@cassiomc1/forgeloop 1.2.2 → 1.2.3
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.
package/docs/TROUBLESHOOTING.md
CHANGED
|
@@ -195,7 +195,7 @@ forgeloop status --task <id> --json
|
|
|
195
195
|
|
|
196
196
|
---
|
|
197
197
|
|
|
198
|
-
### Symptom: `EXECUTING` task is stale because the repository moved (`E_REPOSITORY_CHANGED`)
|
|
198
|
+
### Symptom: `EXECUTING`/`VERIFYING` task is stale because the repository moved (`E_REPOSITORY_CHANGED`)
|
|
199
199
|
|
|
200
200
|
#### What it means
|
|
201
201
|
|
|
@@ -210,7 +210,7 @@ forgeloop reconcile-closure --task <id> --id <verification-id> \
|
|
|
210
210
|
|
|
211
211
|
`reconcile-closure` requires:
|
|
212
212
|
|
|
213
|
-
1. The task is `EXECUTING
|
|
213
|
+
1. The task is `EXECUTING` or `VERIFYING` (later phases are not reconcilable; work must return to a verification phase first).
|
|
214
214
|
2. The only drift is `REPOSITORY_CHANGED` (contract or required-artifact drift stays blocked).
|
|
215
215
|
3. The append-only event ledger is valid.
|
|
216
216
|
4. `--id` and `--requirement` exactly match a `VERIFICATION` item of the task contract, and the executed command exits 0, proving the objective is present in the current repository.
|
|
@@ -582,7 +582,7 @@ forgeloop next --task <id> --json
|
|
|
582
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
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
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. | reconcile-closure supports EXECUTING tasks whose objective is already satisfied. |
|
|
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
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
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
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. |
|
package/package.json
CHANGED
package/src/core/error-codes.js
CHANGED
|
@@ -189,8 +189,8 @@ export const PUBLIC_ERROR_CODES = Object.freeze({
|
|
|
189
189
|
code: "E_RECONCILE_PHASE_INVALID",
|
|
190
190
|
category: "lifecycle",
|
|
191
191
|
classification: "PUBLIC_STABLE",
|
|
192
|
-
meaning: "reconcile-closure was invoked for a task that is not EXECUTING.",
|
|
193
|
-
safeResolution: "reconcile-closure supports EXECUTING tasks whose objective is already satisfied.",
|
|
192
|
+
meaning: "reconcile-closure was invoked for a task that is not EXECUTING or VERIFYING.",
|
|
193
|
+
safeResolution: "reconcile-closure supports EXECUTING or VERIFYING tasks whose objective is already satisfied.",
|
|
194
194
|
}),
|
|
195
195
|
E_RECONCILE_UNSUPPORTED_DRIFT: Object.freeze({
|
|
196
196
|
code: "E_RECONCILE_UNSUPPORTED_DRIFT",
|
|
@@ -9,6 +9,8 @@ export const RECONCILE_EVENT = "CHECKPOINT_RECONCILED";
|
|
|
9
9
|
|
|
10
10
|
const RECONCILABLE_DRIFT = new Set(["REPOSITORY_CHANGED"]);
|
|
11
11
|
|
|
12
|
+
const RECONCILABLE_PHASES = new Set(["EXECUTING", "VERIFYING"]);
|
|
13
|
+
|
|
12
14
|
function reconcileError(code, message, artifacts = []) {
|
|
13
15
|
const error = new Error(message);
|
|
14
16
|
error.code = code;
|
|
@@ -17,12 +19,12 @@ function reconcileError(code, message, artifacts = []) {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
|
-
* Canonical recovery for an EXECUTING task whose objective is
|
|
21
|
-
* satisfied in the current repository but whose work-state
|
|
22
|
-
* stale because the repository fingerprint moved.
|
|
22
|
+
* Canonical recovery for an EXECUTING or VERIFYING task whose objective is
|
|
23
|
+
* already satisfied in the current repository but whose work-state
|
|
24
|
+
* checkpoint is stale because the repository fingerprint moved.
|
|
23
25
|
*
|
|
24
26
|
* The command refreshes the checkpoint repository fingerprint only after:
|
|
25
|
-
* - the task is EXECUTING,
|
|
27
|
+
* - the task is EXECUTING or VERIFYING,
|
|
26
28
|
* - classification requires revalidation and the only drift is
|
|
27
29
|
* REPOSITORY_CHANGED,
|
|
28
30
|
* - the append-only event ledger is valid,
|
|
@@ -66,10 +68,10 @@ export async function runReconcileClosure({
|
|
|
66
68
|
if (!state) {
|
|
67
69
|
throw reconcileError("E_RECONCILE_PHASE_INVALID", "Cannot reconcile without work state", [stateRel]);
|
|
68
70
|
}
|
|
69
|
-
if (state.phase
|
|
71
|
+
if (!RECONCILABLE_PHASES.has(state.phase)) {
|
|
70
72
|
throw reconcileError(
|
|
71
73
|
"E_RECONCILE_PHASE_INVALID",
|
|
72
|
-
`reconcile-closure supports EXECUTING tasks whose objective is already satisfied; found ${state.phase}`,
|
|
74
|
+
`reconcile-closure supports EXECUTING or VERIFYING tasks whose objective is already satisfied; found ${state.phase}`,
|
|
73
75
|
[stateRel],
|
|
74
76
|
);
|
|
75
77
|
}
|