Versions 40 to 318
new file, 630 lines
2+
8+
23+
30+
33+
35+ it("open, in progress, in review, blocked, done and dropped, and a dropped issue can be reopened", () => {
41+
46+
48+ const review = s.ask(builder, { issue: a, of: "security", question: "Is the cookie set right?", review: true });
52+ assert.ok(review.news.text.endsWith(`: "Is the cookie set right?" Answer: abso answer ${review.id} "..."`));
53+
54+ // A question that isn't a review blocks, and outranks the review; it can hold up other issues too.
64+ assert.equal(s.page(b).issue.status, "blocked", "an ask holds up the issues it names in blocks");
66+ assert.ok(q.news.text.endsWith('"Take abso.dev?"'), "a person answers elsewhere, so no command");
67+
69+ const answered = s.answer(christopher, q.id, { option: "Yes", note: "Renew it for two years." });
70+ assert.equal(answered.ask.answer?.words, "Yes\n\nRenew it for two years.", "kept in the person's own words");
75+
81+ assert.deepEqual(page.issue.closed, { how: "done", by: "builder3", version: 13, at: page.issue.closed!.at });
84+
104+
105+ it("a start note that ends without --done takes the claim back and leaves the issue open", () => {
116+
139+
141+ it("closes like an answer: off the waiting list, no longer blocking, kept with the note, and the one asked hears it", () => {
144+ const ask = s.ask(builder, { of: "person:u1", question: "A, B or C?", issue: id, options: ["A", "B", "C"] });
153+ assert.match(r.news.text, /^builder3 withdrew their question of person:u1 on issue \d+: "Overtaken/);
159+
160+ it("only the asker withdraws, only while unanswered, and once; then it can't be answered", () => {
163+ assert.throws(() => s.withdraw(christopher, ask.id, {}), /asked by builder3; only they can withdraw it/);
167+ assert.equal(r.news.text, "builder3 withdrew their question of person:u1", "no note, so nothing after it");
171+ (e: { status?: number; message: string }) => e.status === 409 && /withdrawn by builder3/.test(e.message),
175+ assert.throws(() => s.withdraw(builder, answered.id, {}), /answered already, so there's nothing to withdraw/);
179+
181+ it("stays open and blocking, shows the ack and its note, and the asker hears it; an answer closes it", () => {
191+ `person:u1 has your question (ask ${ask.id}) on issue ${id} and will answer: "after the review"`,
202+ assert.equal(again.news.text, `person:u1 has your question (ask ${ask.id}) on issue ${id} and will answer.`);
207+
213+ (e: { status?: number; message: string }) => e.status === 403 && /is for person:u1, not builder3/.test(e.message),
222+ (e: { status?: number; message: string }) => e.status === 409 && /answered already/.test(e.message),
228+ (e: { status?: number; message: string }) => e.status === 409 && /withdrawn by builder3/.test(e.message),
232+
258+ assert.deepEqual(waiting[1]!.recommendation, { text: "Yes, with avcs kept as an alias", by: "builder3" });
268+
272+ assert.throws(() => s.answer({ person: "u2" }, ask.id, { words: "A" }), /is for person:u1, not person:u2/);
284+
288+ assert.throws(() => s.open(builder, { title: "x".repeat(201) }), /201 characters; the most is 200/);
294+ assert.throws(() => s.ask(builder, { of: "x", question: "q", review: true }), /a review ask is on an issue/);
296+ assert.throws(() => s.ask(builder, { of: "x", question: "q", kind: "chore" }), /kind is "question", or "task"/);
299+
301+ const call = (s: IssuesStore, method: string, path: string, body?: unknown, headers: Record<string, string> = {}) =>
310+
311+ it("agents write under /a/:agent/, a write naming nobody is refused, and everyone reads", async () => {
313+ const opened = await call(s, "POST", "/p/web/a/builder3/issue", { title: "Sign-in", description: "d" });
316+ assert.equal((await call(s, "POST", "/p/web/a/fe/issue/1/comment", { text: "nice" })).status, 200);
317+ assert.equal((await call(s, "POST", "/p/web/issue/1/comment", { text: "who am I" })).status, 403);
319+ (await call(s, "POST", "/p/web/issue/1/comment", { text: "a person?" }, { "X-Avcs-User": "u1" })).status,
323+ const asked = await call(s, "POST", "/p/web/a/builder3/ask", { issue: 1, of: "fe", question: "OK?" });
325+ assert.equal((await call(s, "POST", `/p/web/a/fe/answer/${asked.json.id}`, { words: "OK" })).status, 200);
326+
343+
360+ assert.equal(moved.news!.text, 'person:u1 edited issue 2 ("Sign-in flow"): title was "Sign-in"; parent is issue 1');
372+ more.notified.includes("person:u2") && more.notified.includes("web") && !more.notified.includes("builder3"),
375+ assert.throws(() => s.edit(builder, b.id, { agent: "web" }), /that changes nothing on issue 2/);
379+
386+ assert.throws(() => s.edit(builder, a, { blockedBy: [b] }), /issue 2 already waits on issue 1/);
396+
409+
410+ it("drafts are their writer's alone, have no number, make no news, and open as issues", () => {
428+ assert.throws(() => s.openDraft(christopher, s.drafts(christopher)[0]!.id), /the title is missing/);
430+
438+ assert.throws(() => s.open(builder, { title: "x", description: "a\u202Eb" }), /bidirectional/);
444+
447+ const call = (method: string, path: string, body?: unknown, headers: Record<string, string> = {}) =>
465+ assert.equal((await call("GET", "/p/web/a/lead/drafts", undefined)).json.drafts[0].body.title, "Later");
470+ assert.equal((await call("POST", `/p/web/a/lead/draft/${saved.json.id}/open`, {})).json.id, 2);
474+
476+ it("one write past the per-minute limit gets 429 with Retry-After; another writer isn't affected", async () => {
500+ assert.equal((await call("/p/web/issue/1/comment", { text: "a minute on" }, "u1")).status, 200);
503+
507+ const a = s.open(builder, { title: "Sync is slow", labels: ["friction", "client", "friction"] }).id;
508+ const b = s.open(builder, { title: "Blame past a reformat", labels: ["friction", "engine"] }).id;
520+ const quiet = s.edit(christopher, a, { addLabels: ["good-first-issue"], removeLabels: ["client"] });
545+ assert.throws(() => s.open(builder, { title: "x", labels: ["x".repeat(41)] }), /isn't a label/);
549+
552+ const call = (method: string, path: string, body?: unknown, headers: Record<string, string> = {}) =>
568+ assert.equal((await call("GET", "/p/web/issues?label=friction&label=client")).json.issues.length, 1);
578+ assert.deepEqual((await call("GET", `/p/web/issue/${opened.json.id}`)).json.issue.labels, ["friction"]);
581+
587+ ids.push(s.open(builder, { title: `t${i}`, labels: Array.from({ length: 20 }, (_, j) => `l${i * 20 + j}`) }).id);
597+ assert.equal(s.edit(builder, ids[1]!, { addLabels: ["l0"], removeLabels: ["l20"] }).notified.length, 0);
600+
604+
605+ it("an agent's own waiting marks what it lists as seen, and says null for what it saw first just now", async () => {
610+ assert.deepEqual(await read("/p/abso/waiting?of=security"), [{ ...s.waiting("security")[0]!, seen: null }]);
611+ assert.equal(s.waiting("security")[0]!.seen, null, "a read of someone else's list marks nothing");
621+
- MCP
- compare on this site's /mcp
- CLI
- abso diff 40 318 server/test/issues/issues.test.ts --json
- JSON
- /christopher/abso-core/compare/40..318?file=server%2Ftest%2Fissues%2Fissues.test.ts&format=json