@consiliency/contract 0.0.1 → 0.1.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/README.md +42 -4
- package/conformance/vectors/canonical-html-contract-loaded.json +15 -0
- package/conformance/vectors/interface-invalid-host-path.json +26 -0
- package/conformance/vectors/interface-valid-realized-and-promised.json +36 -0
- package/conformance/vectors/loop-gate-invalid-blocking-default.json +15 -0
- package/conformance/vectors/loop-gate-missing-doc-warns.json +16 -0
- package/conformance/vectors/manifest-invalid-absolute-path.json +20 -0
- package/conformance/vectors/manifest-invalid-certified-maturity.json +20 -0
- package/conformance/vectors/manifest-invalid-path-and-ref.json +20 -0
- package/conformance/vectors/manifest-invalid-unknown-archetype.json +18 -0
- package/conformance/vectors/manifest-valid-baseline-only.json +20 -0
- package/conformance/vectors/manifest-valid-product.json +21 -0
- package/conformance/vectors/version-skew-compatible.json +15 -0
- package/conformance/vectors/version-skew-incompatible-warns.json +15 -0
- package/core/canonical-html/contract-v1.json +459 -0
- package/core/canonical-html/provenance.json +22 -0
- package/core/contract.json +45 -0
- package/core/registries/archetypes.json +62 -0
- package/core/registries/document-classes.json +33 -0
- package/core/registries/maturity-labels.json +22 -0
- package/core/registries/required-documents.json +74 -0
- package/core/schemas/canonical-html-v1.schema.json +15 -0
- package/core/schemas/contract-version-status.schema.json +26 -0
- package/core/schemas/decision.schema.json +26 -0
- package/core/schemas/interface-declaration.schema.json +67 -0
- package/core/schemas/loop-gate-protocol.schema.json +25 -0
- package/core/schemas/loop-gate-scenario.schema.json +25 -0
- package/core/schemas/manifest.schema.json +97 -0
- package/core/schemas/version-skew-protocol.schema.json +32 -0
- package/core/schemas/version-skew-scenario.schema.json +13 -0
- package/package.json +8 -2
- package/src/index.d.ts +7 -1
- package/src/index.js +47 -7
package/README.md
CHANGED
|
@@ -7,12 +7,50 @@ The Consiliency cross-repo **contract package** — the single, neutral rulebook
|
|
|
7
7
|
- the **archetype registry** — `product` / `service` / `library` / `infra` / `tooling-meta` / `experiment` / `document`, plus modifiers (`data-bearing` / `public` / `regulated` / `user-facing`), with `baseline-only` as a legal declaration
|
|
8
8
|
- the required-document sets per archetype (the 7 document classes)
|
|
9
9
|
- the interface-declaration schema (realized + promised cross-repo edges)
|
|
10
|
-
- the loop-gate protocol (presence / freshness / integrity)
|
|
10
|
+
- the loop-gate protocol (presence / freshness / integrity / version-skew)
|
|
11
11
|
- the `canonical_html.v1` display schema
|
|
12
12
|
- the version-skew protocol
|
|
13
13
|
|
|
14
14
|
Dual-published: **npm** [`@consiliency/contract`](https://www.npmjs.com/package/@consiliency/contract) + **PyPI** [`consiliency-contract`](https://pypi.org/project/consiliency-contract/), from shared JSON data + conformance vectors so the two language readers stay byte-identical.
|
|
15
15
|
|
|
16
|
-
> **Status — `
|
|
17
|
-
>
|
|
18
|
-
>
|
|
16
|
+
> **Status — `0.1.0` carries the first normative Phase-0 L0 contract content.**
|
|
17
|
+
> The shared JSON data lives under `core/` and `conformance/`; npm and PyPI
|
|
18
|
+
> readers are intentionally thin loaders over those same bytes.
|
|
19
|
+
|
|
20
|
+
## Reader API
|
|
21
|
+
|
|
22
|
+
JavaScript:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import {
|
|
26
|
+
CONTRACT,
|
|
27
|
+
CONTRACT_VERSION,
|
|
28
|
+
listVectors,
|
|
29
|
+
loadContract,
|
|
30
|
+
loadRegistry,
|
|
31
|
+
loadSchema,
|
|
32
|
+
loadVector,
|
|
33
|
+
} from "@consiliency/contract";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Python:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from consiliency_contract import (
|
|
40
|
+
CONTRACT,
|
|
41
|
+
CONTRACT_VERSION,
|
|
42
|
+
list_vectors,
|
|
43
|
+
load_contract,
|
|
44
|
+
load_registry,
|
|
45
|
+
load_schema,
|
|
46
|
+
load_vector,
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Verification
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npm test
|
|
54
|
+
python -m unittest discover -s tests -p 'test_*.py'
|
|
55
|
+
python -m build
|
|
56
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "canonical-html-contract-loaded",
|
|
3
|
+
"description": "The relocated canonical_html.v1 contract is present with recorded provenance.",
|
|
4
|
+
"input": {
|
|
5
|
+
"contract_path": "core/canonical-html/contract-v1.json",
|
|
6
|
+
"provenance_path": "core/canonical-html/provenance.json",
|
|
7
|
+
"expected_sha256": "3c0c11b7be8b2301409c47416269dd5579fac90f6e7a4e9ca9c3caef50bd2e28"
|
|
8
|
+
},
|
|
9
|
+
"decision": {
|
|
10
|
+
"schema": "consiliency.conformance_decision.v1",
|
|
11
|
+
"status": "accepted",
|
|
12
|
+
"maturity": "hash-checked",
|
|
13
|
+
"findings": []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "interface-invalid-host-path",
|
|
3
|
+
"description": "Local sibling checkout paths are rejected from public interface data.",
|
|
4
|
+
"input": {
|
|
5
|
+
"schema": "consiliency.interface_declaration.v1",
|
|
6
|
+
"repo_id": "governed-pipeline",
|
|
7
|
+
"realized_edges": [
|
|
8
|
+
{
|
|
9
|
+
"id": "bad-path",
|
|
10
|
+
"provider_repo": "spec",
|
|
11
|
+
"consumer_repo": "governed-pipeline",
|
|
12
|
+
"interface_id": "spec-certificate",
|
|
13
|
+
"ref": {"kind": "repo-relative-path", "value": "/absolute/private/spec-certificate-canon.mjs"},
|
|
14
|
+
"maturity": "realized-edge-observed",
|
|
15
|
+
"evidence": []
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"promised_edges": []
|
|
19
|
+
},
|
|
20
|
+
"decision": {
|
|
21
|
+
"schema": "consiliency.conformance_decision.v1",
|
|
22
|
+
"status": "rejected",
|
|
23
|
+
"maturity": "presence-only",
|
|
24
|
+
"findings": [{"code": "interface.ref.host_path", "severity": "block", "message": "Interface refs must not contain host absolute paths."}]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "interface-valid-realized-and-promised",
|
|
3
|
+
"description": "Interface declarations can carry realized and promised edges with safe refs.",
|
|
4
|
+
"input": {
|
|
5
|
+
"schema": "consiliency.interface_declaration.v1",
|
|
6
|
+
"repo_id": "governed-pipeline",
|
|
7
|
+
"realized_edges": [
|
|
8
|
+
{
|
|
9
|
+
"id": "harness-pin",
|
|
10
|
+
"provider_repo": "agent-harness",
|
|
11
|
+
"consumer_repo": "governed-pipeline",
|
|
12
|
+
"interface_id": "phase-loop-cli-entrypoint",
|
|
13
|
+
"ref": {"kind": "git-ref", "value": "v0.1.12"},
|
|
14
|
+
"maturity": "realized-edge-observed",
|
|
15
|
+
"evidence": [{"ref": "tools/agent-harness.pin.json", "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"}]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"promised_edges": [
|
|
19
|
+
{
|
|
20
|
+
"id": "contract-package",
|
|
21
|
+
"provider_repo": "consiliency-contract",
|
|
22
|
+
"consumer_repo": "governed-pipeline",
|
|
23
|
+
"interface_id": "consiliency-contract-v1",
|
|
24
|
+
"ref": {"kind": "package-coordinate", "value": "@consiliency/contract@^0.1.0"},
|
|
25
|
+
"maturity": "presence-only",
|
|
26
|
+
"evidence": []
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"decision": {
|
|
31
|
+
"schema": "consiliency.conformance_decision.v1",
|
|
32
|
+
"status": "accepted",
|
|
33
|
+
"maturity": "realized-edge-observed",
|
|
34
|
+
"findings": []
|
|
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.1.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.1.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.1.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.1.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.1.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.1.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.1 range are compatible.",
|
|
4
|
+
"input": {
|
|
5
|
+
"schema": "consiliency.version_skew_scenario.v1",
|
|
6
|
+
"contract_version": "0.1.0",
|
|
7
|
+
"package_version": "0.1.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.2.0",
|
|
7
|
+
"package_version": "0.1.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
|
+
}
|