@c4a/context-cli 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 (273) hide show
  1. package/README.md +67 -6
  2. package/README.zh-CN.md +42 -5
  3. package/cli.js +75051 -42154
  4. package/indexers/bundles/context-code-indexer/SKILL.md +20 -0
  5. package/indexers/bundles/context-code-indexer/context-indexer.yaml +230 -0
  6. package/indexers/bundles/context-code-indexer/references/composers/contracts-and-chains.md +23 -0
  7. package/indexers/bundles/context-code-indexer/references/composers/cross-module-chain.md +22 -0
  8. package/indexers/bundles/context-code-indexer/references/composers/development-and-delivery.md +22 -0
  9. package/indexers/bundles/context-code-indexer/references/composers/event-flow.md +21 -0
  10. package/indexers/bundles/context-code-indexer/references/composers/examples-and-documentation.md +22 -0
  11. package/indexers/bundles/context-code-indexer/references/composers/persistence-boundary.md +21 -0
  12. package/indexers/bundles/context-code-indexer/references/composers/protocol-boundary.md +22 -0
  13. package/indexers/bundles/context-code-indexer/references/composers/public-contract.md +23 -0
  14. package/indexers/bundles/context-code-indexer/references/indexer.md +49 -0
  15. package/indexers/bundles/context-code-indexer/references/metrics.md +201 -0
  16. package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +119 -0
  17. package/indexers/bundles/context-code-indexer/templates/api-service.md +118 -0
  18. package/indexers/bundles/context-code-indexer/templates/background-runtime.md +109 -0
  19. package/indexers/bundles/context-code-indexer/templates/cli-tool.md +129 -0
  20. package/indexers/bundles/context-code-indexer/templates/component-library.md +99 -0
  21. package/indexers/bundles/context-code-indexer/templates/contract-source.md +73 -0
  22. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +77 -0
  23. package/indexers/bundles/context-code-indexer/templates/derived-generated-source.md +117 -0
  24. package/indexers/bundles/context-code-indexer/templates/domain-service.md +109 -0
  25. package/indexers/bundles/context-code-indexer/templates/event-consumer.md +62 -0
  26. package/indexers/bundles/context-code-indexer/templates/gateway-facade.md +89 -0
  27. package/indexers/bundles/context-code-indexer/templates/monorepo-container.md +124 -0
  28. package/indexers/bundles/context-code-indexer/templates/plugin-extension.md +52 -0
  29. package/indexers/bundles/context-code-indexer/templates/sdk-library.md +132 -0
  30. package/indexers/bundles/context-code-indexer/templates/storage-repository.md +56 -0
  31. package/indexers/bundles/context-code-indexer/templates/web-application.md +146 -0
  32. package/indexers/bundles/context-code-indexer/tests/fixtures/chapters.json +226 -0
  33. package/indexers/bundles/context-code-indexer/tests/fixtures/composers.json +82 -0
  34. package/indexers/bundles/context-code-indexer/tests/fixtures/profiles.json +210 -0
  35. package/indexers/bundles/context-code-indexer/tests/fixtures/scenarios.json +122 -0
  36. package/indexers/bundles/context-markdown-indexer/SKILL.md +20 -0
  37. package/indexers/bundles/context-markdown-indexer/context-indexer.yaml +147 -0
  38. package/indexers/bundles/context-markdown-indexer/references/classification.md +63 -0
  39. package/indexers/bundles/context-markdown-indexer/references/editorial-policy.md +106 -0
  40. package/indexers/bundles/context-markdown-indexer/references/indexer.md +23 -0
  41. package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +146 -0
  42. package/indexers/bundles/context-markdown-indexer/references/structure-and-artifacts.md +109 -0
  43. package/indexers/bundles/context-markdown-indexer/tests/fixtures/anonymous.json +31 -0
  44. package/indexers/bundles/context-markdown-indexer/tests/fixtures/editorial.json +309 -0
  45. package/indexers/bundles/context-markdown-indexer/tests/fixtures/migration-equivalence.json +186 -0
  46. package/indexers/bundles/context-markdown-indexer/tests/fixtures/profiles.json +171 -0
  47. package/indexers/bundles/context-markdown-indexer/tests/fixtures/routing.json +151 -0
  48. package/indexers/capability-manifest.json +40 -0
  49. package/indexers/contracts/hard-rule-conformance.json +2644 -0
  50. package/indexers/contracts/operator-contract.json +35 -0
  51. package/indexers/contracts/profile-contract.json +10162 -0
  52. package/indexers/release-manifest.json +208 -0
  53. package/package.json +5 -4
  54. package/plugins/README.md +17 -109
  55. package/plugins/README_CN.md +11 -89
  56. package/plugins/VERSION +1 -1
  57. package/plugins/claude/.claude-plugin/plugin.json +3 -11
  58. package/plugins/claude/CLAUDE.md +1 -1
  59. package/plugins/claude/README.md +1 -1
  60. package/plugins/claude/commands/context.md +76 -1
  61. package/plugins/codex/.codex-plugin/plugin.json +6 -17
  62. package/plugins/codex/AGENTS.md +1 -1
  63. package/plugins/codex/README.md +1 -1
  64. package/plugins/codex/skills/context/SKILL.md +77 -13
  65. package/plugins/cursor/.cursor-plugin/plugin.json +4 -17
  66. package/plugins/cursor/AGENTS.md +1 -1
  67. package/plugins/cursor/README.md +3 -2
  68. package/plugins/cursor/commands/c4a-context.md +76 -3
  69. package/plugins/skills/{c4a-context → context}/SKILL.md +78 -14
  70. package/plugins/skills/context-code-indexer/SKILL.md +20 -0
  71. package/plugins/skills/context-code-indexer/context-indexer.yaml +230 -0
  72. package/plugins/skills/context-code-indexer/references/composers/contracts-and-chains.md +23 -0
  73. package/plugins/skills/context-code-indexer/references/composers/cross-module-chain.md +22 -0
  74. package/plugins/skills/context-code-indexer/references/composers/development-and-delivery.md +22 -0
  75. package/plugins/skills/context-code-indexer/references/composers/event-flow.md +21 -0
  76. package/plugins/skills/context-code-indexer/references/composers/examples-and-documentation.md +22 -0
  77. package/plugins/skills/context-code-indexer/references/composers/persistence-boundary.md +21 -0
  78. package/plugins/skills/context-code-indexer/references/composers/protocol-boundary.md +22 -0
  79. package/plugins/skills/context-code-indexer/references/composers/public-contract.md +23 -0
  80. package/plugins/skills/context-code-indexer/references/indexer.md +49 -0
  81. package/plugins/skills/context-code-indexer/references/metrics.md +201 -0
  82. package/plugins/skills/context-code-indexer/templates/adapter-integration.md +119 -0
  83. package/plugins/skills/context-code-indexer/templates/api-service.md +118 -0
  84. package/plugins/skills/context-code-indexer/templates/background-runtime.md +109 -0
  85. package/plugins/skills/context-code-indexer/templates/cli-tool.md +129 -0
  86. package/plugins/skills/context-code-indexer/templates/component-library.md +99 -0
  87. package/plugins/skills/context-code-indexer/templates/contract-source.md +73 -0
  88. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +77 -0
  89. package/plugins/skills/context-code-indexer/templates/derived-generated-source.md +117 -0
  90. package/plugins/skills/context-code-indexer/templates/domain-service.md +109 -0
  91. package/plugins/skills/context-code-indexer/templates/event-consumer.md +62 -0
  92. package/plugins/skills/context-code-indexer/templates/gateway-facade.md +89 -0
  93. package/plugins/skills/context-code-indexer/templates/monorepo-container.md +124 -0
  94. package/plugins/skills/context-code-indexer/templates/plugin-extension.md +52 -0
  95. package/plugins/skills/context-code-indexer/templates/sdk-library.md +132 -0
  96. package/plugins/skills/context-code-indexer/templates/storage-repository.md +56 -0
  97. package/plugins/skills/context-code-indexer/templates/web-application.md +146 -0
  98. package/plugins/skills/context-code-indexer/tests/fixtures/chapters.json +226 -0
  99. package/plugins/skills/context-code-indexer/tests/fixtures/composers.json +82 -0
  100. package/plugins/skills/context-code-indexer/tests/fixtures/profiles.json +210 -0
  101. package/plugins/skills/context-code-indexer/tests/fixtures/scenarios.json +122 -0
  102. package/plugins/skills/context-markdown-indexer/SKILL.md +20 -0
  103. package/plugins/skills/context-markdown-indexer/context-indexer.yaml +147 -0
  104. package/plugins/skills/context-markdown-indexer/references/classification.md +63 -0
  105. package/plugins/skills/context-markdown-indexer/references/editorial-policy.md +106 -0
  106. package/plugins/skills/context-markdown-indexer/references/indexer.md +23 -0
  107. package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +146 -0
  108. package/plugins/skills/context-markdown-indexer/references/structure-and-artifacts.md +109 -0
  109. package/plugins/skills/context-markdown-indexer/tests/fixtures/anonymous.json +31 -0
  110. package/plugins/skills/context-markdown-indexer/tests/fixtures/editorial.json +309 -0
  111. package/plugins/skills/context-markdown-indexer/tests/fixtures/migration-equivalence.json +186 -0
  112. package/plugins/skills/context-markdown-indexer/tests/fixtures/profiles.json +171 -0
  113. package/plugins/skills/context-markdown-indexer/tests/fixtures/routing.json +151 -0
  114. package/providers/context/actions/accept-main-index-run.yaml +7 -0
  115. package/providers/context/actions/accept-material-answer-run.yaml +7 -0
  116. package/providers/context/actions/accept-post-author-composer-run.yaml +7 -0
  117. package/providers/context/actions/actualize-material-answer-bindings.yaml +8 -0
  118. package/providers/context/actions/apply-document-optimization-guidance.yaml +5 -0
  119. package/providers/context/actions/apply-indexer-project.yaml +7 -0
  120. package/providers/context/actions/audit-material-gap-state.yaml +8 -0
  121. package/providers/context/actions/audit-projected-artifact-fan-out.yaml +8 -0
  122. package/providers/context/actions/authorize-indexer-contract-overlay.yaml +7 -0
  123. package/providers/context/actions/authorize-indexer-dependencies.yaml +7 -0
  124. package/providers/context/actions/authorize-indexer-program-execution.yaml +7 -0
  125. package/providers/context/actions/build-main-index-author-worksets.yaml +7 -0
  126. package/providers/context/actions/build-main-index-catalog-fallback.yaml +7 -0
  127. package/providers/context/actions/build-main-index-partition-worksets.yaml +7 -0
  128. package/providers/context/actions/build-material-question-workset.yaml +7 -0
  129. package/providers/context/actions/build-post-author-composer-worksets.yaml +7 -0
  130. package/providers/context/actions/build-question-target-inventory.yaml +7 -0
  131. package/providers/context/actions/build-subject-catalog.yaml +7 -0
  132. package/providers/context/actions/build-target-resolution-views.yaml +7 -0
  133. package/providers/context/actions/checkpoint-material-answer-review.yaml +8 -0
  134. package/providers/context/actions/checkpoint-material-gaps.yaml +8 -0
  135. package/providers/context/actions/close-indexer-approved-knowledge.yaml +8 -0
  136. package/providers/context/actions/compile-indexer-candidates.yaml +8 -0
  137. package/providers/context/actions/compose-indexer-post-author-fragments.yaml +7 -0
  138. package/providers/context/actions/configure-community-indexer-fallback.yaml +6 -0
  139. package/providers/context/actions/configure-indexer-providers.yaml +6 -0
  140. package/providers/context/actions/confirm-index-requirement-workset.yaml +8 -0
  141. package/providers/context/actions/confirm-subject-reidentification.yaml +8 -0
  142. package/providers/context/actions/converge-main-index-partition-run.yaml +7 -0
  143. package/providers/context/actions/discover-markdown-indexer-providers.yaml +6 -0
  144. package/providers/context/actions/evaluate-material-gaps.yaml +8 -0
  145. package/providers/context/actions/fail-main-index-run.yaml +7 -0
  146. package/providers/context/actions/fail-material-answer-run.yaml +7 -0
  147. package/providers/context/actions/fail-post-author-composer-run.yaml +7 -0
  148. package/providers/context/actions/inspect-index-candidate-review-readiness.yaml +8 -0
  149. package/providers/context/actions/inspect-index-profile-failure.yaml +7 -0
  150. package/providers/context/actions/inspect-indexer-dependencies.yaml +7 -0
  151. package/providers/context/actions/inspect-indexer-program-execution.yaml +7 -0
  152. package/providers/context/actions/inspect-indexer-project-proposal.yaml +7 -0
  153. package/providers/context/actions/inspect-markdown-provider-capture.yaml +7 -0
  154. package/providers/context/actions/inspect-material-answer-review.yaml +8 -0
  155. package/providers/context/actions/materialize-indexer-instructions.yaml +7 -0
  156. package/providers/context/actions/observe-indexer-project.yaml +7 -0
  157. package/providers/context/actions/observe-main-index-run-ledger.yaml +7 -0
  158. package/providers/context/actions/observe-material-answer-runs.yaml +7 -0
  159. package/providers/context/actions/observe-post-author-composer-worksets.yaml +7 -0
  160. package/providers/context/actions/override-index-profile-audit.yaml +7 -0
  161. package/providers/context/actions/prepare-indexer-customization-project.yaml +7 -0
  162. package/providers/context/actions/prepare-main-index-run-ledger.yaml +7 -0
  163. package/providers/context/actions/prepare-material-answer-runs.yaml +7 -0
  164. package/providers/context/actions/propose-indexer-customization.yaml +7 -0
  165. package/providers/context/actions/propose-overlay-question-amendment.yaml +7 -0
  166. package/providers/context/actions/rebind-indexer-selection-to-requirement.yaml +7 -0
  167. package/providers/context/actions/reconcile-indexer-results.yaml +7 -0
  168. package/providers/context/actions/record-index-profile-revision.yaml +7 -0
  169. package/providers/context/actions/report-index-profile-failure.yaml +7 -0
  170. package/providers/context/actions/report-indexer-incremental-impact.yaml +8 -0
  171. package/providers/context/actions/resolve-effective-composers.yaml +7 -0
  172. package/providers/context/actions/review-material-answer-candidate.yaml +8 -0
  173. package/providers/context/actions/revise-index-output.yaml +7 -0
  174. package/providers/context/actions/route-index-requirement-confirmation.yaml +8 -0
  175. package/providers/context/actions/route-indexer-provider-selection.yaml +7 -0
  176. package/providers/context/actions/run-indexer-agent-step.yaml +7 -0
  177. package/providers/context/actions/run-indexer-post-author-composer.yaml +7 -0
  178. package/providers/context/actions/run-material-answer-indexers.yaml +7 -0
  179. package/providers/context/actions/start-main-index-run.yaml +7 -0
  180. package/providers/context/actions/start-material-answer-run.yaml +7 -0
  181. package/providers/context/actions/start-post-author-composer-run.yaml +7 -0
  182. package/providers/context/actions/validate-indexer-contract-overlays.yaml +7 -0
  183. package/providers/context/actions/validate-indexer-customization.yaml +7 -0
  184. package/providers/context/actions/validate-indexer-selection-proposal.yaml +7 -0
  185. package/providers/context/actions/validate-main-index-run.yaml +7 -0
  186. package/providers/context/actions/validate-markdown-provider-selection.yaml +7 -0
  187. package/providers/context/actions/validate-subject-key-schemas.yaml +8 -0
  188. package/providers/context/codes.yaml +70 -0
  189. package/providers/context/graphs/indexer.yaml +1068 -0
  190. package/providers/context/graphs/workspace.yaml +20 -1
  191. package/providers/context/manifest.json +1433 -121
  192. package/providers/context/provider.yaml +3 -2
  193. package/providers/context/resources/manuals/reference/code-extractors.md +2 -2
  194. package/providers/context/resources/manuals/reference/project-api.md +2 -2
  195. package/providers/context/resources/procedures/code-extraction.md +6 -2
  196. package/providers/context/resources/procedures/code-index-audit.md +36 -6
  197. package/providers/context/resources/procedures/document-optimization.md +23 -4
  198. package/providers/context/resources/semantic/code-index/templates/adapter.md +9 -0
  199. package/providers/context/resources/semantic/code-index/templates/contracts-and-chains.md +81 -0
  200. package/providers/context/resources/views/resolved-indexer-instructions.yaml +23 -0
  201. package/providers/context/schemas/document-optimization-decisions.schema.json +1 -1
  202. package/providers/context/schemas/indexer-agent-step-input.schema.json +30 -0
  203. package/providers/context/schemas/indexer-agent-step-result.schema.json +47 -0
  204. package/providers/context/schemas/indexer-candidate-compile-input.schema.json +57 -0
  205. package/providers/context/schemas/indexer-candidate-compile-output.schema.json +38 -0
  206. package/providers/context/schemas/indexer-candidate-review-readiness-input.schema.json +46 -0
  207. package/providers/context/schemas/indexer-candidate-review-readiness-output.schema.json +104 -0
  208. package/providers/context/schemas/indexer-contract-overlay-authorization-input.schema.json +32 -0
  209. package/providers/context/schemas/indexer-contract-overlay-authorization-result.schema.json +121 -0
  210. package/providers/context/schemas/indexer-contract-overlay-validation-input.schema.json +90 -0
  211. package/providers/context/schemas/indexer-contract-overlay-validation-result.schema.json +158 -0
  212. package/providers/context/schemas/indexer-customization-project-preparation-result.schema.json +44 -0
  213. package/providers/context/schemas/indexer-customization-proposal-draft.schema.json +83 -0
  214. package/providers/context/schemas/indexer-customization-validation-result.schema.json +36 -0
  215. package/providers/context/schemas/indexer-dependency-authorization-input.schema.json +71 -0
  216. package/providers/context/schemas/indexer-dependency-authorization-result.schema.json +138 -0
  217. package/providers/context/schemas/indexer-incremental-impact-input.schema.json +31 -0
  218. package/providers/context/schemas/indexer-incremental-impact-output.schema.json +52 -0
  219. package/providers/context/schemas/indexer-main-lifecycle-input.schema.json +187 -0
  220. package/providers/context/schemas/indexer-main-lifecycle-output.schema.json +180 -0
  221. package/providers/context/schemas/indexer-markdown-provider-capture-input.schema.json +17 -0
  222. package/providers/context/schemas/indexer-markdown-provider-capture-output.schema.json +54 -0
  223. package/providers/context/schemas/indexer-markdown-provider-validation-input.schema.json +34 -0
  224. package/providers/context/schemas/indexer-markdown-provider-validation-output.schema.json +75 -0
  225. package/providers/context/schemas/indexer-material-answer-lifecycle-input.schema.json +90 -0
  226. package/providers/context/schemas/indexer-material-answer-lifecycle-output.schema.json +80 -0
  227. package/providers/context/schemas/indexer-material-answer-review-inspection-input.schema.json +32 -0
  228. package/providers/context/schemas/indexer-material-answer-review-inspection-output.schema.json +32 -0
  229. package/providers/context/schemas/indexer-material-answer-review-resolution-input.schema.json +19 -0
  230. package/providers/context/schemas/indexer-material-answer-review-resolution-output.schema.json +87 -0
  231. package/providers/context/schemas/indexer-material-gap-lifecycle-input.schema.json +86 -0
  232. package/providers/context/schemas/indexer-material-gap-lifecycle-output.schema.json +19 -0
  233. package/providers/context/schemas/indexer-materialize-request.schema.json +53 -0
  234. package/providers/context/schemas/indexer-materialized-resource.schema.json +57 -0
  235. package/providers/context/schemas/indexer-overlay-question-amendment.schema.json +13 -0
  236. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +40 -0
  237. package/providers/context/schemas/indexer-overlay-question-rebind-input.schema.json +35 -0
  238. package/providers/context/schemas/indexer-overlay-question-rebind-result.schema.json +25 -0
  239. package/providers/context/schemas/indexer-post-author-fragment-request.schema.json +26 -0
  240. package/providers/context/schemas/indexer-post-author-fragment-result.schema.json +18 -0
  241. package/providers/context/schemas/indexer-post-author-lifecycle-input.schema.json +94 -0
  242. package/providers/context/schemas/indexer-post-author-lifecycle-output.schema.json +72 -0
  243. package/providers/context/schemas/indexer-profile-failure-inspection-input.schema.json +13 -0
  244. package/providers/context/schemas/indexer-profile-failure-inspection-result.schema.json +19 -0
  245. package/providers/context/schemas/indexer-profile-failure-report-input.schema.json +22 -0
  246. package/providers/context/schemas/indexer-profile-failure-report-result.schema.json +49 -0
  247. package/providers/context/schemas/indexer-profile-override-decision.schema.json +20 -0
  248. package/providers/context/schemas/indexer-profile-override-result.schema.json +49 -0
  249. package/providers/context/schemas/indexer-profile-revision-agent-input.schema.json +18 -0
  250. package/providers/context/schemas/indexer-profile-revision-record-input.schema.json +31 -0
  251. package/providers/context/schemas/indexer-profile-revision-record-result.schema.json +45 -0
  252. package/providers/context/schemas/indexer-program-execution-authorization-input.schema.json +145 -0
  253. package/providers/context/schemas/indexer-program-execution-authorization-result.schema.json +60 -0
  254. package/providers/context/schemas/indexer-project-action-result.schema.json +19 -0
  255. package/providers/context/schemas/indexer-project-gate-input.schema.json +100 -0
  256. package/providers/context/schemas/indexer-project-observation-input.schema.json +16 -0
  257. package/providers/context/schemas/indexer-project-observation-result.schema.json +42 -0
  258. package/providers/context/schemas/indexer-provider-route-input.schema.json +55 -0
  259. package/providers/context/schemas/indexer-provider-route-report.schema.json +188 -0
  260. package/providers/context/schemas/indexer-requirement-confirmation-input.schema.json +27 -0
  261. package/providers/context/schemas/indexer-requirement-confirmation-output.schema.json +24 -0
  262. package/providers/context/schemas/indexer-result-reconciliation-input.schema.json +59 -0
  263. package/providers/context/schemas/indexer-result-reconciliation-output.schema.json +43 -0
  264. package/providers/context/schemas/indexer-selection-proposal-input.schema.json +12 -0
  265. package/providers/context/schemas/indexer-selection-proposal-validation.schema.json +23 -0
  266. package/providers/context/schemas/indexer-subject-reidentification-input.schema.json +37 -0
  267. package/providers/context/schemas/indexer-subject-reidentification-output.schema.json +31 -0
  268. package/providers/context/skills/configure-indexer-providers/SKILL.md +58 -0
  269. package/providers/context/skills/prepare-indexer-customization-project/SKILL.md +31 -0
  270. package/providers/context/skills/propose-indexer-customization/SKILL.md +40 -0
  271. package/providers/context/skills/revise-index-output/SKILL.md +12 -0
  272. package/providers/context/skills/run-indexer-agent-step/SKILL.md +20 -0
  273. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +21 -0
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: context.code-indexer.composer.development-and-delivery
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Development and delivery composer
8
+
9
+ Run only for an effective `development-and-delivery` workset. It supplements
10
+ the primary target and cannot own repository scope, release authority, or the
11
+ final Indexer Result.
12
+
13
+ Require an evidenced `development-entry` fact and primary `content` Artifact.
14
+ Propose derived `content` only for module-owned setup, build, test, packaging,
15
+ deployment, release, rollback, or recovery behavior that answers a stable
16
+ reader question. Distinguish local commands from CI orchestration and record
17
+ configuration inputs without copying secret-like values.
18
+
19
+ Use the existing Node, `standard` policy, and view evidence. Workspace-wide
20
+ processes belong on a container target, not every module. If the required input
21
+ is absent or the view contains no module-owned development/delivery contract,
22
+ return `fragments: []` in the ordinary structured result.
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: context.code-indexer.composer.event-flow
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Event flow composer
8
+
9
+ Run only from an effective `event-flow` workset. The supplied primary view is
10
+ the complete authority boundary for this invocation.
11
+
12
+ Require an evidenced `event-binding` fact and primary `content` Artifact.
13
+ Propose derived `content` only when a stable event identity connects producer,
14
+ transport or dispatch, consumer, state effect, retry/idempotency behavior, and
15
+ failure handling. Timers and scheduled triggers qualify only when their
16
+ registration and downstream behavior are explicit.
17
+
18
+ Keep the current target Node, use `standard`, and cite view evidence. Do not
19
+ invent a producer from a consumer name or infer delivery guarantees from a
20
+ library default. Missing requirements, an unpaired boundary, or no additional
21
+ reader value must return the normal result envelope with `fragments: []`.
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: context.code-indexer.composer.examples-and-documentation
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Examples and documentation composer
8
+
9
+ Run only when selected for the current profile. The workset-scoped primary
10
+ view is the sole input; documentation files outside that view are not implicit
11
+ authority.
12
+
13
+ Require an evidenced `example-candidate` fact and primary `content` Artifact.
14
+ Propose an `examples` Artifact only for maintained usage that demonstrates a
15
+ supported public target, meaningful setup, expected outcome, and important
16
+ constraints. Merge scenario variants and exclude fixtures, generated samples,
17
+ and demos that do not represent supported use.
18
+
19
+ Use the existing target Node and `standard` policy. Evidence must come from the
20
+ view. When no representative example closes the reader question, or either
21
+ required input is missing, return the structured empty fragment-set result;
22
+ never invent tutorial steps.
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: context.code-indexer.composer.persistence-boundary
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Persistence boundary composer
8
+
9
+ Run only for an effective `persistence-boundary` selection. Consume the exact
10
+ `PrimaryResultView` and keep all proposals subordinate to its Node and Result.
11
+
12
+ Require an evidenced `persistence-binding` fact and primary `content`
13
+ Artifact. Derived `content` may connect the domain operation to repository or
14
+ store, model/schema authority, transaction or consistency boundary, caching,
15
+ migration, failure, and recovery. Separate authoritative schema sources from
16
+ generated models and runtime observations.
17
+
18
+ Use `standard` and existing evidence. Do not infer storage semantics from a
19
+ driver dependency or method name. If the binding, required Artifact, or a
20
+ source-backed persistence question is absent, return a valid empty fragment
21
+ set rather than reading outside the workset.
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: context.code-indexer.composer.protocol-boundary
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Protocol boundary composer
8
+
9
+ Run only for an effective `protocol-boundary` composer workset and consume its
10
+ exact `PrimaryResultView`. Never discover new scope or claim final Result
11
+ authority.
12
+
13
+ Require an evidenced `protocol-operation` fact and a primary `contract`
14
+ Artifact. A derived `contract` proposal may connect a stable operation identity
15
+ to transport, request/response or message shapes, provider and consumer,
16
+ errors, compatibility, and authoritative schema evidence. Keep generated
17
+ clients and bindings pointed at their source contract.
18
+
19
+ Use the existing target Node and `standard` policy. Do not infer operations
20
+ from names or import adjacency. If the required fact/Artifact is missing, the
21
+ provider/consumer pairing is ambiguous, or the primary contract already
22
+ answers the reader question, return a valid result with `fragments: []`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ id: context.code-indexer.composer.public-contract
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Public contract composer
8
+
9
+ Run only for an effective `public-contract` composer workset. Consume the
10
+ workset-scoped `PrimaryResultView`; do not inspect a broader repository or
11
+ replace the primary Result.
12
+
13
+ Require an evidenced `public-surface` fact and its owning primary `content`
14
+ Artifact. Propose a `contract` Artifact only when the view establishes stable
15
+ consumer identities, entrypoints, behavior, constraints, and evidence. Group
16
+ related exports, commands, routes, or extension points by the public concept a
17
+ consumer uses; do not enumerate incidental symbols.
18
+
19
+ Every proposal must retain the existing target Node, use the `standard`
20
+ Artifact policy variant, and cite evidence already present in the view. Return
21
+ only a post-author `derived-artifact-proposal` fragment. If either required
22
+ input is absent or no independent reader question is supported, return the
23
+ normal layer-fragment result with `fragments: []`.
@@ -0,0 +1,49 @@
1
+ # Code Indexer authoring contract
2
+
3
+ Consume only the current workset, normalized parser facts, verified layer input, and scoped evidence views supplied by Context.
4
+
5
+ ## Classify before selecting templates
6
+
7
+ Classify each requested module from current manifests, stable entries, public contracts, runtime registration, maintained documentation, and source-backed boundary evidence. Select one primary profile and only the additional profiles supplied by the current workset. A directory name, framework dependency, class suffix, or generated file is not sufficient classification evidence.
8
+
9
+ Read only the templates materialized for the selected profiles. Combine their questions into one deduplicated plan for the reader-visible capability; a template is guidance, not a source of facts, page counts, output paths, thresholds, or authority. Keep a repository container, public contract, runtime boundary, event flow, persistence boundary, adapter, generated-source provenance, and cross-module handoff separate when they answer different reader questions. Do not copy a template outline when source evidence does not support its sections.
10
+
11
+ ## Partition and identity
12
+
13
+ For partition work, close every inventory member as owned, excluded, or unsupported and use stable semantic subjects. Each member has exactly one primary owner; extension layers may enrich but cannot claim final authority. Do not create ordinal batches or infer identity from display titles, filenames, headings, or traversal order. If no defensible semantic grouping exists, return the protocol failure that permits the CLI-owned catalog fallback.
14
+
15
+ Use only the ordered partition strategy materialized by Context for the current workset. The order is project-first and authority-bound; do not skip to a CLI builtin, substitute another strategy id, or recalculate an implementation digest. A strategy may group only the canonical members and profiles supplied with that workset.
16
+
17
+ Group related identities by a capability, entrypoint, protocol boundary, lifecycle stage, state owner, or handoff. A granular catalog is appropriate only when the selected profile and reader goal require a public API, protocol, command, or registry reference. A cross-module chain requires an explicit trigger, source-backed joins on both sides of every boundary, transformations or state handoffs, and a terminal outcome; imports or similar names do not prove execution order.
18
+
19
+ Create a reader target only from a CLI-supplied declaration, public export, contract declaration, runtime registration, approved Subject, or Partition Subject identity. Import/re-export aliases, ordinary references, internal helpers, and lightweight evidence may enrich their canonical owner but cannot independently authorize a target. Normalize aliases into the supplied canonical identity. Never promote a name merely because it appears in prose or has many inbound references.
20
+
21
+ ## Author Result and evidence
22
+
23
+ For author work, produce exactly one Result for the supplied logical unit. Keep deterministic catalogs separate from explanatory prose, bind every declaration and Section to current evidence, and select only an Artifact policy variant listed in the workset. Missing material must become a canonical question disposition; never invent an answer or emit placeholder knowledge.
24
+
25
+ Treat the CLI inventory as the complete denominator, not a sample. Parser facts may prove files, declarations, entries, contracts, and relationships; they do not by themselves prove business meaning, runtime defaults, failure behavior, or ownership. Every relationship must cite the concrete evidence for its own handoff. Do not repeat one whole-page evidence set across unrelated facts, and do not reduce a multi-source fact to one arbitrary primary file.
26
+
27
+ Close every CLI-supplied example candidate with exactly one decision: link it to its public target, merge it into a canonical example for the same target and scenario, retain it as a documentation example, exclude it with a reason, or request missing material. A retained representative must decide setup, key calls, parameters, and expected behavior as either extracted facts or evidence-backed not-applicable facets. Merge only by the full example identity supplied by Context; filenames and basenames are not identities. Do not omit an unresolved candidate from the decision set, and do not treat a material request as completed linkage.
28
+
29
+ Explain stable responsibility, inputs, outputs, state and failure boundaries, the next handoff, and the evidence that supports each claim. Keep implementation bodies, generated payloads, exhaustive internal helper lists, and normalized template repetition out of reader prose. Empty Results are valid only when every target receives a legal disposition.
30
+
31
+ ## Post-author composer result
32
+
33
+ For a post-author workset, use only the effective composer named by Context and the matching composer instruction materialized beside this contract. Consume the complete workset-scoped `PrimaryResultView`; do not reopen discovery, expand scope, change Subject identity or ownership, or return another complete main Result. A composer may emit only the declared `derived-artifact-proposal` kind and Artifact policy.
34
+
35
+ If a declared primary fact or Artifact requirement is absent, or the view does not support an independent reader question, return the ordinary `context.indexer.layer-fragment-result/v1` with `fragments: []` and the exact consumed view digest. This is a successful structured empty invocation, not a license to inspect temporary files or infer missing content.
36
+
37
+ ## Mechanical audit and revision
38
+
39
+ Context independently validates inventory closure, owner closure, parser coverage, Artifact completeness, evidence scope, relationship candidates, semantic density, template repetition, enumeration, and implementation-body limits. These dimensions are independent; one strong dimension cannot offset a hard failure in another. Do not alter wording, Markdown syntax, sentence counts, or partitions solely to influence a counter.
40
+
41
+ For a failed metric, follow the matching entry in `references/metrics.md`. Each entry explains the denominator-preserving repair, a positive example, and an anti-example. It deliberately contains no numeric threshold: use the current CLI audit for actual, recommended, and hard values.
42
+
43
+ The reference-only reader-target metric is a zero-count hard gate. Context joins the proposed reader-target projection to its own current identity observations and separately rejects targets with no identity observation at all. Provider prose, display titles, filenames, inbound-reference counts, and self-reported target authority cannot satisfy this gate.
44
+
45
+ Context recomputes example candidate decision coverage over the complete example inventory. Representative coverage and public-target linkage keep undecided and material-request candidates in their denominator, while only a confirmed exclusion removes a candidate. A scenario variant inherits coverage only when its canonical decision chain terminates at a retained representative; it inherits public-target linkage only when that terminal decision links the exact public target.
46
+
47
+ When the current audit reports a repairable profile failure, revise the complete affected logical-unit set and return a new Result under the same stable problem lineage. Use the reported uncovered identities, failed metric ids, evidence locators, and legal actions. Request material only when reliable correction requires a source, contract, protocol, or access boundary absent from the registered scope. Three failed revisions produce one complete human report; only the explicit non-delegable profile-risk Gate may accept that runtime profile risk, and no baseline integrity failure is bypassable.
48
+
49
+ Do not return output paths, collection names, quality thresholds, pass/fail decisions, extra owners, ad hoc question contracts, or facts outside the supplied authority. Context validates structure, evidence, layout, metrics, freshness, reconciliation, and final Review independently.
@@ -0,0 +1,201 @@
1
+ # Profile metric revision guide
2
+
3
+ Use the current CLI audit as the sole source of actual, recommended, and hard values. This guide explains how to revise a Result; it does not define thresholds or authorize changing a denominator.
4
+
5
+ ## inventory-disposition-coverage
6
+
7
+ ### Meaning
8
+
9
+ Every identity in the CLI inventory needs an owned, excluded, or unsupported disposition.
10
+
11
+ ### Revise
12
+
13
+ Return decisions for the reported missing identities, preserving the complete inventory denominator and citing the evidence behind exclusions or unsupported cases.
14
+
15
+ ### Positive example
16
+
17
+ An internal generated file is retained in the inventory and marked excluded with its generated-source evidence.
18
+
19
+ ### Anti-example
20
+
21
+ The Result omits files that did not fit the selected template.
22
+
23
+ ## duplicated-fact-target-ratio
24
+
25
+ ### Meaning
26
+
27
+ The same reader fact should have one canonical target rather than competing copies across Artifacts.
28
+
29
+ ### Revise
30
+
31
+ Choose the canonical owner, replace other copies with explicit relationships, and keep evidence on the owning fact.
32
+
33
+ ### Positive example
34
+
35
+ One contract Artifact owns the request semantics while the overview links to it.
36
+
37
+ ### Anti-example
38
+
39
+ Several pages repeat the same behavior paragraph with different headings.
40
+
41
+ ## narrative-enumeration-ratio
42
+
43
+ ### Meaning
44
+
45
+ Reader prose should explain capabilities and boundaries instead of restating a deterministic inventory as sentences.
46
+
47
+ ### Revise
48
+
49
+ Move exhaustive identities into the deterministic catalog, group related items by a reader question, and explain responsibility, differences, and handoffs.
50
+
51
+ ### Positive example
52
+
53
+ A capability section explains dispatch choices and links to a complete generated route catalog.
54
+
55
+ ### Anti-example
56
+
57
+ The page turns every discovered symbol into an “observed” bullet.
58
+
59
+ ## normalized-template-repetition-ratio
60
+
61
+ ### Meaning
62
+
63
+ Repeated sentence frames with only identity substitutions indicate template residue rather than evidence-specific explanation.
64
+
65
+ ### Revise
66
+
67
+ Merge repeated observations, describe the shared rule once, and record meaningful exceptions with their own evidence.
68
+
69
+ ### Positive example
70
+
71
+ A family section states the common lifecycle and separately explains the exceptional member.
72
+
73
+ ### Anti-example
74
+
75
+ Every member receives the same sentence with only its name changed.
76
+
77
+ ## implementation-body-ratio
78
+
79
+ ### Meaning
80
+
81
+ Reader knowledge should describe stable behavior without copying implementation bodies, generated payloads, or declaration dumps.
82
+
83
+ ### Revise
84
+
85
+ Replace copied code with an evidence-bound behavioral statement and retain only a small excerpt when it is necessary to explain a contract or failure boundary.
86
+
87
+ ### Positive example
88
+
89
+ The page explains the validation and rollback sequence and links to the exact implementation locator.
90
+
91
+ ### Anti-example
92
+
93
+ The page embeds the complete function or generated type file as its main content.
94
+
95
+ ## reference-only-reader-targets
96
+
97
+ ### Meaning
98
+
99
+ A reader target requires a CLI-authorized declaration, registration, public contract, approved Subject, or Partition Subject identity.
100
+
101
+ ### Revise
102
+
103
+ Merge aliases and ordinary references into their canonical owner, or remove the target when no authorized identity observation exists.
104
+
105
+ ### Positive example
106
+
107
+ A re-export alias points to the canonical public target instead of creating another page.
108
+
109
+ ### Anti-example
110
+
111
+ A frequently imported helper becomes a target solely because it has many references.
112
+
113
+ ## unresolved-ordinal-partitions
114
+
115
+ ### Meaning
116
+
117
+ Partition identity must come from a stable semantic boundary, not traversal order or a fixed batch label.
118
+
119
+ ### Revise
120
+
121
+ Regroup members by capability, entrypoint, lifecycle stage, state owner, protocol boundary, or handoff; if none applies, return the protocol outcome for CLI-owned catalog fallback.
122
+
123
+ ### Positive example
124
+
125
+ Handlers are grouped by the reader-visible protocol capability they implement.
126
+
127
+ ### Anti-example
128
+
129
+ Files are divided into successive numbered batches to reduce page size.
130
+
131
+ ## discretionary-artifacts-per-logical-unit
132
+
133
+ ### Meaning
134
+
135
+ Optional Artifacts must answer distinct reader questions allowed by the selected Bundle variant.
136
+
137
+ ### Revise
138
+
139
+ Remove unsupported optional Artifacts, merge overlapping ones, or select another CLI-eligible variant when canonical facts justify it.
140
+
141
+ ### Positive example
142
+
143
+ An examples Artifact is retained because it explains a distinct usage scenario with independent evidence.
144
+
145
+ ### Anti-example
146
+
147
+ The Result creates extra pages to spread the same prose across a larger Bundle.
148
+
149
+ ## example-candidate-decision-coverage
150
+
151
+ ### Meaning
152
+
153
+ Every CLI-discovered example candidate needs one explicit terminal or merge decision.
154
+
155
+ ### Revise
156
+
157
+ Decide each reported candidate as linked, merged, documentation-only, excluded with reason, or blocked by a material request.
158
+
159
+ ### Positive example
160
+
161
+ A duplicate scenario is merged into a canonical example through its full example identity.
162
+
163
+ ### Anti-example
164
+
165
+ Unclear examples disappear from the Result without a disposition.
166
+
167
+ ## example-representative-coverage
168
+
169
+ ### Meaning
170
+
171
+ Eligible scenarios need retained representatives that explain setup, key calls, parameters, and expected behavior.
172
+
173
+ ### Revise
174
+
175
+ Promote or merge evidence-backed examples for the reported uncovered scenarios and close each required facet explicitly.
176
+
177
+ ### Positive example
178
+
179
+ A canonical example covers the scenario and records evidence-backed not-applicable facets.
180
+
181
+ ### Anti-example
182
+
183
+ A path is listed as an example without explaining how or why it is used.
184
+
185
+ ## example-public-target-linkage
186
+
187
+ ### Meaning
188
+
189
+ Eligible examples should resolve to the exact public target they demonstrate whenever that target exists.
190
+
191
+ ### Revise
192
+
193
+ Resolve aliases, repair the terminal decision chain, and bind the representative to the CLI-supplied public target identity.
194
+
195
+ ### Positive example
196
+
197
+ A scenario variant merges into a representative whose terminal decision links the canonical public target.
198
+
199
+ ### Anti-example
200
+
201
+ An example is linked to a similarly named internal helper or only to a directory.
@@ -0,0 +1,119 @@
1
+ ---
2
+ id: context.code-indexer.template.adapter-integration
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Adapter, bridge, and integration template
8
+
9
+ Use for `adapter-integration`: BFFs, protocol bridges, host integrations, plugin adapters,
10
+ compatibility layers, gateways, and translators whose stable responsibility is
11
+ to connect two boundaries. An ordinary internal helper that converts one object
12
+ is not automatically an adapter module.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset. For
15
+ an inbound operation surface, combine this template with the selected gateway
16
+ or protocol evidence without creating a second operation registry.
17
+
18
+ ## Evidence pass
19
+
20
+ Locate both sides of the boundary and the code that joins them:
21
+
22
+ - inbound operation, event, command, host hook, or extension registration;
23
+ - outbound operation, client, plugin contribution, or runtime capability;
24
+ - authoritative input and output contract locations;
25
+ - identity, field, enum, version, and lifecycle mappings;
26
+ - authentication, authorization, credential, and context propagation;
27
+ - validation, normalization, batching, caching, fallback, and compatibility;
28
+ - timeout, retry, partial failure, and error/status translation;
29
+ - configuration, feature selection, ownership, and release entrypoints;
30
+ - generated DTOs/clients and converter helpers that should remain evidence.
31
+
32
+ Sample representative paths from each mapping family. Do not claim a mapping
33
+ from matching field names alone.
34
+
35
+ ## Questions the knowledge must answer
36
+
37
+ 1. Which two boundaries does the adapter connect, and who owns each one?
38
+ 2. What triggers the mapping and where is it registered?
39
+ 3. Which fields, identities, versions, or lifecycle states are transformed?
40
+ 4. Which values pass through unchanged, default, or intentionally disappear?
41
+ 5. How are credentials, context, errors, retries, and fallbacks translated?
42
+ 6. Which contracts are authoritative and which artifacts are generated?
43
+ 7. What compatibility obligation makes the adapter stable knowledge?
44
+
45
+ ## Suggested knowledge units
46
+
47
+ - **Adapter contract**: responsibility, inbound/outbound boundaries,
48
+ registration, ownership, and authoritative contracts.
49
+ - **Operation mapping registry**: use the canonical operation record from
50
+ `protocol-boundary.md` and add only adapter-specific transformation fields.
51
+ - **Data or identity mapping**: only stable, non-trivial mappings that readers
52
+ must understand; summarize generated field copies.
53
+ - **Lifecycle and failure translation**: when activation, cancellation,
54
+ retries, partial failure, or compatibility behavior is material.
55
+ - **Cross-module execution path**: when both connected modules are registered
56
+ sources and the chain is source-backed.
57
+
58
+ ## Chapter blueprints
59
+
60
+ ```markdown
61
+ # <Adapter> contract
62
+ ## Responsibility and connected boundaries
63
+ ## Activation or registration
64
+ ## Inbound contracts
65
+ ## Outbound contracts
66
+ ## Data, identity, and lifecycle mapping
67
+ ## Authentication and context propagation
68
+ ## Error, retry, fallback, and compatibility behavior
69
+ ## Configuration, ownership, and release
70
+ ## Evidence and exclusions
71
+ ```
72
+
73
+ For adapter-specific detail attached to a canonical operation record:
74
+
75
+ ```markdown
76
+ ## Adapter transformation
77
+ - Mapper/handler entry:
78
+ - Field/identity/default transformations:
79
+ - Context and credential propagation:
80
+ - Error and fallback mapping:
81
+ ```
82
+
83
+ ## Granularity and relationships
84
+
85
+ Group mappings that share the same boundary pair and transformation policy.
86
+ Split when protocol authority, ownership, lifecycle, or failure semantics
87
+ differ. Do not publish every DTO, converter, generated client, or transport
88
+ helper separately.
89
+
90
+ Add structured edges only for concrete registration and call paths. Keep a
91
+ narrative locator when dynamic dispatch prevents an unambiguous edge.
92
+
93
+ Return `identityGroups` when several target identities share one explained
94
+ adapter responsibility. Return every source-backed adjacency in
95
+ `chainCandidates`, then provide one `chainCandidateDecisions` record for each
96
+ candidate. A documented decision names the reader-facing view and emits its
97
+ structured edge; an equivalent candidate merges into that canonical candidate;
98
+ false positives and missing external material use `exclude` or `request-input`
99
+ with a concrete reason. Read `contracts-and-chains.md` for the complete generic
100
+ contract.
101
+
102
+ ## Template composition examples
103
+
104
+ - An HTTP endpoint backed by an RPC client is `api-service` + `adapter-integration`; combine
105
+ one operation registry with one mapping contract rather than duplicating the
106
+ route facts.
107
+ - A host plugin bridge reads `plugin-extension.md` and may also be `sdk-library`
108
+ when consumers import
109
+ a supported extension API.
110
+ - A compatibility wrapper over generated clients also reads
111
+ `derived-generated-source.md` and identifies the authoritative schemas.
112
+
113
+ ## Revise or stop when
114
+
115
+ - either side of the adapter cannot be identified;
116
+ - mappings are inferred only from same-named types or fields;
117
+ - credential, identity, or error behavior would be guessed;
118
+ - generated DTOs are replacing authoritative contracts in the plan;
119
+ - the adapter page would merely say that one module “calls” another.
@@ -0,0 +1,118 @@
1
+ ---
2
+ id: context.code-indexer.template.api-service
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # API service and gateway template
8
+
9
+ Use after classifying an inbound HTTP, RPC, GraphQL, message-request, or similar
10
+ surface as `api-service`. A module that only calls a remote API is a protocol
11
+ consumer, not automatically an API service. Gateways that translate to another
12
+ protocol normally also selects `adapter-integration`.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset. If
15
+ the reader goal is primarily the transformation between inbound and outbound
16
+ boundaries, use the selected adapter-integration profile and retain one
17
+ canonical operation registry.
18
+
19
+ ## Evidence pass
20
+
21
+ Locate and connect:
22
+
23
+ - process/server entry and service startup;
24
+ - route, method, resolver, or service registration;
25
+ - middleware, authentication, authorization, validation, and request context;
26
+ - handler dispatch and the first stable domain/downstream boundary;
27
+ - authoritative IDL, OpenAPI, schema, service definition, or registration;
28
+ - response/error mapping, retry, timeout, and compatibility behavior;
29
+ - configuration, local run, test, deployment, and release entrypoints;
30
+ - generated models or clients and their actual source of truth.
31
+
32
+ Prefer explicit registrations over handler filenames. Sample enough operations
33
+ from each registration family to verify that the proposed aggregation is real.
34
+
35
+ ## Questions the knowledge must answer
36
+
37
+ 1. What protocol does the module provide, and where is it registered?
38
+ 2. Which operations are stable and who handles each one?
39
+ 3. What authentication, validation, middleware, or request context applies?
40
+ 4. Where does each operation hand off to domain logic or a downstream system?
41
+ 5. How are successful responses and failures translated?
42
+ 6. Which schema is authoritative, and which files are generated projections?
43
+ 7. How is the service run, configured, observed, and released?
44
+
45
+ ## Suggested knowledge units
46
+
47
+ - **Service boundary**: responsibility, startup, supported protocols,
48
+ middleware order, downstream systems, and ownership.
49
+ - **Operation registry**: use the canonical operation record from
50
+ `protocol-boundary.md`, adding handler and middleware detail from this
51
+ template rather than creating a second registry.
52
+ - **Dispatch and dependency map**: route/service registration to handler to
53
+ domain/RPC/repository boundary, grouped by coherent operation family.
54
+ - **Error and compatibility contract**: only when status/error mapping,
55
+ versioning, fallback, or compatibility is stable and source-backed.
56
+ - **Runtime and delivery guide**: configuration, startup, diagnostics,
57
+ deployment, and release entrypoints owned by this service.
58
+
59
+ Do not create a page per generated request/response model, constant, converter,
60
+ pack/unpack helper, or handler-local function.
61
+
62
+ ## Chapter blueprints
63
+
64
+ A service-boundary page may use:
65
+
66
+ ```markdown
67
+ # <Service> boundary
68
+ ## Responsibility and consumers
69
+ ## Startup and protocol registration
70
+ ## Middleware and request lifecycle
71
+ ## Operation families
72
+ ## Domain and downstream dependencies
73
+ ## Error, timeout, and compatibility behavior
74
+ ## Configuration, observability, and release
75
+ ## Exclusions and authoritative schemas
76
+ ```
77
+
78
+ A focused execution-path page may use:
79
+
80
+ ```markdown
81
+ # <Operation> execution path
82
+ ## Inbound contract
83
+ ## Middleware and validation
84
+ ## Handler orchestration
85
+ ## Domain/downstream handoff
86
+ ## Response and error mapping
87
+ ## Source-backed edges
88
+ ```
89
+
90
+ ## Granularity and relationships
91
+
92
+ Aggregate operations that share registration, middleware, handler family, and
93
+ downstream ownership. Split when operation families have different contracts,
94
+ owners, or execution paths—not merely because they are separate methods.
95
+
96
+ Record a route-to-handler or handler-to-downstream edge only when the route
97
+ table, registration, call site, or parser evidence is unambiguous. Generated
98
+ types can locate fields but do not prove runtime behavior.
99
+
100
+ ## Template composition examples
101
+
102
+ - A gateway that receives HTTP and calls RPC reads `adapter-integration.md` and
103
+ `protocol-boundary.md` in addition to this template.
104
+ - An RPC service containing stable domain orchestration also reads
105
+ `domain-service.md`.
106
+ - An event-triggered endpoint may require `event-flow.md`; background consumers
107
+ use `background-runtime.md`.
108
+
109
+ ## Revise or stop when
110
+
111
+ - no registration or authoritative operation identity is available;
112
+ - the plan lists handlers without connecting them to provided operations;
113
+ - the only contract source is generated code with an unknown upstream schema;
114
+ - security or error behavior would be guessed from names;
115
+ - scan mode would expand models and helpers into hundreds of pages.
116
+
117
+ Return a `request-material` disposition tied to a blocking material-question
118
+ proposal when required protocol semantics remain unavailable before preview.