@c4a/context 0.7.9 → 0.7.10-alpha.2

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 (78) hide show
  1. package/articleStructure.d.ts +254 -0
  2. package/docs/guides/agent-dialogue.md +1 -1
  3. package/docs/guides/code-indexer-skill-authoring.md +76 -178
  4. package/docs/guides/indexer-provider-and-customization.md +93 -453
  5. package/docs/guides/indexer-skill-creation.md +107 -97
  6. package/docs/guides/knowledge-updates.md +35 -14
  7. package/docs/guides/markdown-indexer-skill-authoring.md +57 -134
  8. package/docs/reference/indexer-provider-protocol.md +52 -102
  9. package/docs/reference/package-templates.md +39 -65
  10. package/docs/reference/template-variables.md +2 -3
  11. package/index.d.ts +6 -10
  12. package/index.js +6441 -8771
  13. package/indexerAgentStepProtocol.d.ts +0 -910
  14. package/indexerApprovedKnowledge.d.ts +98 -359
  15. package/indexerArticlePlan.d.ts +3 -26
  16. package/indexerArtifact.d.ts +201 -70
  17. package/indexerArtifactPolicy.d.ts +0 -18
  18. package/indexerArtifactResult.d.ts +240 -888
  19. package/indexerAuthoringFixture.d.ts +0 -13
  20. package/indexerBenchmark.d.ts +2 -2
  21. package/indexerCandidateCompile.d.ts +123 -167
  22. package/indexerCatalogFallback.d.ts +32 -374
  23. package/indexerCollectionMapping.d.ts +2 -2
  24. package/indexerContentLayers.d.ts +187 -41
  25. package/indexerContractOverlay.d.ts +30 -44
  26. package/indexerControlledInvocation.d.ts +6 -6
  27. package/indexerControlledProgram.d.ts +959 -3020
  28. package/indexerDependencyView.d.ts +96 -96
  29. package/indexerEffectiveArtifact.d.ts +381 -242
  30. package/indexerExampleDecision.d.ts +134 -134
  31. package/indexerExampleIdentity.d.ts +6 -6
  32. package/indexerExampleIdentityAudit.d.ts +6 -6
  33. package/indexerInventoryDisposition.d.ts +0 -39
  34. package/indexerLayerComposition.d.ts +1378 -852
  35. package/indexerLayoutChange.d.ts +24 -33
  36. package/indexerLayoutProposalSet.d.ts +143 -137
  37. package/indexerLayoutResolver.d.ts +116 -101
  38. package/indexerLayoutTransition.d.ts +6 -6
  39. package/indexerMainLifecycle.d.ts +1 -11
  40. package/indexerMainRunLedger.d.ts +0 -14
  41. package/indexerMainRunProtocol.d.ts +806 -2530
  42. package/indexerMainWorkset.d.ts +0 -1212
  43. package/indexerNavigationArtifactPlan.d.ts +2 -2
  44. package/indexerOverlayQuestionApplyProposal.d.ts +0 -4
  45. package/indexerParserCoordinate.d.ts +2 -2
  46. package/indexerParserExecutionPlan.d.ts +42 -42
  47. package/indexerPartitionPlan.d.ts +24 -354
  48. package/indexerPhysicalArtifactManifest.d.ts +12 -27
  49. package/indexerPostAuthorComposition.d.ts +2 -253
  50. package/indexerPostAuthorRunLedger.d.ts +860 -562
  51. package/indexerPrimaryProjection.d.ts +2 -2
  52. package/indexerPrimaryResultView.d.ts +0 -318
  53. package/indexerProfileContract.d.ts +200 -549
  54. package/indexerProgramExecutionAuthorization.d.ts +4 -4
  55. package/indexerProgramRunProtocol.d.ts +806 -2527
  56. package/indexerProjectProposal.d.ts +8 -8
  57. package/indexerProjectedArtifactFanOutAudit.d.ts +8 -8
  58. package/indexerProjectedArtifactPlan.d.ts +0 -9
  59. package/indexerProvider.d.ts +46 -288
  60. package/indexerProviderComposition.d.ts +16 -42
  61. package/indexerQuestionAuthority.d.ts +2 -82
  62. package/indexerReaderTargetInventory.d.ts +6 -6
  63. package/indexerRequirementLifecycle.d.ts +6 -6
  64. package/indexerResultReconciliation.d.ts +35 -149
  65. package/indexerSemanticInput.d.ts +10642 -4685
  66. package/indexerStructuredDeclaration.d.ts +24 -24
  67. package/indexerTemplateRendering.d.ts +239 -113
  68. package/knowledgeMap.d.ts +5 -5
  69. package/package.json +1 -1
  70. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +13 -16
  71. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +9 -9
  72. package/indexerArtifactDependencies.d.ts +0 -693
  73. package/indexerCompositionFactDependencies.d.ts +0 -16
  74. package/indexerExampleFactDependencies.d.ts +0 -17
  75. package/indexerIncrementalImpact.d.ts +0 -221
  76. package/indexerKnowledgeDependency.d.ts +0 -46
  77. package/indexerSubjectCatalog.d.ts +0 -230
  78. package/indexerSubjectKeyAuthority.d.ts +0 -786
@@ -1,471 +1,111 @@
1
- # Indexer Provider selection and customization
1
+ # Indexer guidance for planning and writing
2
2
 
3
- This guide is for workspace users and Agents selecting Code, Markdown, Note or Sessions
4
- Indexer Providers. Provider authors should also read the dedicated
5
- [Code Indexer](./code-indexer-skill-authoring.md) or
6
- [Markdown Indexer](./markdown-indexer-skill-authoring.md) authoring guide.
3
+ Follow the current Route returned by `context run` or `context status --format json`.
4
+ The CLI prepares a stage directory and returns its instructions, schemas and
5
+ submission command. Use those files instead of copying long content into arguments.
7
6
 
8
- Context is registry-only by default. The durable selection lives in
9
- `src/indexers.yaml`; `package.json`, discovered Skill paths, Host cache paths,
10
- resolved transport paths and runtime staging directories are not selection
11
- authority. A Provider-only project does not create `src/indexer/`.
7
+ ## Responsibilities
12
8
 
9
+ An Indexer helps expose the source skeleton and guides source-grounded writing.
10
+ It is not a mandatory full symbol scan or a semantic classifier owned by the CLI.
11
+ Use a visible Skill directly, or its bounded CLI-assisted discovery, as appropriate
12
+ for the technology. Multiple Indexers may explain different aspects of one module.
13
+ There is no mandatory primary-owner selection or Provider resolution stage.
13
14
 
14
- ## Large sources and planning depth
15
+ At the start of this continuous work, declare the available relevant Skills and
16
+ whether the Agent can schedule sub-agents. Use the capability schema supplied in
17
+ the stage directory. A new session must declare its actual capabilities; do not
18
+ inherit another session's parallel scheduling claim. Skill names and optional
19
+ configuration are guidance, not version pins or evidence of completed reading.
20
+ Do not inspect caches, compare Skill hashes, resolve exact versions or create a
21
+ second installation registry. Installation and enabling Skills belong to the Host.
15
22
 
16
- Use directory/manifests, route or service registration and representative code to
17
- select Providers and plan reader subjects. Do not run a complete symbol index
18
- just to decide the initial article menu. Application/service file-inventory
19
- batches describe reading scope; they are not business module boundaries or a
20
- requirement to publish one article per directory. Inspect the supplied source
21
- access and converge related batches into reader subjects. A file with no supplied
22
- symbol facts has not been deeply parsed; this is not evidence that it has no APIs.
23
- Accepted application batches acquire parser facts before Author. Existing
24
- request-material remains the next action for implementation outside the initial
25
- reading scope. Public-contract-led profiles, including component libraries,
26
- retain their contract preparation because those facts define their reader targets.
23
+ ## Confirmed requirements
27
24
 
28
- A read scope is an authorization ceiling. Each Indexer should own its actual
29
- module, with other sources as supporting evidence only when needed. Mixed
30
- frameworks require per-module Provider choices; do not disable a relevant
31
- extension to avoid fixing an oversized source boundary. Framework facts are
32
- still prepared at Author after the selected code has been parsed. For large
33
- IDL sources, first follow the selected applications' concrete protocol references
34
- and required includes; an entire protocol monorepo is not a default target.
35
-
36
- Parser progress is on stderr; stdout remains the command's JSON result. Report
37
- actual phase, source and available counts without estimating a percentage from
38
- elapsed time. A preparation-cache hit only reuses parser work, not proof of
39
- completed articles. After interruption use the current Route; do not clear state
40
- or increase memory automatically to retry the same oversized scope.
41
-
42
- ## Selection flow
43
-
44
- Follow `workflow.current` from `context status --format json` or `context run`.
45
- When the registry is missing, the Route names `src/indexers.yaml` in
46
- `configuration`: declare the confirmed requirements with `indexers: []`, then
47
- re-evaluate. The next Route supplies the Provider selection input and completion
48
- command. An unconfigured project does not begin Partition or require a fabricated
49
- primary owner. `run --managed --until blocked-or-complete` stops at the same
50
- configuration or semantic input boundary; it does not make those decisions.
51
-
52
- 1. Form the complete requirements using the initial registry contract below.
53
- Reuse the user's stated meaning and research the selected material. Ask about
54
- consequential missing purpose or scope even in managed mode; delegation
55
- covers execution and eligible reviews, not unanswered intent. A Provider,
56
- registry entry or Result may strengthen it but cannot remove targets,
57
- questions, evidence obligations or required owner cells.
58
- 2. Select applicable Providers from the Host-visible Skills and the CLI-bundled
59
- catalog already in the current Action input. No separate catalog command,
60
- installed-Skill inventory, discovery report, or discovery-only confirmation
61
- is required. Use the supplied exact identity and cli-bundled distribution
62
- for shipped Providers, even when their Skills are also visible to the Host.
63
- For a relevant external Skill, read its exact Host-exposed `SKILL.md`
64
- and sibling `context-indexer.yaml`, then only the linked framework references
65
- needed to evaluate observed module signals. Do not guess versions
66
- or scan `.claude`, `.codex`, `.agents` or arbitrary user directories. Different
67
- versions remain distinct; discovery order is not selection precedence.
68
- 3. Submit the semantic `indexers` and any relevant non-CLI `host_visible_skills`
69
- through the current Route's `context action complete-current` command. The
70
- latter may be empty; it is not an inventory or an additional discovery step.
71
- 4. The CLI performs routing, validation, resolution and staging internally.
72
- Shipped Providers load directly from this CLI release; only external
73
- Providers may require the returned Host resolution Action. Follow the
74
- current Route if a distribution is missing, a version conflicts, or program
75
- execution needs authorization. Do not call the low-level commands below as
76
- a second production workflow.
77
- 5. The CLI atomically applies the validated registry and any declared
78
- customization. A successful static report alone is not write or execution
79
- authority. Resume from the returned current Route.
80
-
81
- Every required requirement/domain/source/module cell has exactly one primary
82
- owner. Read scope may overlap for supporting profiles, extensions and
83
- enrichers. Array order is never precedence. Each Provider layer retains its own
84
- exact version, integrity, portable distribution, config and resource
85
- fingerprints.
86
- For CLI-bundled instruction Providers, these fields record the original
87
- selection; they are not a requirement to reinstall old bytes when resuming.
88
- The current CLI supplies its installed Provider's guidance automatically.
89
-
90
- ### Select technology profiles per module
91
-
92
- A registered repository is a source boundary, not a single technology profile.
93
- Different modules may need different primary profiles and extension layers. Use
94
- the current selection contract's supported module and target/read scopes; never
95
- assign one module's stack to the entire repository merely because it was
96
- registered as one source.
97
-
98
- An observed framework dependency, configuration, entry or adapter signal is a
99
- reason to load the relevant Provider Skill and its applicable reference during
100
- selection. Reading this guidance is not activation or permission to execute the
101
- Provider. Follow its evidence rules to verify the signal within authorized source
102
- material, then bind the applicable profile only to the supported modules. A name
103
- alone may justify investigation without proving a framework is active.
104
-
105
- If boundaries are still unclear, identify the relevant modules and inspect their
106
- configuration and entries in the existing selection flow. Do not reject a
107
- relevant Provider solely because the repository contains mixed stacks, or defer
108
- investigation until generic authoring happens to report a capability gap. Record
109
- unresolved evidence and the concrete next inspection when it cannot yet be
110
- obtained. Keep unrelated modules on their appropriate primary profiles; multiple
111
- compatible, proven extensions may support one module without becoming duplicate
112
- primary owners. These are Agent selection responsibilities, not CLI semantic
113
- checks or new review gates.
114
-
115
- ## Resuming after a tool update
116
-
117
- Continue with the current Route and its supplied source material. Agents do not
118
- compare Provider, Fact, signature or inventory fingerprints and do not rewrite
119
- them in an old request. Context rebuilds the internal result from the submitted
120
- page content and references.
121
-
122
- An added parser field or a more complete line range in the same unchanged file
123
- does not invalidate Author work. Continuation compares selected sources and
124
- subjects rather than serialized Fact payloads; accepted work retains its
125
- original request/result pair. New results retain the source references used for
126
- later updates. Repeated Fact references or reader-question answers are deduplicated;
127
- multiple sections may answer the same question. A question ID only identifies a
128
- reader question to cover, not an additional user approval.
129
-
130
- Missing references, a changed source file, a different page owner/subject or a
131
- concurrent write remain meaningful conflicts. Requirements, membership and result
132
- contracts still determine whether a task can be reused. This does not introduce a
133
- new Agent protocol, hash-entry step or persistent audit file.
134
-
135
- ## Provider selection result
136
-
137
- Use the current Action's output schema, which defines the accepted Indexer
138
- entry fields. This is a `complete-current` input, not a replacement registry
139
- and not the requirements-only bootstrap schema.
140
-
141
- For one component-library requirement, the following template selects one
142
- primary Code Provider. Replace the quoted placeholders using the **current
143
- Action input**, not values from a different CLI installation:
144
-
145
- ```yaml
146
- stage: provider-selection
147
- host_visible_skills: []
148
- indexers:
149
- - id: component-guide
150
- operations: [main-index]
151
- requirement_bindings:
152
- - requirement_ref: "<requirement.id>"
153
- coverage_domains: ["<required-domain>"]
154
- owned_scope:
155
- ref: "requirement:<requirement.id>#target_scope"
156
- role: primary
157
- read_scope:
158
- refs:
159
- - "requirement:<requirement.id>#target_scope"
160
- - "requirement:<requirement.id>#evidence_source_scope"
161
- profile:
162
- primary:
163
- id: component-library
164
- provider: community
165
- providers:
166
- - id: community
167
- role: primary
168
- catalog_skill: "<catalog.skill>"
169
- ```
170
-
171
- - Choose `component-library` only if it matches the reader task and appears in
172
- the selected catalog entry's `capabilities.profiles`. For captured documents,
173
- notes or conversation summaries, select a profile from the corresponding
174
- compatible Provider. `catalog_skill` selects exactly one bundled entry from the
175
- current Action catalog. The CLI fills its version, integrity and distribution
176
- after checking the Route revision; a changed catalog invalidates that revision.
177
- Do not combine this reference with identity overrides. Full identities remain
178
- available for explicitly pinned entries and external Providers, which retain
179
- their resolution and authorization requirements. The persisted registry always
180
- contains complete identities, never `catalog_skill` references.
181
- - Bind each selected requirement and all required coverage domains it owns;
182
- the single-domain template is not permission to drop other required domains.
183
- `owned_scope` names the target being described. `read_scope` may also include
184
- supporting evidence, which does not become another owned target.
185
- - `profile.primary.provider`, each additional profile's `provider`, and each
186
- composer's `provider` reference a layer's `providers[].id`, not a Skill path.
187
- Supporting or extension profiles use `profile.additional` with `kind`;
188
- composers use `profile.composers`. Select only combinations supported by the
189
- manifests; do not add empty customization or speculative config.
190
- - The current catalog includes domains, target kinds, profile IDs, operations,
191
- composers and extension relationships. If more detail is needed, read the
192
- selected entry's exact `guidance.skill_path` and `guidance.manifest_path`.
193
- These paths and capabilities are reading aids, not fields to copy into the
194
- persistent registry. No separate discovery command or cache scan is needed.
195
- - JSON Schema describes input shapes and accepted values. The CLI additionally
196
- checks coverage ownership, scope relationships and Provider composition when
197
- submitting. It atomically applies the selection; do not edit `indexers`
198
- manually to bypass a rejected result.
199
-
200
- ## Initial registry: `src/indexers.yaml`
201
-
202
- The initial configuration Route provides the registered source boundary view.
203
- Read it when the source identities are not already available from the current
204
- source registration results. It is a metadata view, not another source capture
205
- or a request to scan the repository. Use only the user's agreed source scope.
206
-
207
- Read the `context.indexer.registry-bootstrap` schema at the exact path in the
208
- current Route's required resources. It ships with the CLI, so it does not
209
- require a workspace SDK reinstall. It describes this **configuration file**,
210
- not an Action completion payload. It
211
- covers the requirements-only state before Provider selection: `indexers` must
212
- be empty here. Later the Provider selection Route fills that array.
213
-
214
- Start with this complete YAML example. Replace the example source reference,
215
- reader goals and coverage domains with the agreed project requirements:
25
+ The configuration Route names the required file and supplies its schema. The
26
+ requirements-only registry records reader goals and authorized sources, not
27
+ production assignments. For example, replace the source and goals with the
28
+ user's actual scope:
216
29
 
217
30
  ```yaml
218
31
  protocol: context.indexer.registry/v1
219
32
  requirements:
220
- - id: component-guide
221
- purpose: Help application developers integrate components and look up their public API.
222
- reader_goals: [understand-components, integrate-components]
33
+ - id: integration-guide
34
+ purpose: Help application developers understand and integrate the system.
35
+ reader_goals: [understand-system, integrate-system]
223
36
  coverage_domains:
224
- component-usage: required
225
- public-api: required
37
+ architecture: required
226
38
  target_scope:
227
39
  targets:
228
- - source_ref: repo:20260901/component-library
40
+ - source_ref: repo:sample
229
41
  evidence_source_scope:
230
42
  targets:
231
- - source_ref: repo:20260901/component-library
43
+ - source_ref: repo:sample
232
44
  indexers: []
233
45
  ```
234
46
 
235
- | Field | What to write |
236
- | --- | --- |
237
- | `protocol` | Exactly `context.indexer.registry/v1` for the file. |
238
- | `requirements` | One or more knowledge goals, grouped by reader need; not one entry per file or symbol. |
239
- | `id` | A unique, readable identifier for this requirement. |
240
- | `purpose` | Optional short natural-language reader and task purpose; reuse explicit existing goals when absent. |
241
- | `reader_goals` | One or more readable goal identifiers, such as `integrate-components`. These are not Provider names. |
242
- | `coverage_domains` | A nonempty map of intended information categories to `required`, `optional` or `out-of-scope`. Provider selection must cover the required categories. |
243
- | `target_scope.targets` | Sources whose subjects the knowledge should describe. At least one target is required. |
244
- | `evidence_source_scope.targets` | Sources the Agent may read to support that knowledge. Include the relevant target sources and any agreed supporting documents. At least one is required. |
245
- | `source_ref` | The source type plus its complete registered name, such as `repo:20260901/component-library`, `file:20260901/usage-guide` or `lark:20260901/faq`. Saved text uses `note:20260908/topic.md` or `sessions:20260908/topic.md`. Preserve the actual name, not these examples. |
246
- | `module_refs` | Optional on each target; omit for the complete registered source boundary. Supply only known module references for an explicitly narrower scope. Do not invent a module merely because the source is a code module. |
247
- | `questions` | Optional structured contract-question bindings, not free-text user questions. Omit unless an actual CLI/profile contract supplies their references, versions and digests. Never invent hashes. |
248
- | `exclusions` | Optional explicit exclusions with `id`, `scope.targets` and a nonempty `reason`. For repository input, optional `paths` lists exact source-relative files or directories, without globs; omitted means the whole named scope. Agreed paths are filtered before Parser and Partition. A shared Indexer retains material still needed by another requirement. Omit when none were agreed. |
249
- | `indexers` | `[]` until the next Route selects Providers. Do not copy version or integrity values from an unrelated project. |
250
-
251
- Requirement, goal, domain and exclusion identifiers use lowercase letters,
252
- digits and `._/-`; the first character is a letter or digit, and slash-separated
253
- segments cannot be empty, `.` or `..`. Requirement ids and goal lists must not
254
- contain duplicates. Each scope lists a source once; put its selected modules in
255
- that target's `module_refs` rather than repeating the source.
256
-
257
- For document-only knowledge, use the selected captured `file:` or `lark:` source,
258
- or saved `note:` or `sessions:` source, in both scopes. Saved text must first be
259
- explicitly selected in the project's `sources`; saving alone is not selection. For a code guide supported by a FAQ, keep the code source in the target
260
- scope and include both code and FAQ in the evidence scope. If the FAQ also needs
261
- independent knowledge coverage, include it as a target in the appropriate
262
- requirement; do not silently treat all captured documents as background.
263
- Source references identify selected source boundaries, not filesystem paths, URLs,
264
- image ids, span references or content digests. A repo source already registered
265
- at a package subdirectory remains bounded to that subdirectory when
266
- `module_refs` is omitted.
267
-
268
- Three existing input shapes have different roles:
269
-
270
- - `src/indexers.yaml`: `protocol: context.indexer.registry/v1`, `requirements`,
271
- and `indexers`.
272
- - `IndexRequirementSet`: `protocol: context.indexer.requirement-set/v1` and
273
- `requirements` only. This is the SDK's requirement value, not the whole file.
274
- - Diagnostic `inspect-index-requirements --input`: an envelope with
275
- `protocol: context.indexer.requirement-inspection-input/v1`, `project_ref`
276
- (the workspace root) and `requirements`; optional `question_contracts` are
277
- only for real resolved contract questions. It does not accept the whole
278
- registry or a bare requirement set, and is not a mandatory bootstrap step.
279
-
280
- After editing the named configuration file, run `context status --format json`
281
- and follow its new current Route. The next step is Provider selection. Do not
282
- submit the YAML through `complete-current`, fabricate a lifecycle Result,
283
- restart the workspace or recapture existing sources.
284
-
285
- ## Six-level customization ladder
286
-
287
- Use the first level that closes the CLI-proven capability gap. Do not start at
288
- a more powerful level because it is convenient.
289
-
290
- | Level | Change | Entry evidence | Exit condition |
291
- | --- | --- | --- | --- |
292
- | 1. Provider only | Select an existing exact Provider/profile | The confirmed requirements are fully owned by declared capabilities | Final selection validation passes and no project customization files exist |
293
- | 2. Config | Select declared variants, resources or data-only options | The manifest exposes a closed config schema that covers the difference | Config validates; no instruction, template or program change is needed |
294
- | 3. Instructions append | Add bounded project guidance | The gap is semantic guidance and does not change contracts, scope, identity, denominators or hard rules | Appended resource closes the gap and the origin/version fingerprint is retained |
295
- | 4. Template override | Replace one declared template for one profile | The Artifact policy is already valid; only reader organization/rendering differs | One exact template id/profile is overridden; unrelated templates remain Provider-owned |
296
- | 5. Program extension | Add a fixed local program under the declared indexer root | A structured algorithm is required and smaller levels are proven insufficient | Static policy passes and independent program/dependency authorization is complete |
297
- | 6. Restricted replace | Replace only the capability named by the final gap proof | Extension cannot satisfy the exact owner cells and a human accepts the larger maintenance boundary | Replacement remains requirement-compatible, content-addressed and explicitly reviewable |
298
-
299
- Levels 3–6 are allowed only after the Route returns
300
- `indexer-customization-required` with a current `capability_gap_proof`. Copy the
301
- proof into the draft unchanged. A draft cannot weaken requirements, widen
302
- source scope, copy a parser, add an evaluator, or claim that it has been
303
- applied. If no safe level closes the gap, stop instead of emitting a
304
- conforming-looking file.
305
-
306
- ## Upgrade and conflict handling
307
-
308
- For a CLI-bundled instruction Provider, resume with the installed Skill and
309
- portable distribution. A version or content change alone does not require
310
- Provider selection, registry edits, source capture or a restart. The CLI
311
- refreshes the current batch's instruction resources and Route revision;
312
- the Agent follows the returned Route without comparing fingerprints.
313
-
314
- Compatible tasks keep their original request/result records. Instruction or
315
- template edits do not, by themselves, discard accepted groups or authored
316
- content. Changes to sources, requirements, executable programs, configuration,
317
- result contracts or semantic extension inputs remain work invalidation reasons;
318
- old results must not be relabeled as outputs of a different task.
319
-
320
- Executable/external Providers continue using their resolved staged programs.
321
- Updating instruction delivery does not replace executable code or grant new
322
- execution permissions. Local customization files remain user-owned:
323
-
324
- - An unchanged upstream resource keeps the local override current.
325
- - A changed instruction resource outside the override refreshes guidance for
326
- pending work, without automatically regenerating completed knowledge.
327
- - A changed resource under an instruction/template/program override returns
328
- `indexer-customization-upstream-changed`; rebase or remove the override.
329
- - Missing, undeclared, escaping or contract-conflicting local resources return
330
- `indexer-customization-invalid`.
331
- - A missing CLI-bundled Provider or selected profile/operation/composer returns
332
- the existing Provider selection Action, with its schema and next command.
333
- Captured sources and completed knowledge are retained. External distributions
334
- that cannot be resolved still require the existing resolution/selection flow.
335
- - Multiple primary owners return a conflict for explicit resolution. Do not
336
- use discovery order or a preferred Provider name as a tie-breaker.
337
-
338
- The optional `@context-indexer-origin <skill>@<version>` comment records where
339
- a local customization began. It grants no trust and never bypasses revalidation.
340
-
341
- ## Outcome handling
342
-
343
- These outcomes all point back to this guide:
344
-
345
- | Outcome | Required next action |
346
- | --- | --- |
347
- | `indexer-provider-required` | Discover visible entry Skills, route a path-free proposal, and keep the requirement set unchanged. |
348
- | `provider-unavailable` / `indexer-provider-unavailable` | Follow the current selection/resolution Action to restore the missing capability. A historical bundled content pin alone is not a failure. |
349
- | `indexer-customization-required` | Follow the six-level ladder using only the returned current gap proof. |
350
- | `indexer-customization-invalid` | Remove undeclared/escaping/conflicting files, then rebuild and restage the proposal. |
351
- | `indexer-customization-upstream-changed` | Reconcile the upstream change with every affected override and rerun final validation. |
352
-
353
- ## Debugging commands
354
-
355
- These are diagnostic/manual primitives, not a checklist for normal selection.
356
- Use them only for an explicit diagnostic or a returned recovery. `--help`
357
- describes command options, not necessarily the payload fields. Use the current
358
- Route's schema and the initial registry contract above; prefer Route-returned commands:
359
-
360
- ```bash
361
- context indexer catalog --format json
362
- context indexer inspect-index-requirements --help
363
- context indexer compare-index-requirements --help
364
- context indexer route-indexer-provider-selection --help
365
- context indexer validate-indexer-selection-proposal --help
366
- context indexer resolve-indexer-providers --help
367
- context indexer stage-indexer-provider-bundle --help
368
- context indexer validate-indexer-customization --help
369
- context indexer prepare-indexer-customization-project --help
370
- context indexer stage-indexer-project-proposal --help
371
- context indexer apply-indexer-project --help
372
- context indexer observe-indexer-project --help
373
- ```
374
-
375
- Keep full runtime reports under `.tmp/context-runtime/`. Do not persist Bundle
376
- bytes, resolution receipts, selection discovery, run ledgers or audit reports
377
- in `src/`, `knowledge/` or `dist/`.
378
-
379
- ## Completion check
380
-
381
- Selection/customization is complete only when all of these are true:
382
-
383
- - the confirmed requirement digest is unchanged;
384
- - every required owner cell has exactly one primary owner;
385
- - every Provider is exact-versioned, integrity-checked and staged from a
386
- portable distribution;
387
- - profile variants, SubjectKey authority, config and resources pass final
388
- validation;
389
- - each local change is the smallest proven ladder level and has no unrelated
390
- copied resources;
391
- - program and dependency receipts exist when required and do not claim a
392
- sandbox the Host does not provide;
393
- - the transactional apply observation matches every target digest;
394
- - a final static/final selection validation passes after apply.
395
-
396
- For the complete manifest and execution surface, see
397
- [Indexer Provider protocol](../reference/indexer-provider-protocol.md).
398
-
399
- ## Purpose, page selection, and delivery
400
-
401
- `purpose` is an optional short description of the intended reader and task.
402
- Existing `reader_goals` remain valid when it is absent. Context passes this
403
- requirement through Partition, Author, and Review; it does not classify free
404
- text against a fixed vocabulary.
405
-
406
- For the first production task in a new workspace, the source-boundary Route
407
- requires `.tmp/work-start-report.md` before source registration. The current
408
- workflow supplies `procedure.work-start-report` and `template.work-start-report`:
409
- a readable report covering readers, purpose, source families, language, settings,
410
- delivery outputs, first delivery and proposed organization. The Agent reads the
411
- brief and representative authorized material with Host tools, presents the report
412
- and resolves its missing choices before registration or capture. The CLI only
413
- checks the Route payload references a real non-empty report and records its digest;
414
- it does not judge prose or infer semantic decisions. Reuse and update the report
415
- with actual Provider choices before Partition rather than adding a per-batch report.
416
-
417
- Partition may select `artifact_intent` and `template_id` from the current
418
- Provider catalog, along with `reader_task`, `outline`, `priority`, and
419
- `delivery_boundary`. These choices are saved in the existing page plan and
420
- reused by Author retries. Program templates declare `kind: page-program` in the
421
- Provider's template resources. Only the selected program is included in the
422
- Author View; procedure templates remain shared instructions. Workspace template
423
- overrides retain priority over the bundled default.
424
-
425
- Selected Code page programs append a deterministic public-contract table to the
426
- same Candidate as its semantic explanation. Declarations provide field types,
427
- requiredness, explicit defaults, signatures, and supported registration facts.
428
- Missing declarations remain explicit; reference tables do not substitute for
429
- source-backed examples, behavior, or change guidance.
430
-
431
- The first readable delivery normally contains one to three pages. Subsequent
432
- batches contain 30–50 pages, or a smaller final tail. Context retains accepted
433
- Results across Review, close, and build, then continues the remaining pages.
434
- `context run --deliver --format json` requests an earlier checkpoint. It keeps
435
- the current approval rules. Status reports page counts and built preview paths;
436
- Author task counts are reported separately.
437
-
438
-
439
- ## Source-specific Providers and Host switches
440
-
441
- The default distribution includes Code, Markdown, Note and Sessions Providers.
442
- `context-note-indexer` interprets saved records/excerpts/observations;
443
- `context-sessions-indexer` interprets bounded conversation summaries, with or
444
- without code associations. Their shared markdown domain reuses document reading
445
- and profiles; it does not force all sources through Markdown's semantic policy.
446
- See [note preparation](note.md) and [sessions preparation](sessions.md).
447
-
448
- The host owns installation and enabled/disabled switches. Business skills may be
449
- installed by any supported host channel. Discover relevant currently visible
450
- `context-…-indexer…` skills and read the real sibling manifest; the prefix alone
451
- is not compatibility proof. Declare the selected business Provider through the
452
- existing host_visible_skills and indexers result. It can replace a default without
453
- enabling that default. CLI validates/resolves what was declared; it does not scan
454
- host caches or maintain a second business-skill enable registry. Respect explicit
455
- user exclusions even when the bundled catalog contains the default.
456
-
457
- Choose the page owner from reader need. A note may improve an existing guide,
458
- answer a FAQ or justify a new reference topic. A session without code may justify
459
- a decision or process guide. Neither saving nor source type requires a new page.
460
- For a Code/Markdown page retain its primary and include the actual supporting
461
- source in evidence/read scope. When specialized source interpretation is needed,
462
- select a Note/Sessions extension layer and the matching namespaced profile
463
- (`note/component-library` or `sessions/component-library`, for example) with
464
- `kind: extension`. The manifest declares each supported base. Supporting profiles
465
- with `kind: supporting` must come from the same primary layer. One primary writes
466
- the final page; extension guidance does not create another production target.
467
-
468
- Optional sessions `changes` records known commit/MR associations in the source
469
- file. Existing structure.yaml source/section links connect knowledge to it.
470
- Do not add per-page commit, session or Provider frontmatter. A reference is not
471
- proof of merging/testing and does not expand source-read authorization.
47
+ Use registered source identities, not guessed paths or URLs. Keep any confirmed
48
+ exclusions and supporting-source boundaries. Sources needed for another requirement
49
+ are not globally excluded. Module directory boundaries can be supplied in task
50
+ instructions by the Agent or CLI; do not invent persistent article fields or
51
+ extra module-path validation. A module name alone does not identify its directory.
52
+
53
+ ## Lightweight investigation and planning
54
+
55
+ For code, inspect directories, manifests and registration points. Return names,
56
+ known counts and locations, not every symbol, call graph or implementation detail.
57
+ Discovery has a bounded budget. Report incomplete coverage honestly; partial
58
+ feature counts are not totals. Read representative code only when it helps make
59
+ the plan. Deep extraction belongs to writing the selected topic.
60
+
61
+ For documents, start with titles, bounded introductory text and heading outlines.
62
+ Read more when necessary. Reuse code topics or existing articles where the content
63
+ belongs, without forcing business concepts into physical directory names. Notes
64
+ and sessions can directly suggest a new article or an amendment to an existing one.
65
+
66
+ Submit article paths, reader questions, source associations and writing batches
67
+ using the supplied planning schema. Record selected Skill names and configuration
68
+ in the temporary plan's `indexer_usage`; the CLI can return it during planning
69
+ and writing. It is not persisted on articles, sections or production results.
70
+ Known one-to-one tasks can use the direct-writing path without an extra semantic
71
+ planning submission. Do not create an inventory-member disposition ledger.
72
+
73
+ Present the final work-start report after the relevant source overviews and plan
74
+ are ready, before bulk writing. Wait for the user's confirmation, including in
75
+ managed mode. Do not add approval for internal batch counts or Skill choices.
76
+
77
+ ## Directory-based writing
78
+
79
+ The CLI determines which batches are ready and supplies their material and
80
+ acceptance rules. Within that authorized work the Agent chooses reading order,
81
+ writing order and, when supported, sub-agent scheduling. Without sub-agent support,
82
+ work serially through the returned batch. Workers may write their assigned draft
83
+ files; the coordinator submits completed subsets and owns shared CLI writes.
84
+
85
+ Write Markdown and references into the stage's temporary output directory. Submit
86
+ the short file manifest with stage-relative paths. Whole-article submissions and
87
+ section repairs use the returned schemas. Read the receipt for accepted tasks,
88
+ precise errors and next ready work; do not resubmit accepted content unnecessarily.
89
+ Multiple authorized sources may support an article. A new task or changed plan
90
+ must still respect confirmed requirements and the work-start report boundary.
91
+
92
+ ## Storage and continuation
93
+
94
+ Drafts, capability declarations, plans, candidates, acceptance receipts and
95
+ transaction state remain in `.tmp`. Only formal knowledge, necessary source
96
+ material and long-term requirements belong in durable project content.
97
+ With intact temporary state the current work can resume or retry safely. After
98
+ clearing `.tmp` or cloning elsewhere, start new production from formal knowledge
99
+ and sources; do not reconstruct the old workflow. There is no historical protocol
100
+ migration or compatibility path.
101
+
102
+ Source authorization, real references, safe file reads and concurrent-write
103
+ protection still apply. Skill identity is not a production acceptance condition.
104
+
105
+ ## When maintaining a Skill
106
+
107
+ For an explicitly requested Skill change, use the
108
+ [code Skill authoring guide](./code-indexer-skill-authoring.md) or
109
+ [document Skill authoring guide](./markdown-indexer-skill-authoring.md).
110
+ These are authoring references, not additional reading required for routine
111
+ knowledge production.