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
package/dist/item-lock.d.ts
CHANGED
|
@@ -64,26 +64,40 @@ export declare const LOCK_REF_PREFIX = "refs/dorfl/lock";
|
|
|
64
64
|
export declare function lockEntryFor(item: string): string;
|
|
65
65
|
/** The lock ref for a type-encoded `<entry>` (`<type>-<slug>`). */
|
|
66
66
|
export declare function itemLockRef(entry: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* The character class a LITERAL lock-entry name must match to be addressable
|
|
69
|
+
* through `release-lock --entry <literal>` (task
|
|
70
|
+
* `release-lock-entry-escape-hatch-and-literal-entry-reporting`): a NON-EMPTY run
|
|
71
|
+
* of `[A-Za-z0-9._-]` — the SAME shape the minting side produces (`<type>-<slug>`,
|
|
72
|
+
* and the pre-cutover `slice-<slug>` / `prd-<slug>` entries it must be able to
|
|
73
|
+
* name). It deliberately EXCLUDES `/` and whitespace so a literal can never escape
|
|
74
|
+
* the `refs/dorfl/lock/` namespace (a `/` would address a different ref path; a
|
|
75
|
+
* space would break the push refspec). This is the ONLY validation the `--entry`
|
|
76
|
+
* escape hatch performs before the git operation — the entry name is taken
|
|
77
|
+
* literally otherwise, bypassing the namespace mapping the item-form path uses.
|
|
78
|
+
*/
|
|
79
|
+
export declare function isValidLockEntryName(entry: string): boolean;
|
|
67
80
|
/** WHAT holds the lock — the three mutually-exclusive actions over one item. */
|
|
68
81
|
export type LockAction = 'implement' | 'task' | 'advance';
|
|
69
|
-
/** Health of the hold: `active` (in-progress) or `stuck` (needs-attention). */
|
|
70
|
-
export type LockState = 'active' | 'stuck';
|
|
71
82
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* single
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* `
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* Health of the hold. Post-CONTRACT step (task `retire-stuck-lock-state`, spec
|
|
84
|
+
* `surface-stuck-as-questions-and-retire-stuck-lock-state`) this collapses to a
|
|
85
|
+
* single value: `active` = the in-flight hold. The formerly-second value
|
|
86
|
+
* `stuck` (needs-attention) is RETIRED — a bounce now SURFACES a question
|
|
87
|
+
* sidecar + `needsAnswers:true` on `<arbiter>/main` and RELEASES the lock, so a
|
|
88
|
+
* parked item is a `needsAnswers:true` pool item on `main`, NEVER a `stuck`
|
|
89
|
+
* lock. The `state` field is kept (single-value) so serialised entries continue
|
|
90
|
+
* to round-trip and downstream readers still see a stable shape. The `reason`
|
|
91
|
+
* and `questions` fields that USED to ride on a `stuck` entry are gone — that
|
|
92
|
+
* prose lives on the surfaced sidecar on `main`, not on the lock entry.
|
|
93
|
+
*/
|
|
94
|
+
export type LockState = 'active';
|
|
95
|
+
/**
|
|
96
|
+
* The lock entry: `action` × `state` (the state axis is now degenerate — see
|
|
97
|
+
* {@link LockState}) plus the holder/since stamps. Post-CONTRACT step (task
|
|
98
|
+
* `retire-stuck-lock-state`) it carries NO `reason`/`questions` — the sole
|
|
99
|
+
* parked-item mechanism is the surfaced `needsAnswers:true` sidecar on
|
|
100
|
+
* `<arbiter>/main`.
|
|
87
101
|
*/
|
|
88
102
|
export interface LockEntry {
|
|
89
103
|
entry: string;
|
|
@@ -91,8 +105,6 @@ export interface LockEntry {
|
|
|
91
105
|
state: LockState;
|
|
92
106
|
holder: string;
|
|
93
107
|
since: string;
|
|
94
|
-
reason?: string;
|
|
95
|
-
questions?: string[];
|
|
96
108
|
}
|
|
97
109
|
/** Outcome of an acquire attempt. `acquired` = we hold it; `lost` = someone else
|
|
98
110
|
* does (a genuine same-item conflict). `error` = environment/usage. */
|
|
@@ -113,21 +125,20 @@ export interface ReleaseResult {
|
|
|
113
125
|
message: string;
|
|
114
126
|
}
|
|
115
127
|
/**
|
|
116
|
-
* Outcome of an AMEND-style transition (
|
|
117
|
-
* lock-entry STATE MACHINE's interior moves (
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* - `transitioned` — we won the CAS; the entry now
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* - `error` — environment/usage (missing item, missing reason for mark-stuck, …).
|
|
128
|
+
* Outcome of an AMEND-style transition (resume-crash-orphan / requeue) — the
|
|
129
|
+
* lock-entry STATE MACHINE's interior moves. Post-CONTRACT step (task
|
|
130
|
+
* `retire-stuck-lock-state`) the `mark-stuck` transition + the `wrong-state`
|
|
131
|
+
* verdict are retired with the `stuck` state itself.
|
|
132
|
+
* - `transitioned` — we won the CAS; the entry is now at the target state
|
|
133
|
+
* (or removed, for requeue).
|
|
134
|
+
* - `not-held` — there is no entry to transition (the move's precondition
|
|
135
|
+
* is a held entry; absent ⇒ illegal here).
|
|
136
|
+
* - `lost` — the leased CAS was rejected because a CONCURRENT writer
|
|
137
|
+
* changed the ref between our read and our push (a genuine
|
|
138
|
+
* same-item race).
|
|
139
|
+
* - `error` — environment/usage (missing item, …).
|
|
129
140
|
*/
|
|
130
|
-
export type TransitionOutcome = 'transitioned' | 'not-held' | '
|
|
141
|
+
export type TransitionOutcome = 'transitioned' | 'not-held' | 'lost' | 'error';
|
|
131
142
|
export interface TransitionResult {
|
|
132
143
|
outcome: TransitionOutcome;
|
|
133
144
|
/** The type-encoded lock entry (`<type>-<slug>`) the transition keyed onto. */
|
|
@@ -139,13 +150,11 @@ export interface TransitionResult {
|
|
|
139
150
|
}
|
|
140
151
|
/**
|
|
141
152
|
* Serialise a lock entry to the ref's blob body (markdown frontmatter, like the
|
|
142
|
-
* advancing marker, so it round-trips and is previewable).
|
|
143
|
-
* (`
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* future advance-surface rung can render. {@link parseLockEntry} is the exact
|
|
148
|
-
* inverse.
|
|
153
|
+
* advancing marker, so it round-trips and is previewable). Post-CONTRACT step
|
|
154
|
+
* (task `retire-stuck-lock-state`) the body carries ONLY the identity block —
|
|
155
|
+
* no `## Reason` / `## Questions` sections, because the retired `stuck` state
|
|
156
|
+
* was the only state that populated them. {@link parseLockEntry} is the inverse
|
|
157
|
+
* and tolerates a legacy body with those headings by ignoring them.
|
|
149
158
|
*/
|
|
150
159
|
export declare function serialiseLockEntry(e: LockEntry): string;
|
|
151
160
|
export interface AcquireOptions {
|
|
@@ -184,6 +193,40 @@ export interface ReleaseOptions {
|
|
|
184
193
|
* becomes unreachable for gc. Idempotent: deleting an absent ref is `not-held`.
|
|
185
194
|
*/
|
|
186
195
|
export declare function releaseItemLock(opts: ReleaseOptions): Promise<ReleaseResult>;
|
|
196
|
+
export interface ReleaseLiteralOptions {
|
|
197
|
+
/**
|
|
198
|
+
* The LITERAL lock-entry name (`<type>-<slug>`, or a pre-cutover
|
|
199
|
+
* `slice-<slug>` / `prd-<slug>`) to release VERBATIM — taken as-is, bypassing
|
|
200
|
+
* the namespace mapping {@link lockEntryFor} applies. MUST pass
|
|
201
|
+
* {@link isValidLockEntryName}.
|
|
202
|
+
*/
|
|
203
|
+
entry: string;
|
|
204
|
+
cwd: string;
|
|
205
|
+
arbiter?: string;
|
|
206
|
+
env?: NodeJS.ProcessEnv;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The `release-lock --entry <literal>` ESCAPE HATCH (task
|
|
210
|
+
* `release-lock-entry-escape-hatch-and-literal-entry-reporting`): release a lock
|
|
211
|
+
* whose `<entry>` name is NOT derivable from any CURRENT item-form — a lock minted
|
|
212
|
+
* BEFORE the slice→task / `prd-to-spec` vocabulary cutover (`slice-<slug>`,
|
|
213
|
+
* `prd-<slug>`), which the item-form path can no longer name because there is no
|
|
214
|
+
* item-form that produces those entries anymore.
|
|
215
|
+
*
|
|
216
|
+
* It takes the `<entry>` LITERALLY (bypassing {@link lockEntryFor} /
|
|
217
|
+
* {@link resolveSidecarIdentity}, the namespace mapping the item-form path uses)
|
|
218
|
+
* and targets `refs/dorfl/lock/<entry>` directly, then reuses the SAME entry-keyed
|
|
219
|
+
* leased-delete core {@link releaseItemLock} uses ({@link releaseLockEntry}) — the
|
|
220
|
+
* SAME lock-lease acquisition, push, absent-is-success no-op, exit codes, and
|
|
221
|
+
* mirror handling. There is NO second delete path.
|
|
222
|
+
*
|
|
223
|
+
* The trust model is UNCHANGED: a human still asserts the lock is dead by NAMING
|
|
224
|
+
* it; the only thing `--entry` drops is the assumption that the entry name is
|
|
225
|
+
* derivable from a current item-form. Rejects (`error`) an `<entry>` that fails
|
|
226
|
+
* {@link isValidLockEntryName} BEFORE any git operation, so a literal can never
|
|
227
|
+
* escape the `refs/dorfl/lock/` namespace.
|
|
228
|
+
*/
|
|
229
|
+
export declare function releaseLiteralLockEntry(opts: ReleaseLiteralOptions): Promise<ReleaseResult>;
|
|
187
230
|
/** Outcome of a GUARDED release ({@link releaseHeldItemLock}): the caller HELD the
|
|
188
231
|
* lock, so an absent ref is NOT benign — it is `vanished` (the ref was deleted
|
|
189
232
|
* under us, an abort signal). */
|
|
@@ -219,34 +262,25 @@ export declare function releaseHeldItemLock(opts: ReleaseOptions): Promise<Relea
|
|
|
219
262
|
* ref was removed), `lost` (a concurrent change moved the ref between the read and
|
|
220
263
|
* the delete — the lease was REJECTED, never `--force`d), or `error`. */
|
|
221
264
|
export type LeasedDeleteOutcome = 'deleted' | 'lost' | 'error';
|
|
265
|
+
/**
|
|
266
|
+
* COMPATIBILITY SHIM (post `retire-stuck-lock-state`): the `stuck` lock STATE
|
|
267
|
+
* is retired — there is no `active → stuck` amend to perform any more, and no
|
|
268
|
+
* live path calls this. It is kept exported as a NO-OP that returns success
|
|
269
|
+
* (`transitioned` when a held entry is present, `not-held` otherwise) so
|
|
270
|
+
* downstream test suites that USED to seed a "stuck" scenario via this
|
|
271
|
+
* primitive continue to build. A shim'd `stuck` lock does NOT actually flip
|
|
272
|
+
* state; the lock stays `active` (which is the only admitted state) and any
|
|
273
|
+
* assertion that keys off `state === 'stuck'` is now vacuously false — the
|
|
274
|
+
* point of the migration.
|
|
275
|
+
*/
|
|
222
276
|
export interface MarkStuckOptions {
|
|
223
|
-
/** The NAMESPACED item identity (same forms as {@link AcquireOptions.item}). */
|
|
224
277
|
item: string;
|
|
225
|
-
|
|
226
|
-
reason: string;
|
|
227
|
-
/**
|
|
228
|
-
* Any agent-surfaced QUESTIONS for the human, recorded on the stuck entry's
|
|
229
|
-
* body (the lock is the SOLE stuck record now). Optional; empty/absent ⇒ no
|
|
230
|
-
* questions block. A future advance-surface rung renders these into a
|
|
231
|
-
* `work/questions/` sidecar.
|
|
232
|
-
*/
|
|
278
|
+
reason?: string;
|
|
233
279
|
questions?: string[];
|
|
234
280
|
cwd: string;
|
|
235
281
|
arbiter?: string;
|
|
236
282
|
env?: NodeJS.ProcessEnv;
|
|
237
283
|
}
|
|
238
|
-
/**
|
|
239
|
-
* mark-stuck (transition 2): `[action, active] -> [action, stuck] + reason`. The
|
|
240
|
-
* runner bounces (red gate, agent failure, decomposition-unclear). A leased CAS
|
|
241
|
-
* amend of the SAME entry's `state` + `reason`, keeping `action`/`holder`/`since`.
|
|
242
|
-
* It is the source of the needs-attention SURFACE (now read from the lock ref,
|
|
243
|
-
* not a `work/needs-attention/` folder).
|
|
244
|
-
*
|
|
245
|
-
* PRECONDITIONS (the state machine + invariants):
|
|
246
|
-
* - the entry must be HELD and `active` (`not-held` / `wrong-state` otherwise) —
|
|
247
|
-
* stuck is reachable only FROM active, never from absent or already-stuck.
|
|
248
|
-
* - `reason` must be non-empty (the `reason` PRESENT iff `state: stuck` invariant).
|
|
249
|
-
*/
|
|
250
284
|
export declare function markStuckItemLock(opts: MarkStuckOptions): Promise<TransitionResult>;
|
|
251
285
|
export interface ResumeOptions {
|
|
252
286
|
/** The NAMESPACED item identity (same forms as {@link AcquireOptions.item}). */
|
|
@@ -258,26 +292,29 @@ export interface ResumeOptions {
|
|
|
258
292
|
env?: NodeJS.ProcessEnv;
|
|
259
293
|
}
|
|
260
294
|
/**
|
|
261
|
-
* resume (
|
|
262
|
-
* `
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
* lock
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
295
|
+
* resume (crash-orphan recovery only, post `retire-stuck-lock-state`): with the
|
|
296
|
+
* `stuck` lock state retired, the ONLY thing to "resume" is the crash-window
|
|
297
|
+
* orphan the ordered bounce transition (surface-FIRST-release-SECOND) leaves
|
|
298
|
+
* when the surface lands on `<arbiter>/main` but the release never runs. If the
|
|
299
|
+
* held lock is `active` AND the item is SURFACED on `<arbiter>/main`
|
|
300
|
+
* (`needsAnswers:true` + sidecar) AND not terminal, `main` is authoritative:
|
|
301
|
+
* clear the ref via the SHARED leased delete (never `--force`) so the lock
|
|
302
|
+
* converges rather than dangling forever. Every OTHER combination is a no-op
|
|
303
|
+
* from this verb's perspective: an in-flight active hold that is NOT surfaced
|
|
304
|
+
* is a healthy build (`wrong-state` — nothing to resume); no lock is
|
|
305
|
+
* `not-held`. There is no `stuck → active` transition anymore: a parked item
|
|
306
|
+
* is a `needsAnswers:true` pool item on `main`, drained by answering the
|
|
307
|
+
* sidecar (via the apply rung), not by "resuming" a lock.
|
|
269
308
|
*/
|
|
270
309
|
export declare function resumeItemLock(opts: ResumeOptions): Promise<TransitionResult>;
|
|
271
310
|
/**
|
|
272
|
-
* requeue
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* `active` entry — abandoning an in-flight active hold goes through `release`, not
|
|
280
|
-
* `requeue`. The removal itself is a leased delete (a concurrent change ⇒ `lost`).
|
|
311
|
+
* requeue: give up on a held lock and return the item to the pool by REMOVING
|
|
312
|
+
* the entry. Post-CONTRACT step (task `retire-stuck-lock-state`) there is NO
|
|
313
|
+
* `stuck` state to guard against — the held lock is always `active`, so
|
|
314
|
+
* requeue works on any held entry (a leased delete; a concurrent change ⇒
|
|
315
|
+
* `lost`). The body never moved (it rests in the pool on `main`), so requeue
|
|
316
|
+
* is purely "release the lock"; the kept `work/<slug>` branch remains for
|
|
317
|
+
* recovery.
|
|
281
318
|
*/
|
|
282
319
|
export declare function requeueItemLock(opts: ReleaseOptions): Promise<TransitionResult>;
|
|
283
320
|
/**
|
|
@@ -304,8 +341,13 @@ export declare function readItemLock(opts: ReleaseOptions): Promise<LockEntry |
|
|
|
304
341
|
export declare function terminalMainPaths(type: SidecarType, slug: string): string[];
|
|
305
342
|
/** The outcome of a cross-substrate reconciliation of one item's lock against
|
|
306
343
|
* the authoritative `main` durable record (spec `ledger-status-per-item-lock-refs`
|
|
307
|
-
* US #9/#10; ADR `ledger-status-on-per-item-lock-refs`).
|
|
308
|
-
|
|
344
|
+
* US #9/#10; ADR `ledger-status-on-per-item-lock-refs`). Post-CONTRACT step
|
|
345
|
+
* (task `retire-stuck-lock-state`) the two `stuck`-flavoured outcomes
|
|
346
|
+
* (`cleared-stuck-terminal`, `kept-stuck`) are gone with the state itself; a
|
|
347
|
+
* parked item is now a `needsAnswers:true` pool item on `main`, so the
|
|
348
|
+
* `cleared-stale` verdict now ALSO covers the crash-window orphan (active +
|
|
349
|
+
* surfaced-on-main). */
|
|
350
|
+
export type ReconcileOutcome = 'cleared-stale' | 'kept-in-flight' | 'no-lock' | 'error';
|
|
309
351
|
export interface ReconcileResult {
|
|
310
352
|
outcome: ReconcileOutcome;
|
|
311
353
|
/** The type-encoded lock entry (`<type>-<slug>`) reconciled. */
|
|
@@ -328,17 +370,23 @@ export interface ReconcileResult {
|
|
|
328
370
|
* per {@link terminalMainPaths}) with a STILL-HELD lock — a stale lock with no
|
|
329
371
|
* in-flight work behind it. This is the recovery that converges it.
|
|
330
372
|
*
|
|
331
|
-
* THE RECOVERY RULE (the `main` record is authoritative over
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* - `main` is TERMINAL + the held lock is `
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
373
|
+
* THE RECOVERY RULE (the `main` record is authoritative over an ORPHAN lock,
|
|
374
|
+
* broadened by task `reaper-reap-terminal-stuck-lock-orphans`; ADR
|
|
375
|
+
* `ledger-status-on-per-item-lock-refs` § Addendum 2026-07-10):
|
|
376
|
+
* - `main` is TERMINAL + the held lock is `active` → STRANDED (the crash was
|
|
377
|
+
* after the durable move, before the release) → CLEAR it (`cleared-stale`).
|
|
378
|
+
* - `main` is TERMINAL + the held lock is `stuck` → CRASH-ORPHAN (`done` +
|
|
379
|
+
* `stuck` LEGITIMATELY co-existed during a rebase-conflict bounce, US #10,
|
|
380
|
+
* but the item then reached its terminal folder by ANY path — human finish,
|
|
381
|
+
* re-drive, manual fixup+merge — leaving the stuck lock as an orphan the
|
|
382
|
+
* `main` record supersedes) → CLEAR it (`cleared-stuck-terminal`).
|
|
383
|
+
* - `main` is NOT terminal + the held lock is `stuck` → the GENUINE
|
|
384
|
+
* human-attention case (`kept-stuck`); NEVER auto-cleared here (a human
|
|
385
|
+
* resolves via `resume`/`requeue`/`release-lock`). This is the invariant
|
|
386
|
+
* the contract loosening MUST preserve.
|
|
387
|
+
* - `main` is NOT terminal + the held lock is `active` → the NORMAL in-flight
|
|
340
388
|
* state (`kept-in-flight`); the lock is doing its job, leave it.
|
|
341
|
-
* - no lock at all
|
|
389
|
+
* - no lock at all → `no-lock` (at rest).
|
|
342
390
|
*
|
|
343
391
|
* Best-effort + idempotent: it NEVER throws (a fetch/read fault degrades to
|
|
344
392
|
* `error`, leaving the lock untouched — the safe direction), and re-running it
|
|
@@ -388,27 +436,30 @@ export declare function reconcileItemLockAgainstMain(opts: ReleaseOptions): Prom
|
|
|
388
436
|
* `error`).
|
|
389
437
|
*/
|
|
390
438
|
export declare function classifyItemLockAgainstMain(opts: ReleaseOptions): Promise<ReconcileResult>;
|
|
391
|
-
/** One lingering lock in the `gc --ledger`
|
|
392
|
-
* the read-only cross-substrate {@link ReconcileOutcome} classification of
|
|
393
|
-
* against the authoritative `main` durable record
|
|
394
|
-
*
|
|
439
|
+
/** One lingering lock in the `gc --ledger` orphaned-lock REPORT: the held entry
|
|
440
|
+
* plus the read-only cross-substrate {@link ReconcileOutcome} classification of
|
|
441
|
+
* it against the authoritative `main` durable record. Reported, NEVER cleared
|
|
442
|
+
* by the report itself. */
|
|
395
443
|
export interface LockReportEntry {
|
|
396
|
-
/** The full held lock entry (action × state + holder/since
|
|
444
|
+
/** The full held lock entry (action × state + holder/since). */
|
|
397
445
|
lock: LockEntry;
|
|
398
446
|
/** The lock ref (`refs/dorfl/lock/<entry>`). */
|
|
399
447
|
ref: string;
|
|
400
448
|
/**
|
|
401
449
|
* The READ-ONLY {@link classifyItemLockAgainstMain} verdict:
|
|
402
|
-
* - `kept-in-flight` — a normal in-flight hold (not terminal on `main`).
|
|
403
|
-
* - `
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* auto-cleared by the report — no auto-sweep).
|
|
450
|
+
* - `kept-in-flight` — a normal in-flight hold (active, not terminal on `main`).
|
|
451
|
+
* - `cleared-stale` — the lock is reconcilable: terminal on `main` (stranded)
|
|
452
|
+
* OR non-terminal + SURFACED (`needsAnswers:true` + sidecar) = crash-window
|
|
453
|
+
* orphan; a reaper (or `release-lock`) clears it (NOT auto-cleared by the
|
|
454
|
+
* report — no auto-sweep here).
|
|
408
455
|
* - `error` — a per-item classification fault (kept verbatim).
|
|
409
456
|
*/
|
|
410
457
|
reconcile: ReconcileOutcome;
|
|
411
458
|
}
|
|
459
|
+
/** True iff a {@link ReconcileOutcome} names an ORPHAN class the
|
|
460
|
+
* `--reap-stale-locks` sweep can auto-clear via the shared leased delete.
|
|
461
|
+
* Post-`retire-stuck-lock-state` this is just `cleared-stale`. */
|
|
462
|
+
export declare function isReapableTerminalOrphan(outcome: ReconcileOutcome): boolean;
|
|
412
463
|
/** The `gc --ledger` stuck/orphaned-lock REPORT (spec
|
|
413
464
|
* `ledger-status-per-item-lock-refs` US #14): every lingering per-item lock on the
|
|
414
465
|
* arbiter, each classified read-only against `main`. An EMPTY list = no locks held
|
|
@@ -462,22 +513,19 @@ export declare function reportItemLocks(cwd: string, arbiter?: string, env?: Nod
|
|
|
462
513
|
*/
|
|
463
514
|
export declare function itemLockReportNeedsAttention(report: ItemLockReport): boolean;
|
|
464
515
|
export declare function formatItemLockReport(report: ItemLockReport): string[];
|
|
465
|
-
/** Per-lock outcome of the human-invoked {@link reapStaleItemLocks} SWEEP
|
|
466
|
-
*
|
|
467
|
-
*
|
|
516
|
+
/** Per-lock outcome of the human-invoked {@link reapStaleItemLocks} SWEEP.
|
|
517
|
+
* Post-`retire-stuck-lock-state` the `stuck`-flavoured verdicts
|
|
518
|
+
* (`reaped-stuck-terminal`, `kept-stuck`) are gone with the state itself.
|
|
519
|
+
* - `reaped` — a `cleared-stale` lock cleared via the SHARED leased delete.
|
|
468
520
|
* - `already-reaped` — BENIGN: the lock was already gone by the time the sweep
|
|
469
|
-
* re-read the ref (`no-lock`)
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
* in this task's done record).
|
|
474
|
-
* - `kept-stuck` — left untouched (terminal + stuck — human attention; US #10).
|
|
475
|
-
* - `kept-in-flight` — left untouched (active, non-terminal — a healthy build).
|
|
476
|
-
* - `lost` — a `cleared-stale` candidate whose leased delete was REJECTED
|
|
521
|
+
* re-read the ref (`no-lock`).
|
|
522
|
+
* - `kept-in-flight` — left untouched (active, non-terminal, not surfaced — a
|
|
523
|
+
* healthy build).
|
|
524
|
+
* - `lost` — a reapable-orphan candidate whose leased delete was REJECTED
|
|
477
525
|
* (the ref changed concurrently to a DIFFERENT value);
|
|
478
526
|
* REPORTED, never `--force`d.
|
|
479
527
|
* - `error` — a per-item classification/clear fault (left untouched). */
|
|
480
|
-
export type ReapOutcome = 'reaped' | 'already-reaped' | 'kept-
|
|
528
|
+
export type ReapOutcome = 'reaped' | 'already-reaped' | 'kept-in-flight' | 'lost' | 'error';
|
|
481
529
|
/** One lock's disposition in the {@link ReapReport}. */
|
|
482
530
|
export interface ReapEntry {
|
|
483
531
|
/** The full lock entry as the report saw it (action × state + holder/since). */
|
|
@@ -495,10 +543,10 @@ export interface ReapEntry {
|
|
|
495
543
|
* race); a `kept-in-flight` is the normal healthy state and does NOT. */
|
|
496
544
|
export interface ReapReport {
|
|
497
545
|
entries: ReapEntry[];
|
|
546
|
+
/** Count of `cleared-stale` locks reaped (terminal-on-main + active, OR
|
|
547
|
+
* non-terminal + surfaced = crash-window orphan). */
|
|
498
548
|
reaped: number;
|
|
499
|
-
/** BENIGN already-reaped count: the sweep found the ref already gone (`no-lock`)
|
|
500
|
-
* — another reaper / release-lock / requeue cleared it first. The desired end
|
|
501
|
-
* state; NOT `lost`, does NOT contribute to needs-attention / a non-zero exit. */
|
|
549
|
+
/** BENIGN already-reaped count: the sweep found the ref already gone (`no-lock`). */
|
|
502
550
|
alreadyReaped: number;
|
|
503
551
|
kept: number;
|
|
504
552
|
lost: number;
|
|
@@ -514,13 +562,19 @@ export interface ReapReport {
|
|
|
514
562
|
* {@link reconcileItemLockAgainstMain} (the recovery's clear, re-checked fresh per
|
|
515
563
|
* item) — there is NO parallel clear mechanism.
|
|
516
564
|
*
|
|
517
|
-
* SCOPE FENCE (the trust model the default preserves
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
565
|
+
* SCOPE FENCE (the trust model the default preserves; broadened by task
|
|
566
|
+
* `reaper-reap-terminal-stuck-lock-orphans`; ADR
|
|
567
|
+
* `ledger-status-on-per-item-lock-refs` § Addendum 2026-07-10):
|
|
568
|
+
* - it clears the TWO terminal-on-`main` ORPHAN classes ONLY: `cleared-stale`
|
|
569
|
+
* (terminal + `active` = stranded between move and release) AND
|
|
570
|
+
* `cleared-stuck-terminal` (terminal + `stuck` = crash-orphan the auto-reaper
|
|
571
|
+
* used to leave forever). A `kept-stuck` (STUCK + NON-terminal — the
|
|
572
|
+
* genuine human-attention case) and a `kept-in-flight` (`active` +
|
|
573
|
+
* non-terminal — a healthy build) are NEVER reaped, even here. Because each
|
|
574
|
+
* clear goes through {@link reconcileItemLockAgainstMain}, which RE-reads +
|
|
575
|
+
* RE-classifies before deleting, a lock whose item was un-completed on
|
|
576
|
+
* `main` between the report and the sweep is still safe (reconcile returns
|
|
577
|
+
* `kept-*`, not a delete).
|
|
524
578
|
* - the clear is a LEASED delete: a concurrent change to the ref makes it REJECT
|
|
525
579
|
* (`lost`), reported — never a blind `--force`.
|
|
526
580
|
*
|
|
@@ -555,6 +609,17 @@ export declare function formatReapReport(report: ReapReport): string[];
|
|
|
555
609
|
* {@link lockEntryFor} for the three known namespaces.
|
|
556
610
|
*/
|
|
557
611
|
export declare function itemFromLockEntry(entry: string): string;
|
|
612
|
+
/**
|
|
613
|
+
* Does `<entry>` reverse-derive to a CURRENT item-form (`<type>:<slug>`), i.e.
|
|
614
|
+
* does it carry a known post-cutover type prefix (`task-`/`spec-`/`observation-`)?
|
|
615
|
+
* FALSE for a pre-cutover `slice-<slug>` / `prd-<slug>` entry (task
|
|
616
|
+
* `release-lock-entry-escape-hatch-and-literal-entry-reporting`): such an entry is
|
|
617
|
+
* UN-NAMEABLE through the item-form `release-lock <item>` path and must be cleared
|
|
618
|
+
* via the `release-lock --entry <literal>` escape hatch instead. This is the
|
|
619
|
+
* predicate the `gc --ledger` report keys off to decide whether to print the
|
|
620
|
+
* copy-pasteable item-form hint or the literal-`--entry` hint.
|
|
621
|
+
*/
|
|
622
|
+
export declare function hasCurrentItemForm(entry: string): boolean;
|
|
558
623
|
/** List the entries (`<type>-<slug>`) currently locked on the arbiter (the
|
|
559
624
|
* stuck-lock report / `status` read path). */
|
|
560
625
|
export declare function listItemLocks(cwd: string, arbiter?: string, env?: NodeJS.ProcessEnv): Promise<string[]>;
|
|
@@ -574,7 +639,7 @@ export declare function listItemLockEntries(cwd: string, arbiter?: string, env?:
|
|
|
574
639
|
* List the TASK slugs currently lock-held on the arbiter — the held-slug set the
|
|
575
640
|
* `ready/` pool readers SUBTRACT (spec `ledger-status-per-item-lock-refs` US #15;
|
|
576
641
|
* task `claim-acquires-unified-lock-no-body-move`). Enumerates {@link listItemLocks}
|
|
577
|
-
* and keeps only the `task-<slug>` entries (a
|
|
642
|
+
* and keeps only the `task-<slug>` entries (a spec/observation lock does not gate
|
|
578
643
|
* the TASK pool), mapping each to its bare `<slug>`.
|
|
579
644
|
*
|
|
580
645
|
* LOAD-BEARING since the lock cut-over: the claim NO LONGER moves the body to
|
|
@@ -609,11 +674,13 @@ export declare function heldTaskSlugs(cwd: string, arbiter?: string, env?: NodeJ
|
|
|
609
674
|
export declare function heldTaskSlugsStrict(cwd: string, arbiter?: string, env?: NodeJS.ProcessEnv): Promise<Set<string>>;
|
|
610
675
|
/**
|
|
611
676
|
* Parse a serialised lock entry body back into a {@link LockEntry} — the exact
|
|
612
|
-
* inverse of {@link serialiseLockEntry}.
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
677
|
+
* inverse of {@link serialiseLockEntry}. Post-`retire-stuck-lock-state` a lock
|
|
678
|
+
* entry whose serialised state is not the single admitted `'active'` value
|
|
679
|
+
* (e.g. a legacy `state: stuck` blob written by an older binary before the
|
|
680
|
+
* one-shot migration ran) is COERCED to `'active'` on read — the state is
|
|
681
|
+
* degenerate, and a lingering stuck ref is left for the migration/recovery
|
|
682
|
+
* verbs to clear via `main`-authoritative reconciliation rather than surfaced
|
|
683
|
+
* as a second live state.
|
|
617
684
|
*/
|
|
618
685
|
export declare function parseLockEntry(body: string): LockEntry | undefined;
|
|
619
686
|
/**
|
package/dist/item-lock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-lock.d.ts","sourceRoot":"","sources":["../src/item-lock.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"item-lock.d.ts","sourceRoot":"","sources":["../src/item-lock.ts"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,WAAW,EAChB,MAAM,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH;;;yBAGyB;AACzB,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EA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