@inventarch/compliance 3.6.0 → 3.7.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.
package/SPEC.md CHANGED
@@ -80,6 +80,14 @@ C21 (database admission integration). The report assembler may receive prior fai
80
80
 
81
81
  C21 delivered with the database view builder: report options accept prior non-pass admission observations, coalesce identical check/scope at the worst outcome and deduplicate findings. Candidate-only passes are ignored. The regression test retains removed-subject evidence without duplicate verdicts.
82
82
 
83
+ The canon file rules (C12, A6 and C6, which read the checkout) enter through their own option, `canonFiles`, which is not filtered: a warning-only assessment passes, and its findings and its passing verdict both reach the report, so an advisory file law is seen and reads enforced. The `admission` filter above is unchanged.
84
+
85
+ Canon kit detection (`isKitWorkspace`, read by C4, C5a, C6 and A6) is heuristic. A kit is the one system whose `records/plugin.ia` authors a product `@distribution`, or a `@distribution` under `.ia/src/systems/<n>/records/` that lists `@system` records, or lists only `@workspace` records while `<n>`'s `@system` declares no discriminators. A vocabulary system's `@workspace`-only distribution, such as the foundation's `workspace-system`, is not a kit. An unmigrated `ia init` 1.1.0 workspace (`.ia/src/systems/<n>/records/workspace.ia` plus a `@distribution` listing `[@workspace <n>]`, with a wordless system) cannot be told apart from a `@workspace`-only kit. Explicit kit designation in the language is pending.
86
+
87
+ E4's evaluator (`canonLocalTightening`, CANON-LOCAL-TIGHTEN) checks only the verifiable half of law canon-e4-local-tighten. It judges a local `@law` or `@convention` that cites a canon law, which is a resolved `cites` edge to a law under `.ia/src/systems/<s>/records/canon/`, authored or installed under the store prefix. The citing rule must govern the cited law's `subject.subject-word` and be at least as strong as it (informational < advisory < blocking). When the cited canon law has no subject word, only the severity is judged. A local rule that cites no canon law is not judged, whatever its subject word. The law also asks that a rule that tightens a canon law cite it, but that half cannot be detected by a machine: sharing a subject word is no evidence that a rule tightens a canon law. That half is left to review.
88
+
89
+ Canon findings never refuse an installation. `refusesInstallation(finding)` is true for every error except one whose code is in `CANON_CODES` (the `IA-COMP-CANON-*` codes, from record rules or `canonFiles`). The distribution install paths use it as their refusal predicate (install, update, restore and adopt, with the archive and closure checks they run). A canon law therefore stops work only through `ia validate` and `ia preview`, where its findings keep their severity, and a consumer can always install the release it then fails to validate.
90
+
83
91
  C22–C24 (the host projection renderers renderHostArtifacts and renderWorkspaceProjection, their ProjectionMembership input, the steward composition behind them and the IA-COMP-PROJECTION-INVALID refusal) were retired on 2026-10-09. The position packet and its claude and codex adapters replace them in @inventarch/runtime (runtime SPEC R19 and R20), and the CLI and tools/projections render through those. Compliance exports no projection API, no projection marker and no steward host table, and the ids C22–C24 are not reused.
84
92
 
85
93
  ## Trusted evaluator catalog, obligations and evidence (producer side)
@@ -0,0 +1,33 @@
1
+ import type { Graph, Node } from '@inventarch/graph';
2
+ import type { Severity } from '@inventarch/language';
3
+ import type { Finding, Verdict } from '../types.js';
4
+ export type LawState = 'enforced' | 'pending' | 'not-evaluated' | 'suspended';
5
+ export type LawSeverity = 'blocking' | 'advisory' | 'informational';
6
+ export interface LawStatus {
7
+ readonly identity: string;
8
+ readonly severity: LawSeverity;
9
+ readonly state: LawState;
10
+ /** Identities of the checks enforcing the law. */
11
+ readonly checks: readonly string[];
12
+ /** Identity of the suspending improvement, else null. */
13
+ readonly suspendedBy: string | null;
14
+ }
15
+ export declare const SEVERITY_ORDER: Readonly<Record<LawSeverity, number>>;
16
+ export declare const lawSeverity: (law: Node) => LawSeverity;
17
+ export declare function lawStatuses(nodes: readonly Node[], verdicts: readonly Verdict[], graph?: Graph): readonly LawStatus[];
18
+ /**
19
+ * The severity a built-in canon check reports at: the strongest of the laws enforcing a check that runs `checkId`.
20
+ * Blocking gives error, advisory gives warning, and a suspended law gives warning. A blocking law gives error only when
21
+ * every check enforcing it runs a built-in id; while any of them does not (6c-3: an evaluation this run cannot make
22
+ * does not block), it gives warning. Null leaves the check inactive.
23
+ */
24
+ export declare function canonSeverity(nodes: readonly Node[], checkId: string, graph?: Graph): Severity | null;
25
+ /** The codes the built-in canon checks report, from records (canonAssessments) or the checkout (`canonFiles`). */
26
+ export declare const CANON_CODES: ReadonlySet<string>;
27
+ /**
28
+ * Whether a finding refuses an installation (`ia install`, `ia update`, `ia restore`, `ia adopt` and the archive and
29
+ * closure checks they run): every error except a canon finding. A canon law stops work through `ia validate` and
30
+ * `ia preview` only (dec-006 6b), so a consumer can always install the release it then fails to validate.
31
+ */
32
+ export declare const refusesInstallation: (finding: Pick<Finding, "code" | "severity">) => boolean;
33
+ //# sourceMappingURL=laws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"laws.d.ts","sourceRoot":"","sources":["../../src/canon/laws.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,eAAe,GAAG,WAAW,CAAC;AAC9E,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;AACpE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAkD,CAAC;AACpH,eAAO,MAAM,WAAW,GAAI,KAAK,IAAI,KAAG,WAGvC,CAAC;AAiCF,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,SAAS,EAAE,CAuBrH;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI,CAqBrG;AAED,kHAAkH;AAClH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAA2E,CAAC;AAExH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC,KAAG,OAClB,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { isBuiltinCheck } from '../check-ids.js';
2
+ import { checkRunner, textField } from '../graph-checks.js';
3
+ import { COMP_CODES } from '../types.js';
4
+ export const SEVERITY_ORDER = { informational: 0, advisory: 1, blocking: 2 };
5
+ export const lawSeverity = (law) => {
6
+ const text = textField(law, 'governance', 'severity');
7
+ return text === 'blocking' || text === 'advisory' ? text : 'informational';
8
+ };
9
+ /**
10
+ * The identities of the checks enforcing `law`. With the graph, only its resolved `enforce` edges count (from the check
11
+ * to the law); without one, the node edges' own targets, on either side.
12
+ */
13
+ function enforcingChecks(nodes, law, graph) {
14
+ const found = new Set();
15
+ if (graph !== undefined) {
16
+ for (const edge of graph.edges)
17
+ if (edge.predicate === 'enforce' && edge.to === law.identity && edge.from !== null)
18
+ found.add(edge.from);
19
+ return [...found].sort();
20
+ }
21
+ for (const edge of law.edges)
22
+ if (edge.predicate === 'enforce' && edge.direction === 'in' && edge.target !== null)
23
+ found.add(edge.target);
24
+ for (const node of nodes)
25
+ if (node.discriminator === 'check')
26
+ for (const edge of node.edges)
27
+ if (edge.predicate === 'enforce' && edge.direction === 'out' && edge.target === law.identity)
28
+ found.add(node.identity);
29
+ return [...found].sort();
30
+ }
31
+ /** The improvement that suspends `law`: its proposal.target is the law's identity and its review.status is suspended. */
32
+ function suspension(nodes, law) {
33
+ return nodes.find((node) => node.discriminator === 'improvement' &&
34
+ textField(node, 'proposal', 'target') === law.identity &&
35
+ textField(node, 'review', 'status') === 'suspended');
36
+ }
37
+ export function lawStatuses(nodes, verdicts, graph) {
38
+ const byIdentity = new Map(nodes.map((node) => [node.identity, node]));
39
+ const evaluated = new Set(verdicts.filter((v) => v.outcome !== 'not-evaluated').map((v) => v.check));
40
+ return nodes
41
+ .filter((node) => node.discriminator === 'law')
42
+ .map((law) => {
43
+ const checks = enforcingChecks(nodes, law, graph), suspendedBy = suspension(nodes, law)?.identity ?? null, runners = checks.map((id) => {
44
+ const check = byIdentity.get(id);
45
+ return check === undefined ? undefined : checkRunner(check);
46
+ }), state = suspendedBy !== null
47
+ ? 'suspended'
48
+ : checks.length === 0
49
+ ? 'pending'
50
+ : runners.every((runner) => runner !== undefined && isBuiltinCheck(runner) && evaluated.has(runner))
51
+ ? 'enforced'
52
+ : 'not-evaluated';
53
+ return { identity: law.identity, severity: lawSeverity(law), state, checks, suspendedBy };
54
+ })
55
+ .sort((a, b) => (a.identity < b.identity ? -1 : a.identity > b.identity ? 1 : 0));
56
+ }
57
+ /**
58
+ * The severity a built-in canon check reports at: the strongest of the laws enforcing a check that runs `checkId`.
59
+ * Blocking gives error, advisory gives warning, and a suspended law gives warning. A blocking law gives error only when
60
+ * every check enforcing it runs a built-in id; while any of them does not (6c-3: an evaluation this run cannot make
61
+ * does not block), it gives warning. Null leaves the check inactive.
62
+ */
63
+ export function canonSeverity(nodes, checkId, graph) {
64
+ let strongest = 'informational';
65
+ let suspended = false;
66
+ const runnerOf = (id) => {
67
+ const check = nodes.find((node) => node.identity === id);
68
+ return check === undefined ? undefined : checkRunner(check);
69
+ };
70
+ for (const law of nodes) {
71
+ if (law.discriminator !== 'law')
72
+ continue;
73
+ const runners = enforcingChecks(nodes, law, graph).map(runnerOf);
74
+ if (!runners.includes(checkId))
75
+ continue;
76
+ let severity = lawSeverity(law);
77
+ if (severity === 'informational')
78
+ continue;
79
+ if (severity === 'blocking' && !runners.every((runner) => runner !== undefined && isBuiltinCheck(runner)))
80
+ severity = 'advisory';
81
+ if (suspension(nodes, law) !== undefined)
82
+ suspended = true;
83
+ else if (SEVERITY_ORDER[severity] > SEVERITY_ORDER[strongest])
84
+ strongest = severity;
85
+ }
86
+ if (strongest === 'blocking')
87
+ return 'error';
88
+ if (strongest === 'advisory' || suspended)
89
+ return 'warning';
90
+ return null;
91
+ }
92
+ /** The codes the built-in canon checks report, from records (canonAssessments) or the checkout (`canonFiles`). */
93
+ export const CANON_CODES = new Set(COMP_CODES.filter((code) => code.startsWith('IA-COMP-CANON-')));
94
+ /**
95
+ * Whether a finding refuses an installation (`ia install`, `ia update`, `ia restore`, `ia adopt` and the archive and
96
+ * closure checks they run): every error except a canon finding. A canon law stops work through `ia validate` and
97
+ * `ia preview` only (dec-006 6b), so a consumer can always install the release it then fails to validate.
98
+ */
99
+ export const refusesInstallation = (finding) => finding.severity === 'error' && !CANON_CODES.has(finding.code);
100
+ //# sourceMappingURL=laws.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"laws.js","sourceRoot":"","sources":["../../src/canon/laws.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAezC,MAAM,CAAC,MAAM,cAAc,GAA0C,EAAE,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AACpH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAS,EAAe,EAAE;IACpD,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IACtD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2C,EAAW,EAAE,CAC1F,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { Graph, Node } from '@inventarch/graph';
2
+ import type { SystemFolder } from '../systems.js';
3
+ import type { Assessment, Finding } from '../types.js';
4
+ /**
5
+ * A14: work records inside a vocabulary system's folder `.ia/src/systems/<name>/`, one whose `@system` declares
6
+ * discriminators. A wordless method system's folder is not a vocabulary payload. The caller sets the severity.
7
+ */
8
+ export declare function canonWorkPlacement(nodes: readonly Node[]): readonly Finding[];
9
+ /**
10
+ * True when the workspace is a kit: either exactly one system has `records/plugin.ia` authoring a product `@distribution`,
11
+ * or a `@distribution` authored under `.ia/src/systems/<name>/records/` lists one or more `@system` or `@workspace`
12
+ * records.
13
+ */
14
+ export declare function isKitWorkspace(nodes: readonly Node[]): boolean;
15
+ /**
16
+ * The kit systems that execute (dec-040 A): a kit system whose records include an `@execution-binding`. Their folders
17
+ * `.ia/src/systems/<name>/` may hold scripts.
18
+ */
19
+ export declare function executingKitSystems(nodes: readonly Node[]): readonly string[];
20
+ /** C4: in a kit, each method system declares no discriminators and requires the owner of every word its records use. */
21
+ export declare function canonKitMethodWords(nodes: readonly Node[], folders: readonly SystemFolder[] | undefined): readonly Finding[];
22
+ /**
23
+ * C5a: in a kit, each shipped `@workspace` (see `shippedWorkspaces`) has no `composition.steward` and no
24
+ * `composition.sources`. The kit's own seat workspace is not shipped, so it is not checked.
25
+ */
26
+ export declare function canonKitWorkspace(nodes: readonly Node[]): readonly Finding[];
27
+ /**
28
+ * E5: a mandate citing a mandate allows no move and covers no path the cited mandate does not. Each `covers` selection
29
+ * must lie within one of the cited mandate's, read in the graph's path selection dialect (`selectionWithin`, G06c).
30
+ */
31
+ export declare function canonMandateNarrowing(nodes: readonly Node[], graph?: Graph): readonly Finding[];
32
+ /**
33
+ * E4, its verifiable half: a local law or convention that cites a canon law (a resolved `cites` edge to a law under a
34
+ * `records/canon/` folder) governs that law's subject word and is at least as strong (informational < advisory <
35
+ * blocking). The law also asks that a rule tightening a canon law cite it; subject-word equality is no evidence that a
36
+ * rule tightens one, so an uncited rule is not judged here and that half is left to review.
37
+ */
38
+ export declare function canonLocalTightening(nodes: readonly Node[], graph?: Graph): readonly Finding[];
39
+ /**
40
+ * One built-in canon check as an assessment: null while no law enforces a check that runs `id`, else its findings at the
41
+ * severity the law sets. `find` runs only when the check is active, so a rule that reads files reads none while inactive.
42
+ */
43
+ export declare function canonAssessment(nodes: readonly Node[], id: string, find: () => readonly Finding[], graph?: Graph): Assessment | null;
44
+ /**
45
+ * The built-in canon rules, each active only when a law enforces a check that runs it. The law sets the severity;
46
+ * an inactive rule reports nothing. `folders` is read by the rules that look at system folders.
47
+ */
48
+ export declare function canonAssessments(nodes: readonly Node[], folders: readonly SystemFolder[] | undefined, graph?: Graph): readonly Assessment[];
49
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/canon/rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AA2BvD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,OAAO,EAAE,CAiB7E;AAwED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAE9D;AAkBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,MAAM,EAAE,CAO7E;AAkBD,wHAAwH;AACxH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GAC3C,SAAS,OAAO,EAAE,CA6CpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,OAAO,EAAE,CAc5E;AAoBD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,OAAO,EAAE,CA8B/F;AASD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,OAAO,EAAE,CAkC9F;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,SAAS,OAAO,EAAE,EAC9B,KAAK,CAAC,EAAE,KAAK,GACZ,UAAU,GAAG,IAAI,CASnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,EAC5C,KAAK,CAAC,EAAE,KAAK,GACZ,SAAS,UAAU,EAAE,CAEvB"}
@@ -0,0 +1,341 @@
1
+ import { selectionWithin } from '@inventarch/graph';
2
+ import { assess } from '../types.js';
3
+ import { fields, textField } from '../graph-checks.js';
4
+ import { SEVERITY_ORDER, canonSeverity, lawSeverity } from './laws.js';
5
+ const WORK_INSTANCES = new Set(['plan', 'milestone', 'task', 'decision', 'spec']);
6
+ const SYSTEM_FOLDER = /^\.ia\/src\/systems\/([^/]+)\//;
7
+ /** The `@system` of the folder `.ia/src/systems/<folder>/`: the one authored in it, else the one named `<folder>`. */
8
+ function folderSystems(nodes, folder) {
9
+ const systems = nodes.filter((node) => node.discriminator === 'system');
10
+ const inside = systems.filter((s) => posix(s.source.path).startsWith(`.ia/src/systems/${folder}/`));
11
+ return inside.length > 0 ? inside : systems.filter((s) => s.name === folder);
12
+ }
13
+ const mintsWords = (systems) => systems.some((s) => sectionKeys(s, 'discriminators').length > 0);
14
+ /** The system folders `.ia/src/systems/<name>/` whose `@system` declares discriminators, so mints words. */
15
+ function vocabularyFolders(nodes) {
16
+ const folders = new Set();
17
+ for (const node of nodes) {
18
+ const match = SYSTEM_FOLDER.exec(posix(node.source.path));
19
+ if (match !== null)
20
+ folders.add(match[1]);
21
+ }
22
+ return new Set([...folders].filter((folder) => mintsWords(folderSystems(nodes, folder))));
23
+ }
24
+ /**
25
+ * A14: work records inside a vocabulary system's folder `.ia/src/systems/<name>/`, one whose `@system` declares
26
+ * discriminators. A wordless method system's folder is not a vocabulary payload. The caller sets the severity.
27
+ */
28
+ export function canonWorkPlacement(nodes) {
29
+ const vocabulary = vocabularyFolders(nodes);
30
+ return nodes
31
+ .filter((node) => {
32
+ if (!WORK_INSTANCES.has(node.discriminator))
33
+ return false;
34
+ const match = SYSTEM_FOLDER.exec(posix(node.source.path));
35
+ return match !== null && vocabulary.has(match[1]);
36
+ })
37
+ .map((node) => ({
38
+ code: 'IA-COMP-CANON-WORK-PLACEMENT',
39
+ path: node.source.path,
40
+ line: node.source.line,
41
+ severity: 'error',
42
+ message: `${node.source.path}:${node.source.line}: Repository plans, milestones, tasks, decisions and specifications belong in workspace-authored records, outside reusable vocabulary system payloads.`,
43
+ }));
44
+ }
45
+ const posix = (path) => path.split(String.fromCharCode(92)).join('/');
46
+ const PLUGIN_RECORDS = /^\.ia\/src\/systems\/([^/]+)\/records\/plugin\.ia$/;
47
+ const SYSTEM_RECORDS = /^\.ia\/src\/systems\/([^/]+)\/records\/[^/]+$/;
48
+ /** The kit's seat workspace: the repository's own, which a kit never ships. */
49
+ const SEAT_WORKSPACE = '.ia/src/workspace.ia';
50
+ const NO_KIT = { systems: [], distributions: [] };
51
+ /** The names of the `@<discriminator>` references a distribution's `distribution.records` lists. */
52
+ function listed(distribution, discriminator) {
53
+ const names = [];
54
+ for (const field of fields(distribution, 'distribution', 'records'))
55
+ if (field.value.kind === 'list')
56
+ for (const item of field.value.items)
57
+ if (item.kind === 'ref' && item.discriminator === discriminator)
58
+ names.push(item.name);
59
+ return names;
60
+ }
61
+ /** Form (a): the one system whose `records/plugin.ia` authors a product `@distribution` (host-plugin-distribution section 12). */
62
+ function loweredKit(nodes) {
63
+ const found = new Map();
64
+ for (const node of nodes) {
65
+ if (node.discriminator !== 'distribution' || !node.sections.some((s) => s.name === 'product'))
66
+ continue;
67
+ const match = PLUGIN_RECORDS.exec(posix(node.source.path));
68
+ if (match !== null)
69
+ found.set(match[1], [...(found.get(match[1]) ?? []), node]);
70
+ }
71
+ if (found.size !== 1)
72
+ return NO_KIT;
73
+ const [system, distributions] = [...found][0];
74
+ return { systems: [system], distributions };
75
+ }
76
+ /**
77
+ * Form (b): a `@distribution` authored under `.ia/src/systems/<n>/records/` whose `distribution.records` lists `@system`
78
+ * or `@workspace` records. Its kit systems are the `@system`s it lists. One listing only `@workspace`s (as ia-brand,
79
+ * ia-design, ia-ui and ia-ux ship) makes `<n>`, the system folder holding it, the kit system, but only when that folder's
80
+ * `@system` declares no discriminators: a vocabulary system's `@workspace`-only distribution (the foundation's
81
+ * `workspace-system`) is not a kit. A folder with no `@system` is not one either. The detection is heuristic.
82
+ */
83
+ const wordless = (nodes, folder) => {
84
+ const systems = folderSystems(nodes, folder);
85
+ return systems.length > 0 && !mintsWords(systems);
86
+ };
87
+ function nativeKit(nodes) {
88
+ const systems = new Set();
89
+ const distributions = [];
90
+ for (const node of nodes) {
91
+ if (node.discriminator !== 'distribution')
92
+ continue;
93
+ const match = SYSTEM_RECORDS.exec(posix(node.source.path));
94
+ if (match === null)
95
+ continue;
96
+ const named = listed(node, 'system');
97
+ if (named.length > 0)
98
+ for (const name of named)
99
+ systems.add(name);
100
+ else if (listed(node, 'workspace').length > 0 && wordless(nodes, match[1]))
101
+ systems.add(match[1]);
102
+ else
103
+ continue;
104
+ distributions.push(node);
105
+ }
106
+ return { systems: [...systems].sort(), distributions };
107
+ }
108
+ /** The kit: the single section 12 system, else the systems native release distributions name. */
109
+ function kitOf(nodes) {
110
+ const lowered = loweredKit(nodes);
111
+ return lowered.systems.length > 0 ? lowered : nativeKit(nodes);
112
+ }
113
+ const kitSystems = (nodes) => kitOf(nodes).systems;
114
+ /**
115
+ * True when the workspace is a kit: either exactly one system has `records/plugin.ia` authoring a product `@distribution`,
116
+ * or a `@distribution` authored under `.ia/src/systems/<name>/records/` lists one or more `@system` or `@workspace`
117
+ * records.
118
+ */
119
+ export function isKitWorkspace(nodes) {
120
+ return kitSystems(nodes).length > 0;
121
+ }
122
+ /**
123
+ * The `@workspace` records a kit ships: those its kit distributions list in `distribution.records`, and those authored
124
+ * under a kit system's folder `.ia/src/systems/<kit system>/`. Never the seat `.ia/src/workspace.ia`, which stays home.
125
+ */
126
+ function shippedWorkspaces(nodes) {
127
+ const kit = kitOf(nodes);
128
+ if (kit.systems.length === 0)
129
+ return [];
130
+ const names = new Set(kit.distributions.flatMap((d) => listed(d, 'workspace')));
131
+ return nodes.filter((node) => {
132
+ if (node.discriminator !== 'workspace')
133
+ return false;
134
+ const path = posix(node.source.path);
135
+ if (path === SEAT_WORKSPACE)
136
+ return false;
137
+ return names.has(node.name) || kit.systems.some((system) => path.startsWith(`.ia/src/systems/${system}/`));
138
+ });
139
+ }
140
+ /**
141
+ * The kit systems that execute (dec-040 A): a kit system whose records include an `@execution-binding`. Their folders
142
+ * `.ia/src/systems/<name>/` may hold scripts.
143
+ */
144
+ export function executingKitSystems(nodes) {
145
+ return kitSystems(nodes).filter((name) => nodes.some((node) => node.discriminator === 'execution-binding' && posix(node.source.path).startsWith(`.ia/src/systems/${name}/`)));
146
+ }
147
+ const METHOD_WORDS = new Set([
148
+ 'capability',
149
+ 'playbook',
150
+ 'convention',
151
+ 'principle',
152
+ 'law',
153
+ 'agent-profile',
154
+ ]);
155
+ const systemNode = (nodes, name) => nodes.find((node) => node.discriminator === 'system' && node.name === name);
156
+ const sectionKeys = (node, section) => node.sections
157
+ .filter((s) => s.name === section)
158
+ .flatMap((s) => s.fields.map((f) => ('key' in f ? f.key : f.item.kind === 'scalar' ? f.item.text : '')));
159
+ /** C4: in a kit, each method system declares no discriminators and requires the owner of every word its records use. */
160
+ export function canonKitMethodWords(nodes, folders) {
161
+ const found = [];
162
+ const report = (path, line, message) => {
163
+ found.push({
164
+ code: 'IA-COMP-CANON-KIT-WORDS',
165
+ path,
166
+ line,
167
+ severity: 'error',
168
+ message: `${path}:${line}: ${message}`,
169
+ });
170
+ };
171
+ const owners = new Map();
172
+ for (const node of nodes)
173
+ if (node.discriminator === 'system')
174
+ for (const word of sectionKeys(node, 'discriminators'))
175
+ owners.set(word, node.name);
176
+ for (const kit of kitSystems(nodes)) {
177
+ const folder = folders?.find((f) => f.name === kit);
178
+ const used = new Map();
179
+ const record = (word, path, line) => {
180
+ if (!used.has(word))
181
+ used.set(word, { path, line });
182
+ };
183
+ if (folder !== undefined)
184
+ for (const r of folder.records)
185
+ record(r.discriminator, r.source.path, r.source.line);
186
+ else
187
+ for (const node of nodes)
188
+ if (posix(node.source.path).startsWith(`.ia/src/systems/${kit}/`))
189
+ record(node.discriminator, node.source.path, node.source.line);
190
+ if (![...used.keys()].some((word) => METHOD_WORDS.has(word)))
191
+ continue;
192
+ const method = systemNode(nodes, kit);
193
+ if (method !== undefined) {
194
+ const minted = sectionKeys(method, 'discriminators');
195
+ if (minted.length > 0)
196
+ report(method.source.path, method.source.line, `Kit system ${kit} declares ${minted.join(', ')}; a kit method system mints no words and requires the system that owns each word it uses.`);
197
+ }
198
+ const required = new Set(method === undefined ? [] : sectionKeys(method, 'requires'));
199
+ for (const [word, where] of [...used].sort(([x], [y]) => (x < y ? -1 : x > y ? 1 : 0))) {
200
+ const owner = owners.get(word);
201
+ if (owner !== undefined && owner !== kit && !required.has(owner))
202
+ report(where.path, where.line, `Kit system ${kit} uses ${word} but does not require ${owner}, which owns it.`);
203
+ }
204
+ }
205
+ return found;
206
+ }
207
+ /**
208
+ * C5a: in a kit, each shipped `@workspace` (see `shippedWorkspaces`) has no `composition.steward` and no
209
+ * `composition.sources`. The kit's own seat workspace is not shipped, so it is not checked.
210
+ */
211
+ export function canonKitWorkspace(nodes) {
212
+ const found = [];
213
+ for (const node of shippedWorkspaces(nodes)) {
214
+ for (const key of ['steward', 'sources'])
215
+ for (const field of fields(node, 'composition', key))
216
+ found.push({
217
+ code: 'IA-COMP-CANON-KIT-WORKSPACE',
218
+ path: node.source.path,
219
+ line: field.span.line,
220
+ severity: 'error',
221
+ message: `${node.source.path}:${field.span.line}: A kit workspace declares no composition.${key}; the host workspace supplies it.`,
222
+ });
223
+ }
224
+ return found;
225
+ }
226
+ /** The identities `node` cites. With the graph, only its resolved `cite` edges count; without one, its edges' own targets. */
227
+ function citedBy(node, graph) {
228
+ const found = new Set();
229
+ if (graph !== undefined) {
230
+ for (const edge of graph.edges)
231
+ if (edge.predicate === 'cite' && edge.from === node.identity && edge.to !== null)
232
+ found.add(edge.to);
233
+ }
234
+ else
235
+ for (const edge of node.edges)
236
+ if (edge.predicate === 'cite' && edge.direction === 'out' && edge.target !== null)
237
+ found.add(edge.target);
238
+ return found;
239
+ }
240
+ /** The text of each non-reference item of a list field. */
241
+ const listTexts = (node, section, key) => fields(node, section, key).flatMap((field) => field.value.kind === 'list' ? field.value.items.flatMap((item) => ('text' in item ? [item.text] : [])) : []);
242
+ /**
243
+ * E5: a mandate citing a mandate allows no move and covers no path the cited mandate does not. Each `covers` selection
244
+ * must lie within one of the cited mandate's, read in the graph's path selection dialect (`selectionWithin`, G06c).
245
+ */
246
+ export function canonMandateNarrowing(nodes, graph) {
247
+ const found = [];
248
+ const mandates = new Map(nodes.filter((n) => n.discriminator === 'mandate').map((n) => [n.identity, n]));
249
+ for (const mandate of mandates.values())
250
+ for (const id of [...citedBy(mandate, graph)].sort()) {
251
+ const parent = mandates.get(id);
252
+ if (parent === undefined)
253
+ continue;
254
+ const moves = new Set(listTexts(parent, 'authority', 'moves'));
255
+ const covers = listTexts(parent, 'authority', 'covers');
256
+ const report = (key, message) => {
257
+ const line = fields(mandate, 'authority', key)[0]?.span.line ?? mandate.source.line;
258
+ found.push({
259
+ code: 'IA-COMP-CANON-MANDATE-WIDEN',
260
+ path: mandate.source.path,
261
+ line,
262
+ severity: 'error',
263
+ message: `${mandate.source.path}:${line}: ${message}`,
264
+ });
265
+ };
266
+ for (const move of listTexts(mandate, 'authority', 'moves'))
267
+ if (!moves.has(move))
268
+ report('moves', `Mandate ${mandate.name} allows ${move}, which ${parent.name}, which it cites, does not.`);
269
+ for (const path of listTexts(mandate, 'authority', 'covers'))
270
+ if (!covers.some((c) => selectionWithin(path, c)))
271
+ report('covers', `Mandate ${mandate.name} covers ${path}, outside every path ${parent.name}, which it cites, covers.`);
272
+ }
273
+ return found;
274
+ }
275
+ /**
276
+ * A canon record: one under `.ia/src/systems/<system>/records/canon/`, in the folder of the system owning its word, as
277
+ * authored or as installed (the store prefix `.ia/distributions/store/<sha256 hex>/` before it).
278
+ */
279
+ const CANON_LAWS = /^(?:\.ia\/distributions\/store\/[0-9a-f]{64}\/)?\.ia\/src\/systems\/[^/]+\/records\/canon\//;
280
+ const underCanon = (node) => CANON_LAWS.test(posix(node.source.path));
281
+ /**
282
+ * E4, its verifiable half: a local law or convention that cites a canon law (a resolved `cites` edge to a law under a
283
+ * `records/canon/` folder) governs that law's subject word and is at least as strong (informational < advisory <
284
+ * blocking). The law also asks that a rule tightening a canon law cite it; subject-word equality is no evidence that a
285
+ * rule tightens one, so an uncited rule is not judged here and that half is left to review.
286
+ */
287
+ export function canonLocalTightening(nodes, graph) {
288
+ const found = [];
289
+ const canon = nodes.filter((node) => node.discriminator === 'law' && underCanon(node));
290
+ for (const local of nodes) {
291
+ if ((local.discriminator !== 'law' && local.discriminator !== 'convention') || underCanon(local))
292
+ continue;
293
+ const cited = citedBy(local, graph), tightened = canon.filter((law) => cited.has(law.identity));
294
+ if (tightened.length === 0)
295
+ continue;
296
+ const word = textField(local, 'subject', 'subject-word');
297
+ const report = (message) => {
298
+ found.push({
299
+ code: 'IA-COMP-CANON-LOCAL-TIGHTEN',
300
+ path: local.source.path,
301
+ line: local.source.line,
302
+ severity: 'error',
303
+ message: `${local.source.path}:${local.source.line}: ${message}`,
304
+ });
305
+ };
306
+ for (const law of tightened) {
307
+ // A canon law with no subject word sets no word to match: only its severity is judged.
308
+ const lawWord = textField(law, 'subject', 'subject-word');
309
+ if (lawWord !== undefined && word !== lawWord)
310
+ report(`${local.name} cites the canon law ${law.name}, which governs the word ${lawWord}, but ${word === undefined ? 'governs no subject word' : `governs the word ${word}`}.`);
311
+ if (SEVERITY_ORDER[lawSeverity(local)] < SEVERITY_ORDER[lawSeverity(law)])
312
+ report(`${local.name} is ${lawSeverity(local)}, weaker than the canon law ${law.name}, which is ${lawSeverity(law)}.`);
313
+ }
314
+ }
315
+ return found;
316
+ }
317
+ const RULES = [
318
+ ['CANON-WORK-PLACEMENT', canonWorkPlacement],
319
+ ['CANON-KIT-WORDS', canonKitMethodWords],
320
+ ['CANON-KIT-WORKSPACE', canonKitWorkspace],
321
+ ['CANON-MANDATE-NARROW', (nodes, _folders, graph) => canonMandateNarrowing(nodes, graph)],
322
+ ['CANON-LOCAL-TIGHTEN', (nodes, _folders, graph) => canonLocalTightening(nodes, graph)],
323
+ ];
324
+ /**
325
+ * One built-in canon check as an assessment: null while no law enforces a check that runs `id`, else its findings at the
326
+ * severity the law sets. `find` runs only when the check is active, so a rule that reads files reads none while inactive.
327
+ */
328
+ export function canonAssessment(nodes, id, find, graph) {
329
+ const severity = canonSeverity(nodes, id, graph);
330
+ return severity === null
331
+ ? null
332
+ : assess(id, 'graph', find().map((finding) => ({ ...finding, severity })));
333
+ }
334
+ /**
335
+ * The built-in canon rules, each active only when a law enforces a check that runs it. The law sets the severity;
336
+ * an inactive rule reports nothing. `folders` is read by the rules that look at system folders.
337
+ */
338
+ export function canonAssessments(nodes, folders, graph) {
339
+ return RULES.flatMap(([id, rule]) => canonAssessment(nodes, id, () => rule(nodes, folders, graph), graph) ?? []);
340
+ }
341
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/canon/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvG,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAEvD,sHAAsH;AACtH,SAAS,aAAa,CAAC,KAAsB,EAAE,MAAc;IAC3D,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,mBAAmB,MAAM,GAAG,CAAC,CAAC,CAAC;IACpG,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAC/E,CAAC;AACD,MAAM,U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KAAK,EAAE,KAAK,CAAC,CAAC;CACxF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAsB,EACtB,EAAU,EACV,IAA8B,EAC9B,KAAa;IAEb,MAAM,QAAQ,GAAoB,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAClE,OAAO,QAAQ,KAAK,IAAI;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM,CACJ,EAAE,EACF,OAAO,EACP,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CACpD,CAAC;AACR,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAsB,EACtB,OAA4C,EAC5C,KAAa;IAEb,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AACnH,CAAC"}
@@ -1,4 +1,4 @@
1
1
  /** The built-in compliance evaluators (C16). A leaf module so catalog code can import it without a cycle. */
2
- export declare const CHECK_IDS: readonly ["COMP-PARSE", "COMP-SCHEMA", "COMP-SYSTEM", "COMP-SCHEMA-ENROLLED", "COMP-CONSENT-DECLARED", "COMP-CONSENT", "COMP-IDENTITY", "COMP-SELECTOR", "COMP-VARIANT", "COMP-COVERAGE", "COMP-FRAGMENT", "COMP-ADOPTION", "COMP-KERNEL", "COMP-FIXTURES", "COMP-STEWARD", "COMP-BOOTSTRAP", "COMP-CHECK"];
2
+ export declare const CHECK_IDS: readonly ["COMP-PARSE", "COMP-SCHEMA", "COMP-SYSTEM", "COMP-SCHEMA-ENROLLED", "COMP-CONSENT-DECLARED", "COMP-CONSENT", "COMP-IDENTITY", "COMP-SELECTOR", "COMP-VARIANT", "COMP-COVERAGE", "COMP-FRAGMENT", "COMP-ADOPTION", "COMP-KERNEL", "COMP-FIXTURES", "COMP-STEWARD", "COMP-BOOTSTRAP", "COMP-CHECK", "CANON-WORK-PLACEMENT", "CANON-KIT-WORDS", "CANON-KIT-WORKSPACE", "CANON-TEACHING-LINKS", "CANON-SOURCE-ROOTS", "CANON-KIT-SCRIPTS", "CANON-MANDATE-NARROW", "CANON-LOCAL-TIGHTEN"];
3
3
  export declare const isBuiltinCheck: (id: string) => boolean;
4
4
  //# sourceMappingURL=check-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-ids.d.ts","sourceRoot":"","sources":["../src/check-ids.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,eAAO,MAAM,SAAS,6SAkBX,CAAC;AACZ,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,OAAwD,CAAC"}
1
+ {"version":3,"file":"check-ids.d.ts","sourceRoot":"","sources":["../src/check-ids.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,eAAO,MAAM,SAAS,ieA0BX,CAAC;AACZ,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,OAAwD,CAAC"}
package/dist/check-ids.js CHANGED
@@ -17,6 +17,14 @@ export const CHECK_IDS = Object.freeze([
17
17
  'COMP-STEWARD',
18
18
  'COMP-BOOTSTRAP',
19
19
  'COMP-CHECK',
20
+ 'CANON-WORK-PLACEMENT',
21
+ 'CANON-KIT-WORDS',
22
+ 'CANON-KIT-WORKSPACE',
23
+ 'CANON-TEACHING-LINKS',
24
+ 'CANON-SOURCE-ROOTS',
25
+ 'CANON-KIT-SCRIPTS',
26
+ 'CANON-MANDATE-NARROW',
27
+ 'CANON-LOCAL-TIGHTEN',
20
28
  ]);
21
29
  export const isBuiltinCheck = (id) => CHECK_IDS.includes(id);
22
30
  //# sourceMappingURL=check-ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-ids.js","sourceRoot":"","sources":["../src/check-ids.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,YAAY;IACZ,aAAa;IACb,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,aAAa;IACb,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,YAAY;CACJ,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAU,EAAW,EAAE,CAAE,SAA+B,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"check-ids.js","sourceRoot":"","sources":["../src/check-ids.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,YAAY;IACZ,aAAa;IACb,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,aAAa;IACb,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,sBAAsB;IACtB,iBAAiB;IACjB,qBAAqB;IACrB,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,qBAAqB;CACb,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAU,EAAW,EAAE,CAAE,SAA+B,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC"}