@consiliency/contract 0.0.1 → 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.
Files changed (62) hide show
  1. package/README.md +44 -4
  2. package/conformance/vectors/adoption-absent-ungoverned.json +16 -0
  3. package/conformance/vectors/adoption-adopted-governed.json +18 -0
  4. package/conformance/vectors/adoption-declared-false-ungoverned.json +17 -0
  5. package/conformance/vectors/adoption-partial-scope.json +18 -0
  6. package/conformance/vectors/canonical-html-contract-loaded.json +15 -0
  7. package/conformance/vectors/coordination-announce-intent-does-not-lease.json +38 -0
  8. package/conformance/vectors/coordination-done-does-not-release-lease.json +38 -0
  9. package/conformance/vectors/coordination-handoff-does-not-transfer-holder.json +38 -0
  10. package/conformance/vectors/coordination-message-does-not-mutate-lease.json +38 -0
  11. package/conformance/vectors/doc-label-foreign-governed-false.json +19 -0
  12. package/conformance/vectors/doc-label-present-nonconforming.json +19 -0
  13. package/conformance/vectors/edge-label-unmanaged-cross-repo.json +30 -0
  14. package/conformance/vectors/governed-set-undeclared-ungoverned.json +18 -0
  15. package/conformance/vectors/ignore-set-nested-path-any-depth.json +19 -0
  16. package/conformance/vectors/ignore-set-scratch-never-governed.json +19 -0
  17. package/conformance/vectors/interface-invalid-host-path.json +26 -0
  18. package/conformance/vectors/interface-valid-realized-and-promised.json +36 -0
  19. package/conformance/vectors/lease-acquire.json +35 -0
  20. package/conformance/vectors/lease-event-carries-lease.json +28 -0
  21. package/conformance/vectors/lease-expire.json +25 -0
  22. package/conformance/vectors/lease-expiry-boundary.json +25 -0
  23. package/conformance/vectors/lease-hard-degrades-to-soft.json +35 -0
  24. package/conformance/vectors/lease-hard-mode-atomic.json +35 -0
  25. package/conformance/vectors/lease-release.json +26 -0
  26. package/conformance/vectors/lease-renew.json +36 -0
  27. package/conformance/vectors/loop-gate-invalid-blocking-default.json +15 -0
  28. package/conformance/vectors/loop-gate-missing-doc-warns.json +16 -0
  29. package/conformance/vectors/manifest-invalid-absolute-path.json +20 -0
  30. package/conformance/vectors/manifest-invalid-certified-maturity.json +20 -0
  31. package/conformance/vectors/manifest-invalid-path-and-ref.json +20 -0
  32. package/conformance/vectors/manifest-invalid-unknown-archetype.json +18 -0
  33. package/conformance/vectors/manifest-valid-baseline-only.json +20 -0
  34. package/conformance/vectors/manifest-valid-product.json +21 -0
  35. package/conformance/vectors/version-skew-compatible.json +15 -0
  36. package/conformance/vectors/version-skew-incompatible-warns.json +15 -0
  37. package/core/canonical-html/contract-v1.json +459 -0
  38. package/core/canonical-html/provenance.json +22 -0
  39. package/core/contract.json +55 -0
  40. package/core/registries/archetypes.json +62 -0
  41. package/core/registries/default-ignore-set.json +30 -0
  42. package/core/registries/document-classes.json +33 -0
  43. package/core/registries/maturity-labels.json +48 -0
  44. package/core/registries/required-documents.json +74 -0
  45. package/core/schemas/canonical-html-v1.schema.json +15 -0
  46. package/core/schemas/contract-version-status.schema.json +26 -0
  47. package/core/schemas/coordination-channel-protocol.schema.json +53 -0
  48. package/core/schemas/coordination-scenario.schema.json +67 -0
  49. package/core/schemas/decision.schema.json +31 -0
  50. package/core/schemas/governance-scope-scenario.schema.json +62 -0
  51. package/core/schemas/interface-declaration.schema.json +69 -0
  52. package/core/schemas/lease-event.schema.json +17 -0
  53. package/core/schemas/lease-store-protocol.schema.json +117 -0
  54. package/core/schemas/lease.schema.json +42 -0
  55. package/core/schemas/loop-gate-protocol.schema.json +25 -0
  56. package/core/schemas/loop-gate-scenario.schema.json +25 -0
  57. package/core/schemas/manifest.schema.json +140 -0
  58. package/core/schemas/version-skew-protocol.schema.json +32 -0
  59. package/core/schemas/version-skew-scenario.schema.json +13 -0
  60. package/package.json +8 -2
  61. package/src/index.d.ts +7 -1
  62. package/src/index.js +47 -7
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "lease-hard-degrades-to-soft",
3
+ "description": "Hard mode requires an atomic acquire; without an atomic backend the requested hard lease degrades to soft and warns.",
4
+ "input": {
5
+ "schema": "consiliency.coordination_scenario.v1",
6
+ "now": "2026-01-01T00:00:10Z",
7
+ "requested_mode": "hard",
8
+ "backend": "local-file",
9
+ "atomic_backend": false,
10
+ "events": [
11
+ {"event": "acquire", "lease_id": "lease-symbol-parse", "holder": "agent-a", "at": "2026-01-01T00:00:00Z", "ttl_seconds": 300, "mode": "hard", "scope": {"granularity": "symbol", "selector": ["src/parser.rs::parse"]}, "phase": "implement"}
12
+ ]
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "warn",
17
+ "maturity": "presence-only",
18
+ "findings": [{"code": "coordination.hard_degraded_to_soft", "severity": "warn", "message": "Backend does not support atomic acquire; hard lease degraded to soft advisory mode."}]
19
+ },
20
+ "expected": {
21
+ "effective_mode": "soft",
22
+ "changed_by_message": false,
23
+ "current_lease": {
24
+ "schema": "consiliency.lease.v1",
25
+ "lease_id": "lease-symbol-parse",
26
+ "holder": "agent-a",
27
+ "acquired_at": "2026-01-01T00:00:00Z",
28
+ "ttl_seconds": 300,
29
+ "heartbeat_at": "2026-01-01T00:00:00Z",
30
+ "mode": "soft",
31
+ "scope": {"granularity": "symbol", "selector": ["src/parser.rs::parse"]},
32
+ "phase": "implement"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "lease-hard-mode-atomic",
3
+ "description": "Hard mode is granted only over an atomic backend; the atomic acquire yields an active hard lease.",
4
+ "input": {
5
+ "schema": "consiliency.coordination_scenario.v1",
6
+ "now": "2026-01-01T00:00:10Z",
7
+ "requested_mode": "hard",
8
+ "backend": "coordinator",
9
+ "atomic_backend": true,
10
+ "events": [
11
+ {"event": "acquire", "lease_id": "lease-symbol-parse", "holder": "agent-a", "at": "2026-01-01T00:00:00Z", "ttl_seconds": 300, "mode": "hard", "scope": {"granularity": "symbol", "selector": ["src/parser.rs::parse"]}, "phase": "implement"}
12
+ ]
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "accepted",
17
+ "maturity": "presence-only",
18
+ "findings": [{"code": "coordination.hard_granted", "severity": "info", "message": "Atomic backend present; hard lease granted and active."}]
19
+ },
20
+ "expected": {
21
+ "effective_mode": "hard",
22
+ "changed_by_message": false,
23
+ "current_lease": {
24
+ "schema": "consiliency.lease.v1",
25
+ "lease_id": "lease-symbol-parse",
26
+ "holder": "agent-a",
27
+ "acquired_at": "2026-01-01T00:00:00Z",
28
+ "ttl_seconds": 300,
29
+ "heartbeat_at": "2026-01-01T00:00:00Z",
30
+ "mode": "hard",
31
+ "scope": {"granularity": "symbol", "selector": ["src/parser.rs::parse"]},
32
+ "phase": "implement"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "id": "lease-release",
3
+ "description": "An explicit release clears the lease; the current-lease view is empty even though the TTL had not elapsed.",
4
+ "input": {
5
+ "schema": "consiliency.coordination_scenario.v1",
6
+ "now": "2026-01-01T00:02:10Z",
7
+ "requested_mode": "soft",
8
+ "backend": "local-file",
9
+ "atomic_backend": false,
10
+ "events": [
11
+ {"event": "acquire", "lease_id": "lease-src-mod", "holder": "agent-a", "at": "2026-01-01T00:00:00Z", "ttl_seconds": 300, "mode": "soft", "scope": {"granularity": "path-set", "selector": ["src/mod/**"]}, "phase": "implement"},
12
+ {"event": "release", "lease_id": "lease-src-mod", "holder": "agent-a", "at": "2026-01-01T00:02:00Z"}
13
+ ]
14
+ },
15
+ "decision": {
16
+ "schema": "consiliency.conformance_decision.v1",
17
+ "status": "accepted",
18
+ "maturity": "presence-only",
19
+ "findings": [{"code": "coordination.lease_released", "severity": "info", "message": "Holder released the lease before its TTL; the lease is free."}]
20
+ },
21
+ "expected": {
22
+ "effective_mode": "soft",
23
+ "changed_by_message": false,
24
+ "current_lease": null
25
+ }
26
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "id": "lease-renew",
3
+ "description": "A heartbeat renew extends the effective expiry (acquired_at + ttl measured from the last heartbeat), so the lease is still active past its original TTL.",
4
+ "input": {
5
+ "schema": "consiliency.coordination_scenario.v1",
6
+ "now": "2026-01-01T00:06:40Z",
7
+ "requested_mode": "soft",
8
+ "backend": "local-file",
9
+ "atomic_backend": false,
10
+ "events": [
11
+ {"event": "acquire", "lease_id": "lease-src-mod", "holder": "agent-a", "at": "2026-01-01T00:00:00Z", "ttl_seconds": 300, "mode": "soft", "scope": {"granularity": "path-set", "selector": ["src/mod/**"]}, "phase": "implement"},
12
+ {"event": "renew", "lease_id": "lease-src-mod", "holder": "agent-a", "at": "2026-01-01T00:04:10Z"}
13
+ ]
14
+ },
15
+ "decision": {
16
+ "schema": "consiliency.conformance_decision.v1",
17
+ "status": "accepted",
18
+ "maturity": "presence-only",
19
+ "findings": [{"code": "coordination.lease_renewed", "severity": "info", "message": "Heartbeat renew extended the lease; it is active past its original TTL."}]
20
+ },
21
+ "expected": {
22
+ "effective_mode": "soft",
23
+ "changed_by_message": false,
24
+ "current_lease": {
25
+ "schema": "consiliency.lease.v1",
26
+ "lease_id": "lease-src-mod",
27
+ "holder": "agent-a",
28
+ "acquired_at": "2026-01-01T00:00:00Z",
29
+ "ttl_seconds": 300,
30
+ "heartbeat_at": "2026-01-01T00:04:10Z",
31
+ "mode": "soft",
32
+ "scope": {"granularity": "path-set", "selector": ["src/mod/**"]},
33
+ "phase": "implement"
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "loop-gate-invalid-blocking-default",
3
+ "description": "Phase 0 contract data must not make blocking the default.",
4
+ "input": {
5
+ "schema": "consiliency.loop_gate_scenario.v1",
6
+ "gate": "presence",
7
+ "severity_default": "block"
8
+ },
9
+ "decision": {
10
+ "schema": "consiliency.conformance_decision.v1",
11
+ "status": "rejected",
12
+ "maturity": "presence-only",
13
+ "findings": [{"code": "gate.default.blocking", "severity": "block", "message": "Blocking must be opt-in during Phase 0."}]
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "loop-gate-missing-doc-warns",
3
+ "description": "Phase 0 missing document checks warn by default.",
4
+ "input": {
5
+ "schema": "consiliency.loop_gate_scenario.v1",
6
+ "gate": "presence",
7
+ "missing": ["runbook"],
8
+ "consumer_policy": {"blocking_opt_in": false}
9
+ },
10
+ "decision": {
11
+ "schema": "consiliency.conformance_decision.v1",
12
+ "status": "warn",
13
+ "maturity": "presence-only",
14
+ "findings": [{"code": "presence.missing_doc", "severity": "warn", "message": "Required document is missing at L0."}]
15
+ }
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "manifest-invalid-absolute-path",
3
+ "description": "Host absolute paths are rejected from public package data.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "bad", "display_name": "Bad", "default_branch": "main"},
8
+ "declaration": {"mode": "baseline-only"},
9
+ "documents": [
10
+ {"id": "readme", "class": "index", "path": "/absolute/private/README.md", "maturity": "presence-only", "target_level": "L0", "required": true}
11
+ ],
12
+ "interfaces": ".consiliency/interfaces.json"
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "rejected",
17
+ "maturity": "presence-only",
18
+ "findings": [{"code": "path.absolute", "severity": "block", "message": "Paths must be repo-relative."}]
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "manifest-invalid-certified-maturity",
3
+ "description": "Phase 0 vectors must not claim certified maturity.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "bad", "display_name": "Bad", "default_branch": "main"},
8
+ "declaration": {"mode": "baseline-only"},
9
+ "documents": [
10
+ {"id": "glossary", "class": "proj-S", "path": "docs/glossary.html", "maturity": "certified", "target_level": "L1", "required": true}
11
+ ],
12
+ "interfaces": ".consiliency/interfaces.json"
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "rejected",
17
+ "maturity": "presence-only",
18
+ "findings": [{"code": "maturity.certified.phase0", "severity": "block", "message": "Certified maturity is reserved for post-XG-1 evidence."}]
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "manifest-invalid-path-and-ref",
3
+ "description": "A document declaration must use exactly one of path or ref.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "bad", "display_name": "Bad", "default_branch": "main"},
8
+ "declaration": {"mode": "baseline-only"},
9
+ "documents": [
10
+ {"id": "readme", "class": "index", "path": "README.md", "ref": {"kind": "url", "value": "https://example.invalid"}, "maturity": "presence-only", "target_level": "L0", "required": true}
11
+ ],
12
+ "interfaces": ".consiliency/interfaces.json"
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "rejected",
17
+ "maturity": "presence-only",
18
+ "findings": [{"code": "document.path_ref.exclusive", "severity": "block", "message": "Document declarations must use exactly one of path or ref."}]
19
+ }
20
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "manifest-invalid-unknown-archetype",
3
+ "description": "Unknown archetypes are rejected.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "bad", "display_name": "Bad", "default_branch": "main"},
8
+ "declaration": {"mode": "archetyped", "archetypes": ["website"], "modifiers": []},
9
+ "documents": [],
10
+ "interfaces": ".consiliency/interfaces.json"
11
+ },
12
+ "decision": {
13
+ "schema": "consiliency.conformance_decision.v1",
14
+ "status": "rejected",
15
+ "maturity": "presence-only",
16
+ "findings": [{"code": "archetype.unknown", "severity": "block", "message": "Archetype is not in the contract registry."}]
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "manifest-valid-baseline-only",
3
+ "description": "A baseline-only declaration is legal and carries no archetype list.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "notes", "display_name": "Notes", "default_branch": "main"},
8
+ "declaration": {"mode": "baseline-only"},
9
+ "documents": [
10
+ {"id": "readme", "class": "index", "path": "README.md", "maturity": "presence-only", "target_level": "L0", "required": true}
11
+ ],
12
+ "interfaces": ".consiliency/interfaces.json"
13
+ },
14
+ "decision": {
15
+ "schema": "consiliency.conformance_decision.v1",
16
+ "status": "accepted",
17
+ "maturity": "presence-only",
18
+ "findings": []
19
+ }
20
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "manifest-valid-product",
3
+ "description": "An archetyped product manifest with repo-relative documents is accepted at L0.",
4
+ "input": {
5
+ "schema": "consiliency.manifest.v1",
6
+ "contract_version": "0.2.0",
7
+ "repo": {"id": "portal", "display_name": "Consiliency Portal", "default_branch": "main"},
8
+ "declaration": {"mode": "archetyped", "archetypes": ["product"], "modifiers": ["user-facing"]},
9
+ "documents": [
10
+ {"id": "readme", "class": "index", "path": "README.md", "maturity": "presence-only", "target_level": "L0", "required": true},
11
+ {"id": "contract-version-status", "class": "index", "path": ".consiliency/status.json", "maturity": "presence-only", "target_level": "L0", "required": true}
12
+ ],
13
+ "interfaces": ".consiliency/interfaces.json"
14
+ },
15
+ "decision": {
16
+ "schema": "consiliency.conformance_decision.v1",
17
+ "status": "accepted",
18
+ "maturity": "presence-only",
19
+ "findings": []
20
+ }
21
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "version-skew-compatible",
3
+ "description": "Contract and package versions in the 0.2 range are compatible.",
4
+ "input": {
5
+ "schema": "consiliency.version_skew_scenario.v1",
6
+ "contract_version": "0.2.0",
7
+ "package_version": "0.2.0"
8
+ },
9
+ "decision": {
10
+ "schema": "consiliency.conformance_decision.v1",
11
+ "status": "accepted",
12
+ "maturity": "presence-only",
13
+ "findings": []
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "version-skew-incompatible-warns",
3
+ "description": "Version skew emits a warning by default during Phase 0.",
4
+ "input": {
5
+ "schema": "consiliency.version_skew_scenario.v1",
6
+ "contract_version": "0.1.0",
7
+ "package_version": "0.2.0"
8
+ },
9
+ "decision": {
10
+ "schema": "consiliency.conformance_decision.v1",
11
+ "status": "warn",
12
+ "maturity": "presence-only",
13
+ "findings": [{"code": "version_skew.incompatible", "severity": "warn", "message": "Contract and package versions are outside the compatible range."}]
14
+ }
15
+ }