@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
@@ -0,0 +1,55 @@
1
+ # Documentation diagrams
2
+
3
+ The ForgeLoop architecture flow is authored as typed Archify workflow IR in
4
+ [`forgeloop-engineering-flow.workflow.json`](./forgeloop-engineering-flow.workflow.json).
5
+ The checked-in outputs are generated from that source with the pinned Archify
6
+ v2.15.0 toolchain. The animated interactive explorer is the primary experience:
7
+
8
+ - [animated HTML explorer](../assets/diagrams/forgeloop-engineering-flow.html)
9
+ - [animated, self-contained SVG fallback](../assets/diagrams/forgeloop-engineering-flow.svg)
10
+ - [deterministic generation receipt](../assets/diagrams/forgeloop-engineering-flow.receipt.json)
11
+
12
+ The canonical source sets `meta.animation` to `trace`, so the explorer and SVG
13
+ trace the workflow edges and nodes. Use the explorer's Present, playback, and
14
+ focus controls for the full animated experience; the SVG remains available for
15
+ repository previews and text-only fallbacks.
16
+
17
+ [`manifest.json`](./manifest.json) is the governance source for diagram types,
18
+ renderer support, canonical purposes, artifact ownership, and required
19
+ references. The persistent human approval is kept separately in
20
+ [`reviews/forgeloop-engineering-flow.review.json`](./reviews/forgeloop-engineering-flow.review.json).
21
+
22
+ The JSON IR is the source of truth. Do not edit the generated HTML or SVG by
23
+ hand. Run `npm run docs:diagrams` to regenerate the outputs and
24
+ `npm run docs:diagrams:check` to validate the pinned renderer, source semantics,
25
+ animation markers, artifact fingerprints, persistent review binding, manifest
26
+ ownership, and GitHub-safe SVG constraints.
27
+
28
+ The HTML view opens in Archify's dark presentation stage so the official flow
29
+ is visible without scrolling; its Present and playback controls expose the
30
+ animated trace, while reduced-motion preferences remain respected. The SVG
31
+ fallback also carries the trace-capable styles and intentionally defaults to the
32
+ dark presentation so it remains legible in repository previews; the adjacent text fallback in
33
+ [`README.md`](../../README.md#architecture-flow) carries the same lifecycle
34
+ semantics for text-only readers.
35
+
36
+ Archify is vendored at `vendor/archify/v2.15.0/archify` under its MIT license.
37
+ The exact source commit and cryptographic vendor-tree hash are recorded in
38
+ `vendor/archify/v2.15.0/PIN.json`; generated-file hashes are recorded in the
39
+ receipt and the visual approval binds the current source and SVG fingerprints.
40
+
41
+ `PIN.json` uses ForgeLoop Archify PIN `schemaVersion: 2`. This version describes
42
+ the metadata and integrity-declaration format and is independent of Archify's
43
+ upstream release version. A future PIN format change must increment the schema
44
+ version and update the validator before new files are accepted; it does not
45
+ change the vendored tree digest.
46
+
47
+ The ForgeLoop Archify wrapper is intentionally documentation-scoped. It reads
48
+ canonical inputs only from `docs/diagrams/` and permits deliver outputs only
49
+ under `docs/assets/diagrams/`.
50
+
51
+ ForgeLoop governs five documentation-diagram categories: workflow,
52
+ architecture, sequence, dataflow, and lifecycle. The current repository has
53
+ one canonical workflow diagram. Governance support does not imply renderer
54
+ support: a type requires an explicit renderer mapping before it can be added as
55
+ an active diagram.
@@ -0,0 +1,122 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "workflow",
4
+ "meta": {
5
+ "title": "ForgeLoop Evidence-First Engineering Flow",
6
+ "subtitle": "Typed intent → gated work → validator-backed closure",
7
+ "animation": "trace",
8
+ "visual_preset": "signal-flow",
9
+ "quality_profile": "showcase",
10
+ "views": [
11
+ {
12
+ "id": "contract-to-work",
13
+ "label": "Contract to work",
14
+ "focus": ["request", "profile", "contract", "route", "gates", "preflight", "work"],
15
+ "note": "Follow how a request becomes scoped, routed, and safe to execute."
16
+ },
17
+ {
18
+ "id": "evidence-to-close",
19
+ "label": "Evidence to close",
20
+ "focus": ["work", "evidence", "review", "valid"],
21
+ "note": "See the evidence and review boundary that makes completion trustworthy."
22
+ },
23
+ {
24
+ "id": "recovery-loop",
25
+ "label": "Recovery loop",
26
+ "focus": ["evidence", "diagnose", "correct", "preflight", "blocked"],
27
+ "note": "Failures return to diagnosis and correction before another claim is made."
28
+ }
29
+ ],
30
+ "legend": {
31
+ "mode": "auto",
32
+ "entries": {
33
+ "frontend": { "label": "Human-facing surface" },
34
+ "backend": { "label": "ForgeLoop state" },
35
+ "database": { "label": "Durable evidence" },
36
+ "cloud": { "label": "External boundary" },
37
+ "security": { "label": "Policy or gate" },
38
+ "messagebus": { "label": "Recovery signal" },
39
+ "external": { "label": "Request or result" }
40
+ }
41
+ },
42
+ "viewBox": [720, 900]
43
+ },
44
+ "lanes": [
45
+ { "id": "intent", "label": "Intent + Context" },
46
+ { "id": "policy", "label": "Policy Boundary" },
47
+ { "id": "execution", "label": "Resumable Execution" },
48
+ { "id": "evidence", "label": "Evidence Ledger" },
49
+ { "id": "recovery", "label": "Recovery + Stops", "variant": "exception" },
50
+ { "id": "closure", "label": "Review + Closure" }
51
+ ],
52
+ "phases": [
53
+ { "id": "discover", "label": "Discover + scope", "fromCol": 0, "toCol": 2 },
54
+ { "id": "authorize", "label": "Route + authorize", "fromCol": 3, "toCol": 4, "variant": "emphasis" },
55
+ { "id": "verify", "label": "Execute + verify", "fromCol": 5, "toCol": 5, "variant": "dashed" }
56
+ ],
57
+ "groups": [
58
+ { "id": "contract_boundary", "label": "Contract boundary", "lane": "policy", "fromCol": 3, "toCol": 5, "variant": "emphasis" },
59
+ { "id": "evidence_boundary", "label": "Evidence boundary", "lane": "evidence", "fromCol": 4, "toCol": 5, "variant": "dashed" },
60
+ { "id": "recovery_path", "label": "Reconcile before retry", "lane": "recovery", "fromCol": 0, "toCol": 2, "variant": "security" }
61
+ ],
62
+ "mainPath": ["request", "profile", "contract", "route", "gates", "preflight", "work", "evidence", "review", "valid"],
63
+ "nodes": [
64
+ { "id": "request", "lane": "intent", "col": 0, "type": "external", "label": "Request", "sublabel": "intent", "width": 50 },
65
+ { "id": "profile", "lane": "intent", "col": 1, "type": "backend", "label": "Profile", "sublabel": "facts", "width": 50 },
66
+ { "id": "contract", "lane": "intent", "col": 2, "type": "security", "label": "Contract", "sublabel": "scope", "tag": "saved", "width": 50 },
67
+ { "id": "route", "lane": "policy", "col": 2, "type": "security", "label": "Route", "sublabel": "guides", "tag": "fail closed", "width": 50 },
68
+ { "id": "gates", "lane": "policy", "col": 3, "type": "security", "label": "Gates", "sublabel": "policy", "width": 50 },
69
+ { "id": "preflight", "lane": "policy", "col": 4, "type": "security", "label": "READY", "sublabel": "unlock", "tag": "PREFLIGHT", "width": 50 },
70
+ { "id": "work", "lane": "execution", "col": 4, "type": "backend", "label": "Work", "sublabel": "checkpoint", "width": 50 },
71
+ { "id": "evidence", "lane": "evidence", "col": 4, "type": "database", "label": "Evidence", "sublabel": "checks", "tag": "freshness", "width": 50 },
72
+ { "id": "review", "lane": "closure", "col": 5, "type": "backend", "label": "Review", "sublabel": "drift", "width": 50 },
73
+ { "id": "valid", "lane": "evidence", "col": 5, "type": "database", "label": "VALID", "sublabel": "validator", "tag": "claim", "width": 50 },
74
+ { "id": "diagnose", "lane": "recovery", "col": 2, "type": "messagebus", "label": "Diagnose", "sublabel": "failure", "width": 50 },
75
+ { "id": "correct", "lane": "recovery", "col": 1, "type": "backend", "label": "Correct", "sublabel": "repair", "width": 50 },
76
+ { "id": "blocked", "lane": "recovery", "col": 0, "type": "security", "label": "Blocked", "sublabel": "stop", "width": 50 }
77
+ ],
78
+ "edges": [
79
+ { "id": "request-profile", "from": "request", "to": "profile", "variant": "emphasis" },
80
+ { "id": "profile-contract", "from": "profile", "to": "contract", "variant": "default" },
81
+ { "id": "contract-route", "from": "contract", "to": "route", "variant": "emphasis", "fromSide": "bottom", "toSide": "top", "route": "drop" },
82
+ { "id": "route-gates", "from": "route", "to": "gates", "variant": "emphasis" },
83
+ { "id": "gates-preflight", "from": "gates", "to": "preflight", "variant": "security", "fromSide": "bottom", "toSide": "bottom", "route": "bottom-channel", "channelY": 312 },
84
+ { "id": "preflight-work", "from": "preflight", "to": "work", "variant": "emphasis", "fromSide": "bottom", "toSide": "top", "route": "drop" },
85
+ { "id": "work-evidence", "from": "work", "to": "evidence", "variant": "dashed", "fromSide": "bottom", "toSide": "top", "route": "drop" },
86
+ { "id": "evidence-review", "from": "evidence", "to": "review", "variant": "emphasis", "fromSide": "left", "toSide": "left", "route": "return-left", "channelX": 360 },
87
+ { "id": "review-valid", "from": "review", "to": "valid", "variant": "emphasis", "fromSide": "right", "toSide": "right", "route": "outside-right", "channelX": 760 },
88
+ { "id": "evidence-diagnose", "from": "evidence", "to": "diagnose", "variant": "security", "role": "error", "fromSide": "left", "toSide": "right", "route": "return-left", "channelX": 360 },
89
+ { "id": "diagnose-correct", "from": "diagnose", "to": "correct", "variant": "dashed", "role": "branch", "fromSide": "left", "toSide": "right", "route": "return-left" },
90
+ { "id": "correct-evidence", "from": "correct", "to": "evidence", "variant": "security", "role": "return", "fromSide": "left", "toSide": "left", "route": "return-left", "channelX": 160 },
91
+ { "id": "correct-blocked", "from": "correct", "to": "blocked", "variant": "dashed", "role": "branch", "fromSide": "left", "toSide": "right", "route": "return-left" }
92
+ ],
93
+ "cards": [
94
+ {
95
+ "dot": "rose",
96
+ "title": "Safety boundary",
97
+ "items": [
98
+ "Execution starts only after PREFLIGHT_READY",
99
+ "Failures return to diagnosis before another claim",
100
+ "Completion is validator-backed, not inferred from a screenshot"
101
+ ]
102
+ },
103
+ {
104
+ "dot": "cyan",
105
+ "title": "Evidence contract",
106
+ "items": [
107
+ "run-check binds commands to an execution reference",
108
+ "record-check covers manual observations",
109
+ "Drift reopens verification instead of being hidden"
110
+ ]
111
+ },
112
+ {
113
+ "dot": "emerald",
114
+ "title": "Portable output",
115
+ "items": [
116
+ "JSON IR is the source of truth",
117
+ "HTML stays explorable and SVG stays GitHub-safe",
118
+ "The text fallback carries the same lifecycle semantics"
119
+ ]
120
+ }
121
+ ]
122
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "version": 2,
3
+ "renderer": {
4
+ "name": "archify",
5
+ "version": "2.15.0",
6
+ "commit": "e1ac748f19cf805e44bf74fb93c796662152e273",
7
+ "source": "https://github.com/tt-a1i/archify/tree/v2.15.0",
8
+ "license": "MIT"
9
+ },
10
+ "policy": {
11
+ "supportedTypes": [
12
+ "workflow",
13
+ "architecture",
14
+ "sequence",
15
+ "dataflow",
16
+ "lifecycle"
17
+ ],
18
+ "requireVisualReview": true
19
+ },
20
+ "diagrams": [
21
+ {
22
+ "id": "forgeloop-engineering-flow",
23
+ "type": "workflow",
24
+ "defaultTheme": "dark",
25
+ "canonicalFor": [
26
+ "high-level-engineering-flow"
27
+ ],
28
+ "source": "docs/diagrams/forgeloop-engineering-flow.workflow.json",
29
+ "html": "docs/assets/diagrams/forgeloop-engineering-flow.html",
30
+ "svg": "docs/assets/diagrams/forgeloop-engineering-flow.svg",
31
+ "receipt": "docs/assets/diagrams/forgeloop-engineering-flow.receipt.json",
32
+ "review": "docs/diagrams/reviews/forgeloop-engineering-flow.review.json",
33
+ "fallback": "README.md#architecture-flow",
34
+ "referencedBy": [
35
+ "README.md",
36
+ "DOCS_INDEX.md",
37
+ "docs/DOCUMENTATION_GUIDE.md",
38
+ "docs/diagrams/README.md"
39
+ ]
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": 1,
3
+ "diagramId": "forgeloop-engineering-flow",
4
+ "status": "approved",
5
+ "binding": {
6
+ "sourceSha256": "e4778296d1b9b2129b1ff6c956acaa1e7faba3dbfe68e0e5a6fb47dae3499308",
7
+ "svgSha256": "f549d1f998c2c84793783b9b6ce7aabe05d9a91edebecb764403c67dfbb4cc52"
8
+ },
9
+ "checks": {
10
+ "darkThemeLegible": true,
11
+ "noOverlap": true,
12
+ "labelsReadable": true,
13
+ "trustBoundariesClear": true,
14
+ "mobilePreviewAcceptable": true,
15
+ "textFallbackEquivalent": true,
16
+ "accessibleMetadataPresent": true
17
+ },
18
+ "reviewedBy": "repository-maintainer",
19
+ "reviewedAt": "2026-08-26"
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cassiomc1/forgeloop",
3
- "version": "1.3.0",
3
+ "version": "1.6.0",
4
4
  "description": "Portable, verifiable engineering protocol for AI coding environments and developer workflows",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,8 +45,8 @@
45
45
  ".github/copilot-instructions.md",
46
46
  "README.md",
47
47
  "DOCS_INDEX.md",
48
- "docs/forgeloop-flow.mmd",
49
- "docs/assets/forgeloop-flow.svg",
48
+ "docs/diagrams",
49
+ "docs/assets/diagrams",
50
50
  "docs/GETTING_STARTED.md",
51
51
  "docs/CROSS_HARNESS_CONTINUITY.md",
52
52
  "docs/CLI_REFERENCE.md",
@@ -54,15 +54,22 @@
54
54
  "docs/TROUBLESHOOTING.md",
55
55
  "docs/RECIPES.md",
56
56
  "docs/DOCUMENTATION_GUIDE.md",
57
- "scripts/CI_VALIDATORS.md"
57
+ "docs/RELEASE_CHECKLIST_1_4.md",
58
+ "scripts/CI_VALIDATORS.md",
59
+ "docs/MCP.md",
60
+ "docs/UNIVERSAL_INTEGRATION.md",
61
+ "docs/DIAGNOSTIC_MODEL.md",
62
+ "docs/EXECUTION_TRACE.md",
63
+ "docs/RELEASE_CHECKLIST_1_5_MCP.md"
58
64
  ],
59
65
  "scripts": {
60
66
  "test": "node scripts/run-tests.js",
61
67
  "pack:check": "node --test tests/package.test.js",
62
68
  "pack:smoke": "node scripts/package_smoke.mjs",
63
69
  "release:identity": "node scripts/verify_release_identity.mjs",
64
- "docs:flow": "node scripts/generate-readme-flow.mjs",
65
- "docs:diagram:check": "node scripts/check-generated-diagram.mjs",
70
+ "docs:diagrams": "node scripts/generate-documentation-diagrams.mjs",
71
+ "docs:diagrams:check": "node scripts/check-documentation-diagrams.mjs",
72
+ "docs:diagram:inventory": "node scripts/documentation-diagram-inventory.mjs --json",
66
73
  "docs:generate": "node scripts/generate_documentation_reference.mjs --write",
67
74
  "docs:generated:check": "node scripts/generate_documentation_reference.mjs --check",
68
75
  "docs:conformance": "node scripts/validate_documentation_conformance.mjs",
@@ -71,11 +78,17 @@
71
78
  "docs:check": "node scripts/run-docs-check.js",
72
79
  "lint": "eslint .",
73
80
  "coverage": "c8 --all --include=src/**/*.js --reporter=text --reporter=lcov --check-coverage --lines=80 --functions=75 --branches=70 --statements=80 node scripts/run-tests.js",
74
- "dependency:policy": "node scripts/check-dependency-policy.mjs"
81
+ "dependency:policy": "node scripts/check-dependency-policy.mjs",
82
+ "mcp:test": "node --test integrations/mcp/tests/*.test.js",
83
+ "mcp:setup": "node scripts/mcp-setup.mjs",
84
+ "mcp:pack:check": "node scripts/mcp-package-smoke.mjs"
75
85
  },
76
86
  "devDependencies": {
77
- "@mermaid-js/mermaid-cli": "^11.16.0",
78
87
  "c8": "^12.0.0",
79
88
  "eslint": "^9.39.5"
89
+ },
90
+ "exports": {
91
+ ".": "./src/cli.js",
92
+ "./integration": "./src/integration.js"
80
93
  }
81
94
  }
@@ -0,0 +1,100 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/action.schema.json",
4
+ "title": "ForgeLoop durable action artifact",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "taskId",
9
+ "actionId",
10
+ "actionFingerprint",
11
+ "effectClass",
12
+ "capability",
13
+ "operation",
14
+ "target",
15
+ "idempotencyKey",
16
+ "requiredForCompletion",
17
+ "requirement",
18
+ "provenance",
19
+ "state",
20
+ "revision",
21
+ "createdAt",
22
+ "updatedAt"
23
+ ],
24
+ "properties": {
25
+ "schemaVersion": { "const": 1 },
26
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 256 },
27
+ "actionId": { "type": "string", "pattern": "^action-[A-Za-z0-9_-]+$" },
28
+ "actionFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
29
+ "effectClass": {
30
+ "enum": [
31
+ "READ_ONLY",
32
+ "REVERSIBLE_WRITE",
33
+ "IRREVERSIBLE_WRITE",
34
+ "EXTERNAL_PUBLICATION",
35
+ "DESTRUCTIVE"
36
+ ]
37
+ },
38
+ "capability": {
39
+ "enum": [
40
+ "filesystem.read",
41
+ "filesystem.write",
42
+ "process.execute",
43
+ "dependency.install",
44
+ "network.read",
45
+ "network.write",
46
+ "repository.commit",
47
+ "repository.push",
48
+ "repository.pull_request",
49
+ "external.publish",
50
+ "external.delete",
51
+ "deployment.execute"
52
+ ]
53
+ },
54
+ "operation": { "type": "string", "minLength": 1, "maxLength": 512 },
55
+ "target": { "type": "string", "minLength": 1, "maxLength": 512 },
56
+ "idempotencyKey": { "oneOf": [{ "type": "string", "minLength": 1, "maxLength": 512 }, { "type": "null" }] },
57
+ "requiredForCompletion": { "type": "boolean" },
58
+ "requirement": { "oneOf": [{ "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "null" }] },
59
+ "provenance": {
60
+ "enum": [
61
+ "FORGELOOP_EXECUTED",
62
+ "HOST_ATTESTED",
63
+ "CALLER_REPORTED",
64
+ "HOST_REPORTED",
65
+ "EXTERNAL_OBSERVED"
66
+ ]
67
+ },
68
+ "state": {
69
+ "enum": [
70
+ "PROPOSED",
71
+ "AUTHORIZED",
72
+ "STARTED",
73
+ "COMMITTED",
74
+ "VERIFIED",
75
+ "FAILED",
76
+ "COMMIT_UNKNOWN",
77
+ "CANCELLED"
78
+ ]
79
+ },
80
+ "revision": { "type": "integer", "minimum": 0 },
81
+ "createdAt": { "type": "string", "minLength": 1 },
82
+ "updatedAt": { "type": "string", "minLength": 1 },
83
+ "lastEvidenceRef": { "oneOf": [{ "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "null" }] },
84
+ "lastReconciliationAt": { "oneOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }] },
85
+ "commitResultCode": {
86
+ "oneOf": [
87
+ {
88
+ "enum": [
89
+ "IDEMPOTENCY_PROTECTED",
90
+ "RECONCILED_COMMITTED",
91
+ "RECONCILED_NOT_COMMITTED",
92
+ "AMBIGUOUS"
93
+ ]
94
+ },
95
+ { "type": "null" }
96
+ ]
97
+ }
98
+ },
99
+ "additionalProperties": false
100
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/approval.schema.json",
4
+ "title": "ForgeLoop durable action approval artifact",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "taskId",
9
+ "approvalId",
10
+ "actionId",
11
+ "actionFingerprint",
12
+ "contractFingerprint",
13
+ "taskRevision",
14
+ "capability",
15
+ "status",
16
+ "requestedAt"
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": { "const": 1 },
20
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 256 },
21
+ "approvalId": { "type": "string", "pattern": "^approval-[A-Za-z0-9_-]+$" },
22
+ "actionId": { "type": "string", "pattern": "^action-[A-Za-z0-9_-]+$" },
23
+ "actionFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
24
+ "contractFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
25
+ "taskRevision": { "type": "integer", "minimum": 0 },
26
+ "capability": {
27
+ "enum": [
28
+ "filesystem.read",
29
+ "filesystem.write",
30
+ "process.execute",
31
+ "dependency.install",
32
+ "network.read",
33
+ "network.write",
34
+ "repository.commit",
35
+ "repository.push",
36
+ "repository.pull_request",
37
+ "external.publish",
38
+ "external.delete",
39
+ "deployment.execute"
40
+ ]
41
+ },
42
+ "status": { "enum": ["PENDING", "APPROVED", "REJECTED"] },
43
+ "requestedAt": { "type": "string", "minLength": 1 },
44
+ "reason": { "oneOf": [{ "type": "string", "maxLength": 512 }, { "type": "null" }] },
45
+ "decision": { "enum": ["APPROVED", "REJECTED"] },
46
+ "resolvedAt": { "oneOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }] },
47
+ "authorityKind": { "enum": ["CALLER_ACKNOWLEDGED", "HOST_ATTESTED"] },
48
+ "hostGrantRef": { "oneOf": [{ "type": "string", "maxLength": 256 }, { "type": "null" }] }
49
+ },
50
+ "additionalProperties": false
51
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/capability-policy.schema.json",
4
+ "title": "ForgeLoop project capability policy",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "defaultDecision", "rules"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "defaultDecision": { "enum": ["ALLOW", "DENY"] },
10
+ "rules": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "object",
14
+ "required": ["capability", "decision"],
15
+ "properties": {
16
+ "capability": {
17
+ "enum": [
18
+ "filesystem.read",
19
+ "filesystem.write",
20
+ "process.execute",
21
+ "dependency.install",
22
+ "network.read",
23
+ "network.write",
24
+ "repository.commit",
25
+ "repository.push",
26
+ "repository.pull_request",
27
+ "external.publish",
28
+ "external.delete",
29
+ "deployment.execute"
30
+ ]
31
+ },
32
+ "decision": {
33
+ "enum": ["ALLOW", "DENY", "REQUIRE_AUTHORITY", "REQUIRE_APPROVAL"]
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ }
39
+ },
40
+ "additionalProperties": false
41
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/diagnostic-case.schema.json",
4
+ "title": "ForgeLoop structured diagnostic case",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "verificationCycle", "diagnosticRevision", "failureClass", "observations", "contributors", "hypotheses", "nextSafeAction", "diagnosticFingerprint"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "verificationCycle": { "type": "integer", "minimum": 1 },
10
+ "diagnosticRevision": { "type": "integer", "minimum": 1 },
11
+ "failureClass": { "type": "string", "minLength": 1 },
12
+ "observations": {
13
+ "type": "array",
14
+ "maxItems": 64,
15
+ "items": {
16
+ "type": "object",
17
+ "required": ["id", "kind", "statement"],
18
+ "properties": {
19
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
20
+ "kind": { "enum": ["CHECK_RESULT", "EXECUTION_RESULT", "REPOSITORY_STATE", "ENVIRONMENT_STATE", "DEPENDENCY_STATE", "MANUAL_OBSERVATION", "PROTOCOL_STATE"] },
21
+ "evidenceRef": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
22
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 },
23
+ "verificationCycle": { "type": "integer", "minimum": 1 },
24
+ "provenance": { "enum": ["FORGELOOP_EXECUTED", "ACTOR_REPORTED", "MANUAL_OBSERVATION"] }
25
+ },
26
+ "additionalProperties": false
27
+ }
28
+ },
29
+ "contributors": {
30
+ "type": "array",
31
+ "maxItems": 64,
32
+ "items": {
33
+ "type": "object",
34
+ "required": ["id", "type", "statement"],
35
+ "properties": {
36
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
37
+ "type": { "enum": ["CODE", "CONFIGURATION", "ARCHITECTURE", "DEPENDENCY", "ENVIRONMENT", "DATA", "TIMING", "CONCURRENCY", "STATE", "AUTHORITY", "CAPABILITY", "ASSUMPTION", "INTERFACE", "PROCESS", "EXTERNAL_SERVICE", "UNKNOWN"] },
38
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 },
39
+ "basis": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1 } },
40
+ "status": { "enum": ["OBSERVED", "INFERRED", "SUSPECTED", "ELIMINATED", "CONFIRMED_RELEVANT"] }
41
+ },
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "hypotheses": {
46
+ "type": "array",
47
+ "minItems": 1,
48
+ "maxItems": 32,
49
+ "items": {
50
+ "type": "object",
51
+ "required": ["id", "statement", "settledBy"],
52
+ "properties": {
53
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
54
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 },
55
+ "contributorRefs": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1 } },
56
+ "evidenceRefs": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1 } },
57
+ "settledBy": {
58
+ "type": "object",
59
+ "required": ["type"],
60
+ "properties": {
61
+ "type": { "enum": ["PREDICATE", "CHECK_STATUS", "FAILURE_SIGNATURE_CHANGE", "REQUIREMENT_STATUS", "MANUAL_OBSERVATION"] },
62
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 },
63
+ "checkId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
64
+ "expectedStatus": { "type": "string", "minLength": 1 }
65
+ },
66
+ "additionalProperties": false
67
+ },
68
+ "status": { "const": "OPEN" }
69
+ },
70
+ "additionalProperties": false
71
+ }
72
+ },
73
+ "nextSafeAction": {
74
+ "type": "object",
75
+ "required": ["statement"],
76
+ "properties": {
77
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 }
78
+ },
79
+ "additionalProperties": false
80
+ },
81
+ "diagnosticFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
82
+ "previousDiagnosticFingerprint": { "oneOf": [{ "type": "null" }, { "type": "string", "pattern": "^[a-f0-9]{64}$" }] }
83
+ },
84
+ "additionalProperties": false
85
+ }
@@ -20,6 +20,22 @@
20
20
  "selectedGuides": { "type": "array", "items": { "type": "string" } },
21
21
  "changedPaths": { "type": "array", "items": { "type": "string" } },
22
22
  "checks": { "type": "array", "items": { "type": "object" } },
23
+ "actions": {
24
+ "type": "object",
25
+ "required": ["count", "required", "verified", "failed", "ambiguous", "pending", "actionRefs"],
26
+ "properties": {
27
+ "count": { "type": "integer", "minimum": 0 },
28
+ "required": { "type": "integer", "minimum": 0 },
29
+ "verified": { "type": "integer", "minimum": 0 },
30
+ "trustedSatisfied": { "type": "integer", "minimum": 0 },
31
+ "unresolvedRequired": { "type": "integer", "minimum": 0 },
32
+ "failed": { "type": "integer", "minimum": 0 },
33
+ "ambiguous": { "type": "integer", "minimum": 0 },
34
+ "pending": { "type": "integer", "minimum": 0 },
35
+ "actionRefs": { "type": "array", "items": { "type": "string", "pattern": "^action-[A-Za-z0-9_-]+$" } }
36
+ },
37
+ "additionalProperties": false
38
+ },
23
39
  "evidence": {
24
40
  "type": "array",
25
41
  "items": {
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/hypothesis-disposition.schema.json",
4
+ "title": "ForgeLoop hypothesis disposition record",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "verificationCycle", "hypothesisRef", "status", "evidenceRefs", "reason"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "verificationCycle": { "type": "integer", "minimum": 1 },
10
+ "hypothesisRef": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
11
+ "status": { "enum": ["SUPPORTED", "WEAKENED", "FALSIFIED", "SUPERSEDED", "UNRESOLVED"] },
12
+ "evidenceRefs": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "type": "string", "minLength": 1 } },
13
+ "reason": { "type": "string", "minLength": 1, "maxLength": 4096 }
14
+ },
15
+ "additionalProperties": false
16
+ }