@c4a/context-cli 0.7.1 → 0.7.5

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 (161) hide show
  1. package/README.md +18 -39
  2. package/README.zh-CN.md +13 -27
  3. package/cli.js +64945 -81995
  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 +12 -2
  23. package/plugins/VERSION +1 -1
  24. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  25. package/plugins/claude/commands/context.md +56 -107
  26. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  27. package/plugins/codex/skills/context/SKILL.md +56 -107
  28. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  29. package/plugins/cursor/commands/c4a-context.md +56 -107
  30. package/plugins/skills/context/SKILL.md +56 -107
  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/authorize-current-indexer-provider-program.yaml +6 -0
  48. package/providers/context/actions/configure-indexer-providers.yaml +1 -1
  49. package/providers/context/actions/finalize-current-indexer-provider-selection.yaml +5 -0
  50. package/providers/context/actions/materialize-indexer-workset-view.yaml +7 -0
  51. package/providers/context/actions/resolve-current-indexer-gate.yaml +6 -0
  52. package/providers/context/actions/resolve-current-indexer-provider.yaml +6 -0
  53. package/providers/context/actions/run-indexer-lifecycle.yaml +0 -1
  54. package/providers/context/actions/run-indexer-post-author-composer.yaml +2 -2
  55. package/providers/context/codes.yaml +8 -22
  56. package/providers/context/graphs/indexer.yaml +95 -564
  57. package/providers/context/graphs/workspace.yaml +5 -43
  58. package/providers/context/manifest.json +119 -678
  59. package/providers/context/provider.yaml +1 -1
  60. package/providers/context/resources/dialogue/human-gates.md +3 -3
  61. package/providers/context/resources/dialogue/knowledge-review.md +6 -3
  62. package/providers/context/resources/manuals/reference/package-templates.md +2 -3
  63. package/providers/context/resources/manuals/reference/project-api.md +52 -986
  64. package/providers/context/resources/procedures/close-and-build.md +8 -23
  65. package/providers/context/resources/procedures/knowledge-review.md +17 -5
  66. package/providers/context/resources/procedures/source-capture-detailed.md +6 -8
  67. package/providers/context/resources/views/authorized-indexer-workset-view.yaml +15 -0
  68. package/providers/context/resources/views/resolved-indexer-instructions.yaml +2 -4
  69. package/providers/context/schemas/indexer-agent-step-input.schema.json +71 -21
  70. package/providers/context/schemas/indexer-agent-step-result.schema.json +385 -32
  71. package/providers/context/schemas/indexer-authorized-workset-view.schema.json +65 -0
  72. package/providers/context/schemas/indexer-main-lifecycle-input.schema.json +13 -20
  73. package/providers/context/schemas/indexer-main-lifecycle-output.schema.json +17 -2
  74. package/providers/context/schemas/indexer-materialize-request.schema.json +4 -8
  75. package/providers/context/schemas/indexer-materialized-resource.schema.json +8 -1
  76. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +51 -2
  77. package/providers/context/schemas/indexer-workset-view-materialization-request.schema.json +35 -0
  78. package/providers/context/skills/authorize-current-indexer-provider-program/SKILL.md +20 -0
  79. package/providers/context/skills/configure-indexer-providers/SKILL.md +47 -33
  80. package/providers/context/skills/resolve-current-indexer-gate/SKILL.md +27 -0
  81. package/providers/context/skills/resolve-current-indexer-provider/SKILL.md +20 -0
  82. package/providers/context/skills/run-indexer-agent-step/SKILL.md +49 -10
  83. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +19 -13
  84. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +52 -11
  85. package/docs/document-optimization.md +0 -82
  86. package/docs/document-optimization.zh-CN.md +0 -70
  87. package/indexers/capability-manifest.json +0 -35
  88. package/indexers/contracts/hard-rule-conformance.json +0 -2644
  89. package/providers/context/actions/accept-main-index-run.yaml +0 -7
  90. package/providers/context/actions/accept-material-answer-run.yaml +0 -7
  91. package/providers/context/actions/accept-post-author-composer-run.yaml +0 -7
  92. package/providers/context/actions/actualize-material-answer-bindings.yaml +0 -8
  93. package/providers/context/actions/audit-material-gap-state.yaml +0 -8
  94. package/providers/context/actions/audit-projected-artifact-fan-out.yaml +0 -8
  95. package/providers/context/actions/build-main-index-author-worksets.yaml +0 -7
  96. package/providers/context/actions/build-main-index-catalog-fallback.yaml +0 -7
  97. package/providers/context/actions/build-main-index-partition-worksets.yaml +0 -7
  98. package/providers/context/actions/build-material-question-workset.yaml +0 -7
  99. package/providers/context/actions/build-post-author-composer-worksets.yaml +0 -7
  100. package/providers/context/actions/build-question-target-inventory.yaml +0 -7
  101. package/providers/context/actions/build-subject-catalog.yaml +0 -7
  102. package/providers/context/actions/build-target-resolution-views.yaml +0 -7
  103. package/providers/context/actions/checkpoint-material-answer-review.yaml +0 -8
  104. package/providers/context/actions/checkpoint-material-gaps.yaml +0 -8
  105. package/providers/context/actions/close-indexer-approved-knowledge.yaml +0 -8
  106. package/providers/context/actions/compose-indexer-post-author-fragments.yaml +0 -7
  107. package/providers/context/actions/converge-main-index-partition-run.yaml +0 -7
  108. package/providers/context/actions/evaluate-material-gaps.yaml +0 -8
  109. package/providers/context/actions/fail-main-index-run.yaml +0 -7
  110. package/providers/context/actions/fail-material-answer-run.yaml +0 -7
  111. package/providers/context/actions/fail-post-author-composer-run.yaml +0 -7
  112. package/providers/context/actions/inspect-index-candidate-review-readiness.yaml +0 -8
  113. package/providers/context/actions/inspect-index-profile-failure.yaml +0 -7
  114. package/providers/context/actions/inspect-material-answer-review.yaml +0 -8
  115. package/providers/context/actions/observe-main-index-run-ledger.yaml +0 -7
  116. package/providers/context/actions/observe-material-answer-runs.yaml +0 -7
  117. package/providers/context/actions/observe-post-author-composer-worksets.yaml +0 -7
  118. package/providers/context/actions/override-index-profile-audit.yaml +0 -7
  119. package/providers/context/actions/prepare-main-index-run-ledger.yaml +0 -7
  120. package/providers/context/actions/prepare-material-answer-runs.yaml +0 -7
  121. package/providers/context/actions/reconcile-indexer-results.yaml +0 -7
  122. package/providers/context/actions/reconcile-review-identities.yaml +0 -5
  123. package/providers/context/actions/record-index-profile-revision.yaml +0 -7
  124. package/providers/context/actions/report-index-profile-failure.yaml +0 -7
  125. package/providers/context/actions/resolve-effective-composers.yaml +0 -7
  126. package/providers/context/actions/review-material-answer-candidate.yaml +0 -8
  127. package/providers/context/actions/revise-document.yaml +0 -5
  128. package/providers/context/actions/revise-index-output.yaml +0 -7
  129. package/providers/context/actions/run-material-answer-indexers.yaml +0 -7
  130. package/providers/context/actions/start-main-index-run.yaml +0 -7
  131. package/providers/context/actions/start-material-answer-run.yaml +0 -7
  132. package/providers/context/actions/start-post-author-composer-run.yaml +0 -7
  133. package/providers/context/resources/procedures/document-revision.md +0 -36
  134. package/providers/context/resources/views/document-optimization-current.yaml +0 -6
  135. package/providers/context/schemas/indexer-candidate-review-readiness-input.schema.json +0 -46
  136. package/providers/context/schemas/indexer-candidate-review-readiness-output.schema.json +0 -104
  137. package/providers/context/schemas/indexer-lifecycle-continuation.schema.json +0 -15
  138. package/providers/context/schemas/indexer-material-answer-lifecycle-input.schema.json +0 -90
  139. package/providers/context/schemas/indexer-material-answer-lifecycle-output.schema.json +0 -80
  140. package/providers/context/schemas/indexer-material-answer-review-inspection-input.schema.json +0 -32
  141. package/providers/context/schemas/indexer-material-answer-review-inspection-output.schema.json +0 -32
  142. package/providers/context/schemas/indexer-material-answer-review-resolution-input.schema.json +0 -19
  143. package/providers/context/schemas/indexer-material-answer-review-resolution-output.schema.json +0 -87
  144. package/providers/context/schemas/indexer-material-gap-lifecycle-input.schema.json +0 -86
  145. package/providers/context/schemas/indexer-material-gap-lifecycle-output.schema.json +0 -19
  146. package/providers/context/schemas/indexer-post-author-fragment-request.schema.json +0 -26
  147. package/providers/context/schemas/indexer-post-author-fragment-result.schema.json +0 -18
  148. package/providers/context/schemas/indexer-post-author-lifecycle-input.schema.json +0 -94
  149. package/providers/context/schemas/indexer-post-author-lifecycle-output.schema.json +0 -72
  150. package/providers/context/schemas/indexer-profile-failure-inspection-input.schema.json +0 -13
  151. package/providers/context/schemas/indexer-profile-failure-inspection-result.schema.json +0 -19
  152. package/providers/context/schemas/indexer-profile-failure-report-input.schema.json +0 -22
  153. package/providers/context/schemas/indexer-profile-failure-report-result.schema.json +0 -49
  154. package/providers/context/schemas/indexer-profile-override-decision.schema.json +0 -20
  155. package/providers/context/schemas/indexer-profile-override-result.schema.json +0 -49
  156. package/providers/context/schemas/indexer-profile-revision-agent-input.schema.json +0 -18
  157. package/providers/context/schemas/indexer-profile-revision-record-input.schema.json +0 -31
  158. package/providers/context/schemas/indexer-profile-revision-record-result.schema.json +0 -45
  159. package/providers/context/schemas/indexer-result-reconciliation-input.schema.json +0 -59
  160. package/providers/context/schemas/indexer-result-reconciliation-output.schema.json +0 -43
  161. package/providers/context/skills/revise-index-output/SKILL.md +0 -12
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.materialize-request/v1",
3
+ "$id": "context.indexer.materialize-request/v2",
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "required": [
@@ -12,9 +12,7 @@
12
12
  "provider_fingerprint",
13
13
  "provider_integrity",
14
14
  "manifest_digest",
15
- "requirement_set_digest",
16
- "workset_ref",
17
- "workset_digest",
15
+ "stage",
18
16
  "profile",
19
17
  "composer_id",
20
18
  "instruction_set_digest",
@@ -22,7 +20,7 @@
22
20
  "request_digest"
23
21
  ],
24
22
  "properties": {
25
- "protocol": { "const": "context.indexer.materialize-request/v1" },
23
+ "protocol": { "const": "context.indexer.materialize-request/v2" },
26
24
  "handler": { "const": "context.materialize-indexer-instructions/v1" },
27
25
  "resource_id": { "const": "resolved-indexer-instructions" },
28
26
  "indexer_id": { "type": "string", "minLength": 1 },
@@ -30,9 +28,7 @@
30
28
  "provider_fingerprint": { "$ref": "#/$defs/digest" },
31
29
  "provider_integrity": { "$ref": "#/$defs/digest" },
32
30
  "manifest_digest": { "$ref": "#/$defs/digest" },
33
- "requirement_set_digest": { "$ref": "#/$defs/digest" },
34
- "workset_ref": { "type": "string", "minLength": 1 },
35
- "workset_digest": { "$ref": "#/$defs/digest" },
31
+ "stage": { "enum": ["partition", "author", "post-author"] },
36
32
  "profile": { "type": "string", "minLength": 1 },
37
33
  "composer_id": {
38
34
  "oneOf": [
@@ -23,7 +23,14 @@
23
23
  "additionalProperties": false,
24
24
  "required": ["kind", "resource_ref", "digest", "content"],
25
25
  "properties": {
26
- "kind": { "enum": ["provider", "customization-append"] },
26
+ "kind": {
27
+ "enum": [
28
+ "provider",
29
+ "template",
30
+ "composer",
31
+ "customization-append"
32
+ ]
33
+ },
27
34
  "resource_ref": { "type": "string", "minLength": 1 },
28
35
  "digest": { "$ref": "#/$defs/digest" },
29
36
  "content": { "type": "string" }
@@ -23,10 +23,59 @@
23
23
  },
24
24
  "validation_result": {
25
25
  "type": "object",
26
- "required": ["protocol", "outcome", "result_digest"],
26
+ "additionalProperties": false,
27
+ "required": [
28
+ "protocol",
29
+ "outcome",
30
+ "graph_outcome",
31
+ "validation_input_digest",
32
+ "project_ref",
33
+ "overlay",
34
+ "effective_profile",
35
+ "conformance_report",
36
+ "validation_receipt",
37
+ "result_digest"
38
+ ],
27
39
  "properties": {
28
40
  "protocol": { "const": "context.indexer.contract-overlay-validation-result/v1" },
29
- "outcome": { "const": "trusted" },
41
+ "outcome": { "const": "valid" },
42
+ "graph_outcome": { "const": "completed" },
43
+ "validation_input_digest": { "$ref": "#/$defs/digest" },
44
+ "project_ref": { "type": "string", "minLength": 1 },
45
+ "overlay": { "type": "object" },
46
+ "effective_profile": { "type": "object" },
47
+ "conformance_report": {
48
+ "type": "object",
49
+ "required": ["protocol", "report_digest"],
50
+ "properties": {
51
+ "protocol": { "const": "context.indexer.overlay-conformance-report/v1" },
52
+ "report_digest": { "$ref": "#/$defs/digest" }
53
+ }
54
+ },
55
+ "validation_receipt": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": [
59
+ "protocol",
60
+ "project_ref",
61
+ "overlay_digest",
62
+ "base_contract_digest",
63
+ "provider_integrity",
64
+ "operator_contract_digest",
65
+ "conformance_report_digest",
66
+ "receipt_digest"
67
+ ],
68
+ "properties": {
69
+ "protocol": { "const": "context.indexer.overlay-validation-receipt/v1" },
70
+ "project_ref": { "type": "string", "minLength": 1 },
71
+ "overlay_digest": { "$ref": "#/$defs/digest" },
72
+ "base_contract_digest": { "$ref": "#/$defs/digest" },
73
+ "provider_integrity": { "$ref": "#/$defs/digest" },
74
+ "operator_contract_digest": { "$ref": "#/$defs/digest" },
75
+ "conformance_report_digest": { "$ref": "#/$defs/digest" },
76
+ "receipt_digest": { "$ref": "#/$defs/digest" }
77
+ }
78
+ },
30
79
  "result_digest": { "$ref": "#/$defs/digest" }
31
80
  }
32
81
  },
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "context.indexer.workset-view-materialization-request/v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "protocol",
8
+ "handler",
9
+ "resource_id",
10
+ "workset_digest",
11
+ "execution_request_digest",
12
+ "view_digest",
13
+ "payload_digest",
14
+ "request_digest"
15
+ ],
16
+ "properties": {
17
+ "protocol": { "const": "context.indexer.workset-view-materialization-request/v1" },
18
+ "handler": { "const": "context.materialize-indexer-workset-view/v1" },
19
+ "resource_id": {
20
+ "type": "string",
21
+ "pattern": "^authorized-indexer-workset-view(?:/task-[0-9]{3})?$"
22
+ },
23
+ "workset_digest": { "$ref": "#/$defs/digest" },
24
+ "execution_request_digest": { "$ref": "#/$defs/digest" },
25
+ "view_digest": { "$ref": "#/$defs/digest" },
26
+ "payload_digest": { "$ref": "#/$defs/digest" },
27
+ "request_digest": { "$ref": "#/$defs/digest" }
28
+ },
29
+ "$defs": {
30
+ "digest": {
31
+ "type": "string",
32
+ "pattern": "^sha256:[a-f0-9]{64}$"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: context-authorize-current-indexer-provider-program
3
+ description: Resolve the current Context Gate for an exact non-sandboxed Indexer Provider program.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-provider-program-authorization
8
+ ---
9
+
10
+ # Authorize the current Provider program
11
+
12
+ Read the exact program report in `gate.resolution_action.input`. Resolve only the current Gate:
13
+
14
+ - return `stage: provider-program-authorization`;
15
+ - return `decision: approved` only when the user approved it or the Route says the Gate is resolved
16
+ by session authority;
17
+ - otherwise return `decision: rejected`.
18
+
19
+ Do not change Provider identity, program content, scope, limits, or authority. Submit the value to
20
+ the Route's only `complete-current` command and then follow the newly returned Route.
@@ -17,42 +17,56 @@ completion conditions. This Action is the entry for
17
17
  the guide's `indexer-provider-unavailable` handling instead of substituting a
18
18
  different version or cache.
19
19
 
20
- Report the exact CLI-bundled catalog together with other Indexer entry Skills
21
- already visible in this conversation. For an exact Skill root already exposed
22
- by the Host, read only `SKILL.md` frontmatter and the sibling
23
- `context-indexer.yaml`: the manifest version is authoritative and
24
- `metadata.context-provider-version` must match it. Do not load Provider guidance
25
- until selection. Group the same Skill name and exact version into one
26
- conversation item with all observed source types; an installed copy of the
27
- same CLI-bundled identity is not another Provider. Preserve distinct source
28
- observations in `visible_skills`, keep different versions separate, and never
29
- use source count or discovery order as precedence. Do not scan plugin caches or
30
- persist this discovery list.
20
+ The current Action input already contains the exact requirements and
21
+ CLI-bundled catalog. Select applicable Providers using that input and the Skills
22
+ already visible in this conversation. Do not run a separate catalog command,
23
+ enumerate every installed Skill, or require a discovery report/confirmation.
24
+ For a selected shipped Provider, copy its exact version, integrity and
25
+ cli-bundled distribution from the supplied catalog. The same Skill/version
26
+ visible in the Host is a projection, not another Provider or a reason for Host
27
+ resolution. If selecting a relevant external Skill, read only its exact
28
+ Host-exposed frontmatter and sibling `context-indexer.yaml` needed to identify
29
+ it; manifest version is authoritative. Do not guess missing versions, substitute
30
+ a different version, or scan caches. Read Provider guidance only when selected.
31
31
 
32
32
  When the Graph enters through `markdown-provider`, first require the completed
33
- capture report and report the visible `context-markdown-indexer*` Skills before
34
- building the route input. Treat only the report's exact `source_inputs` as
33
+ capture report. Treat only the report's exact `source_inputs` as
35
34
  current evidence. Do not infer semantic ownership from filenames, titles, or
36
35
  headings, and do not persist the discovery list. Capture proves byte/currentness
37
36
  only; the selected Markdown Provider remains responsible for semantic indexing.
38
37
 
39
- Produce `context.indexer.provider-route-input/v1` for the current, unchanged
40
- requirement set. Select portable distribution locators and exact versions and
41
- integrities. Each required requirement/domain/source/module owner cell needs one
42
- primary Indexer; overlapping read scope is allowed for enrichers. One Indexer
43
- may combine a primary layer, supporting profiles, extension layers, and
44
- composers, but Provider array order is not precedence.
45
-
46
- On the first pass set `community_fallback_attempted: false`. If the CLI records
47
- the route Action as `partial`, retry with the applicable CLI-bundled community
48
- profile and set it to `true`. If the CLI reports conflicting primary owner cells,
49
- do not choose one by name order: present the exact conflict and wait for a
50
- decision. If fallback still leaves an unowned required cell, preserve the exact
51
- CLI `capability_gap_proof` and record `blocked`; never invent a Provider or
52
- weaken the requirement. Only the following `propose-indexer-customization`
53
- Action may use that proof to draft a dependency-free minimal `extend`.
54
-
55
- Record the CLI Route Action outcome exactly from `route.graph_outcome`. Only a
56
- `completed` report may pass its `selection_proposal_input` to
57
- `validate-indexer-selection-proposal`. Provider resolution and execution remain
58
- separate Actions.
38
+ Return only the compact current-Action result:
39
+
40
+ ```yaml
41
+ stage: provider-selection
42
+ host_visible_skills: []
43
+ indexers:
44
+ - <one complete selected Indexer registry entry>
45
+ ```
46
+
47
+ `host_visible_skills` contains only relevant non-CLI observations already
48
+ visible to the Host; leave it empty for a CLI-bundled selection without external
49
+ observations. It is not an inventory of installed Skills. `indexers` contains
50
+ the semantic registry entries selected for the
51
+ unchanged requirements in the Action input. Select portable distribution
52
+ locators and exact versions and integrities. Each required
53
+ requirement/domain/source/module owner cell needs one primary Indexer;
54
+ overlapping read scope is allowed for enrichers. One Indexer may combine a
55
+ primary layer, supporting profiles, extension layers, and composers, but
56
+ Provider array order is not precedence.
57
+
58
+ Choose the applicable CLI-bundled community profile directly when no visible
59
+ specialized Provider is required. The CLI constructs the full route input,
60
+ performs fallback/conflict checks, validates the proposal, resolves and stages
61
+ bundles, and atomically applies `src/indexers.yaml`. If the current Route reports
62
+ a primary owner conflict or an uncovered required cell, present that exact
63
+ problem and wait; never invent a Provider or weaken the requirement.
64
+
65
+ Submit the result only through the exact `context action complete-current`
66
+ command returned by the Route. Never call the low-level route, validation,
67
+ resolution, staging or apply commands as a production workflow. If a selected
68
+ external Provider needs Host resolution, the next current Route exposes that
69
+ existing Host Action and its exact request; invoke it once and submit its Host
70
+ result through the next `complete-current` command. If the resolved Bundle carries a
71
+ non-allowlisted program, continue through the returned existing program-execution
72
+ Gate; never bypass it or fall back to its low-level command.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: context-resolve-current-indexer-gate
3
+ description: Resolve the current Indexer structure or layout Gate using the exact current Route input and output schema.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-lifecycle
8
+ ---
9
+
10
+ # Resolve the current Indexer Gate
11
+
12
+ Use this Skill only when the current Indexer Route exposes it as
13
+ `gate.resolution_action`. Read the Route input and the resolution Action output
14
+ schema before deciding.
15
+
16
+ For `stage: structure-review`, inspect the complete semantic structure Resource
17
+ and return either `approved` or `request-adjustment`. Include specific feedback
18
+ when requesting adjustment.
19
+
20
+ For `stage: layout-confirmation`, use the supplied change reports and the
21
+ user's decision. Return either `approved` or `rejected`. Include specific
22
+ feedback when rejecting. A non-delegatable layout Gate must not be approved on
23
+ the user's behalf.
24
+
25
+ Submit exactly one existing `context.indexer.current-action-input/v2` value to
26
+ the Route's completion command. Do not invent a lifecycle continuation
27
+ envelope, a second approval protocol, or additional audit data.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: context-resolve-current-indexer-provider
3
+ description: Resolve the exact Host-backed Provider request selected by the current Context workflow Route.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-provider-resolution
8
+ ---
9
+
10
+ # Resolve the current Indexer Provider
11
+
12
+ Use only the Host Action Resource required by the current Route. Materialize that Resource once and
13
+ return one `context.indexer.current-action-input/v2` value with `stage` set to
14
+ `provider-resolution` and `result` set to the complete Host Action result. If the Host also returns
15
+ the managed output named by the Route, include it as `managed_output` without changing its ref,
16
+ digest, or value.
17
+
18
+ Do not discover another Provider, substitute a version, read Provider files directly, or recreate
19
+ the Host result. Submit the value to the Route's only `complete-current` command and then follow the
20
+ newly returned Route.
@@ -1,20 +1,59 @@
1
1
  ---
2
2
  name: context-run-indexer-agent-step
3
- description: Execute one Context-authorized Indexer workset using only the current Route input and resolved Provider instructions.
3
+ description: Execute one bounded batch of Context-authorized Indexer worksets using the current Route input, shared Provider instructions, and each task's authorized View.
4
4
  metadata:
5
5
  agent-graph: path:../../provider.yaml
6
6
  agent-graph.graph: indexer
7
7
  agent-graph.entry: agent-step
8
8
  ---
9
9
 
10
- # Run one Indexer Agent step
10
+ # Run one bounded Indexer Agent batch
11
11
 
12
12
  Read the current Route action input and every required Resource marked `read-required`.
13
- Use only the materialized `resolved-indexer-instructions` content, the supplied workset,
14
- composition input, and Context-authorized evidence. Do not discover another Skill, read a
15
- Provider path, widen source scope, run a program, or invent missing evidence.
16
-
17
- Return exactly `context.indexer.agent-step-result/v1`. Preserve the supplied input and
18
- execution request digests, bind the materialized instruction payload digest, and include
19
- the current Host execution receipt. Context performs the final schema, evidence, owner,
20
- scope, and workset validation; never report success merely because the prose looks valid.
13
+ Use only the materialized `resolved-indexer-instructions`, the supplied transport worksets,
14
+ and each task's `authorized-indexer-workset-view/task-NNN`. Match Views and outputs only through
15
+ the short `task_key`; do not copy internal digests into the semantic result. Each View contains the
16
+ exact facts, dependencies, Provider fragments, and Author authority authorized for that task. Do not
17
+ construct evidence read requests, manage pages or cursors, discover another Skill, read a
18
+ Provider path, widen source scope, run an unauthorized Indexer or parser, or invent missing
19
+ evidence.
20
+
21
+ Return exactly one `results[]` entry for every task in the current batch, in task-key order. Each
22
+ entry carries its `task_key` and the existing stage-specific semantic Result. A single-task batch
23
+ still uses the same array shape. Copy dynamic authority values only from the Route input or that
24
+ task's authorized View.
25
+
26
+ For a Partition Result, read `partition-authority` before choosing each group subject. A string
27
+ changes only the local key and preserves `base_subject_key` namespace and kind. Use an explicit
28
+ subject object only when its kind is listed in `subject_key_contract.kinds`; never invent a kind
29
+ from a page title, operation name, framework term, or business vocabulary.
30
+
31
+ `subject_intent` describes the reader-subject outcome, not the source file's role. Use `primary`
32
+ when the group owns a reader subject. Use `enrich-or-independent` for a publishable supplemental
33
+ view such as test or example behavior: Context reuses a matching subject when available and creates
34
+ an independent subject otherwise. Do not emit `supporting`; material that must never become a reader
35
+ subject must not be emitted as a group.
36
+
37
+ For an Author Result, a selected parser Fact is an immutable projection, not material for a new
38
+ Fact shape. Build it only from the matching View items:
39
+
40
+ - `fact_ref` = the `fact` item's `value.fact_ref`;
41
+ - `fact_kind` = the `fact` item's `value.kind`;
42
+ - `subject_key` = `author-authority.expected_subject_key`;
43
+ - `value` = the `fact` item's `value.payload` exactly, without wrapping, renaming, or adding fields;
44
+ - `evidence_refs` = the source-span evidence refs reached through the matching `selected-fact`
45
+ dependency node.
46
+
47
+ Build each EvidenceBinding from that same source-span dependency's `evidence_ref`, `source_ref`,
48
+ `module_ref`, `locator`, and `content_digest`. Do not infer a new locator or digest from prose.
49
+ For behavior, read the Author View's `source-text` items. Their `spans` contain the authorized
50
+ source lines; `source_span_refs` link back to existing dependency nodes, not new evidence identities.
51
+ Overlapping ranges appear once. A signature or call name alone does not establish behavior absent
52
+ from those lines. Do not copy these process-only carriers into reader Markdown.
53
+ Do not invent or manually copy read-receipt, execution-receipt, or stable-result digests. Submit
54
+ exactly `context.indexer.current-action-input/v2` through the Route's completion command; Context
55
+ derives internal envelopes and performs dependency, schema, owner, scope, and per-workset validation
56
+ before reporting each task accepted. Read the completion's `outcomes`, then continue directly from
57
+ its `next` Route and ready Resource paths. Do not run `context status` or either Resource materializer
58
+ between successful batches. A failed item is retried from its returned task-only skeleton; already
59
+ accepted peers are not repeated. Never report success merely because the envelope or prose looks valid.
@@ -9,28 +9,34 @@ metadata:
9
9
 
10
10
  # Run The Indexer Lifecycle
11
11
 
12
- This Action replaces the retired extraction, document-classification, align,
13
- structure-confirmation, and prose default-plan routes. Do not invoke those
14
- paths and do not turn existing approved knowledge into an indexing fallback.
12
+ This Action continues the sole registry-and-Provider indexing route. Use the
13
+ current Indexer subroute for semantic partitioning, structure review, authoring,
14
+ composition, layout, Candidate compilation, and repair. Existing approved
15
+ knowledge is an input to incremental planning, never a parallel authoring path.
15
16
 
16
17
  Read
17
18
  `node_modules/@c4a/context/docs/guides/indexer-provider-and-customization.md`,
18
19
  then follow the root `context` Skill's Indexer instructions and the exact
19
20
  structured outcomes returned by `context indexer ...`. Start by forming and
20
- confirming requirements when `src/indexers.yaml` is absent or stale; otherwise
21
+ confirming requirements when `src/indexers.yaml` is absent or stale. When the
22
+ Route returns `configuration`, edit the named project file and re-evaluate;
23
+ do not submit a lifecycle Result or repeatedly run an unconfigured project. Otherwise
21
24
  continue the current registry selection, Provider resolution, execution,
22
- reconciliation, layout, audit, and Candidate compile subroute. The Indexer
25
+ reconciliation, mechanical validation, layout, and Candidate compile subroute. The Indexer
23
26
  Graph is the authority for each substep. Never skip directly to compile and
24
27
  never synthesize a Provider Result or a default plan.
25
28
 
29
+ When the current subroute is a Gate, follow `gate.resolution_action` rather
30
+ than looking for a top-level `action`. Read its Skill and output schema, use its
31
+ Route input, and submit the resulting value through the Route completion
32
+ command. The Indexer Graph owns the Gate identity, authority, delegation and
33
+ resolution Action; do not replace them with an inferred command or handler.
34
+
26
35
  Stop on the first Host permission, non-delegatable Gate, validation failure, or
27
36
  human decision. Once current Candidates have been compiled, return control to
28
37
  `context status --format json`; the workspace Graph will select Knowledge
29
- Review. The Action output is only:
30
-
31
- ```json
32
- {
33
- "protocol": "context.indexer.lifecycle-continuation/v1",
34
- "outcome": "follow-indexer-route"
35
- }
36
- ```
38
+ Review. This outer Action has no payload of its own and must never be submitted
39
+ through `complete-current`. Context projects it to the one current Indexer
40
+ subroute; follow that Route's command and output schema exactly. If project
41
+ configuration was edited, re-run `context status --format json` to obtain the
42
+ new revision instead of inventing a lifecycle continuation result.
@@ -1,21 +1,62 @@
1
1
  ---
2
2
  name: context-run-indexer-post-author-composer
3
- description: Execute one CLI-authorized post-author composer request without changing primary facts, identity, scope, or composer selection.
3
+ description: Execute one bounded batch of CLI-authorized post-author composer tasks without changing primary facts, identity, scope, or composer selection.
4
4
  metadata:
5
5
  agent-graph: path:../../provider.yaml
6
6
  agent-graph.graph: indexer
7
7
  agent-graph.entry: post-author-composer-step
8
8
  ---
9
9
 
10
- # Run one post-author composer
10
+ # Run a post-author composer batch
11
11
 
12
- Read the current Route input and the exact `context.indexer.layer-fragment-request/v1`.
13
- Use only its bounded `primary_result_view`, selected `composer_ref`, allowed target refs,
14
- and the resolved instructions supplied by Context. Do not discover another Skill or
15
- composer, read project files outside the request, change a SubjectKey, create a complete
16
- primary Result, or widen the target set.
12
+ Read both required Route resources before acting:
17
13
 
18
- Return exactly `context.indexer.layer-fragment-result/v1`. Preserve the request digest,
19
- composer ref, and consumed PrimaryResultView digest. Return only zero or more
20
- `derived-artifact-proposal` fragments for allowed targets. Context performs final schema,
21
- identity, evidence, policy, layer, and receipt validation before accepting the Result.
14
+ - `resolved-indexer-instructions` defines the selected Composer's job;
15
+ - each `authorized-indexer-workset-view/task-NNN` is one complete, bounded PrimaryResult View.
16
+
17
+ Use only the target aliases and source aliases exposed by that View and the current Route.
18
+ Do not discover another Skill or Composer, scan project files outside the View, change a
19
+ SubjectKey, rewrite the primary Result, or widen the target set.
20
+
21
+ Return exactly one result for every task key in the Action input. Keep task results
22
+ independent: one empty or failed result must not replace another task's proposal.
23
+
24
+ Return only the minimal semantic JSON accepted by the current Route:
25
+
26
+ ```json
27
+ {
28
+ "stage": "post-author",
29
+ "results": [
30
+ {
31
+ "task_key": "task-001",
32
+ "result": {
33
+ "stage": "post-author",
34
+ "outcome": "complete",
35
+ "proposals": [
36
+ {
37
+ "target": "target:1",
38
+ "artifact_kind": "content",
39
+ "title": "Reader-facing title",
40
+ "summary": "Why this derived page is useful",
41
+ "sections": [
42
+ {
43
+ "key": "overview",
44
+ "heading": "Overview",
45
+ "markdown": "Reader-facing content",
46
+ "source_refs": ["fact:1"]
47
+ }
48
+ ]
49
+ }
50
+ ],
51
+ "diagnostics": []
52
+ }
53
+ }
54
+ ]
55
+ }
56
+ ```
57
+
58
+ If a task needs no derived Artifact, return `outcome: "complete"` with an empty
59
+ `proposals` array for that task. If one bounded input cannot be processed, return
60
+ `outcome: "failed"` with at least one diagnostic for that task and still return the
61
+ other task results. Context expands aliases, validates evidence and policy, creates
62
+ internal fragments and digests, then resumes the same production state machine.
@@ -1,82 +0,0 @@
1
- # Document revisions
2
-
3
- New workspaces enable source-constrained editorial revision by default. It is a
4
- build phase for source-backed prose that improves publication value and
5
- readability without changing the approved knowledge page or inventing facts.
6
-
7
- To opt out during initialization:
8
-
9
- ```bash
10
- context init context --no-optimize-docs
11
- ```
12
-
13
- Existing workspaces retain their current setting. Change it explicitly with:
14
-
15
- ```bash
16
- context optimize-docs enable
17
- context optimize-docs disable
18
- context status --format json
19
- ```
20
-
21
- When enabled, the workflow plans only new or changed source Sections. For each
22
- Section the CLI reports mechanical signals and allowed actions. The Agent may
23
- keep it, repair local presentation, reshape it within the same source boundary,
24
- or omit it when the CLI confirms a non-knowledge reason. Only changed pages
25
- receive a full revision beside their approved page:
26
-
27
- Signals are review leads rather than a complete readability verdict. The Agent
28
- must read every Section. Keeping a signaled Section requires a concrete,
29
- decision-only assessment explaining why each signal is a false positive or why
30
- editing would reduce source fidelity. The assessment names every reported
31
- signal code so the CLI can verify complete coverage; it is never published.
32
- Time, cost, workload, batch size, or delivery pressure are not valid keep or
33
- defer reasons. Fully managed operation applies all safe repairs, reshapes, and
34
- eligible omissions autonomously; only genuinely unavailable semantic input is
35
- batched for the user. A large fragment set must meet the same quality standard
36
- as a single fragment.
37
-
38
- ```text
39
- knowledge/guides/setup.md
40
- knowledge/guides/setup__revision.md
41
- ```
42
-
43
- The `__revision.md` suffix is reserved. Default knowledge discovery, structure,
44
- search, and package selection exclude revision files. Validation and build
45
- associate a revision with its sibling base page and apply it under the original
46
- package path. A revision stores only the base digest that cannot be inferred;
47
- its path and revised Sections are derived. Unchanged Sections inside a full
48
- revision are inferred. A page with no changes stores only one derived negative
49
- cache key below `.tmp/context-runtime/document-optimization/`; replacement
50
- prose and Section metadata are not duplicated there.
51
-
52
- Typical repair candidates are Markdown syntax, spacing, empty table rows, and
53
- descriptive labels for links whose purpose is already present. Reshape handles
54
- wide tables, long cells, mixed images and links, or long prose by creating a
55
- clearer structure inside the same Section. Unanswered question sets, empty
56
- placeholders, decision-free drafts, duplicates, and obsolete-only Sections may
57
- be omitted. Questions with answers, limitations with an action, and
58
- deprecations with a replacement remain knowledge. Link targets, images, code,
59
- commands, numbers, identifiers, conditions, and source references are protected
60
- through validation. Ambiguous currency, ownership, or sensitive values appear
61
- together in the plan's `input_requests` and require one batched user decision.
62
-
63
- After capture, review, or build, a user may ask conversationally to correct one
64
- existing knowledge page. Start the correction by title, approved path, or
65
- ViewRef:
66
-
67
- ```bash
68
- context revise "<title, approved path, or ViewRef>" --format json
69
- ```
70
-
71
- Context starts `route.document-revision.requested` only after resolving one
72
- page. Ambiguous requests return candidates instead of guessing. Edit
73
- reader-visible prose within existing `context:section` boundaries without
74
- changing provenance or protected values, then run `context optimize-docs
75
- validate`. A valid correction ends
76
- the request and the next Route offers a package build when output is stale. If
77
- broad document optimization was disabled, this entry activates only the target
78
- page and keeps every other eligible page out of the pending batch. If upstream
79
- content changes, the revision becomes a conflict and must be reviewed again.
80
-
81
- Disabling moves active revision pages to Context runtime recovery storage. The
82
- next build uses approved knowledge directly.