@cassiomc1/forgeloop 1.13.0 → 1.14.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 (211) hide show
  1. package/AGENT_COMPATIBILITY.md +8 -0
  2. package/DOCS_INDEX.md +35 -3
  3. package/ENG/nodejs-backend-development-eng.md +2 -2
  4. package/ENG/sec-code-eng.md +7 -7
  5. package/EXECUTION_STATE.md +12 -0
  6. package/LOOP_ENGINEERING.md +28 -2
  7. package/ORCHESTRATOR_INTEGRATION.md +9 -5
  8. package/PROTOCOL_INTEGRATION.md +55 -2
  9. package/README.md +40 -25
  10. package/TERMINOLOGY.md +2 -0
  11. package/THREAT_MODEL.md +140 -1
  12. package/completions/_forgeloop +19 -1
  13. package/completions/forgeloop.bash +37 -1
  14. package/completions/forgeloop.fish +123 -1
  15. package/docs/ADVISORY_CONTEXT.md +25 -0
  16. package/docs/AGENT_BROWSER_ADAPTER.md +81 -0
  17. package/docs/AGENT_BROWSER_VERIFICATION.md +6 -0
  18. package/docs/AGENT_PROTOCOL_SUMMARY.md +27 -2
  19. package/docs/AGENT_SKILL.md +66 -0
  20. package/docs/ARTIFACT_REFERENCE.md +123 -0
  21. package/docs/AUDIT_UX.md +46 -0
  22. package/docs/BROWSER_VERIFICATION.md +136 -0
  23. package/docs/CLI_REFERENCE.md +366 -6
  24. package/docs/CODE_ATTESTATION.md +2 -2
  25. package/docs/DOCUMENTATION_GUIDE.md +32 -11
  26. package/docs/JEV_BENCHMARKS.md +31 -0
  27. package/docs/MODEL_ROUTING.md +37 -0
  28. package/docs/OPENSRC_ADAPTER.md +241 -0
  29. package/docs/PACKAGE_CONTENTS.md +35 -8
  30. package/docs/PROVIDERS.md +126 -0
  31. package/docs/PROVIDER_ARCHITECTURE.md +199 -0
  32. package/docs/RECIPES.md +9 -0
  33. package/docs/RELEASE_CHECKLIST.md +38 -5
  34. package/docs/SECURITY_REVIEW.md +71 -0
  35. package/docs/SEMANTIC_DECISION_PLANE.md +71 -0
  36. package/docs/TEST_INTELLIGENCE.md +29 -0
  37. package/docs/TEST_PRUNING.md +14 -0
  38. package/docs/TROUBLESHOOTING.md +198 -1
  39. package/docs/UNIVERSAL_INTEGRATION.md +31 -0
  40. package/docs/assets/diagrams/forgeloop-code-attestation-flow.html +2 -2
  41. package/docs/assets/diagrams/forgeloop-code-attestation-flow.receipt.json +5 -5
  42. package/docs/assets/diagrams/forgeloop-code-attestation-flow.svg +1 -1
  43. package/docs/assets/diagrams/forgeloop-engineering-flow.html +39 -26
  44. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +6 -6
  45. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +26 -26
  46. package/docs/assets/diagrams/forgeloop-verification-trust-flow.html +2 -1
  47. package/docs/assets/diagrams/forgeloop-verification-trust-flow.receipt.json +5 -5
  48. package/docs/assets/diagrams/forgeloop-verification-trust-flow.svg +1 -1
  49. package/docs/diagrams/README.md +13 -9
  50. package/docs/diagrams/forgeloop-code-attestation-flow.workflow.json +1 -1
  51. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +24 -19
  52. package/docs/diagrams/forgeloop-verification-trust-flow.workflow.json +1 -0
  53. package/docs/diagrams/reviews/forgeloop-code-attestation-flow.review.json +4 -4
  54. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +4 -4
  55. package/docs/diagrams/reviews/forgeloop-verification-trust-flow.review.json +4 -4
  56. package/docs/documentation-manifest.json +750 -5
  57. package/docs/protocol-requirements.json +24 -0
  58. package/package.json +30 -3
  59. package/schemas/config.schema.json +14 -0
  60. package/schemas/context-plan.schema.json +18 -0
  61. package/schemas/semantic-decision.schema.json +46 -0
  62. package/schemas/test-utility.schema.json +44 -0
  63. package/scripts/CI_VALIDATORS.md +6 -6
  64. package/scripts/benchmark-jev.mjs +5 -0
  65. package/scripts/benchmark-test-intelligence.mjs +4 -0
  66. package/scripts/generate-agent-protocol-summary.mjs +4 -1
  67. package/scripts/generate-forgeloop-skill.mjs +133 -0
  68. package/scripts/jev-smoke.mjs +19 -0
  69. package/skills/forgeloop/README.md +9 -0
  70. package/skills/forgeloop/SKILL.md +77 -0
  71. package/skills/forgeloop/references/lifecycle.md +9 -0
  72. package/skills/forgeloop/references/recovery.md +7 -0
  73. package/skills/forgeloop/references/verification.md +7 -0
  74. package/src/adapters/agent-browser/assertions.js +47 -0
  75. package/src/adapters/agent-browser/commands.js +54 -0
  76. package/src/adapters/agent-browser/index.js +3 -0
  77. package/src/adapters/agent-browser/locator.js +40 -0
  78. package/src/adapters/agent-browser/process.js +215 -0
  79. package/src/adapters/agent-browser/provider.js +313 -0
  80. package/src/adapters/emulated-services/constants.js +24 -0
  81. package/src/adapters/emulated-services/index.js +7 -0
  82. package/src/adapters/emulated-services/process.js +162 -0
  83. package/src/adapters/emulated-services/provider.js +282 -0
  84. package/src/adapters/opensrc/normalize.js +90 -0
  85. package/src/adapters/opensrc/process.js +248 -0
  86. package/src/adapters/opensrc/provider.js +338 -0
  87. package/src/adapters/opensrc/search.js +264 -0
  88. package/src/adapters/typesafe/client.js +28 -0
  89. package/src/adapters/typesafe/engine.js +63 -0
  90. package/src/adapters/typesafe/normalize.js +41 -0
  91. package/src/cli.js +108 -0
  92. package/src/commands/checkpoint-revalidate.js +176 -0
  93. package/src/commands/context-plan.js +38 -0
  94. package/src/commands/contract-create.js +264 -0
  95. package/src/commands/contract-revise.js +236 -0
  96. package/src/commands/decision-show.js +14 -0
  97. package/src/commands/decision-status.js +22 -0
  98. package/src/commands/discover.js +41 -0
  99. package/src/commands/doctor.js +15 -0
  100. package/src/commands/gate-record.js +205 -0
  101. package/src/commands/gate-revalidate.js +137 -0
  102. package/src/commands/model-route.js +32 -0
  103. package/src/commands/route.js +146 -18
  104. package/src/commands/semantic-plan.js +17 -0
  105. package/src/commands/task-abandon.js +224 -0
  106. package/src/commands/task-migrate-contract-bootstrap-repair.js +288 -0
  107. package/src/commands/task-repair-contract-bootstrap.js +263 -0
  108. package/src/commands/test-inventory.js +5 -0
  109. package/src/commands/test-prune-plan.js +5 -0
  110. package/src/commands/test-prune-probe.js +5 -0
  111. package/src/commands/test-utility.js +5 -0
  112. package/src/commands/validate-protocol.js +10 -1
  113. package/src/core/artifact-registry.js +24 -0
  114. package/src/core/audit-ux.js +514 -0
  115. package/src/core/browser-verification/constants.js +149 -0
  116. package/src/core/browser-verification/normalize.js +254 -0
  117. package/src/core/browser-verification/provider.js +519 -0
  118. package/src/core/browser-verification/service.js +115 -0
  119. package/src/core/checkpoint-revalidation.js +319 -0
  120. package/src/core/cli-command-definitions.js +241 -0
  121. package/src/core/command-executors.js +110 -0
  122. package/src/core/command-input.js +115 -43
  123. package/src/core/completion-artifacts.js +14 -5
  124. package/src/core/completion.js +4 -6
  125. package/src/core/config.js +3 -0
  126. package/src/core/context-compiler/budget.js +9 -0
  127. package/src/core/context-compiler/candidates.js +39 -0
  128. package/src/core/context-compiler/compiler.js +63 -0
  129. package/src/core/context-compiler/fingerprint.js +11 -0
  130. package/src/core/context-compiler/policy.js +13 -0
  131. package/src/core/context-compiler/result.js +23 -0
  132. package/src/core/contract-bootstrap-recovery.js +655 -0
  133. package/src/core/contract-revision.js +210 -0
  134. package/src/core/decision/artifact.js +69 -0
  135. package/src/core/decision/benchmarks.js +103 -0
  136. package/src/core/decision/cache.js +27 -0
  137. package/src/core/decision/constants.js +58 -0
  138. package/src/core/decision/cutover.js +34 -0
  139. package/src/core/decision/engine.js +22 -0
  140. package/src/core/decision/errors.js +68 -0
  141. package/src/core/decision/events.js +101 -0
  142. package/src/core/decision/freshness.js +19 -0
  143. package/src/core/decision/normalizers/index.js +115 -0
  144. package/src/core/decision/policy.js +18 -0
  145. package/src/core/decision/projection.js +16 -0
  146. package/src/core/decision/question-registry.js +201 -0
  147. package/src/core/decision/request.js +26 -0
  148. package/src/core/decision/resolver.js +130 -0
  149. package/src/core/decision/result.js +58 -0
  150. package/src/core/decision/service.js +156 -0
  151. package/src/core/decision/state-builder.js +65 -0
  152. package/src/core/decision/task-bindings.js +30 -0
  153. package/src/core/decision/test-provider.js +32 -0
  154. package/src/core/decision/thresholds.js +15 -0
  155. package/src/core/error-codes.js +278 -0
  156. package/src/core/events.js +226 -57
  157. package/src/core/evidence-readiness.js +9 -0
  158. package/src/core/execution-prerequisites.js +14 -0
  159. package/src/core/execution-profile.js +63 -38
  160. package/src/core/gate-provenance.js +124 -0
  161. package/src/core/integration-invocation-policy.js +27 -4
  162. package/src/core/integration-resources.js +86 -61
  163. package/src/core/model-router/constants.js +10 -0
  164. package/src/core/model-router/policy.js +103 -0
  165. package/src/core/model-router/router.js +37 -0
  166. package/src/core/next-action-model.js +58 -0
  167. package/src/core/next-action-phases.js +130 -42
  168. package/src/core/next-action-refresh.js +43 -9
  169. package/src/core/next-action-review-phase.js +7 -2
  170. package/src/core/next-action.js +35 -7
  171. package/src/core/phase.js +128 -10
  172. package/src/core/preflight-consistency.js +23 -9
  173. package/src/core/preflight-loaders.js +37 -5
  174. package/src/core/protocol-info.js +65 -0
  175. package/src/core/protocol.js +20 -0
  176. package/src/core/reconcile-closure.js +128 -52
  177. package/src/core/recovery-history.js +1 -0
  178. package/src/core/resumability.js +154 -44
  179. package/src/core/route-artifact.js +15 -1
  180. package/src/core/router.js +67 -1
  181. package/src/core/runtime-context.js +118 -61
  182. package/src/core/schema-validation.js +3 -0
  183. package/src/core/security-review/constants.js +64 -0
  184. package/src/core/security-review/normalize.js +245 -0
  185. package/src/core/security-review/provider.js +204 -0
  186. package/src/core/security-review/service.js +134 -0
  187. package/src/core/semantic-planning/constants.js +19 -0
  188. package/src/core/semantic-planning/projection.js +94 -0
  189. package/src/core/semantic-planning/service.js +15 -0
  190. package/src/core/sources.js +37 -0
  191. package/src/core/task-claim-state.js +201 -1
  192. package/src/core/task-conflict-inspection.js +31 -5
  193. package/src/core/task-paths.js +13 -0
  194. package/src/core/task-recovery.js +1 -0
  195. package/src/core/templates.js +3 -0
  196. package/src/core/test-intelligence/benchmarks.js +68 -0
  197. package/src/core/test-intelligence/inventory.js +73 -0
  198. package/src/core/test-intelligence/prune.js +90 -0
  199. package/src/core/test-intelligence/semantic-state.js +15 -0
  200. package/src/core/test-intelligence/service.js +40 -0
  201. package/src/core/test-intelligence/utility.js +50 -0
  202. package/src/core/trace.js +11 -7
  203. package/src/core/transaction.js +1 -0
  204. package/src/integration.d.ts +492 -0
  205. package/src/integration.js +54 -0
  206. package/src/providers/README.md +47 -0
  207. package/src/providers/capabilities.js +46 -0
  208. package/src/providers/errors.js +15 -0
  209. package/src/providers/index.js +29 -0
  210. package/src/providers/json-snapshot.js +105 -0
  211. package/src/providers/registry.js +152 -0
@@ -72,6 +72,30 @@
72
72
  "statement": "A structural-quality integration MUST preserve unavailable, malformed, stale, incomparable, and blocked provider results without promoting them to PASS.",
73
73
  "tests": ["tests/sentrux-structural-quality-provider.test.js", "tests/structural-quality-artifacts.test.js"],
74
74
  "validator": "src/core/structural-quality/provider.js"
75
+ },
76
+ "FL-PROVIDER-001": {
77
+ "source": "PROTOCOL_INTEGRATION.md",
78
+ "statement": "The providerExtensions capability MUST remain provider-neutral and experimental, and MUST NOT imply a public generic provider registry API.",
79
+ "tests": ["tests/protocol-info.test.js", "tests/provider-capabilities.test.js"],
80
+ "validator": "src/core/protocol-info.js"
81
+ },
82
+ "FL-PROVIDER-002": {
83
+ "source": "PROTOCOL_INTEGRATION.md",
84
+ "statement": "Every advertised provider kind MUST deny lifecycle, completion, and evidence authority.",
85
+ "tests": ["tests/provider-capabilities.test.js"],
86
+ "validator": "src/providers/capabilities.js"
87
+ },
88
+ "FL-PROVIDER-003": {
89
+ "source": "PROTOCOL_INTEGRATION.md",
90
+ "statement": "Provider results MUST cross a strict JSON snapshot boundary before consumer use.",
91
+ "tests": ["tests/provider-architecture.test.js"],
92
+ "validator": "src/providers/json-snapshot.js"
93
+ },
94
+ "FL-PROVIDER-004": {
95
+ "source": "PROTOCOL_INTEGRATION.md",
96
+ "statement": "The generic provider registry MUST remain absent from the public package subpath exports.",
97
+ "tests": ["tests/provider-architecture.test.js", "tests/package.test.js"],
98
+ "validator": "package.json"
75
99
  }
76
100
  }
77
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cassiomc1/forgeloop",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Portable, verifiable engineering protocol for AI coding environments and developer workflows",
5
5
  "repository": {
6
6
  "type": "git",
@@ -60,6 +60,7 @@
60
60
  "docs/CROSS_HARNESS_CONTINUITY.md",
61
61
  "docs/ADVISORY_CONTEXT.md",
62
62
  "docs/RIPWIRE_ADAPTER.md",
63
+ "docs/OPENSRC_ADAPTER.md",
63
64
  "docs/CLI_REFERENCE.md",
64
65
  "docs/ARTIFACT_REFERENCE.md",
65
66
  "docs/TROUBLESHOOTING.md",
@@ -68,9 +69,21 @@
68
69
  "docs/DOCUMENTATION_GUIDE.md",
69
70
  "docs/RELEASE_CHECKLIST.md",
70
71
  "docs/PACKAGE_CONTENTS.md",
72
+ "docs/PROVIDER_ARCHITECTURE.md",
73
+ "docs/PROVIDERS.md",
74
+ "docs/SECURITY_REVIEW.md",
75
+ "docs/BROWSER_VERIFICATION.md",
76
+ "docs/AGENT_BROWSER_ADAPTER.md",
77
+ "docs/AGENT_BROWSER_VERIFICATION.md",
78
+ "docs/JEV_BENCHMARKS.md",
79
+ "docs/MODEL_ROUTING.md",
80
+ "docs/SEMANTIC_DECISION_PLANE.md",
81
+ "docs/TEST_INTELLIGENCE.md",
82
+ "docs/TEST_PRUNING.md",
71
83
  "scripts/CI_VALIDATORS.md",
72
84
  "docs/MCP.md",
73
85
  "docs/UNIVERSAL_INTEGRATION.md",
86
+ "docs/AUDIT_UX.md",
74
87
  "docs/DIAGNOSTIC_MODEL.md",
75
88
  "docs/EXECUTION_TRACE.md",
76
89
  "docs/CODE_ATTESTATION.md",
@@ -78,12 +91,18 @@
78
91
  "docs/SIGNING_PROVIDERS.md",
79
92
  "docs/PLATFORM_ADAPTERS.md",
80
93
  "docs/AGENT_PROTOCOL_SUMMARY.md",
94
+ "docs/AGENT_SKILL.md",
81
95
  "docs/EXECUTION_PROFILE_BENCHMARKS.md",
82
96
  "docs/REPOSITORY_INDEX.md",
83
97
  "docs/PERSISTENT_SEARCH_TRANSPORT.md",
84
98
  "docs/KNOWLEDGE_SOURCES.md",
85
99
  "scripts/generate-shell-completions.mjs",
86
100
  "scripts/generate-agent-protocol-summary.mjs",
101
+ "scripts/generate-forgeloop-skill.mjs",
102
+ "scripts/jev-smoke.mjs",
103
+ "scripts/benchmark-jev.mjs",
104
+ "scripts/benchmark-test-intelligence.mjs",
105
+ "skills/forgeloop",
87
106
  "scripts/run-execution-profile-benchmarks.mjs",
88
107
  "scripts/summarize-execution-profile-benchmarks.mjs",
89
108
  "scripts/validate-execution-profile-benchmarks.mjs",
@@ -128,13 +147,15 @@
128
147
  "mcp:test": "node scripts/run-mcp-tests.mjs",
129
148
  "completions:generate": "node scripts/generate-shell-completions.mjs --write",
130
149
  "completions:check": "node scripts/generate-shell-completions.mjs --check",
131
- "test:quick": "node --test tests/cli.test.js tests/schema-health.test.js tests/schema-golden.test.js tests/protocol-info.test.js tests/integration-capabilities.test.js tests/ci-classify.test.js tests/validation-tiers.test.js",
150
+ "test:quick": "node --import=./scripts/test-semantic-provider-loader.mjs --test tests/cli.test.js tests/schema-health.test.js tests/schema-golden.test.js tests/protocol-info.test.js tests/integration-capabilities.test.js tests/ci-classify.test.js tests/validation-tiers.test.js",
132
151
  "performance:check": "node scripts/benchmark-cli-startup.mjs",
133
152
  "critical-coverage:check": "node scripts/check-critical-coverage.mjs",
134
153
  "changelog:check": "node scripts/check-changelog-freshness.mjs",
135
154
  "attestation:summary": "node scripts/write-forgeloop-attestation-summary.mjs",
136
155
  "summary:generate": "node scripts/generate-agent-protocol-summary.mjs --write",
137
156
  "summary:check": "node scripts/generate-agent-protocol-summary.mjs --check",
157
+ "skill:generate": "node scripts/generate-forgeloop-skill.mjs --write",
158
+ "skill:check": "node scripts/generate-forgeloop-skill.mjs --check",
138
159
  "mcp:setup": "node scripts/mcp-setup.mjs",
139
160
  "mcp:pack:check": "node scripts/mcp-package-smoke.mjs",
140
161
  "poc:evidence:verify": "node scripts/verify_poc_evidence.mjs",
@@ -148,11 +169,16 @@
148
169
  "transactions:compact": "node scripts/compact-transactions.mjs",
149
170
  "complexity:check": "node scripts/check-complexity.mjs",
150
171
  "repository-index:manifest": "node scripts/verify-tgrep-manifest.mjs",
172
+ "repository:hygiene": "node scripts/check-repository-hygiene.mjs",
151
173
  "task-discovery:benchmark": "node scripts/benchmark-task-discovery.mjs",
152
174
  "verify:fast": "node scripts/run-validation.mjs --tier fast",
153
175
  "verify:local": "node scripts/run-validation.mjs --tier local",
154
176
  "verify:prepush": "node scripts/run-validation.mjs --tier prepush",
155
- "verify:release": "node scripts/run-validation.mjs --tier release"
177
+ "verify:release": "node scripts/run-validation.mjs --tier release",
178
+ "jev:smoke": "node scripts/jev-smoke.mjs",
179
+ "benchmark:jev": "node scripts/benchmark-jev.mjs",
180
+ "benchmark:jev:live": "node scripts/benchmark-jev.mjs --live",
181
+ "benchmark:test-intelligence": "node scripts/benchmark-test-intelligence.mjs"
156
182
  },
157
183
  "devDependencies": {
158
184
  "c8": "^12.0.0",
@@ -161,6 +187,7 @@
161
187
  "yaml": "2.9.0"
162
188
  },
163
189
  "dependencies": {
190
+ "@typesafe-ai/sdk": "0.6.0",
164
191
  "smol-toml": "1.8.0"
165
192
  },
166
193
  "exports": {
@@ -12,6 +12,20 @@
12
12
  "policy": { "type": "string", "minLength": 1 },
13
13
  "requiredGates": { "type": "array", "items": { "type": "string", "minLength": 1 } },
14
14
  "requiredEvidence": { "type": "array", "items": { "type": "string", "minLength": 1 } },
15
+ "decisionEngine": {
16
+ "type": "object",
17
+ "required": ["required", "provider", "model", "policyVersion", "requestTimeoutMs", "maxRetries", "cache"],
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "required": { "const": true },
21
+ "provider": { "const": "typesafe-jev" },
22
+ "model": { "const": "jev-1.13.0" },
23
+ "policyVersion": { "const": 1 },
24
+ "requestTimeoutMs": { "type": "integer", "minimum": 500, "maximum": 60000 },
25
+ "maxRetries": { "type": "integer", "minimum": 0, "maximum": 3 },
26
+ "cache": { "type": "boolean" }
27
+ }
28
+ },
15
29
  "structuralQuality": {
16
30
  "type": "object",
17
31
  "additionalProperties": false,
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/context-plan.schema.json",
4
+ "title": "ForgeLoop bounded context plan",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "protocolVersion", "profile", "budget", "candidateItems", "selectedItems", "candidateChars", "selectedChars", "selected", "omitted", "mandatoryIds", "promptInjectionIds", "candidateSetFingerprint", "tokenUsage", "decisionFingerprint", "authority", "evidenceAuthority", "lifecycleAuthority", "completionAuthority"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 }, "protocolVersion": { "const": 1 },
9
+ "profile": { "enum": ["light", "balanced", "full"] },
10
+ "budget": { "type": "object", "required": ["maxItems", "maxChars"], "properties": { "maxItems": { "type": "integer", "minimum": 1 }, "maxChars": { "type": "integer", "minimum": 1 } }, "additionalProperties": false },
11
+ "candidateItems": { "type": "integer", "minimum": 0 }, "selectedItems": { "type": "integer", "minimum": 0 }, "candidateChars": { "type": "integer", "minimum": 0 }, "selectedChars": { "type": "integer", "minimum": 0 },
12
+ "selected": { "type": "array", "items": { "type": "object" } }, "omitted": { "type": "array", "items": { "type": "object" } },
13
+ "mandatoryIds": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "promptInjectionIds": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "candidateSetFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
14
+ "tokenUsage": { "type": "object", "required": ["inputTokens", "outputTokens", "reportedBy"], "properties": { "inputTokens": { "type": ["integer", "null"] }, "outputTokens": { "type": ["integer", "null"] }, "reportedBy": { "enum": ["PROVIDER", "HOST", "UNKNOWN"] } }, "additionalProperties": false },
15
+ "decisionFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "authority": { "const": "SEMANTIC_DECISION" }, "evidenceAuthority": { "const": "NONE" }, "lifecycleAuthority": { "const": false }, "completionAuthority": { "const": false }
16
+ },
17
+ "additionalProperties": false
18
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/semantic-decision.schema.json",
4
+ "title": "ForgeLoop semantic decision",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "protocolVersion", "taskId", "decisionId", "decisionKind", "engine", "model", "questionSetId", "questionSetVersion", "questionSetFingerprint", "policyVersion", "stateFingerprint", "policyFingerprint", "answers", "confidence", "decision", "usage", "authority", "evidenceAuthority", "lifecycleAuthority", "completionAuthority", "ownershipAuthority", "installationAuthority", "recordedAt"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "protocolVersion": { "const": 1 },
10
+ "taskId": { "type": "string", "minLength": 1 },
11
+ "decisionId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$" },
12
+ "decisionKind": { "type": "string", "minLength": 1 },
13
+ "engine": { "const": "typesafe-jev" },
14
+ "model": { "const": "jev-1.13.0" },
15
+ "questionSetId": { "type": "string", "minLength": 1 },
16
+ "questionSetVersion": { "type": "integer", "minimum": 1 },
17
+ "questionSetFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
18
+ "questionSet": { "type": "object", "required": ["id", "version", "decisionKind", "questions", "fingerprint"], "properties": { "id": { "type": "string", "minLength": 1 }, "version": { "type": "integer", "minimum": 1 }, "decisionKind": { "type": "string", "minLength": 1 }, "questions": { "type": "object" }, "fingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "candidateIds": { "type": "array", "items": { "type": "string" } }, "metadata": { "type": "object" } }, "additionalProperties": true },
19
+ "policyVersion": { "const": 1 },
20
+ "stateFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
21
+ "taskStateFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] },
22
+ "semanticStateFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] },
23
+ "policyFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
24
+ "repositoryFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "object" }, { "type": "null" }] },
25
+ "contractFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] },
26
+ "routeFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] },
27
+ "verificationCycle": { "oneOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }] },
28
+ "candidateSetFingerprint": { "oneOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] },
29
+ "answers": { "type": "object" },
30
+ "confidence": { "type": "object" },
31
+ "decision": { "type": "object" },
32
+ "usage": {
33
+ "type": "object", "required": ["inputTokens", "outputTokens", "reportedBy"], "additionalProperties": false,
34
+ "properties": { "inputTokens": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "outputTokens": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "reportedBy": { "enum": ["PROVIDER", "HOST", "UNKNOWN"] } }
35
+ },
36
+ "latencyMs": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
37
+ "authority": { "const": "SEMANTIC_DECISION" },
38
+ "evidenceAuthority": { "const": "NONE" },
39
+ "lifecycleAuthority": { "const": false },
40
+ "completionAuthority": { "const": false },
41
+ "ownershipAuthority": { "const": false },
42
+ "installationAuthority": { "const": false },
43
+ "recordedAt": { "type": "string", "minLength": 1 }
44
+ },
45
+ "additionalProperties": false
46
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/test-utility.schema.json",
4
+ "title": "ForgeLoop test utility analysis",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "protocolVersion", "taskId", "generatedAt", "inventoryFingerprint", "semanticStatus", "tests"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "protocolVersion": { "const": 1 },
10
+ "taskId": { "type": "string", "minLength": 1 },
11
+ "generatedAt": { "type": "string", "minLength": 1 },
12
+ "inventoryFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
13
+ "semanticStatus": { "enum": ["PROVIDER_REPORTED", "UNAVAILABLE", "NOT_REQUESTED"] },
14
+ "decisionId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$" },
15
+ "semanticDecisionFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
16
+ "decisionIds": { "type": "array", "items": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$" } },
17
+ "semanticDecisionFingerprints": { "type": "array", "items": { "type": "string", "pattern": "^[a-f0-9]{64}$" } },
18
+ "tests": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "required": ["testId", "file", "framework", "name", "classification", "recommendation", "protected"],
23
+ "properties": {
24
+ "testId": { "type": "string", "pattern": "^test-[a-f0-9]{24}$" },
25
+ "file": { "type": "string", "minLength": 1 },
26
+ "framework": { "type": "string", "minLength": 1 },
27
+ "suite": { "type": "string" },
28
+ "name": { "type": "string", "minLength": 1 },
29
+ "line": { "type": "integer", "minimum": 1 },
30
+ "sourceSummary": { "type": "string" },
31
+ "targets": { "type": "array", "items": { "type": "string" } },
32
+ "runtimeMs": { "type": ["number", "null"], "minimum": 0 },
33
+ "uniqueBranches": { "type": ["integer", "null"], "minimum": 0 },
34
+ "classification": { "enum": ["KEEP_REQUIRED", "KEEP_UNIQUE", "KEEP_RISK_GUARD", "KEEP_AUTHORITY_BOUNDARY", "KEEP_RECOVERY_INVARIANT", "KEEP_RELEASE_SMOKE", "KEEP_MIGRATION_COMPATIBILITY", "KEEP_PLATFORM_BEHAVIOR", "KEEP_DOCUMENTATION_VALUE", "KEEP_INTEGRATION_GUARD", "OBSOLETE_CANDIDATE", "FLAKY_LOW_SIGNAL", "EXPENSIVE_LOW_SIGNAL", "UNKNOWN", "REDUNDANT_CANDIDATE"] },
35
+ "recommendation": { "enum": ["KEEP", "REWRITE", "PROBE_REMOVAL", "BLOCKED", "REVIEW"] },
36
+ "protected": { "type": "boolean" },
37
+ "signals": { "type": "object", "additionalProperties": true }
38
+ },
39
+ "additionalProperties": false
40
+ }
41
+ }
42
+ },
43
+ "additionalProperties": false
44
+ }
@@ -48,7 +48,7 @@ missing tool implicitly:
48
48
 
49
49
  | Tier | Command | Intended use |
50
50
  | --- | --- | --- |
51
- | Fast | `npm run verify:fast` | feedback while editing; quick Node, lint, dependency-policy, and generated-doc checks |
51
+ | Fast | `npm run verify:fast` | feedback while editing; quick Node, lint, dependency-policy, generated-doc, and repository-hygiene checks |
52
52
  | Local | `npm run verify:local` | full deterministic source, documentation, manifest, and frozen Python checks |
53
53
  | Pre-push | `npm run verify:prepush` | coverage, critical coverage, package/MCP checks, PoC checks, and the local suite expected before a PR |
54
54
  | Release | `npm run verify:release` | pre-push checks plus package smoke, benchmark/profile checks, performance, release-identity prerequisites, and `npm pack --dry-run --json` |
@@ -69,8 +69,8 @@ the full suite as a second `npm test`. `npm run lint`,
69
69
  `npm run complexity:check`, and `npm run critical-coverage:check` retain
70
70
  independent purposes: syntax and usage correctness, hotspot growth, and
71
71
  coverage of critical modules. Packed TypeScript consumers validate the public
72
- declarations; YAML-based tests validate workflow semantics. The core runtime
73
- remains dependency-free.
72
+ declarations; YAML-based tests validate workflow semantics. The approved exact
73
+ runtime dependencies are `@typesafe-ai/sdk` and `smol-toml`.
74
74
 
75
75
  ## GitHub Actions boundary
76
76
 
@@ -122,9 +122,9 @@ is not duplicated in every ordinary PR job.
122
122
  `npm run critical-coverage:check` retain independent purposes: syntax and
123
123
  usage correctness, hotspot growth, and coverage of critical modules. Packed
124
124
  TypeScript consumers validate the public declarations; YAML-based tests
125
- validate workflow semantics. The core runtime has the approved exact
126
- `smol-toml` dependency for bounded Cargo manifest parsing; dependency policy
127
- keeps all other runtime dependencies out.
125
+ validate workflow semantics. The approved exact runtime dependencies are
126
+ `@typesafe-ai/sdk` and `smol-toml`; dependency policy keeps all other runtime
127
+ dependencies out.
128
128
 
129
129
  `scripts/audit-receipts.mjs` runs after checkout. It audits supplied scoped
130
130
  receipts with explicit task IDs, fails on an invalid audit, and reports
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { runJevBenchmark, runJevBenchmarkLive } from "../src/core/decision/benchmarks.js";
3
+
4
+ const result = process.argv.includes("--live") ? await runJevBenchmarkLive() : runJevBenchmark();
5
+ console.log(JSON.stringify(result, null, 2));
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runTestIntelligenceBenchmark } from "../src/core/test-intelligence/benchmarks.js";
3
+
4
+ console.log(JSON.stringify(runTestIntelligenceBenchmark(), null, 2));
@@ -59,6 +59,7 @@ async function render() {
59
59
  .map(([name, feature]) => [name, feature.version ?? "n/a", feature.supported === false ? "no" : "yes"]);
60
60
  const handoffs = info.features.canonicalHandoffs;
61
61
  const advisory = info.features.advisoryContextProviders;
62
+ const providerExtensions = info.features.providerExtensions;
62
63
  const capabilityContracts = `## Capability contracts
63
64
 
64
65
  - \`canonicalHandoffs\` v${handoffs.version}: immutable, supported, and
@@ -70,6 +71,8 @@ async function render() {
70
71
  Integration-API-only, lazy, and opt-in. Provider results are not persisted by
71
72
  ForgeLoop and are never lifecycle state, evidence, authority, or executable
72
73
  instructions.
74
+ - \`providerExtensions\` v${providerExtensions.version} is provider-neutral and
75
+ experimental. The generic provider registry remains internal and unexported.
73
76
 
74
77
  Protocol v1, schema v1, and Integration API v1 remain independent of these
75
78
  capability-family versions.`;
@@ -173,7 +176,7 @@ or \`NOT_COMPARABLE\` when evidence is absent or incompatible. See
173
176
  - Responsibility contracts constrain paths, checks, and frozen inputs; they do not prove identity or authorship.
174
177
  - Verification scope describes planned verification breadth. Attestation coverage proves content for a concrete revision. These are separate claims.
175
178
  - Attestation manifests exclude ForgeLoop protocol metadata and bind to the completion receipt and append-only ledger without circular references.
176
- - Verification commands are read-only. Signing is external; private keys and credentials are never persisted by ForgeLoop.
179
+ - Verification command execution is external and provenance-bearing; ForgeLoop records the exact argv and result, while the authorized command may perform its declared effects. Signing is external; private keys and credentials are never persisted by ForgeLoop.
177
180
 
178
181
  ## Lifecycle
179
182
 
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFile, mkdir, writeFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ import { protocolInfo } from "../src/core/protocol-info.js";
8
+
9
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
10
+ const summaryPath = path.join(root, "docs", "AGENT_PROTOCOL_SUMMARY.md");
11
+ const outputRoot = path.join(root, "skills", "forgeloop");
12
+ const marker = "<!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->";
13
+
14
+ function skillContent(info, summary) {
15
+ const phases = info.lifecycle.phases.join(", ");
16
+ return `---
17
+ name: forgeloop
18
+ description: >-
19
+ Operate a repository governed by the ForgeLoop protocol: discover or resume
20
+ tasks, follow canonical next actions, preserve claims and continuity, record
21
+ verification evidence, recover supported protocol state, and require
22
+ validator-backed completion.
23
+ ---
24
+
25
+ ${marker}
26
+
27
+ # ForgeLoop
28
+
29
+ ## Purpose
30
+
31
+ This skill is operational guidance generated from ForgeLoop's canonical protocol metadata. It is not protocol authority. Always follow the current repository runtime, \`protocol-info\`, \`next\`, schemas, validators, and canonical documentation when they differ from this skill.
32
+
33
+ ## When to Use
34
+
35
+ Use when ForgeLoop is present in the repository or explicitly requested. Do not activate it for unrelated repositories merely because an agent supports skills.
36
+
37
+ ## Source of Truth
38
+
39
+ Runtime registries and validators outrank canonical protocol docs; canonical docs outrank \`docs/AGENT_PROTOCOL_SUMMARY.md\`; this generated skill is the final non-normative projection. Protocol version is ${info.protocolVersion}. Mutable facts such as phases (${phases}) must be read from the runtime.
40
+
41
+ ## Command Resolution
42
+
43
+ In ForgeLoop's own source repository, use \`node src/cli.js\`. In a consumer repository, use that repository's configured local invocation. Never silently install or upgrade ForgeLoop, and never use a stale global CLI when repository-local code exists. If compatibility is uncertain, inspect \`protocol-info --json\`.
44
+
45
+ ## Operating Workflow
46
+
47
+ 1. Discover existing work with \`node src/cli.js task-list --json\`.
48
+ 2. Select or resume the relevant task; a harness, session, model, or context change does not create a new task.
49
+ 3. Ask ForgeLoop for \`next --task <id> --json\` at every boundary and execute only the returned supported action.
50
+ 4. Require \`preflight\` to return \`READY\` before implementation.
51
+ 5. Preserve fresh, validator-owned evidence through verification, review, completion, and the terminal \`next\` check.
52
+
53
+ ## Task Discovery and Continuation
54
+
55
+ Respect active write claims. Do not steal, override, manually release, or edit ownership artifacts. Reconcile continuity with canonical state rather than trusting stale narrative.
56
+
57
+ ## Verification Rules
58
+
59
+ \`run-check\` executes the exact command and records ForgeLoop-owned provenance. \`record-check\` is serialization-only; its command text is metadata and is never executed. Claims, provider/advisory output, screenshots, and actor summaries are not evidence by themselves. Missing tools remain unavailable; do not auto-install a verifier.
60
+
61
+ ## Recovery Rules
62
+
63
+ Use supported recovery only. Preserve failed evidence and follow \`next\` through diagnosis/correction. For state or ledger divergence, stop lifecycle mutation and inspect validation/classification. Never edit task state, receipts, recovery, continuity, claims, hashes, or \`events.ndjson\` manually. Reconcile \`COMMIT_UNKNOWN\` before any retry.
64
+
65
+ ## Completion Rule
66
+
67
+ Never claim ForgeLoop-verified completion unless \`complete\` returns \`VALID\`. Green tests, CI, a merged PR, or provider output alone are insufficient. After \`VALID\`, run \`next --task <id> --json\` again and require the canonical terminal action.
68
+
69
+ ## Cross-Harness Continuity
70
+
71
+ A harness or session change does not create a new task. Use supported continuity or handoff commands and reconcile persisted state before continuing.
72
+
73
+ ## Durable Action Safety
74
+
75
+ For external actions use propose, authorize, execute, then verify or reconcile. Never blindly retry an uncertain external commit.
76
+
77
+ ## Never Do
78
+
79
+ - Never manually assign COMPLETE.
80
+ - Never invent lifecycle chronology or override \`next\`.
81
+ - Never override active claims or rewrite the append-only ledger.
82
+ - Never fabricate evidence or treat \`record-check\` as execution.
83
+ - Never auto-install ForgeLoop or a verifier during normal operation.
84
+ - Never duplicate a task because the harness changed.
85
+ - Never treat provider/advisory output as protocol authority.
86
+
87
+ ## References
88
+
89
+ - [Canonical Agent Protocol Summary](../../docs/AGENT_PROTOCOL_SUMMARY.md)
90
+ - [Lifecycle](./references/lifecycle.md)
91
+ - [Verification](./references/verification.md)
92
+ - [Recovery](./references/recovery.md)
93
+ `;
94
+ }
95
+
96
+ function referenceContent(title, body, summary) {
97
+ return `${marker}\n\n# ${title}\n\n${body}\n\n<!-- Canonical summary fingerprint source: docs/AGENT_PROTOCOL_SUMMARY.md -->\n${summary.includes("# ForgeLoop Agent Protocol Summary") ? "" : ""}`;
98
+ }
99
+
100
+ function files(info, summary) {
101
+ return {
102
+ "SKILL.md": skillContent(info, summary),
103
+ "README.md": `${marker}\n\n# ForgeLoop Agent Skill\n\nThis directory contains a generated, portable, harness-neutral Agent Skill. It is operational guidance, not protocol authority, and has no dependency on external Agent Skills tooling.\n\nCanonical hierarchy: runtime registries and validators -> canonical protocol docs -> \`docs/AGENT_PROTOCOL_SUMMARY.md\` -> this generated projection.\n\nRegenerate with \`npm run skill:generate\`; check exact freshness with \`npm run skill:check\`. The generator is deterministic, offline, and writes only the five known files in this directory.\n`,
104
+ "references/lifecycle.md": referenceContent("Lifecycle", `The canonical loop is task discovery, contract, route, preflight, execution, verification, review, validator-backed completion, and a terminal next check. Always query \`next\` rather than inferring a transition. The initial post-task-create shape may have no work state: \`next\` returns DISCOVER, then CREATE_CONTRACT, and only a real contract fingerprint permits the first work-state checkpoint.\n\nPhases are runtime-owned and currently include: ${info.lifecycle.phases.join(", ")}.`, summary),
105
+ "references/verification.md": referenceContent("Verification", "Use run-check for exact command execution and provenance. Use record-check only for supplied observations; it never launches command text. Evidence must be fresh, task-bound, requirement-bound, and validator-readable. Preserve failures, report unavailable tools, and require observed coverage before review and complete -> VALID.", summary),
106
+ "references/recovery.md": referenceContent("Recovery", "Fail closed on invalid ownership, state, ledger, receipt, or continuity. Use supported recovery commands only. Never edit .forgeloop/task-state, work-state.json, events.ndjson, recovery.json, claims, or hashes by hand. Claim release is not a lifecycle bypass. Reconcile COMMIT_UNKNOWN before retrying any external action.", summary),
107
+ };
108
+ }
109
+
110
+ async function main() {
111
+ const args = process.argv.slice(2);
112
+ if (args.length !== 1 || !["--write", "--check"].includes(args[0])) {
113
+ throw new Error("Usage: node scripts/generate-forgeloop-skill.mjs --write|--check");
114
+ }
115
+ const summary = await readFile(summaryPath, "utf8");
116
+ const generated = files(protocolInfo(), summary);
117
+ let failed = false;
118
+ for (const [relative, content] of Object.entries(generated)) {
119
+ const target = path.join(outputRoot, relative);
120
+ let current = null;
121
+ try { current = await readFile(target, "utf8"); } catch (error) { if (error.code !== "ENOENT") throw error; }
122
+ if (args[0] === "--check") {
123
+ if (current !== content) { console.error(`Generated Agent Skill is stale: skills/forgeloop/${relative}`); failed = true; }
124
+ } else {
125
+ await mkdir(path.dirname(target), { recursive: true });
126
+ await writeFile(target, content, "utf8");
127
+ }
128
+ }
129
+ if (failed) process.exitCode = 1;
130
+ else console.log(args[0] === "--check" ? "Generated Agent Skill is current." : "Generated Agent Skill.");
131
+ }
132
+
133
+ await main();
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { DECISION_DEFAULT_POLICY } from "../src/core/decision/constants.js";
3
+ import { createTypesafeEngine } from "../src/adapters/typesafe/engine.js";
4
+
5
+ const engine = createTypesafeEngine({ policy: DECISION_DEFAULT_POLICY });
6
+ const result = await engine.health();
7
+ const status = result.status === "missing" ? "NOT_RUN" : result.status;
8
+ console.log(JSON.stringify({
9
+ status,
10
+ provider: result.engine,
11
+ model: result.model,
12
+ ...(result.latencyMs !== undefined ? { latencyMs: result.latencyMs } : {}),
13
+ ...(result.usage ? { usage: result.usage } : {}),
14
+ ...(result.errorCode ? { errorCode: result.errorCode } : {}),
15
+ ...(result.providerErrorType ? { providerErrorType: result.providerErrorType } : {}),
16
+ ...(result.httpStatus ? { httpStatus: result.httpStatus } : {}),
17
+ ...(result.requestId ? { requestId: result.requestId } : {}),
18
+ }, null, 2));
19
+ if (status !== "healthy" && status !== "NOT_RUN") process.exitCode = 1;
@@ -0,0 +1,9 @@
1
+ <!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->
2
+
3
+ # ForgeLoop Agent Skill
4
+
5
+ This directory contains a generated, portable, harness-neutral Agent Skill. It is operational guidance, not protocol authority, and has no dependency on external Agent Skills tooling.
6
+
7
+ Canonical hierarchy: runtime registries and validators -> canonical protocol docs -> `docs/AGENT_PROTOCOL_SUMMARY.md` -> this generated projection.
8
+
9
+ Regenerate with `npm run skill:generate`; check exact freshness with `npm run skill:check`. The generator is deterministic, offline, and writes only the five known files in this directory.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: forgeloop
3
+ description: >-
4
+ Operate a repository governed by the ForgeLoop protocol: discover or resume
5
+ tasks, follow canonical next actions, preserve claims and continuity, record
6
+ verification evidence, recover supported protocol state, and require
7
+ validator-backed completion.
8
+ ---
9
+
10
+ <!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->
11
+
12
+ # ForgeLoop
13
+
14
+ ## Purpose
15
+
16
+ This skill is operational guidance generated from ForgeLoop's canonical protocol metadata. It is not protocol authority. Always follow the current repository runtime, `protocol-info`, `next`, schemas, validators, and canonical documentation when they differ from this skill.
17
+
18
+ ## When to Use
19
+
20
+ Use when ForgeLoop is present in the repository or explicitly requested. Do not activate it for unrelated repositories merely because an agent supports skills.
21
+
22
+ ## Source of Truth
23
+
24
+ Runtime registries and validators outrank canonical protocol docs; canonical docs outrank `docs/AGENT_PROTOCOL_SUMMARY.md`; this generated skill is the final non-normative projection. Protocol version is 1. Mutable facts such as phases (RECEIVED, DISCOVERING, CONTRACT_READY, ROUTED, DESIGNING, PLANNED, EXECUTING, VERIFYING, DIAGNOSING, CORRECTING, REVIEWING, COMPLETE, BLOCKED) must be read from the runtime.
25
+
26
+ ## Command Resolution
27
+
28
+ In ForgeLoop's own source repository, use `node src/cli.js`. In a consumer repository, use that repository's configured local invocation. Never silently install or upgrade ForgeLoop, and never use a stale global CLI when repository-local code exists. If compatibility is uncertain, inspect `protocol-info --json`.
29
+
30
+ ## Operating Workflow
31
+
32
+ 1. Discover existing work with `node src/cli.js task-list --json`.
33
+ 2. Select or resume the relevant task; a harness, session, model, or context change does not create a new task.
34
+ 3. Ask ForgeLoop for `next --task <id> --json` at every boundary and execute only the returned supported action.
35
+ 4. Require `preflight` to return `READY` before implementation.
36
+ 5. Preserve fresh, validator-owned evidence through verification, review, completion, and the terminal `next` check.
37
+
38
+ ## Task Discovery and Continuation
39
+
40
+ Respect active write claims. Do not steal, override, manually release, or edit ownership artifacts. Reconcile continuity with canonical state rather than trusting stale narrative.
41
+
42
+ ## Verification Rules
43
+
44
+ `run-check` executes the exact command and records ForgeLoop-owned provenance. `record-check` is serialization-only; its command text is metadata and is never executed. Claims, provider/advisory output, screenshots, and actor summaries are not evidence by themselves. Missing tools remain unavailable; do not auto-install a verifier.
45
+
46
+ ## Recovery Rules
47
+
48
+ Use supported recovery only. Preserve failed evidence and follow `next` through diagnosis/correction. For state or ledger divergence, stop lifecycle mutation and inspect validation/classification. Never edit task state, receipts, recovery, continuity, claims, hashes, or `events.ndjson` manually. Reconcile `COMMIT_UNKNOWN` before any retry.
49
+
50
+ ## Completion Rule
51
+
52
+ Never claim ForgeLoop-verified completion unless `complete` returns `VALID`. Green tests, CI, a merged PR, or provider output alone are insufficient. After `VALID`, run `next --task <id> --json` again and require the canonical terminal action.
53
+
54
+ ## Cross-Harness Continuity
55
+
56
+ A harness or session change does not create a new task. Use supported continuity or handoff commands and reconcile persisted state before continuing.
57
+
58
+ ## Durable Action Safety
59
+
60
+ For external actions use propose, authorize, execute, then verify or reconcile. Never blindly retry an uncertain external commit.
61
+
62
+ ## Never Do
63
+
64
+ - Never manually assign COMPLETE.
65
+ - Never invent lifecycle chronology or override `next`.
66
+ - Never override active claims or rewrite the append-only ledger.
67
+ - Never fabricate evidence or treat `record-check` as execution.
68
+ - Never auto-install ForgeLoop or a verifier during normal operation.
69
+ - Never duplicate a task because the harness changed.
70
+ - Never treat provider/advisory output as protocol authority.
71
+
72
+ ## References
73
+
74
+ - [Canonical Agent Protocol Summary](../../docs/AGENT_PROTOCOL_SUMMARY.md)
75
+ - [Lifecycle](./references/lifecycle.md)
76
+ - [Verification](./references/verification.md)
77
+ - [Recovery](./references/recovery.md)
@@ -0,0 +1,9 @@
1
+ <!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->
2
+
3
+ # Lifecycle
4
+
5
+ The canonical loop is task discovery, contract, route, preflight, execution, verification, review, validator-backed completion, and a terminal next check. Always query `next` rather than inferring a transition. The initial post-task-create shape may have no work state: `next` returns DISCOVER, then CREATE_CONTRACT, and only a real contract fingerprint permits the first work-state checkpoint.
6
+
7
+ Phases are runtime-owned and currently include: RECEIVED, DISCOVERING, CONTRACT_READY, ROUTED, DESIGNING, PLANNED, EXECUTING, VERIFYING, DIAGNOSING, CORRECTING, REVIEWING, COMPLETE, BLOCKED.
8
+
9
+ <!-- Canonical summary fingerprint source: docs/AGENT_PROTOCOL_SUMMARY.md -->
@@ -0,0 +1,7 @@
1
+ <!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->
2
+
3
+ # Recovery
4
+
5
+ Fail closed on invalid ownership, state, ledger, receipt, or continuity. Use supported recovery commands only. Never edit .forgeloop/task-state, work-state.json, events.ndjson, recovery.json, claims, or hashes by hand. Claim release is not a lifecycle bypass. Reconcile COMMIT_UNKNOWN before retrying any external action.
6
+
7
+ <!-- Canonical summary fingerprint source: docs/AGENT_PROTOCOL_SUMMARY.md -->
@@ -0,0 +1,7 @@
1
+ <!-- Generated by scripts/generate-forgeloop-skill.mjs. Do not edit manually. -->
2
+
3
+ # Verification
4
+
5
+ Use run-check for exact command execution and provenance. Use record-check only for supplied observations; it never launches command text. Evidence must be fresh, task-bound, requirement-bound, and validator-readable. Preserve failures, report unavailable tools, and require observed coverage before review and complete -> VALID.
6
+
7
+ <!-- Canonical summary fingerprint source: docs/AGENT_PROTOCOL_SUMMARY.md -->