@open-agent-toolkit/cli 0.2.4 → 0.2.6

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 (106) hide show
  1. package/assets/docs/cli-utilities/configuration.md +40 -0
  2. package/assets/docs/cli-utilities/tool-packs.md +31 -0
  3. package/assets/docs/workflows/projects/artifacts.md +27 -0
  4. package/assets/docs/workflows/projects/implementation-execution.md +30 -5
  5. package/assets/docs/workflows/skills/explainer-kit.md +125 -0
  6. package/assets/docs/workflows/skills/index.md +4 -0
  7. package/assets/migration/pjm-restructure.md +12 -0
  8. package/assets/public-package-versions.json +4 -4
  9. package/assets/skills/explainer-kit/SKILL.md +95 -0
  10. package/assets/skills/explainer-kit/examples/project-explainer/content.md +31 -0
  11. package/assets/skills/explainer-kit/examples/project-explainer/fact-base.md +22 -0
  12. package/assets/skills/explainer-kit/examples/project-recap/content.md +34 -0
  13. package/assets/skills/explainer-kit/examples/project-recap/fact-base.md +22 -0
  14. package/assets/skills/explainer-kit/examples/theme-bundle.json +87 -0
  15. package/assets/skills/explainer-kit/palettes/ember.json +37 -0
  16. package/assets/skills/explainer-kit/palettes/forest.json +37 -0
  17. package/assets/skills/explainer-kit/palettes/neutral.json +37 -0
  18. package/assets/skills/explainer-kit/palettes/ocean.json +37 -0
  19. package/assets/skills/explainer-kit/palettes/violet.json +37 -0
  20. package/assets/skills/explainer-kit/profiles/clean.json +42 -0
  21. package/assets/skills/explainer-kit/profiles/editorial.json +42 -0
  22. package/assets/skills/explainer-kit/profiles/technical.json +39 -0
  23. package/assets/skills/explainer-kit/recipes/engineer-tour.json +33 -0
  24. package/assets/skills/explainer-kit/recipes/program-recap.json +34 -0
  25. package/assets/skills/explainer-kit/recipes/project-explainer.json +33 -0
  26. package/assets/skills/explainer-kit/recipes/project-recap.json +34 -0
  27. package/assets/skills/explainer-kit/references/contracts.md +101 -0
  28. package/assets/skills/explainer-kit/references/destination-contract.md +94 -0
  29. package/assets/skills/explainer-kit/references/extension-contract.md +71 -0
  30. package/assets/skills/explainer-kit/references/fact-base-contract.md +119 -0
  31. package/assets/skills/explainer-kit/schemas/build-record.schema.json +92 -0
  32. package/assets/skills/explainer-kit/schemas/durability-evidence.schema.json +53 -0
  33. package/assets/skills/explainer-kit/schemas/fact-base.schema.json +129 -0
  34. package/assets/skills/explainer-kit/schemas/manifest.schema.json +193 -0
  35. package/assets/skills/explainer-kit/schemas/publish-receipt.schema.json +97 -0
  36. package/assets/skills/explainer-kit/schemas/publish-request.schema.json +32 -0
  37. package/assets/skills/explainer-kit/schemas/run-request.schema.json +132 -0
  38. package/assets/skills/explainer-kit/schemas/theme.schema.json +217 -0
  39. package/assets/skills/explainer-kit/scripts/lib/content-approval.mjs +180 -0
  40. package/assets/skills/explainer-kit/scripts/lib/contracts.mjs +680 -0
  41. package/assets/skills/explainer-kit/scripts/lib/durability.mjs +538 -0
  42. package/assets/skills/explainer-kit/scripts/lib/fact-base.mjs +494 -0
  43. package/assets/skills/explainer-kit/scripts/lib/fs-safe.mjs +218 -0
  44. package/assets/skills/explainer-kit/scripts/lib/qa.mjs +512 -0
  45. package/assets/skills/explainer-kit/scripts/lib/recipes.mjs +289 -0
  46. package/assets/skills/explainer-kit/scripts/lib/records.mjs +231 -0
  47. package/assets/skills/explainer-kit/scripts/lib/render.mjs +485 -0
  48. package/assets/skills/explainer-kit/scripts/lib/s3-static.mjs +587 -0
  49. package/assets/skills/explainer-kit/scripts/lib/safe-paths.mjs +96 -0
  50. package/assets/skills/explainer-kit/scripts/lib/theme.mjs +332 -0
  51. package/assets/skills/explainer-kit/scripts/publish.mjs +76 -0
  52. package/assets/skills/explainer-kit/scripts/record-durability.mjs +64 -0
  53. package/assets/skills/explainer-kit/scripts/render-qa.mjs +273 -0
  54. package/assets/skills/explainer-kit/scripts/run.mjs +778 -0
  55. package/assets/skills/explainer-kit/scripts/validate.mjs +59 -0
  56. package/assets/skills/explainer-kit/templates/deck-shell.html +233 -0
  57. package/assets/skills/explainer-kit/templates/diagram-shell.html +219 -0
  58. package/assets/skills/explainer-kit/templates/engineer-tour.html +273 -0
  59. package/assets/skills/explainer-kit/templates/house-style.html +218 -0
  60. package/assets/skills/oat-explainer-kit/SKILL.md +92 -0
  61. package/assets/skills/oat-explainer-kit/references/config-contract.md +67 -0
  62. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +143 -0
  63. package/assets/skills/oat-explainer-kit/references/migration.md +143 -0
  64. package/assets/skills/oat-explainer-kit/scripts/bind-project-sources.mjs +103 -0
  65. package/assets/skills/oat-explainer-kit/scripts/check-core.mjs +127 -0
  66. package/assets/skills/oat-explainer-kit/scripts/finalize-tracked-run.mjs +392 -0
  67. package/assets/skills/oat-explainer-kit/scripts/persist-intent.mjs +130 -0
  68. package/assets/skills/oat-explainer-kit/scripts/resolve-config.mjs +293 -0
  69. package/assets/skills/oat-explainer-kit/scripts/resolve-intent.mjs +209 -0
  70. package/assets/skills/oat-explainer-kit/scripts/resolve-paths.mjs +166 -0
  71. package/assets/skills/oat-explainer-kit/scripts/run.mjs +284 -0
  72. package/assets/skills/oat-project-autonomous/SKILL.md +22 -1
  73. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +5 -1
  74. package/assets/skills/oat-project-complete/SKILL.md +166 -28
  75. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +5 -1
  76. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  77. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +84 -9
  78. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +5 -1
  79. package/assets/skills/oat-project-next/SKILL.md +31 -11
  80. package/assets/skills/oat-project-plan/SKILL.md +30 -1
  81. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +5 -1
  82. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +5 -1
  83. package/assets/skills/oat-project-summary/SKILL.md +20 -1
  84. package/assets/templates/state.md +4 -1
  85. package/dist/commands/config/index.d.ts.map +1 -1
  86. package/dist/commands/config/index.js +232 -1
  87. package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
  88. package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
  89. package/dist/commands/init/tools/shared/skill-manifest.js +2 -0
  90. package/dist/commands/project/archive/archive-utils.d.ts +12 -0
  91. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  92. package/dist/commands/project/archive/archive-utils.js +320 -8
  93. package/dist/commands/project/archive/index.d.ts.map +1 -1
  94. package/dist/commands/project/archive/index.js +1 -0
  95. package/dist/commands/project/archive/push-runner.d.ts +1 -0
  96. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  97. package/dist/commands/project/archive/push-runner.js +9 -2
  98. package/dist/config/oat-config.d.ts +26 -0
  99. package/dist/config/oat-config.d.ts.map +1 -1
  100. package/dist/config/oat-config.js +88 -0
  101. package/dist/config/resolve.d.ts.map +1 -1
  102. package/dist/config/resolve.js +18 -0
  103. package/dist/validation/project-state.d.ts +3 -0
  104. package/dist/validation/project-state.d.ts.map +1 -1
  105. package/dist/validation/project-state.js +91 -0
  106. package/package.json +2 -2
@@ -0,0 +1,94 @@
1
+ # S3 static destination contract
2
+
3
+ The `s3-static` connector publishes only files declared as built artifacts in a
4
+ validated manifest. Publishing is human-gated:
5
+
6
+ ```bash
7
+ node scripts/publish.mjs \
8
+ --request /path/to/publish-request.json \
9
+ --receipt /path/to/publish-receipt.json \
10
+ --confirm-publish
11
+ ```
12
+
13
+ The request uses `explainer-kit.publish-request/v1`. Credentials come only from
14
+ the standard AWS credential chain or the request's optional profile. Never put
15
+ access keys, secret keys, session tokens, or SSO tokens in a request.
16
+
17
+ ## Corresponding roots
18
+
19
+ `s3Uri` and `publicBaseUrl` must identify corresponding roots. Both are
20
+ normalized without trailing slashes. For a path `P` relative to `siteRoot`, the
21
+ connector writes `<s3Uri>/P` and verifies `<publicBaseUrl>/P`.
22
+
23
+ For example:
24
+
25
+ | Input | Value |
26
+ | ----------------------- | --------------------------------------------------------------- |
27
+ | `siteRoot` | `/tmp/run/site` |
28
+ | manifest `renderedPath` | `site/initiatives/demo/index.html` |
29
+ | `s3Uri` | `s3://example-bucket/published` |
30
+ | `publicBaseUrl` | `https://cdn.example.com/published` |
31
+ | object | `s3://example-bucket/published/initiatives/demo/index.html` |
32
+ | public URL | `https://cdn.example.com/published/initiatives/demo/index.html` |
33
+
34
+ Use explicit `index.html` URLs. Directory redirects are not portable evidence.
35
+ The destination must serve uploaded bytes at the corresponding public path.
36
+
37
+ ## Safety and ordering
38
+
39
+ The connector validates the request, manifest, paths, hashes, and duplicate
40
+ site-relative paths before network access. It then:
41
+
42
+ 1. uploads a sentinel whose path contains the run ID and a random 128-bit
43
+ suffix;
44
+ 2. verifies the sentinel with `head-object`;
45
+ 3. fetches that exact sentinel through the public root;
46
+ 4. deletes only that sentinel;
47
+ 5. uploads or idempotently skips each declared artifact;
48
+ 6. verifies object metadata, content type, and SHA-256 of the exact response
49
+ bytes from each public artifact URL; and
50
+ 7. atomically writes `explainer-kit.publish-receipt/v1`.
51
+
52
+ If public sentinel verification fails, no artifact is uploaded. The connector
53
+ attempts sentinel cleanup and emits no successful receipt.
54
+
55
+ Publishing is additive. The implementation uses individual `put-object`,
56
+ `head-object`, and sentinel-only `delete-object` operations. It never performs
57
+ root-wide synchronization, never passes a delete flag, never walks or uploads
58
+ undeclared files, and never deletes an artifact object. Existing declared
59
+ objects with matching hash and metadata are skipped; changed declared objects
60
+ may be replaced.
61
+
62
+ ## Metadata
63
+
64
+ Every upload sets metadata explicitly:
65
+
66
+ | File | Content type |
67
+ | ------- | ------------------------------------------------- |
68
+ | `.html` | `text/html; charset=utf-8` |
69
+ | `.json` | `application/json` |
70
+ | `.css` | `text/css; charset=utf-8` |
71
+ | `.js` | `text/javascript; charset=utf-8` |
72
+ | `.svg` | `image/svg+xml` |
73
+ | `.txt` | `text/plain; charset=utf-8` |
74
+ | other | manifest media type or `application/octet-stream` |
75
+
76
+ Artifacts use `Cache-Control: public, max-age=300`. The connector stores the
77
+ SHA-256 digest as object metadata for idempotency and verifies content type,
78
+ cache control, and digest after upload. Public verification hashes response
79
+ bytes without text decoding, so binary artifacts and stale wrong-byte 200
80
+ responses are covered.
81
+
82
+ ## Failures and retries
83
+
84
+ Authentication and permission failures stop immediately. The connector does
85
+ not run `aws sso login`, retry with another profile, expose AWS diagnostics, or
86
+ persist credentials. Refresh credentials separately and rerun after approval.
87
+
88
+ Only transient individual object-operation failures receive bounded retries.
89
+ Input, authorization, root-correspondence, metadata, and public-verification
90
+ failures are not retried. A failed publish preserves the local package.
91
+
92
+ Public roots must be credential-free HTTPS URLs with no username, password,
93
+ query, or fragment. Invalid roots fail before AWS or HTTP operations and are
94
+ never persisted in receipts.
@@ -0,0 +1,71 @@
1
+ # Wrapper extension contract
2
+
3
+ V1 freezes one destination-neutral extension seam:
4
+
5
+ 1. **Pre-resolution:** the caller resolves presets, private source systems,
6
+ accounts, and destination topology without exposing them as public config.
7
+ 2. **`ExplainerRunRequestV1`:** the caller translates only the inputs required
8
+ by `explainer-kit.run-request/v1`.
9
+ 3. **Core run:** the caller invokes `runExplainer(request, options)` once. The
10
+ core owns validation, fact-base processing, content, theme, render, QA, and
11
+ run records.
12
+ 4. **Manifest consumption:** the caller accepts only
13
+ `explainer-kit.manifest/v1`, verifies its run, recipe, and slug identity, and
14
+ reads built artifact paths from the manifest.
15
+ 5. **Post-run linking:** the caller may create companion notes, synchronize
16
+ external documents, or maintain private links from manifest and optional
17
+ publish-receipt data.
18
+
19
+ Private wrappers may retain presets, vault conventions, Google Docs behavior,
20
+ and personal destinations around this seam. Those values are wrapper-owned;
21
+ they are not OAT config keys and must not be discovered by the core.
22
+
23
+ ## Frozen v1 boundary
24
+
25
+ The versioned request, artifact package, manifest, build record, durability
26
+ request, publish request, and publish receipt are the public boundary. V1 has
27
+ no plugin registry and no mid-pipeline callback API for private destinations.
28
+ Provider-neutral callbacks already documented by the core remain explicit run
29
+ options; they do not transfer stage ownership to a wrapper.
30
+
31
+ V1 readers reject unsupported contract majors and identity mismatches rather
32
+ than guessing. Wrappers should preserve unknown future versions for diagnosis,
33
+ stop before post-processing, and migrate deliberately.
34
+
35
+ The compatibility smoke fixture at
36
+ `tools/smoke/explainer-kit/wrapper-compatibility.test.mjs` proves this sequence
37
+ with the actual core. It uses sanitized private-wrapper inputs and is not a
38
+ substitute for the operator-owned release-candidate gate.
39
+
40
+ Release-candidate execution requires the retained tarball directory explicitly:
41
+
42
+ ```bash
43
+ # Pre: resolve private inputs and write the external run request.
44
+ node tools/release/run-explainer-rc.mjs \
45
+ --rc-manifest /path/to/acceptance/rc.json \
46
+ --artifacts-dir /path/to/retained/explainer-kit-rc \
47
+ --entry scripts/run.mjs \
48
+ --record /path/to/acceptance/private-wrapper-execution.json \
49
+ -- --request /path/to/private/request.json
50
+ ```
51
+
52
+ The packaged CLI stdout contract is exactly one complete JSON result document.
53
+ The document may be pretty-printed across lines; progress text and
54
+ line-delimited JSON are not part of this machine framing. The RC runner parses
55
+ the complete document, then binds the request, child-reported manifest, and core
56
+ run ID. It binds a receipt only when the packaged child itself reports that
57
+ output. The sanitized record does not store paths, argument values, credentials,
58
+ or private content.
59
+
60
+ After the core command returns, the wrapper performs its post-run publication
61
+ and linking work. It retains the immutable core manifest as
62
+ `private-wrapper-manifest.json`, the complete `PublishReceiptV1` as
63
+ `private-wrapper-publish-receipt.json`, and its sanitized wrapper result as
64
+ `private-wrapper-result.json`. The wrapper result repeats canonical hashes for
65
+ the request, manifest, and post-run receipt.
66
+
67
+ The wrapper acceptance stage reads those post-run files separately. It
68
+ validates the closed receipt contract, every manifest artifact/hash and
69
+ destination, the run-unique sentinel, the manifest hash, and the core run ID
70
+ against `private-wrapper-execution.json`. Repeating a matching hash cannot make
71
+ a foreign or stale receipt attributable to the packaged run.
@@ -0,0 +1,119 @@
1
+ # Fact-base processing contract
2
+
3
+ `processFactBase(binding, options)` produces one
4
+ `explainer-kit.fact-base/v1` record plus processing diagnostics. It has no
5
+ provider-specific dispatch logic and reads no ambient configuration.
6
+
7
+ ## Result
8
+
9
+ The function resolves to:
10
+
11
+ ```js
12
+ {
13
+ factBase, // valid explainer-kit.fact-base/v1
14
+ checks, // consistency/freshness diagnostics
15
+ critic, // critic invocation and provenance metadata
16
+ }
17
+ ```
18
+
19
+ All claims are cited. Claims that cannot be reconciled remain in
20
+ `unresolvedClaims` with one of the contract's closed reason values.
21
+
22
+ ## Supplied mode
23
+
24
+ Use:
25
+
26
+ ```js
27
+ await processFactBase({
28
+ mode: 'supplied',
29
+ freshnessPolicy: 'live-wins',
30
+ factBase,
31
+ });
32
+ ```
33
+
34
+ The processor validates the supplied v1 record, verifies unique source and
35
+ claim IDs, verifies that every citation names a declared source, verifies that
36
+ every override names a confirmed claim, and compares `generatedAt` plus each
37
+ available source `observedAt` with the freshness window. Staleness produces a
38
+ warning; structural or citation inconsistency rejects the input.
39
+
40
+ Supplied mode never invokes the adversarial critic. Its `critic` result is
41
+ `{ invoked: false, reason: 'supplied-mode-lightweight-check-only' }`.
42
+
43
+ ## Federated mode
44
+
45
+ Each source document contains a schema-compatible source and extracted claims:
46
+
47
+ ```js
48
+ {
49
+ mode: 'federated',
50
+ freshnessPolicy: 'live-wins',
51
+ sourceDocuments: [{
52
+ source: {
53
+ id,
54
+ kind,
55
+ locator,
56
+ revision,
57
+ hash,
58
+ observedAt,
59
+ authoritativeFor,
60
+ },
61
+ claims: [{ id, text, locator }],
62
+ }],
63
+ overrides: [{ claimId, decision, confirmedAt }],
64
+ }
65
+ ```
66
+
67
+ For conflicting text under one claim ID, an `authoritativeFor` declaration
68
+ wins first. Otherwise the newest `observedAt` wins. A tie remains
69
+ `contradictory`. Operator overrides take final precedence, produce an
70
+ `overridden` claim, remain explicit in `overrides`, and suppress critic
71
+ findings for that claim.
72
+
73
+ Federated processing requires `options.critic`, an asynchronous,
74
+ provider-neutral callback. The callback receives only data:
75
+
76
+ ```js
77
+ async function critic({ freshnessPolicy, sources, claims, overrides }) {
78
+ return {
79
+ criticId: 'stable-callback-id',
80
+ executedAt: new Date().toISOString(),
81
+ findings: [
82
+ {
83
+ claimId: 'status',
84
+ classification: 'contradictory',
85
+ text: 'The status sources disagree.',
86
+ sourceIds: ['snapshot', 'live'],
87
+ },
88
+ ],
89
+ };
90
+ }
91
+ ```
92
+
93
+ The seam deliberately contains no provider, model, command, or dispatch
94
+ field. The caller owns critic execution; the core only invokes the callback
95
+ and integrates its returned data.
96
+
97
+ ## Critic provenance
98
+
99
+ Every federated invocation adds one source:
100
+
101
+ ```js
102
+ {
103
+ id: `critic:${criticId}`,
104
+ kind: 'other',
105
+ locator: `critic-callback:${criticId}`,
106
+ hash: canonicalHash(criticResult),
107
+ observedAt: executedAt,
108
+ }
109
+ ```
110
+
111
+ The result's `critic` metadata repeats the stable critic ID, execution time,
112
+ source ID, and canonical result hash. Integrated findings cite both this
113
+ synthetic critic source and every declared source named by the finding. This
114
+ makes the critic's contribution auditable without exposing or depending on a
115
+ provider-specific implementation.
116
+
117
+ Critic classifications map directly to unresolved-claim reasons. A finding
118
+ removes a previously confirmed claim and creates an unresolved claim, or
119
+ updates an already unresolved claim while preserving its existing citations.
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "explainer-kit.build-record/v1",
4
+ "title": "BuildRecordV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "runId",
10
+ "renderStrategy",
11
+ "startedAt",
12
+ "stages",
13
+ "outcome"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": { "const": "explainer-kit.build-record/v1" },
17
+ "runId": { "type": "string", "minLength": 1 },
18
+ "renderStrategy": { "enum": ["default-only", "user-switchable"] },
19
+ "startedAt": { "type": "string", "format": "date-time" },
20
+ "completedAt": { "type": "string", "format": "date-time" },
21
+ "stages": {
22
+ "type": "array",
23
+ "items": { "$ref": "#/$defs/stage" },
24
+ "minItems": 1
25
+ },
26
+ "outcome": {
27
+ "enum": ["built-durable", "built-not-durable", "failed", "incomplete"]
28
+ }
29
+ },
30
+ "$defs": {
31
+ "safeRelativePath": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
35
+ },
36
+ "error": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["code", "message", "recovery"],
40
+ "properties": {
41
+ "code": { "type": "string", "minLength": 1 },
42
+ "message": { "type": "string", "minLength": 1 },
43
+ "recovery": {
44
+ "type": "array",
45
+ "items": { "type": "string", "minLength": 1 },
46
+ "minItems": 1
47
+ }
48
+ }
49
+ },
50
+ "stage": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["id", "status", "outputPaths", "warnings"],
54
+ "properties": {
55
+ "id": {
56
+ "enum": [
57
+ "validate",
58
+ "fact-base",
59
+ "content",
60
+ "theme",
61
+ "render",
62
+ "qa",
63
+ "durability",
64
+ "publish"
65
+ ]
66
+ },
67
+ "status": {
68
+ "enum": [
69
+ "pending",
70
+ "running",
71
+ "passed",
72
+ "warned",
73
+ "failed",
74
+ "skipped"
75
+ ]
76
+ },
77
+ "startedAt": { "type": "string", "format": "date-time" },
78
+ "completedAt": { "type": "string", "format": "date-time" },
79
+ "outputPaths": {
80
+ "type": "array",
81
+ "items": { "$ref": "#/$defs/safeRelativePath" },
82
+ "uniqueItems": true
83
+ },
84
+ "warnings": {
85
+ "type": "array",
86
+ "items": { "type": "string", "minLength": 1 }
87
+ },
88
+ "error": { "$ref": "#/$defs/error" }
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "explainer-kit.durability-evidence/v1",
4
+ "title": "DurabilityEvidenceRequestV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "manifestPath", "evidence"],
8
+ "properties": {
9
+ "schemaVersion": {
10
+ "const": "explainer-kit.durability-evidence/v1"
11
+ },
12
+ "manifestPath": { "type": "string", "minLength": 1 },
13
+ "evidence": {
14
+ "oneOf": [
15
+ {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["kind", "repoRoot", "commit", "paths"],
19
+ "properties": {
20
+ "kind": { "const": "commit" },
21
+ "repoRoot": { "type": "string", "minLength": 1 },
22
+ "commit": {
23
+ "type": "string",
24
+ "pattern": "^[a-f0-9]{7,64}$"
25
+ },
26
+ "paths": {
27
+ "type": "array",
28
+ "items": { "$ref": "#/$defs/safeRelativePath" },
29
+ "minItems": 1,
30
+ "uniqueItems": true
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["kind", "receiptPath"],
38
+ "properties": {
39
+ "kind": { "const": "publish" },
40
+ "receiptPath": { "type": "string", "minLength": 1 }
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "$defs": {
47
+ "safeRelativePath": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "explainer-kit.fact-base/v1",
4
+ "title": "FactBaseV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "generatedAt",
10
+ "mode",
11
+ "freshnessPolicy",
12
+ "sources",
13
+ "claims",
14
+ "unresolvedClaims",
15
+ "overrides"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": { "const": "explainer-kit.fact-base/v1" },
19
+ "generatedAt": { "type": "string", "format": "date-time" },
20
+ "mode": { "enum": ["supplied", "federated"] },
21
+ "freshnessPolicy": { "const": "live-wins" },
22
+ "sources": {
23
+ "type": "array",
24
+ "items": { "$ref": "#/$defs/source" },
25
+ "minItems": 1,
26
+ "uniqueItems": true
27
+ },
28
+ "claims": {
29
+ "type": "array",
30
+ "items": { "$ref": "#/$defs/claim" },
31
+ "uniqueItems": true
32
+ },
33
+ "unresolvedClaims": {
34
+ "type": "array",
35
+ "items": { "$ref": "#/$defs/unresolvedClaim" },
36
+ "uniqueItems": true
37
+ },
38
+ "overrides": {
39
+ "type": "array",
40
+ "items": { "$ref": "#/$defs/override" },
41
+ "uniqueItems": true
42
+ }
43
+ },
44
+ "$defs": {
45
+ "hash": {
46
+ "type": "string",
47
+ "pattern": "^sha256:[a-f0-9]{64}$"
48
+ },
49
+ "source": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["id", "kind", "locator", "hash"],
53
+ "properties": {
54
+ "id": { "type": "string", "minLength": 1 },
55
+ "kind": {
56
+ "enum": ["file", "directory", "git", "github", "session", "other"]
57
+ },
58
+ "locator": { "type": "string", "minLength": 1 },
59
+ "role": { "type": "string", "minLength": 1 },
60
+ "sourceSetId": { "type": "string", "minLength": 1 },
61
+ "revision": { "type": "string", "minLength": 1 },
62
+ "hash": { "$ref": "#/$defs/hash" },
63
+ "observedAt": { "type": "string", "format": "date-time" },
64
+ "authoritativeFor": {
65
+ "type": "array",
66
+ "items": { "type": "string", "minLength": 1 },
67
+ "uniqueItems": true
68
+ }
69
+ }
70
+ },
71
+ "citation": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["sourceId", "locator"],
75
+ "properties": {
76
+ "sourceId": { "type": "string", "minLength": 1 },
77
+ "locator": { "type": "string", "minLength": 1 }
78
+ }
79
+ },
80
+ "claim": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": ["id", "text", "status", "citations"],
84
+ "properties": {
85
+ "id": { "type": "string", "minLength": 1 },
86
+ "text": { "type": "string", "minLength": 1 },
87
+ "status": { "enum": ["confirmed", "overridden"] },
88
+ "citations": {
89
+ "type": "array",
90
+ "items": { "$ref": "#/$defs/citation" },
91
+ "minItems": 1,
92
+ "uniqueItems": true
93
+ }
94
+ }
95
+ },
96
+ "unresolvedClaim": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "required": ["id", "text", "reason", "citations"],
100
+ "properties": {
101
+ "id": { "type": "string", "minLength": 1 },
102
+ "text": { "type": "string", "minLength": 1 },
103
+ "reason": {
104
+ "enum": [
105
+ "contradictory",
106
+ "stale",
107
+ "missing-evidence",
108
+ "needs-confirmation"
109
+ ]
110
+ },
111
+ "citations": {
112
+ "type": "array",
113
+ "items": { "$ref": "#/$defs/citation" },
114
+ "uniqueItems": true
115
+ }
116
+ }
117
+ },
118
+ "override": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["claimId", "decision", "confirmedAt"],
122
+ "properties": {
123
+ "claimId": { "type": "string", "minLength": 1 },
124
+ "decision": { "type": "string", "minLength": 1 },
125
+ "confirmedAt": { "type": "string", "format": "date-time" }
126
+ }
127
+ }
128
+ }
129
+ }