@inventarch/compliance 3.6.0 → 3.8.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.
Files changed (63) hide show
  1. package/README.md +3 -3
  2. package/SPEC.md +16 -7
  3. package/dist/canon/laws.d.ts +33 -0
  4. package/dist/canon/laws.d.ts.map +1 -0
  5. package/dist/canon/laws.js +100 -0
  6. package/dist/canon/laws.js.map +1 -0
  7. package/dist/canon/rules.d.ts +49 -0
  8. package/dist/canon/rules.d.ts.map +1 -0
  9. package/dist/canon/rules.js +341 -0
  10. package/dist/canon/rules.js.map +1 -0
  11. package/dist/catalog.d.ts +36 -7
  12. package/dist/catalog.d.ts.map +1 -1
  13. package/dist/catalog.js +100 -30
  14. package/dist/catalog.js.map +1 -1
  15. package/dist/check-ids.d.ts +1 -1
  16. package/dist/check-ids.d.ts.map +1 -1
  17. package/dist/check-ids.js +8 -0
  18. package/dist/check-ids.js.map +1 -1
  19. package/dist/conformance/evidence-fixtures.d.ts.map +1 -1
  20. package/dist/conformance/evidence-fixtures.js +10 -7
  21. package/dist/conformance/evidence-fixtures.js.map +1 -1
  22. package/dist/conformance/evidence.d.ts +4 -4
  23. package/dist/conformance/evidence.d.ts.map +1 -1
  24. package/dist/conformance/evidence.js +3 -2
  25. package/dist/conformance/evidence.js.map +1 -1
  26. package/dist/conformance/inventory.d.ts +5 -1
  27. package/dist/conformance/inventory.d.ts.map +1 -1
  28. package/dist/conformance/inventory.generated.d.ts +1 -1
  29. package/dist/conformance/inventory.generated.d.ts.map +1 -1
  30. package/dist/conformance/inventory.generated.js +18 -2
  31. package/dist/conformance/inventory.generated.js.map +1 -1
  32. package/dist/conformance/inventory.js +5 -0
  33. package/dist/conformance/inventory.js.map +1 -1
  34. package/dist/conformance/refusals.d.ts.map +1 -1
  35. package/dist/conformance/refusals.js +249 -0
  36. package/dist/conformance/refusals.js.map +1 -1
  37. package/dist/conformance/verify.d.ts +1 -1
  38. package/dist/conformance/verify.d.ts.map +1 -1
  39. package/dist/conformance/verify.js +6 -4
  40. package/dist/conformance/verify.js.map +1 -1
  41. package/dist/evidence.d.ts.map +1 -1
  42. package/dist/evidence.js +2 -2
  43. package/dist/evidence.js.map +1 -1
  44. package/dist/index.d.ts +6 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +4 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/obligations.d.ts.map +1 -1
  49. package/dist/obligations.js +10 -7
  50. package/dist/obligations.js.map +1 -1
  51. package/dist/profiles.d.ts +4 -3
  52. package/dist/profiles.d.ts.map +1 -1
  53. package/dist/profiles.js +9 -2
  54. package/dist/profiles.js.map +1 -1
  55. package/dist/report.d.ts +6 -0
  56. package/dist/report.d.ts.map +1 -1
  57. package/dist/report.js +3 -0
  58. package/dist/report.js.map +1 -1
  59. package/dist/types.d.ts +1 -1
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/types.js +8 -0
  62. package/dist/types.js.map +1 -1
  63. package/package.json +3 -3
package/README.md CHANGED
@@ -56,10 +56,10 @@ for (const verdict of verified.verdicts.filter((v) => ['COMP-KERNEL', 'COMP-FIXT
56
56
  console.log(verdict.check, verdict.outcome, verdict.basis);
57
57
  // COMP-FIXTURES pass verified
58
58
  // COMP-KERNEL pass verified
59
- console.log(verified.conformance.profile); // package-v1
59
+ console.log(verified.conformance.profile); // package
60
60
  ```
61
61
 
62
- `verifyKernel()` regenerates the kernel from the floor and compares it with the running `@inventarch/language`; `verifyFixtures()` runs the `package-v1` profile of the fixtures this package ships. `verified.conformance.fixtures.outOfProfile` names the suites that profile does not run: hooks, the runtime, escalation, execution and publication.
62
+ `verifyKernel()` regenerates the kernel from the floor and compares it with the running `@inventarch/language`; `verifyFixtures()` runs the `package` profile of the fixtures this package ships. `verified.conformance.fixtures.outOfProfile` names the suites that profile does not run: hooks, the runtime, escalation, execution and publication.
63
63
 
64
64
  ## 🧭 What it does
65
65
 
@@ -101,5 +101,5 @@ Finding codes are `COMP_CODES` and `EVIDENCE_CODES` (`IA-COMP-*`); language and
101
101
  - [LANGUAGE.md](LANGUAGE.md): the packaged summary of the words this release ships
102
102
  - [Architecture reference](../../docs/reference/architecture/README.md#which-package-to-use) and the [host plugin specification](../../docs/specs/host-plugin-distribution/README.md)
103
103
  - Neighbours in the dependency direction: [`@inventarch/language`](../language/README.md) and [`@inventarch/graph`](../graph/README.md) before it; [`@inventarch/db`](../db/README.md) after it
104
- - In this repository, `pnpm compliance:check` runs these checks over the native corpus, the conformance fixtures and the `package-v1` inventory
104
+ - In this repository, `pnpm compliance:check` runs these checks over the native corpus, the conformance fixtures and the `package` inventory
105
105
  - [Root README](../../README.md)
package/SPEC.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Compliance specification
2
2
 
3
- Evaluator catalog extension: the producer side of trusted evaluator catalog and obligations is implemented by C25–C29 below (the catalog, check binding, obligation resolution including the strict-typing-v1 profile mapping, receipts and admission, with their qualification cases in tests/evaluator-catalog.test.ts). It is explicit and optional: calls without a catalog keep the built-in-only behavior, and unknown check.runs ids still refuse. Hosts outside this package own the consumer side: transactional admission and the managed transition, choosing between fixed and catalog evaluators, re-evaluation after a late edit, concurrent workers with durable intent, silent agents, and a real strict-typing compiler evaluator with excluded-source detection. No scheduler, execution, persistence or native word is added here.
3
+ Evaluator catalog extension: the producer side of trusted evaluator catalog and obligations is implemented by C25–C29 below (the catalog, check binding, obligation resolution including the strict-typing profile mapping, receipts and admission, with their qualification cases in tests/evaluator-catalog.test.ts). It is explicit and optional: calls without a catalog keep the built-in-only behavior, and unknown check.runs ids still refuse. Hosts outside this package own the consumer side: transactional admission and the managed transition, choosing between fixed and catalog evaluators, re-evaluation after a late edit, concurrent workers with durable intent, silent agents, and a real strict-typing compiler evaluator with excluded-source detection. No scheduler, execution, persistence or native word is added here.
4
4
 
5
5
  Status: C01–C21 and C25–C32 are implemented; the projection clauses C22–C24 are retired (below). Delivery evidence below is chronological; statements of later work within early checkpoints describe that checkpoint only.
6
6
 
@@ -80,11 +80,19 @@ 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)
86
94
 
87
- C25 (catalog v1). Pure `createEvaluatorCatalog({format, entries}, {codecs, builtins?})`. The top level must be exactly `{format, entries}` with format `ia-evaluator-catalog/1.<minor>`; an unknown key (e.g. `revocations`), another major or another shape is CATALOG-VERSION. Minor-version handling: any minor of major 1 is accepted, but every entry must use exactly the v1 fields, so a later minor that adds behavior is refused rather than silently ignored; the declared format, minor included, is part of the digest. An entry has exactly id, contractVersion, implementationVersion, implementationDigest, inputSchemaId, outputSchemaId, supportedScopes, effects, environmentProfile, limits, evidencePolicy and availability; an unknown or missing field is CATALOG-ENTRY-INVALID. The id is a lowercase namespaced `id` (at least one hyphen, e.g. `acme-strict-typing`) so it stays a valid native `check.runs` value. Only CHECK_IDS are built in (D4). `options.builtins` lists host-reserved ids (validated as `A-Z`/`a-z` ids, otherwise TypeError); an entry id equal case-insensitively to a CHECK_IDS or reserved id, or in the reserved `comp` namespace, is CATALOG-BUILTIN-OVERRIDE. Reserved ids are recorded as `catalog.reserved`; they never pass COMP-CHECK and never resolve as evaluators. Versions are MAJOR.MINOR.PATCH; a contractVersion major outside EVALUATOR_CONTRACT_MAJORS (1) is CATALOG-VERSION. implementationDigest is `sha256:<64 hex>`. inputSchemaId/outputSchemaId are `name@major` ids that must be in the host codec registry, otherwise CATALOG-CODEC-UNKNOWN; a codec is trusted host code with `validate` and an optional `normalize`. supportedScopes (nonempty) and effects are unique ids. environmentProfile is `{id, credentials: none | scoped}`; ambient credentials are not expressible. limits require positive safe-integer timeoutMs, memoryBytes, outputBytes and concurrency (CATALOG-LIMITS). evidencePolicy is `{kind: fresh-run}` or `{kind: reusable, maxAgeMs, environmentSensitive}`. availability is `{status: supported}` or `{status: unavailable | revoked, reason}` with a printable single-line reason of at most 200 characters and no credential assignment. A repeated id@implementationVersion is CATALOG-DUPLICATE when the digests agree and CATALOG-DIGEST-CONFLICT when they differ; more than one supported version of one id is CATALOG-DUPLICATE. Findings carry the 1-based input index of the offending entry. Any finding refuses the whole catalog with no partial result. The accepted catalog is deeply frozen, entries sorted by id and version, with digest `sha256` of the canonical serialization of the format, entries, built-in and reserved ids; equal inputs in any entry order give equal digests. Only objects returned by this constructor are accepted by the functions below (`isEvaluatorCatalog`); a copied or hand-built object is a TypeError.
95
+ C25 (catalog). Pure `createEvaluatorCatalog({format, formatVersion, entries}, {codecs, builtins?})`. The current shape is exactly `{format: 'evaluator-catalog', formatVersion: 2, entries}`: the version is an integer field, never part of the name, and an unsupported `formatVersion` (EVALUATOR_CATALOG_FORMAT_VERSIONS) is CATALOG-VERSION. The legacy shape `{format: 'ia-evaluator-catalog/1.<minor>', entries}` is still read: any minor of major 1 is accepted, its entries name codecs by the legacy `inputSchemaId` / `outputSchemaId` strings `name@major`, and an explicit legacy reader (`legacyCodecRef`, the only parser of that string) converts them to `{id, version}`, so the accepted catalog always carries the current entry shape (`catalog.formatVersion` is 1 for a legacy catalog, 2 otherwise) and a legacy catalog's digest is still computed over its entries as declared. An unknown key (e.g. `revocations`), another major or another shape is CATALOG-VERSION; each shape is exact, so the legacy fields in the current shape and the current fields in the legacy shape are CATALOG-ENTRY-INVALID; the declared format, and the format version in the current shape, are part of the digest. An entry has exactly id, contractVersion, implementationVersion, implementationDigest, inputCodec, outputCodec, supportedScopes, effects, environmentProfile, limits, evidencePolicy and availability; an unknown or missing field is CATALOG-ENTRY-INVALID. The id is a lowercase namespaced `id` (at least one hyphen, e.g. `acme-strict-typing`) so it stays a valid native `check.runs` value. Only CHECK_IDS are built in (D4). `options.builtins` lists host-reserved ids (validated as `A-Z`/`a-z` ids, otherwise TypeError); an entry id equal case-insensitively to a CHECK_IDS or reserved id, or in the reserved `comp` namespace, is CATALOG-BUILTIN-OVERRIDE. Reserved ids are recorded as `catalog.reserved`; they never pass COMP-CHECK and never resolve as evaluators. Versions are MAJOR.MINOR.PATCH; a contractVersion major outside EVALUATOR_CONTRACT_MAJORS (1) is CATALOG-VERSION. implementationDigest is `sha256:<64 hex>`. inputCodec/outputCodec are `{id, version}` references (a plain token id with no `@`, and a positive safe-integer version; `contractVersion` keeps its meaning, the version of the evaluator's invocation contract) that must name a codec in the host registry, otherwise CATALOG-CODEC-UNKNOWN; a malformed reference is CATALOG-ENTRY-INVALID. A codec is registered as `{id, version, validate, normalize?}` (a list; a malformed or repeated `{id, version}` registration is a TypeError), is trusted host code, and is looked up by the pair, so two versions of one codec id coexist (`codecOf(catalog, {id, version})`). supportedScopes (nonempty) and effects are unique ids. environmentProfile is `{id, credentials: none | scoped}`; ambient credentials are not expressible. limits require positive safe-integer timeoutMs, memoryBytes, outputBytes and concurrency (CATALOG-LIMITS). evidencePolicy is `{kind: fresh-run}` or `{kind: reusable, maxAgeMs, environmentSensitive}`. availability is `{status: supported}` or `{status: unavailable | revoked, reason}` with a printable single-line reason of at most 200 characters and no credential assignment. A repeated id@implementationVersion is CATALOG-DUPLICATE when the digests agree and CATALOG-DIGEST-CONFLICT when they differ; more than one supported version of one id is CATALOG-DUPLICATE. Findings carry the 1-based input index of the offending entry. Any finding refuses the whole catalog with no partial result. The accepted catalog is deeply frozen, entries sorted by id and version, with digest `sha256` of the canonical serialization of the format, entries, built-in and reserved ids; equal inputs in any entry order give equal digests. Only objects returned by this constructor are accepted by the functions below (`isEvaluatorCatalog`); a copied or hand-built object is a TypeError.
88
96
 
89
97
  C26 (check.runs with a catalog). `validateCheck(node, catalog?)` and `evaluate(graph, {catalog})`. Without a catalog the result is byte-identical to C16. With one, a CHECK_IDS id passes as before; otherwise `selectEvaluator` picks the id's supported entry, else its highest listed version. Supported passes. Revoked is EVALUATOR-REVOKED, a blocking error. Unavailable is an EVALUATOR-UNAVAILABLE warning and the assessment is not-evaluated (D5): an unavailable evaluator does not refute the declaration, and blocking belongs to admission of a required obligation, while an optional one stays visibly unevaluated. An id in neither set, including a host-reserved id, is still CHECK-UNKNOWN. Native check records keep `check.runs`; the schema also admits `check.implementation`, which `checkRunner` reads first, and requires neither alone (C16). Catalog text never names a callback, command or path: `bindEvaluators(catalog, implementations)` associates trusted host implementations keyed `${id}@${implementationDigest}`, and any key naming an unknown, substituted, unavailable or revoked implementation is EVALUATOR-SUBSTITUTED and refuses the whole binding. The host must bind before invoking; binding invokes nothing, and admission independently checks each receipt's evaluator id, version and digest against the catalog (C28).
90
98
 
@@ -119,22 +127,23 @@ Failed diagnostics are sliced to 20 entries before filtering, and each line is r
119
127
 
120
128
  Resolver not-applicable with evidence does not block. An optional obligation never blocks and is reported as `optional-unevaluated`, or `optional-failed` when its latest valid receipt failed. Each decision records the trust of the receipt it relied on, and the transition records `minimumTrust` and `reliedTrust` (the weakest trust among satisfying receipts, or none). A local unsigned receipt is a local diagnostic. None of these functions reads files, a clock or the network, schedules or executes anything, or persists receipts.
121
129
 
122
- C29 (evaluation profiles; D6). `EVALUATION_PROFILES['strict-typing-v1']` is the consumer contract id mapping to three requirements: `configuration`, `included-file-coverage` and `compiler-run`. `profileOccurrences('strict-typing-v1', binding)` expands one selected law or contract occurrence into three required occurrences with requirements `strict-typing-v1/<name>`, each discharged by a host catalog evaluator named in the binding. A built-in id, a non-catalog id, an unknown profile or a missing or extra mapping is a TypeError. The profile is not a native word. Declarations, native cases and check records never become results by presence: the three obligations are admitted only with valid passed receipts, so a real compiler run requires an installed evaluator and its receipt.
130
+ C29 (evaluation profiles; D6). `EVALUATION_PROFILES['strict-typing']` is the consumer contract id mapping to three requirements: `configuration`, `included-file-coverage` and `compiler-run`. `profileOccurrences('strict-typing', binding)` expands one selected law or contract occurrence into three required occurrences with requirements `strict-typing/<name>`, each discharged by a host catalog evaluator named in the binding. A built-in id, a non-catalog id, an unknown profile or a missing or extra mapping is a TypeError. The original id `strict-typing-v1` stays an accepted alias, as compatibility for at least one major release; a requirement is named after the profile id the caller gave, so receipts written under the old id keep matching. The profile is not a native word. Declarations, native cases and check records never become results by presence: the three obligations are admitted only with valid passed receipts, so a real compiler run requires an installed evaluator and its receipt.
123
131
 
124
132
  C30 (structural COMP-CHECK). `validateCheckStructure(node)` is COMP-CHECK as a structural admission reads it: CHECK-CONFLICT for two different evaluators and CHECK-UNKNOWN ("the check names no evaluator") for none, as C16 has them, and a pass for any one named evaluator, built in or not, because which implementation serves it is decided when the check is bound against a host catalog. `evaluate(graph, {checks})` takes `strict` (the default, C16 or C26 with `catalog`) or `structural`. `validateCheck` stays the strict admission every existing reader uses.
125
133
 
126
- Evaluator catalog rules D1–D6 (2026-09-28): D1 package metadata never weakens a root-adopted obligation (C27); D2 admission is bound to a verified resolver-issued resolution (C27, C28); D3 service trust needs a host verifier, `minimumTrust` is required and trust is recorded (C28); D4 only CHECK_IDS are built in, `options.builtins` only reserves ids (C25, C26); D5 COMP-CHECK treats revoked as an error and unavailable as not-evaluated (C26); D6 the strict-typing-v1 producer mapping belongs to this package (C29).
134
+ Evaluator catalog rules D1–D6 (2026-09-28): D1 package metadata never weakens a root-adopted obligation (C27); D2 admission is bound to a verified resolver-issued resolution (C27, C28); D3 service trust needs a host verifier, `minimumTrust` is required and trust is recorded (C28); D4 only CHECK_IDS are built in, `options.builtins` only reserves ids (C25, C26); D5 COMP-CHECK treats revoked as an error and unavailable as not-evaluated (C26); D6 the strict-typing producer mapping belongs to this package (C29).
127
135
 
128
136
  Public type note: `Finding['code']` now also admits `EvidenceCode`, an additive widening of the exported union; consumers that switch exhaustively over `Finding['code']` must handle the new codes. C25–C29 codes are exported as `EVIDENCE_CODES`, separate from COMP_CODES. The repository fixture gate now requires successful producer observations for both inventories. `tools/compliance/evidence-fixtures.ts` executes 28 catalog, binding, obligation, receipt and admission refusals through the actual pure APIs, after valid catalog/receipt/admission positive controls. Removing or failing the sole observation for any evidence code fails COMP-FIXTURES. Direct package tests remain in tests/evaluator-catalog.test.ts. Synthetic local unsigned receipts establish no live host, writer, reviewer or service authorization.
129
137
 
130
138
  C25–C28 delivered (2026-09-28) with 23 tests. A repair the same day added D1–D6, fixes to secret redaction and package directive validation, and C29, bringing tests/evaluator-catalog.test.ts to 35 tests. They cover catalog construction, check binding with and without a catalog, bounded evaluator output, receipt reuse and fresh-run attempts, the producer side of root precedence, obligation resolution and each catalog, binding, resolution, receipt and admission refusal, plus a byte-identical report regression without a catalog. The pre-change report digests on the native corpus (with and without supplied observations) were unchanged after the original change and after the repair.
131
139
 
132
- ## Native conformance evidence (package-v1)
140
+ ## Native conformance evidence (package)
133
141
 
134
142
  C31 (native conformance evidence). The package produces COMP-KERNEL and COMP-FIXTURES evidence itself, and `evaluate(graph, {conformance: {inputs, kernel, fixtures}})` binds it to the graph. It is opt-in: without `conformance`, nothing runs.
135
143
  - `verifyKernel(floor = KERNEL_SOURCES)` regenerates the kernel from `floor` in-process against the closed contract. The pure generator lives in `src/kernel.ts`; `tools/kernel` keeps the reader, the drift check and `kernel:check`. It compares every regenerated constant, `KERNEL_DIGEST` and `KERNEL_SOURCES` included, with the running `@inventarch/language`'s public exports. `PRESENT_PHRASES` is not exported, so it is compared through what it determines: `VERB_PHRASES` and each phrase's `verbOf`. Only the public entry is read, so neither the generator nor `kernel:check` needs built output. A floor that does not regenerate, or regenerates to anything else, fails, so a floor with one byte changed fails. `floorDigest` is the digest of that floor, computed as `KERNEL_DIGEST` is.
136
- - `verifyFixtures()` runs the `package-v1` profile: the language fixtures this package ships, checked against `src/conformance/inventory.generated.ts`, and the refusal and evidence boundary suites over the conformance corpus the inventory embeds. It reads only the package's own files and writes nothing. It fails on any of these: a missing, extra or changed fixture file; a companion its clause and mode do not admit; a fixture listed under another clause or mode; a duplicate inventory path; an inventory that differs from `INVENTORY_DIGEST`; required codes that differ from the running LANG, GRAPH, COMP and EVIDENCE codes; a boundary case the inventory does not list or that no longer runs; and any required code that no passing failing case observes. A fixture directory that cannot be read leaves the profile not-evaluated. So does a listed file that cannot be read: it is not evaluated and suspends the coverage judgement, while other failures still fail.
137
- - Out of profile. Every fixture evidence object lists the suites the profile does not run, each with its reason and the codes only it observes: HOOK, RUNTIME, escalation, EXEC and PUBLICATION. A `package-v1` pass says nothing about hooks, the runtime, execution or publication on that host; `tools/compliance` still runs those suites. The mandate fixtures are pure, but they need `@inventarch/runtime` and observe RUNTIME codes, so they stay out of profile.
144
+ - The profile id carries no version. `package-v1` is its original spelling and is accepted wherever an inventory names its profile, as compatibility for at least one major release; new evidence and inventories write `package`.
145
+ - `verifyFixtures()` runs the `package` profile: the language fixtures this package ships, checked against `src/conformance/inventory.generated.ts`, and the refusal and evidence boundary suites over the conformance corpus the inventory embeds. It reads only the package's own files and writes nothing. It fails on any of these: a missing, extra or changed fixture file; a companion its clause and mode do not admit; a fixture listed under another clause or mode; a duplicate inventory path; an inventory that differs from `INVENTORY_DIGEST`; required codes that differ from the running LANG, GRAPH, COMP and EVIDENCE codes; a boundary case the inventory does not list or that no longer runs; and any required code that no passing failing case observes. A fixture directory that cannot be read leaves the profile not-evaluated. So does a listed file that cannot be read: it is not evaluated and suspends the coverage judgement, while other failures still fail.
146
+ - Out of profile. Every fixture evidence object lists the suites the profile does not run, each with its reason and the codes only it observes: HOOK, RUNTIME, escalation, EXEC and PUBLICATION. A `package` pass says nothing about hooks, the runtime, execution or publication on that host; `tools/compliance` still runs those suites. The mandate fixtures are pure, but they need `@inventarch/runtime` and observe RUNTIME codes, so they stay out of profile.
138
147
  - Evidence objects are deeply frozen and recorded by kind in module-private WeakSets. `isConformanceEvidence(value, subject?)` accepts only an object that `verifyKernel` or `verifyFixtures` returned in the same module instance. Each object carries `subject`, `profile`, `toolchain {languageVersion, kernelDigest, compliance, node}` and `assessment`. Kernel evidence adds `floorDigest`; fixture evidence adds `inventoryDigest`, `observedCodes` and `outOfProfile`. The words are C28's; none of C28's catalog, trust or admission machinery applies.
139
148
  - Binding. `inputs` are the graph's `RevisionInputs`. `evaluate` reads them once, by index and without Array methods (so no `Symbol.species` constructor is consulted), into frozen plain data of exactly `{languageVersion, kernelDigest, sources: [{path, text, location: {placement: {kind, band, reach}, provenance}}]}`, and every rule below uses that copy, so a getter cannot show the revision one value and a later rule another. Both checks are NOT-EVALUATED when `revisionOf(graph.registry, inputs)` is not `graph.revision`, or when `inputs.languageVersion` or `inputs.kernelDigest` is not the running language's. Each check is also NOT-EVALUATED when its own evidence's toolchain is not the running one, so one stale object leaves the other bound. COMP-KERNEL is also NOT-EVALUATED when an input source has a `.ia/src/floor/` path or floor placement but not both, or when the digest of the sources that have both is not `kernel.floorDigest`. Otherwise each check takes its evidence's assessment. A COMP-KERNEL failure therefore needs verification that ran on the graph's own floor and failed.
140
149
  - Refusals (TypeError): an unbranded, cloned, copied or hand-built object; a kernel object and a fixture object in each other's slots; `inputs` that are not an object with a sources array; a path, text, placement kind, reach, provenance, language version or kernel digest that is not a string, or a band that is not a number; and `evidence` together with `conformance`.
@@ -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,E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AAClH,MAAM,CAAC,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAExH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAA2C,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;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