@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.
Files changed (128) hide show
  1. package/README.md +73 -25
  2. package/dist/asks.test.d.ts +17 -0
  3. package/dist/asks.test.d.ts.map +1 -0
  4. package/dist/asks.test.js +278 -0
  5. package/dist/asks.test.js.map +1 -0
  6. package/dist/check.d.ts +43 -0
  7. package/dist/check.d.ts.map +1 -0
  8. package/dist/check.js +403 -0
  9. package/dist/check.js.map +1 -0
  10. package/dist/check.test.d.ts +9 -0
  11. package/dist/check.test.d.ts.map +1 -0
  12. package/dist/check.test.js +248 -0
  13. package/dist/check.test.js.map +1 -0
  14. package/dist/claim-io.d.ts +73 -0
  15. package/dist/claim-io.d.ts.map +1 -0
  16. package/dist/claim-io.js +344 -0
  17. package/dist/claim-io.js.map +1 -0
  18. package/dist/claim.d.ts +61 -9
  19. package/dist/claim.d.ts.map +1 -1
  20. package/dist/claim.js +197 -67
  21. package/dist/claim.js.map +1 -1
  22. package/dist/claim.test.d.ts +2 -2
  23. package/dist/claim.test.js +235 -64
  24. package/dist/claim.test.js.map +1 -1
  25. package/dist/cli.js +724 -136
  26. package/dist/cli.js.map +1 -1
  27. package/dist/file-store.d.ts +110 -38
  28. package/dist/file-store.d.ts.map +1 -1
  29. package/dist/file-store.js +514 -238
  30. package/dist/file-store.js.map +1 -1
  31. package/dist/git-serve.d.ts +183 -0
  32. package/dist/git-serve.d.ts.map +1 -0
  33. package/dist/git-serve.js +503 -0
  34. package/dist/git-serve.js.map +1 -0
  35. package/dist/git-serve.test.d.ts +16 -0
  36. package/dist/git-serve.test.d.ts.map +1 -0
  37. package/dist/git-serve.test.js +183 -0
  38. package/dist/git-serve.test.js.map +1 -0
  39. package/dist/git.d.ts +65 -0
  40. package/dist/git.d.ts.map +1 -0
  41. package/dist/git.js +114 -0
  42. package/dist/git.js.map +1 -0
  43. package/dist/id.d.ts +39 -0
  44. package/dist/id.d.ts.map +1 -0
  45. package/dist/id.js +67 -0
  46. package/dist/id.js.map +1 -0
  47. package/dist/inbox.d.ts +41 -0
  48. package/dist/inbox.d.ts.map +1 -0
  49. package/dist/inbox.js +56 -0
  50. package/dist/inbox.js.map +1 -0
  51. package/dist/index.d.ts +5 -3
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +5 -3
  54. package/dist/index.js.map +1 -1
  55. package/dist/overview.d.ts +52 -0
  56. package/dist/overview.d.ts.map +1 -0
  57. package/dist/overview.js +61 -0
  58. package/dist/overview.js.map +1 -0
  59. package/dist/overview.test.d.ts +8 -0
  60. package/dist/overview.test.d.ts.map +1 -0
  61. package/dist/overview.test.js +48 -0
  62. package/dist/overview.test.js.map +1 -0
  63. package/dist/promote.test.d.ts +15 -0
  64. package/dist/promote.test.d.ts.map +1 -0
  65. package/dist/promote.test.js +104 -0
  66. package/dist/promote.test.js.map +1 -0
  67. package/dist/publish.d.ts +2 -17
  68. package/dist/publish.d.ts.map +1 -1
  69. package/dist/publish.js +4 -49
  70. package/dist/publish.js.map +1 -1
  71. package/dist/search.d.ts +34 -0
  72. package/dist/search.d.ts.map +1 -0
  73. package/dist/search.js +79 -0
  74. package/dist/search.js.map +1 -0
  75. package/dist/search.test.d.ts +2 -0
  76. package/dist/search.test.d.ts.map +1 -0
  77. package/dist/search.test.js +53 -0
  78. package/dist/search.test.js.map +1 -0
  79. package/dist/server.d.ts.map +1 -1
  80. package/dist/server.js +228 -23
  81. package/dist/server.js.map +1 -1
  82. package/dist/store.d.ts +43 -63
  83. package/dist/store.d.ts.map +1 -1
  84. package/dist/store.js +0 -368
  85. package/dist/store.js.map +1 -1
  86. package/dist/store.test.d.ts +1 -2
  87. package/dist/store.test.d.ts.map +1 -1
  88. package/dist/store.test.js +148 -106
  89. package/dist/store.test.js.map +1 -1
  90. package/dist/ticket-doc.d.ts +74 -5
  91. package/dist/ticket-doc.d.ts.map +1 -1
  92. package/dist/ticket-doc.js +229 -15
  93. package/dist/ticket-doc.js.map +1 -1
  94. package/dist/types.d.ts +115 -28
  95. package/dist/types.d.ts.map +1 -1
  96. package/dist/types.js.map +1 -1
  97. package/package.json +1 -1
  98. package/skill/SKILL.md +153 -40
  99. package/src/asks.test.ts +355 -0
  100. package/src/check.test.ts +328 -0
  101. package/src/check.ts +497 -0
  102. package/src/claim-io.ts +401 -0
  103. package/src/claim.test.ts +301 -71
  104. package/src/claim.ts +238 -81
  105. package/src/cli.ts +740 -131
  106. package/src/file-store.ts +572 -254
  107. package/src/git-serve.test.ts +240 -0
  108. package/src/git-serve.ts +595 -0
  109. package/src/git.ts +141 -0
  110. package/src/id.ts +68 -0
  111. package/src/inbox.ts +77 -0
  112. package/src/index.ts +4 -2
  113. package/src/overview.test.ts +52 -0
  114. package/src/overview.ts +105 -0
  115. package/src/promote.test.ts +143 -0
  116. package/src/publish.ts +6 -53
  117. package/src/search.test.ts +64 -0
  118. package/src/search.ts +105 -0
  119. package/src/server.ts +232 -21
  120. package/src/store.test.ts +166 -116
  121. package/src/store.ts +46 -444
  122. package/src/ticket-doc.ts +284 -21
  123. package/src/types.ts +120 -28
  124. package/ui/dist/assets/index-BjsorZOU.js +229 -0
  125. package/ui/dist/assets/index-CoKCUYic.css +1 -0
  126. package/ui/dist/index.html +2 -2
  127. package/ui/dist/assets/index-COunM-QN.css +0 -1
  128. package/ui/dist/assets/index-D4homvrQ.js +0 -229
@@ -0,0 +1,248 @@
1
+ /**
2
+ * `task check` exists for the write paths the CLI never sees — git merges and
3
+ * hand-edits — so its tests are those: files written slightly wrong, links
4
+ * whose target one branch deleted, tickets a merge duplicated into the board
5
+ * *and* the archive. Plus the sharp edge fixed alongside it: unknown
6
+ * frontmatter keys now survive a rewrite instead of being dropped.
7
+ */
8
+ import assert from "node:assert/strict";
9
+ import { test } from "node:test";
10
+ import { mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
11
+ import { tmpdir } from "node:os";
12
+ import { join } from "node:path";
13
+ import { checkBoards } from "./check.js";
14
+ import { initProject } from "./file-store.js";
15
+ import { parseTicket, serializeTicket } from "./ticket-doc.js";
16
+ function tempRoot() {
17
+ const dir = mkdtempSync(join(tmpdir(), "task-check-"));
18
+ process.on("exit", () => rmSync(dir, { recursive: true, force: true }));
19
+ return dir;
20
+ }
21
+ test("a board the CLI wrote is clean", () => {
22
+ const root = tempRoot();
23
+ const store = initProject(root, { name: "clean", prefix: "CLN" });
24
+ store.createGoal({ title: "Ship it", description: "the why" });
25
+ const a = store.create({ title: "First", description: "with a body", goal: "ship-it" });
26
+ const b = store.create({ title: "Second", status: "backlog", tags: ["x"] });
27
+ store.link(b.key, "blocked_by", a.key);
28
+ store.addComment(a.key, "hello", "claude");
29
+ store.update(a.key, { status: "done" });
30
+ store.archive(a.key);
31
+ const result = checkBoards(root, false);
32
+ assert.deepEqual(result.issues, []);
33
+ assert.equal(result.boards, 1);
34
+ assert.equal(result.files, 4); // two tickets + one comment + one goal
35
+ });
36
+ test("ask files are linted like comments; the retired flag reads as an unknown key", () => {
37
+ const root = tempRoot();
38
+ const store = initProject(root, { name: "owed", prefix: "OWE" });
39
+ const t = store.create({ title: "Owes things", status: "in_progress" });
40
+ store.addAsk(t.key, "Mint the token", "claude");
41
+ assert.deepEqual(checkBoards(root, false).issues, [], "a CLI-written ask is clean");
42
+ const asksDir = join(root, ".task", "tickets", t.key, "asks");
43
+ // Hand-edit shapes: an ask that says nothing, a resolution that isn't a
44
+ // timestamp, a key nothing reads, and mere drift (unquoted author).
45
+ writeFileSync(join(asksDir, "z-empty.md"), '---\nauthor: "x"\ncreated: 2026-08-27T00:00:00.000Z\n---\n\n\n');
46
+ writeFileSync(join(asksDir, "z-bad.md"), '---\nauthor: "x"\ncreated: 2026-08-27T00:00:00.000Z\nresolved: yesterday-ish\nurgency: high\n---\n\nDo the thing\n');
47
+ const found = checkBoards(root, false);
48
+ const messages = found.issues.map((issue) => issue.message);
49
+ assert.ok(messages.some((m) => /empty ask/.test(m)), "empty ask reported");
50
+ assert.ok(messages.some((m) => /resolved is not a valid timestamp/.test(m)), "bad resolution reported");
51
+ assert.ok(messages.some((m) => /unknown frontmatter key "urgency"/.test(m)), "unknown key reported");
52
+ // The retired pre-0.8 boolean isn't a field anymore — a file still carrying
53
+ // it (deep history, an ancient branch) reads as an unknown key: flagged,
54
+ // preserved through rewrites, never interpreted.
55
+ const ticketPath = join(root, ".task", "tickets", t.key, "ticket.md");
56
+ writeFileSync(ticketPath, readFileSync(ticketPath, "utf8").replace("status: in_progress", "status: in_progress\nneeds_human: true"));
57
+ const flagged = checkBoards(root, true);
58
+ const unknown = flagged.issues.find((issue) => /unknown frontmatter key "needs_human"/.test(issue.message));
59
+ assert.ok(unknown, "retired key flagged as unknown");
60
+ assert.match(readFileSync(ticketPath, "utf8"), /needs_human: true/);
61
+ });
62
+ test("finds what merges and hand-edits leave behind, and --fix repairs the mechanical part", () => {
63
+ const root = tempRoot();
64
+ const store = initProject(root, { name: "rough", prefix: "RGH" });
65
+ const a = store.create({ title: "Kept", status: "todo" });
66
+ const b = store.create({ title: "Points at a ghost", status: "todo" });
67
+ const c = store.create({ title: "Broken later", status: "todo" });
68
+ // A dangling reference: link b to a ticket, then lose the ticket the way a
69
+ // merge would — the directory vanishes without the store's delete cascade.
70
+ store.link(b.key, "blocked_by", a.key);
71
+ const ticketPath = (key) => join(root, ".task", "tickets", key, "ticket.md");
72
+ const bText = readFileSync(ticketPath(b.key), "utf8");
73
+ writeFileSync(ticketPath(b.key), bText.replace(`blocked_by: ["${a.key}"]`, `blocked_by: ["${a.key}", "zz9zz", "zz9zz"]`));
74
+ // A hand-edit that still parses but isn't canonical (bare goal string).
75
+ store.createGoal({ title: "Launch" });
76
+ const cText = readFileSync(ticketPath(c.key), "utf8");
77
+ writeFileSync(ticketPath(c.key), cText.replace("status: todo", "status: todo\ngoal: launch"));
78
+ // A file that doesn't parse at all, in a well-formed key directory.
79
+ mkdirSync(join(root, ".task", "tickets", "zzz9x"));
80
+ writeFileSync(ticketPath("zzz9x"), "---\nstatus: todoo\nposition: 0\ncreated: x\nupdated: x\n---\n\n# Bad status\n");
81
+ const found = checkBoards(root, false);
82
+ const messages = found.issues.map((issue) => issue.message);
83
+ assert.ok(messages.some((m) => /RGH-zz9zz, which doesn't exist/.test(m)), "dangling ref reported");
84
+ assert.ok(messages.some((m) => /not in canonical form/.test(m)), "drift reported");
85
+ assert.ok(messages.some((m) => /invalid status "todoo"/.test(m)), "parse error reported");
86
+ assert.ok(messages.some((m) => /not a valid timestamp/.test(m)) === false, "unparseable file isn't double-reported");
87
+ const fixed = checkBoards(root, true);
88
+ assert.ok(fixed.fixed.length >= 2, "fix rewrote the repairable files");
89
+ // The dangling ref is pruned, the real one kept; the drift is normalized.
90
+ assert.ok(readFileSync(ticketPath(b.key), "utf8").includes(`blocked_by: ["${a.key}"]\n`));
91
+ assert.match(readFileSync(ticketPath(c.key), "utf8"), /goal: "launch"/);
92
+ // What remains is exactly what needs a human: the unparseable file.
93
+ const after = checkBoards(root, false);
94
+ assert.deepEqual(after.issues.filter((issue) => issue.fixable), []);
95
+ assert.equal(after.issues.length, 1);
96
+ assert.match(after.issues[0].message, /invalid status/);
97
+ });
98
+ test("merge artifacts across the archive are reported, never auto-fixed", () => {
99
+ const root = tempRoot();
100
+ const store = initProject(root, { name: "dup", prefix: "DUP" });
101
+ const t = store.create({ title: "Archived on one branch" });
102
+ store.update(t.key, { status: "done" });
103
+ store.archive(t.key);
104
+ // The other branch kept editing it — the merge keeps both directories.
105
+ mkdirSync(join(root, ".task", "tickets", t.key), { recursive: true });
106
+ writeFileSync(join(root, ".task", "tickets", t.key, "ticket.md"), readFileSync(join(root, ".task", "archive", t.key, "ticket.md")));
107
+ const result = checkBoards(root, true);
108
+ assert.ok(result.issues.some((issue) => /also exists in tickets\//.test(issue.message)));
109
+ assert.deepEqual(result.fixed, []);
110
+ });
111
+ test("a ticket parked in the archive while still open is flagged", () => {
112
+ const root = tempRoot();
113
+ const store = initProject(root, { name: "arc", prefix: "ARC" });
114
+ const t = store.create({ title: "Half archived", status: "todo" });
115
+ renameSync(join(root, ".task", "tickets", t.key), (mkdirSync(join(root, ".task", "archive"), { recursive: true }),
116
+ join(root, ".task", "archive", t.key)));
117
+ const result = checkBoards(root, false);
118
+ assert.ok(result.issues.some((issue) => /archived but still todo/.test(issue.message)));
119
+ });
120
+ test("unknown frontmatter keys are reported — and survive a rewrite round-trip", () => {
121
+ const root = tempRoot();
122
+ const store = initProject(root, { name: "extra", prefix: "EXT" });
123
+ const t = store.create({ title: "Carries a custom field", status: "todo" });
124
+ const path = join(root, ".task", "tickets", t.key, "ticket.md");
125
+ writeFileSync(path, readFileSync(path, "utf8").replace("status: todo", 'status: todo\nowner: "nick"'));
126
+ const result = checkBoards(root, false);
127
+ assert.ok(result.issues.some((issue) => /unknown frontmatter key "owner"/.test(issue.message)));
128
+ // The sharp edge this fixed: an ordinary update used to drop the key.
129
+ store.update(t.key, { title: "Renamed" });
130
+ const text = readFileSync(path, "utf8");
131
+ assert.match(text, /owner: "nick"/);
132
+ assert.match(text, /# Renamed/);
133
+ // And the parse carries it explicitly.
134
+ assert.deepEqual(parseTicket(text, "test").extras, [["owner", '"nick"']]);
135
+ // Round-trip is bytes-stable, so check won't flag the rewritten file.
136
+ assert.equal(serializeTicket(parseTicket(text, "test")), text);
137
+ assert.deepEqual(checkBoards(root, false).issues.map((issue) => issue.message), [
138
+ 'unknown frontmatter key "owner" — preserved on rewrite, but nothing reads it',
139
+ ]);
140
+ });
141
+ test("the pre-0.8 milestone key is refused by name — no migration machinery", () => {
142
+ const root = tempRoot();
143
+ const store = initProject(root, { name: "old", prefix: "OLD" });
144
+ const t = store.create({ title: "From an old board", status: "todo" });
145
+ const path = join(root, ".task", "tickets", t.key, "ticket.md");
146
+ writeFileSync(path, readFileSync(path, "utf8").replace("status: todo", 'status: todo\nmilestone: "launch"'));
147
+ // The strict parse refuses the retired spelling with the rename in the
148
+ // error; check surfaces exactly that, unfixable, and --fix leaves the file
149
+ // alone — renaming the key is the human's one edit.
150
+ const found = checkBoards(root, true);
151
+ const refusal = found.issues.find((issue) => /`milestone:` is the pre-0\.8 spelling.*rename the key to `goal:`/.test(issue.message));
152
+ assert.ok(refusal, "retired spelling refused by name");
153
+ assert.equal(refusal.fixable, false);
154
+ assert.match(readFileSync(path, "utf8"), /milestone: "launch"/);
155
+ writeFileSync(path, readFileSync(path, "utf8").replace('milestone: "launch"', 'goal: "launch"'));
156
+ store.createGoal({ title: "Launch" });
157
+ checkBoards(root, true);
158
+ assert.deepEqual(checkBoards(root, false).issues, []);
159
+ });
160
+ test("goal files are linted, and drift in them is fixable", () => {
161
+ const root = tempRoot();
162
+ const store = initProject(root, { name: "gol", prefix: "GOL" });
163
+ store.createGoal({ title: "Tidy", description: "fine" });
164
+ // A hand-dropped goal: parseable, bad timestamp, non-canonical spacing, and
165
+ // a slug the CLI would never mint.
166
+ writeFileSync(join(root, ".task", "goals", "Bad Slug.md"), "---\ncreated: not-a-date\nupdated: 2026-08-15T17:00:00.000Z\n---\n# Handmade\n\nbody\n");
167
+ const result = checkBoards(root, false);
168
+ const messages = result.issues.map((issue) => issue.message);
169
+ assert.ok(messages.some((m) => /not a valid goal slug/.test(m)));
170
+ assert.ok(messages.some((m) => /created is not a valid timestamp/.test(m)));
171
+ assert.ok(result.issues.some((issue) => issue.fixable), "spacing drift is fixable");
172
+ checkBoards(root, true);
173
+ assert.match(readFileSync(join(root, ".task", "goals", "Bad Slug.md"), "utf8"), /---\n\n# Handmade/);
174
+ });
175
+ test("comment files are linted too", () => {
176
+ const root = tempRoot();
177
+ const store = initProject(root, { name: "com", prefix: "COM" });
178
+ const t = store.create({ title: "Talked about" });
179
+ store.addComment(t.key, "fine", "claude");
180
+ const dir = join(root, ".task", "tickets", t.key, "comments");
181
+ // A hand-dropped comment: parseable, wrong created, non-canonical spacing.
182
+ writeFileSync(join(dir, "2026-08-15T170000-other.md"), '---\nauthor: "other"\ncreated: not-a-date\n---\nbody\n');
183
+ const result = checkBoards(root, false);
184
+ assert.ok(result.issues.some((issue) => /created is not a valid timestamp/.test(issue.message)));
185
+ });
186
+ test("config lints: retired claimPrefix refuses, boards is root-only, prefixes must agree", () => {
187
+ const root = tempRoot();
188
+ initProject(root, { name: "cfg", prefix: "CFG" });
189
+ const rootConfig = join(root, ".task", "config.json");
190
+ const raw = JSON.parse(readFileSync(rootConfig, "utf8"));
191
+ raw.claimPrefix = "claude/task/";
192
+ raw.boards = ["CFG", "SUB"];
193
+ writeFileSync(rootConfig, `${JSON.stringify(raw, null, 2)}\n`);
194
+ // A nested board that disagrees on the namespace and carries its own
195
+ // boards list — both are repo-level decisions the root board owns.
196
+ mkdirSync(join(root, "pkg"), { recursive: true });
197
+ initProject(join(root, "pkg"), { name: "sub", prefix: "SUB" });
198
+ const subConfig = join(root, "pkg", ".task", "config.json");
199
+ const subRaw = JSON.parse(readFileSync(subConfig, "utf8"));
200
+ subRaw.boards = ["SUB"];
201
+ subRaw.claims = { branchPrefix: "task/claim/" };
202
+ writeFileSync(subConfig, `${JSON.stringify(subRaw, null, 2)}\n`);
203
+ // The retired key with no claims.branchPrefix beside it: claimNamespace
204
+ // refuses by name, check surfaces that refusal, and --fix touches nothing —
205
+ // renaming the key is the human's one edit. The root's namespace being
206
+ // unreadable also means the sub-board mismatch lint has no reference to
207
+ // compare against; the root-only boards lint still fires.
208
+ const found = checkBoards(root, true);
209
+ const messages = found.issues.map((issue) => issue.message);
210
+ assert.ok(messages.some((m) => /`claimPrefix` in \.task\/config\.json is the pre-0\.8 spelling/.test(m)));
211
+ assert.ok(messages.some((m) => /"boards" is root-only/.test(m)));
212
+ assert.ok(found.issues.every((issue) => !issue.fixable || !/claimPrefix/.test(issue.message)));
213
+ const untouched = JSON.parse(readFileSync(rootConfig, "utf8"));
214
+ assert.equal(untouched.claimPrefix, "claude/task/");
215
+ });
216
+ test("a stray claimPrefix beside claims.branchPrefix is inert and flagged", () => {
217
+ const root = tempRoot();
218
+ initProject(root, { name: "dup", prefix: "DUP" });
219
+ const configPath = join(root, ".task", "config.json");
220
+ const raw = JSON.parse(readFileSync(configPath, "utf8"));
221
+ raw.claimPrefix = "old/ns/";
222
+ raw.claims = { branchPrefix: "new/ns/", maxOpenCount: 2 };
223
+ writeFileSync(configPath, `${JSON.stringify(raw, null, 2)}\n`);
224
+ const messages = checkBoards(root, false).issues.map((issue) => issue.message);
225
+ assert.ok(messages.some((m) => /`claims\.branchPrefix` wins; delete the leftover key/.test(m)));
226
+ });
227
+ test("numeric ticket dirs are called out as pre-TAS-42 — junk entries separately", () => {
228
+ const root = tempRoot();
229
+ const store = initProject(root, { name: "mig", prefix: "MIG" });
230
+ store.create({ title: "A modern ticket", status: "todo" });
231
+ // A pre-migration ticket, imported by merging a branch cut before the id
232
+ // cutover: numeric directory, numeric blocked_by.
233
+ mkdirSync(join(root, ".task", "tickets", "42"), { recursive: true });
234
+ writeFileSync(join(root, ".task", "tickets", "42", "ticket.md"), "---\nstatus: todo\nposition: 0\ncreated: 2026-08-15T16:00:33.758Z\nupdated: 2026-08-15T16:00:33.758Z\n---\n\n# Old-format ticket\n");
235
+ // And something that was never a ticket directory at all.
236
+ mkdirSync(join(root, ".task", "tickets", "Not A Key"), { recursive: true });
237
+ const messages = checkBoards(root, false).issues.map((issue) => issue.message);
238
+ assert.ok(messages.some((m) => /numeric ticket directory — the pre-TAS-42 sequential-id format/.test(m)), "pre-migration dir named with the migration fix");
239
+ assert.ok(messages.some((m) => /ticket directories are named by their key/.test(m)), "junk entry reported as unexpected");
240
+ // A modern file whose blocked_by still carries numbers is refused by the
241
+ // strict parser with the migration named — surfaced through check.
242
+ const modern = store.create({ title: "Bad link format", status: "todo" });
243
+ const path = join(root, ".task", "tickets", modern.key, "ticket.md");
244
+ writeFileSync(path, readFileSync(path, "utf8").replace("status: todo", "status: todo\nblocked_by: [7]"));
245
+ const after = checkBoards(root, false).issues.map((issue) => issue.message);
246
+ assert.ok(after.some((m) => /pre-TAS-42 id format, which is no longer read/.test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IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACvF,CAAC,CAAC,CAAA"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Ask I/O against claim branches (TAS-38, second round): a claimed ticket's
3
+ * truth lives on its claim branch, so ask *writes* on a claimed ticket go to
4
+ * the branch too — resolve, reopen, add, delete — as real commits, made and
5
+ * pushed without ever touching the checkout. The owner clicks a checkbox on
6
+ * main's board; the commit lands on `claude/task/tas-40`; the worker's next
7
+ * tick pulls it and sees the answer in the one place it was ever going to
8
+ * look. No parallel copies, no merge collision, no relay through comments.
9
+ *
10
+ * The mechanics are plain git plumbing: build the new tree in a temporary
11
+ * index (`read-tree` → `update-index` → `write-tree`), commit it with the
12
+ * branch tip as parent, and push fast-forward. A concurrent worker push just
13
+ * rejects ours; we refetch and reapply once against the new tip — the
14
+ * mutation is expressed as a function of the file's current bytes, so a
15
+ * retry can notice the work is already done and quietly stand down.
16
+ *
17
+ * Reads (the inbox's view of a claimed ticket) live here too, so reading and
18
+ * writing can never disagree about where an ask file is.
19
+ */
20
+ import type { Store } from "./store.ts";
21
+ import type { Ask, Task } from "./types.ts";
22
+ /**
23
+ * Every claim branch on origin right now, with its tip sha — one bounded
24
+ * `ls-remote`, the single unavoidable network call behind live claim status.
25
+ * Null means "origin can't be asked" (offline, no remote, auth would have
26
+ * prompted), which every caller treats as "act on file truth". This is the
27
+ * read-path twin of claim.ts's `remoteClaims`, deliberately separate: reads
28
+ * must never prompt for credentials — this runs inside `task serve` request
29
+ * handlers — while `task claim` itself may legitimately ask a human to log in.
30
+ */
31
+ export declare function remoteClaimTips(store: Store): Map<string, string> | null;
32
+ /**
33
+ * Make the local remote-tracking claim refs agree with the tips `ls-remote`
34
+ * just reported — fetching *only the branches that moved* (the tip sha says
35
+ * whether anything changed, so an unchanged claim costs no fetch at all) and
36
+ * deleting local refs for claims origin no longer has, so a released claim
37
+ * can't linger as a ghost. This is what keeps the inbox cheap under the UI's
38
+ * refetch-on-every-change behavior: steady state is one ls-remote and zero
39
+ * fetches.
40
+ */
41
+ export declare function syncClaimRefs(store: Store, namespace: string, tips: Map<string, string>): void;
42
+ /**
43
+ * The ticket's claim branch if one exists on origin right now, else null —
44
+ * null also for "origin unreachable". Syncs the local claim refs as a side
45
+ * effect when a claim is found, so subsequent branch reads see the tip the
46
+ * answer was based on.
47
+ */
48
+ export declare function claimFor(store: Store, key: string): string | null;
49
+ /** True when this checkout *is* the claim branch — then local writes are branch writes. */
50
+ export declare function onClaimBranch(store: Store, branch: string): boolean;
51
+ /**
52
+ * The ask files of one ticket as its claim branch has them, leniently — the
53
+ * branch's bytes were written by another checkout and possibly an older CLI.
54
+ * Any git failure (ref gone between fetch and read, no asks dir) reads as
55
+ * "no asks on the branch", never an error.
56
+ */
57
+ export declare function branchAsks(store: Store, branch: string, key: string): Omit<Ask, "ordinal">[];
58
+ /**
59
+ * Local and branch asks, unioned by id with the branch winning — the branch
60
+ * holds the claim, so its version of a shared ask is the fresher one — then
61
+ * re-ordinaled over the union. These are the ordinals the inbox prints and
62
+ * the ones a resolve against a claimed ticket accepts.
63
+ */
64
+ export declare function mergedAsks(store: Store, branch: string, task: Task): Ask[];
65
+ /** How a routed write happened — `branch` set when it landed as a pushed commit. */
66
+ export interface RoutedAsk {
67
+ ask: Ask;
68
+ branch: string | null;
69
+ }
70
+ export declare function addAskRouted(store: Store, key: string, text: string, author?: string): RoutedAsk;
71
+ export declare function setAskResolvedRouted(store: Store, key: string, ref: string, resolved: boolean, resolvedBy?: string): RoutedAsk;
72
+ export declare function deleteAskRouted(store: Store, key: string, ref: string): RoutedAsk;
73
+ //# sourceMappingURL=claim-io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim-io.d.ts","sourceRoot":"","sources":["../src/claim-io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,GAAG,EA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