@cassiomc1/forgeloop 1.2.4 → 1.5.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 (92) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/AGENTS.md +1 -0
  3. package/AGENT_COMPATIBILITY.md +4 -0
  4. package/CLAUDE.md +1 -0
  5. package/DOCS_INDEX.md +14 -0
  6. package/EXECUTION_STATE.md +48 -0
  7. package/LOOP_ENGINEERING.md +55 -6
  8. package/LOOP_SYSTEM_DESIGN.md +32 -1
  9. package/PROTOCOL_INTEGRATION.md +71 -0
  10. package/README.md +86 -0
  11. package/TERMINOLOGY.md +15 -0
  12. package/THIRD_PARTY_NOTICES.md +15 -0
  13. package/THREAT_MODEL.md +22 -1
  14. package/docs/ARTIFACT_REFERENCE.md +54 -0
  15. package/docs/CLI_REFERENCE.md +177 -5
  16. package/docs/CROSS_HARNESS_CONTINUITY.md +34 -0
  17. package/docs/DOCUMENTATION_GUIDE.md +31 -0
  18. package/docs/GETTING_STARTED.md +10 -0
  19. package/docs/MCP.md +126 -0
  20. package/docs/RECIPES.md +87 -1
  21. package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
  22. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
  23. package/docs/TROUBLESHOOTING.md +243 -40
  24. package/docs/UNIVERSAL_INTEGRATION.md +48 -0
  25. package/package.json +17 -3
  26. package/schemas/execution.schema.json +11 -1
  27. package/schemas/task-recovery.schema.json +61 -0
  28. package/schemas/work-state.schema.json +1 -0
  29. package/src/cli.js +182 -337
  30. package/src/commands/audit.js +5 -0
  31. package/src/commands/doctor.js +22 -0
  32. package/src/commands/inspect.js +6 -0
  33. package/src/commands/migrate-protocol.js +18 -0
  34. package/src/commands/progress.js +6 -2
  35. package/src/commands/protocol-info.js +16 -0
  36. package/src/commands/run-check.js +2 -0
  37. package/src/commands/status.js +17 -0
  38. package/src/commands/task-create.js +42 -3
  39. package/src/commands/task-list.js +14 -1
  40. package/src/commands/task-lock-status.js +29 -0
  41. package/src/commands/task-recover.js +202 -0
  42. package/src/commands/task-repair-legacy-recovery.js +417 -0
  43. package/src/commands/task-resume.js +172 -0
  44. package/src/commands/task-scope.js +23 -4
  45. package/src/commands/task-show.js +21 -7
  46. package/src/commands/task-unlock.js +8 -6
  47. package/src/commands/validate-protocol.js +19 -2
  48. package/src/core/artifact-registry.js +12 -0
  49. package/src/core/artifacts.js +17 -4
  50. package/src/core/audit.js +20 -4
  51. package/src/core/bundles.js +15 -0
  52. package/src/core/cli-command-definitions.js +94 -4
  53. package/src/core/command-executors.js +387 -0
  54. package/src/core/command-input.js +107 -0
  55. package/src/core/command-runtime.js +106 -0
  56. package/src/core/completion-artifacts.js +17 -6
  57. package/src/core/completion-ownership.js +88 -0
  58. package/src/core/completion.js +15 -3
  59. package/src/core/diagnosis.js +15 -11
  60. package/src/core/error-codes.js +136 -1
  61. package/src/core/events.js +239 -9
  62. package/src/core/execution.js +73 -9
  63. package/src/core/filesystem.js +75 -8
  64. package/src/core/inspect.js +27 -0
  65. package/src/core/integration-invocation-policy.js +170 -0
  66. package/src/core/integration-limits.js +20 -0
  67. package/src/core/integration-resources.js +127 -0
  68. package/src/core/next-action-model.js +60 -0
  69. package/src/core/next-action.js +31 -0
  70. package/src/core/phase.js +10 -3
  71. package/src/core/project-root.js +21 -0
  72. package/src/core/protocol-info.js +54 -0
  73. package/src/core/protocol-migration.js +59 -0
  74. package/src/core/reconcile-closure.js +54 -14
  75. package/src/core/recovery-history.js +116 -0
  76. package/src/core/resumability.js +8 -6
  77. package/src/core/schema-validation.js +1 -0
  78. package/src/core/task-claim-state.js +272 -0
  79. package/src/core/task-command.js +8 -4
  80. package/src/core/task-conflict-inspection.js +321 -0
  81. package/src/core/task-context.js +32 -29
  82. package/src/core/task-discovery.js +14 -1
  83. package/src/core/task-lock.js +248 -18
  84. package/src/core/task-migration.js +24 -1
  85. package/src/core/task-paths.js +6 -3
  86. package/src/core/task-recovery-migration.js +192 -0
  87. package/src/core/task-recovery.js +205 -0
  88. package/src/core/task-scope.js +33 -1
  89. package/src/core/templates.js +1 -0
  90. package/src/core/transaction.js +285 -0
  91. package/src/core/work-state.js +70 -6
  92. package/src/integration.js +47 -0
package/docs/RECIPES.md CHANGED
@@ -20,16 +20,21 @@ 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)
23
24
 
24
25
  ---
25
26
 
26
27
  ### Recipe 1 — Start a New Task
27
28
 
29
+ <!-- FORGELOOP EXAMPLE: recipes:create-task | exit=0 | json.taskId=task-001 -->
28
30
  ```bash
29
- # 1. Create a task with explicit claims
30
31
  forgeloop task-create --task task-001 --claim src --claim tests --json
32
+ ```
33
+ <!-- END FORGELOOP EXAMPLE -->
31
34
 
35
+ ```bash
32
36
  # 2. Discover task state path and author contract under .forgeloop/task-state/<taskKey>/contract.json
37
+
33
38
  forgeloop task-show --task task-001 --json
34
39
 
35
40
  # 3. Route engineering guides
@@ -307,3 +312,84 @@ forgeloop next --task task-001 --json
307
312
  # Intentional operator-authorized baseline reset (not normal recovery)
308
313
  forgeloop baseline --record --policy-reset-authorized --json
309
314
  ```
315
+
316
+ ---
317
+
318
+ ### Recipe 15 — Release and Reacquire Claims for an Abandoned Task
319
+
320
+ ```bash
321
+ # 1. Inspect deterministic classification and structured next action
322
+ forgeloop next --task task-001 --json
323
+
324
+ # 2. RECOVERABLE must use reconcile-closure; do not use task-recover
325
+ forgeloop reconcile-closure --task task-001 --id <verification-id> \
326
+ --requirement "<exact verification text>" -- <verification-command>
327
+
328
+ # 3. Only STALE or ABANDONED may release effective claims
329
+ forgeloop task-recover --task task-001 --acknowledge-recovery --json
330
+
331
+ # 4. Other tasks may now adopt the released paths
332
+ forgeloop task-create --task replacement-task --claim src --json
333
+
334
+ # 5. Reacquisition fails while replacement-task owns src
335
+ forgeloop task-resume --task task-001 --json
336
+
337
+ # 6. After the conflicting owner completes, reacquire claims explicitly
338
+ forgeloop task-resume --task task-001 --claim src --json
339
+ ```
340
+
341
+ `--acknowledge-recovery` records caller acknowledgement only. It does not grant
342
+ host authority or mark the task complete. Recovery preserves work state,
343
+ receipts, failures, policy snapshots, and continuity until normal lifecycle
344
+ work resumes. Claims are released only after ForgeLoop validates the recovery
345
+ artifact against the complete ledger history. If `next` returns
346
+ `RESOLVE_RECOVERY_INCONSISTENCY`, run `validate-protocol`; do not create, edit,
347
+ or delete `recovery.json` manually.
348
+
349
+ ## Run ForgeLoop through MCP (safe mode)
350
+
351
+ Start the local MCP adapter and inspect what it exposes:
352
+
353
+ ```bash
354
+ forgeloop-mcp --project . --mode safe
355
+ ```
356
+
357
+ `safe` mode permits reads, normal loop mutations, and canonical `task-resume`.
358
+ Call the `forgeloop_capabilities` tool first: it reports versions, features,
359
+ launch policy, and the resource list. Task ownership is available from the
360
+ `forgeloop://task/{taskId}/ownership` resource — always the canonical claim
361
+ resolver projection.
362
+
363
+ ## Resume a recovered task through MCP
364
+
365
+ Recovered tasks stay mutation-disabled until claims are reacquired:
366
+
367
+ ```json
368
+ { "tool": "forgeloop_task_resume", "arguments": { "taskId": "my-task" } }
369
+ ```
370
+
371
+ Conflicting claims fail with `E_TASK_SCOPE_CONFLICT` and keep recovery intact.
372
+ Ordinary mutations against a recovered task are refused by core regardless of
373
+ transport.
374
+
375
+ ## Deliberately opt into external execution
376
+
377
+ `run-check`/`reconcile-closure` require a full-mode launch flag; tool input
378
+ cannot grant it:
379
+
380
+ ```bash
381
+ forgeloop-mcp --mode full --allow-external-execution
382
+ ```
383
+
384
+ Execution uses exact argv arrays only — there is no generic shell tool — and
385
+ the server `--max-execution-time-ms` ceiling always applies. Output is bounded
386
+ on the exact UTF-8 serialization transmitted (`E_MCP_RESULT_TOO_LARGE`);
387
+ oversized structured input fails with `E_MCP_INPUT_TOO_LARGE`.
388
+
389
+ ## Diagnose loopback-only HTTP errors
390
+
391
+ `forgeloop-mcp-http` binds loopback only. A non-loopback bind fails closed
392
+ with `E_MCP_REMOTE_NOT_SUPPORTED`; remote/authenticated HTTP is unsupported.
393
+ Host/Origin validation is DNS-rebinding defense, not authentication. Under
394
+ load, requests beyond the in-flight ceiling receive 503 `E_MCP_HTTP_BUSY`
395
+ 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.
@@ -24,12 +24,22 @@ This guide provides symptom-first recovery procedures for common ForgeLoop proto
24
24
  - [Baseline re-record blocked during active task (`E_BASELINE_RECORD_DURING_ACTIVE_TASK`)](#symptom-baseline-re-record-blocked-during-active-task)
25
25
  - [Mutation checker execution error (`E_CHECK_MUTATION_EXECUTION_ERROR`)](#symptom-mutation-checker-execution-error)
26
26
  - [Another harness cannot resume the task](#symptom-another-harness-cannot-resume)
27
+ - [Task claim conflict or recovered task](#symptom-task-creation-blocked-by-a-write-claim-conflict-e_task_scope_conflict)
27
28
  - [Stable Error & Reason Code Reference](#stable-error-and-reason-codes)
28
29
 
29
30
  ---
30
31
 
31
32
  ## Symptoms and Recovery
32
33
 
34
+ Confirm the local CLI's public metadata before diagnosing a harness/version
35
+ mismatch. This check does not create or mutate task state.
36
+
37
+ <!-- FORGELOOP EXAMPLE: troubleshooting:protocol-info | exit=0 | json.errors.0.code=E_AUTHORITY_INVALID -->
38
+ ```bash
39
+ forgeloop protocol-info --json
40
+ ```
41
+ <!-- END FORGELOOP EXAMPLE -->
42
+
33
43
  ### Symptom: `preflight` is `BLOCKED`
34
44
 
35
45
  #### What it means
@@ -226,6 +236,14 @@ forgeloop complete --task <id>
226
236
  ```
227
237
 
228
238
  Write claims release only when completion is validator-backed (`COMPLETE`).
239
+ A `phase: COMPLETE` that was never produced by the official completion pipeline
240
+ is not sufficient: the ownership resolver requires canonical lifecycle proof (a
241
+ validated ledger containing the task-bound `COMPLETION_VALIDATED` event with
242
+ coherent state). Unproven completion reports
243
+ `E_COMPLETION_OWNERSHIP_UNPROVEN` / `E_TASK_CLAIM_OWNERSHIP_INCONSISTENT`,
244
+ retains historical claims, and blocks mutation and overlapping acquisition.
245
+ Re-run the official completion pipeline or restore the canonical completion
246
+ event; never edit `work-state.json` by hand.
229
247
 
230
248
  ---
231
249
 
@@ -294,6 +312,94 @@ export FORGELOOP_TASK="<task-id>"
294
312
 
295
313
  ---
296
314
 
315
+ ### Symptom: Task Creation Blocked by a Write-Claim Conflict (`E_TASK_SCOPE_CONFLICT`)
316
+
317
+ #### What it means
318
+
319
+ Another non-`COMPLETE` task already holds a write claim that overlaps the claims you requested. ForgeLoop inspects the conflicting task automatically before failing and attaches a deterministic classification to the error.
320
+
321
+ #### Inspect
322
+
323
+ The conflict error carries machine-readable fields directly on each
324
+ `error.conflicts[]` entry, plus the full nested `inspection`:
325
+
326
+ - `classification`: one of `ACTIVE`, `RECOVERABLE`, `STALE`, `ABANDONED`, `INCONSISTENT`, `RECOVERED`, or `COMPLETE`;
327
+ - `reasonCodes`: the deterministic evidence codes behind the classification;
328
+ - `nextAction`: the deterministic recovery or wait action;
329
+ - `commandSpecs`: direct-process command metadata and required inputs;
330
+ - `inspection`: the complete classification evidence.
331
+
332
+ Classification is derived from machine state only: the validated relationship
333
+ between descriptor, work state, recovery artifact, and complete recovery
334
+ history; lock/lease,
335
+ checkpoint freshness, drift kinds, ledger validity, all recorded check statuses,
336
+ verification evidence, meaningful ledger activity, and idle time. Lock state
337
+ distinguishes `NONE`, `LIVE`, `STALE`, `UNKNOWN`, and `CORRUPT`; unknown,
338
+ corrupt, or unreadable evidence fails closed as `INCONSISTENT`. A `REVIEWING`
339
+ phase plus an old timestamp alone is never `STALE`; post-execution tasks whose
340
+ only drift is `REPOSITORY_CHANGED` remain `RECOVERABLE`.
341
+
342
+ #### Safe recovery
343
+
344
+ Follow the classification:
345
+
346
+ ```bash
347
+ # RECOVERABLE: reconcile through the official pipeline first
348
+ forgeloop reconcile-closure --task <task-id> --id <verification-id> \
349
+ --requirement "<exact contract verification text>" -- <command>
350
+
351
+ # STALE / ABANDONED only: caller-acknowledged claim release
352
+ forgeloop task-recover --task <task-id> --acknowledge-recovery --json
353
+
354
+ # RECOVERED: reacquire claims through normal ownership checks
355
+ forgeloop task-resume --task <task-id> --json
356
+
357
+ # INCONSISTENT: diagnose; do not force claim release
358
+ forgeloop validate-protocol --task <task-id> --json
359
+ ```
360
+
361
+ `task-recover` uses an explicit allowlist: only `STALE` and `ABANDONED` are
362
+ accepted. It refuses `ACTIVE`, `RECOVERABLE`, `INCONSISTENT`, `RECOVERED`,
363
+ `COMPLETE`, and unknown future classifications. A stale task lock is released
364
+ only if its lock ID, heartbeat, and owner instance still match the observation;
365
+ recovery then revalidates phase, revision, ledger sequence, and classification
366
+ under project-claims and task locks.
367
+
368
+ The command writes durable `recovery.json` and a linked append-only recovery
369
+ event in one transaction. For PR #66 compatibility, the writer retains the
370
+ event name `OPERATOR_RECOVERY_RECORDED`, but records
371
+ `authorityKind: CALLER_ACKNOWLEDGED`; readers also accept
372
+ `TASK_RECOVERY_RECORDED`. Recovery does not refresh `work-state.json`, change
373
+ phase, erase evidence, alter policy/continuity, or fabricate completion.
374
+ Historical descriptor claims remain visible, while canonical effective claims
375
+ are empty only when that relationship validates; ordinary mutations then fail
376
+ with `E_TASK_RECOVERED`. Fake, missing, corrupt, deleted, or mismatched recovery
377
+ evidence is `INCONSISTENT`, keeps historical claims effective, disables
378
+ mutation, and routes `next` to `RESOLVE_RECOVERY_INCONSISTENCY`.
379
+
380
+ `--acknowledge-recovery` is a caller declaration, not host-attested authority.
381
+ The deprecated `--operator-authorized` alias has the same limited meaning.
382
+ Only `task-resume` can transactionally remove recovery state and reacquire
383
+ claims. If another task owns an overlapping path, resume returns
384
+ `E_TASK_SCOPE_CONFLICT` and leaves the recovered task suspended.
385
+
386
+ Never create, delete, or edit `recovery.json` manually. Never remove task
387
+ recovery state to resume a task. Never interpret `recovery.json` without
388
+ validating its ledger binding. Direct changes bypass locks, transactions,
389
+ expected revisions, and the append-only ledger.
390
+
391
+ If `.forgeloop/.claims.lock` is stale, ForgeLoop quarantines and removes it only
392
+ when `lockId`, `heartbeatAt`, and `ownerInstanceId` still match. A live lock
393
+ returns `E_TASK_LOCKED`; unknown, corrupt, or concurrently replaced ownership
394
+ returns `E_PROJECT_CLAIMS_LOCK_INCONSISTENT`. Do not force-delete unknown lock
395
+ ownership.
396
+
397
+ A project containing active task recovery state requires ForgeLoop 1.4.0 or
398
+ newer. An older reader that cannot advertise validated claim projection must
399
+ fail closed instead of inferring ownership from the descriptor or tombstone.
400
+
401
+ ---
402
+
297
403
  ### Symptom: Verification Tool is Missing
298
404
 
299
405
  #### Error Code: `E_VERIFICATION_TOOL_UNAVAILABLE`
@@ -563,56 +669,153 @@ forgeloop next --task <id> --json
563
669
 
564
670
  | Code | Meaning | Safe Resolution |
565
671
  | --- | --- | --- |
566
- | `E_PREFLIGHT_NOT_READY` | Preflight gates or contract validations are incomplete. | Satisfy required gates and check preflight output. |
567
- | `E_CONTRACT_STALE` | Contract modified after downstream artifacts were generated. | Re-run forgeloop route and forgeloop preflight. |
568
- | `E_ROUTE_STALE` | Routing result does not match the active contract fingerprint. | Re-run forgeloop route. |
569
- | `E_GATE_STALE` | Referenced gate artifact changed after approval. | Update artifact SHA-256 in gate file. |
570
- | `E_VERIFICATION_TOOL_UNAVAILABLE` | Required verification executable is missing in environment. | Use local equivalent, obtain host authority, or record NOT_VERIFIED. |
571
- | `E_INSTALLATION_AUTHORITY_REQUIRED` | Attempted software installation without host authority grant. | Use local non-installing binaries or request host authority grant. |
572
672
  | `E_AUTHORITY_INVALID` | Authority grant file is malformed or expired. | Obtain a valid authority grant from host operator. |
573
673
  | `E_AUTHORITY_SCOPE_MISMATCH` | Authority grant does not cover the requested package. | Request updated authority scope. |
574
674
  | `E_AUTHORITY_UNTRUSTED_SOURCE` | Authority file placed inside untrusted project tree. | Place authority file in host-managed trusted location. |
575
- | `E_EXECUTION_REF_INVALID` | Referenced execution ID does not exist. | Re-run check via forgeloop run-check. |
675
+ | `E_BASELINE_EXPANSION` | Attempted unauthorized addition of new violations to brownfield baseline. | Resolve new violations rather than expanding the baseline. |
676
+ | `E_BASELINE_RECORD_DURING_ACTIVE_TASK` | Cannot re-record baseline during an active task with policy snapshot. | Resolve new violations or use monotonic baseline --update. |
677
+ | `E_CHECK_INERT` | An enabled check has no effective scope or target files. | Provide an applicable target scope, configure matching files, or mark the rule unsupported. |
576
678
  | `E_CHECK_INVALID` | Check structure or required parameters are invalid. | Provide valid check ID, requirement, and parameters. |
577
- | `E_RECEIPT_STATE_MISMATCH` | Receipt does not match current state cycle or work state. | Run forgeloop prepare-completion --json. |
679
+ | `E_CHECK_MUTATION_EXECUTION_ERROR` | A policy checker threw an unhandled exception while evaluating its mutation fixture. | Repair the checker execution path and rerun rule verification. |
680
+ | `E_CHECK_MUTATION_NOT_DETECTED` | A blocking rule checker failed to detect an intentional mutation fixture. | Fix checker logic to properly identify target violations. |
681
+ | `E_CHECK_STATUS_CONTRADICTION` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
682
+ | `E_CIRCULAR_COMPLETION_REQUIREMENT` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
683
+ | `E_COMMAND_RESOLUTION_AMBIGUOUS` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
684
+ | `E_COMPLETION_OWNERSHIP_UNPROVEN` | Work-state claims COMPLETE but the canonical lifecycle/ledger completion proof is missing or invalid, so historical claims stay reserved. | Restore the canonical completion event and a valid ledger, or re-run the official completion pipeline; phase=COMPLETE alone never releases claims. |
685
+ | `E_COMPLETION_RECOVERY_UNAUTHORIZED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
686
+ | `E_COMPLETION_REJECTED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
687
+ | `E_COMPLETION_REJECTION_LEDGER_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
688
+ | `E_COMPLETION_REJECTION_RECEIPT_FINGERPRINT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
689
+ | `E_COMPLETION_REJECTION_STATE_FINGERPRINT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
690
+ | `E_CONTINUITY_CONTRACT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
691
+ | `E_CONTINUITY_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
692
+ | `E_CONTINUITY_PHASE_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
578
693
  | `E_CONTINUITY_RECONCILIATION_REQUIRED` | Continuity context has drifted from work state. | Run forgeloop reconcile-continuity --json. |
579
- | `E_TASK_AMBIGUOUS` | Multiple tasks exist in the project but no task selector was provided. | Select a task explicitly using --task <id> or FORGELOOP_TASK=<id>. |
580
- | `E_TASK_LOCKED` | Task mutation is currently locked by another concurrent process or run-check. | Wait for the active mutation to complete or inspect the lock with forgeloop task-show. |
581
- | `E_TASK_SCOPE_CONFLICT` | Task write claims overlap with another non-complete task in the same checkout. | Adjust write claims to non-overlapping paths or run tasks in separate worktrees. |
582
- | `E_TASK_SCOPE_DIRTY` | Claimed paths contain pre-existing uncommitted changes. | Commit or stash changes in claimed paths before defining or adopting the scope. |
583
- | `E_TASK_CHANGE_OUTSIDE_SCOPE` | Modified paths in repository exceed the declared task write claims. | Update write claims with forgeloop task-scope or revert out-of-scope modifications. |
584
- | `E_RECONCILE_NOT_STALE` | reconcile-closure was invoked for a work-state checkpoint that is already fresh. | No reconciliation is required; continue the normal lifecycle. |
585
- | `E_RECONCILE_PHASE_INVALID` | reconcile-closure was invoked for a task that is not EXECUTING or VERIFYING. | reconcile-closure supports EXECUTING or VERIFYING tasks whose objective is already satisfied. |
586
- | `E_RECONCILE_UNSUPPORTED_DRIFT` | Work-state drift includes kinds other than REPOSITORY_CHANGED (contract or required-artifact drift). | Resolve contract or artifact drift through their dedicated recovery surfaces; reconcile-closure only refreshes repository fingerprint drift. |
587
- | `E_RECONCILE_LEDGER_INVALID` | The append-only event ledger is not valid, so reconciliation cannot be recorded. | Inspect the ledger errors and repair before reconciling. |
588
- | `E_RECONCILE_REQUIREMENT_UNKNOWN` | The supplied check id and requirement text do not exactly match a contract verification item of type VERIFICATION. | Supply the exact id and requirement text of an existing contract verification item. |
589
- | `E_RECONCILE_EVIDENCE_FAILED` | The executed objective-satisfaction evidence command did not pass. | Inspect the execution artifact; reconciliation is refused until evidence passes in the current repository. |
590
- | `E_REPOSITORY_CHANGED` | The repository fingerprint (branch or HEAD) moved after the work-state checkpoint was recorded. | If the task objective is already satisfied in the current repository, run forgeloop reconcile-closure; otherwise resume from a checkpoint that matches the current repository. |
591
- | `E_STATE_REVALIDATION_REQUIRED` | The work-state checkpoint must be revalidated before the lifecycle can continue. | Run forgeloop reconcile-closure for externally satisfied EXECUTING tasks, or inspect the freshness reasons for other drift. |
592
- | `E_DIAGNOSIS_REQUIRED` | Current correction cycle has no append-only diagnosis record. | Run forgeloop record-diagnosis with current failed evidence before correcting. |
593
- | `E_DIAGNOSIS_INVALID` | Diagnosis record details or parameters are malformed. | Provide valid failureClass, hypothesis, evidenceRefs, settledBy, and nextSafeAction. |
594
- | `E_DIAGNOSIS_EVIDENCE_INVALID` | Referenced diagnosis evidence is missing or has no failed checks in the current cycle. | Reference at least one failed or blocked check ID from the active verification cycle. |
595
- | `E_DIAGNOSIS_CYCLE_MISMATCH` | Diagnosis verification cycle does not match the active work state verification cycle. | Record diagnosis for the current active verification cycle. |
596
- | `E_DIAGNOSIS_NO_NEW_INFORMATION` | The proposed retry repeats the previous hypothesis with the same evidence. | Change the hypothesis, collect independent evidence, or change strategy. |
597
- | `E_PROGRESS_STALLED` | Persisted correction history shows no new diagnostic information. | Use an independent check, revisit assumptions, or record a materially different diagnosis. |
694
+ | `E_CONTINUITY_SCHEMA_UNSUPPORTED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
695
+ | `E_CONTINUITY_STATE_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
696
+ | `E_CONTINUITY_TASK_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
697
+ | `E_CONTRACT_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
698
+ | `E_CONTRACT_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
699
+ | `E_CONTRACT_STALE` | Contract modified after downstream artifacts were generated. | Re-run forgeloop route and forgeloop preflight. |
700
+ | `E_CONTRACT_UNRESOLVED_DECISION` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
598
701
  | `E_DECISION_CRITERION_INVALID` | Decision settlement criterion details or parameters are malformed. | Provide non-empty decision text and settledBy criterion. |
599
702
  | `E_DECISION_NOT_UNRESOLVED` | A settlement criterion referenced a decision not present in current unresolvedDecisions. | Use the exact current unresolved decision text or update the contract first. |
600
- | `E_CHECK_INERT` | An enabled check has no effective scope or target files. | Provide an applicable target scope, configure matching files, or mark the rule unsupported. |
601
- | `E_CHECK_MUTATION_NOT_DETECTED` | A blocking rule checker failed to detect an intentional mutation fixture. | Fix checker logic to properly identify target violations. |
602
- | `E_POLICY_DRIFT` | Active policy lock does not match the policy snapshot captured at task activation. | Re-verify affected checks or restore original policy. |
603
- | `E_POLICY_WEAKENING` | Policy rules were weakened during task execution without explicit authority. | Restore the original policy configuration. |
604
- | `E_POLICY_LOCK_INVALID` | Policy lockfile is missing, malformed, or corrupt. | Run forgeloop policy-status or regenerate policy.lock. |
703
+ | `E_DIAGNOSIS_CYCLE_MISMATCH` | Diagnosis verification cycle does not match the active work state verification cycle. | Record diagnosis for the current active verification cycle. |
704
+ | `E_DIAGNOSIS_EVIDENCE_INVALID` | Referenced diagnosis evidence is missing or has no failed checks in the current cycle. | Reference at least one failed or blocked check ID from the active verification cycle. |
705
+ | `E_DIAGNOSIS_INVALID` | Diagnosis record details or parameters are malformed. | Provide valid failureClass, hypothesis, evidenceRefs, settledBy, and nextSafeAction. |
706
+ | `E_DIAGNOSIS_NO_NEW_INFORMATION` | The proposed retry repeats the previous hypothesis with the same evidence. | Change the hypothesis, collect independent evidence, or change strategy. |
707
+ | `E_DIAGNOSIS_REQUIRED` | Current correction cycle has no append-only diagnosis record. | Run forgeloop record-diagnosis with current failed evidence before correcting. |
708
+ | `E_EVIDENCE_COVERAGE_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
709
+ | `E_EVIDENCE_COVERAGE_PARTIAL` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
710
+ | `E_EVIDENCE_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
711
+ | `E_EVIDENCE_KIND_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
712
+ | `E_EVIDENCE_PARTIAL` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
713
+ | `E_EVIDENCE_REQUIRED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
714
+ | `E_EVIDENCE_STALE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
715
+ | `E_EXECUTION_REF_INVALID` | Referenced execution ID does not exist. | Re-run check via forgeloop run-check. |
716
+ | `E_FUTURE_LIFECYCLE_EVIDENCE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
717
+ | `E_FUTURE_TERMINAL_EVIDENCE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
718
+ | `E_GATE_REQUIRED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
719
+ | `E_GATE_STALE` | Referenced gate artifact changed after approval. | Update artifact SHA-256 in gate file. |
720
+ | `E_GATE_UNVERIFIED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
721
+ | `E_INIT_KIT_CONFLICT` | A canonical ForgeLoop kit destination already exists with content that does not match the shipped canonical template. | Inspect the conflicting `.forgeloop/kit/...` file. If it is stale or partial ForgeLoop output, remove or restore it and rerun `forgeloop init`. Do not overwrite unknown content automatically. |
722
+ | `E_INSTALLATION_AUTHORITY_REQUIRED` | Attempted software installation without host authority grant. | Use local non-installing binaries or request host authority grant. |
723
+ | `E_LEGACY_RECOVERY_MIGRATION_INVALID` | The legacy recovery-event repair was refused because the ledger does not match the exact known legacy defect signature, has incompatible later activity, holds a live lock, or is otherwise ambiguous. | Inspect the structured plan/errors; ambiguous or tampered ledgers stay INCONSISTENT and are never migrated. |
724
+ | `E_MIGRATION_INCOMPLETE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
725
+ | `E_MIGRATION_WRITE_VERIFY` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
726
+ | `E_MIXED_TERMINAL_REQUIREMENT` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
727
+ | `E_NATIVE_ADAPTER_STALE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
728
+ | `E_NATIVE_ADAPTER_TARGET_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
605
729
  | `E_NEW_POLICY_VIOLATION` | New executable policy violation detected that is not present in brownfield baseline. | Fix the violation before completing the task. |
606
- | `E_BASELINE_EXPANSION` | Attempted unauthorized addition of new violations to brownfield baseline. | Resolve new violations rather than expanding the baseline. |
607
- | `E_POLICY_PROOF_STALE` | Mutation verification proof is stale due to checker or fixture modifications. | Re-run forgeloop rule-verify to refresh mutation proof. |
608
- | `E_CHECK_MUTATION_EXECUTION_ERROR` | A policy checker threw an unhandled exception while evaluating its mutation fixture. | Repair the checker execution path and rerun rule verification. |
730
+ | `E_PHASE_CHRONOLOGY_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
731
+ | `E_PHASE_PREREQUISITE_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
732
+ | `E_PHASE_TRANSITION_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
733
+ | `E_POLICY_DRIFT` | Active policy lock does not match the policy snapshot captured at task activation. | Re-verify affected checks or restore original policy. |
734
+ | `E_POLICY_DRIFT_UNKNOWN` | Task policy drift was detected but baseline snapshot details are unavailable. | Re-verify the task under the current policy state. |
609
735
  | `E_POLICY_EVALUATION_FAILED` | Policy evaluation threw an unexpected error during execution. | Inspect policy configuration and checker adapters for unhandled errors. |
736
+ | `E_POLICY_INITIALIZATION_FAILED` | Executable policy bootstrap could not complete during initialization. | Repair the reported filesystem/schema error and rerun `forgeloop init`. Initialization is restartable while no committed manifest exists. |
610
737
  | `E_POLICY_INVALID` | Policy artifact is malformed, corrupt, or schema-invalid. | Validate and repair rules.json, baseline.json, or discovery.json against schema. |
611
- | `E_POLICY_SNAPSHOT_WRITE_FAILED` | Failed to persist task policy snapshot during preflight. | Ensure the target task directory is writable and repair filesystem permissions. |
738
+ | `E_POLICY_LOCK_INVALID` | Policy lockfile is missing, malformed, or corrupt. | Run forgeloop policy-status or regenerate policy.lock. |
612
739
  | `E_POLICY_LOCK_MISMATCH` | Persisted policy lock digest does not match current effective policy state. | Re-evaluate effective rules and update policy.lock or restore modified rules. |
613
- | `E_POLICY_DRIFT_UNKNOWN` | Task policy drift was detected but baseline snapshot details are unavailable. | Re-verify the task under the current policy state. |
614
- | `E_BASELINE_RECORD_DURING_ACTIVE_TASK` | Cannot re-record baseline during an active task with policy snapshot. | Resolve new violations or use monotonic baseline --update. |
615
- | `E_POLICY_INITIALIZATION_FAILED` | Executable policy bootstrap could not complete during initialization. | Repair the reported filesystem/schema error and rerun `forgeloop init`. Initialization is restartable while no committed manifest exists. |
616
- | `E_INIT_KIT_CONFLICT` | A canonical ForgeLoop kit destination already exists with content that does not match the shipped canonical template. | Inspect the conflicting `.forgeloop/kit/...` file. If it is stale or partial ForgeLoop output, remove or restore it and rerun `forgeloop init`. Do not overwrite unknown content automatically. |
740
+ | `E_POLICY_PROOF_STALE` | Mutation verification proof is stale due to checker or fixture modifications. | Re-run forgeloop rule-verify to refresh mutation proof. |
741
+ | `E_POLICY_SNAPSHOT_WRITE_FAILED` | Failed to persist task policy snapshot during preflight. | Ensure the target task directory is writable and repair filesystem permissions. |
742
+ | `E_POLICY_WEAKENING` | Policy rules were weakened during task execution without explicit authority. | Restore the original policy configuration. |
743
+ | `E_PREFLIGHT_EVENT_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
744
+ | `E_PREFLIGHT_GATES_STALE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
745
+ | `E_PREFLIGHT_GATE_EVENT_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
746
+ | `E_PREFLIGHT_NOT_READY` | Preflight gates or contract validations are incomplete. | Satisfy required gates and check preflight output. |
747
+ | `E_PREFLIGHT_READY_EVENT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
748
+ | `E_PREFLIGHT_READY_EVENT_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
749
+ | `E_PRODUCTION_READINESS_UNVERIFIED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
750
+ | `E_PRODUCTION_REQUIREMENT_PENDING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
751
+ | `E_PROFILE_SOURCE_MISCLASSIFIED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
752
+ | `E_PROFILE_SOURCE_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
753
+ | `E_PROFILE_SOURCE_UNKNOWN` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
754
+ | `E_PROFILE_UNVERIFIED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
755
+ | `E_PROGRESS_STALLED` | Persisted correction history shows no new diagnostic information. | Use an independent check, revisit assumptions, or record a materially different diagnosis. |
756
+ | `E_PROJECT_CLAIMS_LOCK_INCONSISTENT` | The project-wide claim reservation lock has unknown, corrupt, or concurrently changed ownership metadata. | Inspect .forgeloop/.claims.lock and retry only after its lease and owner identity can be validated; never force-delete unknown ownership. |
757
+ | `E_PROTOCOL_MIGRATION_TARGET_UNSUPPORTED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
758
+ | `E_PUBLICATION_CLAIM_UNVERIFIED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
759
+ | `E_PUBLICATION_REQUIREMENT_PENDING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
760
+ | `E_RECEIPT_CONTRACT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
761
+ | `E_RECEIPT_CYCLE_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
762
+ | `E_RECEIPT_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
763
+ | `E_RECEIPT_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
764
+ | `E_RECEIPT_PATH_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
765
+ | `E_RECEIPT_ROUTE_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
766
+ | `E_RECEIPT_STATE_MISMATCH` | Receipt does not match current state cycle or work state. | Run forgeloop prepare-completion --json. |
767
+ | `E_RECEIPT_TASK_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
768
+ | `E_RECONCILE_EVIDENCE_FAILED` | The executed objective-satisfaction evidence command did not pass. | Inspect the execution artifact; reconciliation is refused until evidence passes in the current repository. |
769
+ | `E_RECONCILE_LEDGER_INVALID` | The append-only event ledger is not valid, so reconciliation cannot be recorded. | Inspect the ledger errors and repair before reconciling. |
770
+ | `E_RECONCILE_NOT_STALE` | reconcile-closure was invoked for a work-state checkpoint that is already fresh. | No reconciliation is required; continue the normal lifecycle. |
771
+ | `E_RECONCILE_PHASE_INVALID` | reconcile-closure was invoked for a task that is not EXECUTING or VERIFYING. | reconcile-closure supports EXECUTING or VERIFYING tasks whose objective is already satisfied. |
772
+ | `E_RECONCILE_REQUIREMENT_UNKNOWN` | The supplied check id and requirement text do not exactly match a contract verification item of type VERIFICATION. | Supply the exact id and requirement text of an existing contract verification item. |
773
+ | `E_RECONCILE_UNSUPPORTED_DRIFT` | Work-state drift includes kinds other than REPOSITORY_CHANGED (contract or required-artifact drift). | Resolve contract or artifact drift through their dedicated recovery surfaces; reconcile-closure only refreshes repository fingerprint drift. |
774
+ | `E_REPOSITORY_CHANGED` | The repository fingerprint (branch or HEAD) moved after the work-state checkpoint was recorded. | If the task objective is already satisfied in the current repository, run forgeloop reconcile-closure; otherwise resume from a checkpoint that matches the current repository. |
775
+ | `E_ROUTE_GUIDE_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
776
+ | `E_ROUTE_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
777
+ | `E_ROUTE_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
778
+ | `E_ROUTE_REASON_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
779
+ | `E_ROUTE_STALE` | Routing result does not match the active contract fingerprint. | Re-run forgeloop route. |
780
+ | `E_STATE_LEDGER_DIVERGENCE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
781
+ | `E_STATE_MISSING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
782
+ | `E_STATE_MISSING_AFTER_PREFLIGHT_READY` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
783
+ | `E_STATE_REVALIDATION_REQUIRED` | The work-state checkpoint must be revalidated before the lifecycle can continue. | Run forgeloop reconcile-closure for externally satisfied EXECUTING tasks, or inspect the freshness reasons for other drift. |
784
+ | `E_STATE_TASK_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
785
+ | `E_TASK_ALREADY_EXISTS` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
786
+ | `E_TASK_ALREADY_RECOVERED` | The task already has active durable recovered state. | Inspect the existing recovery metadata; use task-resume to reacquire claims or leave the task recovered. |
787
+ | `E_TASK_AMBIGUOUS` | Multiple tasks exist in the project but no task selector was provided. | Select a task explicitly using --task <id> or FORGELOOP_TASK=<id>. |
788
+ | `E_TASK_CHANGE_ATTRIBUTION_UNAVAILABLE` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
789
+ | `E_TASK_CHANGE_OUTSIDE_SCOPE` | Modified paths in repository exceed the declared task write claims. | Update write claims with forgeloop task-scope or revert out-of-scope modifications. |
790
+ | `E_TASK_CLAIM_OWNERSHIP_INCONSISTENT` | ForgeLoop cannot prove whether a task still owns its historical write claims. | Repair and validate the task descriptor, recovery artifact, and complete event ledger before acquiring overlapping claims or mutating the task. |
791
+ | `E_TASK_COMPLETE` | A validator-backed COMPLETE task is terminal and cannot be mutated. | Create or select a non-terminal task for further work; do not modify terminal task state. |
792
+ | `E_TASK_CONTEXT_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
793
+ | `E_TASK_DESCRIPTOR_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
794
+ | `E_TASK_KEY_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
795
+ | `E_TASK_LAYOUT_LEGACY` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
796
+ | `E_TASK_LOCKED` | Task mutation is currently locked by another concurrent process or run-check. | Wait for the active mutation to complete or inspect the lock with forgeloop task-show. |
797
+ | `E_TASK_LOCK_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
798
+ | `E_TASK_MIGRATION_IDENTITY_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
799
+ | `E_TASK_MIGRATION_INVALID` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
800
+ | `E_TASK_NOT_FOUND` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
801
+ | `E_TASK_NOT_RECOVERED` | task-resume was requested for a task without active recovered state. | Inspect the task with forgeloop task-show; task-resume is only valid while recovery.json is active. |
802
+ | `E_TASK_RECOVERED` | The task released its write claims through recovery and ordinary mutation is suspended. | Run forgeloop task-resume --task <id> to reacquire the released claims before mutating the task. |
803
+ | `E_TASK_RECOVERY_AUTHORITY_INVALID` | Recovery authority metadata is invalid or claims host attestation without a host-owned grant reference. | Use caller acknowledgement, or provide a host-attested recovery grant through a trusted host integration. |
804
+ | `E_TASK_RECOVERY_AUTHORIZATION_REQUIRED` | task-recover requires explicit caller acknowledgement; this is not host-attested authority. | Re-run with --acknowledge-recovery only when evidence shows the task is STALE or ABANDONED; --operator-authorized remains a deprecated alias. |
805
+ | `E_TASK_RECOVERY_INCONSISTENT` | Claim-release recovery was refused because the task state, recovery artifact, lock, or event ledger is inconsistent. | Repair the underlying artifact through its dedicated recovery surface; do not force-complete an unreadable task. |
806
+ | `E_TASK_RECOVERY_OFFICIAL_PATH_AVAILABLE` | Claim-release recovery was refused because canonical lifecycle reconciliation is available. | Use forgeloop reconcile-closure and the normal verification/completion pipeline instead of task-recover. |
807
+ | `E_TASK_RECOVERY_UNSAFE` | Claim-release recovery was refused because the conflicting task is active, inconsistent, already complete, or holds a live lease. | Resolve the reported classification first; live leases must expire or be released by their owner before recovery. |
808
+ | `E_TASK_REQUIRED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
809
+ | `E_TASK_SCOPE_CONFLICT` | Task write claims overlap with another non-complete task in the same checkout. | Inspect the conflicting task classification reported in error.conflicts, then reconcile or recover it through its reported official recovery commands before retrying task creation. |
810
+ | `E_TASK_SCOPE_DIRTY` | Claimed paths contain pre-existing uncommitted changes. | Commit or stash changes in claimed paths before defining or adopting the scope. |
811
+ | `E_TASK_SCOPE_FROZEN` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
812
+ | `E_TASK_SCOPE_REQUIRED` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
813
+ | `E_TASK_SELECTOR_CONFLICT` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
814
+ | `E_TERMINAL_REQUIREMENT_NOT_TERMINAL` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
815
+ | `E_TERMINAL_REQUIREMENT_PENDING` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
816
+ | `E_TERMINAL_REQUIREMENT_TYPE_MISMATCH` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
817
+ | `E_TERMINAL_REQUIREMENT_UNKNOWN` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
818
+ | `E_TERMINAL_STATUS_REGRESSION` | A ForgeLoop protocol validation or lifecycle condition was not satisfied. | Inspect the structured command result, correct the named artifact or prerequisite, then run forgeloop next --json. |
819
+ | `E_VERIFICATION_TOOL_UNAVAILABLE` | Required verification executable is missing in environment. | Use local equivalent, obtain host authority, or record NOT_VERIFIED. |
617
820
 
618
821
  <!-- END FORGELOOP GENERATED: public-error-codes -->