@c4a/context-cli 0.7.0 → 0.7.4

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 (219) hide show
  1. package/README.md +18 -39
  2. package/README.zh-CN.md +13 -27
  3. package/cli.js +59230 -80555
  4. package/indexers/bundles/context-code-indexer/SKILL.md +30 -3
  5. package/indexers/bundles/context-code-indexer/context-indexer.yaml +3 -8
  6. package/indexers/bundles/context-code-indexer/references/indexer.md +110 -7
  7. package/indexers/bundles/context-code-indexer/references/metrics.md +143 -37
  8. package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +2 -2
  9. package/indexers/bundles/context-code-indexer/templates/component-library.md +8 -0
  10. package/indexers/bundles/context-code-indexer/templates/gateway-facade.md +16 -0
  11. package/indexers/bundles/context-markdown-indexer/SKILL.md +13 -3
  12. package/indexers/bundles/context-markdown-indexer/context-indexer.yaml +20 -7
  13. package/indexers/bundles/context-markdown-indexer/references/indexer.md +33 -4
  14. package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +30 -14
  15. package/indexers/bundles/context-markdown-indexer/references/structure-and-artifacts.md +6 -0
  16. package/indexers/bundles/context-markdown-indexer/tests/fixtures/anonymous.json +1 -1
  17. package/indexers/bundles/context-markdown-indexer/tests/fixtures/profiles.json +13 -13
  18. package/indexers/bundles/context-markdown-indexer/tests/fixtures/routing.json +122 -0
  19. package/indexers/contracts/operator-contract.json +2 -2
  20. package/indexers/contracts/profile-contract.json +3819 -454
  21. package/indexers/release-manifest.json +22 -22
  22. package/package.json +13 -3
  23. package/plugins/VERSION +1 -1
  24. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  25. package/plugins/claude/commands/context.md +44 -85
  26. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  27. package/plugins/codex/skills/context/SKILL.md +44 -85
  28. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  29. package/plugins/cursor/commands/c4a-context.md +44 -85
  30. package/plugins/skills/context/SKILL.md +44 -85
  31. package/plugins/skills/context-code-indexer/SKILL.md +30 -3
  32. package/plugins/skills/context-code-indexer/context-indexer.yaml +3 -8
  33. package/plugins/skills/context-code-indexer/references/indexer.md +110 -7
  34. package/plugins/skills/context-code-indexer/references/metrics.md +143 -37
  35. package/plugins/skills/context-code-indexer/templates/adapter-integration.md +2 -2
  36. package/plugins/skills/context-code-indexer/templates/component-library.md +8 -0
  37. package/plugins/skills/context-code-indexer/templates/gateway-facade.md +16 -0
  38. package/plugins/skills/context-markdown-indexer/SKILL.md +13 -3
  39. package/plugins/skills/context-markdown-indexer/context-indexer.yaml +20 -7
  40. package/plugins/skills/context-markdown-indexer/references/indexer.md +33 -4
  41. package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +30 -14
  42. package/plugins/skills/context-markdown-indexer/references/structure-and-artifacts.md +6 -0
  43. package/plugins/skills/context-markdown-indexer/tests/fixtures/anonymous.json +1 -1
  44. package/plugins/skills/context-markdown-indexer/tests/fixtures/profiles.json +13 -13
  45. package/plugins/skills/context-markdown-indexer/tests/fixtures/routing.json +122 -0
  46. package/providers/context/actions/advance-current-indexer-lifecycle.yaml +6 -0
  47. package/providers/context/actions/configure-indexer-providers.yaml +1 -1
  48. package/providers/context/actions/materialize-indexer-workset-view.yaml +7 -0
  49. package/providers/context/actions/run-indexer-lifecycle.yaml +7 -0
  50. package/providers/context/actions/run-indexer-post-author-composer.yaml +1 -1
  51. package/providers/context/codes.yaml +9 -49
  52. package/providers/context/graphs/indexer.yaml +75 -592
  53. package/providers/context/graphs/workspace.yaml +25 -500
  54. package/providers/context/manifest.json +110 -1199
  55. package/providers/context/provider.yaml +2 -2
  56. package/providers/context/resources/diagnostics/projection-stale.md +0 -1
  57. package/providers/context/resources/dialogue/human-gates.md +3 -3
  58. package/providers/context/resources/manuals/reference/package-templates.md +2 -3
  59. package/providers/context/resources/manuals/reference/project-api.md +52 -985
  60. package/providers/context/resources/procedures/close-and-build.md +8 -23
  61. package/providers/context/resources/procedures/knowledge-review.md +13 -4
  62. package/providers/context/resources/procedures/source-capture-detailed.md +6 -8
  63. package/providers/context/resources/views/authorized-indexer-workset-view.yaml +15 -0
  64. package/providers/context/resources/views/package-current.yaml +1 -1
  65. package/providers/context/resources/views/resolved-indexer-instructions.yaml +1 -1
  66. package/providers/context/resources/views/review-current.yaml +1 -1
  67. package/providers/context/resources/views/source-boundary.yaml +1 -1
  68. package/providers/context/resources/views/source-current.yaml +1 -1
  69. package/providers/context/resources/views/verification-current.yaml +1 -1
  70. package/providers/context/resources/views/workspace-current.yaml +1 -1
  71. package/providers/context/schemas/indexer-agent-step-input.schema.json +2 -2
  72. package/providers/context/schemas/indexer-agent-step-result.schema.json +298 -32
  73. package/providers/context/schemas/indexer-authorized-workset-view.schema.json +65 -0
  74. package/providers/context/schemas/indexer-contract-overlay-validation-input.schema.json +0 -42
  75. package/providers/context/schemas/indexer-contract-overlay-validation-result.schema.json +27 -122
  76. package/providers/context/schemas/indexer-lifecycle-continuation.schema.json +15 -0
  77. package/providers/context/schemas/indexer-main-lifecycle-input.schema.json +13 -20
  78. package/providers/context/schemas/indexer-main-lifecycle-output.schema.json +17 -2
  79. package/providers/context/schemas/indexer-materialized-resource.schema.json +8 -1
  80. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +55 -6
  81. package/providers/context/schemas/indexer-overlay-question-rebind-input.schema.json +4 -4
  82. package/providers/context/schemas/indexer-workset-view-materialization-request.schema.json +32 -0
  83. package/providers/context/skills/configure-indexer-providers/SKILL.md +40 -27
  84. package/providers/context/skills/run-indexer-agent-step/SKILL.md +34 -8
  85. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +37 -0
  86. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +38 -9
  87. package/docs/document-optimization.md +0 -82
  88. package/docs/document-optimization.zh-CN.md +0 -70
  89. package/indexers/capability-manifest.json +0 -40
  90. package/indexers/contracts/hard-rule-conformance.json +0 -2644
  91. package/providers/context/actions/accept-main-index-run.yaml +0 -7
  92. package/providers/context/actions/accept-material-answer-run.yaml +0 -7
  93. package/providers/context/actions/accept-post-author-composer-run.yaml +0 -7
  94. package/providers/context/actions/actualize-material-answer-bindings.yaml +0 -8
  95. package/providers/context/actions/align-next.yaml +0 -6
  96. package/providers/context/actions/apply-code-index-guidance.yaml +0 -5
  97. package/providers/context/actions/apply-document-optimization-guidance.yaml +0 -5
  98. package/providers/context/actions/apply-structure-confirmation.yaml +0 -5
  99. package/providers/context/actions/audit-material-gap-state.yaml +0 -8
  100. package/providers/context/actions/audit-projected-artifact-fan-out.yaml +0 -8
  101. package/providers/context/actions/authorize-indexer-contract-overlay.yaml +0 -7
  102. package/providers/context/actions/build-main-index-author-worksets.yaml +0 -7
  103. package/providers/context/actions/build-main-index-catalog-fallback.yaml +0 -7
  104. package/providers/context/actions/build-main-index-partition-worksets.yaml +0 -7
  105. package/providers/context/actions/build-material-question-workset.yaml +0 -7
  106. package/providers/context/actions/build-post-author-composer-worksets.yaml +0 -7
  107. package/providers/context/actions/build-question-target-inventory.yaml +0 -7
  108. package/providers/context/actions/build-subject-catalog.yaml +0 -7
  109. package/providers/context/actions/build-target-resolution-views.yaml +0 -7
  110. package/providers/context/actions/checkpoint-material-answer-review.yaml +0 -8
  111. package/providers/context/actions/checkpoint-material-gaps.yaml +0 -8
  112. package/providers/context/actions/close-indexer-approved-knowledge.yaml +0 -8
  113. package/providers/context/actions/compile-next.yaml +0 -5
  114. package/providers/context/actions/compose-indexer-post-author-fragments.yaml +0 -7
  115. package/providers/context/actions/configure-code-extraction.yaml +0 -5
  116. package/providers/context/actions/configure-prose-lifecycle.yaml +0 -5
  117. package/providers/context/actions/converge-main-index-partition-run.yaml +0 -7
  118. package/providers/context/actions/evaluate-material-gaps.yaml +0 -8
  119. package/providers/context/actions/extract-next.yaml +0 -5
  120. package/providers/context/actions/fail-main-index-run.yaml +0 -7
  121. package/providers/context/actions/fail-material-answer-run.yaml +0 -7
  122. package/providers/context/actions/fail-post-author-composer-run.yaml +0 -7
  123. package/providers/context/actions/inspect-code-extraction.yaml +0 -5
  124. package/providers/context/actions/inspect-document-classification.yaml +0 -5
  125. package/providers/context/actions/inspect-index-candidate-review-readiness.yaml +0 -8
  126. package/providers/context/actions/inspect-index-profile-failure.yaml +0 -7
  127. package/providers/context/actions/inspect-material-answer-review.yaml +0 -8
  128. package/providers/context/actions/inspect-structure.yaml +0 -5
  129. package/providers/context/actions/migrate-codeindex.yaml +0 -5
  130. package/providers/context/actions/observe-main-index-run-ledger.yaml +0 -7
  131. package/providers/context/actions/observe-material-answer-runs.yaml +0 -7
  132. package/providers/context/actions/observe-post-author-composer-worksets.yaml +0 -7
  133. package/providers/context/actions/optimize-documents.yaml +0 -6
  134. package/providers/context/actions/override-index-profile-audit.yaml +0 -7
  135. package/providers/context/actions/prepare-main-index-run-ledger.yaml +0 -7
  136. package/providers/context/actions/prepare-material-answer-runs.yaml +0 -7
  137. package/providers/context/actions/preview-extraction-batch.yaml +0 -5
  138. package/providers/context/actions/reconcile-indexer-results.yaml +0 -7
  139. package/providers/context/actions/reconcile-review-identities.yaml +0 -5
  140. package/providers/context/actions/record-index-profile-revision.yaml +0 -7
  141. package/providers/context/actions/report-index-profile-failure.yaml +0 -7
  142. package/providers/context/actions/resolve-effective-composers.yaml +0 -7
  143. package/providers/context/actions/review-material-answer-candidate.yaml +0 -8
  144. package/providers/context/actions/revise-code-index-audit.yaml +0 -5
  145. package/providers/context/actions/revise-document.yaml +0 -5
  146. package/providers/context/actions/revise-index-output.yaml +0 -7
  147. package/providers/context/actions/run-material-answer-indexers.yaml +0 -7
  148. package/providers/context/actions/start-main-index-run.yaml +0 -7
  149. package/providers/context/actions/start-material-answer-run.yaml +0 -7
  150. package/providers/context/actions/start-post-author-composer-run.yaml +0 -7
  151. package/providers/context/actions/submit-code-index-audit.yaml +0 -6
  152. package/providers/context/resources/dialogue/code-extraction.md +0 -87
  153. package/providers/context/resources/dialogue/document-classification.md +0 -33
  154. package/providers/context/resources/dialogue/structure-confirmation.md +0 -44
  155. package/providers/context/resources/dialogue/workflow-mode-after-capture.md +0 -25
  156. package/providers/context/resources/manuals/reference/code-extractors.md +0 -152
  157. package/providers/context/resources/procedures/code-extraction.md +0 -188
  158. package/providers/context/resources/procedures/code-index-audit.md +0 -113
  159. package/providers/context/resources/procedures/document-classification.md +0 -22
  160. package/providers/context/resources/procedures/document-optimization.md +0 -110
  161. package/providers/context/resources/procedures/document-revision.md +0 -36
  162. package/providers/context/resources/procedures/prose-align.md +0 -68
  163. package/providers/context/resources/procedures/prose-compile.md +0 -23
  164. package/providers/context/resources/semantic/align/candidate-resolution.md +0 -106
  165. package/providers/context/resources/semantic/align/density-profile.md +0 -41
  166. package/providers/context/resources/semantic/align/gates.md +0 -276
  167. package/providers/context/resources/semantic/align/structure-planning.md +0 -337
  168. package/providers/context/resources/semantic/code-index/classification.md +0 -270
  169. package/providers/context/resources/semantic/code-index/templates/adapter.md +0 -118
  170. package/providers/context/resources/semantic/code-index/templates/api-service.md +0 -116
  171. package/providers/context/resources/semantic/code-index/templates/background-runtime.md +0 -109
  172. package/providers/context/resources/semantic/code-index/templates/cli-tool.md +0 -129
  173. package/providers/context/resources/semantic/code-index/templates/contract-source.md +0 -73
  174. package/providers/context/resources/semantic/code-index/templates/contracts-and-chains.md +0 -81
  175. package/providers/context/resources/semantic/code-index/templates/cross-module-chain.md +0 -78
  176. package/providers/context/resources/semantic/code-index/templates/derived-source.md +0 -116
  177. package/providers/context/resources/semantic/code-index/templates/domain-service.md +0 -109
  178. package/providers/context/resources/semantic/code-index/templates/event-flow.md +0 -62
  179. package/providers/context/resources/semantic/code-index/templates/monorepo-container.md +0 -124
  180. package/providers/context/resources/semantic/code-index/templates/persistence-boundary.md +0 -56
  181. package/providers/context/resources/semantic/code-index/templates/plugin-extension.md +0 -52
  182. package/providers/context/resources/semantic/code-index/templates/protocol-boundary.md +0 -88
  183. package/providers/context/resources/semantic/code-index/templates/sdk-library.md +0 -132
  184. package/providers/context/resources/semantic/code-index/templates/web-application.md +0 -145
  185. package/providers/context/resources/semantic/compile/index.md +0 -31
  186. package/providers/context/resources/views/code-index-audit.yaml +0 -6
  187. package/providers/context/resources/views/document-optimization-current.yaml +0 -6
  188. package/providers/context/resources/views/extraction-preview.yaml +0 -6
  189. package/providers/context/resources/views/structure-current.yaml +0 -6
  190. package/providers/context/schemas/code-index-audit-decision.schema.json +0 -94
  191. package/providers/context/schemas/document-optimization-decisions.schema.json +0 -57
  192. package/providers/context/schemas/indexer-candidate-review-readiness-input.schema.json +0 -46
  193. package/providers/context/schemas/indexer-candidate-review-readiness-output.schema.json +0 -104
  194. package/providers/context/schemas/indexer-contract-overlay-authorization-input.schema.json +0 -32
  195. package/providers/context/schemas/indexer-contract-overlay-authorization-result.schema.json +0 -121
  196. package/providers/context/schemas/indexer-material-answer-lifecycle-input.schema.json +0 -90
  197. package/providers/context/schemas/indexer-material-answer-lifecycle-output.schema.json +0 -80
  198. package/providers/context/schemas/indexer-material-answer-review-inspection-input.schema.json +0 -32
  199. package/providers/context/schemas/indexer-material-answer-review-inspection-output.schema.json +0 -32
  200. package/providers/context/schemas/indexer-material-answer-review-resolution-input.schema.json +0 -19
  201. package/providers/context/schemas/indexer-material-answer-review-resolution-output.schema.json +0 -87
  202. package/providers/context/schemas/indexer-material-gap-lifecycle-input.schema.json +0 -86
  203. package/providers/context/schemas/indexer-material-gap-lifecycle-output.schema.json +0 -19
  204. package/providers/context/schemas/indexer-post-author-fragment-result.schema.json +0 -18
  205. package/providers/context/schemas/indexer-post-author-lifecycle-input.schema.json +0 -94
  206. package/providers/context/schemas/indexer-post-author-lifecycle-output.schema.json +0 -72
  207. package/providers/context/schemas/indexer-profile-failure-inspection-input.schema.json +0 -13
  208. package/providers/context/schemas/indexer-profile-failure-inspection-result.schema.json +0 -19
  209. package/providers/context/schemas/indexer-profile-failure-report-input.schema.json +0 -22
  210. package/providers/context/schemas/indexer-profile-failure-report-result.schema.json +0 -49
  211. package/providers/context/schemas/indexer-profile-override-decision.schema.json +0 -20
  212. package/providers/context/schemas/indexer-profile-override-result.schema.json +0 -49
  213. package/providers/context/schemas/indexer-profile-revision-agent-input.schema.json +0 -18
  214. package/providers/context/schemas/indexer-profile-revision-record-input.schema.json +0 -31
  215. package/providers/context/schemas/indexer-profile-revision-record-result.schema.json +0 -45
  216. package/providers/context/schemas/indexer-result-reconciliation-input.schema.json +0 -59
  217. package/providers/context/schemas/indexer-result-reconciliation-output.schema.json +0 -43
  218. package/providers/context/schemas/prose-structure-batch.schema.json +0 -35
  219. package/providers/context/skills/revise-index-output/SKILL.md +0 -12
@@ -6,29 +6,23 @@ mediaType: text/markdown
6
6
 
7
7
  # Close and build
8
8
 
9
- Close deterministically reconciles approved Markdown, existing durable machine
10
- metadata, and confirmed structure snapshots into `knowledge/structure.yaml`.
11
- It then compacts repeated machine fields out of each Markdown page and validates
12
- the hydrated result. When an approved page still points at a captured source asset,
13
- close may mechanically replace that target with its content-addressed
14
- `knowledge/assets` path; it does not rewrite reader-visible prose. Before
15
- removing the transient snapshots, it retains only each closed prose target's
16
- source, collection, and consumed snapshot hash under `source_inputs`.
9
+ Close deterministically reconciles approved Markdown and current relationship
10
+ inputs into `knowledge/structure.yaml`. It compacts repeated machine fields out
11
+ of each Markdown page and validates the hydrated result. When an approved page
12
+ still points at a captured source asset, close may mechanically replace that
13
+ target with its content-addressed `knowledge/assets` path; it does not rewrite
14
+ reader-visible prose. Candidate fingerprints, Section mappings, old prose
15
+ `source_inputs`, and Review receipts remain outside long-lived knowledge.
17
16
 
18
17
  Do not hand-edit, duplicate, or move fields between Markdown and
19
18
  `structure.yaml`. The CLI owns compaction and hydration. A compact Markdown page
20
19
  remains readable and keeps enough identity for projection diagnostics; complete
21
- code and optimization metadata is intentionally not duplicated.
20
+ code lifecycle metadata is intentionally not duplicated.
22
21
 
23
22
  Build runs only after close and verification are current. It writes declared
24
23
  packages under `dist/` and records an inventory receipt with added, updated,
25
24
  removed, and index changes.
26
25
 
27
- When document optimization is enabled, its current revision batch must also be
28
- resolved before build. Build compiles each approved page through its optional
29
- `__revision.md` sidecar and records the policy and decision counts in the
30
- package inventory. Revision sidecars are never emitted as separate knowledge.
31
-
32
26
  Run only the current route command, then evaluate again. A successful build
33
27
  means the currently declared scope is current; newly captured or newly declared
34
28
  targets can reopen earlier graph nodes.
@@ -40,12 +34,3 @@ review decision in this conversation, together with its reviewed scope. Omit
40
34
  the section when no report was user-reviewed. Do not reconstruct it by scanning
41
35
  `.tmp`, invent a shareable URL, or classify fully managed or force approval as
42
36
  user review.
43
- # Code-index audit record
44
-
45
- When a package selects approved `codeindex` pages, build requires the current
46
- batch-level Agent audit to be accepted. The complete report and decision state
47
- are runtime data below `.tmp/context-runtime/code-index-audit/`; deleting
48
- `.tmp/` causes Context to recompute and re-audit them. They are not copied into
49
- `dist/`, uploaded with the package, or committed as knowledge. The package
50
- inventory stores only the report digest, decision, and compact summary needed
51
- to identify the audited build.
@@ -23,7 +23,7 @@ authorization.
23
23
  Without explicit session-managed authority:
24
24
 
25
25
  - open the report returned by the route;
26
- - let the user approve or reject candidates;
26
+ - let the user publish or durably omit candidates;
27
27
  - apply the exact returned decision payload; and
28
28
  - retain the exact report reference and reviewed scope in this conversation for
29
29
  the final completion summary.
@@ -34,10 +34,19 @@ Use it only after the user cannot use the report and explicitly replies with
34
34
  the exact phrase `强制批准` in the current conversation. It approves the complete
35
35
  current scope atomically; no candidate-specific decisions are inferred.
36
36
 
37
- With explicit session-managed authority, Context may approve the complete
38
- current batch atomically. The authority exists only in the current
37
+ With explicit session-managed authority, first run the read-only Review HTML
38
+ command, then read the complete generated report and every reader-facing
39
+ Candidate in its current scope. Only after deciding that the whole batch is
40
+ publishable may the Agent run the managed atomic approval command. If any page
41
+ needs repair, do not approve the batch; reopen the owning Author or Composer
42
+ through the current repair route. The authority exists only in the current
39
43
  conversation. It does not bypass source permission, validation, close, or
40
- verify.
44
+ verify, and it is not proof that the report was read.
41
45
 
42
46
  After apply, re-evaluate. Do not infer that close or package output is current.
43
47
  Do not persist a duplicate review-report ledger in the workspace.
48
+
49
+ The Review UI names the internal `rejected` decision **Omit** because it is a
50
+ durable content decision, not a request to rewrite the page. When a page needs
51
+ changes, leave the whole batch unapplied and use `context revise` so the owning
52
+ Author or Composer produces a new Candidate through the same lifecycle.
@@ -164,9 +164,9 @@ capture result:
164
164
  nested Skill or Schema. These conditional resources are intentionally absent
165
165
  from the Route's ordinary `resources.required`.
166
166
 
167
- Never suggest prose compile or hand-built document knowledge for a code-only
168
- source. Code sources become active knowledge only through the declared
169
- extraction/review route returned by `context status`.
167
+ Never hand-build document knowledge for a code-only source. Code sources become
168
+ active knowledge only through the current Indexer route returned by
169
+ `context status`.
170
170
 
171
171
  If capture is rejected because another phase or write gate is active, do not
172
172
  discard it automatically. Explain the active state from `context status`, follow
@@ -192,11 +192,9 @@ Stable structure:
192
192
  summarize each as a single line naming the work and which sources are
193
193
  affected. Omit the section entirely when there is no pending follow-up.
194
194
  4. Next step. Single command suggestion driven by status: the returned
195
- `context run align:<type>:<source>:<collection> ...` command when structure work is
196
- pending, the returned `context run compile:<type>:<source>:<collection> ...`
197
- command when prose compile work is pending, or the CLI-owned code projection
198
- command when code projection is pending. If nothing is pending, say so
199
- explicitly.
195
+ current Indexer command when semantic structure or authoring work is pending,
196
+ or the CLI-owned capture command when another confirmed source remains. If
197
+ nothing is pending, say so explicitly.
200
198
 
201
199
  Do not include raw CLI diagnostics, agent_hints content, schema names, or phase
202
200
  payload identifiers in the report. Those belong in earlier troubleshooting
@@ -0,0 +1,15 @@
1
+ schema: agent-graph.resource.host-action.v1
2
+ id: authorized-indexer-workset-view
3
+ kind: procedure
4
+ mediaType: application/json
5
+ materializer: actions/materialize-indexer-workset-view.yaml
6
+ input:
7
+ protocol: context.indexer.workset-view-materialization-request/v1
8
+ handler: context.materialize-indexer-workset-view/v1
9
+ resource_id: authorized-indexer-workset-view
10
+ workset_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
11
+ execution_request_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
12
+ view_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
13
+ payload_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
14
+ request_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
15
+ description: Runtime-bound authorized evidence for one exact Indexer workset; Context replaces the reserved template before exposing the Route.
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.package-current
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v2
1
+ schema: agent-graph.resource.host-action.v1
2
2
  id: resolved-indexer-instructions
3
3
  kind: procedure
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.review-current
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.source-boundary
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.source-current
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.verification-current
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -1,4 +1,4 @@
1
- schema: agent-graph.resource.v1
1
+ schema: agent-graph.resource.graph-action.v1
2
2
  id: context.workspace-current
3
3
  kind: context-view
4
4
  mediaType: text/markdown
@@ -10,8 +10,8 @@
10
10
  "type": "object",
11
11
  "required": ["protocol", "operation", "workset", "composition_input", "final_authority", "execution_request_digest"],
12
12
  "properties": {
13
- "protocol": { "const": "context.indexer.run-request/v1" },
14
- "operation": { "enum": ["main-index", "material-answer"] },
13
+ "protocol": { "const": "context.indexer.run-request/v2" },
14
+ "operation": { "const": "main-index" },
15
15
  "workset": { "type": "object" },
16
16
  "composition_input": { "type": "object" },
17
17
  "final_authority": { "type": "object" },
@@ -1,47 +1,313 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.agent-step-result/v1",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": [
7
- "protocol",
8
- "input_digest",
9
- "instruction_payload_digest",
10
- "run_result",
11
- "execution_receipt",
12
- "stable_result_digest"
3
+ "$id": "context.indexer.current-action-input/v1",
4
+ "oneOf": [
5
+ { "$ref": "#/$defs/providerSelection" },
6
+ { "$ref": "#/$defs/providerResolution" },
7
+ { "$ref": "#/$defs/providerProgramAuthorization" },
8
+ { "$ref": "#/$defs/providerFinalization" },
9
+ { "$ref": "#/$defs/partition" },
10
+ { "$ref": "#/$defs/author" },
11
+ { "$ref": "#/$defs/postAuthor" },
12
+ { "$ref": "#/$defs/structureReview" },
13
+ { "$ref": "#/$defs/layoutConfirmation" }
13
14
  ],
14
- "properties": {
15
- "protocol": { "const": "context.indexer.agent-step-result/v1" },
16
- "input_digest": { "$ref": "#/$defs/digest" },
17
- "instruction_payload_digest": { "$ref": "#/$defs/digest" },
18
- "run_result": {
15
+ "$defs": {
16
+ "string": { "type": "string", "minLength": 1 },
17
+ "providerSelection": {
19
18
  "type": "object",
20
- "required": ["protocol", "operation", "result"],
19
+ "additionalProperties": false,
20
+ "required": ["stage", "host_visible_skills", "indexers"],
21
21
  "properties": {
22
- "protocol": { "const": "context.indexer.run-result/v1" },
23
- "operation": { "enum": ["main-index", "material-answer"] },
24
- "result": { "type": "object" }
22
+ "stage": { "const": "provider-selection" },
23
+ "host_visible_skills": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["skill", "version", "source_type"],
29
+ "properties": {
30
+ "skill": { "$ref": "#/$defs/string" },
31
+ "version": { "oneOf": [{ "$ref": "#/$defs/string" }, { "type": "null" }] },
32
+ "source_type": {
33
+ "enum": ["community-plugin", "workspace", "installed-plugin", "marketplace"]
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "indexers": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "items": { "type": "object" }
42
+ }
25
43
  }
26
44
  },
27
- "execution_receipt": {
45
+ "providerResolution": {
28
46
  "type": "object",
29
47
  "additionalProperties": false,
30
- "required": ["adapter", "adapter_version", "execution_id", "receipt_digest"],
48
+ "required": ["stage", "result"],
31
49
  "properties": {
32
- "adapter": { "type": "string", "minLength": 1 },
33
- "adapter_version": { "type": "string", "minLength": 1 },
34
- "model": { "type": "string", "minLength": 1 },
35
- "execution_id": { "type": "string", "minLength": 1 },
36
- "receipt_digest": { "$ref": "#/$defs/digest" }
50
+ "stage": { "const": "provider-resolution" },
51
+ "result": { "type": "object" },
52
+ "managed_output": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["ref", "digest", "value"],
56
+ "properties": {
57
+ "ref": { "$ref": "#/$defs/string" },
58
+ "digest": { "$ref": "#/$defs/string" },
59
+ "value": {}
60
+ }
61
+ }
37
62
  }
38
63
  },
39
- "stable_result_digest": { "$ref": "#/$defs/digest" }
40
- },
41
- "$defs": {
42
- "digest": {
43
- "type": "string",
44
- "pattern": "^sha256:[a-f0-9]{64}$"
64
+ "providerFinalization": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": ["stage"],
68
+ "properties": {
69
+ "stage": { "const": "provider-finalization" }
70
+ }
71
+ },
72
+ "providerProgramAuthorization": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["stage", "decision"],
76
+ "properties": {
77
+ "stage": { "const": "provider-program-authorization" },
78
+ "decision": { "enum": ["approved", "rejected"] }
79
+ }
80
+ },
81
+ "partition": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["stage", "outcome", "unit_type", "partition_axis", "groups", "excluded", "unsupported"],
85
+ "properties": {
86
+ "stage": { "const": "partition" },
87
+ "outcome": { "enum": ["complete", "failed"] },
88
+ "unit_type": { "$ref": "#/$defs/string" },
89
+ "partition_axis": { "$ref": "#/$defs/string" },
90
+ "groups": { "type": "array", "items": { "$ref": "#/$defs/partitionGroup" } },
91
+ "excluded": { "type": "array", "items": { "$ref": "#/$defs/excluded" } },
92
+ "unsupported": { "type": "array", "items": { "$ref": "#/$defs/unsupported" } },
93
+ "failure": { "$ref": "#/$defs/failure" }
94
+ },
95
+ "allOf": [
96
+ {
97
+ "if": { "properties": { "outcome": { "const": "failed" } } },
98
+ "then": { "required": ["failure"] }
99
+ }
100
+ ]
101
+ },
102
+ "partitionGroup": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["key", "title", "reader_task", "subject", "subject_intent", "members", "questions", "question_targets", "outline"],
106
+ "properties": {
107
+ "key": { "$ref": "#/$defs/string" },
108
+ "title": { "$ref": "#/$defs/string" },
109
+ "reader_task": { "$ref": "#/$defs/string" },
110
+ "subject": {
111
+ "oneOf": [
112
+ { "$ref": "#/$defs/string" },
113
+ {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["namespace", "kind", "local_key"],
117
+ "properties": {
118
+ "namespace": { "$ref": "#/$defs/string" },
119
+ "kind": { "$ref": "#/$defs/string" },
120
+ "local_key": { "$ref": "#/$defs/string" }
121
+ }
122
+ }
123
+ ]
124
+ },
125
+ "subject_intent": { "enum": ["primary", "enrich-or-independent"] },
126
+ "members": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/string" } },
127
+ "questions": { "type": "array", "items": { "$ref": "#/$defs/string" } },
128
+ "question_targets": { "type": "array", "items": { "$ref": "#/$defs/questionTarget" } },
129
+ "outline": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/string" } }
130
+ }
131
+ },
132
+ "questionTarget": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["target", "role"],
136
+ "properties": {
137
+ "target": { "$ref": "#/$defs/string" },
138
+ "role": { "enum": ["primary-carrier", "enricher"] }
139
+ }
140
+ },
141
+ "excluded": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": ["item", "reason_code"],
145
+ "properties": {
146
+ "item": { "$ref": "#/$defs/string" },
147
+ "reason_code": { "$ref": "#/$defs/string" }
148
+ }
149
+ },
150
+ "unsupported": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": ["item", "missing_capabilities"],
154
+ "properties": {
155
+ "item": { "$ref": "#/$defs/string" },
156
+ "missing_capabilities": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/string" } }
157
+ }
158
+ },
159
+ "failure": {
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": ["code", "message", "unassigned"],
163
+ "properties": {
164
+ "code": { "enum": ["unsupported-domain", "no-stable-axis", "insufficient-identity-facts", "invalid-input", "strategy-failed"] },
165
+ "message": { "$ref": "#/$defs/string" },
166
+ "unassigned": { "type": "array", "items": { "$ref": "#/$defs/string" } },
167
+ "missing_capabilities": { "type": "array", "items": { "$ref": "#/$defs/string" } },
168
+ "missing_sources": { "type": "array", "items": { "$ref": "#/$defs/string" } }
169
+ }
170
+ },
171
+ "author": {
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": ["stage", "group_key", "outcome", "target_resolutions", "sections", "member_dispositions", "material_gaps", "diagnostics"],
175
+ "properties": {
176
+ "stage": { "const": "author" },
177
+ "group_key": { "$ref": "#/$defs/string" },
178
+ "outcome": { "enum": ["publish", "catalog-only", "request-material", "unsupported"] },
179
+ "artifact_intent": { "$ref": "#/$defs/string" },
180
+ "policy": { "$ref": "#/$defs/string" },
181
+ "target_resolutions": { "type": "array", "items": { "$ref": "#/$defs/targetResolution" } },
182
+ "title": { "$ref": "#/$defs/string" },
183
+ "summary": { "$ref": "#/$defs/string" },
184
+ "sections": { "type": "array", "items": { "$ref": "#/$defs/authorSection" } },
185
+ "member_dispositions": { "type": "array", "items": { "$ref": "#/$defs/memberDisposition" } },
186
+ "material_gaps": { "type": "array", "items": { "$ref": "#/$defs/materialGap" } },
187
+ "diagnostics": { "type": "array", "items": { "$ref": "#/$defs/diagnostic" } }
188
+ }
189
+ },
190
+ "targetResolution": {
191
+ "type": "object",
192
+ "additionalProperties": false,
193
+ "required": ["target", "disposition"],
194
+ "properties": {
195
+ "target": { "$ref": "#/$defs/string" },
196
+ "disposition": { "enum": ["reuse-existing", "create-independent", "unresolved"] },
197
+ "reason_code": { "$ref": "#/$defs/string" }
198
+ }
199
+ },
200
+ "authorSection": {
201
+ "type": "object",
202
+ "additionalProperties": false,
203
+ "required": ["key", "heading", "markdown", "source_items", "facts", "answers"],
204
+ "properties": {
205
+ "key": { "$ref": "#/$defs/string" },
206
+ "heading": { "$ref": "#/$defs/string" },
207
+ "markdown": { "$ref": "#/$defs/string" },
208
+ "source_items": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/string" } },
209
+ "facts": { "type": "array", "items": { "$ref": "#/$defs/string" } },
210
+ "answers": { "type": "array", "items": { "$ref": "#/$defs/string" } }
211
+ }
212
+ },
213
+ "memberDisposition": {
214
+ "type": "object",
215
+ "additionalProperties": false,
216
+ "required": ["item", "state"],
217
+ "properties": {
218
+ "item": { "$ref": "#/$defs/string" },
219
+ "state": { "enum": ["covered", "catalog-only", "unsupported"] },
220
+ "section": { "$ref": "#/$defs/string" },
221
+ "reason_code": { "$ref": "#/$defs/string" }
222
+ }
223
+ },
224
+ "materialGap": {
225
+ "type": "object",
226
+ "additionalProperties": false,
227
+ "required": ["question", "source_hints"],
228
+ "properties": {
229
+ "question": { "$ref": "#/$defs/string" },
230
+ "source_hints": { "type": "array", "items": { "$ref": "#/$defs/string" } }
231
+ }
232
+ },
233
+ "diagnostic": {
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": ["code", "message"],
237
+ "properties": {
238
+ "code": { "$ref": "#/$defs/string" },
239
+ "message": { "$ref": "#/$defs/string" },
240
+ "target": { "$ref": "#/$defs/string" }
241
+ }
242
+ },
243
+ "postAuthor": {
244
+ "type": "object",
245
+ "additionalProperties": false,
246
+ "required": ["stage", "outcome", "proposals", "diagnostics"],
247
+ "properties": {
248
+ "stage": { "const": "post-author" },
249
+ "outcome": { "enum": ["complete", "failed"] },
250
+ "proposals": {
251
+ "type": "array",
252
+ "items": {
253
+ "type": "object",
254
+ "additionalProperties": false,
255
+ "required": ["target", "artifact_kind", "title", "summary", "sections"],
256
+ "properties": {
257
+ "target": { "$ref": "#/$defs/string" },
258
+ "artifact_kind": { "$ref": "#/$defs/string" },
259
+ "title": { "$ref": "#/$defs/string" },
260
+ "summary": { "$ref": "#/$defs/string" },
261
+ "sections": {
262
+ "type": "array",
263
+ "minItems": 1,
264
+ "items": {
265
+ "type": "object",
266
+ "additionalProperties": false,
267
+ "required": ["key", "heading", "markdown", "source_refs"],
268
+ "properties": {
269
+ "key": { "$ref": "#/$defs/string" },
270
+ "heading": { "$ref": "#/$defs/string" },
271
+ "markdown": { "$ref": "#/$defs/string" },
272
+ "source_refs": {
273
+ "type": "array",
274
+ "minItems": 1,
275
+ "items": { "$ref": "#/$defs/string" }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+ },
283
+ "diagnostics": { "type": "array", "items": { "$ref": "#/$defs/diagnostic" } }
284
+ },
285
+ "allOf": [
286
+ {
287
+ "if": { "properties": { "outcome": { "const": "failed" } } },
288
+ "then": { "properties": { "diagnostics": { "minItems": 1 } } }
289
+ }
290
+ ]
291
+ },
292
+ "structureReview": {
293
+ "type": "object",
294
+ "additionalProperties": false,
295
+ "required": ["stage", "decision"],
296
+ "properties": {
297
+ "stage": { "const": "structure-review" },
298
+ "decision": { "enum": ["approved", "request-adjustment"] },
299
+ "feedback": { "$ref": "#/$defs/string" }
300
+ }
301
+ },
302
+ "layoutConfirmation": {
303
+ "type": "object",
304
+ "additionalProperties": false,
305
+ "required": ["stage", "decision"],
306
+ "properties": {
307
+ "stage": { "const": "layout-confirmation" },
308
+ "decision": { "enum": ["approved", "rejected"] },
309
+ "feedback": { "$ref": "#/$defs/string" }
310
+ }
45
311
  }
46
312
  }
47
313
  }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "context.indexer.authorized-workset-view/v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "protocol",
8
+ "operation",
9
+ "stage",
10
+ "workset_digest",
11
+ "execution_request_digest",
12
+ "source_ref",
13
+ "module_ref",
14
+ "projection_input_digests",
15
+ "items",
16
+ "view_digest"
17
+ ],
18
+ "properties": {
19
+ "protocol": { "const": "context.indexer.authorized-workset-view/v1" },
20
+ "operation": { "const": "main-index" },
21
+ "stage": { "enum": ["partition", "author"] },
22
+ "workset_digest": { "$ref": "#/$defs/digest" },
23
+ "execution_request_digest": { "$ref": "#/$defs/digest" },
24
+ "source_ref": { "type": "string", "minLength": 1 },
25
+ "module_ref": { "type": ["string", "null"] },
26
+ "projection_input_digests": {
27
+ "type": "array",
28
+ "minItems": 1,
29
+ "uniqueItems": true,
30
+ "items": { "$ref": "#/$defs/digest" }
31
+ },
32
+ "items": {
33
+ "type": "array",
34
+ "minItems": 1,
35
+ "items": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": ["ref", "category", "provenance", "value", "item_digest"],
39
+ "properties": {
40
+ "ref": { "type": "string", "minLength": 1 },
41
+ "category": { "type": "string", "minLength": 1 },
42
+ "provenance": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["protocol", "digest"],
46
+ "properties": {
47
+ "protocol": { "type": "string", "minLength": 1 },
48
+ "digest": { "$ref": "#/$defs/digest" },
49
+ "container_ref": { "type": "string", "minLength": 1 }
50
+ }
51
+ },
52
+ "value": {},
53
+ "item_digest": { "$ref": "#/$defs/digest" }
54
+ }
55
+ }
56
+ },
57
+ "view_digest": { "$ref": "#/$defs/digest" }
58
+ },
59
+ "$defs": {
60
+ "digest": {
61
+ "type": "string",
62
+ "pattern": "^sha256:[a-f0-9]{64}$"
63
+ }
64
+ }
65
+ }