@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,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "displayName": "C4A Context",
4
- "version": "0.7.1",
4
+ "version": "0.7.5",
5
5
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
6
6
  "author": { "name": "Context4AI", "email": "support@context4ai.dev" },
7
7
  "homepage": "https://github.com/context4ai/c4a",
@@ -43,11 +43,8 @@ managed work, or no further review already resolves this choice.
43
43
  Use the user's explicit language choice when present; otherwise pass `zh-CN`
44
44
  for a Chinese conversation and `en` for an English conversation. Pass
45
45
  `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
46
- requested that initialization choice. New workspaces enable conservative
47
- document compilation optimization by default. Pass `--no-optimize-docs` only
48
- when the user explicitly asks to disable it during initialization. Pass
49
- `--managed` only after the user explicitly authorizes fully managed operation
50
- in this conversation.
46
+ requested that initialization choice. Pass `--managed` only after the user
47
+ explicitly authorizes fully managed operation in this conversation.
51
48
 
52
49
  If the `context` process itself cannot start because the command is missing
53
50
  (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
@@ -76,23 +73,18 @@ Execute only `next_action.command` returned by `context entry`:
76
73
  init`, enter the project root, read the generated `AGENTS.md`, and run this
77
74
  entry again.
78
75
 
79
- If the user explicitly asks to correct or revise an existing approved or built
80
- knowledge page, first let `context entry` relocate into the existing workspace
81
- and evaluate its current Route once. Resolve a blocking workspace diagnostic,
82
- evidence-maintenance action, or already-pending Review batch first; these may
83
- change the approved baseline. Before continuing unrelated capture, extraction,
84
- package configuration, or build work, start the correction with:
76
+ If the user asks to correct a current Candidate before approval, first let
77
+ `context entry` relocate into the workspace and evaluate its current Route.
78
+ Start the correction with:
85
79
 
86
80
  ```bash
87
- context revise "<the user's page title, approved path, ViewRef, or wording>" --format json
81
+ context revise "<candidate title, path, or id>" --instruction "<requested correction>" --format json
88
82
  ```
89
83
 
90
- When the target is unique, run the returned status command and follow
91
- `route.document-revision.requested`. When candidates are returned, select one
92
- only if the conversation identifies it uniquely; otherwise ask which page the
93
- user means. Never edit the approved base page or `dist/` for this operation.
94
- After the Route validates the revision, continue normally: Context will offer
95
- the package build when the correction makes its output stale.
84
+ When the target is unique, Context invalidates only its derived outputs and
85
+ reopens the owning Author workset. Run the returned status command and follow
86
+ the current Route. If the target is ambiguous, ask which Candidate the user
87
+ means. Never edit `knowledge/`, `dist/`, or create a side-channel revision page.
96
88
 
97
89
  ### Conversation modes
98
90
 
@@ -104,24 +96,6 @@ before workflow evaluation. Debugging records traces below
104
96
  `.tmp/context-runtime/debug/` but does not grant workflow authority or provide
105
97
  source evidence.
106
98
 
107
- Document optimization is enabled by default for newly initialized workspaces.
108
- It performs source-constrained editorial revision: the CLI identifies
109
- readability and knowledge-value signals, and the Agent may keep, repair,
110
- reshape, or safely omit content only inside its existing source Section. It
111
- must preserve facts, link targets, images, code, numbers, identifiers, and
112
- source evidence. Approved pages remain source-faithful; only changed full-page
113
- revisions are stored beside them as `knowledge/**/*__revision.md`. Default
114
- knowledge discovery excludes those reserved sidecars, and internal editorial
115
- audit state is not included in package output.
116
-
117
- For an existing workspace, respect its current `package.json` setting. Run
118
- `context optimize-docs enable` or `context optimize-docs disable` only when the
119
- user explicitly changes that preference. If initialization is required and the
120
- user opts out, pass `--no-optimize-docs` through `context entry`; otherwise let
121
- the default initialization command enable it.
122
- Follow the resulting Route instead of editing approved knowledge or package
123
- output by hand.
124
-
125
99
  For explicitly authorized fully managed operation, use:
126
100
 
127
101
  ```bash
@@ -141,13 +115,13 @@ that returned Route; never reconstruct a command from an earlier step.
141
115
 
142
116
  Code knowledge is published under `codeindex`. Context mechanically audits each
143
117
  module's input analysis, stable boundaries, facts, explanation, evidence scope,
144
- and page shape without producing a total score. In fully managed operation,
145
- follow returned repair actions automatically; after three failed revisions of
146
- the same module problem, stop at the one aggregated human-guidance Gate. If a
147
- legacy workspace returns `route.extract.codeindex-migration-required`, execute
148
- only its migration command; do not rename `codegraph` paths manually.
118
+ and page shape without producing a total score. Blocking mechanical failures
119
+ reopen the owning Author or Composer workset; advisory metrics remain warnings
120
+ and do not create a retry ledger or override Gate. If a legacy workspace returns
121
+ `route.extract.codeindex-migration-required`, execute only its migration
122
+ command; do not rename `codegraph` paths manually.
149
123
 
150
- ### Discover Indexer Providers before selection
124
+ ### Select Indexer Providers
151
125
 
152
126
  For `indexer-provider-required`, `indexer-provider-unavailable`,
153
127
  `indexer-customization-required`, `indexer-customization-invalid`, or
@@ -158,69 +132,40 @@ default, six-level customization ladder, upgrade conflict handling, debugging
158
132
  commands, and the exit condition for each level. Do not replace it with a
159
133
  remembered or host-specific workflow.
160
134
 
161
- When the current Route starts a new Code or Markdown indexing task, run this
162
- read-only command once before creating or changing any Provider registry entry:
163
-
164
- ```bash
165
- context indexer catalog --format json
166
- ```
167
-
168
- Report the returned CLI-bundled entry Skills together with every other Indexer
169
- Skill already visible through the current host. The conversational report must
170
- include each Skill name, readable exact version when available, and source type
171
- (CLI-bundled community, workspace, installed plugin, or authorized marketplace
172
- result). When the host already exposes an exact Skill root or `SKILL.md` path,
173
- read only its YAML frontmatter and sibling `context-indexer.yaml` during
174
- discovery. The manifest version is authoritative;
175
- `metadata.context-provider-version` is a readable copy that must match it. Do
176
- not load the Provider body or other guidance until the Route selects it. If the
177
- host exposes no readable root or exact version, report the version as
178
- unavailable rather than guessing it.
179
-
180
- Group observations with the same Skill name and exact version into one
181
- conversational item and list all observed source types on that item. An
182
- installed projection of an identical CLI-bundled identity is not a second
183
- Provider. Keep different versions separate. The route input still preserves
184
- each distinct source observation as its own `visible_skills` entry because
185
- `source_type` is singular; never use source count or discovery order as
186
- selection precedence. Do not search arbitrary directories, infer host cache
187
- paths, install a plugin, or query a marketplace unless the user separately
188
- authorizes it. Keep this discovery report only in the conversation: do not
189
- write it to `src/`, `package.json`, lifecycle state, receipts, audit output, or
190
- `dist/`. Do not repeat it during an unchanged task resume; repeat it only for a
191
- new indexing task, a changed host-visible Skill set, or an explicit diagnostic
192
- request.
193
-
194
- After the requirements are applied, author one
195
- `context.indexer.provider-route-input/v1` payload whose `registry` preserves
196
- the applied `requirements` block exactly and whose `visible_skills` contains
197
- only the just-reported path-free identities. Route it before any Host resolves
198
- or reads an external Provider:
199
-
200
- ```bash
201
- context indexer route-indexer-provider-selection --input <payload.yaml-or-json> --format json
202
- ```
203
-
204
- On `community-fallback-required`, retry with the applicable CLI-bundled profile
205
- and set `community_fallback_attempted: true`. Read-scope overlap is allowed, but
206
- an exact primary owner-cell conflict must be resolved explicitly; do not use
207
- array or discovery order as precedence. If fallback leaves a required owner
208
- cell uncovered, preserve the returned `capability_gap_proof`. Only the Route's
209
- following `propose-indexer-customization` Agent Action may turn that exact proof
210
- into a dependency-free minimal `extend` draft; do not weaken the requirement,
211
- write source, add dependencies, or claim the draft is applied.
212
-
213
- Only `selection-validation-required` returns a
214
- `selection_proposal_input`. Pass that exact object to:
215
-
216
- ```bash
217
- context indexer validate-indexer-selection-proposal --input <payload.yaml-or-json> --format json
218
- ```
219
-
220
- Use only the returned `next_provider_requests` for resolution. A successful
221
- static report does not authorize materialization, installation, execution, or
222
- writing the proposal into `src/indexers.yaml`; continue through the Route's
223
- resolver, staging, final validation, confirmation, and apply Actions.
135
+ When the current Route starts a new Code or Markdown indexing task, its
136
+ `configure-indexer-providers` Action input already contains the exact applied
137
+ requirements and CLI-bundled Provider catalog. Select applicable Providers from
138
+ the Skills already visible to the Host and that supplied catalog. Do not add a
139
+ catalog command, installation preflight, discovery report, or discovery-only
140
+ confirmation to the normal workflow. The main entry being visible is not proof
141
+ that every Provider is available; the CLI checks the selected distribution
142
+ when it is used and returns any missing/version-conflict recovery.
143
+
144
+ Use the supplied CLI-bundled identity for a selected shipped Provider, including
145
+ when the same Skill/version is also visible as an installed projection. Do not
146
+ resolve that copy through the Host or re-read its installed metadata. For a
147
+ relevant external Skill, read only the exact Host-exposed frontmatter and
148
+ sibling `context-indexer.yaml` needed for selection; do not guess a version or
149
+ scan caches. Different versions remain distinct. Read Provider guidance only
150
+ when selected. Discovery is not a durable workspace artifact.
151
+
152
+ Return only `stage: provider-selection`, the non-CLI
153
+ `host_visible_skills`, and the selected semantic `indexers` through the exact
154
+ `context action complete-current` command returned by the Route. The CLI owns
155
+ construction of the full registry payload, fallback/conflict checks, static
156
+ validation, Provider resolution and staging, final validation, and atomic
157
+ application of `src/indexers.yaml`. Do not call their low-level commands as a
158
+ second production workflow.
159
+
160
+ If a selected external Provider needs Host resolution, the next current Route
161
+ contains one `context.resolve-indexer-provider/v1` Host Action and its exact
162
+ request. Invoke that Host Action once, then submit
163
+ `stage: provider-resolution` with the returned Host result through the Route's
164
+ `complete-current` command. If the Bundle carries a non-allowlisted program,
165
+ the following current Route presents the existing program-execution Gate; wait
166
+ for its user/session-authority decision and submit that decision through
167
+ `complete-current`. A recovered `provider-finalization` Route consumes
168
+ only its fixed Action input; it must not resolve or install the Provider again.
224
169
 
225
170
  ### Follow the current Route
226
171
 
@@ -228,8 +173,12 @@ Treat `workflow.current` as the current-step authority:
228
173
 
229
174
  1. Read every `resources.required` item whose `read_state` is `read-required`.
230
175
  Read a returned `path` completely, or execute a returned resource `command`
231
- and read its complete output file. Materializing a resource is not reading
232
- it. Keep the merged receipts only in this conversation and submit them with
176
+ and read its complete output file. For a current Indexer Partition, Author,
177
+ Composer or structure-review Route, read the materialized files and then use
178
+ the Route's immediate completion command; do not create or submit a read
179
+ receipt. Other workflow resources may still require the returned receipt
180
+ command. Materializing a resource is not reading it. Keep those receipts only
181
+ in this conversation and submit them with
233
182
  the exact returned `context status --resource-receipts @<file>` command. Use
234
183
  `after_read_receipts` only after the full resource has been read. The exact
235
184
  `resources.after_read.command` already returns the re-evaluated
@@ -42,11 +42,8 @@ managed work, or no further review already resolves this choice.
42
42
  Use the user's explicit language choice when present; otherwise pass `zh-CN`
43
43
  for a Chinese conversation and `en` for an English conversation. Pass
44
44
  `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
45
- requested that initialization choice. New workspaces enable conservative
46
- document compilation optimization by default. Pass `--no-optimize-docs` only
47
- when the user explicitly asks to disable it during initialization. Pass
48
- `--managed` only after the user explicitly authorizes fully managed operation
49
- in this conversation.
45
+ requested that initialization choice. Pass `--managed` only after the user
46
+ explicitly authorizes fully managed operation in this conversation.
50
47
 
51
48
  If the `context` process itself cannot start because the command is missing
52
49
  (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
@@ -75,23 +72,18 @@ Execute only `next_action.command` returned by `context entry`:
75
72
  init`, enter the project root, read the generated `AGENTS.md`, and run this
76
73
  entry again.
77
74
 
78
- If the user explicitly asks to correct or revise an existing approved or built
79
- knowledge page, first let `context entry` relocate into the existing workspace
80
- and evaluate its current Route once. Resolve a blocking workspace diagnostic,
81
- evidence-maintenance action, or already-pending Review batch first; these may
82
- change the approved baseline. Before continuing unrelated capture, extraction,
83
- package configuration, or build work, start the correction with:
75
+ If the user asks to correct a current Candidate before approval, first let
76
+ `context entry` relocate into the workspace and evaluate its current Route.
77
+ Start the correction with:
84
78
 
85
79
  ```bash
86
- context revise "<the user's page title, approved path, ViewRef, or wording>" --format json
80
+ context revise "<candidate title, path, or id>" --instruction "<requested correction>" --format json
87
81
  ```
88
82
 
89
- When the target is unique, run the returned status command and follow
90
- `route.document-revision.requested`. When candidates are returned, select one
91
- only if the conversation identifies it uniquely; otherwise ask which page the
92
- user means. Never edit the approved base page or `dist/` for this operation.
93
- After the Route validates the revision, continue normally: Context will offer
94
- the package build when the correction makes its output stale.
83
+ When the target is unique, Context invalidates only its derived outputs and
84
+ reopens the owning Author workset. Run the returned status command and follow
85
+ the current Route. If the target is ambiguous, ask which Candidate the user
86
+ means. Never edit `knowledge/`, `dist/`, or create a side-channel revision page.
95
87
 
96
88
  ### Conversation modes
97
89
 
@@ -103,24 +95,6 @@ before workflow evaluation. Debugging records traces below
103
95
  `.tmp/context-runtime/debug/` but does not grant workflow authority or provide
104
96
  source evidence.
105
97
 
106
- Document optimization is enabled by default for newly initialized workspaces.
107
- It performs source-constrained editorial revision: the CLI identifies
108
- readability and knowledge-value signals, and the Agent may keep, repair,
109
- reshape, or safely omit content only inside its existing source Section. It
110
- must preserve facts, link targets, images, code, numbers, identifiers, and
111
- source evidence. Approved pages remain source-faithful; only changed full-page
112
- revisions are stored beside them as `knowledge/**/*__revision.md`. Default
113
- knowledge discovery excludes those reserved sidecars, and internal editorial
114
- audit state is not included in package output.
115
-
116
- For an existing workspace, respect its current `package.json` setting. Run
117
- `context optimize-docs enable` or `context optimize-docs disable` only when the
118
- user explicitly changes that preference. If initialization is required and the
119
- user opts out, pass `--no-optimize-docs` through `context entry`; otherwise let
120
- the default initialization command enable it.
121
- Follow the resulting Route instead of editing approved knowledge or package
122
- output by hand.
123
-
124
98
  For explicitly authorized fully managed operation, use:
125
99
 
126
100
  ```bash
@@ -140,13 +114,13 @@ that returned Route; never reconstruct a command from an earlier step.
140
114
 
141
115
  Code knowledge is published under `codeindex`. Context mechanically audits each
142
116
  module's input analysis, stable boundaries, facts, explanation, evidence scope,
143
- and page shape without producing a total score. In fully managed operation,
144
- follow returned repair actions automatically; after three failed revisions of
145
- the same module problem, stop at the one aggregated human-guidance Gate. If a
146
- legacy workspace returns `route.extract.codeindex-migration-required`, execute
147
- only its migration command; do not rename `codegraph` paths manually.
117
+ and page shape without producing a total score. Blocking mechanical failures
118
+ reopen the owning Author or Composer workset; advisory metrics remain warnings
119
+ and do not create a retry ledger or override Gate. If a legacy workspace returns
120
+ `route.extract.codeindex-migration-required`, execute only its migration
121
+ command; do not rename `codegraph` paths manually.
148
122
 
149
- ### Discover Indexer Providers before selection
123
+ ### Select Indexer Providers
150
124
 
151
125
  For `indexer-provider-required`, `indexer-provider-unavailable`,
152
126
  `indexer-customization-required`, `indexer-customization-invalid`, or
@@ -157,69 +131,40 @@ default, six-level customization ladder, upgrade conflict handling, debugging
157
131
  commands, and the exit condition for each level. Do not replace it with a
158
132
  remembered or host-specific workflow.
159
133
 
160
- When the current Route starts a new Code or Markdown indexing task, run this
161
- read-only command once before creating or changing any Provider registry entry:
162
-
163
- ```bash
164
- context indexer catalog --format json
165
- ```
166
-
167
- Report the returned CLI-bundled entry Skills together with every other Indexer
168
- Skill already visible through the current host. The conversational report must
169
- include each Skill name, readable exact version when available, and source type
170
- (CLI-bundled community, workspace, installed plugin, or authorized marketplace
171
- result). When the host already exposes an exact Skill root or `SKILL.md` path,
172
- read only its YAML frontmatter and sibling `context-indexer.yaml` during
173
- discovery. The manifest version is authoritative;
174
- `metadata.context-provider-version` is a readable copy that must match it. Do
175
- not load the Provider body or other guidance until the Route selects it. If the
176
- host exposes no readable root or exact version, report the version as
177
- unavailable rather than guessing it.
178
-
179
- Group observations with the same Skill name and exact version into one
180
- conversational item and list all observed source types on that item. An
181
- installed projection of an identical CLI-bundled identity is not a second
182
- Provider. Keep different versions separate. The route input still preserves
183
- each distinct source observation as its own `visible_skills` entry because
184
- `source_type` is singular; never use source count or discovery order as
185
- selection precedence. Do not search arbitrary directories, infer host cache
186
- paths, install a plugin, or query a marketplace unless the user separately
187
- authorizes it. Keep this discovery report only in the conversation: do not
188
- write it to `src/`, `package.json`, lifecycle state, receipts, audit output, or
189
- `dist/`. Do not repeat it during an unchanged task resume; repeat it only for a
190
- new indexing task, a changed host-visible Skill set, or an explicit diagnostic
191
- request.
192
-
193
- After the requirements are applied, author one
194
- `context.indexer.provider-route-input/v1` payload whose `registry` preserves
195
- the applied `requirements` block exactly and whose `visible_skills` contains
196
- only the just-reported path-free identities. Route it before any Host resolves
197
- or reads an external Provider:
198
-
199
- ```bash
200
- context indexer route-indexer-provider-selection --input <payload.yaml-or-json> --format json
201
- ```
202
-
203
- On `community-fallback-required`, retry with the applicable CLI-bundled profile
204
- and set `community_fallback_attempted: true`. Read-scope overlap is allowed, but
205
- an exact primary owner-cell conflict must be resolved explicitly; do not use
206
- array or discovery order as precedence. If fallback leaves a required owner
207
- cell uncovered, preserve the returned `capability_gap_proof`. Only the Route's
208
- following `propose-indexer-customization` Agent Action may turn that exact proof
209
- into a dependency-free minimal `extend` draft; do not weaken the requirement,
210
- write source, add dependencies, or claim the draft is applied.
211
-
212
- Only `selection-validation-required` returns a
213
- `selection_proposal_input`. Pass that exact object to:
214
-
215
- ```bash
216
- context indexer validate-indexer-selection-proposal --input <payload.yaml-or-json> --format json
217
- ```
218
-
219
- Use only the returned `next_provider_requests` for resolution. A successful
220
- static report does not authorize materialization, installation, execution, or
221
- writing the proposal into `src/indexers.yaml`; continue through the Route's
222
- resolver, staging, final validation, confirmation, and apply Actions.
134
+ When the current Route starts a new Code or Markdown indexing task, its
135
+ `configure-indexer-providers` Action input already contains the exact applied
136
+ requirements and CLI-bundled Provider catalog. Select applicable Providers from
137
+ the Skills already visible to the Host and that supplied catalog. Do not add a
138
+ catalog command, installation preflight, discovery report, or discovery-only
139
+ confirmation to the normal workflow. The main entry being visible is not proof
140
+ that every Provider is available; the CLI checks the selected distribution
141
+ when it is used and returns any missing/version-conflict recovery.
142
+
143
+ Use the supplied CLI-bundled identity for a selected shipped Provider, including
144
+ when the same Skill/version is also visible as an installed projection. Do not
145
+ resolve that copy through the Host or re-read its installed metadata. For a
146
+ relevant external Skill, read only the exact Host-exposed frontmatter and
147
+ sibling `context-indexer.yaml` needed for selection; do not guess a version or
148
+ scan caches. Different versions remain distinct. Read Provider guidance only
149
+ when selected. Discovery is not a durable workspace artifact.
150
+
151
+ Return only `stage: provider-selection`, the non-CLI
152
+ `host_visible_skills`, and the selected semantic `indexers` through the exact
153
+ `context action complete-current` command returned by the Route. The CLI owns
154
+ construction of the full registry payload, fallback/conflict checks, static
155
+ validation, Provider resolution and staging, final validation, and atomic
156
+ application of `src/indexers.yaml`. Do not call their low-level commands as a
157
+ second production workflow.
158
+
159
+ If a selected external Provider needs Host resolution, the next current Route
160
+ contains one `context.resolve-indexer-provider/v1` Host Action and its exact
161
+ request. Invoke that Host Action once, then submit
162
+ `stage: provider-resolution` with the returned Host result through the Route's
163
+ `complete-current` command. If the Bundle carries a non-allowlisted program,
164
+ the following current Route presents the existing program-execution Gate; wait
165
+ for its user/session-authority decision and submit that decision through
166
+ `complete-current`. A recovered `provider-finalization` Route consumes
167
+ only its fixed Action input; it must not resolve or install the Provider again.
223
168
 
224
169
  ### Follow the current Route
225
170
 
@@ -227,8 +172,12 @@ Treat `workflow.current` as the current-step authority:
227
172
 
228
173
  1. Read every `resources.required` item whose `read_state` is `read-required`.
229
174
  Read a returned `path` completely, or execute a returned resource `command`
230
- and read its complete output file. Materializing a resource is not reading
231
- it. Keep the merged receipts only in this conversation and submit them with
175
+ and read its complete output file. For a current Indexer Partition, Author,
176
+ Composer or structure-review Route, read the materialized files and then use
177
+ the Route's immediate completion command; do not create or submit a read
178
+ receipt. Other workflow resources may still require the returned receipt
179
+ command. Materializing a resource is not reading it. Keep those receipts only
180
+ in this conversation and submit them with
232
181
  the exact returned `context status --resource-receipts @<file>` command. Use
233
182
  `after_read_receipts` only after the full resource has been read. The exact
234
183
  `resources.after_read.command` already returns the re-evaluated
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: context-code-indexer
3
- description: Context-managed Provider for evidence-bound code knowledge. Use only when the Context Indexer lifecycle selects this Provider, not as a standalone workflow.
3
+ description: Context-managed Provider for source-grounded code knowledge. Use only when the Context Indexer lifecycle selects this Provider, not as a standalone workflow.
4
4
  metadata:
5
5
  context-role: "indexer-provider"
6
6
  context-public-entry: "false"
7
- context-provider-version: "1.0.0"
7
+ context-provider-version: "1.1.2"
8
8
  ---
9
9
 
10
10
  # Context Code Indexer
@@ -15,6 +15,33 @@ shared Provider/customization guide before publishing or extending this Skill.
15
15
  Those documents are authoring contracts; the current workset and Route remain
16
16
  execution authority.
17
17
 
18
- Use this Provider only through the Context Indexer lifecycle. The workspace registry selects an exact profile, version, integrity, scope, and operation. Do not scan outside the supplied workset or write project files directly.
18
+ Use this Provider only through the Context Indexer lifecycle. The workspace registry selects an exact profile, version, integrity, scope, and operation. Consume evidence only from the single Context-supplied Authorized Workset View; do not scan outside the supplied workset, construct pagination/receipt requests, or write project files directly.
19
+
20
+ Keep machine identity and reader content deliberately small. A durable Fact
21
+ locator may identify a relation or declaration, but must never embed a source
22
+ expression, implementation body, complete tool response, credential-like value,
23
+ or other source text; keep such material in the process-local protected payload.
24
+ Write for a consumer outside the indexed module: show what the module is
25
+ responsible for, when and how to enter it through stable interfaces, where it
26
+ hands off, and which core state, failure, operation, or source-of-truth facts are
27
+ needed for correct use and attribution. Effective coverage means answering these
28
+ supported reader questions across stable capabilities, not maximizing the number
29
+ of symbols or paths mentioned.
30
+ Every reader Artifact must answer the selected profile's concrete questions from
31
+ current facts. A symbol/path list, generic module summary, workflow explanation,
32
+ or internal Fact/View/digest count is not useful knowledge and must not be emitted.
33
+ Before emitting an Artifact, identify the concrete selected-profile question
34
+ that its logical unit answers. Formal question refs may close required coverage,
35
+ but a group label, Partition Subject, or large Fact volume alone is not a reader
36
+ purpose; a unit with no applicable profile question is catalog-only.
37
+ Bind each reader claim only to the smallest relevant evidence set; never attach
38
+ an entire workset inventory to a generic summary.
39
+ Close inventory members with their actual boundary evidence or a legal
40
+ catalog/exclusion disposition. Never reuse one unrelated fallback evidence
41
+ binding merely to make the disposition denominator appear complete.
42
+ When a large module exposes stable route, capability, protocol, runtime, or
43
+ storage boundaries, partition on those boundaries before authoring. Do not put
44
+ the whole module in one catch-all logical unit, and do not replace semantic
45
+ partitioning with numbered batches.
19
46
 
20
47
  The machine-readable authority is `context-indexer.yaml`. Detailed authoring guidance is materialized by Context from the registered Bundle after its file ledger and integrity have been verified.
@@ -1,6 +1,6 @@
1
1
  protocol: context.indexer.provider/v1
2
2
  id: context-code-indexer
3
- version: 1.0.0
3
+ version: 1.1.2
4
4
  domains: [code]
5
5
 
6
6
  activation:
@@ -62,14 +62,9 @@ provides:
62
62
  priority: 200
63
63
  operations:
64
64
  - id: main-index
65
- consumes: context.indexer.main-workset/v1
65
+ consumes: context.indexer.main-workset/v2
66
66
  produces: context.indexer.main-result/v1
67
67
  accepts_layer_fragments: [fact-enrichment, template-variables]
68
- - id: material-answer
69
- consumes: context.indexer.material-question-workset/v1
70
- produces: context.indexer.material-answer-result/v1
71
- supported_evidence_kinds: [code, contract, configuration, documentation, runbook, test-result, runtime-observation]
72
- accepts_layer_fragments: [fact-enrichment]
73
68
  layer_fragments:
74
69
  - kind: derived-artifact-proposal
75
70
  phase: post-author
@@ -209,7 +204,7 @@ provider:
209
204
  - { id: contract-source, profile: contract-source, path: templates/contract-source.md }
210
205
  - { id: derived-generated-source, profile: derived-generated-source, path: templates/derived-generated-source.md }
211
206
  forbidden_fallbacks: [one-page-per-symbol, ordinal-batch-pages, inferred-runtime-chain]
212
- completion_checks: [inventory-disposition-closure, subject-owner-closure, evidence-binding]
207
+ completion_checks: [inventory-disposition-closure, subject-owner-closure, source-coverage]
213
208
 
214
209
  customization:
215
210
  supports: [config, instructions-append, template-override, program-extend]