@c4a/context 0.6.19 → 0.7.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 (122) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  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/getting-started.md +30 -24
  7. package/docs/guides/agent-guide.md +41 -46
  8. package/docs/guides/code-indexer-skill-authoring.md +124 -0
  9. package/docs/guides/indexer-provider-and-customization.md +140 -0
  10. package/docs/guides/markdown-indexer-skill-authoring.md +118 -0
  11. package/docs/reference/code-extractors.md +9 -24
  12. package/docs/reference/indexer-provider-protocol.md +808 -0
  13. package/docs/reference/project-api.md +41 -40
  14. package/index.d.ts +47 -1
  15. package/index.js +28010 -3945
  16. package/indexerAgentStepProtocol.d.ts +9391 -0
  17. package/indexerArtifactDependencies.d.ts +689 -0
  18. package/indexerArtifactPolicy.d.ts +335 -0
  19. package/indexerArtifactResult.d.ts +2009 -0
  20. package/indexerAuditFacts.d.ts +66 -0
  21. package/indexerAuditOverrideReadiness.d.ts +27 -0
  22. package/indexerAuditProtocol.d.ts +238 -0
  23. package/indexerAuditRevision.d.ts +726 -0
  24. package/indexerAuditRevisionActions.d.ts +236 -0
  25. package/indexerAuthoringFixture.d.ts +152 -0
  26. package/indexerBaseQuestionAmendment.d.ts +2403 -0
  27. package/indexerBenchmark.d.ts +1062 -0
  28. package/indexerCandidateCompile.d.ts +985 -0
  29. package/indexerCapabilityGroupEvidence.d.ts +129 -0
  30. package/indexerCatalogFallback.d.ts +1262 -0
  31. package/indexerCollectionMapping.d.ts +75 -0
  32. package/indexerContentLayers.d.ts +137 -0
  33. package/indexerContractOverlay.d.ts +879 -0
  34. package/indexerControlledInvocation.d.ts +512 -0
  35. package/indexerControlledProgram.d.ts +12535 -0
  36. package/indexerCoreExports.d.ts +21 -0
  37. package/indexerCustomizationDraft.d.ts +13800 -0
  38. package/indexerCustomizationLadder.d.ts +103 -0
  39. package/indexerDependencyView.d.ts +1610 -0
  40. package/indexerEvidenceAdapterResult.d.ts +504 -0
  41. package/indexerExampleDecision.d.ts +1606 -0
  42. package/indexerExampleIdentity.d.ts +132 -0
  43. package/indexerExampleIdentityAudit.d.ts +70 -0
  44. package/indexerExampleLinkageAudit.d.ts +80 -0
  45. package/indexerGeneratedAuthoringAudit.d.ts +208 -0
  46. package/indexerIncrementalImpact.d.ts +221 -0
  47. package/indexerInventoryDisposition.d.ts +443 -0
  48. package/indexerLayerComposition.d.ts +1652 -0
  49. package/indexerLayoutChange.d.ts +329 -0
  50. package/indexerLayoutProposalSet.d.ts +447 -0
  51. package/indexerLayoutResolver.d.ts +342 -0
  52. package/indexerLayoutTransition.d.ts +247 -0
  53. package/indexerLifecycle.d.ts +53 -0
  54. package/indexerMainLifecycle.d.ts +258 -0
  55. package/indexerMainRunLedger.d.ts +888 -0
  56. package/indexerMainRunProtocol.d.ts +6471 -0
  57. package/indexerMainWorkset.d.ts +2141 -0
  58. package/indexerMaterialAnswer.d.ts +738 -0
  59. package/indexerMaterialAnswerActualization.d.ts +91 -0
  60. package/indexerMaterialAnswerExecutionPlan.d.ts +2887 -0
  61. package/indexerMaterialAnswerFlow.d.ts +63 -0
  62. package/indexerMaterialAnswerLayout.d.ts +76 -0
  63. package/indexerMaterialAnswerReview.d.ts +217 -0
  64. package/indexerMaterialAnswerReviewRoute.d.ts +6145 -0
  65. package/indexerMaterialAnswerRunLedger.d.ts +918 -0
  66. package/indexerMaterialAnswerRunProtocol.d.ts +1253 -0
  67. package/indexerMaterialGapLedger.d.ts +3111 -0
  68. package/indexerMaterialQuestionExclusion.d.ts +129 -0
  69. package/indexerMaterialQuestionWorkset.d.ts +508 -0
  70. package/indexerNavigationArtifactGraph.d.ts +5 -0
  71. package/indexerNavigationArtifactPlan.d.ts +39 -0
  72. package/indexerOverlayQuestionAmendment.d.ts +2551 -0
  73. package/indexerOverlayQuestionApplyProposal.d.ts +4697 -0
  74. package/indexerParserCoordinate.d.ts +222 -0
  75. package/indexerParserFactView.d.ts +503 -0
  76. package/indexerPartitionConvergence.d.ts +496 -0
  77. package/indexerPartitionPlan.d.ts +919 -0
  78. package/indexerPartitionStrategyResolution.d.ts +594 -0
  79. package/indexerPhysicalArtifactAudit.d.ts +247 -0
  80. package/indexerPhysicalArtifactManifest.d.ts +449 -0
  81. package/indexerPlannedMaterialAnswer.d.ts +116 -0
  82. package/indexerPostAuthorComposition.d.ts +2000 -0
  83. package/indexerPostAuthorRunLedger.d.ts +1972 -0
  84. package/indexerPrimaryProjection.d.ts +262 -0
  85. package/indexerProfileContract.d.ts +3034 -0
  86. package/indexerProfileMetricAudit.d.ts +218 -0
  87. package/indexerProgramExecutionAuthorization.d.ts +227 -0
  88. package/indexerProgramRunProtocol.d.ts +7642 -0
  89. package/indexerProjectProposal.d.ts +2807 -0
  90. package/indexerProjectedArtifactFanOutAudit.d.ts +159 -0
  91. package/indexerProjectedArtifactPlan.d.ts +217 -0
  92. package/indexerProtocolCommon.d.ts +29 -0
  93. package/indexerProvider.d.ts +2510 -0
  94. package/indexerProviderComposition.d.ts +1357 -0
  95. package/indexerProviderContractReferences.d.ts +13 -0
  96. package/indexerProviderProfileResolution.d.ts +20 -0
  97. package/indexerProviderResolution.d.ts +752 -0
  98. package/indexerProviderResolutionAction.d.ts +678 -0
  99. package/indexerProviderRouting.d.ts +3909 -0
  100. package/indexerProviderSelectionProposal.d.ts +3311 -0
  101. package/indexerQuestionAuthority.d.ts +419 -0
  102. package/indexerReaderTargetInventory.d.ts +161 -0
  103. package/indexerReferenceOnlyAudit.d.ts +90 -0
  104. package/indexerRegistry.d.ts +3019 -0
  105. package/indexerRequirementComparison.d.ts +44 -0
  106. package/indexerRequirementConfirmation.d.ts +1193 -0
  107. package/indexerRequirementLifecycle.d.ts +3314 -0
  108. package/indexerRestrictedSelector.d.ts +63 -0
  109. package/indexerResultReconciliation.d.ts +6844 -0
  110. package/indexerResultReconciliationRun.d.ts +15 -0
  111. package/indexerRunEnvelope.d.ts +384 -0
  112. package/indexerRunProtocolCommon.d.ts +21 -0
  113. package/indexerSharedArtifactFingerprint.d.ts +33 -0
  114. package/indexerStructuredDeclaration.d.ts +513 -0
  115. package/indexerSubjectCatalog.d.ts +230 -0
  116. package/indexerSubjectIdentity.d.ts +19 -0
  117. package/indexerSubjectKeyAuthority.d.ts +785 -0
  118. package/indexerTemplateRendering.d.ts +485 -0
  119. package/indexerToolSnapshot.d.ts +431 -0
  120. package/indexerWorksetRead.d.ts +287 -0
  121. package/package.json +1 -1
  122. package/phases.d.ts +1 -1
@@ -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
@@ -102,28 +102,13 @@ codeindex or reuse an unrelated parser.
102
102
 
103
103
  ## Plan Before Parsing
104
104
 
105
- Classify the user-visible module before selecting language tooling or reading an
106
- archetype template: API/service, background runtime, SDK/library, interactive
107
- application, adapter, CLI/tool, monorepo container, derived source,
108
- authoritative contract source, or unknown.
109
- A hybrid module may declare several `moduleTypes` and several behavior `facets`;
110
- keep one primary `moduleType` for concise reports. Record inspected paths in
111
- `moduleTypeEvidence`, record every Markdown file actually read in `documents`, then read all matching Route-recommended files below
112
- `resources/semantic/code-index/templates/` and combine them into one plan.
113
- After that, choose exactly one closed output profile: `module-map`,
114
- `application-map`, `protocol-index`, `service-boundary`, `runtime-map`,
115
- `public-api-reference`, `command-map`, `adapter-contract`, `module-registry`,
116
- `cross-module-flow`, or `provenance-only`. The profile selects structural probes
117
- and advisory checks; an invented value is rejected.
118
-
119
- Each archetype resource is a working template for an Agent with limited prior
120
- context. It provides a minimum evidence pass, the reader questions the index
121
- must answer, suggested knowledge units, Markdown chapter blueprints,
122
- aggregation and relationship rules, composition examples, and stop conditions.
123
- The blueprints are illustrative: omit unsupported sections and merge overlap
124
- across selected templates instead of producing empty headings or duplicate
125
- pages. They shape content before the batch preview; they do not prescribe or
126
- override projected page counts.
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.
127
112
 
128
113
  Extractor shape defines what can be emitted. `extractTs()` creates one page per
129
114
  selected symbol and permits one owning index unit per source. Use it for an