@c4a/context 0.7.8 → 0.7.10-alpha.1

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 (84) hide show
  1. package/articleStructure.d.ts +254 -0
  2. package/docs/guides/agent-dialogue.md +6 -5
  3. package/docs/guides/agent-guide.md +11 -5
  4. package/docs/guides/code-indexer-skill-authoring.md +76 -178
  5. package/docs/guides/indexer-provider-and-customization.md +93 -398
  6. package/docs/guides/indexer-skill-creation.md +107 -97
  7. package/docs/guides/knowledge-updates.md +137 -18
  8. package/docs/guides/markdown-indexer-skill-authoring.md +57 -134
  9. package/docs/guides/package-outputs.md +213 -47
  10. package/docs/reference/indexer-provider-protocol.md +71 -102
  11. package/docs/reference/package-templates.md +39 -65
  12. package/docs/reference/project-api.md +53 -0
  13. package/docs/reference/template-variables.md +2 -3
  14. package/index.d.ts +11 -11
  15. package/index.js +5826 -8062
  16. package/indexerAgentStepProtocol.d.ts +0 -910
  17. package/indexerApprovedKnowledge.d.ts +98 -359
  18. package/indexerArticlePlan.d.ts +3 -26
  19. package/indexerArtifact.d.ts +201 -70
  20. package/indexerArtifactPolicy.d.ts +4 -22
  21. package/indexerArtifactResult.d.ts +240 -888
  22. package/indexerAuthoringFixture.d.ts +0 -13
  23. package/indexerBenchmark.d.ts +2 -2
  24. package/indexerCandidateCompile.d.ts +123 -167
  25. package/indexerCatalogFallback.d.ts +32 -374
  26. package/indexerCollectionMapping.d.ts +2 -2
  27. package/indexerContentLayers.d.ts +187 -41
  28. package/indexerContractOverlay.d.ts +30 -44
  29. package/indexerControlledInvocation.d.ts +6 -6
  30. package/indexerControlledProgram.d.ts +959 -3020
  31. package/indexerDependencyView.d.ts +96 -96
  32. package/indexerEffectiveArtifact.d.ts +381 -242
  33. package/indexerExampleDecision.d.ts +134 -134
  34. package/indexerExampleIdentity.d.ts +6 -6
  35. package/indexerExampleIdentityAudit.d.ts +6 -6
  36. package/indexerInventoryDisposition.d.ts +0 -39
  37. package/indexerLayerComposition.d.ts +1378 -852
  38. package/indexerLayoutChange.d.ts +24 -33
  39. package/indexerLayoutProposalSet.d.ts +143 -137
  40. package/indexerLayoutResolver.d.ts +116 -101
  41. package/indexerLayoutTransition.d.ts +6 -6
  42. package/indexerMainLifecycle.d.ts +1 -11
  43. package/indexerMainRunLedger.d.ts +0 -14
  44. package/indexerMainRunProtocol.d.ts +806 -2530
  45. package/indexerMainWorkset.d.ts +0 -1212
  46. package/indexerNavigationArtifactPlan.d.ts +2 -2
  47. package/indexerOverlayQuestionApplyProposal.d.ts +0 -4
  48. package/indexerParserCoordinate.d.ts +2 -2
  49. package/indexerParserExecutionPlan.d.ts +42 -42
  50. package/indexerPartitionPlan.d.ts +24 -354
  51. package/indexerPhysicalArtifactManifest.d.ts +12 -27
  52. package/indexerPostAuthorComposition.d.ts +2 -253
  53. package/indexerPostAuthorRunLedger.d.ts +860 -562
  54. package/indexerPrimaryProjection.d.ts +2 -2
  55. package/indexerPrimaryResultView.d.ts +0 -318
  56. package/indexerProfileContract.d.ts +200 -549
  57. package/indexerProgramExecutionAuthorization.d.ts +4 -4
  58. package/indexerProgramRunProtocol.d.ts +806 -2527
  59. package/indexerProjectProposal.d.ts +8 -8
  60. package/indexerProjectedArtifactFanOutAudit.d.ts +8 -8
  61. package/indexerProjectedArtifactPlan.d.ts +0 -9
  62. package/indexerProtocolHash.d.ts +2 -0
  63. package/indexerProvider.d.ts +76 -318
  64. package/indexerProviderComposition.d.ts +16 -42
  65. package/indexerQuestionAuthority.d.ts +2 -82
  66. package/indexerReaderTargetInventory.d.ts +6 -6
  67. package/indexerRegistry.d.ts +606 -0
  68. package/indexerRequirementLifecycle.d.ts +6 -6
  69. package/indexerResultReconciliation.d.ts +35 -149
  70. package/indexerSemanticInput.d.ts +10926 -5665
  71. package/indexerStructuredDeclaration.d.ts +24 -24
  72. package/indexerTemplateRendering.d.ts +239 -113
  73. package/{readingStructure.d.ts → knowledgeMap.d.ts} +21 -21
  74. package/package.json +1 -1
  75. package/packageSite.d.ts +25 -0
  76. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +13 -16
  77. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +9 -9
  78. package/indexerArtifactDependencies.d.ts +0 -693
  79. package/indexerCompositionFactDependencies.d.ts +0 -16
  80. package/indexerExampleFactDependencies.d.ts +0 -17
  81. package/indexerIncrementalImpact.d.ts +0 -221
  82. package/indexerKnowledgeDependency.d.ts +0 -46
  83. package/indexerSubjectCatalog.d.ts +0 -230
  84. package/indexerSubjectKeyAuthority.d.ts +0 -786
@@ -1,416 +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
 
13
- ## Selection flow
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.
14
14
 
15
- Follow `workflow.current` from `context status --format json` or `context run`.
16
- When the registry is missing, the Route names `src/indexers.yaml` in
17
- `configuration`: declare the confirmed requirements with `indexers: []`, then
18
- re-evaluate. The next Route supplies the Provider selection input and completion
19
- command. An unconfigured project does not begin Partition or require a fabricated
20
- primary owner. `run --managed --until blocked-or-complete` stops at the same
21
- configuration or semantic input boundary; it does not make those decisions.
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.
22
22
 
23
- 1. Form the complete requirements using the initial registry contract below.
24
- Reuse the user's stated meaning and research the selected material. Ask about
25
- consequential missing purpose or scope even in managed mode; delegation
26
- covers execution and eligible reviews, not unanswered intent. A Provider,
27
- registry entry or Result may strengthen it but cannot remove targets,
28
- questions, evidence obligations or required owner cells.
29
- 2. Select applicable Providers from the Host-visible Skills and the CLI-bundled
30
- catalog already in the current Action input. No separate catalog command,
31
- installed-Skill inventory, discovery report, or discovery-only confirmation
32
- is required. Use the supplied exact identity and cli-bundled distribution
33
- for shipped Providers, even when their Skills are also visible to the Host.
34
- For a relevant external Skill, read only its exact Host-exposed frontmatter
35
- and sibling `context-indexer.yaml` needed for selection. Do not guess versions
36
- or scan `.claude`, `.codex`, `.agents` or arbitrary user directories. Different
37
- versions remain distinct; discovery order is not selection precedence.
38
- 3. Submit the semantic `indexers` and any relevant non-CLI `host_visible_skills`
39
- through the current Route's `context action complete-current` command. The
40
- latter may be empty; it is not an inventory or an additional discovery step.
41
- 4. The CLI performs routing, validation, resolution and staging internally.
42
- Shipped Providers load directly from this CLI release; only external
43
- Providers may require the returned Host resolution Action. Follow the
44
- current Route if a distribution is missing, a version conflicts, or program
45
- execution needs authorization. Do not call the low-level commands below as
46
- a second production workflow.
47
- 5. The CLI atomically applies the validated registry and any declared
48
- customization. A successful static report alone is not write or execution
49
- authority. Resume from the returned current Route.
23
+ ## Confirmed requirements
50
24
 
51
- Every required requirement/domain/source/module cell has exactly one primary
52
- owner. Read scope may overlap for supporting profiles, extensions and
53
- enrichers. Array order is never precedence. Each Provider layer retains its own
54
- exact version, integrity, portable distribution, config and resource
55
- fingerprints.
56
- For CLI-bundled instruction Providers, these fields record the original
57
- selection; they are not a requirement to reinstall old bytes when resuming.
58
- The current CLI supplies its installed Provider's guidance automatically.
59
-
60
- ## Resuming after a tool update
61
-
62
- Continue with the current Route and its supplied source material. Agents do not
63
- compare Provider, Fact, signature or inventory fingerprints and do not rewrite
64
- them in an old request. Context rebuilds the internal result from the submitted
65
- page content and references.
66
-
67
- An added parser field or a more complete line range in the same unchanged file
68
- does not invalidate Author work. Continuation compares selected sources and
69
- subjects rather than serialized Fact payloads; accepted work retains its
70
- original request/result pair. New results retain the source references used for
71
- later updates. Repeated Fact references or reader-question answers are deduplicated;
72
- multiple sections may answer the same question. A question ID only identifies a
73
- reader question to cover, not an additional user approval.
74
-
75
- Missing references, a changed source file, a different page owner/subject or a
76
- concurrent write remain meaningful conflicts. Requirements, membership and result
77
- contracts still determine whether a task can be reused. This does not introduce a
78
- new Agent protocol, hash-entry step or persistent audit file.
79
-
80
- ## Provider selection result
81
-
82
- Use the current Action's output schema, which defines the accepted Indexer
83
- entry fields. This is a `complete-current` input, not a replacement registry
84
- and not the requirements-only bootstrap schema.
85
-
86
- For one component-library requirement, the following template selects one
87
- primary Code Provider. Replace the quoted placeholders using the **current
88
- Action input**, not values from a different CLI installation:
89
-
90
- ```yaml
91
- stage: provider-selection
92
- host_visible_skills: []
93
- indexers:
94
- - id: component-guide
95
- operations: [main-index]
96
- requirement_bindings:
97
- - requirement_ref: "<requirement.id>"
98
- coverage_domains: ["<required-domain>"]
99
- owned_scope:
100
- ref: "requirement:<requirement.id>#target_scope"
101
- role: primary
102
- read_scope:
103
- refs:
104
- - "requirement:<requirement.id>#target_scope"
105
- - "requirement:<requirement.id>#evidence_source_scope"
106
- profile:
107
- primary:
108
- id: component-library
109
- provider: community
110
- providers:
111
- - id: community
112
- role: primary
113
- skill: "<catalog.skill>"
114
- version: "<catalog.version>"
115
- integrity: "<catalog.integrity>"
116
- distribution:
117
- kind: cli-bundled
118
- locator: "<catalog.distribution.locator>"
119
- ```
120
-
121
- - Choose `component-library` only if it matches the reader task and appears in
122
- the selected catalog entry's `capabilities.profiles`. For captured documents,
123
- notes or conversation summaries, select a profile from the corresponding
124
- compatible Provider. Copy the actual catalog identity.
125
- - Bind each selected requirement and all required coverage domains it owns;
126
- the single-domain template is not permission to drop other required domains.
127
- `owned_scope` names the target being described. `read_scope` may also include
128
- supporting evidence, which does not become another owned target.
129
- - `profile.primary.provider`, each additional profile's `provider`, and each
130
- composer's `provider` reference a layer's `providers[].id`, not a Skill path.
131
- Supporting or extension profiles use `profile.additional` with `kind`;
132
- composers use `profile.composers`. Select only combinations supported by the
133
- manifests; do not add empty customization or speculative config.
134
- - The current catalog includes domains, target kinds, profile IDs, operations,
135
- composers and extension relationships. If more detail is needed, read the
136
- selected entry's exact `guidance.skill_path` and `guidance.manifest_path`.
137
- These paths and capabilities are reading aids, not fields to copy into the
138
- persistent registry. No separate discovery command or cache scan is needed.
139
- - JSON Schema describes input shapes and accepted values. The CLI additionally
140
- checks coverage ownership, scope relationships and Provider composition when
141
- submitting. It atomically applies the selection; do not edit `indexers`
142
- manually to bypass a rejected result.
143
-
144
- ## Initial registry: `src/indexers.yaml`
145
-
146
- The initial configuration Route provides the registered source boundary view.
147
- Read it when the source identities are not already available from the current
148
- source registration results. It is a metadata view, not another source capture
149
- or a request to scan the repository. Use only the user's agreed source scope.
150
-
151
- Read the `context.indexer.registry-bootstrap` schema at the exact path in the
152
- current Route's required resources. It ships with the CLI, so it does not
153
- require a workspace SDK reinstall. It describes this **configuration file**,
154
- not an Action completion payload. It
155
- covers the requirements-only state before Provider selection: `indexers` must
156
- be empty here. Later the Provider selection Route fills that array.
157
-
158
- Start with this complete YAML example. Replace the example source reference,
159
- 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:
160
29
 
161
30
  ```yaml
162
31
  protocol: context.indexer.registry/v1
163
32
  requirements:
164
- - id: component-guide
165
- purpose: Help application developers integrate components and look up their public API.
166
- 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]
167
36
  coverage_domains:
168
- component-usage: required
169
- public-api: required
37
+ architecture: required
170
38
  target_scope:
171
39
  targets:
172
- - source_ref: repo:20260901/component-library
40
+ - source_ref: repo:sample
173
41
  evidence_source_scope:
174
42
  targets:
175
- - source_ref: repo:20260901/component-library
43
+ - source_ref: repo:sample
176
44
  indexers: []
177
45
  ```
178
46
 
179
- | Field | What to write |
180
- | --- | --- |
181
- | `protocol` | Exactly `context.indexer.registry/v1` for the file. |
182
- | `requirements` | One or more knowledge goals, grouped by reader need; not one entry per file or symbol. |
183
- | `id` | A unique, readable identifier for this requirement. |
184
- | `purpose` | Optional short natural-language reader and task purpose; reuse explicit existing goals when absent. |
185
- | `reader_goals` | One or more readable goal identifiers, such as `integrate-components`. These are not Provider names. |
186
- | `coverage_domains` | A nonempty map of intended information categories to `required`, `optional` or `out-of-scope`. Provider selection must cover the required categories. |
187
- | `target_scope.targets` | Sources whose subjects the knowledge should describe. At least one target is required. |
188
- | `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. |
189
- | `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. |
190
- | `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. |
191
- | `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. |
192
- | `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. |
193
- | `indexers` | `[]` until the next Route selects Providers. Do not copy version or integrity values from an unrelated project. |
194
-
195
- Requirement, goal, domain and exclusion identifiers use lowercase letters,
196
- digits and `._/-`; the first character is a letter or digit, and slash-separated
197
- segments cannot be empty, `.` or `..`. Requirement ids and goal lists must not
198
- contain duplicates. Each scope lists a source once; put its selected modules in
199
- that target's `module_refs` rather than repeating the source.
200
-
201
- For document-only knowledge, use the selected captured `file:` or `lark:` source,
202
- or saved `note:` or `sessions:` source, in both scopes. Saved text must first be
203
- 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
204
- scope and include both code and FAQ in the evidence scope. If the FAQ also needs
205
- independent knowledge coverage, include it as a target in the appropriate
206
- requirement; do not silently treat all captured documents as background.
207
- Source references identify selected source boundaries, not filesystem paths, URLs,
208
- image ids, span references or content digests. A repo source already registered
209
- at a package subdirectory remains bounded to that subdirectory when
210
- `module_refs` is omitted.
211
-
212
- Three existing input shapes have different roles:
213
-
214
- - `src/indexers.yaml`: `protocol: context.indexer.registry/v1`, `requirements`,
215
- and `indexers`.
216
- - `IndexRequirementSet`: `protocol: context.indexer.requirement-set/v1` and
217
- `requirements` only. This is the SDK's requirement value, not the whole file.
218
- - Diagnostic `inspect-index-requirements --input`: an envelope with
219
- `protocol: context.indexer.requirement-inspection-input/v1`, `project_ref`
220
- (the workspace root) and `requirements`; optional `question_contracts` are
221
- only for real resolved contract questions. It does not accept the whole
222
- registry or a bare requirement set, and is not a mandatory bootstrap step.
223
-
224
- After editing the named configuration file, run `context status --format json`
225
- and follow its new current Route. The next step is Provider selection. Do not
226
- submit the YAML through `complete-current`, fabricate a lifecycle Result,
227
- restart the workspace or recapture existing sources.
228
-
229
- ## Six-level customization ladder
230
-
231
- Use the first level that closes the CLI-proven capability gap. Do not start at
232
- a more powerful level because it is convenient.
233
-
234
- | Level | Change | Entry evidence | Exit condition |
235
- | --- | --- | --- | --- |
236
- | 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 |
237
- | 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 |
238
- | 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 |
239
- | 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 |
240
- | 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 |
241
- | 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 |
242
-
243
- Levels 3–6 are allowed only after the Route returns
244
- `indexer-customization-required` with a current `capability_gap_proof`. Copy the
245
- proof into the draft unchanged. A draft cannot weaken requirements, widen
246
- source scope, copy a parser, add an evaluator, or claim that it has been
247
- applied. If no safe level closes the gap, stop instead of emitting a
248
- conforming-looking file.
249
-
250
- ## Upgrade and conflict handling
251
-
252
- For a CLI-bundled instruction Provider, resume with the installed Skill and
253
- portable distribution. A version or content change alone does not require
254
- Provider selection, registry edits, source capture or a restart. The CLI
255
- refreshes the current batch's instruction resources and Route revision;
256
- the Agent follows the returned Route without comparing fingerprints.
257
-
258
- Compatible tasks keep their original request/result records. Instruction or
259
- template edits do not, by themselves, discard accepted groups or authored
260
- content. Changes to sources, requirements, executable programs, configuration,
261
- result contracts or semantic extension inputs remain work invalidation reasons;
262
- old results must not be relabeled as outputs of a different task.
263
-
264
- Executable/external Providers continue using their resolved staged programs.
265
- Updating instruction delivery does not replace executable code or grant new
266
- execution permissions. Local customization files remain user-owned:
267
-
268
- - An unchanged upstream resource keeps the local override current.
269
- - A changed instruction resource outside the override refreshes guidance for
270
- pending work, without automatically regenerating completed knowledge.
271
- - A changed resource under an instruction/template/program override returns
272
- `indexer-customization-upstream-changed`; rebase or remove the override.
273
- - Missing, undeclared, escaping or contract-conflicting local resources return
274
- `indexer-customization-invalid`.
275
- - A missing CLI-bundled Provider or selected profile/operation/composer returns
276
- the existing Provider selection Action, with its schema and next command.
277
- Captured sources and completed knowledge are retained. External distributions
278
- that cannot be resolved still require the existing resolution/selection flow.
279
- - Multiple primary owners return a conflict for explicit resolution. Do not
280
- use discovery order or a preferred Provider name as a tie-breaker.
281
-
282
- The optional `@context-indexer-origin <skill>@<version>` comment records where
283
- a local customization began. It grants no trust and never bypasses revalidation.
284
-
285
- ## Outcome handling
286
-
287
- These outcomes all point back to this guide:
288
-
289
- | Outcome | Required next action |
290
- | --- | --- |
291
- | `indexer-provider-required` | Discover visible entry Skills, route a path-free proposal, and keep the requirement set unchanged. |
292
- | `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. |
293
- | `indexer-customization-required` | Follow the six-level ladder using only the returned current gap proof. |
294
- | `indexer-customization-invalid` | Remove undeclared/escaping/conflicting files, then rebuild and restage the proposal. |
295
- | `indexer-customization-upstream-changed` | Reconcile the upstream change with every affected override and rerun final validation. |
296
-
297
- ## Debugging commands
298
-
299
- These are diagnostic/manual primitives, not a checklist for normal selection.
300
- Use them only for an explicit diagnostic or a returned recovery. `--help`
301
- describes command options, not necessarily the payload fields. Use the current
302
- Route's schema and the initial registry contract above; prefer Route-returned commands:
303
-
304
- ```bash
305
- context indexer catalog --format json
306
- context indexer inspect-index-requirements --help
307
- context indexer compare-index-requirements --help
308
- context indexer route-indexer-provider-selection --help
309
- context indexer validate-indexer-selection-proposal --help
310
- context indexer resolve-indexer-providers --help
311
- context indexer stage-indexer-provider-bundle --help
312
- context indexer validate-indexer-customization --help
313
- context indexer prepare-indexer-customization-project --help
314
- context indexer stage-indexer-project-proposal --help
315
- context indexer apply-indexer-project --help
316
- context indexer observe-indexer-project --help
317
- ```
318
-
319
- Keep full runtime reports under `.tmp/context-runtime/`. Do not persist Bundle
320
- bytes, resolution receipts, selection discovery, run ledgers or audit reports
321
- in `src/`, `knowledge/` or `dist/`.
322
-
323
- ## Completion check
324
-
325
- Selection/customization is complete only when all of these are true:
326
-
327
- - the confirmed requirement digest is unchanged;
328
- - every required owner cell has exactly one primary owner;
329
- - every Provider is exact-versioned, integrity-checked and staged from a
330
- portable distribution;
331
- - profile variants, SubjectKey authority, config and resources pass final
332
- validation;
333
- - each local change is the smallest proven ladder level and has no unrelated
334
- copied resources;
335
- - program and dependency receipts exist when required and do not claim a
336
- sandbox the Host does not provide;
337
- - the transactional apply observation matches every target digest;
338
- - a final static/final selection validation passes after apply.
339
-
340
- For the complete manifest and execution surface, see
341
- [Indexer Provider protocol](../reference/indexer-provider-protocol.md).
342
-
343
- ## Purpose, page selection, and delivery
344
-
345
- `purpose` is an optional short description of the intended reader and task.
346
- Existing `reader_goals` remain valid when it is absent. Context passes this
347
- requirement through Partition, Author, and Review; it does not classify free
348
- text against a fixed vocabulary.
349
-
350
- After representative reading and necessary scope discussion, substantial new work
351
- can preserve the decisions in `.tmp/work-start-report.md` before Partition.
352
- The current workflow supplies `procedure.work-start-report` and
353
- `template.work-start-report`: a readable report with its existing requirement
354
- reference, use scenarios, scope choices, proposed classifications, first delivery
355
- and actual execution settings. Lightweight edits keep a short summary. The report
356
- is scratch context, not a published Artifact, a new approval or a condition for
357
- advancing the workflow. On its first presentation, invite the user to read and
358
- correct it and pause for that response, including in managed mode, unless they
359
- explicitly waived this reading opportunity. Reuse the response and report when
360
- continuing the same task; do not add a per-batch pause or report-status field.
361
-
362
- Partition may select `artifact_intent` and `template_id` from the current
363
- Provider catalog, along with `reader_task`, `outline`, `priority`, and
364
- `delivery_boundary`. These choices are saved in the existing page plan and
365
- reused by Author retries. Program templates declare `kind: page-program` in the
366
- Provider's template resources. Only the selected program is included in the
367
- Author View; procedure templates remain shared instructions. Workspace template
368
- overrides retain priority over the bundled default.
369
-
370
- Selected Code page programs append a deterministic public-contract table to the
371
- same Candidate as its semantic explanation. Declarations provide field types,
372
- requiredness, explicit defaults, signatures, and supported registration facts.
373
- Missing declarations remain explicit; reference tables do not substitute for
374
- source-backed examples, behavior, or change guidance.
375
-
376
- The first readable delivery normally contains one to three pages. Subsequent
377
- batches contain 30–50 pages, or a smaller final tail. Context retains accepted
378
- Results across Review, close, and build, then continues the remaining pages.
379
- `context run --deliver --format json` requests an earlier checkpoint. It keeps
380
- the current approval rules. Status reports page counts and built preview paths;
381
- Author task counts are reported separately.
382
-
383
-
384
- ## Source-specific Providers and Host switches
385
-
386
- The default distribution includes Code, Markdown, Note and Sessions Providers.
387
- `context-note-indexer` interprets saved records/excerpts/observations;
388
- `context-sessions-indexer` interprets bounded conversation summaries, with or
389
- without code associations. Their shared markdown domain reuses document reading
390
- and profiles; it does not force all sources through Markdown's semantic policy.
391
- See [note preparation](note.md) and [sessions preparation](sessions.md).
392
-
393
- The host owns installation and enabled/disabled switches. Business skills may be
394
- installed by any supported host channel. Discover relevant currently visible
395
- `context-…-indexer…` skills and read the real sibling manifest; the prefix alone
396
- is not compatibility proof. Declare the selected business Provider through the
397
- existing host_visible_skills and indexers result. It can replace a default without
398
- enabling that default. CLI validates/resolves what was declared; it does not scan
399
- host caches or maintain a second business-skill enable registry. Respect explicit
400
- user exclusions even when the bundled catalog contains the default.
401
-
402
- Choose the page owner from reader need. A note may improve an existing guide,
403
- answer a FAQ or justify a new reference topic. A session without code may justify
404
- a decision or process guide. Neither saving nor source type requires a new page.
405
- For a Code/Markdown page retain its primary and include the actual supporting
406
- source in evidence/read scope. When specialized source interpretation is needed,
407
- select a Note/Sessions extension layer and the matching namespaced profile
408
- (`note/component-library` or `sessions/component-library`, for example) with
409
- `kind: extension`. The manifest declares each supported base. Supporting profiles
410
- with `kind: supporting` must come from the same primary layer. One primary writes
411
- the final page; extension guidance does not create another production target.
412
-
413
- Optional sessions `changes` records known commit/MR associations in the source
414
- file. Existing structure.yaml source/section links connect knowledge to it.
415
- Do not add per-page commit, session or Provider frontmatter. A reference is not
416
- 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.