@nickmeriano/task 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -25
- package/dist/asks.test.d.ts +17 -0
- package/dist/asks.test.d.ts.map +1 -0
- package/dist/asks.test.js +278 -0
- package/dist/asks.test.js.map +1 -0
- package/dist/check.d.ts +43 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +403 -0
- package/dist/check.js.map +1 -0
- package/dist/check.test.d.ts +9 -0
- package/dist/check.test.d.ts.map +1 -0
- package/dist/check.test.js +248 -0
- package/dist/check.test.js.map +1 -0
- package/dist/claim-io.d.ts +73 -0
- package/dist/claim-io.d.ts.map +1 -0
- package/dist/claim-io.js +344 -0
- package/dist/claim-io.js.map +1 -0
- package/dist/claim.d.ts +61 -9
- package/dist/claim.d.ts.map +1 -1
- package/dist/claim.js +197 -67
- package/dist/claim.js.map +1 -1
- package/dist/claim.test.d.ts +2 -2
- package/dist/claim.test.js +235 -64
- package/dist/claim.test.js.map +1 -1
- package/dist/cli.js +724 -136
- package/dist/cli.js.map +1 -1
- package/dist/file-store.d.ts +110 -38
- package/dist/file-store.d.ts.map +1 -1
- package/dist/file-store.js +514 -238
- package/dist/file-store.js.map +1 -1
- package/dist/git-serve.d.ts +183 -0
- package/dist/git-serve.d.ts.map +1 -0
- package/dist/git-serve.js +503 -0
- package/dist/git-serve.js.map +1 -0
- package/dist/git-serve.test.d.ts +16 -0
- package/dist/git-serve.test.d.ts.map +1 -0
- package/dist/git-serve.test.js +183 -0
- package/dist/git-serve.test.js.map +1 -0
- package/dist/git.d.ts +65 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +114 -0
- package/dist/git.js.map +1 -0
- package/dist/id.d.ts +39 -0
- package/dist/id.d.ts.map +1 -0
- package/dist/id.js +67 -0
- package/dist/id.js.map +1 -0
- package/dist/inbox.d.ts +41 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +56 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/overview.d.ts +52 -0
- package/dist/overview.d.ts.map +1 -0
- package/dist/overview.js +61 -0
- package/dist/overview.js.map +1 -0
- package/dist/overview.test.d.ts +8 -0
- package/dist/overview.test.d.ts.map +1 -0
- package/dist/overview.test.js +48 -0
- package/dist/overview.test.js.map +1 -0
- package/dist/promote.test.d.ts +15 -0
- package/dist/promote.test.d.ts.map +1 -0
- package/dist/promote.test.js +104 -0
- package/dist/promote.test.js.map +1 -0
- package/dist/publish.d.ts +2 -17
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +4 -49
- package/dist/publish.js.map +1 -1
- package/dist/search.d.ts +34 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +79 -0
- package/dist/search.js.map +1 -0
- package/dist/search.test.d.ts +2 -0
- package/dist/search.test.d.ts.map +1 -0
- package/dist/search.test.js +53 -0
- package/dist/search.test.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +228 -23
- package/dist/server.js.map +1 -1
- package/dist/store.d.ts +43 -63
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +0 -368
- package/dist/store.js.map +1 -1
- package/dist/store.test.d.ts +1 -2
- package/dist/store.test.d.ts.map +1 -1
- package/dist/store.test.js +148 -106
- package/dist/store.test.js.map +1 -1
- package/dist/ticket-doc.d.ts +74 -5
- package/dist/ticket-doc.d.ts.map +1 -1
- package/dist/ticket-doc.js +229 -15
- package/dist/ticket-doc.js.map +1 -1
- package/dist/types.d.ts +115 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +153 -40
- package/src/asks.test.ts +355 -0
- package/src/check.test.ts +328 -0
- package/src/check.ts +497 -0
- package/src/claim-io.ts +401 -0
- package/src/claim.test.ts +301 -71
- package/src/claim.ts +238 -81
- package/src/cli.ts +740 -131
- package/src/file-store.ts +572 -254
- package/src/git-serve.test.ts +240 -0
- package/src/git-serve.ts +595 -0
- package/src/git.ts +141 -0
- package/src/id.ts +68 -0
- package/src/inbox.ts +77 -0
- package/src/index.ts +4 -2
- package/src/overview.test.ts +52 -0
- package/src/overview.ts +105 -0
- package/src/promote.test.ts +143 -0
- package/src/publish.ts +6 -53
- package/src/search.test.ts +64 -0
- package/src/search.ts +105 -0
- package/src/server.ts +232 -21
- package/src/store.test.ts +166 -116
- package/src/store.ts +46 -444
- package/src/ticket-doc.ts +284 -21
- package/src/types.ts +120 -28
- package/ui/dist/assets/index-BjsorZOU.js +229 -0
- package/ui/dist/assets/index-CoKCUYic.css +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-COunM-QN.css +0 -1
- package/ui/dist/assets/index-D4homvrQ.js +0 -229
package/dist/claim.js
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
* against `origin`. PR/session awareness belongs to whatever drives the claim
|
|
10
10
|
* (the implement-task skill, a human).
|
|
11
11
|
*/
|
|
12
|
-
import { spawnSync } from "node:child_process";
|
|
13
12
|
import { join } from "node:path";
|
|
14
|
-
import { FileStore, TICKETS_DIR } from "./file-store.js";
|
|
13
|
+
import { FileStore, TICKETS_DIR, openBoard } from "./file-store.js";
|
|
14
|
+
import { GIT_NETWORK_TIMEOUT_MS, defaultBase, git, gitMust, runGit, } from "./git.js";
|
|
15
|
+
import { boardConfig, findBoardsByPrefix, findRoot, findScopeRoot, } from "./store.js";
|
|
15
16
|
/**
|
|
16
17
|
* The branch namespace claims live under when the board doesn't configure
|
|
17
18
|
* one. Deliberately vendor-neutral: repos whose workers are Claude Code cloud
|
|
@@ -25,21 +26,44 @@ export const DEFAULT_CLAIM_PREFIX = "task/claim/";
|
|
|
25
26
|
/** Slash-terminated path segments of ref-safe characters. */
|
|
26
27
|
const CLAIM_PREFIX_SHAPE = /^([A-Za-z0-9._-]+\/)+$/;
|
|
27
28
|
/**
|
|
28
|
-
* The board's claim namespace:
|
|
29
|
+
* The board's claim namespace: `claims.branchPrefix` (a trailing slash is
|
|
29
30
|
* implied) or the default. Validated here because it becomes a git ref and an
|
|
30
31
|
* ls-remote glob — a malformed value must fail the claim, not corrupt it.
|
|
32
|
+
*
|
|
33
|
+
* The pre-0.8 top-level `claimPrefix` spelling is not honored — no consumers,
|
|
34
|
+
* no compat (TAS-41) — but silently *defaulting* over it would be worse than
|
|
35
|
+
* a shim: the board's committed lock convention would change under every
|
|
36
|
+
* worker at once. So its presence refuses, loudly, by name.
|
|
31
37
|
*/
|
|
32
38
|
export function claimNamespace(config) {
|
|
33
|
-
|
|
39
|
+
if (config.claimPrefix !== undefined && config.claims?.branchPrefix === undefined) {
|
|
40
|
+
throw new ClaimError('`claimPrefix` in .task/config.json is the pre-0.8 spelling and is no longer read — rename it to `claims: { "branchPrefix": … }`', "invalid");
|
|
41
|
+
}
|
|
42
|
+
const raw = config.claims?.branchPrefix ?? DEFAULT_CLAIM_PREFIX;
|
|
34
43
|
const prefix = raw.endsWith("/") ? raw : `${raw}/`;
|
|
35
44
|
if (!CLAIM_PREFIX_SHAPE.test(prefix) || prefix.includes("..") || /(^|\/)\./.test(prefix)) {
|
|
36
|
-
throw new ClaimError(`invalid
|
|
45
|
+
throw new ClaimError(`invalid claims.branchPrefix in .task/config.json: ${JSON.stringify(raw)} — use slash-separated segments like "task/claim/" or "claude/task/"`, "invalid");
|
|
37
46
|
}
|
|
38
47
|
return prefix;
|
|
39
48
|
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
/**
|
|
50
|
+
* The repo-wide cap on open claims: `claims.maxOpenCount` read from the
|
|
51
|
+
* *root* board's config (the outermost `.task/` above `root`), never the
|
|
52
|
+
* nearest one — a WIP cap each board could set for itself is no cap at all.
|
|
53
|
+
* Absent, unparseable or nonsensical values all mean "no cap".
|
|
54
|
+
*/
|
|
55
|
+
export function openClaimCap(root) {
|
|
56
|
+
try {
|
|
57
|
+
const cap = boardConfig(findScopeRoot(root)).claims?.maxOpenCount;
|
|
58
|
+
return typeof cap === "number" && Number.isInteger(cap) && cap > 0 ? cap : undefined;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** { prefix: "TAS" }, "x7k4m" → "task/claim/tas-x7k4m" (or under the configured namespace). */
|
|
65
|
+
export function claimBranch(config, key) {
|
|
66
|
+
return `${claimNamespace(config)}${config.prefix.toLowerCase()}-${key}`;
|
|
43
67
|
}
|
|
44
68
|
/**
|
|
45
69
|
* Why a claim was refused: "claimed" (someone holds the branch — exit 1, pick
|
|
@@ -53,43 +77,17 @@ export class ClaimError extends Error {
|
|
|
53
77
|
this.kind = kind;
|
|
54
78
|
}
|
|
55
79
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
throw result.error;
|
|
60
|
-
return {
|
|
61
|
-
status: result.status ?? 1,
|
|
62
|
-
stdout: (result.stdout ?? "").trim(),
|
|
63
|
-
stderr: (result.stderr ?? "").trim(),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** Run git and throw on failure — for the steps that have no soft outcome. */
|
|
67
|
-
function gitMust(cwd, ...args) {
|
|
68
|
-
const result = git(cwd, ...args);
|
|
80
|
+
/** Network git that throws on failure, with the timeout a real remote deserves. */
|
|
81
|
+
function gitNetMust(cwd, ...args) {
|
|
82
|
+
const result = runGit(cwd, args, { timeoutMs: GIT_NETWORK_TIMEOUT_MS });
|
|
69
83
|
if (result.status !== 0) {
|
|
70
84
|
throw new Error(`git ${args[0]} failed: ${result.stderr || result.stdout}`);
|
|
71
85
|
}
|
|
72
86
|
return result.stdout;
|
|
73
87
|
}
|
|
74
|
-
/**
|
|
75
|
-
* The base every claim branch starts from: origin's default branch. Resolved
|
|
76
|
-
* from `origin/HEAD` when the clone recorded it, with a main/master fallback
|
|
77
|
-
* for repos wired up by hand (`git remote add` + push never sets origin/HEAD).
|
|
78
|
-
*/
|
|
79
|
-
function defaultBase(cwd) {
|
|
80
|
-
const head = git(cwd, "symbolic-ref", "--quiet", "refs/remotes/origin/HEAD");
|
|
81
|
-
if (head.status === 0)
|
|
82
|
-
return head.stdout.replace(/^refs\/remotes\//, "");
|
|
83
|
-
for (const name of ["main", "master"]) {
|
|
84
|
-
if (git(cwd, "show-ref", "--verify", "--quiet", `refs/remotes/origin/${name}`).status === 0) {
|
|
85
|
-
return `origin/${name}`;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
throw new Error("couldn't resolve origin's default branch — origin/HEAD is unset and neither origin/main nor origin/master exists");
|
|
89
|
-
}
|
|
90
88
|
/** Every claim branch that exists on origin right now — one network call. */
|
|
91
89
|
export function remoteClaims(cwd, namespace) {
|
|
92
|
-
const out =
|
|
90
|
+
const out = gitNetMust(cwd, "ls-remote", "--heads", "origin", `${namespace}*`);
|
|
93
91
|
const names = new Set();
|
|
94
92
|
for (const line of out.split("\n")) {
|
|
95
93
|
const ref = line.split("\t")[1];
|
|
@@ -99,30 +97,48 @@ export function remoteClaims(cwd, namespace) {
|
|
|
99
97
|
return names;
|
|
100
98
|
}
|
|
101
99
|
function remoteBranchExists(cwd, branch) {
|
|
102
|
-
return
|
|
100
|
+
return gitNetMust(cwd, "ls-remote", "--heads", "origin", branch) !== "";
|
|
103
101
|
}
|
|
104
102
|
/** Blockers still in the way — anything not done or canceled still blocks. */
|
|
105
103
|
function openBlockers(store, task) {
|
|
106
104
|
return task.blockedBy
|
|
107
|
-
.map((
|
|
105
|
+
.map((k) => store.get(k))
|
|
108
106
|
.filter((b) => b !== null && b.status !== "done" && b.status !== "canceled")
|
|
109
107
|
.map((b) => b.id);
|
|
110
108
|
}
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Throws ClaimError("invalid") unless `task` is claimable right now. Open asks
|
|
111
|
+
* deliberately don't gate here: a ticket can be agent-implementable while a
|
|
112
|
+
* person owes it something in parallel — the done gate keeps that honest. An
|
|
113
|
+
* ask that must land *before* the work starts is a `blocked_by` on a thin
|
|
114
|
+
* human ticket, which the blocker check below already enforces.
|
|
115
|
+
*/
|
|
116
|
+
function assertClaimable(store, task, key) {
|
|
117
|
+
const id = store.displayId(key);
|
|
114
118
|
if (!task)
|
|
115
119
|
throw new ClaimError(`no such task: ${id}`, "invalid");
|
|
116
120
|
if (task.status !== "todo") {
|
|
117
121
|
throw new ClaimError(`${id} is ${task.status} — only todo tickets can be claimed`, "invalid");
|
|
118
122
|
}
|
|
119
|
-
if (task.needsHuman)
|
|
120
|
-
throw new ClaimError(`${id} needs a human — not claimable`, "invalid");
|
|
121
123
|
const blockers = openBlockers(store, task);
|
|
122
124
|
if (blockers.length) {
|
|
123
125
|
throw new ClaimError(`${id} is blocked by ${blockers.join(", ")} — not claimable`, "invalid");
|
|
124
126
|
}
|
|
125
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The WIP-cap gate every claim passes through: while `maxOpenCount` claim
|
|
130
|
+
* branches exist on origin, claiming more is refused (exit 2 — the fix is to
|
|
131
|
+
* finish or release one, not to pick a different ticket). Existence on origin
|
|
132
|
+
* is the definition of "open": a claim branch dies at merge or release, so a
|
|
133
|
+
* lingering merged branch counts — deliberate pressure to clean it up. The
|
|
134
|
+
* cap applies to humans and agents alike; `--force` is the escape.
|
|
135
|
+
*/
|
|
136
|
+
function assertUnderCap(openClaims, root, namespace) {
|
|
137
|
+
const cap = openClaimCap(root);
|
|
138
|
+
if (cap !== undefined && openClaims.size >= cap) {
|
|
139
|
+
throw new ClaimError(`${openClaims.size} claim branch${openClaims.size === 1 ? "" : "es"} already open under ${namespace} — at the root board's maxOpenCount cap (${cap}); finish or \`task claim --release\` one, or pass --force`, "invalid");
|
|
140
|
+
}
|
|
141
|
+
}
|
|
126
142
|
/**
|
|
127
143
|
* Claim `number`: validate, branch off origin's default branch, flip the
|
|
128
144
|
* ticket to in_progress as the branch's first commit, and push. The push
|
|
@@ -132,31 +148,44 @@ function assertClaimable(store, task, number) {
|
|
|
132
148
|
* someone pre-created without a claim commit can't be hijacked by a plain
|
|
133
149
|
* fast-forward. Leaves the winner checked out on the claim branch.
|
|
134
150
|
*/
|
|
135
|
-
export function claim(store,
|
|
151
|
+
export function claim(store, key, options = {}) {
|
|
152
|
+
// Unreachable since openBoard refuses pre-0.6 boards, kept as the narrowing
|
|
153
|
+
// that lets the rest of this function assume text-canonical semantics.
|
|
136
154
|
if (!(store instanceof FileStore)) {
|
|
137
|
-
throw new ClaimError("claiming needs a text-format board — run `task migrate`
|
|
155
|
+
throw new ClaimError("claiming needs a text-format board — run `npx @nickmeriano/task@0.6 migrate` once", "invalid");
|
|
138
156
|
}
|
|
139
157
|
const cwd = store.root;
|
|
140
|
-
const branch = claimBranch(store.config,
|
|
141
|
-
const id = store.displayId(
|
|
158
|
+
const branch = claimBranch(store.config, key);
|
|
159
|
+
const id = store.displayId(key);
|
|
142
160
|
// The local-branch check comes before ticket validation on purpose: on the
|
|
143
161
|
// claim branch itself the ticket reads in_progress, and "already claimed"
|
|
144
162
|
// (exit 1, move on) is the truthful answer there — not a validation failure.
|
|
145
|
-
|
|
163
|
+
// -uno everywhere a claim reads the tree: only *tracked* modifications block
|
|
164
|
+
// a branch switch. Untracked files ride along untouched — and the release
|
|
165
|
+
// flow deliberately leaves one (the reason comment), so counting them would
|
|
166
|
+
// wedge the release-then-claim-next loop this exists for.
|
|
167
|
+
const tree = git(cwd, "status", "--porcelain", "-uno");
|
|
146
168
|
if (tree.status !== 0) {
|
|
147
169
|
throw new ClaimError(`not a git repository: ${cwd}`, "invalid");
|
|
148
170
|
}
|
|
149
171
|
if (git(cwd, "show-ref", "--verify", "--quiet", `refs/heads/${branch}`).status === 0) {
|
|
150
172
|
throw new ClaimError(`${id} is already claimed — ${branch} exists locally (finish it, or \`task claim --release ${id}\`)`, "claimed");
|
|
151
173
|
}
|
|
152
|
-
assertClaimable(store, store.get(
|
|
174
|
+
assertClaimable(store, store.get(key), key);
|
|
153
175
|
if (tree.stdout !== "") {
|
|
154
176
|
throw new ClaimError("working tree is dirty — commit or stash before claiming, the claim switches branches", "invalid");
|
|
155
177
|
}
|
|
156
|
-
|
|
157
|
-
|
|
178
|
+
gitNetMust(cwd, "fetch", "--quiet", "origin");
|
|
179
|
+
// One ls-remote answers both gates: is this ticket taken, and is the repo
|
|
180
|
+
// at its WIP cap. "Already claimed" wins — that's exit 1 (pick the next
|
|
181
|
+
// ticket), where the cap is exit 2 (fix something).
|
|
182
|
+
const namespace = claimNamespace(store.config);
|
|
183
|
+
const openClaims = remoteClaims(cwd, namespace);
|
|
184
|
+
if (openClaims.has(branch)) {
|
|
158
185
|
throw new ClaimError(`${id} is already claimed — ${branch} exists on origin`, "claimed");
|
|
159
186
|
}
|
|
187
|
+
if (!options.force)
|
|
188
|
+
assertUnderCap(openClaims, cwd, namespace);
|
|
160
189
|
const base = defaultBase(cwd);
|
|
161
190
|
// So a failed claim can put the checkout back exactly where it was —
|
|
162
191
|
// a branch name usually, a bare sha when HEAD was detached.
|
|
@@ -171,16 +200,16 @@ export function claim(store, number) {
|
|
|
171
200
|
// Re-validate against the base branch: the pre-checkout validation read
|
|
172
201
|
// whatever happened to be checked out, this one reads the truth the claim
|
|
173
202
|
// will actually be built on.
|
|
174
|
-
assertClaimable(store, store.get(
|
|
175
|
-
store.update(
|
|
176
|
-
gitMust(cwd, "add", "--", join(store.taskDir, TICKETS_DIR,
|
|
203
|
+
assertClaimable(store, store.get(key), key);
|
|
204
|
+
store.update(key, { status: "in_progress" });
|
|
205
|
+
gitMust(cwd, "add", "--", join(store.taskDir, TICKETS_DIR, key));
|
|
177
206
|
gitMust(cwd, "commit", "--quiet", "-m", `chore(board): claim ${id} → in_progress`);
|
|
178
207
|
}
|
|
179
208
|
catch (error) {
|
|
180
209
|
undo();
|
|
181
210
|
throw error;
|
|
182
211
|
}
|
|
183
|
-
const push =
|
|
212
|
+
const push = runGit(cwd, ["push", "--quiet", "-u", "origin", branch, `--force-with-lease=refs/heads/${branch}:`], { timeoutMs: GIT_NETWORK_TIMEOUT_MS });
|
|
184
213
|
if (push.status !== 0) {
|
|
185
214
|
undo();
|
|
186
215
|
if (remoteBranchExists(cwd, branch)) {
|
|
@@ -188,19 +217,19 @@ export function claim(store, number) {
|
|
|
188
217
|
}
|
|
189
218
|
throw new ClaimError(`${id}: push of ${branch} was rejected (likely a concurrent claim) — ${push.stderr || "no detail from git"}`, "claimed");
|
|
190
219
|
}
|
|
191
|
-
return { task: store.get(
|
|
220
|
+
return { task: store.get(key), branch, base };
|
|
192
221
|
}
|
|
193
222
|
/**
|
|
194
223
|
* Abandon a claim cleanly: delete the branch on origin and locally. The status
|
|
195
224
|
* flip only ever existed as a commit on that branch, so deleting it *is* the
|
|
196
225
|
* revert — the default branch never saw in_progress.
|
|
197
226
|
*/
|
|
198
|
-
export function release(store,
|
|
227
|
+
export function release(store, key) {
|
|
199
228
|
const cwd = store.root;
|
|
200
|
-
const branch = claimBranch(store.config,
|
|
229
|
+
const branch = claimBranch(store.config, key);
|
|
201
230
|
const onBranch = git(cwd, "symbolic-ref", "--quiet", "--short", "HEAD").stdout === branch;
|
|
202
231
|
if (onBranch) {
|
|
203
|
-
const tree = gitMust(cwd, "status", "--porcelain");
|
|
232
|
+
const tree = gitMust(cwd, "status", "--porcelain", "-uno");
|
|
204
233
|
if (tree !== "") {
|
|
205
234
|
throw new ClaimError(`working tree on ${branch} is dirty — commit elsewhere or discard before releasing`, "invalid");
|
|
206
235
|
}
|
|
@@ -218,20 +247,121 @@ export function release(store, number) {
|
|
|
218
247
|
const local = git(cwd, "branch", "--quiet", "-D", branch).status === 0;
|
|
219
248
|
const remote = remoteBranchExists(cwd, branch);
|
|
220
249
|
if (remote)
|
|
221
|
-
|
|
250
|
+
gitNetMust(cwd, "push", "--quiet", "origin", "--delete", branch);
|
|
222
251
|
return { branch, remote, local };
|
|
223
252
|
}
|
|
224
253
|
/**
|
|
225
|
-
* The dispatcher's queue view: `todo` in position order, minus
|
|
226
|
-
*
|
|
227
|
-
*
|
|
254
|
+
* The dispatcher's queue view: `todo` in position order, minus blocked, minus
|
|
255
|
+
* tickets whose claim branch already exists on origin (one ls-remote for the
|
|
256
|
+
* whole namespace). The top entry is next up. Open asks don't exclude a
|
|
257
|
+
* ticket — see assertClaimable.
|
|
228
258
|
*/
|
|
229
259
|
export function claimableTasks(store) {
|
|
230
260
|
const claimed = remoteClaims(store.root, claimNamespace(store.config));
|
|
231
261
|
return store
|
|
232
262
|
.list({ statuses: ["todo"] })
|
|
233
|
-
.filter((t) => !t.needsHuman)
|
|
234
263
|
.filter((t) => openBlockers(store, t).length === 0)
|
|
235
|
-
.filter((t) => !claimed.has(claimBranch(store.config, t.
|
|
264
|
+
.filter((t) => !claimed.has(claimBranch(store.config, t.key)));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* `task promote` — the human "build this" call, as a verb: `backlog` → `todo`.
|
|
268
|
+
* No quality gate: planning happens at claim time (the worker's plan tick),
|
|
269
|
+
* so a one-line backlog ticket is promotable. Blockers are claim-time facts
|
|
270
|
+
* that `claim`/`--claimable` already enforce live, so promoting a blocked
|
|
271
|
+
* ticket is legitimate sequencing ("build this once NIC-11 lands") — reported
|
|
272
|
+
* as a hold, never refused. Open asks aren't a hold at all: they don't gate
|
|
273
|
+
* claiming, only done. Writes the ticket like `update` does; committing is
|
|
274
|
+
* the caller's job.
|
|
275
|
+
*/
|
|
276
|
+
export function promote(store, key) {
|
|
277
|
+
const task = store.get(key);
|
|
278
|
+
const id = store.displayId(key);
|
|
279
|
+
if (!task)
|
|
280
|
+
throw new ClaimError(`no such task: ${id}`, "invalid");
|
|
281
|
+
if (task.status !== "backlog") {
|
|
282
|
+
throw new ClaimError(`${id} is ${task.status} — only backlog tickets can be promoted`, "invalid");
|
|
283
|
+
}
|
|
284
|
+
const updated = store.update(key, { status: "todo" });
|
|
285
|
+
const holds = [];
|
|
286
|
+
const blockers = openBlockers(store, updated);
|
|
287
|
+
if (blockers.length)
|
|
288
|
+
holds.push(`blocked by ${blockers.join(", ")}`);
|
|
289
|
+
return { task: updated, holds };
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The boards `claim --next` and `list --claimable` select over, in priority
|
|
293
|
+
* order. Resolution: an explicit `--board` list > the root board's top-level
|
|
294
|
+
* `boards` key > the nearest board alone. The list is *selection scope*, not
|
|
295
|
+
* permission — `task claim <id>` works on any board regardless — and it's
|
|
296
|
+
* read from the repo's root board only, so a vendored board can't opt itself
|
|
297
|
+
* into a repo's automation by shipping a config.
|
|
298
|
+
*/
|
|
299
|
+
export function selectionBoards(cwd, prefixes) {
|
|
300
|
+
const scope = findScopeRoot(cwd);
|
|
301
|
+
let wanted = prefixes?.length ? prefixes : undefined;
|
|
302
|
+
if (!wanted) {
|
|
303
|
+
try {
|
|
304
|
+
const boards = boardConfig(scope).boards;
|
|
305
|
+
if (Array.isArray(boards) && boards.length > 0)
|
|
306
|
+
wanted = boards.map(String);
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
// No readable root board — same answer as no boards list.
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (!wanted) {
|
|
313
|
+
const nearest = findRoot(cwd);
|
|
314
|
+
if (!nearest) {
|
|
315
|
+
throw new ClaimError("no .task directory found in this directory or any parent — run `task init` first", "invalid");
|
|
316
|
+
}
|
|
317
|
+
return [openBoard(nearest)];
|
|
318
|
+
}
|
|
319
|
+
return wanted.map((prefix) => {
|
|
320
|
+
const matches = findBoardsByPrefix(scope, prefix);
|
|
321
|
+
if (matches.length === 1)
|
|
322
|
+
return openBoard(matches[0].root);
|
|
323
|
+
throw new ClaimError(matches.length === 0
|
|
324
|
+
? `no board with prefix ${prefix.toUpperCase()} in this repo — check --board and the root board's "boards" list`
|
|
325
|
+
: `prefix ${prefix.toUpperCase()} is ambiguous — boards at: ${matches.map((m) => m.id).join(", ")}`, "invalid");
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* `task claim --next`: walk the selection scope in priority order and claim
|
|
330
|
+
* the first ticket that sticks. Losing a race for one ticket (another worker
|
|
331
|
+
* pushed its branch first) means *try the next*, so every ClaimError inside
|
|
332
|
+
* the loop is a skip — which is why the repo-level preconditions (dirty tree,
|
|
333
|
+
* malformed prefix, WIP cap) are asserted up front, where they still mean
|
|
334
|
+
* "stop and fix something" (exit 2) instead of draining the queue to a bogus
|
|
335
|
+
* "nothing claimable". Returns null when the queue really is empty (exit 1).
|
|
336
|
+
*/
|
|
337
|
+
export function claimNext(stores, options = {}) {
|
|
338
|
+
const first = stores[0];
|
|
339
|
+
const tree = git(first.root, "status", "--porcelain", "-uno");
|
|
340
|
+
if (tree.status !== 0) {
|
|
341
|
+
throw new ClaimError(`not a git repository: ${first.root}`, "invalid");
|
|
342
|
+
}
|
|
343
|
+
if (tree.stdout !== "") {
|
|
344
|
+
throw new ClaimError("working tree is dirty — commit or stash before claiming, the claim switches branches", "invalid");
|
|
345
|
+
}
|
|
346
|
+
for (const store of stores)
|
|
347
|
+
claimNamespace(store.config);
|
|
348
|
+
if (!options.force) {
|
|
349
|
+
const namespace = claimNamespace(first.config);
|
|
350
|
+
assertUnderCap(remoteClaims(first.root, namespace), first.root, namespace);
|
|
351
|
+
}
|
|
352
|
+
for (const store of stores) {
|
|
353
|
+
for (const task of claimableTasks(store)) {
|
|
354
|
+
try {
|
|
355
|
+
return claim(store, task.key, options);
|
|
356
|
+
}
|
|
357
|
+
catch (error) {
|
|
358
|
+
// Claimed out from under us, or changed since listing — next in line.
|
|
359
|
+
if (error instanceof ClaimError)
|
|
360
|
+
continue;
|
|
361
|
+
throw error;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return null;
|
|
236
366
|
}
|
|
237
367
|
//# sourceMappingURL=claim.js.map
|
package/dist/claim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|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C,OAAO,KAAK,EAAE,CAAC;gBACf,sEAAsE;gBACtE,IAAI,KAAK,YAAY,UAAU;oBAAE,SAAQ;gBACzC,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/claim.test.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* 1. Two concurrent `task claim <same-id>`: exactly one exits 0, the other
|
|
7
7
|
* exits 1 — git's atomic ref creation is the lock.
|
|
8
8
|
* 2. Validation failures exit 2 before anything touches git.
|
|
9
|
-
* 3. `task list --claimable` is the queue: position order, minus blocked
|
|
10
|
-
*
|
|
9
|
+
* 3. `task list --claimable` is the queue: position order, minus blocked
|
|
10
|
+
* and already-claimed tickets — open asks never exclude a ticket.
|
|
11
11
|
* 4. `task claim --release` deletes the branch both sides and the ticket is
|
|
12
12
|
* claimable again.
|
|
13
13
|
*/
|