@c4a/context 0.7.1 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +65 -170
  2. package/README.zh-CN.md +52 -129
  3. package/docs/README.md +9 -10
  4. package/docs/README.zh-CN.md +6 -7
  5. package/docs/getting-started.md +73 -428
  6. package/docs/guides/agent-guide.md +94 -518
  7. package/docs/guides/code-indexer-skill-authoring.md +24 -13
  8. package/docs/guides/markdown-indexer-skill-authoring.md +14 -14
  9. package/docs/reference/code-extractors.md +29 -121
  10. package/docs/reference/indexer-provider-protocol.md +43 -110
  11. package/docs/reference/package-templates.md +2 -3
  12. package/docs/reference/project-api.md +52 -986
  13. package/index.d.ts +10 -8
  14. package/index.js +4739 -7103
  15. package/indexerAgentStepProtocol.d.ts +1366 -7649
  16. package/indexerArtifact.d.ts +225 -0
  17. package/indexerArtifactDependencies.d.ts +41 -39
  18. package/indexerArtifactResult.d.ts +219 -252
  19. package/indexerAuthorizedWorksetView.d.ts +368 -0
  20. package/indexerBaseQuestionAmendment.d.ts +484 -280
  21. package/indexerBenchmark.d.ts +16 -16
  22. package/indexerCandidateCompile.d.ts +66 -60
  23. package/indexerCapabilityGroupEvidence.d.ts +6 -6
  24. package/indexerCatalogFallback.d.ts +122 -128
  25. package/indexerCollectionMapping.d.ts +13 -13
  26. package/indexerContentLayers.d.ts +8 -8
  27. package/indexerContractOverlay.d.ts +10 -10
  28. package/indexerControlledInvocation.d.ts +12 -12
  29. package/indexerControlledProgram.d.ts +2467 -2797
  30. package/indexerCoreExports.d.ts +6 -6
  31. package/indexerCustomizationDraft.d.ts +3315 -2091
  32. package/indexerCustomizationLadder.d.ts +2 -2
  33. package/indexerDependencyView.d.ts +108 -108
  34. package/indexerEffectiveArtifact.d.ts +1134 -0
  35. package/indexerEvidenceAdapterAuthorityMerge.d.ts +48 -0
  36. package/indexerEvidenceAdapterResult.d.ts +52 -52
  37. package/indexerExampleDecision.d.ts +128 -128
  38. package/indexerExampleIdentity.d.ts +6 -6
  39. package/indexerGeneratedAuthoringAudit.d.ts +18 -18
  40. package/indexerIncrementalImpact.d.ts +16 -16
  41. package/indexerInspectorWorksetProjection.d.ts +6 -0
  42. package/indexerInventoryDisposition.d.ts +70 -70
  43. package/indexerLayerComposition.d.ts +2139 -373
  44. package/indexerLayoutChange.d.ts +10 -10
  45. package/indexerLayoutProposalSet.d.ts +71 -66
  46. package/indexerLayoutResolver.d.ts +53 -48
  47. package/indexerLayoutTransition.d.ts +0 -50
  48. package/indexerLifecycle.d.ts +0 -13
  49. package/indexerMainLifecycle.d.ts +10 -0
  50. package/indexerMainRunLedger.d.ts +138 -11
  51. package/indexerMainRunProtocol.d.ts +1406 -785
  52. package/indexerMainWorkset.d.ts +460 -206
  53. package/indexerMaterialGapLedger.d.ts +13 -2904
  54. package/indexerOverlayQuestionAmendment.d.ts +491 -287
  55. package/indexerOverlayQuestionApplyProposal.d.ts +1022 -614
  56. package/indexerParserCapabilityCatalog.d.ts +136 -0
  57. package/indexerParserCoordinate.d.ts +16 -16
  58. package/indexerParserDependencyIntent.d.ts +22 -0
  59. package/indexerParserExecutionPlan.d.ts +388 -0
  60. package/indexerParserFactView.d.ts +42 -22
  61. package/indexerPartitionConvergence.d.ts +0 -3
  62. package/indexerPartitionInventory.d.ts +2 -0
  63. package/indexerPartitionPlan.d.ts +101 -99
  64. package/indexerPhysicalArtifactManifest.d.ts +8 -8
  65. package/indexerPostAuthorComposition.d.ts +116 -1156
  66. package/indexerPostAuthorRunLedger.d.ts +1434 -280
  67. package/indexerPrimaryProjection.d.ts +10 -10
  68. package/indexerPrimaryResultView.d.ts +435 -0
  69. package/indexerProfileContract.d.ts +181 -181
  70. package/indexerProgramExecutionAuthorization.d.ts +12 -12
  71. package/indexerProgramRunProtocol.d.ts +2141 -2749
  72. package/indexerProjectProposal.d.ts +496 -292
  73. package/indexerProjectedArtifactFanOutAudit.d.ts +0 -3
  74. package/indexerProtocolCommon.d.ts +4 -1
  75. package/indexerProvider.d.ts +134 -218
  76. package/indexerProviderComposition.d.ts +53 -53
  77. package/indexerProviderResolution.d.ts +12 -12
  78. package/indexerProviderResolutionAction.d.ts +14 -14
  79. package/indexerProviderRouting.d.ts +923 -515
  80. package/indexerProviderSelectionProposal.d.ts +893 -485
  81. package/indexerQuestionAuthority.d.ts +46 -47
  82. package/indexerReaderTargetInventory.d.ts +8 -8
  83. package/indexerRegistry.d.ts +765 -357
  84. package/indexerRequirementConfirmation.d.ts +98 -98
  85. package/indexerRequirementLifecycle.d.ts +224 -224
  86. package/indexerResultReconciliation.d.ts +204 -5919
  87. package/indexerResultReconciliationRun.d.ts +0 -1
  88. package/indexerRunEnvelope.d.ts +20 -20
  89. package/indexerSemanticInput.d.ts +3678 -0
  90. package/indexerStructuredDeclaration.d.ts +57 -53
  91. package/indexerSubjectCatalog.d.ts +14 -14
  92. package/indexerSubjectIdentity.d.ts +2 -2
  93. package/indexerSubjectKeyAuthority.d.ts +31 -30
  94. package/indexerTemplateRendering.d.ts +64 -64
  95. package/indexerToolSnapshot.d.ts +8 -8
  96. package/package.json +1 -1
  97. package/phases.d.ts +3 -183
  98. package/codeIndexPlan.d.ts +0 -158
  99. package/indexerAuditFacts.d.ts +0 -66
  100. package/indexerAuditOverrideReadiness.d.ts +0 -27
  101. package/indexerAuditProtocol.d.ts +0 -238
  102. package/indexerAuditRevision.d.ts +0 -726
  103. package/indexerAuditRevisionActions.d.ts +0 -236
  104. package/indexerMaterialAnswer.d.ts +0 -738
  105. package/indexerMaterialAnswerActualization.d.ts +0 -91
  106. package/indexerMaterialAnswerExecutionPlan.d.ts +0 -2887
  107. package/indexerMaterialAnswerFlow.d.ts +0 -63
  108. package/indexerMaterialAnswerLayout.d.ts +0 -76
  109. package/indexerMaterialAnswerReview.d.ts +0 -217
  110. package/indexerMaterialAnswerReviewRoute.d.ts +0 -6145
  111. package/indexerMaterialAnswerRunLedger.d.ts +0 -918
  112. package/indexerMaterialAnswerRunProtocol.d.ts +0 -1253
  113. package/indexerMaterialQuestionExclusion.d.ts +0 -129
  114. package/indexerMaterialQuestionWorkset.d.ts +0 -508
  115. package/indexerPlannedMaterialAnswer.d.ts +0 -116
  116. package/indexerProfileMetricAudit.d.ts +0 -218
  117. package/indexerWorksetRead.d.ts +0 -287
@@ -34,18 +34,22 @@ rules, metric operators and thresholds.
34
34
  4. **Activation and profiles.** Declare strong/supporting/negative signals.
35
35
  Dependency names are candidates, not runtime proof. One module may combine
36
36
  one primary profile with supporting/extensions and selected composers.
37
- 5. **Sources and Artifacts.** Declare source roles and logical-unit intent;
37
+ 5. **Sources and Artifacts.** Write for a reader outside the indexed module:
38
+ make responsibility, stable interfaces/entrypoints, handoffs and the core
39
+ state, failure, operation and source-of-truth facts needed for correct use
40
+ and attribution discoverable. Declare source roles and logical-unit intent;
38
41
  select only CLI-registered Artifact kinds/policy variants. Keep logical unit
39
- identity separate from physical Artifact count.
42
+ identity separate from physical Artifact count, and measure useful coverage
43
+ by answered profile questions rather than symbol or path counts.
40
44
  6. **Inventory protocols.** Close every input member with an explicit
41
45
  disposition. Use stable aggregation, full-path example identity and
42
46
  structured chain decisions; do not substitute page prose for inventory.
43
- 7. **Metrics.** Reference registered metric ids and revision guidance. The CLI
44
- alone owns recommended ranges, `inflation-sensitive` 150% enforcement and
45
- mechanical audit results; a Provider cannot return a pass or threshold.
46
- 8. **Revision boundary.** Use metric-specific revisions for at most the Route-
47
- supplied attempts. After three failed attempts, report the complete issue
48
- set for the human Gate. Forced approval cannot bypass base integrity rules.
47
+ 7. **Metrics.** Reference registered metric ids as reader-quality guidance.
48
+ The CLI may report advisory observations, but a Provider cannot return a
49
+ pass, threshold, retry count, or risk-acceptance decision.
50
+ 8. **Revision boundary.** Hard contract or source failures block at their
51
+ owner. Reader-quality feedback reopens the same Author or Composer through
52
+ `context revise`; it does not create a metric retry ledger or risk Gate.
49
53
  9. **Reader questions.** Declare reusable question templates with stable refs,
50
54
  target domains and allowed evidence contracts. Do not make a question id
51
55
  globally unique to one SubjectKey group.
@@ -68,11 +72,13 @@ rules, metric operators and thresholds.
68
72
  15. **Marketplace layout.** Archives keep one top-level Skill directory with
69
73
  `SKILL.md`, the manifest and referenced runtime resources. Exclude tests,
70
74
  caches, credentials, local paths and Host-specific temporary manifests.
71
- 16. **Material handoff.** Return structured material questions when required
72
- evidence is missing. Bind owner cell, question contract, Subject target and
73
- intended landing. Never render gaps as empty pages or speculative prose;
74
- Context owns the retained ledger, checkpoints, reconciliation and any
75
- Markdown answer run.
75
+ 16. **Material gaps.** Return a canonical question disposition in the same
76
+ main Result when required evidence is missing. Never render a gap as an
77
+ empty page or speculative prose. Registered Markdown or tool material may
78
+ enrich the same main indexing batch before Candidate generation; do not
79
+ create a separate answer operation, Candidate, checkpoint or Review. The
80
+ CLI projects allowed enrichment material into that same Authorized
81
+ Workset View; Providers must not reopen registered sources themselves.
76
82
  17. **Backend profiles.** Test neutral RPC/HTTP, Gateway, Event/function,
77
83
  Cron/worker, sync/reconciliation, stateful service/storage and library
78
84
  shapes. Local facts remain baseline when optional remote metadata is absent.
@@ -115,6 +121,11 @@ Markdown Indexers must reuse the same Node when the SubjectKey is equal. An
115
121
  enricher uses the supplied TargetResolutionView (`resolved`, `absent` or
116
122
  `ambiguous`) and never guesses identity from a title or path resemblance.
117
123
 
124
+ Every Section uses the exact `document_kind`, `reader_goal` and
125
+ `artifact_kind` tuple from the current profile's unique layout mapping. The
126
+ Provider never returns a collection name; Context resolves the collection from
127
+ that tuple and rejects missing or ambiguous mappings.
128
+
118
129
  ## Publication gate
119
130
 
120
131
  Do not publish until the exact packed artifact passes manifest/schema
@@ -62,6 +62,11 @@ alphabetic batches. Do not create one page per heading/member or inflate page
62
62
  count to satisfy a metric. The CLI owns Artifact-policy eligibility, physical
63
63
  fan-out audit, layout actualization and the final Candidate compile.
64
64
 
65
+ The first actual Section of each reader Artifact begins with one concise,
66
+ source-backed level-one heading. Context uses that heading as the outline and
67
+ Candidate Review display title. It never participates in SubjectKey derivation
68
+ or ownership, and later Sections in the same Artifact do not repeat it.
69
+
65
70
  Each Section carries exact positive and negative dependency refs. Incremental
66
71
  impact is Section/Artifact-local: a source membership, question denominator,
67
72
  candidate pool, evidence span or run-envelope change invalidates only the
@@ -77,24 +82,19 @@ hard metrics. Deterministic blocks render only registered facts; semantic prose
77
82
  must cite consumed evidence. Placeholders, speculation, fabricated transitions
78
83
  and “content unavailable” pages are invalid even when the structure looks rich.
79
84
 
80
- ## Material questions and answers
85
+ ## Missing material
81
86
 
82
87
  When current material cannot answer a required canonical question, return the
83
88
  exact material-question disposition for the supplied owner cell, question
84
89
  contract and Subject target. Do not invent a new question contract or landing.
85
- Context stores the retained `material_gap_ledger`, derives the
86
- MaterialQuestionWorkset and schedules a separate `material-answer` operation.
87
-
88
- A material-answer Result contains only the question revision and source/span/
89
- content-digest claims allowed by the workset. It does not return reader prose,
90
- future Artifact/Section identity or self-authored EvidenceItem refs. Context
91
- canonicalizes evidence, reviews the answer binding, derives the planned answer
92
- and actualizes it into an approved landing. Stale source, Provider, question,
93
- binding or landing returns the ledger item to unresolved atomically.
90
+ Context reports the unresolved set in current reconciliation state; it does not
91
+ create a second checkpoint ledger or published gap artifact.
94
92
 
95
- The ledger, answer body, answer provenance and revision scratch pages do not
96
- enter reader Markdown or `dist`. A blocking gap closes only through current
97
- evidence or an explicit non-delegable requirement change.
93
+ Capture the missing Markdown or other source normally, then rerun `main-index`.
94
+ The new Result updates the same knowledge Candidate and enters the same final
95
+ content Review. There is no answer-only operation or evidence-specific Review.
96
+ A blocking gap closes only through current source or an explicit non-delegable
97
+ requirement change.
98
98
 
99
99
  ## Markdown author fixture checklist
100
100
 
@@ -109,7 +109,7 @@ Release fixtures should cover:
109
109
  move in both directions;
110
110
  - protected values, links, images/assets and source-span fidelity;
111
111
  - editorial positives and placeholder/speculation/unsupported negatives;
112
- - material-answer approval, stale/rebind/deletion recovery and no-output-leak;
112
+ - material-gap runtime recovery, main-index retry and no-output-leak;
113
113
  - Section-local incremental invalidation, new membership/denominator/candidate
114
114
  pool changes and unaffected Section reuse.
115
115
 
@@ -1,131 +1,39 @@
1
- # Code Extractor Selection
1
+ # Code Parser Selection
2
2
 
3
- Use this manual only when the current code-extraction Route asks the Agent to
4
- choose or declare an extractor. The CLI reports repository facts; the Agent
5
- chooses how those facts become source-backed code knowledge.
3
+ Code parsing is an Indexer Provider implementation detail. A knowledge
4
+ workspace selects the Provider and profile in `src/indexers.yaml`; it does not
5
+ declare a separate extraction phase in `src/index.ts`.
6
6
 
7
- ## Inspect Before Declaring
7
+ ## Selection order
8
8
 
9
- Run the single batch inspection command returned by the extraction-scope Gate.
10
- The result identifies every confirmed module, its recognized `manifests`,
11
- README locations, entry candidates, protocol locators, and lifecycle markers.
12
- Treat these as deterministic technology signals, not as product semantics:
9
+ 1. Identify the target boundary and the knowledge questions.
10
+ 2. Let the selected Provider inspect language, manifests, entries, routes, and
11
+ contracts.
12
+ 3. Use the smallest parser set that covers those questions.
13
+ 4. Keep deterministic parser output as Provider facts; let the Provider author
14
+ reader-oriented knowledge pages from those facts and readable sources.
13
15
 
14
- | Signal | Technology candidate |
15
- |---|---|
16
- | `package.json` | TypeScript, TSX, JavaScript, or JSX |
17
- | `go.mod` | Go |
18
- | `Cargo.toml` | Rust |
19
- | `pyproject.toml` or `setup.py` | Python |
20
- | `pom.xml` or `build.gradle` | Java or JVM |
21
- | multiple manifests | a mixed module that may need more than one extractor |
22
-
23
- Do not select `extractTs()` merely because a repository contains some
24
- TypeScript. Decide against the exact confirmed module and include boundary. A
25
- mixed module may compose multiple structural passes; parser selection is not an
26
- exclusive repository-wide switch.
27
-
28
- ## Selection Order
29
-
30
- Use the narrowest reusable capability that covers the confirmed source:
31
-
32
- 1. Use a Context-owned phase when its contract matches the source.
33
- 2. Otherwise use a reusable structural package inside `extractCustom()`.
34
- 3. If no reusable package covers the syntax or repository protocol, implement a
35
- project-owned adapter and keep it in the Context workspace.
36
-
37
- Current reusable capabilities are:
38
-
39
- | Source fact | Preferred capability | Lifecycle integration |
40
- |---|---|---|
41
- | TypeScript/JavaScript package or TSX/JSX file scope | `extractTs()` | Context-owned phase |
42
- | Go declarations, imports, calls, and common HTTP routes | `@c4a/extract-go` | call from `extractCustom()` |
43
- | Rush workspace packages, tags, dependencies, entries, and owners | `@c4a/extract-rush` | call from `extractCustom()`; may complement a language extractor |
44
- | React Router route declarations | `extractReactRouterRoutes()` from `@c4a/extract-ts` | call from `extractCustom()`; complements ECMAScript symbols |
45
- | Rust, Python, Java/JVM, or an unsupported framework/protocol | no assumed built-in parser | project-owned `extractCustom()` adapter |
46
-
47
- The custom extraction preview verifies this selection mechanically. Context
48
- detects applicable community capabilities from source manifests and stable path
49
- signals, then checks that candidate evidence covers every required entry,
50
- route, implementation boundary, workspace, or protocol probe. One aggregated
51
- module page is valid when it closes that structural coverage. A callback that
52
- only hashes a few filenames or renders configured prose does not satisfy the
53
- probe, even when its Markdown count is small.
54
-
55
- The probe does not assign business meaning and does not require one page per
56
- fact. The project adapter still owns grouping, titles, explanations, and
57
- cross-module semantics. If the source uses an unsupported language or protocol,
58
- report a capability gap instead of claiming that a known probe was consumed.
16
+ ## Community parser packages
59
17
 
60
- An optional package does not create a new CLI phase. Add it as an explicit
61
- workspace dependency, then map its structural facts to candidates in the
62
- project callback. Do not add a parser package when its documented coverage does
63
- not match the inspected source.
64
-
65
- ## Read The Contract Before Extending
66
-
67
- Before editing `src/index.ts`, read the Route-selected Context lifecycle and
68
- extractor resources completely. They are the installed contract for
69
- Context-owned phases such as `extractTs()`; do not require a separate
70
- workspace copy of an implementation package and do not infer APIs from bundled
71
- JavaScript.
72
-
73
- Only a capability imported directly by a project-owned `extractCustom()`
74
- adapter requires its package README. Use this matrix to decide whether that
75
- optional capability is relevant, add only that dependency, then read the
76
- README from the resolved installed package before implementing the callback.
77
- Never assume that a transitive or dev-only package is present at a hard-coded
78
- `node_modules` path.
79
-
80
- A project-owned adapter may use an existing parser, compiler API, or command
81
- whose output is deterministic. It must return source-backed candidates through
82
- `extractCustom()`; it must not write lifecycle, knowledge, or Review files.
83
- Framework-specific classification and rendering remain in the project. The CLI
84
- and structural parser must not infer product meaning.
85
-
86
- ## Decision To Report
87
-
88
- Before the first extraction preview, state briefly:
89
-
90
- - the inspected module and manifest signals;
91
- - the selected Context phase or structural package;
92
- - whether coverage is complete or which facts remain project-owned; and
93
- - why another available extractor is not needed.
94
-
95
- After preview, use `inspection.structuralProbes` and each index unit's
96
- `structuralCoverage` as the exact audit result. An uncovered probe is a
97
- configuration problem, not a Review decision.
18
+ | Package | Useful structural facts |
19
+ |---|---|
20
+ | `@c4a/extract-ts` | TypeScript/JavaScript symbols, exports, imports, calls, and React Router routes |
21
+ | `@c4a/extract-go` | Go declarations, imports, calls, and common HTTP routes |
22
+ | `@c4a/extract-rush` | Rush projects, tags, entries, dependencies, and owner boundaries |
23
+ | `@c4a/extract` | Shared extraction result and adapter contracts |
98
24
 
99
- If no current capability can parse the source reliably, stop at configuration
100
- and report the missing generic capability. Do not silently emit an empty
101
- codeindex or reuse an unrelated parser.
25
+ These packages do not create Candidate rows, write `knowledge/`, or control
26
+ Review. The Code Indexer Provider owns those lifecycle responsibilities.
102
27
 
103
- ## Plan Before Parsing
28
+ ## Unsupported technologies
104
29
 
105
- The root workflow no longer owns module taxonomy or archetype templates. The
106
- Indexer registry selects the applicable Provider profile, and the resolved
107
- Provider Bundle supplies the semantic plan, evidence questions, composition
108
- rules, and output guidance. Context only validates the closed selection,
109
- digests, inventories, and resulting Candidate contracts. Do not reconstruct a
110
- parallel profile taxonomy in this reference or route around the Indexer
111
- lifecycle with an extractor-specific plan.
30
+ When the current Provider cannot parse a required boundary, first use its
31
+ supported customization ladder (`config`, instruction append, template
32
+ override, then program extension). Add a reusable parser to the Provider only
33
+ when the same technology boundary is useful across projects. Do not create a
34
+ project-local parallel knowledge pipeline.
112
35
 
113
- Extractor shape defines what can be emitted. `extractTs()` creates one page per
114
- selected symbol and permits one owning index unit per source. Use it for an
115
- intentional granular public reference. Use `extractCustom()` for module-level
116
- aggregation, registries, protocol indexes, cross-module flows, or multiple
117
- candidate owners over one source; each candidate declares its `module` and
118
- at least one evidence-scoped `section`; there is no page-level Markdown
119
- fallback. Each section's typed coverage and exact evidence is checked against
120
- the output profile during preview. Resolve repositories from
121
- the extractor context's `sources[].absolutePath`, never from a
122
- machine-specific checkout path. Cross-module flow output must also emit
123
- source-backed structured edges. Generated clients/models, mirrored sources, legacy
124
- implementations, and internal helpers should normally be excluded or recorded
125
- as provenance rather than expanded one symbol per page.
36
+ Parser coverage is complete when every required inventory item has an explicit
37
+ disposition and the resulting pages answer the declared reader questions. A
38
+ large symbol count by itself is not useful coverage.
126
39
 
127
- If a repository uses service manifests or protocol registrations that the
128
- community inspector cannot interpret, keep that interpretation in a generic
129
- project-owned `inspect` adapter attached to `extractCustom()`. Return findings
130
- and capability gaps through the public Context contract; do not add internal
131
- framework names or directory rules to the CLI.
@@ -184,8 +184,8 @@ Bundles, expanded variants, semantic split parts and the single CLI
184
184
  `catalog-fallback` parent do not. Counts up to 100 continue, 101 through 300
185
185
  continue with a warning, and counts above 300 return the non-Gate
186
186
  `indexer-plan-revision-required` outcome before any author workset runs. That
187
- partial outcome consumes neither a user Gate nor the three-attempt profile
188
- revision ledger.
187
+ partial outcome reopens the owning semantic step; it does not create a profile
188
+ revision ledger or an override route.
189
189
 
190
190
  Artifact content has three mechanically separate layers. `facts[]` contains
191
191
  canonical, source-bound values and never reader prose. A structured
@@ -392,9 +392,8 @@ verified or exact project-authorized program may use the `trusted-program` path,
392
392
  which is not an isolation claim. An untrusted program without a real sandbox is
393
393
  not executable.
394
394
 
395
- The program input remains the operation-discriminated
396
- `context.indexer.run-request/v1` (`main-index` or `material-answer`). Its output
397
- is `context.indexer.run-result/v1`, wrapped by
395
+ The program input is `context.indexer.run-request/v2` with the single
396
+ `main-index` operation. Its output is `context.indexer.run-result/v1`, wrapped by
398
397
  `context.indexer.controlled-program-result/v1` to bind the exact invocation and
399
398
  payload digest. Context still validates the operation-specific Result and
400
399
  recomputes mechanical gates independently.
@@ -412,9 +411,9 @@ program, instructions, templates, config, CLI/profile contracts and only
412
411
  `primary_resource_binding_digest`; a post-author resource cannot satisfy that
413
412
  schema.
414
413
 
415
- `context.indexer.main-workset/v1` digests its complete canonical payload. A
414
+ `context.indexer.main-workset/v2` digests its complete canonical payload. A
416
415
  workset set permits only one author workset for an Indexer, owner cohort and
417
- group key. `context.indexer.main-transport-batch/v1` may carry several complete
416
+ group key. `context.indexer.main-transport-batch/v2` may carry several complete
418
417
  worksets but intentionally has no batch identity, digest, page number or
419
418
  reader-facing name. Regrouping worksets for Host transport therefore cannot
420
419
  change an individual workset or Result identity.
@@ -429,17 +428,14 @@ same workset with the next authorized strategy. This path has no user Gate and
429
428
  does not consume profile-revision attempts; an exhausted strategy set routes
430
429
  to the CLI catalog fallback.
431
430
 
432
- Source and evidence are read through
433
- `context.indexer.workset-read-request/v1`. The stable request identity binds the
434
- current workset, read kind and exact authorized ref set. Cursor and page size
435
- are transport fields and do not enter that identity. Every response carries a
436
- digest of its canonical page payload; cursor fields are again excluded. The
437
- CLI closes a complete, acyclic cursor chain into
438
- `context.indexer.workset-read-receipt/v1`, requiring exact coverage of the
439
- requested refs. A main Result contains the canonically sorted receipt digest
440
- set, and operation validation compares it with the actual CLI-issued receipts.
441
- Changing a cursor, page size, call grouping or Host batch cannot manufacture a
442
- new logical unit such as `batch-1` or alter an Artifact identity.
431
+ Context projects every source-specific fact, dependency and verified Provider
432
+ fragment authorized for one main workset into the single
433
+ `context.indexer.authorized-workset-view/v1` resource. The Agent reads that
434
+ managed resource and uses its file locators directly. It does not construct
435
+ source-specific reads, semantic windows, cursors or receipt fields. Workset,
436
+ View and execution-request identity bind the accepted Result; Host call grouping
437
+ cannot manufacture a new logical unit such as `batch-1` or alter an Artifact
438
+ identity.
443
439
 
444
440
  Post-author composition uses its own
445
441
  `context.indexer.post-author-run-ledger/v1`; it never reuses primary main-run
@@ -515,7 +511,7 @@ derived under `knowledge/<collection>/` and never accepted from a Provider.
515
511
 
516
512
  Template Artifacts enter layout only after validated rendering. Only rendered
517
513
  Sections exist; an omitted optional projection does not create an empty
518
- Section, while a retained material gap remains a planned landing without
514
+ Section, while a retained material gap remains unresolved without
519
515
  reader-visible placeholder content. Artifact Bundle purpose and `split_of`
520
516
  lineage are retained in the proposal. A proposal set rejects duplicate Node
521
517
  owners, Artifact identities, logical Section identities, Section placements
@@ -545,12 +541,9 @@ fan-out to an already approved Node, removing or renaming an Artifact,
545
541
  splitting/merging its declared lineage, moving a logical Section, or changing
546
542
  an approved collection/path is represented by a digest-bound layout change
547
543
  report and requires the human, non-delegable `confirm-layout-change` Gate.
548
- `context.indexer.layout-transition/v1` first validates an explicit
549
- no-planned-output state or a material-answer actualization whose digest and
550
- actual ArtifactRef/SectionRef all belong to the current proposal set; only
551
- then does it expose the conditional Gate. Replacing the proposal set makes the
552
- prior actualization stale. The legacy align Route remains available only until
553
- the workflow cutover; it is not an authority for the new Indexer protocol.
544
+ `context.indexer.layout-transition/v1` binds the current proposal set and base
545
+ projections before exposing the conditional Gate. No parallel align Route can
546
+ approve or rewrite that transition.
554
547
 
555
548
  ## Explicit Result-bound Candidate compile
556
549
 
@@ -559,7 +552,7 @@ author Results from the durable main-run store. Its input repeats only the
559
552
  exact workset, execution-request, acceptance and Artifact Result digests; the
560
553
  CLI rejects a missing, extra, forged or stale Result reference before
561
554
  materialization. Callers cannot provide an alternate Result body, Provider
562
- contract, default plan or prose-compile payload.
555
+ contract or a second document-authoring payload.
563
556
 
564
557
  The compiler validates every accepted run envelope and acceptance record,
565
558
  then binds each Candidate to the same Indexer Result, source identity,
@@ -582,62 +575,19 @@ customization may be proposed only after the explicit
582
575
  `indexer-customization-required` outcome and its capability-gap proof; compile
583
576
  itself never invents one.
584
577
 
585
- ## Material-answer dispatch, baseline, Review, and layout actualization
586
-
587
- `context.indexer.material-question-workset/v1` is built only by the CLI after a
588
- material-gap checkpoint. It binds the current requirement and registry digests,
589
- question contract and target inventory, source-input digests, exact question
590
- revision, predecessor ledger revision, authorized sources, and eligible answer
591
- Indexers. Eligibility is derived from the registry-enabled `material-answer`
592
- operation, an enricher binding, the primary Provider manifest, read scope, and
593
- the evidence-kind intersection; callers cannot add an eligible Indexer.
594
-
595
- The CLI creates one `context.indexer.run-request/v1` per eligible answer Indexer.
596
- Its Provider composition fingerprint is recomputed from the answer Indexer,
597
- exact final Provider authority, and layer-composition view digest. The separate
598
- material-answer run ledger uses CAS transitions and content-addressed accepted
599
- records. A complete accepted empty Result is recovered without another dispatch;
600
- an interrupted running entry without its accepted record returns to pending.
601
- Before acceptance, every evidence claim must resolve through an exact current
602
- source-span read receipt, and unused or stale receipts are rejected.
603
-
604
- A `material-answer` Result cannot move a retained gap directly to an approved
605
- state. Context first validates the exact workset, question revision, eligible
606
- Indexer, Provider fingerprint, source authority, canonical spans, evidence
607
- content digests, provenance selector and minimum item/origin counts. Only a
608
- passing candidate can produce
609
- `context.indexer.material-answer-baseline-report/v1`. Its fixed Review scope is
610
- `question-target-source-span-evidence-binding`; the strict schema has no field
611
- for approving a reader page, Artifact content or final knowledge candidate.
612
-
613
- `context.indexer.material-answer-review-decision/v1` binds that report, the
614
- candidate set, workset, question revision and binding digest. Applying an
615
- `approved` decision uses the workset's predecessor ledger revision as a CAS
616
- base, consumes that workset and records the decision digest in the canonical
617
- answer binding. A successor ledger revision does not make the consumed workset
618
- self-stale. A rejected, insufficient, forged or differently scoped decision
619
- cannot create `answer-approved` state.
620
-
621
- Layout uses an unapplied
622
- `context.indexer.material-answer-layout-proposal/v1`. Each planned or existing
623
- answer landing must map uniquely to an actual `node:`, `artifact:` or
624
- `section:` ref. Before creating a resolved actualization, Context recomputes
625
- `context.indexer.material-answer-evidence-compatibility/v1` from the retained
626
- canonical evidence and current question/source authority. A changed source set,
627
- origin, snapshot, kind, span, content digest, provenance rule or minimum count
628
- reopens the gap to `unresolved`. A missing or colliding landing remains
629
- `answer-approved`; rejecting or replacing a layout proposal invalidates its
630
- resolved mappings back to `answer-approved`.
631
-
632
- `context.indexer.material-answer-flow-status/v1` is the admission fact for the
633
- next stages. An unresolved blocking gap stops layout. An `answer-approved`
634
- blocking gap may enter layout but cannot consume a conditional layout Gate or
635
- enter the main Candidate Review. Those two admissions become true only when
636
- every blocking answer has a current actualization for the exact layout digest.
637
- Optional gaps remain reported but do not become blocking. Final close removes
638
- a resolved ledger entry only when the approved structure projection carries
639
- the same question, binding, actualized target and complete canonical evidence
640
- ref set.
578
+ ## Material gaps and the single authoring path
579
+
580
+ Reconciliation reports unresolved material gaps from the current accepted
581
+ Results. Required gaps keep the current lifecycle blocked; optional gaps remain
582
+ diagnostics in that report. Context does not create a second checkpoint, audit
583
+ ledger, answer workset, or special close route for them.
584
+
585
+ Newly captured Markdown, tool snapshots, or other authorized material re-enter
586
+ the normal `main-index` operation. The affected Partition and Author worksets
587
+ run again, reconciliation is recomputed, and the user reviews the resulting
588
+ knowledge Candidate once. Successful close writes only approved knowledge and
589
+ the recovery metadata in `knowledge/structure.yaml`, then clears transient
590
+ Indexer runtime state.
641
591
 
642
592
  ## Detector and inspector
643
593
 
@@ -660,12 +610,19 @@ payloads fail closed.
660
610
  `present`, `absent` or `unknown`; a present signal requires evidence. Context,
661
611
  not the detector, derives `matched`, `not-matched` or `indeterminate`.
662
612
 
663
- An authoring inspector consumes `context.indexer.inspector-request/v1` and
664
- returns `context.indexer.inspector-result/v1`. Its evidence payload is the
665
- shared `context.indexer.evidence-adapter-result/v1`. Inspector files are always
613
+ An authoring inspector consumes `context.indexer.inspector-request/v1`, including
614
+ the exact active Provider profiles and Registry variants, and returns
615
+ `context.indexer.inspector-result/v1`. Its evidence payload is the shared
616
+ `context.indexer.evidence-adapter-result/v1`; its `fact_payloads` carry only
617
+ validated profile variants, source Fact refs, bounded template variables and a
618
+ structured availability status. Context requires one payload for every
619
+ enrichment fact, verifies each payload digest and source ref, rejects Registry
620
+ variant drift, then adapts the values into the same internal Authorized Workset
621
+ View projection source used by other inputs. Inspector files are always
666
622
  `enricher` plus `lightweight-evidence`; they cannot own baseline inventory or
667
623
  contribute a denominator. The Result must close the requested inventory and
668
- authorized source/module scope. Detector and inspector entries run only from
624
+ authorized source/module scope. No Inspector protocol or technical identifier
625
+ is exposed as a separate Agent input. Detector and inspector entries run only from
669
626
  the reverified content-addressed stage through the same empty-environment,
670
627
  no-shell, bounded JSON subprocess runner. Timeout, stdin/stdout/stderr overflow,
671
628
  invalid UTF-8/JSON, undeclared evidence and scope expansion are typed failures;
@@ -782,27 +739,3 @@ structured claim passed owner-local evidence coverage, and lists every
782
739
  semantic-prose block or direct authored template variable as
783
740
  `semantic-prose-agent-review-required`. It does not scan free prose to claim
784
741
  that unsupported natural-language assertions were mechanically detected.
785
-
786
- ## Material-question target exclusion
787
-
788
- A target exclusion is not a Provider Result and does not change the confirmed
789
- requirement. Context first emits
790
- `context.indexer.material-question-exclusion-report/v1` for one current
791
- unresolved `QuestionTargetKey`. The report binds the project, predecessor
792
- ledger revision, question-target inventory, question contract and revision,
793
- target ref/item digest, exact allowlisted reason, derived severity and the
794
- reader-visible impact.
795
-
796
- `confirm-material-question-exclusion` accepts only that report and always emits
797
- `context.indexer.material-question-exclusion-confirmation/v1` with human,
798
- non-delegable authority. Managed mode, Provider omission, wildcard targets and
799
- non-allowlisted reasons cannot create the decision. Apply revalidates the
800
- report against the current resolved question and ledger before retaining only
801
- the reason code and decision digest in the entry.
802
-
803
- The successor ledger is checkpointed with the predecessor revision through the
804
- same durable structure journal. A question contract, owner, target item,
805
- question revision or other pair dependency change replaces the retained
806
- exclusion with an unresolved entry in one checkpoint. The Material Gap ledger
807
- is intentionally absent from the main-workset identity, so this target-level
808
- decision does not invalidate unrelated main indexing worksets.
@@ -348,9 +348,8 @@ src-N#span:<heading-hint> L<start>-<end>@<span-hash>
348
348
 
349
349
  The code symbol form includes the source-relative file so same-name symbols in
350
350
  different files resolve to one exact symbol-index row. Consumers should still
351
- treat the complete `source_ref` as opaque. Production codeindex pages keep
352
- `candidate_fingerprint` at the top level and do not duplicate this evidence in
353
- `code_origin`.
351
+ treat the complete `source_ref` as opaque. Production pages do not expose
352
+ Candidate fingerprints, Indexer digests, or `code_origin`.
354
353
 
355
354
  `#span:` refs retain source snapshot line ranges for human review, diffing, and
356
355
  stable re-pinning. They resolve against committed file/lark document snapshots,