@cassiomc1/forgeloop 1.3.0 → 1.6.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 (163) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/AGENTS.md +1 -0
  3. package/CLAUDE.md +1 -0
  4. package/DOCS_INDEX.md +20 -8
  5. package/EXECUTION_STATE.md +60 -0
  6. package/LOOP_ENGINEERING.md +135 -5
  7. package/LOOP_SYSTEM_DESIGN.md +54 -1
  8. package/PROTOCOL_INTEGRATION.md +87 -0
  9. package/QUALITY_SCORECARD.md +2 -0
  10. package/README.md +69 -9
  11. package/TERMINOLOGY.md +15 -0
  12. package/THIRD_PARTY_NOTICES.md +30 -0
  13. package/THREAT_MODEL.md +59 -1
  14. package/docs/ARTIFACT_REFERENCE.md +183 -0
  15. package/docs/CLI_REFERENCE.md +391 -6
  16. package/docs/CROSS_HARNESS_CONTINUITY.md +23 -0
  17. package/docs/DIAGNOSTIC_MODEL.md +181 -0
  18. package/docs/DOCUMENTATION_GUIDE.md +36 -13
  19. package/docs/EXECUTION_TRACE.md +76 -0
  20. package/docs/GETTING_STARTED.md +1 -0
  21. package/docs/MCP.md +159 -0
  22. package/docs/RECIPES.md +149 -0
  23. package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
  24. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
  25. package/docs/TROUBLESHOOTING.md +217 -3
  26. package/docs/UNIVERSAL_INTEGRATION.md +48 -0
  27. package/docs/assets/diagrams/forgeloop-engineering-flow.html +13797 -0
  28. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +37 -0
  29. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +5002 -0
  30. package/docs/diagrams/README.md +55 -0
  31. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +122 -0
  32. package/docs/diagrams/manifest.json +42 -0
  33. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +20 -0
  34. package/package.json +21 -8
  35. package/schemas/action.schema.json +100 -0
  36. package/schemas/approval.schema.json +51 -0
  37. package/schemas/capability-policy.schema.json +41 -0
  38. package/schemas/diagnostic-case.schema.json +85 -0
  39. package/schemas/execution-receipt.schema.json +16 -0
  40. package/schemas/hypothesis-disposition.schema.json +16 -0
  41. package/schemas/intervention.schema.json +27 -0
  42. package/schemas/policy-lock.schema.json +1 -0
  43. package/schemas/policy-snapshot.schema.json +2 -0
  44. package/schemas/task-recovery.schema.json +61 -0
  45. package/schemas/trajectory-evaluation.schema.json +64 -0
  46. package/schemas/trajectory-scenario.schema.json +42 -0
  47. package/src/cli.js +267 -347
  48. package/src/commands/action-authorize.js +41 -0
  49. package/src/commands/action-propose.js +10 -0
  50. package/src/commands/action-reconcile.js +10 -0
  51. package/src/commands/action-record.js +47 -0
  52. package/src/commands/action-show.js +10 -0
  53. package/src/commands/action-verify.js +10 -0
  54. package/src/commands/advance.js +7 -2
  55. package/src/commands/approval-request.js +64 -0
  56. package/src/commands/approval-resolve.js +10 -0
  57. package/src/commands/audit.js +5 -0
  58. package/src/commands/baseline.js +3 -3
  59. package/src/commands/eval.js +6 -0
  60. package/src/commands/history.js +18 -0
  61. package/src/commands/init.js +2 -2
  62. package/src/commands/inspect.js +55 -0
  63. package/src/commands/metrics.js +7 -0
  64. package/src/commands/next.js +8 -2
  65. package/src/commands/policy-discover.js +2 -2
  66. package/src/commands/progress.js +6 -2
  67. package/src/commands/record-diagnosis.js +37 -1
  68. package/src/commands/record-hypothesis-disposition.js +45 -0
  69. package/src/commands/record-intervention.js +35 -0
  70. package/src/commands/reflect.js +38 -0
  71. package/src/commands/report.js +9 -1
  72. package/src/commands/run-action.js +18 -0
  73. package/src/commands/status.js +17 -0
  74. package/src/commands/task-create.js +39 -1
  75. package/src/commands/task-list.js +14 -1
  76. package/src/commands/task-lock-status.js +2 -2
  77. package/src/commands/task-recover.js +202 -0
  78. package/src/commands/task-repair-legacy-recovery.js +417 -0
  79. package/src/commands/task-resume.js +172 -0
  80. package/src/commands/task-scope.js +23 -4
  81. package/src/commands/task-show.js +18 -4
  82. package/src/commands/trace.js +34 -0
  83. package/src/commands/validate-protocol.js +40 -15
  84. package/src/core/action-authorization.js +106 -0
  85. package/src/core/action-constants.js +86 -0
  86. package/src/core/action-execution.js +105 -0
  87. package/src/core/action-ledger-projection.js +302 -0
  88. package/src/core/action-model.js +581 -0
  89. package/src/core/action-readiness.js +141 -0
  90. package/src/core/action-reconciliation-policy.js +49 -0
  91. package/src/core/action-reconciliation.js +66 -0
  92. package/src/core/action-verification.js +111 -0
  93. package/src/core/actions.js +462 -0
  94. package/src/core/approvals.js +405 -0
  95. package/src/core/artifact-registry.js +60 -0
  96. package/src/core/audit.js +45 -4
  97. package/src/core/bundles.js +30 -0
  98. package/src/core/capability-policy.js +226 -0
  99. package/src/core/cli-command-definitions.js +260 -5
  100. package/src/core/command-executors.js +543 -0
  101. package/src/core/command-input.js +107 -0
  102. package/src/core/command-runtime.js +117 -0
  103. package/src/core/completion-artifacts.js +39 -15
  104. package/src/core/completion-ownership.js +88 -0
  105. package/src/core/completion-recovery-rebind.js +194 -0
  106. package/src/core/completion.js +70 -0
  107. package/src/core/continuity-reconciliation.js +24 -5
  108. package/src/core/diagnostic-model.js +396 -0
  109. package/src/core/diagnostic-projection.js +51 -0
  110. package/src/core/diagnostic-record.js +360 -0
  111. package/src/core/error-codes.js +461 -1
  112. package/src/core/events.js +171 -2
  113. package/src/core/execution-prerequisites.js +4 -1
  114. package/src/core/execution.js +26 -188
  115. package/src/core/failure-signature.js +70 -0
  116. package/src/core/failure-surface.js +57 -0
  117. package/src/core/filesystem.js +55 -6
  118. package/src/core/history.js +110 -0
  119. package/src/core/hypothesis-projection.js +85 -0
  120. package/src/core/information-gain-projection.js +283 -0
  121. package/src/core/information-gain.js +138 -0
  122. package/src/core/inspect.js +132 -7
  123. package/src/core/integration-invocation-policy.js +217 -0
  124. package/src/core/integration-limits.js +20 -0
  125. package/src/core/integration-resources.js +178 -0
  126. package/src/core/next-action-model.js +94 -0
  127. package/src/core/next-action.js +490 -3
  128. package/src/core/phase.js +42 -22
  129. package/src/core/policy-engine.js +113 -6
  130. package/src/core/preflight-consistency.js +31 -5
  131. package/src/core/preflight.js +19 -2
  132. package/src/core/prepared-execution.js +227 -0
  133. package/src/core/progress.js +41 -4
  134. package/src/core/project-root.js +21 -0
  135. package/src/core/protocol-info.js +61 -0
  136. package/src/core/protocol.js +14 -0
  137. package/src/core/receipt.js +1 -0
  138. package/src/core/reconcile-closure.js +35 -10
  139. package/src/core/recovery-history.js +116 -0
  140. package/src/core/reflection.js +305 -0
  141. package/src/core/resumability.js +57 -3
  142. package/src/core/schema-validation.js +9 -0
  143. package/src/core/strategy-analysis.js +97 -0
  144. package/src/core/task-claim-state.js +272 -0
  145. package/src/core/task-command.js +5 -1
  146. package/src/core/task-conflict-inspection.js +321 -0
  147. package/src/core/task-context.js +32 -29
  148. package/src/core/task-discovery.js +14 -1
  149. package/src/core/task-lock.js +216 -22
  150. package/src/core/task-paths.js +31 -2
  151. package/src/core/task-recovery-migration.js +192 -0
  152. package/src/core/task-recovery.js +205 -0
  153. package/src/core/task-scope.js +33 -1
  154. package/src/core/task-snapshot.js +53 -0
  155. package/src/core/templates.js +9 -0
  156. package/src/core/trace.js +548 -0
  157. package/src/core/trajectory-evaluation.js +71 -0
  158. package/src/core/trajectory-metrics.js +80 -0
  159. package/src/core/transaction.js +36 -2
  160. package/src/core/work-state.js +10 -5
  161. package/src/integration.js +47 -0
  162. package/docs/assets/forgeloop-flow.svg +0 -1
  163. package/docs/forgeloop-flow.mmd +0 -51
@@ -14,7 +14,7 @@ ForgeLoop strictly separates normative protocol definitions from operational doc
14
14
  | **Operational & Reference** | `docs/` (`GETTING_STARTED.md`, `CROSS_HARNESS_CONTINUITY.md`, `CLI_REFERENCE.md`, `ARTIFACT_REFERENCE.md`, `TROUBLESHOOTING.md`, `RECIPES.md`) | Tutorials, command reference, handoff workflows, and troubleshooting | Explains how to operate the system. Links to normative sources for formal specifications. |
15
15
  | **Domain Engineering** | `ENG/` (`clean-code-eng.md`, `design-code-eng.md`, `test-code-eng.md`, etc.) | Domain-specific implementation and quality standards | Frontmatter must adhere to `validate_loop_system.py` standards. |
16
16
  | **Consumer Documentation Quality** | [`ENG/documentation-quality-eng.md`](../ENG/documentation-quality-eng.md) | Quality standards for documentation work in projects using ForgeLoop | Governs client/consumer project documentation tasks via guide routing. |
17
- | **Visual Architecture** | `docs/forgeloop-flow.mmd` | Canonical architecture diagram source | Rendered SVG committed at `docs/assets/forgeloop-flow.svg`. |
17
+ | **Visual Architecture** | `docs/diagrams/manifest.json` + `docs/diagrams/forgeloop-engineering-flow.workflow.json` | Governance metadata and canonical typed Archify workflow source | Animated HTML explorer, animated SVG fallback, deterministic receipt, and source-bound human review are committed under `docs/assets/diagrams/` and `docs/diagrams/reviews/`. |
18
18
  | **Documentation Index** | `DOCS_INDEX.md` | Single repository index and ownership map | Updated whenever documentation structure changes. |
19
19
 
20
20
  ---
@@ -31,10 +31,24 @@ Reason-code truth -> exported protocol constants (src/core/error-codes.js,
31
31
  Guide registry truth -> canonical guide registry (src/config/guides.json)
32
32
  Package contents truth -> package.json + package tests (tests/package.test.js)
33
33
  Documentation routing -> DOCS_INDEX.md
34
+ Integration API truth -> src/integration.js (exports, envelope, limits, risk classes, resources)
35
+ MCP behavior truth -> integrations/mcp/src/* and integrations/mcp/package.json
36
+ MCP package boundary -> MCP package tests + scripts/mcp-package-smoke.mjs
34
37
  ```
35
38
 
36
39
  Operational documentation must explain canonical behavior, not redefine it.
37
40
 
41
+ Documentation-impact questions for integration/MCP changes:
42
+
43
+ - Did a server mode or capability gate change?
44
+ - Did an MCP transport change?
45
+ - Did an adapter error code change?
46
+ - Did an integration limit or resource list change?
47
+
48
+ Anti-drift invariant: every `documentation-manifest.json` entry marked
49
+ `packaged: true` is mechanically checked against the core npm tarball
50
+ contents (`tests/package.test.js`).
51
+
38
52
  Canonical phase and transition inventories must be derived from `WORK_PHASES`
39
53
  and `WORK_TRANSITIONS`; do not maintain independent hand-written transition
40
54
  enums when a generated or mechanically validated representation is available.
@@ -70,7 +84,7 @@ cross-platform CI (.github/workflows/docs-quality.yml)
70
84
  | **CLI Command Options** | `CLI_COMMAND_DEFINITIONS` (`src/core/cli-command-definitions.js`) | `docs/CLI_REFERENCE.md` | `<!-- BEGIN FORGELOOP GENERATED: cli:<command>:options -->` |
71
85
  | **Work-State Transitions** | `WORK_PHASES` / `WORK_TRANSITIONS` (`src/core/protocol.js`) | `ORCHESTRATOR_INTEGRATION.md` | `<!-- BEGIN FORGELOOP GENERATED: work-transitions -->` |
72
86
  | **Public Error Codes** | `PUBLIC_ERROR_CODES` (`src/core/error-codes.js`) | `docs/TROUBLESHOOTING.md` | `<!-- BEGIN FORGELOOP GENERATED: public-error-codes -->` |
73
- | **Architecture Flow** | `docs/forgeloop-flow.mmd` | `docs/assets/forgeloop-flow.svg` | Verified via embedded SHA-256 fingerprint |
87
+ | **Architecture Flow** | `docs/diagrams/manifest.json` + `docs/diagrams/forgeloop-engineering-flow.workflow.json` | `docs/assets/diagrams/forgeloop-engineering-flow.{html,svg,receipt.json}` + `docs/diagrams/reviews/forgeloop-engineering-flow.review.json` | Verified via pinned Archify renderer, trace-animation markers, source/SVG fingerprints, artifact hashes, persistent review, and composition checks |
74
88
 
75
89
  ### Maintenance Workflow
76
90
 
@@ -108,7 +122,7 @@ conformance checks detect omissions.
108
122
  | **Discovery resume rules** | `DISCOVERY_SURFACES` & `nativeShim` | `scripts/validate_documentation_conformance.mjs` |
109
123
  | **Task-layout path freshness** | `TASK_LAYOUT_DOCUMENTS` & `task-paths.js` | `scripts/validate_documentation_conformance.mjs` |
110
124
  | **Package-shipped docs** | `package.json` (`files`) | `tests/package.test.js` |
111
- | **Architecture diagram** | `docs/forgeloop-flow.mmd` | `scripts/check-generated-diagram.mjs` |
125
+ | **Architecture diagram** | `docs/diagrams/forgeloop-engineering-flow.workflow.json` | `scripts/check-documentation-diagrams.mjs` and `scripts/documentation-diagram-inventory.mjs` |
112
126
 
113
127
  ---
114
128
 
@@ -163,21 +177,29 @@ migration, or security-sensitive require `npm run docs:check` before merge.
163
177
 
164
178
  ---
165
179
 
166
- ## 7. Mermaid Diagrams and SVG Generation
180
+ ## 7. Archify Diagrams and Animated SVG Generation
181
+
182
+ 1. **Typed source is canonical**: The architecture flow is authored in Archify workflow IR at `docs/diagrams/forgeloop-engineering-flow.workflow.json`. Never modify generated HTML or SVG files directly.
183
+ 2. **Pinned local renderer**: Generation uses only the vendored Archify v2.15.0 source at the reviewed commit recorded in `docs/diagrams/manifest.json` and `vendor/archify/v2.15.0/PIN.json`.
184
+ 3. **Animated committed outputs**: The source uses `meta.animation: "trace"`. The interactive HTML is the primary animated explorer, and the self-contained SVG fallback carries trace-capable edge/node animation while remaining usable in repository previews. The deterministic receipt is committed under `docs/assets/diagrams/`.
185
+ 4. **GitHub-safe SVG**: The SVG must not embed `<script>` or `<foreignObject>`, must expose accessible title/description metadata, and must remain visible through standard Markdown image syntax.
186
+ 5. **Fingerprint and review verification**: The generated SVG embeds a `data-forgeloop-source-sha256` attribute, the outputs expose trace markers, and the receipt binds the source, HTML, and SVG hashes. The human-owned review at `docs/diagrams/reviews/` binds the current source and SVG hashes and is never generated or overwritten. Run `npm run docs:diagrams:check` before review.
187
+ 6. **Scoped wrapper**: The ForgeLoop Archify wrapper is intentionally documentation-scoped. It reads canonical inputs only from `docs/diagrams/` and permits deliver outputs only under `docs/assets/diagrams/`.
167
188
 
168
- 1. **Source is Canonical**: Diagram source files live in `.mmd` files (e.g. `docs/forgeloop-flow.mmd`). Never modify SVG files directly.
169
- 2. **Local Committed SVGs**: Generated SVGs are committed locally in `docs/assets/`. Never hotlink externally rendered diagram images.
170
- 3. **Self-Contained & GitHub-Safe**: Generated SVGs must not import external stylesheets (e.g. `@import url(...)`), must not embed `<script>` or `<foreignObject>`, and must be visible via standard Markdown image syntax (`![alt](./path.svg)`).
171
- 4. **Fingerprint Verification**: Generated SVGs embed a `data-forgeloop-source-sha256` attribute verified by `npm run docs:check`.
189
+ ForgeLoop governs five documentation-diagram categories: workflow,
190
+ architecture, sequence, dataflow, and lifecycle. The current repository has
191
+ one canonical workflow diagram. Governance support does not imply renderer
192
+ support: a type requires an explicit renderer mapping before it can be added as
193
+ an active diagram.
172
194
 
173
195
  ---
174
196
 
175
197
  ## 8. README Hero and Package Boundary
176
198
 
177
199
  README hero assets are branding/conceptual illustrations. They are not the
178
- canonical protocol diagram. `docs/forgeloop-flow.mmd` remains the canonical
179
- architecture flow source and `docs/assets/forgeloop-flow.svg` remains its
180
- generated render.
200
+ canonical protocol diagram. The typed Archify workflow under `docs/diagrams/`
201
+ remains the canonical architecture flow source, with generated outputs under
202
+ `docs/assets/diagrams/`.
181
203
 
182
204
  The README hero is intentionally GitHub-repository-only:
183
205
 
@@ -192,8 +214,9 @@ The README hero is intentionally GitHub-repository-only:
192
214
  packaged Markdown must be present in the package and covered by
193
215
  `tests/package.test.js`.
194
216
 
195
- Never delete `docs/assets/forgeloop-flow.svg`; it is generator-owned output of
196
- the diagram workflow.
217
+ Never edit or delete a generated diagram output independently of its source;
218
+ regenerate `docs/assets/diagrams/` from the typed workflow and keep the receipt
219
+ in sync.
197
220
 
198
221
  ---
199
222
 
@@ -0,0 +1,76 @@
1
+ # ForgeLoop Execution Trace
2
+
3
+ Reference for `history`, `trace`, `reflect`, and task-level `inspect` observability projections (ForgeLoop 1.6.0+).
4
+
5
+ All views are deterministic read-only projections of canonical artifacts (event ledger + work state). There is no second truth store.
6
+
7
+ ## history
8
+
9
+ ```bash
10
+ forgeloop history --task <id> [--json] [--compact] [--verbose]
11
+ [--type <types>] [--phase <phases>] [--failures] [--checks]
12
+ [--since <ts>] [--until <ts>] [--limit <n>]
13
+ ```
14
+
15
+ Human output shows chronological events with timestamps from the ledger. JSON output includes:
16
+
17
+ - `snapshot`: consistency anchors (`stateRevision`, `ledgerTailSequence`)
18
+ - `summary`: event/check/diagnostic counts
19
+ - `historyQuality`: `COMPLETE | PARTIAL | MINIMAL` with reasons
20
+ - `integrity`: ledger validation result
21
+ - `events`: normalized events (category, phase, provenance, references)
22
+
23
+ Filters are presentation-only; they never weaken integrity validation. Truncation via `--limit` is explicit (`truncated: true`).
24
+
25
+ ## trace
26
+
27
+ ```bash
28
+ forgeloop trace --task <id> --json
29
+ ```
30
+
31
+ Machine-readable reconstruction containing events, lifecycle transitions (including `VERIFICATION_STARTED`), check attempts, diagnostics (legacy diagnoses, structured cases, interventions, dispositions), failure signatures/surfaces, executions, evidence, continuity, recovery, completion, integrity, and snapshot anchors.
32
+
33
+ Failure surfaces include every canonically verified cycle; a successful
34
+ verification appears explicitly as `surface: []`, enabling deterministic
35
+ `REDUCED -> empty` and intervention `IMPROVED` classification.
36
+
37
+ Attempt cardinality comes primarily from ledger chronology: one ledger attempt plus its state checkpoint counts once; two distinct ledger events count twice; a state-only check appears as one fallback attempt (`source: "state-fallback"`). Phases are reconstructed forward from milestone events (`TASK_RECEIVED -> RECEIVED` ... `COMPLETION_VALIDATED -> COMPLETE`); events between milestones carry derived phases (for example failed verification -> `DIAGNOSING`, recorded intervention -> `CORRECTING`) with `phaseQuality: "authoritative" | "derived" | "unknown"`. Determinism: identical canonical artifacts produce identical traces except `snapshot.capturedAt`.
38
+
39
+ ## reflect
40
+
41
+ ```bash
42
+ forgeloop reflect --task <id> [--json]
43
+ ```
44
+
45
+ Whole-task retrospective (gain truth comes from the canonical cycle analysis;
46
+ `stallAnalysis` explains historical repetition without changing the fail-fast
47
+ stall decision): verification cycles, failure surfaces, hypothesis summary, intervention effectiveness (`PENDING | INFORMATIVE | NON_INFORMATIVE | IMPROVED | REGRESSED`), strategy fingerprints, oscillation patterns, signals, and a recommended protocol action. Deterministic — ForgeLoop does not call an LLM.
48
+
49
+ ## inspect --task
50
+
51
+ `forgeloop inspect --task <id>` extends target health with an additive `taskInspection` section: snapshot, lifecycle transitions, history quality, verification attempts per requirement, diagnostic summary, progress evaluation, integrity issues, deterministic explanation reason codes, and the safe next command. Existing top-level inspect fields are unchanged.
52
+
53
+ ## Read-only invariant
54
+
55
+ `history`, `trace`, `reflect`, `inspect`, `progress` never mutate protocol state, acquire ownership, or append events. Test suites enforce this by hashing the complete `.forgeloop` tree before/after invocation.
56
+
57
+ ## Durable actions in the trace
58
+
59
+ `trace --json` adds an `actions` projection with totals, state and capability
60
+ counts, required/verified/failed/ambiguous counts, repeated idempotency-key
61
+ attempts, reconciliation count, and action-event count. The projection reads
62
+ the task action artifacts and the same ledger already used by history; it is
63
+ not a second source of lifecycle truth.
64
+
65
+ An action recorded as `COMMIT_UNKNOWN` is an external-state uncertainty, not a
66
+ diagnostic failure. Reflection surfaces `EXTERNAL_ACTION_RECONCILIATION_REQUIRED`
67
+ and recommends `RECONCILE_EXTERNAL_ACTION` before ordinary retry guidance.
68
+ `FORGELOOP_EXECUTED`, `HOST_REPORTED`, and `EXTERNAL_OBSERVED` remain distinct
69
+ provenance values.
70
+
71
+ `forgeloop metrics --task <id> --json` projects trajectory counts, action
72
+ outcomes, observed executions, and first/last authoritative ledger timestamps.
73
+ Usage fields remain `null` with `source: "UNKNOWN"` when the host did not
74
+ report them. `forgeloop eval --task <id> --scenario <path> --json` evaluates a
75
+ validated current trace against a project-local reference scenario; an
76
+ efficiency ratio is omitted when no positive comparable-step reference exists.
@@ -382,6 +382,7 @@ forgeloop task-migrate --json
382
382
  ## 8. Next Steps
383
383
 
384
384
  - Continue a task across different AI harnesses: [`docs/CROSS_HARNESS_CONTINUITY.md`](./CROSS_HARNESS_CONTINUITY.md)
385
+ - Optional: use ForgeLoop through MCP or the Integration API — [`docs/MCP.md`](./MCP.md) and [`docs/UNIVERSAL_INTEGRATION.md`](./UNIVERSAL_INTEGRATION.md). MCP is not required; CLI and MCP share the same canonical project/task state.
385
386
  - Complete command reference: [`docs/CLI_REFERENCE.md`](./CLI_REFERENCE.md)
386
387
  - Artifact and schema reference: [`docs/ARTIFACT_REFERENCE.md`](./ARTIFACT_REFERENCE.md)
387
388
  - Common symptoms and recovery: [`docs/TROUBLESHOOTING.md`](./TROUBLESHOOTING.md)
package/docs/MCP.md ADDED
@@ -0,0 +1,159 @@
1
+ # ForgeLoop MCP
2
+
3
+ The `@cassiomc1/forgeloop-mcp` package is a **local-first MCP adapter** over
4
+ the canonical ForgeLoop integration API (`@cassiomc1/forgeloop/integration`).
5
+ It is an **adapter, never a second implementation**: every tool call executes
6
+ a canonical ForgeLoop command and every ownership value comes from the
7
+ canonical claim resolver.
8
+
9
+ Two transports ship in one package:
10
+
11
+ - `forgeloop-mcp` — **stdio**, the default/recommended transport;
12
+ - `forgeloop-mcp-http` — **optional** strict-modern MCP 2026 HTTP,
13
+ loopback-only (remote access is unsupported).
14
+
15
+ ## Core principles
16
+
17
+ - **No duplicated protocol logic.** The server contains no lifecycle,
18
+ ownership, recovery, lock, or transaction code.
19
+ - **No direct protocol-state access.** The adapter never reads or writes
20
+ `.forgeloop` files; all mutation flows through ForgeLoop's own guards
21
+ (locks, transactions, revision checks, ledger append serialization).
22
+ - **`COMPLETE` is not enough.** Claim release is presented exactly as the
23
+ canonical resolver reports it; forged COMPLETE stays INCONSISTENT with
24
+ historical claims retained.
25
+ - **Recovery acknowledgement is not authorization.** `acknowledgeRecovery`
26
+ in tool input only satisfies ForgeLoop's caller acknowledgement after the
27
+ server was started with recovery capability.
28
+
29
+ ## Modes
30
+
31
+ | Mode | Read | Loop mutations | task-resume | External | Maintenance | Recovery | Legacy repair | Force |
32
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
33
+ | `readonly` | yes | no | no | no | no | no | no | no |
34
+ | `safe` (default) | yes | yes | yes | no | no | no | no | no |
35
+ | `full` | yes | yes | yes | opt-in | opt-in | opt-in | opt-in | opt-in |
36
+
37
+ Capability flags (process-scoped, immutable after launch):
38
+ `--allow-external-execution`, `--allow-maintenance`, `--allow-recovery`,
39
+ `--allow-legacy-repair`, `--allow-force-recovery`.
40
+
41
+ ## Resources
42
+
43
+ - `forgeloop://protocol/info`
44
+ - `forgeloop://project/tasks`
45
+ - `forgeloop://task/{taskId}/status`
46
+ - `forgeloop://task/{taskId}/ownership` — canonical validated ownership
47
+ - `forgeloop://task/{taskId}/contract`
48
+ - `forgeloop://task/{taskId}/continuity`
49
+ - `forgeloop://task/{taskId}/actions`
50
+ - `forgeloop://task/{taskId}/action/{actionId}`
51
+ - `forgeloop://task/{taskId}/approvals`
52
+ - `forgeloop://task/{taskId}/metrics`
53
+ - `forgeloop://task/{taskId}/evaluations`
54
+ - `forgeloop://project/capability-policy`
55
+
56
+ The durable-action resources are read-only projections. The first release does
57
+ not expose `run-action` or host-attestation minting over MCP. An action that is
58
+ `COMMIT_UNKNOWN` is surfaced as an external reconciliation requirement; MCP
59
+ transport/session metadata cannot authorize a retry or manufacture
60
+ `HOST_ATTESTED` authority. Capability policy remains policy, not authority.
61
+
62
+ ### Approval resolution and reconciliation settlement capabilities
63
+
64
+ Two launch flags expose transport surfaces; neither creates host authority:
65
+
66
+ - `--allow-approval-resolution` exposes the `approval-resolve` tool.
67
+ Resolving an approval as `HOST_ATTESTED` still requires a trusted
68
+ out-of-band authority context supplied by the embedding host through
69
+ `createForgeLoopMcpServer({ authorityContextProvider })`. Without a
70
+ provider, `HOST_ATTESTED` resolutions fail closed with
71
+ `E_ACTION_AUTHORITY_REQUIRED`. Tool arguments can never carry the context:
72
+ any actor-supplied `authorityContext` property is stripped before dispatch.
73
+ - `--allow-reconciliation-settlement` exposes settlement-class
74
+ `action-reconcile` invocations (`--outcome COMMITTED|NOT_COMMITTED`).
75
+ Recording an `UNKNOWN` observation needs no special capability, but settling
76
+ external commit state is independently gated and still requires trusted
77
+ host attestation plus evidence at the core layer.
78
+
79
+ Capability introspection reports whether these surfaces are enabled
80
+ (`hostAttestationAvailable: false` by default) but never exposes grant
81
+ content.
82
+
83
+ Raw recovery artifacts, transaction journals, lock files, and unbounded event
84
+ ledgers are intentionally not exposed.
85
+
86
+ ## Optional stateless HTTP transport
87
+
88
+ `forgeloop-mcp-http` serves the same deterministic catalog over the **strict
89
+ modern** stateless MCP 2026 model (legacy-era traffic rejected):
90
+
91
+ ```bash
92
+ forgeloop-mcp-http --project /repo --mode safe # 127.0.0.1:3333
93
+ ```
94
+
95
+ - **Loopback only**: non-loopback binds fail closed with
96
+ `E_MCP_REMOTE_NOT_SUPPORTED`. Authenticated remote access is not designed
97
+ yet; Host validation is DNS-rebinding defense, not authentication.
98
+ - Strict modern: legacy-era handshakes are rejected, never silently served.
99
+ - Stateless: no session identity is issued, so transport metadata is never
100
+ ForgeLoop authority.
101
+ - Resource bounds: 4 MiB body cap, POST-only, header/request/keepalive
102
+ timeouts, in-flight ceiling (503 `E_MCP_HTTP_BUSY`).
103
+
104
+ ## Version matrix
105
+
106
+ | Component | Current contract |
107
+ | --- | --- |
108
+ | ForgeLoop core package | `1.5.x` repository generation |
109
+ | ForgeLoop protocol | `1` |
110
+ | Integration API | `1` |
111
+ | MCP package | `0.1.x` initial package |
112
+ | MCP protocol target | `2026-07-28` |
113
+
114
+ Repository implementation is separate from npm publication; nothing here
115
+ claims a published release.
116
+
117
+ ## Risk classes and gating examples
118
+
119
+ Invocations are classified at the adapter boundary:
120
+
121
+ ```text
122
+ READ_ONLY · LOOP_MUTATION · CLAIM_REACQUISITION · EXTERNAL_EXECUTION
123
+ MAINTENANCE · CLAIM_RELEASE_RECOVERY · LEGACY_MIGRATION · FORCE_DESTRUCTIVE
124
+ ```
125
+
126
+ Examples: `bundle` → MAINTENANCE (hidden in readonly/safe);
127
+ `task-resume` → CLAIM_REACQUISITION (available in safe — canonical claim
128
+ reacquisition); `task-recover` → CLAIM_RELEASE_RECOVERY (full +
129
+ `--allow-recovery`, plus the canonical acknowledgement); legacy repair →
130
+ separately gated/hidden; force unlock → separately gated. Tool input can
131
+ never elevate launch policy.
132
+
133
+ ## Bounds and timeouts
134
+
135
+ - Structured MCP input is byte-bounded (`E_MCP_INPUT_TOO_LARGE`).
136
+ - External execution cannot exceed the server launch timeout maximum:
137
+ omitted/null timeout receives the maximum; `0`, negative, non-integer, or
138
+ above-maximum values are refused.
139
+ - Tool, capabilities and resource output is bounded using the exact UTF-8
140
+ serialization actually transmitted. Oversized output fails closed with
141
+ `E_MCP_RESULT_TOO_LARGE` and is never silently truncated.
142
+
143
+ ## Adapter errors
144
+
145
+ Adapter-level errors are separate from the generated ForgeLoop core error
146
+ list in [TROUBLESHOOTING](./TROUBLESHOOTING.md):
147
+
148
+ | Code | Meaning |
149
+ | --- | --- |
150
+ | `E_MCP_INPUT_TOO_LARGE` | structured tool input exceeds the byte bound |
151
+ | `E_MCP_RESULT_TOO_LARGE` | serialized output exceeds the output bound |
152
+ | `E_MCP_HTTP_BUSY` | in-flight HTTP ceiling reached (503, Retry-After) |
153
+ | `E_MCP_REMOTE_NOT_SUPPORTED` | non-loopback bind attempted |
154
+ | `E_MCP_EXECUTION_TIMEOUT_INVALID` | timeout not a positive integer |
155
+ | `E_MCP_EXECUTION_TIMEOUT_EXCEEDS_LIMIT` | timeout above server maximum |
156
+ | `E_MCP_FORGELOOP_INTEGRATION_UNSUPPORTED` | installed core integration API mismatch |
157
+
158
+ Canonical ForgeLoop errors (e.g. `E_TASK_SCOPE_CONFLICT`,
159
+ `E_TASK_CLAIM_OWNERSHIP_INCONSISTENT`) are always preserved verbatim.
package/docs/RECIPES.md CHANGED
@@ -20,6 +20,8 @@ Concise, copy-paste friendly recipes for common ForgeLoop tasks.
20
20
  12. [Migrate Legacy 1.0 Single-Task Layout](#recipe-12--migrate-legacy-10-single-task-layout)
21
21
  13. [Record Decision Settlement Criteria](#recipe-13--record-decision-settlement-criteria)
22
22
  14. [Executable Policy, Baseline Ratchet, and Recovery](#recipe-14--executable-policy-baseline-ratchet-and-recovery)
23
+ 15. [Release and Reacquire Claims for an Abandoned Task](#recipe-15--release-and-reacquire-claims-for-an-abandoned-task)
24
+ 16. [Execute a Durable External Action Safely](#recipe-16--execute-a-durable-external-action-safely)
23
25
 
24
26
  ---
25
27
 
@@ -311,3 +313,150 @@ forgeloop next --task task-001 --json
311
313
  # Intentional operator-authorized baseline reset (not normal recovery)
312
314
  forgeloop baseline --record --policy-reset-authorized --json
313
315
  ```
316
+
317
+ ---
318
+
319
+ ### Recipe 15 — Release and Reacquire Claims for an Abandoned Task
320
+
321
+ ```bash
322
+ # 1. Inspect deterministic classification and structured next action
323
+ forgeloop next --task task-001 --json
324
+
325
+ # 2. RECOVERABLE must use reconcile-closure; do not use task-recover
326
+ forgeloop reconcile-closure --task task-001 --id <verification-id> \
327
+ --requirement "<exact verification text>" -- <verification-command>
328
+
329
+ # 3. Only STALE or ABANDONED may release effective claims
330
+ forgeloop task-recover --task task-001 --acknowledge-recovery --json
331
+
332
+ # 4. Other tasks may now adopt the released paths
333
+ forgeloop task-create --task replacement-task --claim src --json
334
+
335
+ # 5. Reacquisition fails while replacement-task owns src
336
+ forgeloop task-resume --task task-001 --json
337
+
338
+ # 6. After the conflicting owner completes, reacquire claims explicitly
339
+ forgeloop task-resume --task task-001 --claim src --json
340
+ ```
341
+
342
+ `--acknowledge-recovery` records caller acknowledgement only. It does not grant
343
+ host authority or mark the task complete. Recovery preserves work state,
344
+ receipts, failures, policy snapshots, and continuity until normal lifecycle
345
+ work resumes. Claims are released only after ForgeLoop validates the recovery
346
+ artifact against the complete ledger history. If `next` returns
347
+ `RESOLVE_RECOVERY_INCONSISTENCY`, run `validate-protocol`; do not create, edit,
348
+ or delete `recovery.json` manually.
349
+
350
+ ---
351
+
352
+ ### Recipe 16 — Execute a Durable External Action Safely
353
+
354
+ Record the intended external effect before execution, satisfy the capability
355
+ policy and fingerprint-bound approval, and execute with an exact argument list:
356
+
357
+ ```bash
358
+ forgeloop action-propose --task release --id action-publish --capability external.publish --effect-class EXTERNAL_PUBLICATION --target registry/release --operation "publish release" --idempotency-key release:publish:v1 --required-for-completion
359
+ forgeloop approval-request --task release --approval approval-publish --action action-publish --reason "reviewed release"
360
+ forgeloop approval-resolve --task release --approval approval-publish --decision APPROVED --authority CALLER_ACKNOWLEDGED
361
+ forgeloop run-action --task release --action action-publish --capability external.publish --effect-class EXTERNAL_PUBLICATION --target registry/release --idempotency-key release:publish:v1 --required-for-completion -- npm publish
362
+ # If the external outcome cannot be proven after start, do not retry:
363
+ forgeloop action-reconcile --task release --action action-publish --outcome UNKNOWN
364
+ ```
365
+
366
+ Provenance and authority truths for this recipe:
367
+
368
+ - `CALLER_ACKNOWLEDGED` approval resolution records an acknowledgement; if the
369
+ capability policy requires `REQUIRE_APPROVAL`, only a fresh `HOST_ATTESTED`
370
+ approval resolved through a trusted embedding-host boundary authorizes the
371
+ action. The standalone CLI can never mint it.
372
+ - `forgeloop next` evaluates the current capability policy before inspecting
373
+ approval state, but only after validating that the capability artifact is
374
+ bound to the active policy lock and task snapshot. Historical or stale
375
+ approvals never override `ALLOW`, `DENY`, or `REQUIRE_AUTHORITY`; only a
376
+ currently applicable `REQUIRE_APPROVAL` decision can make a pending approval
377
+ the active resolver target.
378
+ - `commands` in next-action guidance are safe standalone CLI commands. A
379
+ host-only authorization is returned with `commands: []` and structured
380
+ `hostActionRequired`/`authorityRequired` data so an embedding host can invoke
381
+ `action-authorize` while preserving its trusted authority context.
382
+ - `approval-request` is policy-aware: it creates a pending approval only for
383
+ `REQUIRE_APPROVAL`; `ALLOW`, `DENY`, and `REQUIRE_AUTHORITY` reject the request
384
+ without creating an approval artifact. A changed `capabilities.json` alone is
385
+ not a valid policy update: restore the recorded epoch or refresh the lock and
386
+ task snapshot through the supported policy lifecycle first.
387
+ - `COMMIT_UNKNOWN` is an explicit reconciliation boundary, not a failed retry.
388
+ Recording `UNKNOWN` keeps the action ambiguous. Settling `COMMITTED` or
389
+ `NOT_COMMITTED` requires trusted host attestation plus evidence through a
390
+ trusted integration boundary. A trusted `NOT_COMMITTED` returns the action
391
+ to `PROPOSED` so authorization is re-evaluated before any retry.
392
+
393
+ After commit ambiguity is settled as `COMMITTED`, verify the independent
394
+ postcondition before completion:
395
+
396
+ ```bash
397
+ forgeloop run-check --task release --id check-release-live --requirement publication -- node scripts/check-release-live.js
398
+ forgeloop action-verify --task release --action action-publish --evidence <execution-ref>
399
+ ```
400
+
401
+ `COMMITTED != VERIFIED`: exit code 0 from the action command proves local
402
+ completion only. Verification requires canonical evidence from an independent
403
+ check execution.
404
+
405
+ Inspect the observed trajectory without inventing usage data:
406
+
407
+ ```bash
408
+ forgeloop metrics --task release --json
409
+ forgeloop eval --task release --scenario scenarios/release.json --json
410
+ ```
411
+
412
+ The efficiency comparison is present only when the scenario declares a
413
+ positive `reference.comparableSteps`; absent host token/cost/model data stays
414
+ unknown.
415
+
416
+ ## Run ForgeLoop through MCP (safe mode)
417
+
418
+ Start the local MCP adapter and inspect what it exposes:
419
+
420
+ ```bash
421
+ forgeloop-mcp --project . --mode safe
422
+ ```
423
+
424
+ `safe` mode permits reads, normal loop mutations, and canonical `task-resume`.
425
+ Call the `forgeloop_capabilities` tool first: it reports versions, features,
426
+ launch policy, and the resource list. Task ownership is available from the
427
+ `forgeloop://task/{taskId}/ownership` resource — always the canonical claim
428
+ resolver projection.
429
+
430
+ ## Resume a recovered task through MCP
431
+
432
+ Recovered tasks stay mutation-disabled until claims are reacquired:
433
+
434
+ ```json
435
+ { "tool": "forgeloop_task_resume", "arguments": { "taskId": "my-task" } }
436
+ ```
437
+
438
+ Conflicting claims fail with `E_TASK_SCOPE_CONFLICT` and keep recovery intact.
439
+ Ordinary mutations against a recovered task are refused by core regardless of
440
+ transport.
441
+
442
+ ## Deliberately opt into external execution
443
+
444
+ `run-check`/`reconcile-closure` require a full-mode launch flag; tool input
445
+ cannot grant it:
446
+
447
+ ```bash
448
+ forgeloop-mcp --mode full --allow-external-execution
449
+ ```
450
+
451
+ Execution uses exact argv arrays only — there is no generic shell tool — and
452
+ the server `--max-execution-time-ms` ceiling always applies. Output is bounded
453
+ on the exact UTF-8 serialization transmitted (`E_MCP_RESULT_TOO_LARGE`);
454
+ oversized structured input fails with `E_MCP_INPUT_TOO_LARGE`.
455
+
456
+ ## Diagnose loopback-only HTTP errors
457
+
458
+ `forgeloop-mcp-http` binds loopback only. A non-loopback bind fails closed
459
+ with `E_MCP_REMOTE_NOT_SUPPORTED`; remote/authenticated HTTP is unsupported.
460
+ Host/Origin validation is DNS-rebinding defense, not authentication. Under
461
+ load, requests beyond the in-flight ceiling receive 503 `E_MCP_HTTP_BUSY`
462
+ with `Retry-After`.
@@ -0,0 +1,38 @@
1
+ # ForgeLoop 1.4.0 release checklist
2
+
3
+ This checklist prepares the validated claim-recovery capability for release. It does not authorize publication, tagging, or deployment.
4
+
5
+ ## Ownership and recovery gates
6
+
7
+ - [ ] Fake, deleted, corrupt, schema-invalid, and mismatched `recovery.json` cases resolve to `INCONSISTENT`.
8
+ - [ ] `INCONSISTENT` preserves historical claims, disables mutation, blocks overlapping acquisition, and is visible in list/show/status/audit/inspect/next.
9
+ - [ ] Only a fully matched recovery artifact and append-only recovery history releases claims.
10
+ - [ ] `task-recover` remains restricted to `STALE` and `ABANDONED`; `RECOVERABLE` keeps its canonical reconciliation path.
11
+ - [ ] `task-resume` validates ownership, settles only an unchanged stale task lock, and reacquires claims under the project claims lock.
12
+ - [ ] Project claim locks classify `NONE`, `LIVE`, `STALE`, `UNKNOWN`, and `CORRUPT`, with CAS-safe stale settlement.
13
+ - [ ] Manually forged COMPLETE state cannot release claims.
14
+ - [ ] Canonically completed task does release claims.
15
+ - [ ] Corrupt/missing completion lifecycle proof retains historical claims.
16
+ - [ ] Task locks with incomplete identity classify UNKNOWN.
17
+ - [ ] Single COMPLETE/RECOVERED task can be inspected implicitly by READ commands.
18
+ - [ ] Single COMPLETE/RECOVERED task cannot be selected implicitly for mutation.
19
+ - [ ] Ownership ledger validation is not redundantly repeated inside one immutable snapshot.
20
+ - [ ] Legacy recovery repair CAS-settles only unchanged stale task locks.
21
+ - [ ] Legacy recovery repair refuses UNKNOWN/CORRUPT task locks.
22
+ - [ ] alreadyRepaired requires a fully valid canonical recovery relationship.
23
+ - [ ] No exported claim helper releases claims from COMPLETE phase alone.
24
+ - [ ] Legacy recovery migration v1 accepts only CALLER_ACKNOWLEDGED authority.
25
+
26
+ ## Compatibility and package gates
27
+
28
+ - [ ] `package.json` and `package-lock.json` agree on `1.4.0`.
29
+ - [ ] `protocol-info --json` advertises `features.taskClaimRecovery.validatedClaimProjection=true` and task-recovery schema v1.
30
+ - [ ] Documentation states that active task-recovery schema v1 requires a recovery-aware ForgeLoop reader (`>=1.4.0`).
31
+ - [ ] The packed package contains the recovery schema, claim-state core, recovery-history core, and this checklist.
32
+ - [ ] `npm test && npm run lint && npm run coverage && npm run docs:check && npm run pack:check && npm run pack:smoke && npm run dependency:policy` passes once on the release candidate.
33
+ - [ ] `git diff --check` and the repository ForgeLoop audit pass.
34
+
35
+ ## Publication boundary
36
+
37
+ - [ ] A separately authorized release workflow verifies the final commit, `v1.4.0` tag, npm metadata, tarball digests, and GitHub release identity.
38
+ - [ ] No actor treats caller acknowledgement as `HOST_ATTESTED` authority.
@@ -0,0 +1,78 @@
1
+ # ForgeLoop 1.5.0 + MCP release checklist
2
+
3
+ Preparation checklist for the `@cassiomc1/forgeloop` 1.5.0 and
4
+ `@cassiomc1/forgeloop-mcp` releases. It does not authorize publication.
5
+
6
+ ## Core integration gates
7
+
8
+ - [ ] Core package version is `1.5.0`; integration API version is `1`.
9
+ - [ ] `exports` map exposes only `.` and `./integration`.
10
+ - [ ] Executor registry is in parity with canonical command definitions.
11
+ - [ ] `bundle` is MAINTENANCE-gated; hidden in readonly/safe.
12
+ - [ ] `resolveForgeLoopProjectRoot` applies CLI target semantics (symlinks rejected).
13
+ - [ ] Integration limits bound strings, arrays, argv, and structured inputs.
14
+
15
+ ## MCP package gates
16
+
17
+ - [ ] Official SDK v2; target protocol generation `2026-07-28`.
18
+ - [ ] stdio works with clean stdout (protocol-only) and JSON stderr diagnostics.
19
+ - [ ] HTTP is strict modern (`legacy: "reject"`) and loopback-only
20
+ (`E_MCP_REMOTE_NOT_SUPPORTED` for any other bind).
21
+ - [ ] Transport bounds active: header/request/keepalive timeouts, 4 MiB body cap,
22
+ POST-only, in-flight ceiling (503 `E_MCP_HTTP_BUSY`).
23
+ - [ ] Tool/resource catalogs are deterministic and identical across transports.
24
+ - [ ] Task-aware mutation tools require explicit `taskId`.
25
+ - [ ] Capability gates re-checked per invocation; tool input cannot elevate policy.
26
+ - [ ] `task-recover`, legacy repair, and force unlock are separately gated;
27
+ legacy repair hidden by default; `operatorAuthorized` absent from schemas.
28
+ - [ ] No generic shell/exec tool exists.
29
+
30
+ ## Ownership/recovery parity
31
+
32
+ - [ ] `task/ownership` derives exclusively from the canonical claim resolver.
33
+ - [ ] Forged COMPLETE stays INCONSISTENT with retained claims on every surface.
34
+ - [ ] RECOVERED tasks block ordinary mutation; `task-resume` reacquires canonically.
35
+ - [ ] Concurrent resume yields exactly one winner.
36
+
37
+ ## Safety
38
+
39
+ - [ ] `maxExecutionTimeMs` enforced: missing→max, zero/negative/float rejected,
40
+ over-max rejected.
41
+ - [ ] Error payloads preserve canonical codes; secrets redacted; stacks stripped;
42
+ messages bounded.
43
+ - [ ] Oversized tool/resource output refused with `E_MCP_RESULT_TOO_LARGE`.
44
+
45
+ ## Packaging/docs
46
+
47
+ - [ ] Core tarball contains integration modules and both integration docs.
48
+ - [ ] MCP tarball contains both bins, src, README; core tarball never ships
49
+ `integrations/`.
50
+ - [ ] Server `serverInfo.version` equals MCP package.json version.
51
+ - [ ] MCP README documents stdio-default + optional loopback-only HTTP.
52
+ - [ ] THIRD_PARTY_NOTICES covers the Model Context Protocol SDK.
53
+ - [ ] CHANGELOG entries present.
54
+
55
+ ## Exact output-bound gates (post-PR #80)
56
+
57
+ - [ ] Output bounds measure the exact UTF-8 serialization transmitted
58
+ (pretty-printed included), not compact JSON.
59
+ - [ ] Compact-below/pretty-above regression covered by tests.
60
+ - [ ] UTF-8 byte-count regression covered by tests.
61
+ - [ ] `forgeloop_capabilities` complete result is bounded like command tools.
62
+ - [ ] Non-size serialization errors are rethrown, not mislabeled as overflow.
63
+ - [ ] Structured tool input is byte-bounded (`E_MCP_INPUT_TOO_LARGE`).
64
+
65
+ ## Documentation gates
66
+
67
+ - [ ] Repository-wide documentation audit complete.
68
+ - [ ] Documentation manifest/index current.
69
+ - [ ] Generated references current (`docs:generate` leaves no diff).
70
+ - [ ] README / CHANGELOG current.
71
+ - [ ] MCP / Universal Integration docs current.
72
+ - [ ] Security docs current.
73
+
74
+ ## Publication boundary
75
+
76
+ - [ ] Release identity verification passes.
77
+ - [ ] Publication of either package is separately authorized; this checklist
78
+ does not itself authorize npm publishing.