@c4a/context 0.6.19 → 0.7.0

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 (120) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/codeIndexPlan.d.ts +34 -0
  4. package/docs/README.md +7 -0
  5. package/docs/README.zh-CN.md +5 -0
  6. package/docs/guides/code-indexer-skill-authoring.md +124 -0
  7. package/docs/guides/indexer-provider-and-customization.md +140 -0
  8. package/docs/guides/markdown-indexer-skill-authoring.md +118 -0
  9. package/docs/reference/code-extractors.md +2 -2
  10. package/docs/reference/indexer-provider-protocol.md +819 -0
  11. package/docs/reference/project-api.md +2 -2
  12. package/index.d.ts +47 -1
  13. package/index.js +28239 -3952
  14. package/indexerAgentStepProtocol.d.ts +9391 -0
  15. package/indexerArtifactDependencies.d.ts +689 -0
  16. package/indexerArtifactPolicy.d.ts +335 -0
  17. package/indexerArtifactResult.d.ts +2010 -0
  18. package/indexerAuditFacts.d.ts +66 -0
  19. package/indexerAuditOverrideReadiness.d.ts +27 -0
  20. package/indexerAuditProtocol.d.ts +238 -0
  21. package/indexerAuditRevision.d.ts +726 -0
  22. package/indexerAuditRevisionActions.d.ts +236 -0
  23. package/indexerAuthoringFixture.d.ts +152 -0
  24. package/indexerBaseQuestionAmendment.d.ts +2403 -0
  25. package/indexerBenchmark.d.ts +1062 -0
  26. package/indexerCandidateCompile.d.ts +801 -0
  27. package/indexerCapabilityGroupEvidence.d.ts +129 -0
  28. package/indexerCatalogFallback.d.ts +1262 -0
  29. package/indexerCollectionMapping.d.ts +75 -0
  30. package/indexerContentLayers.d.ts +137 -0
  31. package/indexerControlledInvocation.d.ts +512 -0
  32. package/indexerControlledProgram.d.ts +12535 -0
  33. package/indexerCoreExports.d.ts +21 -0
  34. package/indexerCustomizationDraft.d.ts +13800 -0
  35. package/indexerCustomizationLadder.d.ts +103 -0
  36. package/indexerDependencyView.d.ts +1610 -0
  37. package/indexerEvidenceAdapterResult.d.ts +504 -0
  38. package/indexerExampleDecision.d.ts +1606 -0
  39. package/indexerExampleIdentity.d.ts +132 -0
  40. package/indexerExampleIdentityAudit.d.ts +70 -0
  41. package/indexerExampleLinkageAudit.d.ts +80 -0
  42. package/indexerGeneratedAuthoringAudit.d.ts +208 -0
  43. package/indexerIncrementalImpact.d.ts +221 -0
  44. package/indexerInventoryDisposition.d.ts +443 -0
  45. package/indexerLayerComposition.d.ts +1652 -0
  46. package/indexerLayoutChange.d.ts +329 -0
  47. package/indexerLayoutProposalSet.d.ts +447 -0
  48. package/indexerLayoutResolver.d.ts +342 -0
  49. package/indexerLayoutTransition.d.ts +247 -0
  50. package/indexerLifecycle.d.ts +53 -0
  51. package/indexerMainLifecycle.d.ts +258 -0
  52. package/indexerMainRunLedger.d.ts +888 -0
  53. package/indexerMainRunProtocol.d.ts +6471 -0
  54. package/indexerMainWorkset.d.ts +2141 -0
  55. package/indexerMaterialAnswer.d.ts +738 -0
  56. package/indexerMaterialAnswerActualization.d.ts +91 -0
  57. package/indexerMaterialAnswerExecutionPlan.d.ts +2887 -0
  58. package/indexerMaterialAnswerFlow.d.ts +63 -0
  59. package/indexerMaterialAnswerLayout.d.ts +76 -0
  60. package/indexerMaterialAnswerReview.d.ts +217 -0
  61. package/indexerMaterialAnswerReviewRoute.d.ts +6145 -0
  62. package/indexerMaterialAnswerRunLedger.d.ts +918 -0
  63. package/indexerMaterialAnswerRunProtocol.d.ts +1253 -0
  64. package/indexerMaterialGapLedger.d.ts +3111 -0
  65. package/indexerMaterialQuestionExclusion.d.ts +129 -0
  66. package/indexerMaterialQuestionWorkset.d.ts +508 -0
  67. package/indexerNavigationArtifactGraph.d.ts +5 -0
  68. package/indexerNavigationArtifactPlan.d.ts +39 -0
  69. package/indexerOverlayQuestionAmendment.d.ts +2551 -0
  70. package/indexerOverlayQuestionApplyProposal.d.ts +4697 -0
  71. package/indexerOverlayTrust.d.ts +1425 -0
  72. package/indexerParserCoordinate.d.ts +222 -0
  73. package/indexerParserFactView.d.ts +503 -0
  74. package/indexerPartitionConvergence.d.ts +496 -0
  75. package/indexerPartitionPlan.d.ts +919 -0
  76. package/indexerPartitionStrategyResolution.d.ts +594 -0
  77. package/indexerPhysicalArtifactAudit.d.ts +247 -0
  78. package/indexerPhysicalArtifactManifest.d.ts +449 -0
  79. package/indexerPlannedMaterialAnswer.d.ts +116 -0
  80. package/indexerPostAuthorComposition.d.ts +2000 -0
  81. package/indexerPostAuthorRunLedger.d.ts +1972 -0
  82. package/indexerPrimaryProjection.d.ts +262 -0
  83. package/indexerProfileContract.d.ts +3034 -0
  84. package/indexerProfileMetricAudit.d.ts +218 -0
  85. package/indexerProgramExecutionAuthorization.d.ts +227 -0
  86. package/indexerProgramRunProtocol.d.ts +7642 -0
  87. package/indexerProjectProposal.d.ts +2807 -0
  88. package/indexerProjectedArtifactFanOutAudit.d.ts +159 -0
  89. package/indexerProjectedArtifactPlan.d.ts +217 -0
  90. package/indexerProtocolCommon.d.ts +29 -0
  91. package/indexerProvider.d.ts +2573 -0
  92. package/indexerProviderComposition.d.ts +1357 -0
  93. package/indexerProviderContractReferences.d.ts +13 -0
  94. package/indexerProviderProfileResolution.d.ts +20 -0
  95. package/indexerProviderResolution.d.ts +752 -0
  96. package/indexerProviderResolutionAction.d.ts +678 -0
  97. package/indexerProviderRouting.d.ts +3909 -0
  98. package/indexerProviderSelectionProposal.d.ts +3311 -0
  99. package/indexerQuestionAuthority.d.ts +419 -0
  100. package/indexerReaderTargetInventory.d.ts +161 -0
  101. package/indexerReferenceOnlyAudit.d.ts +90 -0
  102. package/indexerRegistry.d.ts +3019 -0
  103. package/indexerRequirementComparison.d.ts +44 -0
  104. package/indexerRequirementConfirmation.d.ts +1193 -0
  105. package/indexerRequirementLifecycle.d.ts +3314 -0
  106. package/indexerRestrictedSelector.d.ts +63 -0
  107. package/indexerResultReconciliation.d.ts +6844 -0
  108. package/indexerResultReconciliationRun.d.ts +15 -0
  109. package/indexerRunEnvelope.d.ts +384 -0
  110. package/indexerRunProtocolCommon.d.ts +21 -0
  111. package/indexerSharedArtifactFingerprint.d.ts +33 -0
  112. package/indexerStructuredDeclaration.d.ts +513 -0
  113. package/indexerSubjectCatalog.d.ts +230 -0
  114. package/indexerSubjectIdentity.d.ts +19 -0
  115. package/indexerSubjectKeyAuthority.d.ts +785 -0
  116. package/indexerTemplateRendering.d.ts +485 -0
  117. package/indexerToolSnapshot.d.ts +431 -0
  118. package/indexerWorksetRead.d.ts +287 -0
  119. package/package.json +1 -1
  120. package/phases.d.ts +1 -1
package/README.md CHANGED
@@ -86,7 +86,7 @@ maintain this declaration from the user's requirements.
86
86
  |---|---|
87
87
  | `defineProject()` | Declares the complete project graph. |
88
88
  | `source()` and `allSources()` | References registered repo, file, or Lark source boundaries. |
89
- | `extractTs()` | Extracts TypeScript/TSX symbols and relationships into `codeindex` candidates. |
89
+ | `extractTs()` | Extracts TypeScript/JavaScript and TSX/JSX symbols and relationships into `codeindex` candidates. |
90
90
  | `extractCustom()` | Runs a project-owned code extractor while Context owns candidate, evidence, freshness, and Review state. |
91
91
  | `alignProse()` and `compileProse()` | Structures document evidence and compiles source-bound knowledge candidates. |
92
92
  | `reviewValidity()` | Declares the review gate for one collection or the project. |
package/README.zh-CN.md CHANGED
@@ -80,7 +80,7 @@ Route 会按需选择维护这份声明所需的操作说明、Schema 和手册
80
80
  |---|---|
81
81
  | `defineProject()` | 声明完整的项目处理图。 |
82
82
  | `source()` 和 `allSources()` | 引用已经登记的代码仓库、本地文件或飞书来源边界。 |
83
- | `extractTs()` | 从 TypeScript/TSX 中提取符号和关系,生成 `codeindex` 候选。 |
83
+ | `extractTs()` | 从 TypeScript/JavaScript 与 TSX/JSX 中提取符号和关系,生成 `codeindex` 候选。 |
84
84
  | `extractCustom()` | 运行项目自有代码提取器,同时由 Context 维护候选、证据、新鲜度和审核状态。 |
85
85
  | `alignProse()` 和 `compileProse()` | 整理文档证据,并生成与来源绑定的知识候选。 |
86
86
  | `reviewValidity()` | 声明单个知识类型或整个项目的审核门禁。 |
@@ -53,6 +53,34 @@ export interface CodeIndexCapabilityGap {
53
53
  reason: string;
54
54
  requestedMaterial?: string;
55
55
  }
56
+ export interface CodeIndexIdentityGroup {
57
+ id: string;
58
+ /** Stable target identities represented by one reader-facing capability group. */
59
+ members: readonly string[];
60
+ /** Reader-facing page that explains the common responsibility of the members. */
61
+ viewRef: string;
62
+ /** Eligible source files that prove the group membership. */
63
+ sourceFiles: readonly string[];
64
+ }
65
+ export type CodeIndexChainCandidateFamily = "entry-operation" | "operation-handler" | "handler-downstream" | "event-processing" | "command-effect" | "export-implementation" | "cross-source-handoff";
66
+ export interface CodeIndexChainCandidate {
67
+ id: string;
68
+ family: CodeIndexChainCandidateFamily;
69
+ from: string;
70
+ to: string;
71
+ sourceFiles: readonly string[];
72
+ confidence: "structural" | "declared" | "ambiguous";
73
+ }
74
+ export interface CodeIndexChainCandidateDecision {
75
+ candidateId: string;
76
+ decision: "document" | "merge" | "exclude" | "request-input";
77
+ /** Required for document decisions and must identify the reader-facing chain page. */
78
+ viewRef?: string;
79
+ /** Required when an equivalent candidate is merged into a canonical chain. */
80
+ canonicalChainId?: string;
81
+ /** Required for exclude and request-input decisions. */
82
+ reason?: string;
83
+ }
56
84
  /** Complete source inventory returned by a project adapter for mechanical quality scoring. */
57
85
  export interface CodeIndexInspectionInventory {
58
86
  indexUnitId: string;
@@ -92,6 +120,12 @@ export interface CodeIndexInspectionInventory {
92
120
  kind: "entry" | "export" | "route" | "operation" | "handler" | "downstream" | "command" | "event" | "plugin" | "handoff";
93
121
  identity: string;
94
122
  }[];
123
+ /** Source-constrained groups that cover target identities without listing every member in prose. */
124
+ identityGroups?: readonly CodeIndexIdentityGroup[];
125
+ /** Static or declared chain candidates discovered during source inspection. */
126
+ chainCandidates?: readonly CodeIndexChainCandidate[];
127
+ /** Explicit disposition for every discovered chain candidate. */
128
+ chainCandidateDecisions?: readonly CodeIndexChainCandidateDecision[];
95
129
  excludedFiles: number;
96
130
  /** Complete identities deliberately excluded after discovery. */
97
131
  excludedFileTargets: readonly string[];
package/docs/README.md CHANGED
@@ -25,6 +25,9 @@ preload the whole manual set.
25
25
  | Understand the whole knowledge-project shape | [Getting Started](./getting-started.md) |
26
26
  | Know what the Agent may decide or change | [Agent Guide](./guides/agent-guide.md) and [Agent Dialogue](./guides/agent-dialogue.md) |
27
27
  | Configure sources, phases, review, or packages | [Project API](./reference/project-api.md) |
28
+ | Author or inspect an Indexer Provider protocol | [Indexer Provider Protocol](./reference/indexer-provider-protocol.md) |
29
+ | Select or customize an Indexer Provider | [Provider Selection and Customization](./guides/indexer-provider-and-customization.md) |
30
+ | Author a Code or Markdown Indexer Skill | [Code Indexer Authoring](./guides/code-indexer-skill-authoring.md) and [Markdown Indexer Authoring](./guides/markdown-indexer-skill-authoring.md) |
28
31
  | Choose a code extraction path | [Code Extractor Selection](./reference/code-extractors.md) |
29
32
  | Choose an Agent package or LLM document | [Package Outputs](./guides/package-outputs.md) |
30
33
  | Customize package files and indexes | [Package Templates](./reference/package-templates.md) and [Template Variables](./reference/template-variables.md) |
@@ -38,6 +41,10 @@ preload the whole manual set.
38
41
  - [Package Outputs](./guides/package-outputs.md) — how to choose between an agent knowledge-base package, LLM text, or no package output.
39
42
  - [Lark Resource Materialization](./guides/lark-resources.md) — how embedded resources move from source evidence to approved knowledge and package assets.
40
43
  - [Project API](./reference/project-api.md) — `defineProject`, sources, phases, review, and packages.
44
+ - [Indexer Provider Protocol](./reference/indexer-provider-protocol.md) — manifest, controlled execution, detector/inspector I/O, customization, and staged project apply.
45
+ - [Provider Selection and Customization](./guides/indexer-provider-and-customization.md) — registry-only selection, the six-level customization ladder, upgrade conflicts, debugging, and completion conditions.
46
+ - [Code Indexer Authoring](./guides/code-indexer-skill-authoring.md) — the 23-point Provider Skill release contract and anonymous fixture expectations.
47
+ - [Markdown Indexer Authoring](./guides/markdown-indexer-skill-authoring.md) — capture/semantic boundaries, Section placement, material answers, editorial policy, and local incremental behavior.
41
48
  - [Code Extractor Selection](./reference/code-extractors.md) — inspect module technology signals and choose a built-in extractor, reusable structural package, or project adapter.
42
49
  - [Package Templates](./reference/package-templates.md) — `kbPackage`, `llmsPackage`, template variables, and examples.
43
50
  - [Template Variables](./reference/template-variables.md) — Handlebars variables, loops, comments, and default knowledge inventories.
@@ -16,6 +16,8 @@
16
16
  | 理解完整知识项目的形态 | [Getting Started](./getting-started.md) |
17
17
  | 判断 Agent 可以决定或修改什么 | [Agent Guide](./guides/agent-guide.md) 和 [Agent Dialogue](./guides/agent-dialogue.md) |
18
18
  | 配置来源、阶段、审核或产物 | [Project API](./reference/project-api.md) |
19
+ | 选择或定制 Indexer Provider | [Provider Selection and Customization](./guides/indexer-provider-and-customization.md) |
20
+ | 编写 Code/Markdown Indexer Skill | [Code Indexer Authoring](./guides/code-indexer-skill-authoring.md) 和 [Markdown Indexer Authoring](./guides/markdown-indexer-skill-authoring.md) |
19
21
  | 选择代码提取方式 | [Code Extractor Selection](./reference/code-extractors.md) |
20
22
  | 选择 Agent 知识包或 LLM 文档 | [Package Outputs](./guides/package-outputs.md) |
21
23
  | 自定义包文件和索引 | [Package Templates](./reference/package-templates.md) 和 [Template Variables](./reference/template-variables.md) |
@@ -29,6 +31,9 @@
29
31
  - [Package Outputs](./guides/package-outputs.md):如何选择 Agent 知识包、LLM 文本或不构建产物。
30
32
  - [Lark Resource Materialization](./guides/lark-resources.md):内嵌资源如何从来源证据进入正式知识和知识包。
31
33
  - [Project API](./reference/project-api.md):`defineProject`、来源、阶段、审核和知识包声明。
34
+ - [Provider Selection and Customization](./guides/indexer-provider-and-customization.md):registry-only 选择、六级最小定制阶梯、升级冲突、调试与退出条件。
35
+ - [Code Indexer Authoring](./guides/code-indexer-skill-authoring.md):Code Provider Skill 的 23 项作者/发布契约。
36
+ - [Markdown Indexer Authoring](./guides/markdown-indexer-skill-authoring.md):capture/semantic 边界、Section 投影、material answer、编辑策略与局部增量。
32
37
  - [Code Extractor Selection](./reference/code-extractors.md):如何根据技术信号选择内建提取器、结构库或项目适配器。
33
38
  - [Package Templates](./reference/package-templates.md):`kbPackage`、`llmsPackage`、模板变量和示例。
34
39
  - [Template Variables](./reference/template-variables.md):Handlebars 变量、循环、注释和默认知识清单。
@@ -0,0 +1,124 @@
1
+ # Code Indexer Skill authoring
2
+
3
+ This guide defines the release checklist for a Code Indexer Provider Skill.
4
+ It does not reproduce Context's internal Agent Graph lifecycle. The Provider
5
+ receives validated requirements, scopes, worksets and evidence views and
6
+ returns only its declared structured Results/fragments.
7
+
8
+ ## Minimal package
9
+
10
+ Use one `context-indexer.yaml` with protocol
11
+ `context.indexer.provider/v1`. Give the Skill a SemVer version and publish the
12
+ complete Bundle with a reproducible integrity digest. Instructions, templates,
13
+ fixtures and portable program entries live below the Skill root. Do not invent
14
+ source-specific manifest names or a second schema tree.
15
+
16
+ Programs use a structured `runtime: node`, portable `entry` and literal `args`.
17
+ They never use a free-form command. A detector only reports activation signals;
18
+ an inspector only returns bounded evidence/enrichment. Neither is a hard-gate
19
+ authority. CLI profile contracts and verified data-only overlays own mechanical
20
+ rules, metric operators and thresholds.
21
+
22
+ ## Author contract checklist
23
+
24
+ 1. **Responsibility.** Classify supported code modules and produce evidence-
25
+ bound partitions, logical units, Artifact Bundles and Results. Do not own
26
+ source authorization, requirement approval, final review, CLI metrics or
27
+ package publication.
28
+ 2. **Manifest.** Use the sole `context-indexer.yaml` field tree. Bind domains,
29
+ profiles, operations/fragments, resources, source roles, logical units,
30
+ customization support and composition without duplicate aliases.
31
+ 3. **Resource composition.** Combine only declared programs, profile-bound
32
+ instructions, templates and optional detector/inspector resources. Omitted
33
+ capabilities remain unsupported; natural language cannot add them.
34
+ 4. **Activation and profiles.** Declare strong/supporting/negative signals.
35
+ Dependency names are candidates, not runtime proof. One module may combine
36
+ one primary profile with supporting/extensions and selected composers.
37
+ 5. **Sources and Artifacts.** Declare source roles and logical-unit intent;
38
+ select only CLI-registered Artifact kinds/policy variants. Keep logical unit
39
+ identity separate from physical Artifact count.
40
+ 6. **Inventory protocols.** Close every input member with an explicit
41
+ disposition. Use stable aggregation, full-path example identity and
42
+ 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.
49
+ 9. **Reader questions.** Declare reusable question templates with stable refs,
50
+ target domains and allowed evidence contracts. Do not make a question id
51
+ globally unique to one SubjectKey group.
52
+ 10. **Inspector safety.** Accept only the versioned stdin request and bounded
53
+ authorized evidence view; emit strict JSON within limits. Never read the
54
+ repository, environment or network implicitly, and never expose raw
55
+ config values, secrets or unbounded stderr/stdout.
56
+ 11. **Base gates.** Do not reduce source scope integrity, identity, evidence,
57
+ requirement, disposition, reference-only or provenance gates. Provider
58
+ integrity identifies content; it does not grant pass authority.
59
+ 12. **Anonymous fixtures.** Cover at least a component library, Web app, API
60
+ service, SDK/library and runtime/worker with neutral paths and identifiers.
61
+ 13. **Release tests.** Validate the manifest/resource ledger, run positive and
62
+ negative fixtures, forward-test the complete Skill, pack it, reinstall the
63
+ exact artifact and compare Bundle bytes/digest.
64
+ 14. **Content ownership.** Public technology belongs in the community Skill;
65
+ company-wide infrastructure belongs in a separate namespaced Provider;
66
+ repository, service, team and business mappings belong in business/project
67
+ Providers. Community fixtures remain anonymous.
68
+ 15. **Marketplace layout.** Archives keep one top-level Skill directory with
69
+ `SKILL.md`, the manifest and referenced runtime resources. Exclude tests,
70
+ 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.
76
+ 17. **Backend profiles.** Test neutral RPC/HTTP, Gateway, Event/function,
77
+ Cron/worker, sync/reconciliation, stateful service/storage and library
78
+ shapes. Local facts remain baseline when optional remote metadata is absent.
79
+ 18. **Versioning.** Use Skill/Provider SemVer, exact Provider pins and Bundle
80
+ integrity. Fixed dependencies require exact versions and resolved
81
+ integrity. `@context-indexer-origin` is optional on local customizations
82
+ only and grants no authority.
83
+ 19. **Trust boundary.** Skill/manifest describes capabilities; the verified
84
+ Bundle supplies bytes; workspace customization supplies project deltas;
85
+ CLI contracts supply hard rules. Keep these four authorities distinct.
86
+ 20. **Requirement direction.** `IndexRequirementSet` constrains registry,
87
+ extractor and Result in one direction. Apply requirement/registry changes
88
+ through staged, digest-bound proposals and transactional apply; do not edit
89
+ a live registry around the Route.
90
+ 21. **Program and remote authority.** Programs must pass static policy and the
91
+ applicable trusted/sandbox authorization. Optional remote tools use a
92
+ versioned Host Action, exact source-bound request and readable receipt;
93
+ they never expand scope or perform writes.
94
+ 22. **End-to-end recovery.** Test discovery, exact Provider resolution,
95
+ content-addressed staging, controlled execution, Artifact/Evidence Result
96
+ validation and crash recovery. A resumed run reuses only complete accepted
97
+ records and never infers success from a partial receipt.
98
+ 23. **Customization ladder.** Preserve this order: Provider only → config →
99
+ instructions append → one template override → program extension →
100
+ restricted replace. Document the proof and exit condition at every step;
101
+ see [Provider selection and customization](./indexer-provider-and-customization.md).
102
+
103
+ ## Result and composition rules
104
+
105
+ Exactly one primary layer returns a complete partition/author Result for an
106
+ operation. Pre-author extensions return only declared fragments and cannot
107
+ change ownership, denominator or Subject identity. Post-author composers bind
108
+ one current `PrimaryResultView` and return only a derived proposal fragment;
109
+ an empty composer run still has a receipt. Composer selection is the
110
+ intersection of registry selection, manifest declaration and current profile
111
+ applicability, not array order.
112
+
113
+ Use canonical SubjectKey schemas and the Context NodeRef formula. Code and
114
+ Markdown Indexers must reuse the same Node when the SubjectKey is equal. An
115
+ enricher uses the supplied TargetResolutionView (`resolved`, `absent` or
116
+ `ambiguous`) and never guesses identity from a title or path resemblance.
117
+
118
+ ## Publication gate
119
+
120
+ Do not publish until the exact packed artifact passes manifest/schema
121
+ validation, anonymous positive/negative fixtures, no-scope-expansion and
122
+ secret-leak tests, deterministic Bundle reconstruction, exact-version install,
123
+ controlled execution and forward tests. Publishing a new version does not make
124
+ existing workspace pins current; workspace selection must re-resolve it.
@@ -0,0 +1,140 @@
1
+ # Indexer Provider selection and customization
2
+
3
+ This guide is for workspace users and Agents selecting Code or Markdown
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.
7
+
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/`.
12
+
13
+ ## Selection flow
14
+
15
+ 1. Inspect and confirm the complete `IndexRequirementSet`. A Provider,
16
+ registry entry or Result may strengthen it but cannot remove targets,
17
+ questions, evidence obligations or required owner cells.
18
+ 2. Run `context indexer catalog --format json` and report those CLI-bundled
19
+ entry Skills together with Indexer Skills already visible to the Host.
20
+ When the Host exposes an exact Skill root, read only its `SKILL.md`
21
+ frontmatter and sibling `context-indexer.yaml`; the manifest version is
22
+ authoritative and `metadata.context-provider-version` must match it. Group
23
+ the same Skill name and exact version into one conversational item with all
24
+ observed source types. An installed projection of an identical CLI-bundled
25
+ identity is not a second Provider; different versions remain distinct. Do
26
+ not scan `.claude`, `.codex`, `.agents` or arbitrary user directories.
27
+ 3. Route the path-free visible identities with
28
+ `context indexer route-indexer-provider-selection`. Try the applicable
29
+ community fallback once when the Route requests it.
30
+ 4. Statically validate the returned selection proposal before a Host resolves
31
+ any Bundle. Resolve only the emitted exact requests, then stage and validate
32
+ the complete content ledger.
33
+ 5. Apply the registry and any declared customization through the staged,
34
+ CAS-bound project proposal. A successful static report is not write or
35
+ execution authority.
36
+
37
+ Every required requirement/domain/source/module cell has exactly one primary
38
+ owner. Read scope may overlap for supporting profiles, extensions and
39
+ enrichers. Array order is never precedence. Each Provider layer retains its own
40
+ exact version, integrity, portable distribution, config and resource
41
+ fingerprints.
42
+
43
+ ## Six-level customization ladder
44
+
45
+ Use the first level that closes the CLI-proven capability gap. Do not start at
46
+ a more powerful level because it is convenient.
47
+
48
+ | Level | Change | Entry evidence | Exit condition |
49
+ | --- | --- | --- | --- |
50
+ | 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 |
51
+ | 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 |
52
+ | 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 |
53
+ | 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 |
54
+ | 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 |
55
+ | 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 |
56
+
57
+ Levels 3–6 are allowed only after the Route returns
58
+ `indexer-customization-required` with a current `capability_gap_proof`. Copy the
59
+ proof into the draft unchanged. A draft cannot weaken requirements, widen
60
+ source scope, copy a parser, add an evaluator, or claim that it has been
61
+ applied. If no safe level closes the gap, stop instead of emitting a
62
+ conforming-looking file.
63
+
64
+ ## Upgrade and conflict handling
65
+
66
+ Provider upgrades never silently absorb a local override. Re-resolve the exact
67
+ version and Bundle, then compare the new Provider config, instructions,
68
+ templates, program resources, profile/SubjectKey contracts and the local
69
+ customization fingerprint.
70
+
71
+ - An unchanged upstream resource keeps the local override current.
72
+ - A changed resource outside the override makes only its dependent units stale.
73
+ - A changed resource under an instruction/template/program override returns
74
+ `indexer-customization-upstream-changed`; rebase or remove the override.
75
+ - Missing, undeclared, escaping or contract-conflicting local resources return
76
+ `indexer-customization-invalid`.
77
+ - An exact Provider version/integrity that cannot be resolved returns
78
+ `indexer-provider-unavailable`; do not substitute another version or stale
79
+ cache.
80
+ - Multiple primary owners return a conflict for explicit resolution. Do not
81
+ use discovery order or a preferred Provider name as a tie-breaker.
82
+
83
+ The optional `@context-indexer-origin <skill>@<version>` comment records where
84
+ a local customization began. It grants no trust and never bypasses revalidation.
85
+
86
+ ## Outcome handling
87
+
88
+ These outcomes all point back to this guide:
89
+
90
+ | Outcome | Required next action |
91
+ | --- | --- |
92
+ | `indexer-provider-required` | Discover visible entry Skills, route a path-free proposal, and keep the requirement set unchanged. |
93
+ | `indexer-provider-unavailable` | Restore the exact distribution or choose a new Provider through the selection Gate. Never use an approximate version. |
94
+ | `indexer-customization-required` | Follow the six-level ladder using only the returned current gap proof. |
95
+ | `indexer-customization-invalid` | Remove undeclared/escaping/conflicting files, then rebuild and restage the proposal. |
96
+ | `indexer-customization-upstream-changed` | Reconcile the upstream change with every affected override and rerun final validation. |
97
+
98
+ ## Debugging commands
99
+
100
+ Use `--help` for the current payload schema and copy Route-returned commands
101
+ when available:
102
+
103
+ ```bash
104
+ context indexer catalog --format json
105
+ context indexer inspect-index-requirements --help
106
+ context indexer compare-index-requirements --help
107
+ context indexer route-indexer-provider-selection --help
108
+ context indexer validate-indexer-selection-proposal --help
109
+ context indexer resolve-indexer-providers --help
110
+ context indexer stage-indexer-provider-bundle --help
111
+ context indexer validate-indexer-customization --help
112
+ context indexer prepare-indexer-customization-project --help
113
+ context indexer stage-indexer-project-proposal --help
114
+ context indexer apply-indexer-project --help
115
+ context indexer observe-indexer-project --help
116
+ ```
117
+
118
+ Keep full runtime reports under `.tmp/context-runtime/`. Do not persist Bundle
119
+ bytes, resolution receipts, selection discovery, run ledgers or audit reports
120
+ in `src/`, `knowledge/` or `dist/`.
121
+
122
+ ## Completion check
123
+
124
+ Selection/customization is complete only when all of these are true:
125
+
126
+ - the confirmed requirement digest is unchanged;
127
+ - every required owner cell has exactly one primary owner;
128
+ - every Provider is exact-versioned, integrity-checked and staged from a
129
+ portable distribution;
130
+ - profile variants, SubjectKey authority, config and resources pass final
131
+ validation;
132
+ - each local change is the smallest proven ladder level and has no unrelated
133
+ copied resources;
134
+ - program and dependency receipts exist when required and do not claim a
135
+ sandbox the Host does not provide;
136
+ - the transactional apply observation matches every target digest;
137
+ - a final static/final selection validation passes after apply.
138
+
139
+ For the complete manifest and execution surface, see
140
+ [Indexer Provider protocol](../reference/indexer-provider-protocol.md).
@@ -0,0 +1,118 @@
1
+ # Markdown Indexer Skill authoring
2
+
3
+ Markdown Providers use the same `context.indexer.provider/v1` manifest,
4
+ versioning, Bundle, requirement, trust, Result and customization contracts as
5
+ Code Providers. Read the shared
6
+ [Code Indexer author checklist](./code-indexer-skill-authoring.md) and
7
+ [Provider selection/customization guide](./indexer-provider-and-customization.md)
8
+ first. This page defines the Markdown-specific boundary.
9
+
10
+ ## Capture before semantics
11
+
12
+ Capture owns source authorization, retrieval, revision identity, complete bytes,
13
+ Markdown/MDX parsing and evidence spans. A Markdown Indexer starts only from a
14
+ current captured source report and authorized evidence view. URLs, titles,
15
+ filenames, headings and capture success are activation candidates, not semantic
16
+ classification or proof that the whole document was read.
17
+
18
+ The Provider cannot fetch the document again, follow new links, rewrite source
19
+ revisions or widen capture scope. Missing/unsupported capture capability is an
20
+ explicit unsupported result, never a prose fallback.
21
+
22
+ ## Activation and source roles
23
+
24
+ Declare document activation signals and map evidence-backed sources to declared
25
+ roles such as authoritative, explanatory, operational, decision or example
26
+ material. Keep role selection separate from collection placement. One document
27
+ may support multiple reader questions, but every consumed span retains its
28
+ source/revision identity and cannot be promoted to a stronger authority by an
29
+ instruction.
30
+
31
+ ## Section projection and collection mapping
32
+
33
+ Author Results propose logical Sections and their intent; they do not write
34
+ `knowledge/` paths. Each Section binds:
35
+
36
+ - the canonical SubjectKey/Node target or an explicit independent target;
37
+ - its reader-question refs and exact evidence spans;
38
+ - an Artifact kind and Section key stable across content-only changes;
39
+ - a projection intent describing purpose, not a physical filename;
40
+ - structured content layers and their digests.
41
+
42
+ Context owns the closed mapping from profile/Section intent to collection and
43
+ path. The layout resolver reuses an existing Artifact by stable identity,
44
+ detects add/remove/rename/split/merge/move changes and requests a human Gate
45
+ only for destructive or ambiguous existing-layout changes. A Provider cannot
46
+ avoid that Gate by emitting a path or relabeling the change.
47
+
48
+ ## Reusing Code Nodes
49
+
50
+ Use the supplied subject catalog and TargetResolutionView. Equal SubjectKeys use
51
+ the same NodeRef across Code and Markdown. `resolved` enriches the existing
52
+ Node; `absent` may create an explicitly independent subject or a material gap;
53
+ `ambiguous` fails before authoring. Titles, heading similarity and filenames
54
+ are never identity fallback. Unrelated catalog changes must not make a workset
55
+ stale.
56
+
57
+ ## Artifact and Section planning
58
+
59
+ One logical unit may produce an Artifact Bundle with multiple meaningful
60
+ Sections or semantic split Artifacts. Do not use fixed-count, ordinal or
61
+ alphabetic batches. Do not create one page per heading/member or inflate page
62
+ count to satisfy a metric. The CLI owns Artifact-policy eligibility, physical
63
+ fan-out audit, layout actualization and the final Candidate compile.
64
+
65
+ Each Section carries exact positive and negative dependency refs. Incremental
66
+ impact is Section/Artifact-local: a source membership, question denominator,
67
+ candidate pool, evidence span or run-envelope change invalidates only the
68
+ dependent scope. A Provider must not replace this with source-wide or
69
+ collection-wide recomputation.
70
+
71
+ ## Editorial policy
72
+
73
+ Editorial instructions may guide clarity, consolidation, ordering and
74
+ reader-facing terminology. They cannot alter facts, evidence, source role,
75
+ requirement scope, protected values, revision identity, collection authority or
76
+ hard metrics. Deterministic blocks render only registered facts; semantic prose
77
+ must cite consumed evidence. Placeholders, speculation, fabricated transitions
78
+ and “content unavailable” pages are invalid even when the structure looks rich.
79
+
80
+ ## Material questions and answers
81
+
82
+ When current material cannot answer a required canonical question, return the
83
+ exact material-question disposition for the supplied owner cell, question
84
+ 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.
94
+
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.
98
+
99
+ ## Markdown author fixture checklist
100
+
101
+ Release fixtures should cover:
102
+
103
+ - complete Markdown and MDX capture plus unsupported parser/capture paths;
104
+ - authoritative reference, guide, runbook, FAQ, decision, incident, policy,
105
+ test and release/migration document shapes using anonymous content;
106
+ - per-Section projection into every supported collection intent;
107
+ - existing Code Node reuse, independent subject, ambiguity and material gap;
108
+ - content-only reuse plus add/remove/rename/split/merge/collection/path/Section
109
+ move in both directions;
110
+ - protected values, links, images/assets and source-span fidelity;
111
+ - editorial positives and placeholder/speculation/unsupported negatives;
112
+ - material-answer approval, stale/rebind/deletion recovery and no-output-leak;
113
+ - Section-local incremental invalidation, new membership/denominator/candidate
114
+ pool changes and unaffected Section reuse.
115
+
116
+ Source authorization, capture revision safety, canonical question/collection
117
+ contracts, layout confirmation, review and build remain Context authority and
118
+ cannot be replaced by the Skill.
@@ -38,10 +38,10 @@ Current reusable capabilities are:
38
38
 
39
39
  | Source fact | Preferred capability | Lifecycle integration |
40
40
  |---|---|---|
41
- | TypeScript/TSX package or file scope | `extractTs()` | Context-owned phase |
41
+ | TypeScript/JavaScript package or TSX/JSX file scope | `extractTs()` | Context-owned phase |
42
42
  | Go declarations, imports, calls, and common HTTP routes | `@c4a/extract-go` | call from `extractCustom()` |
43
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 TypeScript symbols |
44
+ | React Router route declarations | `extractReactRouterRoutes()` from `@c4a/extract-ts` | call from `extractCustom()`; complements ECMAScript symbols |
45
45
  | Rust, Python, Java/JVM, or an unsupported framework/protocol | no assumed built-in parser | project-owned `extractCustom()` adapter |
46
46
 
47
47
  The custom extraction preview verifies this selection mechanically. Context