@getvda/governance-schema 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AAUjE,MAAM,cAAc,GAAG,mCAAmC,CAAC;AAE3D,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACrD,IAAI,EAAE,GAAsB,EAAE,CAAC;IAC/B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAY,CAAC;QACpD,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACnE,EAAE,GAAG,MAA2B,CAAC;QACnC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,6EAA6E;QAC7E,4DAA4D;QAC5D,EAAE,GAAG,EAAE,CAAC;IACV,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,kBAAkB,GAA6C;IACnE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,gEAAgE,EAAE;IACrF,EAAE,GAAG,EAAE,KAAK,EAA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AAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,IAAwB,EACxB,MAAc;IAEd,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACvD,OAAO;QACL,IAAI;QACJ,WAAW;QACX,IAAI;QACJ,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;QAC7B,YAAY,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QAC/E,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;KAC9B,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
package/dist/set.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * GovernanceSet — a full parsed governance file set, the shared vocabulary the
3
+ * authoring core and the Compliance Guard both operate on.
4
+ *
5
+ * Deliberately provider-free: a set is built from raw sources (map of file name
6
+ * → text), so the Guard can run in CI with nothing but the file contents, and
7
+ * the authoring core can load the same set from git. One type, two loaders.
8
+ */
9
+ import { type GovernanceFileName } from './version.js';
10
+ import { type ComplianceFingerprint } from './validate.js';
11
+ import type { ParsedGovernanceFile } from './types.js';
12
+ export interface GovernanceSetEntry {
13
+ readonly source: string;
14
+ readonly parsed: ParsedGovernanceFile;
15
+ readonly fingerprint: ComplianceFingerprint;
16
+ }
17
+ export interface GovernanceSet {
18
+ readonly files: Readonly<Partial<Record<GovernanceFileName, GovernanceSetEntry>>>;
19
+ }
20
+ /** Raw sources → a parsed, fingerprinted set. Unknown file names are ignored. */
21
+ export declare function buildGovernanceSet(sources: Partial<Record<GovernanceFileName, string>>): GovernanceSet;
22
+ /** The file names actually present in a set. */
23
+ export declare function presentFiles(set: GovernanceSet): GovernanceFileName[];
24
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../src/set.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACnF;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,GACnD,aAAa,CASf;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,kBAAkB,EAAE,CAErE"}
package/dist/set.js ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * GovernanceSet — a full parsed governance file set, the shared vocabulary the
3
+ * authoring core and the Compliance Guard both operate on.
4
+ *
5
+ * Deliberately provider-free: a set is built from raw sources (map of file name
6
+ * → text), so the Guard can run in CI with nothing but the file contents, and
7
+ * the authoring core can load the same set from git. One type, two loaders.
8
+ */
9
+ import { GOVERNANCE_FILE_NAMES } from './version.js';
10
+ import { parseGovernanceFile } from './parse.js';
11
+ import { complianceFingerprint } from './validate.js';
12
+ /** Raw sources → a parsed, fingerprinted set. Unknown file names are ignored. */
13
+ export function buildGovernanceSet(sources) {
14
+ const files = {};
15
+ for (const name of GOVERNANCE_FILE_NAMES) {
16
+ const source = sources[name];
17
+ if (source === undefined)
18
+ continue;
19
+ const parsed = parseGovernanceFile(name, source);
20
+ files[name] = { source, parsed, fingerprint: complianceFingerprint(parsed) };
21
+ }
22
+ return { files };
23
+ }
24
+ /** The file names actually present in a set. */
25
+ export function presentFiles(set) {
26
+ return GOVERNANCE_FILE_NAMES.filter((n) => set.files[n] !== undefined);
27
+ }
28
+ //# sourceMappingURL=set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.js","sourceRoot":"","sources":["../src/set.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,eAAe,CAAC;AAalF,iFAAiF;AACjF,MAAM,UAAU,kBAAkB,CAChC,OAAoD;IAEpD,MAAM,KAAK,GAA4D,EAAE,CAAC;IAC1E,KAAK,MAAM,IAAI,IAAI,qBAAqB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,MAAM,KAAK,SAAS;YAAE,SAAS;QACnC,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC/E,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,YAAY,CAAC,GAAkB;IAC7C,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Governance-file types for the C2MD ⇄ ACP contract.
3
+ *
4
+ * Two confidence tiers, kept explicit so nothing invented masquerades as
5
+ * confirmed (honesty rule #5):
6
+ *
7
+ * CONFIRMED — read directly from C2MD's live public surface. The validator
8
+ * enforces these strictly.
9
+ * PROVISIONAL — a proposed shape for the parts NOT publicly observable (exact
10
+ * frontmatter fields, serialized capability-condition/"ceiling"
11
+ * structure, literal citation embedding). Validated LENIENTLY
12
+ * (warn, never reject) so a real C2MD file whose fields differ is
13
+ * not wrongly failed. Locked once a real bundle is observed
14
+ * (see docs/OPEN-QUESTIONS.md → C2MD change request).
15
+ */
16
+ import type { FrameworkKey, GovernanceFileName } from './version.js';
17
+ /** Normative clause modality — C2MD's SOP.md body grammar. CONFIRMED. */
18
+ export type ClauseModality = 'MUST' | 'MUST NOT' | 'MAY';
19
+ /**
20
+ * A clause-level framework citation. C2MD describes citations as "clause-level"
21
+ * across the known framework set; the STRUCTURE here (framework + clause id) is
22
+ * confirmed-in-intent, the literal on-page SYNTAX is PROVISIONAL.
23
+ */
24
+ export interface Citation {
25
+ readonly framework: FrameworkKey;
26
+ /** Clause / article / control identifier within the framework (e.g. "Art. 14",
27
+ * "AC-2", "9.2"). Free-form because each framework numbers differently. */
28
+ readonly clause: string;
29
+ /** The raw citation text as it appeared, for round-tripping. */
30
+ readonly raw: string;
31
+ }
32
+ /** A single normative clause. In the v4.1 block format the metadata comes from
33
+ * the clause's YAML block; in the legacy inline format only text + citations. */
34
+ export interface NormativeClause {
35
+ readonly modality: ClauseModality;
36
+ readonly text: string;
37
+ readonly citations: readonly Citation[];
38
+ /** 1-based line number in the source body, for authoring diagnostics. */
39
+ readonly line: number;
40
+ /** v4.1: the clause's `confidence` (from its YAML metadata block). */
41
+ readonly confidence?: number;
42
+ /** v4.1: the raw `framework_reference` string the citations were parsed from. */
43
+ readonly frameworkReference?: string;
44
+ }
45
+ export type FileTypeTag = 'AGENTS' | 'SOP' | 'SKILL' | 'EXCEPTION';
46
+ export interface CommonFrontmatter {
47
+ readonly title?: string;
48
+ /** The agent this file governs. (C2MD emits this per file; may be inconsistent.) */
49
+ readonly agent_id?: string;
50
+ /** The file's type discriminator — the real v4.1 marker (NOT a `schema` field). */
51
+ readonly file_type?: FileTypeTag;
52
+ /** C2MD's file-schema version, e.g. "1.0". */
53
+ readonly c2md_schema_version?: string;
54
+ /** Framework NAMES this file draws on, e.g. "EU AI Act", "GDPR". */
55
+ readonly frameworks?: readonly string[];
56
+ readonly jurisdictions?: readonly string[];
57
+ readonly primary_framework?: string;
58
+ /** Per-framework aggregate citation arrays. */
59
+ readonly nist_controls?: readonly string[];
60
+ readonly iso_42001_clauses?: readonly string[];
61
+ readonly eu_ai_act_articles?: readonly string[];
62
+ readonly gdpr_articles?: readonly string[];
63
+ /** Provenance. */
64
+ readonly generated_at?: string;
65
+ readonly generator?: string;
66
+ readonly generator_version?: string;
67
+ readonly tier?: string;
68
+ /** Genesis gate — governance is never AI-alone. */
69
+ readonly human_review_required?: boolean;
70
+ readonly compliance_officer_reviewed?: boolean;
71
+ /** Declared clause counts (C2MD pre-computes these — used for integrity checks). */
72
+ readonly must_count?: number;
73
+ readonly must_not_count?: number;
74
+ readonly may_count?: number;
75
+ readonly agent_role?: string;
76
+ readonly scope_boundary?: string;
77
+ readonly escalation_path?: string;
78
+ readonly risk_category?: string;
79
+ readonly ai_act_classification?: string;
80
+ readonly dpia_required?: boolean;
81
+ readonly fria_required?: boolean;
82
+ readonly conformity_assessment_required?: boolean;
83
+ readonly permitted_tools?: readonly string[];
84
+ readonly forbidden_tools?: readonly string[];
85
+ readonly invocation_conditions?: readonly string[];
86
+ /** Legacy / control-scoped generation fields (older corpus) — kept optional so
87
+ * those files parse too: control_id, baseline, exception_to, etc. */
88
+ readonly control_id?: string;
89
+ readonly schema?: string;
90
+ readonly agent?: string;
91
+ readonly environment?: string;
92
+ readonly version?: string;
93
+ /** Any other key a real file carries. */
94
+ readonly [key: string]: unknown;
95
+ }
96
+ /**
97
+ * A conditioned capability — SKILL.md's "permitted capabilities with
98
+ * conditions". This is the C2MD-native construct the design brief calls a
99
+ * "ceiling". PROVISIONAL serialized shape.
100
+ *
101
+ * NOTE (vocabulary reconciliation): the brief says "ceilings"; C2MD says
102
+ * "permitted capabilities with conditions" and never uses the word "ceiling".
103
+ * This contract adopts C2MD's vocabulary as canonical and treats "ceiling" as an
104
+ * ACP-side synonym for a conditioned capability. See docs/OPEN-QUESTIONS.md.
105
+ */
106
+ export interface ConditionedCapability {
107
+ readonly capability: string;
108
+ /** Conditions that must hold for the capability to be permitted. */
109
+ readonly conditions: readonly string[];
110
+ readonly citations?: readonly Citation[];
111
+ }
112
+ export interface ParsedGovernanceFile {
113
+ readonly name: GovernanceFileName;
114
+ readonly frontmatter: CommonFrontmatter;
115
+ /** Markdown body (everything after the frontmatter block). */
116
+ readonly body: string;
117
+ /** MUST/MUST NOT/MAY clauses parsed from the body (chiefly SOP.md). */
118
+ readonly clauses: readonly NormativeClause[];
119
+ /** Conditioned capabilities parsed from the body (chiefly SKILL.md). */
120
+ readonly capabilities: readonly ConditionedCapability[];
121
+ /** Whether a RACI section was found (required on AGENTS.md — CONFIRMED). */
122
+ readonly hasRaci: boolean;
123
+ }
124
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMrE,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,S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U,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B,yCAAyC;IACzC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC1C;AAMD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B"}
package/dist/types.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Governance-file types for the C2MD ⇄ ACP contract.
3
+ *
4
+ * Two confidence tiers, kept explicit so nothing invented masquerades as
5
+ * confirmed (honesty rule #5):
6
+ *
7
+ * CONFIRMED — read directly from C2MD's live public surface. The validator
8
+ * enforces these strictly.
9
+ * PROVISIONAL — a proposed shape for the parts NOT publicly observable (exact
10
+ * frontmatter fields, serialized capability-condition/"ceiling"
11
+ * structure, literal citation embedding). Validated LENIENTLY
12
+ * (warn, never reject) so a real C2MD file whose fields differ is
13
+ * not wrongly failed. Locked once a real bundle is observed
14
+ * (see docs/OPEN-QUESTIONS.md → C2MD change request).
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Validate a VDA-MD governance file (and file sets) against the contract.
3
+ *
4
+ * Confidence-tiered enforcement:
5
+ * ERRORS — violations of CONFIRMED invariants (taxonomy, RACI on AGENTS.md,
6
+ * SOP.md carries normative clauses, well-formed frontmatter).
7
+ * WARNINGS — deviations from the PROVISIONAL shape (missing schema marker,
8
+ * uncited normative clause, unknown framework, empty SKILL.md).
9
+ * Warnings never fail a file; they harden into errors once the
10
+ * shape is reconciled against a real C2MD bundle.
11
+ *
12
+ * This validator is also the seed of the Phase-1 Compliance Guard: the
13
+ * `complianceFingerprint` it computes is what the Guard diffs across a change to
14
+ * prove a MUST-clause count wasn't weakened and a citation wasn't stripped.
15
+ */
16
+ import { type GovernanceFileName } from './version.js';
17
+ import { splitFrontmatter } from './parse.js';
18
+ import type { ParsedGovernanceFile } from './types.js';
19
+ export type Severity = 'error' | 'warning';
20
+ export interface ValidationIssue {
21
+ readonly severity: Severity;
22
+ readonly code: string;
23
+ readonly message: string;
24
+ readonly file?: GovernanceFileName;
25
+ readonly line?: number;
26
+ }
27
+ export interface ValidationResult {
28
+ readonly valid: boolean;
29
+ readonly issues: readonly ValidationIssue[];
30
+ readonly errors: readonly ValidationIssue[];
31
+ readonly warnings: readonly ValidationIssue[];
32
+ }
33
+ export interface ComplianceFingerprint {
34
+ readonly file: GovernanceFileName;
35
+ readonly mustCount: number;
36
+ readonly mustNotCount: number;
37
+ readonly mayCount: number;
38
+ /** Sorted unique citation refs, e.g. "euAiAct:Art. 14", "nist:AC-2". */
39
+ readonly citationRefs: readonly string[];
40
+ }
41
+ export declare function isGovernanceFileName(name: string): name is GovernanceFileName;
42
+ /** Validate a single governance file by name + raw source. */
43
+ export declare function validateFile(name: string, source: string): ValidationResult;
44
+ /** Validate a full governance set (map of file name → source). */
45
+ export declare function validateSet(files: Partial<Record<GovernanceFileName, string>>): ValidationResult;
46
+ /** Compute the compliance fingerprint the Guard diffs across a change. */
47
+ export declare function complianceFingerprint(parsed: ParsedGovernanceFile): ComplianceFingerprint;
48
+ export { splitFrontmatter };
49
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAMD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,kBAAkB,CAE7E;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CA0H3E;AAED,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,GAAG,gBAAgB,CAwBhG;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,qBAAqB,CAkBzF;AAwBD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Validate a VDA-MD governance file (and file sets) against the contract.
3
+ *
4
+ * Confidence-tiered enforcement:
5
+ * ERRORS — violations of CONFIRMED invariants (taxonomy, RACI on AGENTS.md,
6
+ * SOP.md carries normative clauses, well-formed frontmatter).
7
+ * WARNINGS — deviations from the PROVISIONAL shape (missing schema marker,
8
+ * uncited normative clause, unknown framework, empty SKILL.md).
9
+ * Warnings never fail a file; they harden into errors once the
10
+ * shape is reconciled against a real C2MD bundle.
11
+ *
12
+ * This validator is also the seed of the Phase-1 Compliance Guard: the
13
+ * `complianceFingerprint` it computes is what the Guard diffs across a change to
14
+ * prove a MUST-clause count wasn't weakened and a citation wasn't stripped.
15
+ */
16
+ import { parse as parseYaml } from 'yaml';
17
+ import { CONDITIONAL_FILE_NAMES, FRAMEWORK_KEYS, GOVERNANCE_FILE_NAMES, REQUIRED_FILE_NAMES, } from './version.js';
18
+ import { parseGovernanceFile, splitFrontmatter } from './parse.js';
19
+ function isKnownFramework(k) {
20
+ return FRAMEWORK_KEYS.includes(k);
21
+ }
22
+ export function isGovernanceFileName(name) {
23
+ return GOVERNANCE_FILE_NAMES.includes(name);
24
+ }
25
+ /** Validate a single governance file by name + raw source. */
26
+ export function validateFile(name, source) {
27
+ const issues = [];
28
+ if (!isGovernanceFileName(name)) {
29
+ issues.push({
30
+ severity: 'error',
31
+ code: 'unknown_file',
32
+ message: `"${name}" is not in the VDA-MD taxonomy (${GOVERNANCE_FILE_NAMES.join(', ')}).`,
33
+ });
34
+ return summarize(issues);
35
+ }
36
+ // Frontmatter well-formedness (CONFIRMED: files are md + YAML frontmatter).
37
+ const fmError = checkFrontmatterWellFormed(source);
38
+ if (fmError)
39
+ issues.push({ severity: 'error', code: 'bad_frontmatter', message: fmError, file: name });
40
+ const parsed = parseGovernanceFile(name, source);
41
+ const fm = parsed.frontmatter;
42
+ // Generation marker — any of file_type / c2md_schema_version / control_id / schema.
43
+ const hasMarker = fm.file_type !== undefined ||
44
+ fm.c2md_schema_version !== undefined ||
45
+ fm.control_id !== undefined ||
46
+ fm.schema !== undefined;
47
+ if (!hasMarker) {
48
+ issues.push({
49
+ severity: 'warning',
50
+ code: 'missing_generation_marker',
51
+ message: 'No generation marker (`file_type` + `c2md_schema_version` for v4.1, or `control_id` for the control-scoped generation).',
52
+ file: name,
53
+ });
54
+ }
55
+ // file_type must match the taxonomy filename when present.
56
+ const expectedType = name.replace(/\.md$/, '').toUpperCase();
57
+ if (typeof fm.file_type === 'string' && fm.file_type !== expectedType) {
58
+ issues.push({
59
+ severity: 'error',
60
+ code: 'file_type_mismatch',
61
+ message: `file_type "${fm.file_type}" does not match file ${name} (expected "${expectedType}").`,
62
+ file: name,
63
+ });
64
+ }
65
+ // Count integrity — declared clause counts vs parsed (detects tampering / a
66
+ // stale bundle). Only checked when the file declares them (v4.1 does).
67
+ const declared = [
68
+ ['must_count', 'MUST'],
69
+ ['must_not_count', 'MUST NOT'],
70
+ ['may_count', 'MAY'],
71
+ ];
72
+ for (const [key, modality] of declared) {
73
+ const d = fm[key];
74
+ if (typeof d === 'number') {
75
+ const actual = parsed.clauses.filter((c) => c.modality === modality).length;
76
+ if (actual !== d) {
77
+ issues.push({
78
+ severity: 'error',
79
+ code: 'clause_count_mismatch',
80
+ message: `Declared ${String(key)}=${d} but parsed ${actual} ${modality} clause(s). File may be tampered or malformed.`,
81
+ file: name,
82
+ });
83
+ }
84
+ }
85
+ }
86
+ // File-type-specific CONFIRMED invariants.
87
+ if (name === 'AGENTS.md' && !parsed.hasRaci) {
88
+ issues.push({
89
+ severity: 'error',
90
+ code: 'agents_missing_raci',
91
+ message: 'AGENTS.md must contain a RACI section (identity/scope/RACI). CONFIRMED invariant.',
92
+ file: name,
93
+ });
94
+ }
95
+ if (name === 'SOP.md' && parsed.clauses.length === 0) {
96
+ issues.push({
97
+ severity: 'error',
98
+ code: 'sop_no_clauses',
99
+ message: 'SOP.md must contain MUST / MUST NOT / MAY clauses. CONFIRMED invariant.',
100
+ file: name,
101
+ });
102
+ }
103
+ // Clause-level citations (PROVISIONAL enforcement → warning in draft).
104
+ for (const clause of parsed.clauses) {
105
+ if (clause.modality !== 'MAY' && clause.citations.length === 0) {
106
+ issues.push({
107
+ severity: 'warning',
108
+ code: 'uncited_normative_clause',
109
+ message: `${clause.modality} clause has no framework citation (C2MD emits clause-level citations). Hardens to error once confirmed.`,
110
+ file: name,
111
+ line: clause.line,
112
+ });
113
+ }
114
+ for (const c of clause.citations) {
115
+ if (!isKnownFramework(c.framework)) {
116
+ issues.push({
117
+ severity: 'warning',
118
+ code: 'unknown_framework',
119
+ message: `Citation references unknown framework "${c.framework}".`,
120
+ file: name,
121
+ line: clause.line,
122
+ });
123
+ }
124
+ }
125
+ }
126
+ if (name === 'SKILL.md' && parsed.capabilities.length === 0) {
127
+ issues.push({
128
+ severity: 'warning',
129
+ code: 'skill_no_capabilities',
130
+ message: 'SKILL.md parsed no conditioned capabilities. Provisional serialization.',
131
+ file: name,
132
+ });
133
+ }
134
+ return summarize(issues);
135
+ }
136
+ /** Validate a full governance set (map of file name → source). */
137
+ export function validateSet(files) {
138
+ const issues = [];
139
+ for (const required of REQUIRED_FILE_NAMES) {
140
+ if (files[required] === undefined) {
141
+ issues.push({
142
+ severity: 'error',
143
+ code: 'missing_required_file',
144
+ message: `Governance set is missing required file: ${required}.`,
145
+ file: required,
146
+ });
147
+ }
148
+ }
149
+ for (const [name, source] of Object.entries(files)) {
150
+ if (source === undefined)
151
+ continue;
152
+ const res = validateFile(name, source);
153
+ issues.push(...res.issues);
154
+ }
155
+ // EXCEPTION.md is conditional — its absence is fine, never flagged.
156
+ void CONDITIONAL_FILE_NAMES;
157
+ return summarize(issues);
158
+ }
159
+ /** Compute the compliance fingerprint the Guard diffs across a change. */
160
+ export function complianceFingerprint(parsed) {
161
+ const refs = new Set();
162
+ let must = 0;
163
+ let mustNot = 0;
164
+ let may = 0;
165
+ for (const clause of parsed.clauses) {
166
+ if (clause.modality === 'MUST')
167
+ must++;
168
+ else if (clause.modality === 'MUST NOT')
169
+ mustNot++;
170
+ else
171
+ may++;
172
+ for (const c of clause.citations)
173
+ refs.add(`${c.framework}:${c.clause}`);
174
+ }
175
+ return {
176
+ file: parsed.name,
177
+ mustCount: must,
178
+ mustNotCount: mustNot,
179
+ mayCount: may,
180
+ citationRefs: [...refs].sort(),
181
+ };
182
+ }
183
+ // ── internals ────────────────────────────────────────────────────────────────
184
+ function checkFrontmatterWellFormed(source) {
185
+ const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(source);
186
+ if (!match)
187
+ return null; // no frontmatter block — separately warned via missing_schema_marker
188
+ try {
189
+ const parsed = parseYaml(match[1] ?? '');
190
+ if (parsed !== null && (typeof parsed !== 'object' || Array.isArray(parsed))) {
191
+ return 'Frontmatter must be a YAML mapping.';
192
+ }
193
+ return null;
194
+ }
195
+ catch (e) {
196
+ return `Malformed YAML frontmatter: ${e.message}`;
197
+ }
198
+ }
199
+ function summarize(issues) {
200
+ const errors = issues.filter((i) => i.severity === 'error');
201
+ const warnings = issues.filter((i) => i.severity === 'warning');
202
+ return { valid: errors.length === 0, issues, errors, warnings };
203
+ }
204
+ // re-export splitFrontmatter for callers that only need frontmatter.
205
+ export { splitFrontmatter };
206
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA6BnE,SAAS,gBAAgB,CAAC,CAAS;IACjC,OAAQ,cAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAQ,qBAA2C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAAc;IACvD,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC;YACV,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,IAAI,IAAI,oCAAoC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;SAC1F,CAAC,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,4EAA4E;IAC5E,MAAM,OAAO,GAAG,0BAA0B,CAA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 *
4
+ * RECONCILED against a REAL C2MD v4.1 bundle generated live 2026-07-18 (a neutral
5
+ * org-agnostic customer-service agent, starter tier via generate_compliance_bundle).
6
+ * The real output: taxonomy AGENTS/SOP/SKILL(/EXCEPTION where warranted), a
7
+ * `file_type` + `c2md_schema_version` marker (NOT a `schema` field), per-clause
8
+ * `## MODALITY` + YAML-block metadata carrying `framework_reference` citations,
9
+ * declared clause counts in frontmatter, and rich provenance. The parser +
10
+ * validator model that shape; the control-scoped `control_id`/baseline-exception
11
+ * generation (older corpus) is recognized as a second generation.
12
+ */
13
+ /** ACP's version of THIS contract package (SemVer). Reconciled against one real
14
+ * v4.1 (starter) sample; kept pre-1.0 until a Pro/multi-file sample confirms the
15
+ * fuller shape (see docs/OPEN-QUESTIONS). */
16
+ export declare const CONTRACT_VERSION: "0.2.0";
17
+ /** C2MD's framework-version label (from its card). */
18
+ export declare const VDA_MD_VERSION: "VDA-MD v4.1";
19
+ /** The `c2md_schema_version` value observed in real v4.1 files. */
20
+ export declare const C2MD_SCHEMA_VERSION: "1.0";
21
+ /** The governance files C2MD emits (authoritative taxonomy). EXCEPTION.md is
22
+ * conditional ("emitted where warranted"). */
23
+ export declare const GOVERNANCE_FILE_NAMES: readonly ["AGENTS.md", "SOP.md", "SKILL.md", "EXCEPTION.md"];
24
+ export type GovernanceFileName = (typeof GOVERNANCE_FILE_NAMES)[number];
25
+ export declare const REQUIRED_FILE_NAMES: readonly GovernanceFileName[];
26
+ export declare const CONDITIONAL_FILE_NAMES: readonly GovernanceFileName[];
27
+ /**
28
+ * Source standards a citation may reference, with the exact version anchors
29
+ * C2MD publishes. A `clause-level` citation names one of these frameworks plus a
30
+ * clause/article/control id within it.
31
+ */
32
+ export declare const SOURCE_STANDARDS: {
33
+ readonly nist: "SP 800-53 Rev 5";
34
+ readonly iso: "IEC 42001:2023";
35
+ readonly euAiAct: "Regulation (EU) 2024/1689";
36
+ readonly gdpr: "Regulation (EU) 2016/679";
37
+ readonly apqc: "PCF v7.4";
38
+ };
39
+ export type FrameworkKey = keyof typeof SOURCE_STANDARDS;
40
+ export declare const FRAMEWORK_KEYS: FrameworkKey[];
41
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;8CAE8C;AAC9C,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,sDAAsD;AACtD,eAAO,MAAM,cAAc,EAAG,aAAsB,CAAC;AAErD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAG,KAAc,CAAC;AAElD;+CAC+C;AAC/C,eAAO,MAAM,qBAAqB,8DAA+D,CAAC;AAClG,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB,EAAE,SAAS,kBAAkB,EAI5D,CAAC;AACF,eAAO,MAAM,sBAAsB,EAAE,SAAS,kBAAkB,EAAqB,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,gBAAgB,CAAC;AACzD,eAAO,MAAM,cAAc,EAAoC,YAAY,EAAE,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Version + framework anchors for the shared governance-file schema contract.
3
+ *
4
+ * RECONCILED against a REAL C2MD v4.1 bundle generated live 2026-07-18 (a neutral
5
+ * org-agnostic customer-service agent, starter tier via generate_compliance_bundle).
6
+ * The real output: taxonomy AGENTS/SOP/SKILL(/EXCEPTION where warranted), a
7
+ * `file_type` + `c2md_schema_version` marker (NOT a `schema` field), per-clause
8
+ * `## MODALITY` + YAML-block metadata carrying `framework_reference` citations,
9
+ * declared clause counts in frontmatter, and rich provenance. The parser +
10
+ * validator model that shape; the control-scoped `control_id`/baseline-exception
11
+ * generation (older corpus) is recognized as a second generation.
12
+ */
13
+ /** ACP's version of THIS contract package (SemVer). Reconciled against one real
14
+ * v4.1 (starter) sample; kept pre-1.0 until a Pro/multi-file sample confirms the
15
+ * fuller shape (see docs/OPEN-QUESTIONS). */
16
+ export const CONTRACT_VERSION = '0.2.0';
17
+ /** C2MD's framework-version label (from its card). */
18
+ export const VDA_MD_VERSION = 'VDA-MD v4.1';
19
+ /** The `c2md_schema_version` value observed in real v4.1 files. */
20
+ export const C2MD_SCHEMA_VERSION = '1.0';
21
+ /** The governance files C2MD emits (authoritative taxonomy). EXCEPTION.md is
22
+ * conditional ("emitted where warranted"). */
23
+ export const GOVERNANCE_FILE_NAMES = ['AGENTS.md', 'SOP.md', 'SKILL.md', 'EXCEPTION.md'];
24
+ export const REQUIRED_FILE_NAMES = [
25
+ 'AGENTS.md',
26
+ 'SOP.md',
27
+ 'SKILL.md',
28
+ ];
29
+ export const CONDITIONAL_FILE_NAMES = ['EXCEPTION.md'];
30
+ /**
31
+ * Source standards a citation may reference, with the exact version anchors
32
+ * C2MD publishes. A `clause-level` citation names one of these frameworks plus a
33
+ * clause/article/control id within it.
34
+ */
35
+ export const SOURCE_STANDARDS = {
36
+ nist: 'SP 800-53 Rev 5',
37
+ iso: 'IEC 42001:2023',
38
+ euAiAct: 'Regulation (EU) 2024/1689',
39
+ gdpr: 'Regulation (EU) 2016/679',
40
+ apqc: 'PCF v7.4',
41
+ };
42
+ export const FRAMEWORK_KEYS = Object.keys(SOURCE_STANDARDS);
43
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;8CAE8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAgB,CAAC;AAEjD,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAsB,CAAC;AAErD,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAc,CAAC;AAElD;+CAC+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAU,CAAC;AAGlG,MAAM,CAAC,MAAM,mBAAmB,GAAkC;IAChE,WAAW;IACX,QAAQ;IACR,UAAU;CACX,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAkC,CAAC,cAAc,CAAC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,iBAAiB;IACvB,GAAG,EAAE,gBAAgB;IACrB,OAAO,EAAE,2BAA2B;IACpC,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,UAAU;CACR,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAmB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@getvda/governance-schema",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "The shared governance-file schema contract (C2MD ⇄ ACP). VDA-MD governance files: taxonomy, MUST/MUST NOT/MAY clause grammar, clause-level citations, RACI. Versioned first-class artifact.",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "scripts": {
10
+ "build": "tsc --build",
11
+ "typecheck": "tsc --noEmit",
12
+ "test": "vitest run"
13
+ },
14
+ "dependencies": {
15
+ "yaml": "^2.6.1"
16
+ },
17
+ "license": "Apache-2.0",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md",
24
+ "LICENSE",
25
+ "NOTICE"
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/getvda-ai/acp-agent.git",
30
+ "directory": "packages/governance-schema"
31
+ },
32
+ "homepage": "https://getvda.ai"
33
+ }