dorfl 0.1.2 → 0.2.1
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/dist/advance-drivers.d.ts +1 -1
- package/dist/advance-drivers.d.ts.map +1 -1
- package/dist/advance-drivers.js +15 -3
- package/dist/advance-drivers.js.map +1 -1
- package/dist/advance-lifecycle-template.d.ts.map +1 -1
- package/dist/advance-lifecycle-template.js +76 -4
- package/dist/advance-lifecycle-template.js.map +1 -1
- package/dist/advance-treeless-publish.d.ts +23 -0
- package/dist/advance-treeless-publish.d.ts.map +1 -1
- package/dist/advance-treeless-publish.js +41 -0
- package/dist/advance-treeless-publish.js.map +1 -1
- package/dist/advance.d.ts +59 -7
- package/dist/advance.d.ts.map +1 -1
- package/dist/advance.js +389 -82
- package/dist/advance.js.map +1 -1
- package/dist/advancing-lock.d.ts +30 -2
- package/dist/advancing-lock.d.ts.map +1 -1
- package/dist/advancing-lock.js +50 -0
- package/dist/advancing-lock.js.map +1 -1
- package/dist/agent-launch.d.ts +12 -0
- package/dist/agent-launch.d.ts.map +1 -1
- package/dist/agent-launch.js +22 -12
- package/dist/agent-launch.js.map +1 -1
- package/dist/agent-stop.d.ts +40 -2
- package/dist/agent-stop.d.ts.map +1 -1
- package/dist/agent-stop.js +30 -2
- package/dist/agent-stop.js.map +1 -1
- package/dist/apply-decide.d.ts +17 -3
- package/dist/apply-decide.d.ts.map +1 -1
- package/dist/apply-decide.js +36 -7
- package/dist/apply-decide.js.map +1 -1
- package/dist/apply-merge-action.d.ts +17 -5
- package/dist/apply-merge-action.d.ts.map +1 -1
- package/dist/apply-merge-action.js +43 -8
- package/dist/apply-merge-action.js.map +1 -1
- package/dist/apply-persist.d.ts +57 -26
- package/dist/apply-persist.d.ts.map +1 -1
- package/dist/apply-persist.js +166 -37
- package/dist/apply-persist.js.map +1 -1
- package/dist/apply-stuck-action.d.ts +151 -0
- package/dist/apply-stuck-action.d.ts.map +1 -0
- package/dist/apply-stuck-action.js +125 -0
- package/dist/apply-stuck-action.js.map +1 -0
- package/dist/brand.d.ts +12 -1
- package/dist/brand.d.ts.map +1 -1
- package/dist/brand.js +2 -1
- package/dist/brand.js.map +1 -1
- package/dist/cli-spinner.d.ts +1 -1
- package/dist/cli-spinner.js +1 -1
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +320 -63
- package/dist/cli.js.map +1 -1
- package/dist/close-job-template.js +1 -1
- package/dist/complete.d.ts +6 -3
- package/dist/complete.d.ts.map +1 -1
- package/dist/complete.js +91 -37
- package/dist/complete.js.map +1 -1
- package/dist/config.d.ts +55 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +56 -4
- package/dist/config.js.map +1 -1
- package/dist/continue-branch.d.ts.map +1 -1
- package/dist/continue-branch.js +22 -0
- package/dist/continue-branch.js.map +1 -1
- package/dist/decision-engine.d.ts +38 -10
- package/dist/decision-engine.d.ts.map +1 -1
- package/dist/decision-engine.js +10 -6
- package/dist/decision-engine.js.map +1 -1
- package/dist/do-autopick.d.ts.map +1 -1
- package/dist/do-autopick.js +11 -1
- package/dist/do-autopick.js.map +1 -1
- package/dist/do-config.d.ts +1 -1
- package/dist/do.d.ts +49 -56
- package/dist/do.d.ts.map +1 -1
- package/dist/do.js +419 -30
- package/dist/do.js.map +1 -1
- package/dist/env-config.d.ts.map +1 -1
- package/dist/env-config.js +12 -4
- package/dist/env-config.js.map +1 -1
- package/dist/failure-cause.d.ts +3 -2
- package/dist/failure-cause.d.ts.map +1 -1
- package/dist/failure-cause.js +28 -1
- package/dist/failure-cause.js.map +1 -1
- package/dist/format.d.ts +6 -6
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +10 -27
- package/dist/format.js.map +1 -1
- package/dist/frontmatter.d.ts +16 -4
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +27 -1
- package/dist/frontmatter.js.map +1 -1
- package/dist/gc.d.ts +65 -6
- package/dist/gc.d.ts.map +1 -1
- package/dist/gc.js +126 -9
- package/dist/gc.js.map +1 -1
- package/dist/github.d.ts +14 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +73 -0
- package/dist/github.js.map +1 -1
- package/dist/harness.d.ts +25 -0
- package/dist/harness.d.ts.map +1 -1
- package/dist/harness.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/install-ci-branch-protection.d.ts +132 -38
- package/dist/install-ci-branch-protection.d.ts.map +1 -1
- package/dist/install-ci-branch-protection.js +190 -48
- package/dist/install-ci-branch-protection.js.map +1 -1
- package/dist/install-ci-core.d.ts +21 -1
- package/dist/install-ci-core.d.ts.map +1 -1
- package/dist/install-ci-core.js +10 -3
- package/dist/install-ci-core.js.map +1 -1
- package/dist/install-ci-github.d.ts +32 -0
- package/dist/install-ci-github.d.ts.map +1 -1
- package/dist/install-ci-github.js +73 -0
- package/dist/install-ci-github.js.map +1 -1
- package/dist/install-skills.d.ts +123 -0
- package/dist/install-skills.d.ts.map +1 -0
- package/dist/install-skills.js +100 -0
- package/dist/install-skills.js.map +1 -0
- package/dist/intake-trigger-template.js +1 -1
- package/dist/intake.d.ts +17 -4
- package/dist/intake.d.ts.map +1 -1
- package/dist/intake.js +23 -7
- package/dist/intake.js.map +1 -1
- package/dist/integration-core.d.ts +10 -7
- package/dist/integration-core.d.ts.map +1 -1
- package/dist/integration-core.js +174 -60
- package/dist/integration-core.js.map +1 -1
- package/dist/integrator.d.ts +1 -1
- package/dist/integrator.d.ts.map +1 -1
- package/dist/integrator.js +19 -3
- package/dist/integrator.js.map +1 -1
- package/dist/isolation.d.ts +2 -2
- package/dist/isolation.d.ts.map +1 -1
- package/dist/isolation.js +9 -0
- package/dist/isolation.js.map +1 -1
- package/dist/item-lock.d.ts +196 -129
- package/dist/item-lock.d.ts.map +1 -1
- package/dist/item-lock.js +329 -254
- package/dist/item-lock.js.map +1 -1
- package/dist/ledger-write.d.ts +31 -26
- package/dist/ledger-write.d.ts.map +1 -1
- package/dist/ledger-write.js +100 -122
- package/dist/ledger-write.js.map +1 -1
- package/dist/lifecycle-gather.d.ts +17 -0
- package/dist/lifecycle-gather.d.ts.map +1 -1
- package/dist/lifecycle-gather.js +7 -1
- package/dist/lifecycle-gather.js.map +1 -1
- package/dist/lifecycle-pools.d.ts +40 -3
- package/dist/lifecycle-pools.d.ts.map +1 -1
- package/dist/lifecycle-pools.js +26 -6
- package/dist/lifecycle-pools.js.map +1 -1
- package/dist/merge-question-surfacer.d.ts +15 -1
- package/dist/merge-question-surfacer.d.ts.map +1 -1
- package/dist/merge-question-surfacer.js +18 -3
- package/dist/merge-question-surfacer.js.map +1 -1
- package/dist/migrate-stuck-locks.d.ts +129 -0
- package/dist/migrate-stuck-locks.d.ts.map +1 -0
- package/dist/migrate-stuck-locks.js +355 -0
- package/dist/migrate-stuck-locks.js.map +1 -0
- package/dist/needs-attention.d.ts +293 -16
- package/dist/needs-attention.d.ts.map +1 -1
- package/dist/needs-attention.js +532 -57
- package/dist/needs-attention.js.map +1 -1
- package/dist/orphan-sidecar.d.ts +8 -4
- package/dist/orphan-sidecar.d.ts.map +1 -1
- package/dist/orphan-sidecar.js +35 -2
- package/dist/orphan-sidecar.js.map +1 -1
- package/dist/pi-harness.d.ts +16 -0
- package/dist/pi-harness.d.ts.map +1 -1
- package/dist/pi-harness.js +82 -2
- package/dist/pi-harness.js.map +1 -1
- package/dist/placement.d.ts +3 -3
- package/dist/placement.js +1 -1
- package/dist/prd-to-spec.d.ts.map +1 -1
- package/dist/prd-to-spec.js +9 -5
- package/dist/prd-to-spec.js.map +1 -1
- package/dist/protocol/CLAIM-PROTOCOL.md +17 -10
- package/dist/protocol/REVIEW-PROTOCOL.md +4 -1
- package/dist/protocol/SURFACE-PROTOCOL.md +16 -2
- package/dist/protocol/TASKING-PROTOCOL.md +3 -1
- package/dist/protocol/WORK-CONTRACT.md +22 -18
- package/dist/protocol/task-template.md +1 -1
- package/dist/reap-branches.d.ts +12 -9
- package/dist/reap-branches.d.ts.map +1 -1
- package/dist/reap-branches.js +25 -7
- package/dist/reap-branches.js.map +1 -1
- package/dist/recover-isolated.d.ts +12 -0
- package/dist/recover-isolated.d.ts.map +1 -1
- package/dist/recover-isolated.js +5 -0
- package/dist/recover-isolated.js.map +1 -1
- package/dist/repo-config.d.ts +23 -2
- package/dist/repo-config.d.ts.map +1 -1
- package/dist/repo-config.js +53 -7
- package/dist/repo-config.js.map +1 -1
- package/dist/repo-mirror.d.ts.map +1 -1
- package/dist/repo-mirror.js +18 -2
- package/dist/repo-mirror.js.map +1 -1
- package/dist/review-verdict.js +1 -1
- package/dist/review-verdict.js.map +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +54 -19
- package/dist/run.js.map +1 -1
- package/dist/scan.d.ts +17 -8
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +22 -8
- package/dist/scan.js.map +1 -1
- package/dist/select-priority.d.ts +2 -2
- package/dist/select-priority.js +1 -1
- package/dist/select-priority.js.map +1 -1
- package/dist/sidecar-apply.js +1 -1
- package/dist/sidecar-apply.js.map +1 -1
- package/dist/sidecar.d.ts +45 -10
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/sidecar.js +82 -2
- package/dist/sidecar.js.map +1 -1
- package/dist/skills/answer-questions/SKILL.md +89 -0
- package/dist/skills/capture-signal/SKILL.md +52 -0
- package/dist/skills/convert-from-prd-to-spec/SKILL.md +90 -0
- package/dist/skills/drive-tasks/SKILL.md +218 -0
- package/dist/skills/from-idea/SKILL.md +83 -0
- package/dist/skills/merge-prs/SKILL.md +70 -0
- package/dist/skills/orchestrate/SKILL.md +101 -0
- package/dist/skills/promote/SKILL.md +35 -0
- package/dist/skills/review/SKILL.md +16 -0
- package/dist/skills/setup/SKILL.md +258 -0
- package/dist/skills/setup/protocol/ADR-FORMAT.md +47 -0
- package/dist/skills/setup/protocol/CLAIM-PROTOCOL.md +224 -0
- package/dist/skills/setup/protocol/REVIEW-PROTOCOL.md +122 -0
- package/dist/skills/setup/protocol/SURFACE-PROTOCOL.md +135 -0
- package/dist/skills/setup/protocol/TASKING-PROTOCOL.md +124 -0
- package/dist/skills/setup/protocol/WORK-CONTRACT.md +280 -0
- package/dist/skills/setup/protocol/spec-template.md +71 -0
- package/dist/skills/setup/protocol/task-template.md +65 -0
- package/dist/skills/surface-questions/SKILL.md +16 -0
- package/dist/skills/to-spec/SKILL.md +34 -0
- package/dist/skills/to-task/SKILL.md +19 -0
- package/dist/skills/triage-observations/SKILL.md +78 -0
- package/dist/skills/work/SKILL.md +51 -0
- package/dist/slug-namespace.d.ts +5 -5
- package/dist/slug-namespace.js +5 -5
- package/dist/slug-namespace.js.map +1 -1
- package/dist/spec-complete.d.ts.map +1 -1
- package/dist/spec-complete.js +2 -3
- package/dist/spec-complete.js.map +1 -1
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +51 -57
- package/dist/start.js.map +1 -1
- package/dist/surface-gate.d.ts.map +1 -1
- package/dist/surface-gate.js +10 -3
- package/dist/surface-gate.js.map +1 -1
- package/dist/surface-persist.js +1 -1
- package/dist/surface-persist.js.map +1 -1
- package/dist/tasker-review-loop.d.ts +4 -3
- package/dist/tasker-review-loop.d.ts.map +1 -1
- package/dist/tasker-review-loop.js.map +1 -1
- package/dist/tasking-lock.d.ts +2 -2
- package/dist/tasking-lock.d.ts.map +1 -1
- package/dist/tasking-lock.js +53 -32
- package/dist/tasking-lock.js.map +1 -1
- package/dist/tasking.d.ts +40 -6
- package/dist/tasking.d.ts.map +1 -1
- package/dist/tasking.js +224 -12
- package/dist/tasking.js.map +1 -1
- package/dist/triage-persist.d.ts +10 -6
- package/dist/triage-persist.d.ts.map +1 -1
- package/dist/triage-persist.js +34 -4
- package/dist/triage-persist.js.map +1 -1
- package/dist/vendor/incur/agents.d.ts +58 -0
- package/dist/vendor/incur/agents.d.ts.map +1 -0
- package/dist/vendor/incur/agents.js +343 -0
- package/dist/vendor/incur/agents.js.map +1 -0
- package/dist/verify-workflow-template.js +1 -1
- package/dist/watch-session.d.ts +11 -3
- package/dist/watch-session.d.ts.map +1 -1
- package/dist/watch-session.js +94 -7
- package/dist/watch-session.js.map +1 -1
- package/dist/work-layout.d.ts +7 -3
- package/dist/work-layout.d.ts.map +1 -1
- package/dist/work-layout.js +6 -3
- package/dist/work-layout.js.map +1 -1
- package/dist/workspace.d.ts +1 -1
- package/package.json +2 -2
- package/src/advance-drivers.ts +16 -3
- package/src/advance-lifecycle-template.ts +89 -4
- package/src/advance-treeless-publish.ts +45 -0
- package/src/advance.ts +467 -87
- package/src/advancing-lock.ts +96 -1
- package/src/agent-launch.ts +37 -12
- package/src/agent-stop.ts +60 -2
- package/src/apply-decide.ts +36 -7
- package/src/apply-merge-action.ts +45 -7
- package/src/apply-persist.ts +228 -54
- package/src/apply-stuck-action.ts +260 -0
- package/src/brand.ts +14 -2
- package/src/cli-spinner.ts +1 -1
- package/src/cli.ts +401 -70
- package/src/close-job-template.ts +1 -1
- package/src/complete.ts +110 -52
- package/src/config.ts +107 -13
- package/src/continue-branch.ts +22 -0
- package/src/decision-engine.ts +55 -17
- package/src/do-autopick.ts +12 -1
- package/src/do-config.ts +1 -1
- package/src/do.ts +511 -38
- package/src/env-config.ts +12 -4
- package/src/failure-cause.ts +30 -1
- package/src/format.ts +10 -30
- package/src/frontmatter.ts +35 -5
- package/src/gc.ts +172 -9
- package/src/github.ts +78 -0
- package/src/harness.ts +25 -0
- package/src/index.ts +10 -0
- package/src/install-ci-branch-protection.ts +282 -57
- package/src/install-ci-core.ts +30 -3
- package/src/install-ci-github.ts +86 -0
- package/src/install-skills.ts +166 -0
- package/src/intake-trigger-template.ts +1 -1
- package/src/intake.ts +46 -11
- package/src/integration-core.ts +199 -65
- package/src/integrator.ts +22 -9
- package/src/isolation.ts +11 -2
- package/src/item-lock.ts +485 -341
- package/src/ledger-write.ts +135 -150
- package/src/lifecycle-gather.ts +29 -6
- package/src/lifecycle-pools.ts +67 -9
- package/src/merge-question-surfacer.ts +28 -4
- package/src/migrate-stuck-locks.ts +451 -0
- package/src/needs-attention.ts +857 -84
- package/src/orphan-sidecar.ts +47 -6
- package/src/pi-harness.ts +82 -2
- package/src/placement.ts +3 -3
- package/src/prd-to-spec.ts +13 -5
- package/src/reap-branches.ts +38 -14
- package/src/recover-isolated.ts +17 -0
- package/src/repo-config.ts +55 -6
- package/src/repo-mirror.ts +23 -1
- package/src/review-verdict.ts +1 -1
- package/src/run.ts +64 -18
- package/src/scan.ts +22 -8
- package/src/select-priority.ts +3 -3
- package/src/sidecar-apply.ts +1 -1
- package/src/sidecar.ts +138 -11
- package/src/slug-namespace.ts +7 -7
- package/src/spec-complete.ts +2 -3
- package/src/start.ts +53 -59
- package/src/surface-gate.ts +10 -3
- package/src/surface-persist.ts +1 -1
- package/src/tasker-review-loop.ts +4 -3
- package/src/tasking-lock.ts +52 -36
- package/src/tasking.ts +261 -17
- package/src/triage-persist.ts +56 -12
- package/src/vendor/incur/LICENSE +21 -0
- package/src/vendor/incur/README.md +19 -0
- package/src/vendor/incur/agents.ts +392 -0
- package/src/verify-workflow-template.ts +1 -1
- package/src/watch-session.ts +102 -7
- package/src/work-layout.ts +6 -3
- package/src/workspace.ts +1 -1
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE-SHOT migration of pre-existing `stuck` per-item lock refs into the
|
|
3
|
+
* post-`retire-stuck-lock-state` resting shape (surface-on-`main` +
|
|
4
|
+
* `needsAnswers:true` + release the lock).
|
|
5
|
+
*
|
|
6
|
+
* Context (spec `surface-stuck-as-questions-and-retire-stuck-lock-state`,
|
|
7
|
+
* resolved decision #3, user story 5; task
|
|
8
|
+
* `migrate-existing-stuck-locks-one-shot`):
|
|
9
|
+
* - Before the retirement, a bounced item was recorded as a `state: stuck`
|
|
10
|
+
* lock ref (`refs/dorfl/lock/<entry>`) with the bounce reason (+ any
|
|
11
|
+
* agent-surfaced questions) on the ref's blob body.
|
|
12
|
+
* - After the retirement (task `retire-stuck-lock-state`), `LockState`
|
|
13
|
+
* admits only `active`. {@link parseLockEntry} silently COERCES a legacy
|
|
14
|
+
* `state: stuck` blob to `active` on read, and the `stuck`-only body
|
|
15
|
+
* sections (`## Reason` / `## Questions`) are no longer emitted or
|
|
16
|
+
* parsed. So a legacy stuck ref is now invisible to the runner (it looks
|
|
17
|
+
* like a healthy in-flight `active` hold) and its reason/questions would
|
|
18
|
+
* rot forever if the state were not migrated at rollout.
|
|
19
|
+
*
|
|
20
|
+
* This module runs the migration ONCE per arbiter at rollout: for every held
|
|
21
|
+
* lock ref whose RAW blob body still carries `state: stuck` in its
|
|
22
|
+
* frontmatter, it extracts the reason (+ questions) directly from the legacy
|
|
23
|
+
* body (bypassing the coercing {@link parseLockEntry}) and drives the SAME
|
|
24
|
+
* ordered surface-first-release-second transition the new bounce uses
|
|
25
|
+
* ({@link surfaceStuckToNeedsAttention}) — writing the `stuck`-kind
|
|
26
|
+
* `work/questions/<entry>.md` sidecar + flipping `needsAnswers:true` on the
|
|
27
|
+
* item body on `<arbiter>/main`, then releasing the ref. After the migration
|
|
28
|
+
* no `stuck` lock ref remains and every previously-stuck item rests as a
|
|
29
|
+
* `needsAnswers:true` pool item with a sidecar (the same resting shape a
|
|
30
|
+
* fresh bounce produces).
|
|
31
|
+
*
|
|
32
|
+
* IDEMPOTENT by construction: the legacy shape is identified from the raw
|
|
33
|
+
* blob's `state: stuck` frontmatter line, which the new lock module NEVER
|
|
34
|
+
* writes; a re-run therefore finds no legacy stuck ref → the report has zero
|
|
35
|
+
* `migrated` entries and no arbiter mutation occurs. Bare-arbiter safe (a ref
|
|
36
|
+
* is a ref): every operation goes through the same lock-ref plumbing the
|
|
37
|
+
* live path uses, so it works on a `--bare file://` arbiter identically to a
|
|
38
|
+
* real remote.
|
|
39
|
+
*
|
|
40
|
+
* SCOPE FENCE: this migrates ONLY lock entries whose name reverse-derives to
|
|
41
|
+
* a CURRENT item-form (`task-*` / `spec-*` / `observation-*` via
|
|
42
|
+
* {@link hasCurrentItemForm}); a pre-cutover `slice-*` / `prd-*` legacy stuck
|
|
43
|
+
* ref has no on-`main` body to flip and is out of scope for the surface
|
|
44
|
+
* transition — such entries are reported as `skipped-no-item-form` and left
|
|
45
|
+
* for the existing `release-lock --entry <literal>` escape hatch to clear (a
|
|
46
|
+
* human still asserts the clear on those; the migration never `--force`s or
|
|
47
|
+
* deletes them). See the CLI verb `dorfl migrate-stuck-locks` for the
|
|
48
|
+
* user-facing surface + its help text.
|
|
49
|
+
*/
|
|
50
|
+
import { runAsync } from './git.js';
|
|
51
|
+
import { itemFromLockEntry, itemLockRef, hasCurrentItemForm, listItemLocks, } from './item-lock.js';
|
|
52
|
+
import { surfaceStuckToNeedsAttention, } from './needs-attention.js';
|
|
53
|
+
import { resolveSidecarIdentity } from './sidecar.js';
|
|
54
|
+
/**
|
|
55
|
+
* Run the one-shot migration against the arbiter. Enumerates every held
|
|
56
|
+
* per-item lock ref, and for each whose RAW blob body carries `state: stuck`
|
|
57
|
+
* (the legacy shape the retired `stuck` state produced) drives the shared
|
|
58
|
+
* surface-first-release-second transition (reason + questions extracted from
|
|
59
|
+
* the legacy body). Idempotent: a re-run finds no legacy stuck refs and is a
|
|
60
|
+
* clean no-op.
|
|
61
|
+
*/
|
|
62
|
+
export async function migrateStuckLocks(options) {
|
|
63
|
+
const cwd = options.cwd;
|
|
64
|
+
const arbiter = options.arbiter ?? 'origin';
|
|
65
|
+
const env = options.env;
|
|
66
|
+
const note = options.note ?? (() => { });
|
|
67
|
+
const entries = [];
|
|
68
|
+
let migrated = 0;
|
|
69
|
+
let migratedBodyAbsent = 0;
|
|
70
|
+
let notStuck = 0;
|
|
71
|
+
let skippedNoItemForm = 0;
|
|
72
|
+
let lost = 0;
|
|
73
|
+
let errors = 0;
|
|
74
|
+
// Enumerate every held lock entry on the arbiter. `listItemLocks` fetches the
|
|
75
|
+
// lock refs first (hard-fails on a fetch fault) so the enumeration reads a
|
|
76
|
+
// fresh arbiter snapshot; if the fetch throws we surface it as a single
|
|
77
|
+
// terminal error rather than degrading to `[]` (which would silently claim
|
|
78
|
+
// "nothing to migrate").
|
|
79
|
+
let heldEntries;
|
|
80
|
+
try {
|
|
81
|
+
heldEntries = await listItemLocks(cwd, arbiter, env);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
return {
|
|
85
|
+
entries: [
|
|
86
|
+
{
|
|
87
|
+
entry: '',
|
|
88
|
+
ref: '',
|
|
89
|
+
item: '',
|
|
90
|
+
outcome: 'error',
|
|
91
|
+
message: `failed to enumerate lock refs on ${arbiter}: ${err instanceof Error ? err.message : String(err)}`,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
migrated: 0,
|
|
95
|
+
migratedBodyAbsent: 0,
|
|
96
|
+
notStuck: 0,
|
|
97
|
+
skippedNoItemForm: 0,
|
|
98
|
+
lost: 0,
|
|
99
|
+
errors: 1,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
for (const entry of heldEntries) {
|
|
103
|
+
const ref = itemLockRef(entry);
|
|
104
|
+
const item = itemFromLockEntry(entry);
|
|
105
|
+
let body;
|
|
106
|
+
try {
|
|
107
|
+
body = await readLockBlob(ref, cwd, env);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
errors++;
|
|
111
|
+
entries.push({
|
|
112
|
+
entry,
|
|
113
|
+
ref,
|
|
114
|
+
item,
|
|
115
|
+
outcome: 'error',
|
|
116
|
+
message: `read failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
117
|
+
});
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (!isLegacyStuckBlob(body)) {
|
|
121
|
+
notStuck++;
|
|
122
|
+
entries.push({
|
|
123
|
+
entry,
|
|
124
|
+
ref,
|
|
125
|
+
item,
|
|
126
|
+
outcome: 'not-stuck',
|
|
127
|
+
message: `${entry} is not a legacy stuck lock (state != stuck on the ref blob) — left untouched.`,
|
|
128
|
+
});
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (!hasCurrentItemForm(entry)) {
|
|
132
|
+
// A pre-cutover `slice-*` / `prd-*` stuck ref has no current
|
|
133
|
+
// item-form and therefore no on-`main` body path to flip. The
|
|
134
|
+
// existing `release-lock --entry <literal>` escape hatch is the
|
|
135
|
+
// supported clear here; the migration NEVER `--force`s such a ref.
|
|
136
|
+
skippedNoItemForm++;
|
|
137
|
+
entries.push({
|
|
138
|
+
entry,
|
|
139
|
+
ref,
|
|
140
|
+
item,
|
|
141
|
+
outcome: 'skipped-no-item-form',
|
|
142
|
+
message: `'${entry}' is a legacy stuck ref with no current item-form ` +
|
|
143
|
+
`(pre-cutover slice-*/prd-*); clear via ` +
|
|
144
|
+
`\`dorfl release-lock --entry ${entry}\` (no auto-force).`,
|
|
145
|
+
});
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const { slug } = resolveSidecarIdentity(item);
|
|
149
|
+
const reason = extractLegacyReason(body) ?? '(no reason recorded)';
|
|
150
|
+
const questions = extractLegacyQuestions(body).map((q) => ({ question: q }));
|
|
151
|
+
let result;
|
|
152
|
+
try {
|
|
153
|
+
result = await surfaceStuckToNeedsAttention({
|
|
154
|
+
cwd,
|
|
155
|
+
slug,
|
|
156
|
+
item,
|
|
157
|
+
reason,
|
|
158
|
+
questions,
|
|
159
|
+
arbiter,
|
|
160
|
+
env,
|
|
161
|
+
note,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
errors++;
|
|
166
|
+
entries.push({
|
|
167
|
+
entry,
|
|
168
|
+
ref,
|
|
169
|
+
item,
|
|
170
|
+
outcome: 'error',
|
|
171
|
+
message: `surface transition threw: ${err instanceof Error ? err.message : String(err)}`,
|
|
172
|
+
});
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (result.surfaced && result.released) {
|
|
176
|
+
migrated++;
|
|
177
|
+
entries.push({
|
|
178
|
+
entry,
|
|
179
|
+
ref,
|
|
180
|
+
item,
|
|
181
|
+
outcome: 'migrated',
|
|
182
|
+
message: `migrated '${entry}' → surfaced on ${arbiter}/main ` +
|
|
183
|
+
'(needsAnswers:true + sidecar) and released the lock.',
|
|
184
|
+
});
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (!result.surfaced && result.released && result.bodyAbsent === true) {
|
|
188
|
+
// D1 body-absent probe: no `main` body existed to flip. The bounce
|
|
189
|
+
// primitive STILL released the lock so the legacy stuck ref no longer
|
|
190
|
+
// dangles; there is just nothing to surface. Counted as a drained
|
|
191
|
+
// migration (the goal — no stuck ref remains).
|
|
192
|
+
migratedBodyAbsent++;
|
|
193
|
+
entries.push({
|
|
194
|
+
entry,
|
|
195
|
+
ref,
|
|
196
|
+
item,
|
|
197
|
+
outcome: 'migrated-body-absent',
|
|
198
|
+
message: `released legacy stuck lock '${entry}': no body for '${item}' on ` +
|
|
199
|
+
`${arbiter}/main (D1 probe) — sidecar surface skipped, but the ` +
|
|
200
|
+
'stale lock was drained (the migration goal).',
|
|
201
|
+
});
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
// The surface CAS or the release did not converge (contention exhausted,
|
|
205
|
+
// or the leased release lost the race). Reported, never forced.
|
|
206
|
+
lost++;
|
|
207
|
+
entries.push({
|
|
208
|
+
entry,
|
|
209
|
+
ref,
|
|
210
|
+
item,
|
|
211
|
+
outcome: 'lost',
|
|
212
|
+
message: result.reasonNotSurfaced ??
|
|
213
|
+
`surface/release for '${entry}' did not converge (surfaced=${result.surfaced}, released=${result.released}); re-run.`,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
entries,
|
|
218
|
+
migrated,
|
|
219
|
+
migratedBodyAbsent,
|
|
220
|
+
notStuck,
|
|
221
|
+
skippedNoItemForm,
|
|
222
|
+
lost,
|
|
223
|
+
errors,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* True iff the migration report leaves a state a human should look at: a
|
|
228
|
+
* `lost` (CAS race) or an `error` (read/plumbing fault). A `not-stuck` /
|
|
229
|
+
* `skipped-no-item-form` outcome is INFORMATIONAL (the former is the normal
|
|
230
|
+
* healthy-hold state; the latter is deferred to `release-lock --entry`) and
|
|
231
|
+
* does NOT count. A pure "0 migrated, 0 lost, 0 error" report is exit-0.
|
|
232
|
+
*/
|
|
233
|
+
export function migrateStuckLocksNeedsAttention(report) {
|
|
234
|
+
return report.lost > 0 || report.errors > 0;
|
|
235
|
+
}
|
|
236
|
+
/** Format the sweep for the terminal. An empty enumeration (no lock refs at
|
|
237
|
+
* all) yields no lines (silent, like the gc lock report). */
|
|
238
|
+
export function formatMigrateStuckLocksReport(report) {
|
|
239
|
+
if (report.entries.length === 0) {
|
|
240
|
+
return [
|
|
241
|
+
'Migrate stuck locks: no per-item lock refs held on the arbiter — nothing to migrate.',
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
const lines = [
|
|
245
|
+
`Migrate stuck locks: migrated ${report.migrated}` +
|
|
246
|
+
(report.migratedBodyAbsent > 0
|
|
247
|
+
? ` (+${report.migratedBodyAbsent} body-absent — lock drained, no on-main body to surface)`
|
|
248
|
+
: '') +
|
|
249
|
+
`, left ${report.notStuck} healthy active hold(s) untouched` +
|
|
250
|
+
(report.skippedNoItemForm > 0
|
|
251
|
+
? `, skipped ${report.skippedNoItemForm} pre-cutover entry (clear via release-lock --entry)`
|
|
252
|
+
: '') +
|
|
253
|
+
(report.lost > 0
|
|
254
|
+
? `, ${report.lost} could not converge (lease lost — re-run)`
|
|
255
|
+
: '') +
|
|
256
|
+
(report.errors > 0
|
|
257
|
+
? `, ${report.errors} error(s) (left untouched)`
|
|
258
|
+
: '') +
|
|
259
|
+
':',
|
|
260
|
+
];
|
|
261
|
+
for (const e of report.entries) {
|
|
262
|
+
const tag = e.outcome === 'migrated'
|
|
263
|
+
? '[migrated] '
|
|
264
|
+
: e.outcome === 'migrated-body-absent'
|
|
265
|
+
? '[migrated:body-absent]'
|
|
266
|
+
: e.outcome === 'not-stuck'
|
|
267
|
+
? '[healthy] '
|
|
268
|
+
: e.outcome === 'skipped-no-item-form'
|
|
269
|
+
? '[skipped:no-item-form]'
|
|
270
|
+
: e.outcome === 'lost'
|
|
271
|
+
? '[lost] '
|
|
272
|
+
: '[error] ';
|
|
273
|
+
lines.push(` ${tag} ${e.entry} ${e.message}`);
|
|
274
|
+
}
|
|
275
|
+
return lines;
|
|
276
|
+
}
|
|
277
|
+
/** Read the raw `lock.md` blob body from a lock ref, or throw. Bypasses
|
|
278
|
+
* {@link parseLockEntry} on purpose — the caller needs the untouched legacy
|
|
279
|
+
* text (which the coercing parser strips). */
|
|
280
|
+
async function readLockBlob(ref, cwd, env) {
|
|
281
|
+
const show = await runAsync('git', ['show', `${ref}:lock.md`], cwd, { env });
|
|
282
|
+
if (show.status !== 0) {
|
|
283
|
+
throw new Error(`git show ${ref}:lock.md failed (exit ${show.status}): ${show.stderr.trim()}`);
|
|
284
|
+
}
|
|
285
|
+
return show.stdout;
|
|
286
|
+
}
|
|
287
|
+
/** True iff `body` is the legacy `state: stuck` shape (the pre-retirement
|
|
288
|
+
* lock-entry blob). Matched on the raw frontmatter line so this is unaffected
|
|
289
|
+
* by the current parser's coercion to `active`. */
|
|
290
|
+
export function isLegacyStuckBlob(body) {
|
|
291
|
+
const normalized = body.replace(/\r\n/g, '\n');
|
|
292
|
+
const fm = /^---\n([\s\S]*?)\n---/.exec(normalized);
|
|
293
|
+
if (!fm) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
return /^state:\s*stuck\s*$/m.test(fm[1]);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Extract the bounce reason from a legacy stuck lock blob. Preference order
|
|
300
|
+
* (the two shapes the retired serialiser produced):
|
|
301
|
+
* 1. A `## Reason` block in the body (multi-line, blank-trimmed).
|
|
302
|
+
* 2. A one-line `reason:` field in the frontmatter (pre-cutover shape).
|
|
303
|
+
* Returns `undefined` when neither is present.
|
|
304
|
+
*/
|
|
305
|
+
export function extractLegacyReason(body) {
|
|
306
|
+
const normalized = body.replace(/\r\n/g, '\n');
|
|
307
|
+
const fm = /^---\n([\s\S]*?)\n---/.exec(normalized);
|
|
308
|
+
const bodyText = fm ? normalized.slice(fm[0].length) : normalized;
|
|
309
|
+
const lines = bodyText.split('\n');
|
|
310
|
+
const start = lines.findIndex((l) => l.trim() === '## Reason');
|
|
311
|
+
if (start !== -1) {
|
|
312
|
+
const collected = [];
|
|
313
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
314
|
+
if (/^##\s/.test(lines[i])) {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
collected.push(lines[i]);
|
|
318
|
+
}
|
|
319
|
+
const text = collected.join('\n').replace(/^\n+/, '').replace(/\n+$/, '');
|
|
320
|
+
if (text !== '') {
|
|
321
|
+
return text;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (fm) {
|
|
325
|
+
const m = /^reason:\s*(.*)$/m.exec(fm[1]);
|
|
326
|
+
if (m && m[1].trim() !== '') {
|
|
327
|
+
return m[1].trim();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
/** Extract the `## Questions` bulleted list from a legacy stuck lock blob (or
|
|
333
|
+
* `[]` when absent). Each bullet becomes one question string. */
|
|
334
|
+
export function extractLegacyQuestions(body) {
|
|
335
|
+
const normalized = body.replace(/\r\n/g, '\n');
|
|
336
|
+
const fm = /^---\n[\s\S]*?\n---/.exec(normalized);
|
|
337
|
+
const bodyText = fm ? normalized.slice(fm[0].length) : normalized;
|
|
338
|
+
const lines = bodyText.split('\n');
|
|
339
|
+
const start = lines.findIndex((l) => l.trim() === '## Questions');
|
|
340
|
+
if (start === -1) {
|
|
341
|
+
return [];
|
|
342
|
+
}
|
|
343
|
+
const questions = [];
|
|
344
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
345
|
+
if (/^##\s/.test(lines[i])) {
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
const m = /^-\s+(.*)$/.exec(lines[i].trim());
|
|
349
|
+
if (m) {
|
|
350
|
+
questions.push(m[1]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return questions;
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=migrate-stuck-locks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-stuck-locks.js","sourceRoot":"","sources":["../src/migrate-stuck-locks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAC,QAAQ,EAAiB,MAAM,UAAU,CAAC;AAClD,OAAO,EACN,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,GAE5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,sBAAsB,EAAC,MAAM,cAAc,CAAC;AAwDpD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,OAAiC;IAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC5C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAExC,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,iBAAiB,GAAG,CAA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