dorfl 0.1.0 → 0.1.2
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-ci-template.d.ts +3 -3
- package/dist/advance-ci-template.js +1 -1
- package/dist/advance-ci-template.js.map +1 -1
- package/dist/advance-classify.d.ts +5 -5
- package/dist/advance-classify.d.ts.map +1 -1
- package/dist/advance-classify.js +4 -4
- package/dist/advance-drivers.d.ts +7 -7
- package/dist/advance-drivers.d.ts.map +1 -1
- package/dist/advance-drivers.js +5 -5
- package/dist/advance-drivers.js.map +1 -1
- package/dist/advance-isolated.d.ts +3 -3
- package/dist/advance-isolated.d.ts.map +1 -1
- package/dist/advance-isolated.js +1 -1
- package/dist/advance-lifecycle-template.d.ts +2 -2
- package/dist/advance-lifecycle-template.js +9 -9
- package/dist/advance-lifecycle-template.js.map +1 -1
- package/dist/advance-loop-driver.d.ts +3 -3
- package/dist/advance-loop-driver.d.ts.map +1 -1
- package/dist/advance-loop-driver.js +1 -1
- package/dist/advance-treeless-publish.d.ts +1 -1
- package/dist/advance.d.ts +11 -11
- package/dist/advance.d.ts.map +1 -1
- package/dist/advance.js +21 -21
- package/dist/advance.js.map +1 -1
- package/dist/advancing-lock.d.ts +1 -1
- package/dist/advancing-lock.js +5 -5
- package/dist/apply-decide.d.ts +2 -2
- package/dist/apply-decide.js +2 -2
- package/dist/apply-merge-action.d.ts +4 -4
- package/dist/apply-merge-action.js +2 -2
- package/dist/apply-persist.d.ts +5 -5
- package/dist/apply-persist.d.ts.map +1 -1
- package/dist/apply-persist.js +7 -7
- package/dist/apply-persist.js.map +1 -1
- package/dist/buildable-body.d.ts +14 -14
- package/dist/buildable-body.js +9 -9
- package/dist/claim-cas.d.ts +3 -3
- package/dist/claim-cas.js +1 -1
- package/dist/claim-cas.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +83 -77
- package/dist/cli.js.map +1 -1
- package/dist/close-job-template.d.ts +3 -3
- package/dist/close-job-template.js +8 -8
- package/dist/close-job.d.ts +8 -8
- package/dist/close-job.js +25 -25
- package/dist/close-job.js.map +1 -1
- package/dist/complete.d.ts +3 -3
- package/dist/complete.js +8 -8
- package/dist/complete.js.map +1 -1
- package/dist/concurrency.d.ts +1 -1
- package/dist/concurrency.js +1 -1
- package/dist/config.d.ts +32 -32
- package/dist/config.js +5 -5
- package/dist/config.js.map +1 -1
- package/dist/continue-branch.d.ts +1 -1
- package/dist/continue-branch.js +1 -1
- package/dist/cwd-section.js +1 -1
- package/dist/cwd-section.js.map +1 -1
- package/dist/decision-engine.d.ts +2 -2
- package/dist/do-autopick.d.ts +6 -6
- package/dist/do-autopick.d.ts.map +1 -1
- package/dist/do-autopick.js +5 -5
- package/dist/do-autopick.js.map +1 -1
- package/dist/do-config.d.ts +3 -3
- package/dist/do-config.js +3 -3
- package/dist/do-config.js.map +1 -1
- package/dist/do-remote-auto.d.ts +2 -2
- package/dist/do-remote-auto.js +1 -1
- package/dist/do.d.ts +25 -25
- package/dist/do.d.ts.map +1 -1
- package/dist/do.js +22 -22
- package/dist/do.js.map +1 -1
- package/dist/drop-source.d.ts +2 -2
- package/dist/env-config.js +8 -8
- package/dist/env-config.js.map +1 -1
- package/dist/format.js +3 -3
- package/dist/format.js.map +1 -1
- package/dist/frontmatter.d.ts +33 -39
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +18 -31
- package/dist/frontmatter.js.map +1 -1
- package/dist/install-ci-branch-protection.d.ts +1 -1
- package/dist/install-ci-branch-protection.js +1 -1
- package/dist/install-ci-capabilities/advance-lifecycle.d.ts +1 -1
- package/dist/install-ci-capabilities/advance-lifecycle.js +1 -1
- package/dist/install-ci-capabilities/close-job.d.ts +1 -1
- package/dist/install-ci-capabilities/close-job.js +1 -1
- package/dist/install-ci-capabilities/example-noop.d.ts +1 -1
- package/dist/install-ci-capabilities/example-noop.js +1 -1
- package/dist/install-ci-capabilities/intake.d.ts +2 -2
- package/dist/install-ci-capabilities/intake.js +2 -2
- package/dist/install-ci-capabilities/verify.d.ts +1 -1
- package/dist/install-ci-capabilities/verify.js +1 -1
- package/dist/install-ci-core.d.ts +3 -3
- package/dist/install-ci-core.js +2 -2
- package/dist/install-ci-core.js.map +1 -1
- package/dist/install-ci-github.d.ts +1 -1
- package/dist/install-ci-github.js +1 -1
- package/dist/install-ci.d.ts +1 -1
- package/dist/install-ci.js +4 -4
- package/dist/install-ci.js.map +1 -1
- package/dist/intake-event.d.ts +6 -6
- package/dist/intake-event.js +6 -6
- package/dist/intake-marker.d.ts +3 -3
- package/dist/intake-marker.d.ts.map +1 -1
- package/dist/intake-triage.d.ts +1 -1
- package/dist/intake-triage.js +2 -2
- package/dist/intake-trigger-template.d.ts +8 -8
- package/dist/intake-trigger-template.d.ts.map +1 -1
- package/dist/intake-trigger-template.js +16 -16
- package/dist/intake-trigger-template.js.map +1 -1
- package/dist/intake.d.ts +50 -50
- package/dist/intake.d.ts.map +1 -1
- package/dist/intake.js +70 -70
- package/dist/intake.js.map +1 -1
- package/dist/integration-core.d.ts +17 -17
- package/dist/integration-core.js +17 -17
- package/dist/integration-core.js.map +1 -1
- package/dist/isolation.d.ts +3 -3
- package/dist/issue-provider.d.ts +4 -4
- package/dist/issue-provider.js +1 -1
- package/dist/item-lock.d.ts +21 -21
- package/dist/item-lock.d.ts.map +1 -1
- package/dist/item-lock.js +16 -16
- package/dist/item-path.d.ts +2 -2
- package/dist/item-path.js +2 -2
- package/dist/ledger-lint.d.ts +9 -9
- package/dist/ledger-lint.js +9 -9
- package/dist/ledger-read.d.ts +57 -57
- package/dist/ledger-read.d.ts.map +1 -1
- package/dist/ledger-read.js +24 -24
- package/dist/ledger-read.js.map +1 -1
- package/dist/ledger-write.d.ts +2 -2
- package/dist/ledger-write.js +1 -1
- package/dist/lifecycle-gather.d.ts +1 -1
- package/dist/lifecycle-gather.js +16 -16
- package/dist/lifecycle-gather.js.map +1 -1
- package/dist/lifecycle-pools.d.ts +4 -4
- package/dist/lifecycle-pools.js +1 -1
- package/dist/merge-question-surfacer.d.ts +3 -3
- package/dist/merge-question-surfacer.js +2 -2
- package/dist/merge-question-surfacer.js.map +1 -1
- package/dist/mint-adr.js +4 -4
- package/dist/mirror-pool-scan.d.ts +2 -2
- package/dist/mirror-pool-scan.js +3 -3
- package/dist/mirror-pool-scan.js.map +1 -1
- package/dist/needs-attention.d.ts +13 -13
- package/dist/needs-attention.d.ts.map +1 -1
- package/dist/needs-attention.js +11 -11
- package/dist/needs-attention.js.map +1 -1
- package/dist/orphan-sidecar.d.ts +2 -2
- package/dist/placement.d.ts +6 -6
- package/dist/placement.js +2 -2
- package/dist/prd-to-spec.d.ts +15 -1
- package/dist/prd-to-spec.d.ts.map +1 -1
- package/dist/prd-to-spec.js +36 -14
- package/dist/prd-to-spec.js.map +1 -1
- package/dist/prompt.d.ts +24 -24
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +29 -31
- package/dist/prompt.js.map +1 -1
- package/dist/protocol/CLAIM-PROTOCOL.md +4 -4
- package/dist/protocol/REVIEW-PROTOCOL.md +1 -1
- package/dist/protocol/TASKING-PROTOCOL.md +12 -12
- package/dist/protocol/WORK-CONTRACT.md +39 -39
- package/dist/protocol/spec-template.md +1 -1
- package/dist/protocol/task-template.md +3 -3
- package/dist/readiness.d.ts +1 -1
- package/dist/recover-isolated.js +1 -1
- package/dist/repo-config.js +12 -12
- package/dist/repo-config.js.map +1 -1
- package/dist/review-gate.d.ts +3 -3
- package/dist/review-gate.d.ts.map +1 -1
- package/dist/review-gate.js +11 -10
- package/dist/review-gate.js.map +1 -1
- package/dist/review-verdict.d.ts +2 -2
- package/dist/review-verdict.d.ts.map +1 -1
- package/dist/review-verdict.js +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/run.js +5 -5
- package/dist/run.js.map +1 -1
- package/dist/scan.d.ts +10 -10
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +8 -8
- package/dist/scan.js.map +1 -1
- package/dist/select-order.d.ts +1 -1
- package/dist/select-priority.d.ts +12 -12
- package/dist/select-priority.d.ts.map +1 -1
- package/dist/select-priority.js +5 -5
- package/dist/select-priority.js.map +1 -1
- package/dist/sidecar.d.ts +2 -2
- package/dist/sidecar.js +2 -2
- package/dist/sidecar.js.map +1 -1
- package/dist/slug-namespace.d.ts +1 -1
- package/dist/slug-namespace.js +3 -3
- package/dist/slug-namespace.js.map +1 -1
- package/dist/spec-complete.js +2 -2
- package/dist/spec-complete.js.map +1 -1
- package/dist/start.d.ts +1 -1
- package/dist/start.js +3 -3
- package/dist/start.js.map +1 -1
- package/dist/status.d.ts +3 -3
- package/dist/status.js +4 -4
- package/dist/status.js.map +1 -1
- package/dist/surface-gate.d.ts +2 -2
- package/dist/surface-gate.d.ts.map +1 -1
- package/dist/surface-persist.d.ts +2 -2
- package/dist/surface-persist.d.ts.map +1 -1
- package/dist/tasker-review-loop.d.ts +8 -8
- package/dist/tasker-review-loop.d.ts.map +1 -1
- package/dist/tasker-review-loop.js +8 -8
- package/dist/tasker-review-loop.js.map +1 -1
- package/dist/tasking-eligibility.d.ts +21 -21
- package/dist/tasking-eligibility.d.ts.map +1 -1
- package/dist/tasking-eligibility.js +10 -10
- package/dist/tasking-lock.d.ts +8 -8
- package/dist/tasking-lock.d.ts.map +1 -1
- package/dist/tasking-lock.js +20 -21
- package/dist/tasking-lock.js.map +1 -1
- package/dist/tasking.d.ts +33 -33
- package/dist/tasking.d.ts.map +1 -1
- package/dist/tasking.js +89 -88
- package/dist/tasking.js.map +1 -1
- package/dist/triage-gate.d.ts +1 -1
- package/dist/triage-persist.d.ts +5 -5
- package/dist/triage-persist.js +15 -15
- package/dist/triage-persist.js.map +1 -1
- package/dist/verify-workflow-template.d.ts +1 -1
- package/dist/verify-workflow-template.js +2 -2
- package/dist/work-layout.d.ts +9 -7
- package/dist/work-layout.d.ts.map +1 -1
- package/dist/work-layout.js +9 -7
- package/dist/work-layout.js.map +1 -1
- package/dist/workspace.d.ts +1 -1
- package/package.json +1 -1
- package/src/advance-ci-template.ts +4 -4
- package/src/advance-classify.ts +5 -5
- package/src/advance-drivers.ts +10 -10
- package/src/advance-isolated.ts +3 -3
- package/src/advance-lifecycle-template.ts +9 -9
- package/src/advance-loop-driver.ts +3 -3
- package/src/advance-treeless-publish.ts +1 -1
- package/src/advance.ts +30 -30
- package/src/advancing-lock.ts +6 -6
- package/src/apply-decide.ts +2 -2
- package/src/apply-merge-action.ts +5 -5
- package/src/apply-persist.ts +8 -8
- package/src/buildable-body.ts +14 -14
- package/src/claim-cas.ts +4 -4
- package/src/cli.ts +94 -84
- package/src/close-job-template.ts +8 -8
- package/src/close-job.ts +26 -26
- package/src/complete.ts +11 -11
- package/src/concurrency.ts +1 -1
- package/src/config.ts +37 -37
- package/src/continue-branch.ts +1 -1
- package/src/cwd-section.ts +1 -1
- package/src/decision-engine.ts +3 -3
- package/src/do-autopick.ts +9 -9
- package/src/do-config.ts +6 -6
- package/src/do-remote-auto.ts +2 -2
- package/src/do.ts +49 -49
- package/src/drop-source.ts +2 -2
- package/src/env-config.ts +8 -8
- package/src/format.ts +3 -3
- package/src/frontmatter.ts +42 -60
- package/src/install-ci-branch-protection.ts +1 -1
- package/src/install-ci-capabilities/advance-lifecycle.ts +1 -1
- package/src/install-ci-capabilities/close-job.ts +1 -1
- package/src/install-ci-capabilities/example-noop.ts +1 -1
- package/src/install-ci-capabilities/intake.ts +2 -2
- package/src/install-ci-capabilities/verify.ts +1 -1
- package/src/install-ci-core.ts +4 -4
- package/src/install-ci-github.ts +1 -1
- package/src/install-ci.ts +4 -4
- package/src/intake-event.ts +6 -6
- package/src/intake-marker.ts +3 -3
- package/src/intake-triage.ts +2 -2
- package/src/intake-trigger-template.ts +17 -17
- package/src/intake.ts +97 -97
- package/src/integration-core.ts +35 -35
- package/src/isolation.ts +3 -3
- package/src/issue-provider.ts +4 -4
- package/src/item-lock.ts +21 -21
- package/src/item-path.ts +2 -2
- package/src/ledger-lint.ts +9 -9
- package/src/ledger-read.ts +81 -81
- package/src/ledger-write.ts +3 -3
- package/src/lifecycle-gather.ts +16 -16
- package/src/lifecycle-pools.ts +4 -4
- package/src/merge-question-surfacer.ts +4 -4
- package/src/mint-adr.ts +4 -4
- package/src/mirror-pool-scan.ts +5 -5
- package/src/needs-attention.ts +22 -22
- package/src/orphan-sidecar.ts +2 -2
- package/src/placement.ts +6 -6
- package/src/prd-to-spec.ts +51 -15
- package/src/prompt.ts +33 -35
- package/src/readiness.ts +1 -1
- package/src/recover-isolated.ts +1 -1
- package/src/repo-config.ts +12 -12
- package/src/review-gate.ts +12 -11
- package/src/review-verdict.ts +2 -2
- package/src/run.ts +6 -6
- package/src/scan.ts +15 -15
- package/src/select-order.ts +1 -1
- package/src/select-priority.ts +13 -13
- package/src/sidecar.ts +3 -3
- package/src/slug-namespace.ts +3 -3
- package/src/spec-complete.ts +2 -2
- package/src/start.ts +4 -4
- package/src/status.ts +7 -7
- package/src/surface-gate.ts +2 -2
- package/src/surface-persist.ts +2 -2
- package/src/tasker-review-loop.ts +15 -15
- package/src/tasking-eligibility.ts +21 -21
- package/src/tasking-lock.ts +27 -28
- package/src/tasking.ts +124 -123
- package/src/triage-gate.ts +1 -1
- package/src/triage-persist.ts +16 -16
- package/src/verify-workflow-template.ts +2 -2
- package/src/work-layout.ts +9 -7
- package/src/workspace.ts +1 -1
package/src/surface-gate.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {parseableJsonContractPrompt} from './review-verdict.js';
|
|
|
6
6
|
import type {NewQuestion} from './sidecar.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The **SURFACE gate** (
|
|
9
|
+
* The **SURFACE gate** (spec `advance-loop`, task `advance-rung-surface`,
|
|
10
10
|
* US #32/33) — the surface-question rung's fresh-context spawn, the DIRECT mirror
|
|
11
11
|
* of the PR/code review gate ({@link import('./review-gate.js')}). On
|
|
12
12
|
* `classify=surface`, the advance engine spawns a FRESH-CONTEXT agent with the
|
|
@@ -70,7 +70,7 @@ export interface SurfaceEmit {
|
|
|
70
70
|
|
|
71
71
|
/** What the surface gate needs to launch a fresh-context surface of one item. */
|
|
72
72
|
export interface SurfaceGateInput {
|
|
73
|
-
/** The namespaced identity the surface is for (`task:foo` / `
|
|
73
|
+
/** The namespaced identity the surface is for (`task:foo` / `spec:bar` / `observation:baz`). */
|
|
74
74
|
item: string;
|
|
75
75
|
/** The working clone/checkout the gate runs in. */
|
|
76
76
|
cwd: string;
|
package/src/surface-persist.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from './sidecar.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* The engine-owned SURFACE PERSIST (
|
|
16
|
+
* The engine-owned SURFACE PERSIST (spec `advance-loop`, task
|
|
17
17
|
* `advance-rung-surface`, US #15/33) — the half of the surface rung the ENGINE
|
|
18
18
|
* owns (the skill JUDGES, the engine PERSISTS). Given the questions the
|
|
19
19
|
* `surface-questions` skill EMITTED (gathered by `surface-gate.ts`'s spawn), the
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
export interface SurfacePersistOptions {
|
|
54
54
|
/** Working clone/worktree the persist commits in. */
|
|
55
55
|
cwd: string;
|
|
56
|
-
/** The namespaced item identity (`task:foo` / `
|
|
56
|
+
/** The namespaced item identity (`task:foo` / `spec:bar` / `observation:baz`). */
|
|
57
57
|
item: string;
|
|
58
58
|
/**
|
|
59
59
|
* The item file path RELATIVE to `cwd` (e.g. `work/backlog/foo.md`). The
|
|
@@ -29,9 +29,9 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* **The tasker review→edit→re-review→converge LOOP** (`slicer-review-edit-loop`,
|
|
32
|
-
* GATES
|
|
32
|
+
* GATES spec `work/specs/ready/review.md` RESOLVED DESIGN — Shape 2 / insertion point A).
|
|
33
33
|
*
|
|
34
|
-
* On the `do
|
|
34
|
+
* On the `do spec:<slug>` tasking path (`tasking.ts`/`performTask`), AFTER the
|
|
35
35
|
* agent produces a candidate set of `work/tasks/backlog/<slug>.md` tasks and BEFORE the
|
|
36
36
|
* runner finalises/lands them, this loop RUNS the `review` SKILL
|
|
37
37
|
* (`skills/review/SKILL.md`), APPLIES its findings as EDITS to the candidate task
|
|
@@ -47,7 +47,7 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
|
|
|
47
47
|
* N so the loop can never run forever.
|
|
48
48
|
*
|
|
49
49
|
* ⚠️ ASPIRATION-VS-BUILT (2026-06-10): the "single context" wording above is the
|
|
50
|
-
*
|
|
50
|
+
* spec's ASPIRATION, NOT what this module does at runtime. The ACTUAL N loop is
|
|
51
51
|
* RUNNER-DRIVEN and PER-PASS: `runOneExecution` does `for (pass …) { gate(…);
|
|
52
52
|
* applyEdits(…to disk…) }` — ONE agent LAUNCH per pass, the runner writing the
|
|
53
53
|
* agent's edits to the candidate task FILES (`work/tasks/backlog/`) between passes, the
|
|
@@ -75,7 +75,7 @@ export {parseReviewVerdict as parseTaskReviewVerdict} from './review-verdict.js'
|
|
|
75
75
|
* - **a specific uncertain task** → emit it `needsAnswers: true` with the
|
|
76
76
|
* questions in its body (created, not agent-buildable until a human answers).
|
|
77
77
|
* - **the whole decomposition unclear / `taskerLoopMax` exhausted with blockers** →
|
|
78
|
-
* route the
|
|
78
|
+
* route the spec to `work/needs-attention/<slug>.md` with the questions as the
|
|
79
79
|
* reason, emitting NO guessed tasks.
|
|
80
80
|
*
|
|
81
81
|
* The verdict sink itself (the git transitions for those three outcomes) is the
|
|
@@ -101,7 +101,7 @@ export type TaskReviewVerdict = ReviewVerdict;
|
|
|
101
101
|
|
|
102
102
|
/** What the review gate needs to launch a fresh-context review+edit pass. */
|
|
103
103
|
export interface TaskReviewGateInput {
|
|
104
|
-
/** The
|
|
104
|
+
/** The spec slug whose candidate tasks are under review. */
|
|
105
105
|
slug: string;
|
|
106
106
|
/** The working clone/checkout the loop runs in (candidate tasks live here). */
|
|
107
107
|
cwd: string;
|
|
@@ -141,7 +141,7 @@ export type LoopOutcome =
|
|
|
141
141
|
| 'converged'
|
|
142
142
|
/** `taskerLoopMax` hit with blockers → specific uncertain task(s) → needsAnswers. */
|
|
143
143
|
| 'uncertain-tasks'
|
|
144
|
-
/** `taskerLoopMax` hit / decomposition unclear → route the
|
|
144
|
+
/** `taskerLoopMax` hit / decomposition unclear → route the spec to needs-attention. */
|
|
145
145
|
| 'decomposition-unclear';
|
|
146
146
|
|
|
147
147
|
/** The result of running the loop — the disposition the caller's sink routes. */
|
|
@@ -174,7 +174,7 @@ export interface RunTaskReviewLoopResult {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
export interface RunTaskReviewLoopOptions {
|
|
177
|
-
/** The
|
|
177
|
+
/** The spec slug whose candidate tasks are being improved. */
|
|
178
178
|
slug: string;
|
|
179
179
|
/** The working clone/checkout the loop runs in. */
|
|
180
180
|
cwd: string;
|
|
@@ -226,7 +226,7 @@ export interface RunTaskReviewLoopOptions {
|
|
|
226
226
|
* to the candidate task files, then re-review — until `verdict === 'approve'` (no
|
|
227
227
|
* NEW blocking issue → converged) or the pass count reaches `taskerLoopMax`. On the cap
|
|
228
228
|
* with a still-`block` verdict, ROUTE per the verdict's channels:
|
|
229
|
-
* - `decompositionUnclear` set ⇒ `decomposition-unclear` (
|
|
229
|
+
* - `decompositionUnclear` set ⇒ `decomposition-unclear` (spec → needs-attention,
|
|
230
230
|
* no guessed tasks);
|
|
231
231
|
* - else `uncertainTasks` (or, as a floor, every candidate task) ⇒
|
|
232
232
|
* `uncertain-tasks` (those tasks emitted `needsAnswers: true` + questions).
|
|
@@ -296,7 +296,7 @@ export async function runTaskReviewLoop(
|
|
|
296
296
|
note(
|
|
297
297
|
`Tasker review loop did not converge within taskerLoopMax=${taskerLoopMax} ` +
|
|
298
298
|
`across ${executions} fresh context(s); the whole decomposition is ` +
|
|
299
|
-
'unclear — routing the
|
|
299
|
+
'unclear — routing the spec to needs-attention (no guessed tasks).',
|
|
300
300
|
);
|
|
301
301
|
return {
|
|
302
302
|
outcome: 'decomposition-unclear',
|
|
@@ -308,7 +308,7 @@ export async function runTaskReviewLoop(
|
|
|
308
308
|
message:
|
|
309
309
|
`The decomposition of '${options.slug}' is still unclear after ` +
|
|
310
310
|
`taskerLoopMax=${taskerLoopMax} review pass(es) across ${executions} fresh ` +
|
|
311
|
-
'context(s); routing the
|
|
311
|
+
'context(s); routing the spec to needs-attention with the open ' +
|
|
312
312
|
'questions, emitting no guessed tasks.',
|
|
313
313
|
};
|
|
314
314
|
}
|
|
@@ -617,18 +617,18 @@ export function buildTaskReviewPrompt(input: TaskReviewGateInput): string {
|
|
|
617
617
|
const list = input.candidateTasks.map((p) => ` - ${p}`).join('\n');
|
|
618
618
|
return [
|
|
619
619
|
`You are a FRESH-CONTEXT reviewer in the TASKER review→edit→converge LOOP`,
|
|
620
|
-
`(insertion point A). Review the CANDIDATE TASKS just produced for the
|
|
620
|
+
`(insertion point A). Review the CANDIDATE TASKS just produced for the spec`,
|
|
621
621
|
`"${input.slug}":`,
|
|
622
622
|
list || ' (no candidate tasks found)',
|
|
623
623
|
``,
|
|
624
624
|
reviewDisciplinePrompt(),
|
|
625
625
|
``,
|
|
626
|
-
`Read the source
|
|
626
|
+
`Read the source spec (${workItemRel('specs-ready', `${input.slug}.md`)}) and review the candidate`,
|
|
627
627
|
`decomposition ADVERSARIALLY. Review the WHOLE SET — graph coherence / gaps /`,
|
|
628
628
|
`overlap / goal-composition (dependency-graph coherence, set-level gaps,`,
|
|
629
|
-
`overlapping/duplicated tasks, and "does the set compose into the
|
|
629
|
+
`overlapping/duplicated tasks, and "does the set compose into the spec goal")`,
|
|
630
630
|
`— not just per-task well-formedness. The DESTINATION CHECK ("if every task`,
|
|
631
|
-
`is built exactly as written, do we end up with the system the
|
|
631
|
+
`is built exactly as written, do we end up with the system the spec describes?")`,
|
|
632
632
|
`is PART OF this pass and may ITSELF trigger edits — that is why this is a`,
|
|
633
633
|
`loop, not a one-shot gate.`,
|
|
634
634
|
``,
|
|
@@ -645,7 +645,7 @@ export function buildTaskReviewPrompt(input: TaskReviewGateInput): string {
|
|
|
645
645
|
` can FIX a finding by editing (the natural improver step).`,
|
|
646
646
|
` - "uncertainTasks" — specific tasks you cannot make buildable (each gets`,
|
|
647
647
|
` \`needsAnswers: true\` with the questions in its body).`,
|
|
648
|
-
` - "decompositionUnclear" — the WHOLE decomposition is unsound (the
|
|
648
|
+
` - "decompositionUnclear" — the WHOLE decomposition is unsound (the spec is`,
|
|
649
649
|
` routed to needs-attention; emit no guessed tasks).`,
|
|
650
650
|
`Do NOT fill "review" / "edit" / "questions" — those are other callers'`,
|
|
651
651
|
`channels. Flag, do not guess: a flagged question costs one human glance; a`,
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure tasking-eligibility resolution — the auto-task decision layer, one level
|
|
3
|
-
* UP from the build gate (`eligibility.ts`). No I/O: callers pass in the
|
|
3
|
+
* UP from the build gate (`eligibility.ts`). No I/O: callers pass in the spec's
|
|
4
4
|
* two autonomy axes (`humanOnly`, `needsAnswers`), the repo's `autoTask` policy,
|
|
5
|
-
* the
|
|
6
|
-
* TASKED (resolved against `work/
|
|
5
|
+
* the spec's `taskedAfter` slugs, and the set of slugs whose prds are already
|
|
6
|
+
* TASKED (resolved against `work/specs/tasked/` residence, NOT `work/done/`).
|
|
7
7
|
*
|
|
8
8
|
* This mirrors the build-gate shape deliberately (CONTEXT.md / the `auto-slice`
|
|
9
|
-
*
|
|
10
|
-
* predicate, applied to a
|
|
11
|
-
* cross-
|
|
9
|
+
* spec): the same `needsAnswers !== true && humanOnly !== true && <repo policy>`
|
|
10
|
+
* predicate, applied to a spec's two axes + the repo's `autoTask` toggle — and a
|
|
11
|
+
* cross-spec ordering check that resolves against tasked-ness rather than done-ness.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type {HumanOnlyGate} from './eligibility.js';
|
|
15
15
|
|
|
16
16
|
export type {HumanOnlyGate};
|
|
17
17
|
|
|
18
|
-
/** Resolution of a
|
|
18
|
+
/** Resolution of a spec's `taskedAfter` against the set of already-tasked prds. */
|
|
19
19
|
export interface TaskedAfterResult {
|
|
20
|
-
/** True when every listed
|
|
20
|
+
/** True when every listed spec is already tasked. */
|
|
21
21
|
satisfied: boolean;
|
|
22
|
-
/** Listed
|
|
22
|
+
/** Listed spec slugs not yet tasked, in declaration order. */
|
|
23
23
|
missing: string[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface TaskingEligibilityInput {
|
|
27
|
-
/** Autonomy axis 1 (DECIDED): a human must drive THIS
|
|
27
|
+
/** Autonomy axis 1 (DECIDED): a human must drive THIS spec's tasking. */
|
|
28
28
|
humanOnly: HumanOnlyGate;
|
|
29
|
-
/** Autonomy axis 2 (DISCOVERED): the
|
|
29
|
+
/** Autonomy axis 2 (DISCOVERED): the spec has unresolved questions. */
|
|
30
30
|
needsAnswers: HumanOnlyGate;
|
|
31
|
-
/** Cross-
|
|
31
|
+
/** Cross-spec order: spec slugs that must already be tasked before this one. */
|
|
32
32
|
taskedAfter: string[];
|
|
33
|
-
/** Slugs of prds that are already TASKED (residence in `work/
|
|
33
|
+
/** Slugs of prds that are already TASKED (residence in `work/specs/tasked/`). */
|
|
34
34
|
taskedSlugs: Set<string>;
|
|
35
35
|
/** Per-repo policy: may an agent auto-task *undeclared* prds in this repo? */
|
|
36
36
|
autoTask: boolean;
|
|
37
37
|
/**
|
|
38
|
-
* The target was named EXPLICITLY by the operator (`do
|
|
39
|
-
* `autoTask` POLICY is already satisfied — naming the
|
|
38
|
+
* The target was named EXPLICITLY by the operator (`do spec:<slug>`), so the
|
|
39
|
+
* `autoTask` POLICY is already satisfied — naming the spec IS the authorization,
|
|
40
40
|
* exactly as `do <task>` builds a named task regardless of `autoBuild` (the
|
|
41
41
|
* `autoBuild` precedent: the pool/scan gates the policy, the explicit claim path
|
|
42
42
|
* never re-checks it). When `true`, the policy term drops from the gate and ONLY
|
|
43
|
-
* the
|
|
43
|
+
* the spec's own readiness axes (`humanOnly`/`needsAnswers`) + `taskedAfter` bind.
|
|
44
44
|
* Defaults `false` (the AUTO-PICK pool path, where the `autoTask` policy DOES
|
|
45
45
|
* gate). The pool is the single policy-enforcement point; the per-invocation gate
|
|
46
46
|
* applies the policy only when NOT explicit.
|
|
@@ -49,7 +49,7 @@ export interface TaskingEligibilityInput {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface TaskingEligibilityResult {
|
|
52
|
-
/** Taskable now = gate passes AND every `taskedAfter`
|
|
52
|
+
/** Taskable now = gate passes AND every `taskedAfter` spec is already tasked. */
|
|
53
53
|
taskable: boolean;
|
|
54
54
|
/** Whether the autonomy gate alone passes (agent-taskable on its own axes). */
|
|
55
55
|
gatePass: boolean;
|
|
@@ -61,7 +61,7 @@ export interface TaskingEligibilityResult {
|
|
|
61
61
|
* `true` AND `humanOnly` is not `true` AND the repo's `autoTask` POLICY is
|
|
62
62
|
* satisfied — where the policy is satisfied either by the repo's `autoTask`
|
|
63
63
|
* toggle being on (the AUTO-PICK pool path) OR by the target being named
|
|
64
|
-
* EXPLICITLY (`explicit: true` — `do
|
|
64
|
+
* EXPLICITLY (`explicit: true` — `do spec:<slug>`, where naming IS the
|
|
65
65
|
* authorization, mirroring `do <task>` vs `autoBuild`). Both readiness axes
|
|
66
66
|
* block orthogonally and are never agent-taskable regardless of policy; a human
|
|
67
67
|
* is never bound by either. The exact mirror of `resolveGate` (the build gate),
|
|
@@ -82,9 +82,9 @@ export function resolveTaskGate(
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Resolve a
|
|
86
|
-
* `done/`): satisfied iff every listed
|
|
87
|
-
* untasked blocker ⇒ not yet taskable (so this
|
|
85
|
+
* Resolve a spec's `taskedAfter` against the slugs of prds already TASKED (NOT
|
|
86
|
+
* `done/`): satisfied iff every listed spec is present in `taskedSlugs`. An
|
|
87
|
+
* untasked blocker ⇒ not yet taskable (so this spec's emitted tasks can
|
|
88
88
|
* reference the real slugs of those prds' tasks).
|
|
89
89
|
*/
|
|
90
90
|
export function resolveTaskedAfter(
|
package/src/tasking-lock.ts
CHANGED
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
import {workItemRel} from './work-layout.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* The **tasking concurrency lock** (
|
|
10
|
+
* The **tasking concurrency lock** (spec `auto-slice`, task `autoslice-lock`).
|
|
11
11
|
*
|
|
12
|
-
* Serialises *concurrent* taskers (two CI runs, or human + CI) so a
|
|
12
|
+
* Serialises *concurrent* taskers (two CI runs, or human + CI) so a spec is never
|
|
13
13
|
* double-tasked. As of the capstone cut-over (task
|
|
14
|
-
* `cutover-retire-slicing-advancing-markers-and-trim-folder-sets`,
|
|
14
|
+
* `cutover-retire-slicing-advancing-markers-and-trim-folder-sets`, spec
|
|
15
15
|
* `ledger-status-per-item-lock-refs`; ADR `ledger-status-on-per-item-lock-refs`)
|
|
16
|
-
* the legacy `git mv work/
|
|
16
|
+
* the legacy `git mv work/specs/ready/<slug>.md → work/tasking/<slug>.md` MARKER on `main`
|
|
17
17
|
* is GONE: the body NEVER relocates until the durable promotion, exactly as claim
|
|
18
18
|
* no longer moves the task body (task
|
|
19
19
|
* `cutover-claim-body-stays-and-complete-sources-from-backlog`). The tasking lock
|
|
20
20
|
* is now ONLY the UNIFIED per-item lock (`refs/dorfl/lock/<entry>`,
|
|
21
|
-
* `action: task`, keyed `
|
|
22
|
-
* the same item, so tasking a
|
|
21
|
+
* `action: task`, keyed `spec:<slug>`) — the SAME ref claim and advance use for
|
|
22
|
+
* the same item, so tasking a spec is mutually exclusive with claiming/advancing
|
|
23
23
|
* the SAME item BY CONSTRUCTION (the second acquirer loses the SAME create-only
|
|
24
24
|
* ref CAS, with NO retry budget and NO false contention). There is no transient
|
|
25
25
|
* status in `main`'s tree anymore, so a work branch cut from `main` inherits no
|
|
@@ -29,9 +29,9 @@ import {workItemRel} from './work-layout.js';
|
|
|
29
29
|
* A `lost` (the item is already held for implement/task/advance) makes the
|
|
30
30
|
* tasking acquire lose DEFINITIVELY (exit 2, no retry). On a successful acquire
|
|
31
31
|
* it returns {@link AcquireTaskingLockResult.lockedBlob}: the git blob sha of the
|
|
32
|
-
*
|
|
32
|
+
* spec body the lock TOOK, read from `work/specs/ready/<slug>.md` on the arbiter — the
|
|
33
33
|
* snapshot the tasker reads + tasks from, handed back so the integrate
|
|
34
|
-
* transition can fail loud if the held
|
|
34
|
+
* transition can fail loud if the held spec was edited concurrently (the
|
|
35
35
|
* read-stability backstop). A dry-run takes no lock (it mutates nothing).
|
|
36
36
|
*
|
|
37
37
|
* - **Release** ({@link releaseTaskingLock}) DELETES the unified lock ref. It
|
|
@@ -51,11 +51,11 @@ import {workItemRel} from './work-layout.js';
|
|
|
51
51
|
* The READ-STABILITY backstop (the content-identity stale check that used to live
|
|
52
52
|
* in the release, comparing the held `work/tasking/<slug>.md` blob against the
|
|
53
53
|
* acquire-time snapshot) now lives at the integrate seam (`tasking.ts`
|
|
54
|
-
* `heldSpecIsStale`, comparing `work/
|
|
54
|
+
* `heldSpecIsStale`, comparing `work/specs/ready/<slug>.md`) — relocated because the
|
|
55
55
|
* completing transition, not the release, owns the commit. See
|
|
56
56
|
* `work/notes/observations/tasking-lock-does-not-stabilise-prd-content.md`.
|
|
57
57
|
*
|
|
58
|
-
* This module provides the lock PRIMITIVES only. The orchestrating `do
|
|
58
|
+
* This module provides the lock PRIMITIVES only. The orchestrating `do spec:<slug>`
|
|
59
59
|
* tasking command (`tasking.ts`) acquires, drives the agent's tasking, integrates
|
|
60
60
|
* the emitted tasks + the durable `prd → prd-tasked` move, and releases. The
|
|
61
61
|
* human path (no contention) may task on `main` directly without the lock.
|
|
@@ -74,7 +74,7 @@ export type AcquireTaskingLockOutcome =
|
|
|
74
74
|
export type AcquireTaskingLockExitCode = 0 | 1 | 2 | 3;
|
|
75
75
|
|
|
76
76
|
export interface AcquireTaskingLockOptions {
|
|
77
|
-
/** The
|
|
77
|
+
/** The spec slug to lock (`work/specs/ready/<slug>.md`). */
|
|
78
78
|
slug: string;
|
|
79
79
|
/** Working clone/worktree the lock acquire runs in. */
|
|
80
80
|
cwd: string;
|
|
@@ -98,10 +98,10 @@ export interface AcquireTaskingLockResult {
|
|
|
98
98
|
/** Human-readable summary of the terminal condition. */
|
|
99
99
|
message: string;
|
|
100
100
|
/**
|
|
101
|
-
* On a successful acquire (`acquired`), the git BLOB sha of the
|
|
102
|
-
* the lock TOOK (`work/
|
|
101
|
+
* On a successful acquire (`acquired`), the git BLOB sha of the spec body that
|
|
102
|
+
* the lock TOOK (`work/specs/ready/<slug>.md` on the arbiter). This IS the snapshot the
|
|
103
103
|
* tasker reads + tasks from; the integrate transition compares the current
|
|
104
|
-
* `work/
|
|
104
|
+
* `work/specs/ready/<slug>.md` blob against it to fail loud on a concurrent edit (the
|
|
105
105
|
* read-stability backstop). `undefined` unless `outcome === 'acquired'` (and on
|
|
106
106
|
* dry-run, where nothing was published).
|
|
107
107
|
*/
|
|
@@ -157,7 +157,7 @@ async function runAcquire(
|
|
|
157
157
|
}
|
|
158
158
|
const by = options.by || (await resolveBy(cwd, env));
|
|
159
159
|
|
|
160
|
-
// Is the
|
|
160
|
+
// Is the spec still lockable (present in work/specs/ready/ on the arbiter's main)?
|
|
161
161
|
await gitHard(['fetch', '--quiet', arbiter], cwd, env);
|
|
162
162
|
const spec = workItemRel('specs-ready', `${slug}.md`);
|
|
163
163
|
const specBlob = await gitSoft(
|
|
@@ -166,7 +166,7 @@ async function runAcquire(
|
|
|
166
166
|
env,
|
|
167
167
|
);
|
|
168
168
|
if (specBlob.status !== 0) {
|
|
169
|
-
const message = `'${spec}' not found on ${arbiter}/main (no such
|
|
169
|
+
const message = `'${spec}' not found on ${arbiter}/main (no such spec, or it was already moved/tasked).`;
|
|
170
170
|
note(message);
|
|
171
171
|
return {exitCode: 2, outcome: 'lost', message};
|
|
172
172
|
}
|
|
@@ -180,18 +180,17 @@ async function runAcquire(
|
|
|
180
180
|
return {exitCode: 0, outcome: 'acquired', message, lockedBlob};
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
// Acquire the UNIFIED per-item lock (`action: task`, keyed `
|
|
183
|
+
// Acquire the UNIFIED per-item lock (`action: task`, keyed `spec:<slug>` so it
|
|
184
184
|
// shares the ONE ref with claim/advance of the SAME item). A create-only ref
|
|
185
185
|
// CAS: the winner holds it, the loser is DEFINITIVELY `lost` (exit 2, no retry
|
|
186
186
|
// budget). No auto-steal of an orphaned lock, consistent with claim/advance and
|
|
187
187
|
// the ADR's recovery model (no liveness heartbeat / auto-sweep; a human asserts
|
|
188
188
|
// a lock is dead via `release-lock` + `gc --ledger`).
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
//
|
|
193
|
-
// `prd:<slug
|
|
194
|
-
// contract task removes the legacy form.
|
|
189
|
+
// Spec `prd-to-spec-vocabulary-cutover-and-migration-command`: the parent-spec
|
|
190
|
+
// item identity is `spec:<slug>`, so the unified per-item lock ref is
|
|
191
|
+
// `refs/dorfl/lock/spec-<slug>`. HARD CUTOVER: the legacy `prd:<slug>` identity
|
|
192
|
+
// is GONE — the resolver no longer treats `prd:` as the spec namespace (a
|
|
193
|
+
// `prd:<slug>` arg is a bare literal task slug now).
|
|
195
194
|
const lock = await acquireItemLock({
|
|
196
195
|
item: `spec:${slug}`,
|
|
197
196
|
action: 'task',
|
|
@@ -228,7 +227,7 @@ export type ReleaseTaskingLockOutcome =
|
|
|
228
227
|
export type ReleaseTaskingLockExitCode = 0 | 1 | 2 | 3 | 4;
|
|
229
228
|
|
|
230
229
|
export interface ReleaseTaskingLockOptions {
|
|
231
|
-
/** The
|
|
230
|
+
/** The spec slug whose lock to release. */
|
|
232
231
|
slug: string;
|
|
233
232
|
/** Working clone/worktree the release runs in. */
|
|
234
233
|
cwd: string;
|
|
@@ -249,9 +248,9 @@ export interface ReleaseTaskingLockOptions {
|
|
|
249
248
|
/**
|
|
250
249
|
* The tasker review→edit LOOP's **decomposition-unclear** verdict
|
|
251
250
|
* (`slicer-review-edit-loop`), or the task-SET acceptance gate's `block`:
|
|
252
|
-
* instead of DELETING the lock (returning the
|
|
251
|
+
* instead of DELETING the lock (returning the spec to the claimable/taskable
|
|
253
252
|
* pool), amend it `active → stuck` with this reason recorded on the entry,
|
|
254
|
-
* emitting NO guessed tasks. The
|
|
253
|
+
* emitting NO guessed tasks. The spec body stays in `work/specs/ready/` (it never moved
|
|
255
254
|
* under the lock); the stuck lock IS the tasking needs-attention surface (no
|
|
256
255
|
* `work/needs-attention/` folder write), so it is NOT re-taskable until a human
|
|
257
256
|
* resolves it via `release-lock`/`resume`. Omitted ⇒ the normal release DELETES
|
|
@@ -275,7 +274,7 @@ export interface ReleaseTaskingLockResult {
|
|
|
275
274
|
* Release the tasking lock for `slug`: DELETE the unified `action: task` lock ref
|
|
276
275
|
* (idempotent — an already-absent ref is a clean `released`). It moves NO lifecycle
|
|
277
276
|
* file: the durable `prd → prd-tasked` success move is owned by the integrate band,
|
|
278
|
-
* and the
|
|
277
|
+
* and the spec body never left `work/specs/ready/` under the lock, so there is no
|
|
279
278
|
* `tasking/ → prd/` restore.
|
|
280
279
|
*
|
|
281
280
|
* When `routeToNeedsAttention` is set (the tasker decomposition-unclear verdict /
|
|
@@ -328,7 +327,7 @@ async function runRelease(
|
|
|
328
327
|
|
|
329
328
|
// DECOMPOSITION-UNCLEAR / TASK-GATE BLOCK: amend the lock `active → stuck` with
|
|
330
329
|
// the reason on the entry (the tasking needs-attention surface), NOT delete it.
|
|
331
|
-
// The
|
|
330
|
+
// The spec body stays in `work/specs/ready/`; the stuck lock keeps it out of the
|
|
332
331
|
// taskable pool until a human resolves it (`release-lock`/`resume`).
|
|
333
332
|
if (options.routeToNeedsAttention !== undefined) {
|
|
334
333
|
// MIGRATE: EMIT `spec:<slug>` (keyed to the `spec-<slug>` lock entry).
|