@c4a/context-cli 0.7.0 → 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 (219) hide show
  1. package/README.md +18 -39
  2. package/README.zh-CN.md +13 -27
  3. package/cli.js +59230 -80555
  4. package/indexers/bundles/context-code-indexer/SKILL.md +30 -3
  5. package/indexers/bundles/context-code-indexer/context-indexer.yaml +3 -8
  6. package/indexers/bundles/context-code-indexer/references/indexer.md +110 -7
  7. package/indexers/bundles/context-code-indexer/references/metrics.md +143 -37
  8. package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +2 -2
  9. package/indexers/bundles/context-code-indexer/templates/component-library.md +8 -0
  10. package/indexers/bundles/context-code-indexer/templates/gateway-facade.md +16 -0
  11. package/indexers/bundles/context-markdown-indexer/SKILL.md +13 -3
  12. package/indexers/bundles/context-markdown-indexer/context-indexer.yaml +20 -7
  13. package/indexers/bundles/context-markdown-indexer/references/indexer.md +33 -4
  14. package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +30 -14
  15. package/indexers/bundles/context-markdown-indexer/references/structure-and-artifacts.md +6 -0
  16. package/indexers/bundles/context-markdown-indexer/tests/fixtures/anonymous.json +1 -1
  17. package/indexers/bundles/context-markdown-indexer/tests/fixtures/profiles.json +13 -13
  18. package/indexers/bundles/context-markdown-indexer/tests/fixtures/routing.json +122 -0
  19. package/indexers/contracts/operator-contract.json +2 -2
  20. package/indexers/contracts/profile-contract.json +3819 -454
  21. package/indexers/release-manifest.json +22 -22
  22. package/package.json +13 -3
  23. package/plugins/VERSION +1 -1
  24. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  25. package/plugins/claude/commands/context.md +44 -85
  26. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  27. package/plugins/codex/skills/context/SKILL.md +44 -85
  28. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  29. package/plugins/cursor/commands/c4a-context.md +44 -85
  30. package/plugins/skills/context/SKILL.md +44 -85
  31. package/plugins/skills/context-code-indexer/SKILL.md +30 -3
  32. package/plugins/skills/context-code-indexer/context-indexer.yaml +3 -8
  33. package/plugins/skills/context-code-indexer/references/indexer.md +110 -7
  34. package/plugins/skills/context-code-indexer/references/metrics.md +143 -37
  35. package/plugins/skills/context-code-indexer/templates/adapter-integration.md +2 -2
  36. package/plugins/skills/context-code-indexer/templates/component-library.md +8 -0
  37. package/plugins/skills/context-code-indexer/templates/gateway-facade.md +16 -0
  38. package/plugins/skills/context-markdown-indexer/SKILL.md +13 -3
  39. package/plugins/skills/context-markdown-indexer/context-indexer.yaml +20 -7
  40. package/plugins/skills/context-markdown-indexer/references/indexer.md +33 -4
  41. package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +30 -14
  42. package/plugins/skills/context-markdown-indexer/references/structure-and-artifacts.md +6 -0
  43. package/plugins/skills/context-markdown-indexer/tests/fixtures/anonymous.json +1 -1
  44. package/plugins/skills/context-markdown-indexer/tests/fixtures/profiles.json +13 -13
  45. package/plugins/skills/context-markdown-indexer/tests/fixtures/routing.json +122 -0
  46. package/providers/context/actions/advance-current-indexer-lifecycle.yaml +6 -0
  47. package/providers/context/actions/configure-indexer-providers.yaml +1 -1
  48. package/providers/context/actions/materialize-indexer-workset-view.yaml +7 -0
  49. package/providers/context/actions/run-indexer-lifecycle.yaml +7 -0
  50. package/providers/context/actions/run-indexer-post-author-composer.yaml +1 -1
  51. package/providers/context/codes.yaml +9 -49
  52. package/providers/context/graphs/indexer.yaml +75 -592
  53. package/providers/context/graphs/workspace.yaml +25 -500
  54. package/providers/context/manifest.json +110 -1199
  55. package/providers/context/provider.yaml +2 -2
  56. package/providers/context/resources/diagnostics/projection-stale.md +0 -1
  57. package/providers/context/resources/dialogue/human-gates.md +3 -3
  58. package/providers/context/resources/manuals/reference/package-templates.md +2 -3
  59. package/providers/context/resources/manuals/reference/project-api.md +52 -985
  60. package/providers/context/resources/procedures/close-and-build.md +8 -23
  61. package/providers/context/resources/procedures/knowledge-review.md +13 -4
  62. package/providers/context/resources/procedures/source-capture-detailed.md +6 -8
  63. package/providers/context/resources/views/authorized-indexer-workset-view.yaml +15 -0
  64. package/providers/context/resources/views/package-current.yaml +1 -1
  65. package/providers/context/resources/views/resolved-indexer-instructions.yaml +1 -1
  66. package/providers/context/resources/views/review-current.yaml +1 -1
  67. package/providers/context/resources/views/source-boundary.yaml +1 -1
  68. package/providers/context/resources/views/source-current.yaml +1 -1
  69. package/providers/context/resources/views/verification-current.yaml +1 -1
  70. package/providers/context/resources/views/workspace-current.yaml +1 -1
  71. package/providers/context/schemas/indexer-agent-step-input.schema.json +2 -2
  72. package/providers/context/schemas/indexer-agent-step-result.schema.json +298 -32
  73. package/providers/context/schemas/indexer-authorized-workset-view.schema.json +65 -0
  74. package/providers/context/schemas/indexer-contract-overlay-validation-input.schema.json +0 -42
  75. package/providers/context/schemas/indexer-contract-overlay-validation-result.schema.json +27 -122
  76. package/providers/context/schemas/indexer-lifecycle-continuation.schema.json +15 -0
  77. package/providers/context/schemas/indexer-main-lifecycle-input.schema.json +13 -20
  78. package/providers/context/schemas/indexer-main-lifecycle-output.schema.json +17 -2
  79. package/providers/context/schemas/indexer-materialized-resource.schema.json +8 -1
  80. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +55 -6
  81. package/providers/context/schemas/indexer-overlay-question-rebind-input.schema.json +4 -4
  82. package/providers/context/schemas/indexer-workset-view-materialization-request.schema.json +32 -0
  83. package/providers/context/skills/configure-indexer-providers/SKILL.md +40 -27
  84. package/providers/context/skills/run-indexer-agent-step/SKILL.md +34 -8
  85. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +37 -0
  86. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +38 -9
  87. package/docs/document-optimization.md +0 -82
  88. package/docs/document-optimization.zh-CN.md +0 -70
  89. package/indexers/capability-manifest.json +0 -40
  90. package/indexers/contracts/hard-rule-conformance.json +0 -2644
  91. package/providers/context/actions/accept-main-index-run.yaml +0 -7
  92. package/providers/context/actions/accept-material-answer-run.yaml +0 -7
  93. package/providers/context/actions/accept-post-author-composer-run.yaml +0 -7
  94. package/providers/context/actions/actualize-material-answer-bindings.yaml +0 -8
  95. package/providers/context/actions/align-next.yaml +0 -6
  96. package/providers/context/actions/apply-code-index-guidance.yaml +0 -5
  97. package/providers/context/actions/apply-document-optimization-guidance.yaml +0 -5
  98. package/providers/context/actions/apply-structure-confirmation.yaml +0 -5
  99. package/providers/context/actions/audit-material-gap-state.yaml +0 -8
  100. package/providers/context/actions/audit-projected-artifact-fan-out.yaml +0 -8
  101. package/providers/context/actions/authorize-indexer-contract-overlay.yaml +0 -7
  102. package/providers/context/actions/build-main-index-author-worksets.yaml +0 -7
  103. package/providers/context/actions/build-main-index-catalog-fallback.yaml +0 -7
  104. package/providers/context/actions/build-main-index-partition-worksets.yaml +0 -7
  105. package/providers/context/actions/build-material-question-workset.yaml +0 -7
  106. package/providers/context/actions/build-post-author-composer-worksets.yaml +0 -7
  107. package/providers/context/actions/build-question-target-inventory.yaml +0 -7
  108. package/providers/context/actions/build-subject-catalog.yaml +0 -7
  109. package/providers/context/actions/build-target-resolution-views.yaml +0 -7
  110. package/providers/context/actions/checkpoint-material-answer-review.yaml +0 -8
  111. package/providers/context/actions/checkpoint-material-gaps.yaml +0 -8
  112. package/providers/context/actions/close-indexer-approved-knowledge.yaml +0 -8
  113. package/providers/context/actions/compile-next.yaml +0 -5
  114. package/providers/context/actions/compose-indexer-post-author-fragments.yaml +0 -7
  115. package/providers/context/actions/configure-code-extraction.yaml +0 -5
  116. package/providers/context/actions/configure-prose-lifecycle.yaml +0 -5
  117. package/providers/context/actions/converge-main-index-partition-run.yaml +0 -7
  118. package/providers/context/actions/evaluate-material-gaps.yaml +0 -8
  119. package/providers/context/actions/extract-next.yaml +0 -5
  120. package/providers/context/actions/fail-main-index-run.yaml +0 -7
  121. package/providers/context/actions/fail-material-answer-run.yaml +0 -7
  122. package/providers/context/actions/fail-post-author-composer-run.yaml +0 -7
  123. package/providers/context/actions/inspect-code-extraction.yaml +0 -5
  124. package/providers/context/actions/inspect-document-classification.yaml +0 -5
  125. package/providers/context/actions/inspect-index-candidate-review-readiness.yaml +0 -8
  126. package/providers/context/actions/inspect-index-profile-failure.yaml +0 -7
  127. package/providers/context/actions/inspect-material-answer-review.yaml +0 -8
  128. package/providers/context/actions/inspect-structure.yaml +0 -5
  129. package/providers/context/actions/migrate-codeindex.yaml +0 -5
  130. package/providers/context/actions/observe-main-index-run-ledger.yaml +0 -7
  131. package/providers/context/actions/observe-material-answer-runs.yaml +0 -7
  132. package/providers/context/actions/observe-post-author-composer-worksets.yaml +0 -7
  133. package/providers/context/actions/optimize-documents.yaml +0 -6
  134. package/providers/context/actions/override-index-profile-audit.yaml +0 -7
  135. package/providers/context/actions/prepare-main-index-run-ledger.yaml +0 -7
  136. package/providers/context/actions/prepare-material-answer-runs.yaml +0 -7
  137. package/providers/context/actions/preview-extraction-batch.yaml +0 -5
  138. package/providers/context/actions/reconcile-indexer-results.yaml +0 -7
  139. package/providers/context/actions/reconcile-review-identities.yaml +0 -5
  140. package/providers/context/actions/record-index-profile-revision.yaml +0 -7
  141. package/providers/context/actions/report-index-profile-failure.yaml +0 -7
  142. package/providers/context/actions/resolve-effective-composers.yaml +0 -7
  143. package/providers/context/actions/review-material-answer-candidate.yaml +0 -8
  144. package/providers/context/actions/revise-code-index-audit.yaml +0 -5
  145. package/providers/context/actions/revise-document.yaml +0 -5
  146. package/providers/context/actions/revise-index-output.yaml +0 -7
  147. package/providers/context/actions/run-material-answer-indexers.yaml +0 -7
  148. package/providers/context/actions/start-main-index-run.yaml +0 -7
  149. package/providers/context/actions/start-material-answer-run.yaml +0 -7
  150. package/providers/context/actions/start-post-author-composer-run.yaml +0 -7
  151. package/providers/context/actions/submit-code-index-audit.yaml +0 -6
  152. package/providers/context/resources/dialogue/code-extraction.md +0 -87
  153. package/providers/context/resources/dialogue/document-classification.md +0 -33
  154. package/providers/context/resources/dialogue/structure-confirmation.md +0 -44
  155. package/providers/context/resources/dialogue/workflow-mode-after-capture.md +0 -25
  156. package/providers/context/resources/manuals/reference/code-extractors.md +0 -152
  157. package/providers/context/resources/procedures/code-extraction.md +0 -188
  158. package/providers/context/resources/procedures/code-index-audit.md +0 -113
  159. package/providers/context/resources/procedures/document-classification.md +0 -22
  160. package/providers/context/resources/procedures/document-optimization.md +0 -110
  161. package/providers/context/resources/procedures/document-revision.md +0 -36
  162. package/providers/context/resources/procedures/prose-align.md +0 -68
  163. package/providers/context/resources/procedures/prose-compile.md +0 -23
  164. package/providers/context/resources/semantic/align/candidate-resolution.md +0 -106
  165. package/providers/context/resources/semantic/align/density-profile.md +0 -41
  166. package/providers/context/resources/semantic/align/gates.md +0 -276
  167. package/providers/context/resources/semantic/align/structure-planning.md +0 -337
  168. package/providers/context/resources/semantic/code-index/classification.md +0 -270
  169. package/providers/context/resources/semantic/code-index/templates/adapter.md +0 -118
  170. package/providers/context/resources/semantic/code-index/templates/api-service.md +0 -116
  171. package/providers/context/resources/semantic/code-index/templates/background-runtime.md +0 -109
  172. package/providers/context/resources/semantic/code-index/templates/cli-tool.md +0 -129
  173. package/providers/context/resources/semantic/code-index/templates/contract-source.md +0 -73
  174. package/providers/context/resources/semantic/code-index/templates/contracts-and-chains.md +0 -81
  175. package/providers/context/resources/semantic/code-index/templates/cross-module-chain.md +0 -78
  176. package/providers/context/resources/semantic/code-index/templates/derived-source.md +0 -116
  177. package/providers/context/resources/semantic/code-index/templates/domain-service.md +0 -109
  178. package/providers/context/resources/semantic/code-index/templates/event-flow.md +0 -62
  179. package/providers/context/resources/semantic/code-index/templates/monorepo-container.md +0 -124
  180. package/providers/context/resources/semantic/code-index/templates/persistence-boundary.md +0 -56
  181. package/providers/context/resources/semantic/code-index/templates/plugin-extension.md +0 -52
  182. package/providers/context/resources/semantic/code-index/templates/protocol-boundary.md +0 -88
  183. package/providers/context/resources/semantic/code-index/templates/sdk-library.md +0 -132
  184. package/providers/context/resources/semantic/code-index/templates/web-application.md +0 -145
  185. package/providers/context/resources/semantic/compile/index.md +0 -31
  186. package/providers/context/resources/views/code-index-audit.yaml +0 -6
  187. package/providers/context/resources/views/document-optimization-current.yaml +0 -6
  188. package/providers/context/resources/views/extraction-preview.yaml +0 -6
  189. package/providers/context/resources/views/structure-current.yaml +0 -6
  190. package/providers/context/schemas/code-index-audit-decision.schema.json +0 -94
  191. package/providers/context/schemas/document-optimization-decisions.schema.json +0 -57
  192. package/providers/context/schemas/indexer-candidate-review-readiness-input.schema.json +0 -46
  193. package/providers/context/schemas/indexer-candidate-review-readiness-output.schema.json +0 -104
  194. package/providers/context/schemas/indexer-contract-overlay-authorization-input.schema.json +0 -32
  195. package/providers/context/schemas/indexer-contract-overlay-authorization-result.schema.json +0 -121
  196. package/providers/context/schemas/indexer-material-answer-lifecycle-input.schema.json +0 -90
  197. package/providers/context/schemas/indexer-material-answer-lifecycle-output.schema.json +0 -80
  198. package/providers/context/schemas/indexer-material-answer-review-inspection-input.schema.json +0 -32
  199. package/providers/context/schemas/indexer-material-answer-review-inspection-output.schema.json +0 -32
  200. package/providers/context/schemas/indexer-material-answer-review-resolution-input.schema.json +0 -19
  201. package/providers/context/schemas/indexer-material-answer-review-resolution-output.schema.json +0 -87
  202. package/providers/context/schemas/indexer-material-gap-lifecycle-input.schema.json +0 -86
  203. package/providers/context/schemas/indexer-material-gap-lifecycle-output.schema.json +0 -19
  204. package/providers/context/schemas/indexer-post-author-fragment-result.schema.json +0 -18
  205. package/providers/context/schemas/indexer-post-author-lifecycle-input.schema.json +0 -94
  206. package/providers/context/schemas/indexer-post-author-lifecycle-output.schema.json +0 -72
  207. package/providers/context/schemas/indexer-profile-failure-inspection-input.schema.json +0 -13
  208. package/providers/context/schemas/indexer-profile-failure-inspection-result.schema.json +0 -19
  209. package/providers/context/schemas/indexer-profile-failure-report-input.schema.json +0 -22
  210. package/providers/context/schemas/indexer-profile-failure-report-result.schema.json +0 -49
  211. package/providers/context/schemas/indexer-profile-override-decision.schema.json +0 -20
  212. package/providers/context/schemas/indexer-profile-override-result.schema.json +0 -49
  213. package/providers/context/schemas/indexer-profile-revision-agent-input.schema.json +0 -18
  214. package/providers/context/schemas/indexer-profile-revision-record-input.schema.json +0 -31
  215. package/providers/context/schemas/indexer-profile-revision-record-result.schema.json +0 -45
  216. package/providers/context/schemas/indexer-result-reconciliation-input.schema.json +0 -59
  217. package/providers/context/schemas/indexer-result-reconciliation-output.schema.json +0 -43
  218. package/providers/context/schemas/prose-structure-batch.schema.json +0 -35
  219. package/providers/context/skills/revise-index-output/SKILL.md +0 -12
@@ -1,124 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.monorepo-container
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Monorepo and module-container template
8
-
9
- Use for `monorepo-container`: a workspace whose stable knowledge is the
10
- registration, ownership, dependency, build, or release topology of multiple
11
- child modules. Do not treat the physical repository as one application merely
12
- because it has one Git remote.
13
-
14
- Recommended `outputProfile`: `module-registry`.
15
-
16
- ## Evidence pass
17
-
18
- Locate:
19
-
20
- - workspace/package/service manifests and child-module discovery rules;
21
- - build graph, task orchestration, cache, dependency, and affected-scope logic;
22
- - ownership, tags, boundaries, layering, or dependency constraints;
23
- - shared configuration and tooling inherited by child modules;
24
- - release groups, independent packages, deployment units, and version policy;
25
- - generated, mirrored, vendored, fixture, example, and legacy subtrees;
26
- - cross-module registries or contracts that warrant separate chain units.
27
-
28
- Use declared manifests as the primary inventory. Directory discovery is a
29
- fallback and must not silently include generated output or dependency caches.
30
-
31
- ## Questions the knowledge must answer
32
-
33
- 1. How are child modules discovered and identified?
34
- 2. Which modules are applications, services, libraries, tools, or derived
35
- sources, and who owns them?
36
- 3. What dependency and layering rules connect or constrain them?
37
- 4. How do build, test, cache, release, and deployment boundaries work?
38
- 5. Which configuration is inherited globally versus owned by a child module?
39
- 6. Which cross-module flows are important enough to index separately?
40
- 7. Which large or generated subtrees are intentionally excluded?
41
-
42
- ## Suggested knowledge units
43
-
44
- - **Module registry**: child identity, path, type, owner, manifest, supported
45
- entry, build/release unit, and lifecycle.
46
- - **Dependency/topology map**: declared dependency directions, layering rules,
47
- shared contracts, and source-backed edges.
48
- - **Build and release map**: task graph, affected-scope behavior, cache,
49
- artifacts, release groups, and deployment units.
50
- - **Shared tooling/configuration**: only stable workspace-level behavior that
51
- materially affects multiple children.
52
- - **Cross-module chain unit**: independently owned, source-backed flow joining
53
- several child modules; do not hide it inside the container summary.
54
-
55
- Every user-visible child application, service, library, or CLI is classified as
56
- its own index unit before deeper extraction.
57
-
58
- For `extractTs()`, each child package must first be registered as its own source
59
- boundary. One root source cannot be assigned to several index units because
60
- source-level ownership would be ambiguous. If source registration intentionally
61
- remains at repository level, use `extractCustom()` for the container registry
62
- and assign aggregate candidates explicitly; do not use `include` to simulate
63
- package ownership.
64
-
65
- ## Chapter blueprints
66
-
67
- ```markdown
68
- # <Workspace> module registry
69
- ## Workspace purpose and discovery rules
70
- ## Child module inventory
71
- ## Module types, ownership, and lifecycle
72
- ## Dependency and layering constraints
73
- ## Shared configuration and tooling
74
- ## Build, test, cache, and release topology
75
- ## Generated/mirrored boundaries and exclusions
76
- ## Cross-module knowledge entrypoints
77
- ```
78
-
79
- One child-module record may use:
80
-
81
- ```markdown
82
- ## <Module>
83
- - Path and manifest:
84
- - Primary/additional types and facets:
85
- - Responsibility and owner:
86
- - Stable entrypoints:
87
- - Direct module dependencies:
88
- - Build/release unit:
89
- - Lifecycle/source of truth:
90
- - Deeper index unit:
91
- ```
92
-
93
- ## Granularity and relationships
94
-
95
- Do not perform a repository-wide symbol scan as the container extraction. The
96
- container owns topology; child units own reader-facing application/service/API
97
- knowledge. Aggregate the registry when hundreds of children share the same
98
- shape, but preserve exact identities and locators.
99
-
100
- A workspace manifest, package registry, build graph, or release manifest is a
101
- valid stable `entries` locator even when the container has no executable
102
- process. Every registry page must retain exact child identities and locators;
103
- a directory listing is not a module map.
104
-
105
- Use manifest/build-graph evidence for dependency edges. Imports can supplement
106
- but should not override declared workspace ownership or package boundaries.
107
-
108
- ## Template composition examples
109
-
110
- - A workspace containing a Web app, API gateway, CLI, and generated client
111
- produces one registry plus separately classified child units.
112
- - A workspace with independent release groups selects `build-release`; retain
113
- the release map at the container level and package-specific compatibility in
114
- each `sdk-library` unit.
115
- - A cross-module request flow reads `cross-module-chain.md` and receives its
116
- own output owner when it spans several child units.
117
-
118
- ## Revise or stop when
119
-
120
- - module discovery relies only on a broad filesystem scan;
121
- - the plan treats all repository files as one index unit;
122
- - child ownership or source-of-truth boundaries are ambiguous;
123
- - generated/cache/vendor directories dominate projected output;
124
- - dependencies are inferred solely from names without manifest or graph proof.
@@ -1,56 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.persistence-boundary
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Persistence boundary template
8
-
9
- Use for `persistence` when durable state, cache behavior, consistency, or
10
- recovery is part of the confirmed reader goal. This template supplements the
11
- service or runtime that owns the operations; it is not a request to catalog
12
- every model or query.
13
-
14
- ## Evidence pass
15
-
16
- Locate:
17
-
18
- - repository/data-access interface and concrete callers;
19
- - datastore, table, collection, keyspace, entity, or file identity when
20
- source-backed;
21
- - transaction, consistency, cache, lock, idempotency, and concurrency bounds;
22
- - read/write/query families and domain mapping;
23
- - schema/migration authority, versioning, and operational recovery;
24
- - generated models, query helpers, fixtures, and migrations that should remain
25
- supporting evidence.
26
-
27
- ## Questions the knowledge must answer
28
-
29
- 1. Which service or domain operation owns each read or write family?
30
- 2. What durable or cached state is addressed?
31
- 3. Where are transaction, consistency, locking, and idempotency boundaries?
32
- 4. Which schema or migration source is authoritative?
33
- 5. What failure, migration, or recovery behavior is maintained?
34
-
35
- ## Chapter blueprint
36
-
37
- ```markdown
38
- # <Persistence boundary>
39
- ## Owned state and authoritative schema
40
- ## Repository or data-access entry
41
- ## Callers and operation families
42
- ## Transaction, consistency, cache, and locking behavior
43
- ## Failure, migration, and recovery boundaries
44
- ## Source evidence and excluded query helpers
45
- ```
46
-
47
- ## Granularity and stop conditions
48
-
49
- Group operations by owned state and consistency policy. Split only when schema
50
- authority, transaction ownership, datastore, or recovery semantics differ.
51
- Every page must identify real state and caller boundaries with source locators;
52
- a directory or class inventory is not a persistence model.
53
-
54
- Revise or stop when the datastore identity or owning operation is unknown,
55
- transaction/consistency behavior would be guessed, or generated bindings and
56
- migrations would dominate reader-facing pages.
@@ -1,52 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.plugin-extension
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Plugin and extension boundary template
8
-
9
- Use for `plugin-extension`. This file owns the complete plugin contract
10
- blueprint. CLI, SDK, and adapter templates should point here and only add their
11
- module-specific command, public API, or mapping context.
12
-
13
- ## Evidence pass
14
-
15
- Locate:
16
-
17
- - discovery mechanism, manifest, registry, or installation contract;
18
- - activation, deactivation, update, and removal lifecycle;
19
- - contribution points, commands, hooks, providers, and host services;
20
- - configuration, identity, compatibility, permissions, and isolation;
21
- - failure containment, fallback, diagnostics, and version negotiation;
22
- - public extension API and maintained examples when consumers implement it.
23
-
24
- ## Questions the knowledge must answer
25
-
26
- 1. How does the host discover, install, and activate an extension?
27
- 2. What may the extension contribute or call?
28
- 3. Which configuration, identity, permission, and compatibility rules apply?
29
- 4. How are failures isolated, surfaced, and recovered?
30
-
31
- ## Chapter blueprint
32
-
33
- ```markdown
34
- # <Plugin boundary>
35
- ## Host and extension responsibilities
36
- ## Discovery and installation
37
- ## Activation and removal lifecycle
38
- ## Contribution and capability contracts
39
- ## Configuration, permissions, and isolation
40
- ## Compatibility, failure, diagnostics, and recovery
41
- ## Source-backed host-to-extension relationships
42
- ```
43
-
44
- ## Granularity and stop conditions
45
-
46
- Prefer one contract per host/extension model, with compact records for coherent
47
- contribution families. Do not create separate copies under CLI, adapter, and
48
- SDK pages. Every page must name concrete manifests, registries, hooks, or
49
- capability identities and their source locators.
50
-
51
- Revise or stop when discovery or activation is inferred, permissions and
52
- isolation would be guessed, or examples describe an unsupported extension API.
@@ -1,88 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.protocol-boundary
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Protocol provider and consumer template
8
-
9
- Use for `protocol-provider`, `protocol-consumer`, or `generated-contract`. This
10
- template owns the canonical operation record. Application, API, service, SDK,
11
- and adapter templates provide module context but must not create a second
12
- registry for the same operations.
13
-
14
- ## Evidence pass
15
-
16
- Locate:
17
-
18
- - the authoritative IDL, OpenAPI document, schema, service definition, or
19
- explicit registration;
20
- - provider operation identity and dispatch when the provider is in scope;
21
- - consumer client construction and concrete operation call site when the
22
- consumer is in scope;
23
- - request, response, message, identity, and context mapping boundaries;
24
- - authentication, authorization, timeout, retry, compatibility, and error
25
- translation that are explicitly configured;
26
- - generated bindings, their generator/version, and their upstream authority.
27
-
28
- Do not infer protocol semantics from matching type names, generated model
29
- fields, imports, or transport-library dependencies.
30
-
31
- ## Questions the knowledge must answer
32
-
33
- 1. Which concrete operation or coherent operation family is provided or used?
34
- 2. Where is it registered or called, and where is its contract authoritative?
35
- 3. What request, response, identity, credential, and context mapping occurs?
36
- 4. What timeout, retry, compatibility, and failure behavior is source-backed?
37
- 5. Which generated artifacts are locators rather than independent authority?
38
-
39
- ## Canonical operation record
40
-
41
- Use this record wherever another selected template asks for an operation,
42
- route-to-client, or adapter mapping registry. Add type-specific detail around
43
- it rather than copying the operation into another table.
44
-
45
- ```markdown
46
- ## <Protocol operation or family>
47
- - Provider identity and registration:
48
- - Consumer call site:
49
- - Authoritative contract:
50
- - Request, identity, and context mapping:
51
- - Response and error mapping:
52
- - Timeout, retry, and compatibility:
53
- - Source-backed relationship:
54
- ```
55
-
56
- Provider-only records omit the consumer line. Consumer-only records omit
57
- provider dispatch and remain inside the owning module page unless the opposite
58
- endpoint is also a registered source and an evidenced cross-module flow is a
59
- separate reader goal.
60
-
61
- ## Generated and authoritative contracts
62
-
63
- For `generated-contract`, record the upstream schema, generator, version/pin,
64
- generated output boundary, and runtime consumer. Generated code may locate
65
- operations and fields but does not become semantic authority by itself.
66
-
67
- When the upstream authority is unavailable, a separate provenance unit may
68
- still record the generated boundary, generator markers, current consumers, and
69
- known authority gap with `outputProfile: "provenance-only"`. Keep the unit that
70
- would explain field semantics or compatibility as `material-required`; do not
71
- block the independently supported provenance record.
72
-
73
- For a `contract-source` module, preserve exact operation identities, namespaces,
74
- versions, compatibility declarations, imports, and generator targets. Do not
75
- invent runtime dispatch or consumer behavior that the contract does not define.
76
-
77
- ## Granularity and relationships
78
-
79
- Aggregate operations by contract, ownership, and execution family. Split when
80
- authority, mapping, security, versioning, or failure semantics materially
81
- differ. Do not create pages for every generated request/response type or field.
82
-
83
- Every page must contain concrete operation or schema identities and source
84
- locators. A page that only says a module “uses an API” is not sufficient.
85
-
86
- Revise or stop when operation identity is unavailable, authority is ambiguous,
87
- security/error behavior would be guessed, or a claimed provider-consumer join
88
- has no source-backed registration and call evidence.
@@ -1,132 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.sdk-library
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # SDK and shared library template
8
-
9
- Use for `sdk-library`: reusable code packages, component libraries, client
10
- SDKs, public framework extensions, or shared runtimes consumed through a
11
- deliberately supported interface. A package being imported elsewhere is not
12
- enough; confirm its supported entry and consumer contract.
13
-
14
- Recommended `outputProfile`: `public-api-reference`.
15
-
16
- ## Evidence pass
17
-
18
- Locate:
19
-
20
- - package manifest, exports map, public barrels, binary/native entry, or
21
- documented import paths;
22
- - initialization, providers, factories, configuration, and required runtime;
23
- - public capability families, components, hooks, types, commands, or clients;
24
- - supported extension/plugin points and lifecycle;
25
- - compatibility, platform, peer dependency, and version constraints;
26
- - maintained examples, tests, API comments, and migration/release notes;
27
- - external protocol schemas and generated declarations or clients;
28
- - internal implementation, fixtures, demos, and re-export chains that should
29
- not become independent reader pages.
30
-
31
- Use public exports plus maintained documentation together. An exported symbol
32
- can still be incidental; a documented stable import path can remain public even
33
- when it re-exports another implementation.
34
-
35
- ## Questions the knowledge must answer
36
-
37
- 1. Who should use this package and what capabilities does it promise?
38
- 2. What are the supported import/initialization paths?
39
- 3. How are public APIs grouped into concepts a consumer can navigate?
40
- 4. What configuration, lifecycle, compatibility, and failure rules apply?
41
- 5. Which examples demonstrate supported use rather than test-only behavior?
42
- 6. Which declarations are generated, and where is their authority?
43
- 7. How is the package built, versioned, and released when that is in scope?
44
-
45
- ## Suggested knowledge units
46
-
47
- - **Library/module map**: purpose, supported entrypoints, capability families,
48
- runtime/peer requirements, extension points, and navigation.
49
- - **Getting started or lifecycle**: installation assumptions, initialization,
50
- configuration, teardown, and minimal supported examples evidenced by source.
51
- - **Capability-family reference**: a coherent group of APIs/components with
52
- usage, contracts, constraints, and related types.
53
- - **Granular API/component reference**: one symbol or component per page only
54
- when the package intentionally exposes a granular public contract and the
55
- measured preview remains appropriate.
56
- - **Compatibility and migration**: supported platforms/versions and evidenced
57
- breaking or transitional behavior.
58
- - **Build/release entry**: only module-owned packaging and release behavior.
59
-
60
- ## Chapter blueprints
61
-
62
- ```markdown
63
- # <Library> module map
64
- ## Purpose and intended consumers
65
- ## Supported entrypoints and initialization
66
- ## Capability families
67
- ## Runtime, peer, and platform requirements
68
- ## Configuration and lifecycle
69
- ## Extension points and external protocols
70
- ## Compatibility, build, and release
71
- ## Examples, evidence, and exclusions
72
- ```
73
-
74
- For a capability family:
75
-
76
- ```markdown
77
- # <Capability family>
78
- ## When to use it
79
- ## Supported imports or components
80
- ## Initialization and configuration
81
- ## API/component contracts
82
- ## Lifecycle, errors, and constraints
83
- ## Minimal source-backed examples
84
- ## Related capabilities and authoritative references
85
- ```
86
-
87
- For a granular reference page:
88
-
89
- ```markdown
90
- # <Public API or component>
91
- ## Purpose
92
- ## Import and signature/props
93
- ## Required context and configuration
94
- ## Behavior, lifecycle, and errors
95
- ## Supported example
96
- ## Compatibility and source evidence
97
- ```
98
-
99
- ## Granularity and relationships
100
-
101
- Prefer capability families over one page per export. A symbol page is justified
102
- when consumers search for that exact public identity and its contract contains
103
- meaningful behavior beyond a signature. Do not copy complete function bodies,
104
- private members, generated declarations, fixtures, or every re-export.
105
-
106
- The 300-page limit remains per index unit. When a granular public surface would
107
- cross it, keep the public identities navigable but aggregate them into
108
- capability-family pages through `extractCustom()`; the limit is not raised for
109
- large libraries, and splitting one `extractTs()` source into overlapping units
110
- is not a valid workaround.
111
-
112
- Relate public entries to capability families, configuration, examples, and
113
- external protocols. Internal call graphs are secondary unless the knowledge
114
- goal explicitly concerns extension or lifecycle behavior.
115
-
116
- ## Template composition examples
117
-
118
- - A component library may use granular component pages plus family indexes,
119
- while its demo site is a separate `web-application` unit.
120
- - A generated client reads `derived-source.md` and
121
- `protocol-boundary.md`; document the supported client surface while naming
122
- the upstream schema authority.
123
- - A library with a plugin host also reads `adapter.md` and
124
- `plugin-extension.md`.
125
-
126
- ## Revise or stop when
127
-
128
- - the public boundary cannot be distinguished from internal exports;
129
- - examples are invented instead of derived from maintained usage or tests;
130
- - generated declarations have no identifiable authority;
131
- - every export or component is selected without a consumer-navigation reason;
132
- - compatibility or lifecycle claims are unavailable but required by the goal.
@@ -1,145 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.web-application
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Web and interactive application template
8
-
9
- Use only after evidence classifies a module as `web-application`. This covers
10
- browser applications, server-rendered sites, embedded WebViews, desktop Web
11
- shells, native mobile/desktop applications, cross-platform UI runtimes, and
12
- similar interactive modules. The `web-application` identifier is retained for
13
- the current contract but represents an interactive application boundary, not
14
- only browser code. It does
15
- not automatically cover every package containing UI components; a reusable
16
- component package is usually `sdk-library`.
17
-
18
- Recommended `outputProfile`: `application-map`.
19
-
20
- ## Evidence pass
21
-
22
- Locate the concrete application bootstrap and trace outward just far enough to
23
- find:
24
-
25
- - application mounting, server rendering, shell, or host-container entry;
26
- - route/page/screen registries and navigation guards;
27
- - page-to-state, loader, query, client, bridge, or controller boundaries;
28
- - runtime configuration, environment selection, feature registration, and
29
- authentication/session initialization;
30
- - build, local development, test, bundle, and release entrypoints;
31
- - generated clients, assets, styles, fixtures, and legacy routes that should
32
- remain evidence rather than reader-facing pages.
33
-
34
- If the route registry is generated, locate both its generator or source of
35
- truth and the runtime consumer. Do not infer page identity from a directory
36
- tree when an explicit registry exists.
37
-
38
- ## Questions the knowledge must answer
39
-
40
- A useful application index should let a reader determine:
41
-
42
- 1. How does the application start, and which runtime or host does it expect?
43
- 2. What are the stable pages/routes/screens and their entry components?
44
- 3. How does a page obtain data or call an external capability?
45
- 4. Which state, session, bridge, or configuration boundaries affect behavior?
46
- 5. How is the module run, debugged, built, and released?
47
- 6. Which implementation details are intentionally outside the knowledge scope?
48
-
49
- ## Suggested knowledge units
50
-
51
- Select only units supported by the confirmed goal and evidence:
52
-
53
- - **Application map**: responsibility, runtime, bootstrap, major subsystems,
54
- stable dependencies, and navigation to deeper pages.
55
- - **Route or page registry**: concrete route/page identity, entry component,
56
- loader/guard, main data boundary, and source locator. Aggregate related
57
- routes when a page-per-route layout would be repetitive.
58
- - **Data and protocol boundaries**: add application-specific page, state, and
59
- session context to the canonical operation record in `protocol-boundary.md`;
60
- do not create a second operation registry.
61
- - **State and host integration**: only stable stores, bridges, extension points,
62
- or host contracts that affect multiple pages or public behavior.
63
- - **Runtime and delivery guide**: module-owned development commands,
64
- configuration, build output, deployment/release entry, and evidenced recovery
65
- paths.
66
- - **Cross-layer flow**: a source-backed page-to-client-to-provider chain when
67
- both sides are registered sources.
68
-
69
- These are possible page families, not a required number of Markdown files.
70
-
71
- ## Chapter blueprints
72
-
73
- An application-map page may use:
74
-
75
- ```markdown
76
- # <Application> module map
77
- ## Responsibility and supported runtime
78
- ## Bootstrap sequence
79
- ## Route/page organization
80
- ## State, data, and protocol boundaries
81
- ## Host integrations and extension points
82
- ## Configuration and environment selection
83
- ## Development, build, and release entrypoints
84
- ## Known exclusions and source-of-truth links
85
- ```
86
-
87
- A route/page registry may use a compact record rather than prose repetition:
88
-
89
- ```markdown
90
- ## <Route or page family>
91
- - Identity and registration:
92
- - Entry component or controller:
93
- - Loader, guard, or initialization:
94
- - Main client/state dependencies:
95
- - User-visible outcome:
96
- - Source evidence:
97
- ```
98
-
99
- A cross-layer page may use:
100
-
101
- ```markdown
102
- # <User interaction> execution path
103
- ## Trigger and route entry
104
- ## UI/state orchestration
105
- ## Protocol request and authoritative contract
106
- ## Provider boundary and response handling
107
- ## Failure, fallback, and observability
108
- ## Source-backed relationship chain
109
- ```
110
-
111
- Do not fill a heading with generic text. Omit or mark a section as a material
112
- gap when the source cannot support it.
113
-
114
- ## Granularity and relationships
115
-
116
- Prefer stable application concepts over one page per component, hook, state
117
- field, style, generated type, or internal helper. A page registry must contain
118
- real identities and source locators, not just folder names. A protocol page
119
- must name concrete operations or contract locations, not merely state that the
120
- application “uses HTTP”.
121
-
122
- Create structured relationships only when registration, call sites, imports
123
- with unambiguous ownership, or parser evidence support them. Keep inferred
124
- product intent out of the index.
125
-
126
- ## Template composition examples
127
-
128
- - A server-rendered application with local API routes also reads
129
- `api-service.md` and `protocol-boundary.md`.
130
- - An embedded application with a host bridge also reads `adapter.md` and the
131
- applicable `plugin-extension.md` or `protocol-boundary.md` template.
132
- - A design-system package rendered in a demo application may need separate
133
- index units: `sdk-library` for the supported package and `web-application`
134
- for the demo host.
135
-
136
- ## Revise or stop when
137
-
138
- - no executable bootstrap or route registry can be located;
139
- - the proposed output is only a directory summary;
140
- - protocol semantics depend on unavailable material;
141
- - generated routes or clients are being mistaken for authoritative behavior;
142
- - one-symbol-per-page selection expands components or API types without a
143
- deliberate public-reference goal.
144
-
145
- Resolve these issues before the measured batch preview.
@@ -1,31 +0,0 @@
1
- ---
2
- context_resource: semantic/compile/index
3
- id: context.semantic.compile.index
4
- kind: procedure
5
- media-type: text/markdown
6
- applies-to:
7
- - diagnostic-routing
8
- - evidence-repair
9
- name: compile-reference-index
10
- description: "Optional index for non-mechanical structure and evidence diagnostics; normal compile does not require it."
11
- ---
12
-
13
- # Compile semantic reference index
14
-
15
- Normal source-bound compile is deterministic and does not require these
16
- references. Read this index only when a structure or evidence diagnostic asks
17
- for a non-mechanical decision, then open only the matching procedure:
18
-
19
- - [Compile action contract](compile-actions.md)
20
- - [Action and domain gates](action-domain-gates.md)
21
- - [Notes and caveats](notes.md)
22
- - [Refresh and update](refresh-and-update.md)
23
- - [Structural challenges](structural-challenges.md)
24
- - [Compile judgment](compile-judgment.md)
25
- - [Semantic judgment](semantic-judgment.md)
26
- - [Disposition semantics](disposition-semantics.md)
27
- - [Temporal evidence](temporal-and-evidence.md)
28
- - [Leakage and ownership](leakage-and-ownership.md)
29
- - [Scope review and omission](scope-review-and-omit.md)
30
- - [User confirmation](user-confirmation.md)
31
- - [Close gate](close-gate.md)
@@ -1,6 +0,0 @@
1
- schema: agent-graph.resource.v1
2
- id: context.code-index-audit
3
- kind: context-view
4
- mediaType: text/markdown
5
- description: Current code-index content-depth, evidence-scope, relationship, source-coverage signals, and prior Agent decisions.
6
- materializer: actions/materialize-context-view.yaml
@@ -1,6 +0,0 @@
1
- schema: agent-graph.resource.v1
2
- id: context.document-optimization-current
3
- kind: context-view
4
- mediaType: text/markdown
5
- description: Current document revision status and pending batch size.
6
- materializer: actions/materialize-context-view.yaml
@@ -1,6 +0,0 @@
1
- schema: agent-graph.resource.v1
2
- id: context.extraction-preview
3
- kind: context-view
4
- mediaType: text/markdown
5
- description: Current batch code-extraction scale, output profile, ownership, structural probe coverage, and capability report.
6
- materializer: actions/materialize-context-view.yaml
@@ -1,6 +0,0 @@
1
- schema: agent-graph.resource.v1
2
- id: context.structure-current
3
- kind: context-view
4
- mediaType: text/markdown
5
- description: Current multi-document structure slots, declarations, and compile batch.
6
- materializer: actions/materialize-context-view.yaml