@c4a/context-cli 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/cli.js +32779 -32620
  2. package/indexers/capability-manifest.json +4 -9
  3. package/indexers/release-manifest.json +1 -1
  4. package/package.json +3 -3
  5. package/plugins/VERSION +1 -1
  6. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  7. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  8. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  9. package/providers/context/actions/run-indexer-lifecycle.yaml +7 -0
  10. package/providers/context/codes.yaml +3 -27
  11. package/providers/context/graphs/indexer.yaml +2 -28
  12. package/providers/context/graphs/workspace.yaml +37 -473
  13. package/providers/context/manifest.json +58 -558
  14. package/providers/context/provider.yaml +2 -2
  15. package/providers/context/resources/diagnostics/projection-stale.md +0 -1
  16. package/providers/context/resources/manuals/reference/project-api.md +39 -38
  17. package/providers/context/resources/views/document-optimization-current.yaml +1 -1
  18. package/providers/context/resources/views/package-current.yaml +1 -1
  19. package/providers/context/resources/views/resolved-indexer-instructions.yaml +1 -1
  20. package/providers/context/resources/views/review-current.yaml +1 -1
  21. package/providers/context/resources/views/source-boundary.yaml +1 -1
  22. package/providers/context/resources/views/source-current.yaml +1 -1
  23. package/providers/context/resources/views/verification-current.yaml +1 -1
  24. package/providers/context/resources/views/workspace-current.yaml +1 -1
  25. package/providers/context/schemas/indexer-contract-overlay-validation-input.schema.json +0 -42
  26. package/providers/context/schemas/indexer-contract-overlay-validation-result.schema.json +27 -122
  27. package/providers/context/schemas/indexer-lifecycle-continuation.schema.json +15 -0
  28. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +4 -4
  29. package/providers/context/schemas/indexer-overlay-question-rebind-input.schema.json +4 -4
  30. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +36 -0
  31. package/providers/context/actions/align-next.yaml +0 -6
  32. package/providers/context/actions/apply-code-index-guidance.yaml +0 -5
  33. package/providers/context/actions/apply-document-optimization-guidance.yaml +0 -5
  34. package/providers/context/actions/apply-structure-confirmation.yaml +0 -5
  35. package/providers/context/actions/authorize-indexer-contract-overlay.yaml +0 -7
  36. package/providers/context/actions/compile-next.yaml +0 -5
  37. package/providers/context/actions/configure-code-extraction.yaml +0 -5
  38. package/providers/context/actions/configure-prose-lifecycle.yaml +0 -5
  39. package/providers/context/actions/extract-next.yaml +0 -5
  40. package/providers/context/actions/inspect-code-extraction.yaml +0 -5
  41. package/providers/context/actions/inspect-document-classification.yaml +0 -5
  42. package/providers/context/actions/inspect-structure.yaml +0 -5
  43. package/providers/context/actions/migrate-codeindex.yaml +0 -5
  44. package/providers/context/actions/optimize-documents.yaml +0 -6
  45. package/providers/context/actions/preview-extraction-batch.yaml +0 -5
  46. package/providers/context/actions/revise-code-index-audit.yaml +0 -5
  47. package/providers/context/actions/submit-code-index-audit.yaml +0 -6
  48. package/providers/context/resources/dialogue/code-extraction.md +0 -87
  49. package/providers/context/resources/dialogue/document-classification.md +0 -33
  50. package/providers/context/resources/dialogue/structure-confirmation.md +0 -44
  51. package/providers/context/resources/dialogue/workflow-mode-after-capture.md +0 -25
  52. package/providers/context/resources/manuals/reference/code-extractors.md +0 -152
  53. package/providers/context/resources/procedures/code-extraction.md +0 -188
  54. package/providers/context/resources/procedures/code-index-audit.md +0 -113
  55. package/providers/context/resources/procedures/document-classification.md +0 -22
  56. package/providers/context/resources/procedures/document-optimization.md +0 -110
  57. package/providers/context/resources/procedures/prose-align.md +0 -68
  58. package/providers/context/resources/procedures/prose-compile.md +0 -23
  59. package/providers/context/resources/semantic/align/candidate-resolution.md +0 -106
  60. package/providers/context/resources/semantic/align/density-profile.md +0 -41
  61. package/providers/context/resources/semantic/align/gates.md +0 -276
  62. package/providers/context/resources/semantic/align/structure-planning.md +0 -337
  63. package/providers/context/resources/semantic/code-index/classification.md +0 -270
  64. package/providers/context/resources/semantic/code-index/templates/adapter.md +0 -118
  65. package/providers/context/resources/semantic/code-index/templates/api-service.md +0 -116
  66. package/providers/context/resources/semantic/code-index/templates/background-runtime.md +0 -109
  67. package/providers/context/resources/semantic/code-index/templates/cli-tool.md +0 -129
  68. package/providers/context/resources/semantic/code-index/templates/contract-source.md +0 -73
  69. package/providers/context/resources/semantic/code-index/templates/contracts-and-chains.md +0 -81
  70. package/providers/context/resources/semantic/code-index/templates/cross-module-chain.md +0 -78
  71. package/providers/context/resources/semantic/code-index/templates/derived-source.md +0 -116
  72. package/providers/context/resources/semantic/code-index/templates/domain-service.md +0 -109
  73. package/providers/context/resources/semantic/code-index/templates/event-flow.md +0 -62
  74. package/providers/context/resources/semantic/code-index/templates/monorepo-container.md +0 -124
  75. package/providers/context/resources/semantic/code-index/templates/persistence-boundary.md +0 -56
  76. package/providers/context/resources/semantic/code-index/templates/plugin-extension.md +0 -52
  77. package/providers/context/resources/semantic/code-index/templates/protocol-boundary.md +0 -88
  78. package/providers/context/resources/semantic/code-index/templates/sdk-library.md +0 -132
  79. package/providers/context/resources/semantic/code-index/templates/web-application.md +0 -145
  80. package/providers/context/resources/semantic/compile/index.md +0 -31
  81. package/providers/context/resources/views/code-index-audit.yaml +0 -6
  82. package/providers/context/resources/views/extraction-preview.yaml +0 -6
  83. package/providers/context/resources/views/structure-current.yaml +0 -6
  84. package/providers/context/schemas/code-index-audit-decision.schema.json +0 -94
  85. package/providers/context/schemas/document-optimization-decisions.schema.json +0 -57
  86. package/providers/context/schemas/indexer-contract-overlay-authorization-input.schema.json +0 -32
  87. package/providers/context/schemas/indexer-contract-overlay-authorization-result.schema.json +0 -121
  88. package/providers/context/schemas/prose-structure-batch.schema.json +0 -35
@@ -1,118 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.adapter
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Adapter, bridge, and integration template
8
-
9
- Use for `adapter`: 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
- Recommended `outputProfile`: `adapter-contract`. For an inbound gateway whose
15
- reader goal is the provided operation surface, use `protocol-index` instead.
16
-
17
- ## Evidence pass
18
-
19
- Locate both sides of the boundary and the code that joins them:
20
-
21
- - inbound operation, event, command, host hook, or extension registration;
22
- - outbound operation, client, plugin contribution, or runtime capability;
23
- - authoritative input and output contract locations;
24
- - identity, field, enum, version, and lifecycle mappings;
25
- - authentication, authorization, credential, and context propagation;
26
- - validation, normalization, batching, caching, fallback, and compatibility;
27
- - timeout, retry, partial failure, and error/status translation;
28
- - configuration, feature selection, ownership, and release entrypoints;
29
- - generated DTOs/clients and converter helpers that should remain evidence.
30
-
31
- Sample representative paths from each mapping family. Do not claim a mapping
32
- from matching field names alone.
33
-
34
- ## Questions the knowledge must answer
35
-
36
- 1. Which two boundaries does the adapter connect, and who owns each one?
37
- 2. What triggers the mapping and where is it registered?
38
- 3. Which fields, identities, versions, or lifecycle states are transformed?
39
- 4. Which values pass through unchanged, default, or intentionally disappear?
40
- 5. How are credentials, context, errors, retries, and fallbacks translated?
41
- 6. Which contracts are authoritative and which artifacts are generated?
42
- 7. What compatibility obligation makes the adapter stable knowledge?
43
-
44
- ## Suggested knowledge units
45
-
46
- - **Adapter contract**: responsibility, inbound/outbound boundaries,
47
- registration, ownership, and authoritative contracts.
48
- - **Operation mapping registry**: use the canonical operation record from
49
- `protocol-boundary.md` and add only adapter-specific transformation fields.
50
- - **Data or identity mapping**: only stable, non-trivial mappings that readers
51
- must understand; summarize generated field copies.
52
- - **Lifecycle and failure translation**: when activation, cancellation,
53
- retries, partial failure, or compatibility behavior is material.
54
- - **Cross-module execution path**: when both connected modules are registered
55
- sources and the chain is source-backed.
56
-
57
- ## Chapter blueprints
58
-
59
- ```markdown
60
- # <Adapter> contract
61
- ## Responsibility and connected boundaries
62
- ## Activation or registration
63
- ## Inbound contracts
64
- ## Outbound contracts
65
- ## Data, identity, and lifecycle mapping
66
- ## Authentication and context propagation
67
- ## Error, retry, fallback, and compatibility behavior
68
- ## Configuration, ownership, and release
69
- ## Evidence and exclusions
70
- ```
71
-
72
- For adapter-specific detail attached to a canonical operation record:
73
-
74
- ```markdown
75
- ## Adapter transformation
76
- - Mapper/handler entry:
77
- - Field/identity/default transformations:
78
- - Context and credential propagation:
79
- - Error and fallback mapping:
80
- ```
81
-
82
- ## Granularity and relationships
83
-
84
- Group mappings that share the same boundary pair and transformation policy.
85
- Split when protocol authority, ownership, lifecycle, or failure semantics
86
- differ. Do not publish every DTO, converter, generated client, or transport
87
- helper separately.
88
-
89
- Add structured edges only for concrete registration and call paths. Keep a
90
- narrative locator when dynamic dispatch prevents an unambiguous edge.
91
-
92
- Return `identityGroups` when several target identities share one explained
93
- adapter responsibility. Return every source-backed adjacency in
94
- `chainCandidates`, then provide one `chainCandidateDecisions` record for each
95
- candidate. A documented decision names the reader-facing view and emits its
96
- structured edge; an equivalent candidate merges into that canonical candidate;
97
- false positives and missing external material use `exclude` or `request-input`
98
- with a concrete reason. Read `contracts-and-chains.md` for the complete generic
99
- contract.
100
-
101
- ## Template composition examples
102
-
103
- - An HTTP endpoint backed by an RPC client is `api-service` + `adapter`; combine
104
- one operation registry with one mapping contract rather than duplicating the
105
- route facts.
106
- - A host plugin bridge reads `plugin-extension.md` and may also be `sdk-library`
107
- when consumers import
108
- a supported extension API.
109
- - A compatibility wrapper over generated clients also reads
110
- `derived-source.md` and identifies the authoritative schemas.
111
-
112
- ## Revise or stop when
113
-
114
- - either side of the adapter cannot be identified;
115
- - mappings are inferred only from same-named types or fields;
116
- - credential, identity, or error behavior would be guessed;
117
- - generated DTOs are replacing authoritative contracts in the plan;
118
- - the adapter page would merely say that one module “calls” another.
@@ -1,116 +0,0 @@
1
- ---
2
- id: semantic.code-index.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 select `adapter`.
13
-
14
- Recommended `outputProfile`: `protocol-index`. If the reader goal is primarily
15
- the transformation between inbound and outbound boundaries, use
16
- `adapter-contract` instead and retain one canonical operation registry.
17
-
18
- ## Evidence pass
19
-
20
- Locate and connect:
21
-
22
- - process/server entry and service startup;
23
- - route, method, resolver, or service registration;
24
- - middleware, authentication, authorization, validation, and request context;
25
- - handler dispatch and the first stable domain/downstream boundary;
26
- - authoritative IDL, OpenAPI, schema, service definition, or registration;
27
- - response/error mapping, retry, timeout, and compatibility behavior;
28
- - configuration, local run, test, deployment, and release entrypoints;
29
- - generated models or clients and their actual source of truth.
30
-
31
- Prefer explicit registrations over handler filenames. Sample enough operations
32
- from each registration family to verify that the proposed aggregation is real.
33
-
34
- ## Questions the knowledge must answer
35
-
36
- 1. What protocol does the module provide, and where is it registered?
37
- 2. Which operations are stable and who handles each one?
38
- 3. What authentication, validation, middleware, or request context applies?
39
- 4. Where does each operation hand off to domain logic or a downstream system?
40
- 5. How are successful responses and failures translated?
41
- 6. Which schema is authoritative, and which files are generated projections?
42
- 7. How is the service run, configured, observed, and released?
43
-
44
- ## Suggested knowledge units
45
-
46
- - **Service boundary**: responsibility, startup, supported protocols,
47
- middleware order, downstream systems, and ownership.
48
- - **Operation registry**: use the canonical operation record from
49
- `protocol-boundary.md`, adding handler and middleware detail from this
50
- template rather than creating a second registry.
51
- - **Dispatch and dependency map**: route/service registration to handler to
52
- domain/RPC/repository boundary, grouped by coherent operation family.
53
- - **Error and compatibility contract**: only when status/error mapping,
54
- versioning, fallback, or compatibility is stable and source-backed.
55
- - **Runtime and delivery guide**: configuration, startup, diagnostics,
56
- deployment, and release entrypoints owned by this service.
57
-
58
- Do not create a page per generated request/response model, constant, converter,
59
- pack/unpack helper, or handler-local function.
60
-
61
- ## Chapter blueprints
62
-
63
- A service-boundary page may use:
64
-
65
- ```markdown
66
- # <Service> boundary
67
- ## Responsibility and consumers
68
- ## Startup and protocol registration
69
- ## Middleware and request lifecycle
70
- ## Operation families
71
- ## Domain and downstream dependencies
72
- ## Error, timeout, and compatibility behavior
73
- ## Configuration, observability, and release
74
- ## Exclusions and authoritative schemas
75
- ```
76
-
77
- A focused execution-path page may use:
78
-
79
- ```markdown
80
- # <Operation> execution path
81
- ## Inbound contract
82
- ## Middleware and validation
83
- ## Handler orchestration
84
- ## Domain/downstream handoff
85
- ## Response and error mapping
86
- ## Source-backed edges
87
- ```
88
-
89
- ## Granularity and relationships
90
-
91
- Aggregate operations that share registration, middleware, handler family, and
92
- downstream ownership. Split when operation families have different contracts,
93
- owners, or execution paths—not merely because they are separate methods.
94
-
95
- Record a route-to-handler or handler-to-downstream edge only when the route
96
- table, registration, call site, or parser evidence is unambiguous. Generated
97
- types can locate fields but do not prove runtime behavior.
98
-
99
- ## Template composition examples
100
-
101
- - A gateway that receives HTTP and calls RPC reads `adapter.md` and
102
- `protocol-boundary.md` in addition to this template.
103
- - An RPC service containing stable domain orchestration also reads
104
- `domain-service.md`.
105
- - An event-triggered endpoint may require `event-flow.md`; background consumers
106
- use `background-runtime.md`.
107
-
108
- ## Revise or stop when
109
-
110
- - no registration or authoritative operation identity is available;
111
- - the plan lists handlers without connecting them to provided operations;
112
- - the only contract source is generated code with an unknown upstream schema;
113
- - security or error behavior would be guessed from names;
114
- - scan mode would expand models and helpers into hundreds of pages.
115
-
116
- Mark unavailable protocol semantics as `material-required` before preview.
@@ -1,109 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.background-runtime
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Background runtime template
8
-
9
- Use for `background-runtime`: queue or stream consumers, scheduled jobs,
10
- pipelines, functions, controllers, watchers, and long-running agents activated
11
- by a trigger instead of an interactive request.
12
-
13
- Recommended `outputProfile`: `runtime-map`.
14
-
15
- ## Evidence pass
16
-
17
- Locate:
18
-
19
- - process/runtime bootstrap and worker/job registration;
20
- - trigger identity: topic, queue, schedule, hook, file, controller event, or
21
- platform invocation;
22
- - payload/schema locator and producer when available;
23
- - handler dispatch, concurrency, partitioning, ordering, and state changes;
24
- - downstream services, persistence, emitted events, and side effects;
25
- - retry, timeout, checkpoint, idempotency, dead-letter, and recovery behavior;
26
- - configuration, scaling, health, observability, deployment, and ownership;
27
- - replay/test fixtures and generated payload types that are not authoritative.
28
-
29
- Distinguish code defaults from runtime configuration. Do not describe delivery
30
- guarantees unless registration, framework configuration, or maintained
31
- documentation proves them.
32
-
33
- ## Questions the knowledge must answer
34
-
35
- 1. What activates the runtime and where is that trigger registered?
36
- 2. What input contract is consumed, and who produces it?
37
- 3. How does work move from dispatch through orchestration and side effects?
38
- 4. What are the concurrency, ordering, retry, and idempotency boundaries?
39
- 5. How does the runtime checkpoint, recover, or surface failed work?
40
- 6. How is it configured, operated, observed, scaled, and deployed?
41
-
42
- ## Suggested knowledge units
43
-
44
- - **Runtime map**: bootstrap, trigger families, handler registry, dependencies,
45
- state boundaries, and operating model.
46
- - **Trigger/workflow registry**: stable trigger identity, input contract,
47
- handler, downstream effects, retry/idempotency, and source locator.
48
- - **Processing flow**: focused end-to-end path for a high-value workflow family.
49
- - **Recovery and operations guide**: checkpointing, failed work, observability,
50
- configuration, local execution, deployment, and safe replay where evidenced.
51
- - **Producer-consumer chain**: only when both registered modules and the event
52
- identity are source-backed.
53
-
54
- ## Chapter blueprints
55
-
56
- ```markdown
57
- # <Background runtime> map
58
- ## Responsibility and activation model
59
- ## Bootstrap and trigger registration
60
- ## Workflow or handler families
61
- ## State and downstream side effects
62
- ## Concurrency, ordering, retry, and idempotency
63
- ## Failure recovery and observability
64
- ## Configuration, scaling, and deployment
65
- ## Contract sources and exclusions
66
- ```
67
-
68
- For a trigger family:
69
-
70
- ```markdown
71
- ## <Trigger or workflow>
72
- - Trigger identity and registration:
73
- - Input contract and producer:
74
- - Dispatch and handler:
75
- - State changes and downstream effects:
76
- - Retry/idempotency/checkpoint behavior:
77
- - Failure destination and operator action:
78
- - Source evidence:
79
- ```
80
-
81
- ## Granularity and relationships
82
-
83
- Prefer one record per stable trigger or coherent workflow family. Do not create
84
- one page per handler helper, event field, retry branch, or generated payload
85
- type. Split a page when triggers have different contracts, ownership, delivery,
86
- or recovery semantics.
87
-
88
- Every retained page must name concrete trigger, handler, state, side-effect,
89
- and recovery identities with source locators. A runtime page that only lists
90
- directories or says a worker “processes events” is too thin.
91
-
92
- Connect producers and consumers only through a concrete topic/trigger/schema
93
- identity. A shared type name or import is insufficient.
94
-
95
- ## Template composition examples
96
-
97
- - A consumer that invokes a domain boundary reads `domain-service.md`.
98
- - A scheduler that calls external APIs selects `protocol-consumer` and reads
99
- `protocol-boundary.md`.
100
- - A controller exposing administrative commands may combine this template with
101
- `cli-tool.md` or `api-service.md`, but should still produce one runtime map.
102
-
103
- ## Revise or stop when
104
-
105
- - no trigger registry or executable worker entry can be found;
106
- - delivery, ordering, retry, or idempotency would be guessed;
107
- - the producer or authoritative payload contract is required but unavailable;
108
- - the plan expands generated event structures or helpers one symbol per page;
109
- - runtime configuration cannot be distinguished from test setup.
@@ -1,129 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.cli-tool
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # CLI and developer tool template
8
-
9
- Use for `cli-tool`: command-line applications, developer tools, administrative
10
- executables, generators, and command-driven plugin hosts. A build script used
11
- only internally does not need a CLI knowledge unit unless it is a supported
12
- operator or contributor surface.
13
-
14
- Recommended `outputProfile`: `command-map`.
15
-
16
- ## Evidence pass
17
-
18
- Locate:
19
-
20
- - executable/bin entry, runtime requirement, and command parser;
21
- - root and nested command registration;
22
- - positional arguments, flags, defaults, mutually exclusive options, and input
23
- schemas;
24
- - configuration files, environment variables, profiles, credential sources,
25
- and precedence;
26
- - interactive prompts versus non-interactive/automation behavior;
27
- - filesystem, repository, network, platform, and plugin side effects;
28
- - output formats, stdout/stderr behavior, exit codes, polling, and recovery;
29
- - local development, packaging, installation, compatibility, and release;
30
- - deprecated commands, aliases, parser helpers, and formatters to exclude.
31
-
32
- Inspect actual command registration and representative execution paths. Help
33
- text is useful evidence but may not describe hidden preconditions or effects.
34
-
35
- ## Questions the knowledge must answer
36
-
37
- 1. How is the CLI installed or invoked, and what runtime does it require?
38
- 2. What stable command families exist and what user outcomes do they produce?
39
- 3. What inputs, configuration, credentials, and precedence rules apply?
40
- 4. Which commands mutate files, repositories, remote services, or user state?
41
- 5. What output and exit behavior supports automation and diagnosis?
42
- 6. Which plugin or extension points change the command surface?
43
- 7. How does a user recover from common source-backed failure states?
44
-
45
- ## Suggested knowledge units
46
-
47
- - **Command map**: invocation model, command families, configuration,
48
- credentials, side effects, output formats, and extension points.
49
- - **Task workflow**: an end-to-end supported user goal spanning several
50
- commands, with preconditions, state transitions, and recovery.
51
- - **Command-family reference**: coherent subcommands with inputs, outputs,
52
- side effects, and examples.
53
- - **Configuration and credentials**: when precedence or environment behavior is
54
- complex and stable enough for a dedicated page.
55
- - **Plugin/extension contract**: use the single complete blueprint in
56
- `plugin-extension.md`; the command map only links commands and configuration
57
- to that contract.
58
- - **Development and release guide**: only source-backed contributor workflows
59
- owned by this module.
60
-
61
- ## Chapter blueprints
62
-
63
- ```markdown
64
- # <CLI> command map
65
- ## Purpose, installation, and invocation
66
- ## Command families
67
- ## Configuration and precedence
68
- ## Credentials and external dependencies
69
- ## Filesystem/repository/remote side effects
70
- ## Output formats and exit semantics
71
- ## Plugins, compatibility, and release
72
- ## Diagnostics, recovery, and exclusions
73
- ```
74
-
75
- For a command family:
76
-
77
- ```markdown
78
- # <Command family>
79
- ## User outcomes and preconditions
80
- ## Commands and arguments
81
- ## Configuration and credential requirements
82
- ## Execution and side effects
83
- ## Output and exit behavior
84
- ## Failure recovery
85
- ## Source-backed examples
86
- ```
87
-
88
- A workflow page may use:
89
-
90
- ```markdown
91
- # <User task>
92
- ## Starting state
93
- ## Command sequence
94
- ## State and artifact changes
95
- ## Remote operations
96
- ## Success checks
97
- ## Recovery and rollback boundaries
98
- ```
99
-
100
- ## Granularity and relationships
101
-
102
- Prefer command families and user tasks over one page per parser node, flag,
103
- prompt, formatter, or implementation function. Split only when commands have
104
- different state ownership, external systems, or safety/recovery contracts.
105
-
106
- Every retained page must name real commands, task outcomes, state changes, or
107
- extension identities with source locators. A list of command directories or
108
- parser nodes is not a command map.
109
-
110
- Connect commands to configuration, package/file outputs, plugin providers, and
111
- platform operations only when source registrations or call sites prove them.
112
-
113
- ## Template composition examples
114
-
115
- - A CLI with installable providers also reads `adapter.md` and
116
- `plugin-extension.md`.
117
- - A CLI that primarily wraps a remote protocol selects `protocol-consumer` and
118
- reads `protocol-boundary.md`.
119
- - A monorepo release tool may combine this template with
120
- `monorepo-container.md` and `build-release` without duplicating its command
121
- registry.
122
-
123
- ## Revise or stop when
124
-
125
- - no stable command registry or executable entry is found;
126
- - examples require inventing flags or commands not present in source;
127
- - side effects or credential behavior are unclear but material to safe use;
128
- - every option/parser helper is becoming an independent page;
129
- - deprecated or hidden implementation commands are presented as supported.
@@ -1,73 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.contract-source
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Authoritative contract source template
8
-
9
- Use for `contract-source`: a module whose maintained value is an authoritative
10
- IDL, OpenAPI document, schema registry, message contract, or equivalent
11
- machine-readable interface definition. It defines contracts consumed by other
12
- modules but does not need to execute or dispatch them itself.
13
-
14
- Recommended `outputProfile`: `protocol-index`. Also select
15
- `protocol-provider`, and use `generated-contract` only for generated projections
16
- that point back to this authority. The normal lifecycle is `authoritative`.
17
-
18
- ## Evidence pass
19
-
20
- Locate:
21
-
22
- - schema roots, namespaces/packages, service or message registries, and imports;
23
- - operation, event, request, response, and error identities;
24
- - versioning, compatibility, deprecation, and evolution rules;
25
- - generator configuration, target languages/packages, and generated output
26
- boundaries;
27
- - known provider and consumer registrations when those modules are registered;
28
- - ownership, validation, publication, and release entrypoints.
29
-
30
- ## Questions the knowledge must answer
31
-
32
- 1. Which contracts are authoritative in this module?
33
- 2. How are operations/messages grouped and identified?
34
- 3. What versioning and compatibility rules are declared?
35
- 4. Which generated artifacts and consumers derive from this source?
36
- 5. How is the contract validated, published, and changed?
37
-
38
- ## Suggested knowledge units
39
-
40
- - **Contract registry**: namespaces, service/message families, authority,
41
- versions, owners, and navigation.
42
- - **Operation or message-family reference**: exact identities, payload roles,
43
- errors, compatibility, and generated targets.
44
- - **Generation and publication map**: generator inputs/outputs, validation,
45
- versioning, and release boundary.
46
- - **Provider-consumer flow**: only when both runtime endpoints are registered
47
- and source-backed; use the cross-module template.
48
-
49
- ## Chapter blueprint
50
-
51
- ```markdown
52
- # <Contract module> registry
53
- ## Authority, ownership, and schema roots
54
- ## Namespaces and contract families
55
- ## Operations, messages, and error identities
56
- ## Versioning, compatibility, and deprecation
57
- ## Generated targets and active consumers
58
- ## Validation, publication, and release
59
- ## Evidence and exclusions
60
- ```
61
-
62
- Use the canonical operation record from `protocol-boundary.md` for detailed
63
- families. Do not duplicate every generated language binding or claim runtime
64
- behavior from the schema alone.
65
-
66
- ## Granularity and stop conditions
67
-
68
- Aggregate related operations/messages by authoritative family. Split when
69
- namespace, owner, version policy, or compatibility behavior differs. Every page
70
- must contain exact contract identities and source locators, not just filenames.
71
-
72
- Revise or stop when authority cannot be distinguished from a generated copy,
73
- imports or versions are unresolved, or compatibility claims are not declared.
@@ -1,81 +0,0 @@
1
- ---
2
- id: semantic.code-index.template.contracts-and-chains
3
- kind: procedure
4
- media-type: text/markdown
5
- ---
6
-
7
- # Contracts, identity groups, and execution chains
8
-
9
- Use this resource after module classification when a code index must connect
10
- stable identities without turning the inventory into reader-facing prose. It
11
- applies to application, service, library, runtime, command, adapter, and
12
- cross-source units.
13
-
14
- ## Separate inspection facts from reader content
15
-
16
- The adapter inventory is complete machine evidence. A reader page should group
17
- members only when they share a source-backed responsibility, boundary, or
18
- lifecycle. Do not create one sentence, bullet, row, or page per discovered
19
- identity.
20
-
21
- An `identityGroups` record must provide:
22
-
23
- - a stable group `id`;
24
- - the exact target `members` from the same index-unit inventory;
25
- - one reader-facing `viewRef` that explains their common responsibility;
26
- - `sourceFiles` from the eligible-file inventory that prove membership.
27
-
28
- The referenced page must cite every declared source file. A group does not pass
29
- coverage merely because its members exist in frontmatter or evidence.
30
-
31
- ## Discover chain candidates
32
-
33
- Emit a candidate only when code structure or an authoritative declaration
34
- supports both adjacent endpoints. Supported families are:
35
-
36
- - `entry-operation`;
37
- - `operation-handler`;
38
- - `handler-downstream`;
39
- - `event-processing`;
40
- - `command-effect`;
41
- - `export-implementation`;
42
- - `cross-source-handoff`.
43
-
44
- Each candidate records a stable `id`, `from`, `to`, confidence, and the exact
45
- eligible `sourceFiles` that support the adjacency. Imports, filenames, symbol
46
- co-occurrence, or similar names alone are ambiguous evidence; mark such a
47
- candidate ambiguous or request material instead of asserting a runtime chain.
48
-
49
- ## Decide every candidate
50
-
51
- Every discovered candidate receives exactly one decision:
52
-
53
- - `document`: add a source-backed structured edge and name its reader-facing
54
- `viewRef`;
55
- - `merge`: point `canonicalChainId` at an equivalent candidate whose decision
56
- is `document`;
57
- - `exclude`: explain why the static match is not a stable runtime relation;
58
- - `request-input`: explain which external protocol, runtime registration, or
59
- authoritative material is missing.
60
-
61
- Decision coverage is 100%. Excluding all candidates does not close an external
62
- boundary family: at least one representative chain must be documented, merged
63
- into a documented chain, or explicitly require material.
64
-
65
- ## Reader-facing chain blueprint
66
-
67
- ```markdown
68
- ## <Reader goal or boundary>
69
-
70
- <Explain the starting trigger and the stable outcome.>
71
-
72
- 1. **Entry or trigger** — <identity and responsibility>.
73
- 2. **Operation or handler** — <validation, transformation, or state change>.
74
- 3. **External handoff or effect** — <contract, ownership, and next boundary>.
75
-
76
- Failure and retry boundary: <only source-backed behavior>.
77
- Evidence: <section-scoped locators for each adjacent handoff>.
78
- ```
79
-
80
- Remove stages that do not apply. Do not leave empty template headings, repeat a
81
- module inventory, or infer missing runtime behavior.