/** * Compliance pack validation. * * The whole pack is validated before any part of it is installed, and every * problem is collected rather than the first one thrown. A pack with one * malformed control installs nothing — a partially installed pack is worse than * an absent one, because it looks like a working install. * * Absence is never a default. Every field named in the schema must be present, so * an omitted `reviewed_by` cannot quietly read as "reviewed", and an omitted * `kind` cannot quietly read as `checked-only`. * * Two bounds exist for one reason: **pack text becomes instructions an agent * executes.** Control text is rendered into a review prompt, and a constraint * layer is copied to disk and read on every phase. Both are bounded in length and * both reject `{{` placeholder syntax, because placeholder resolution runs the * guidance pass before the glossary pass deliberately — so a `{{glossary:...}}` * inside a layer body would expand when inlined. Bounding the input closes that at * the source rather than relying on the delivery mechanism to make it unreachable. * * Requirements: compliance-packs/AC-1, AC-2, AC-3, AC-4, AC-5, AC-7, AC-65, AC-105 */ import type { Pack } from './types.js'; /** * Maximum characters in any single control prose field. * * Sized to hold a full regime clause and its fail condition comfortably while * ruling out a smuggled instruction block. The shipped SOC 2 pack's longest field * is well under half of this. */ export declare const MAX_CONTROL_FIELD_CHARS = 1000; /** Maximum characters across all of a pack's control text. */ export declare const MAX_PACK_CONTROL_CHARS = 40000; /** Maximum characters in a single constraint-layer body. */ export declare const MAX_LAYER_BODY_CHARS = 20000; /** Maximum characters across all of a pack's constraint-layer bodies. */ export declare const MAX_PACK_LAYER_CHARS = 60000; /** * Maximum characters in one `asked_for_as` name. A name, not a sentence: it is printed * inside a one-line picker hint (ssae-soc1-mapping/AC-7). */ export declare const MAX_ASKED_FOR_AS_CHARS = 40; /** * The notice a pack with `reviewed_by: null` must carry in its constraint text. * * Matched case-insensitively as a substring, so a pack may word the surrounding * sentence freely. Held in three places — here, the report generator, and a doctor * check — because a notice that lives only in installed text can be edited away * permanently, since a locally edited layer is preserved forever by design. */ export declare const UNREVIEWED_NOTICE = "not been reviewed by a compliance practitioner"; /** The raw text of a pack, as read from disk by the resolver. */ export interface PackSources { /** Pack directory name, which the metadata's `id` must match. */ id: string; /** Contents of `pack.yaml`. */ packYaml: string; /** Contents of `controls.yaml`. */ controlsYaml: string; /** Layer file name → body, for every layer the pack registers. */ layerBodies: Map; } /** Outcome of validating a pack. Every problem, not just the first. */ export type PackValidation = { ok: true; pack: Pack; } | { ok: false; errors: string[]; }; /** * Validate a whole pack from its raw sources. * * Pure: takes text, returns a verdict, touches no filesystem. The resolver does * the reading and the containment checks; this decides whether the content is * usable. Nothing is installed unless this returns `ok`. */ export declare function validatePack(sources: PackSources): PackValidation; //# sourceMappingURL=schema.d.ts.map