Public: anyone can read this; the crew can change it.

An issue held behind the Later gate can be snoozed until a date #13138

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/13113-an-issue-held-behind-the-later-gate-can → main 9 commits fork 5 threads · 5 unresolved

  • Merged. mason/13113-an-issue-held-behind-the-later-gate-can was merged into main as e1ecd23.

Review

Sign in to review this change.
16 files changed +472 −47
docs/MCP.md +1 −1
@@ -145,7 +145,7 @@ bytes in `tools/list`. After changing a tool run `bun scripts/mcp-table.ts`;
145145 | `knobs` | — | The crew's five knobs and what each does now | 307 |
146146 | `labels` | `set`, `add`, `remove` | Set an issue's or pull's labels to exactly these (none clears) | 365 |
147147 | `land_past_gate` | — | Land one pull past a broken gate, with a recorded reason; an owner's only | 321 |
148 | `lift` | — | Lift an issue out from behind the Later gate | 214 |
148 | `lift` | — | Lift an issue out from behind the Later gate | 240 |
149149 | `limb` | `defer`, `resume`, `close`, `raise`, `lower`, `replan`, `takeback`, `undo` | Act on a limb by `action` | 532 |
150150 | `limits` | — | Every limit the owner can hit | 1101 |
151151 | `maintenance` | `status`, `prepare`, `resume`, `pause-duty`, `resume-duty` | Prepare the forge for a power-off, check the drain, or end maintenance (admin) | 308 |
docs/features/later-gate.md +1 −1
@@ -9,7 +9,7 @@ The Later gate (`Later gate: …`, read by `core/pillars.ts`) holds work back fr
99 - **Closed ones stay findable.** The apply writes the `issue.gate_reviewed` event after each close, and a comment note beside it. The event, not the note, is the marker (`closedByReview`): it is the review's only while it is newer than the issue's last close and reopen, and a comment cannot forge it. Each is listed under "Closed by the review" on the held page and shows **Revive** at its top. Revive (the same `lift` action) lets it out from behind the gate and reopens it as one outcome: the hold is checked first, and a reopen that fails puts the hold back.
1010 - **The terminal** has the same page: `h` on a repository's issues, or "Held by the Later gate" in the palette (`tui/screens/held.ts`). `space` ticks (a keep row shows `[-]` and has no tick), `A` applies the ticked (close or merge), `l` lifts or revives. It reads and acts through the same functions, so a reader is refused in the same words and a private repository is not found; the web hears each write as the close, reopen and unblock events it already follows.
1111
12 Not done: snoozing an issue until a date or until new activity.
12 - **Lift until a date** (#13113): the held page (a date field beside Lift), the terminal (`u`) and the MCP `lift` (`until`, `YYYY-MM-DD`) lift the issue and have the gate take it back at the start of that day, UTC (`actions/gate_snooze.ts`, run each minute by `engine/duties.ts`). The day must be after today; anything else is refused with one sentence and nothing moves. `issue.snoozed` and `issue.snooze_ended` are recorded. A plain lift clears the snooze. Not done: snoozing until new activity.
1313
1414 ## The pass proposes keep and merge too (#8813)
1515
src/actions/gate.ts +23 −3
@@ -15,6 +15,7 @@ import { servePillar } from "../core/pillar_pick.ts";
1515 import type { Repo } from "../core/repos.ts";
1616 import type { User } from "../core/users.ts";
1717 import { err, ok, type Result } from "../kernel/result.ts";
18 import { clearSnooze, parseUntil, setSnooze } from "../core/gate_snooze.ts";
1819 import { isMirror } from "../origins/write-through.ts";
1920 import type { DependencyError } from "../core/dependencies.ts";
2021 import type { AccessError } from "./access.ts";
@@ -50,20 +51,39 @@ export function stopWaiting(
5051 * part of it: an idea that matters comes back with one tap. The hold is
5152 * checked first, and a reopen that fails puts the hold back, so the answer
5253 * is the whole outcome. One action, the same for a person and an agent;
53 * whoever may link may lift.
54 * whoever may link may lift. With `until` (a day, `YYYY-MM-DD`) the lift is
55 * a snooze: the gate takes the issue back on that day (`actions/gate_snooze.ts`),
56 * and the day is checked before anything moves; a revive has no day, and one given is refused.
5457 */
5558 export function liftHold(
5659 app: App,
5760 actor: User | undefined,
5861 repo: Repo,
5962 issue: Issue,
60 ): Result<Issue, AccessError | "not_held"> {
63 until?: string,
64 now: Date = new Date(),
65 ): Result<Issue, AccessError | "not_held" | "bad_date" | "revive_until"> {
66 const day = until === undefined || until === "" ? undefined : parseUntil(until, now);

until is validated, but on the revive path (line 68 onward) it is dropped without a word. Refuse it there or support it; callers claim a snooze happened.

67 if (day !== undefined && !day.ok) return day;
6168 const revive = closedByReview(app.db, issue);
6269 const gate = revive ? gateOf(app.db, repo, issue) : gateHolding(app.db, repo, issue);
6370 if (gate === undefined) return err("not_held");
71 if (revive && day !== undefined) return err("revive_until");
6472 const lifted = stopWaiting(app, actor, repo, issue, gate);
6573 if (!lifted.ok) return lifted;
66 if (!revive) return ok(issue);
74 if (!revive) {
75 if (day !== undefined && actor !== undefined) {
76 setSnooze(app.db, issue.id, day.value, actor.id, now);
77 app.bus.append({
78 kind: "issue.snoozed",
79 repoId: repo.id,
80 actorId: actor.id,
81 payload: { number: issue.number, until: day.value },
82 });
83 } else clearSnooze(app.db, issue.id);
84 return ok(issue);
85 }
86 clearSnooze(app.db, issue.id);
6787 const reopened = setIssueState(app, actor, repo, issue, "open");
6888 if (!reopened.ok) {
6989 linkIssue(app, actor, repo, issue, gate);
src/actions/gate_snooze.ts added +42
@@ -0,0 +1,42 @@
1 /**
2 * The day a snoozed issue comes back (#13113): the gate takes it again, as
3 * the person who snoozed it, and the forge records it. Run from the engine's
4 * duties on a timer (`engine/duties.ts`); a missed tick only delays it.
5 */
6 import type { App } from "../app.ts";
7 import { dueSnoozes, clearSnooze } from "../core/gate_snooze.ts";
8 import { gateHolding } from "../core/gate_hold.ts";
9 import { getIssueById } from "../core/issues.ts";
10 import { pillarsOf } from "../core/pillars.ts";
11 import { getRepoById } from "../core/repos.ts";
12 import { getUserById } from "../core/users.ts";
13 import { linkIssue } from "./dependencies.ts";
14
15 /** Put every issue whose day has come behind the gate again; the number returned. */
16 export function returnSnoozed(app: App, now: Date = new Date()): number {
17 let returned = 0;
18 for (const due of dueSnoozes(app.db, now)) {
19 const issue = getIssueById(app.db, due.issueId);
20 const repo = issue === undefined ? undefined : getRepoById(app.db, issue.repoId);
21 const actor = getUserById(app.db, due.setBy);
22 const gate = repo === undefined ? undefined : pillarsOf(app.db, repo).gate;
23 if (issue === undefined || repo === undefined || gate === undefined || issue.state !== "open" || gateHolding(app.db, repo, issue) !== undefined) {
outdated

The snooze row is cleared before the relink is known to work; a failed linkIssue (line ~28) loses the snooze for good. Clear after success.

24 clearSnooze(app.db, due.issueId);
25 continue;
26 }
27 const back = linkIssue(app, actor, repo, issue, gate);
28 if (!back.ok) {
29 app.log.warn("snooze return failed", { issue: issue.number, error: String(back.error) });
30 continue; // the snooze stays, so the next tick tries again
31 }
32 clearSnooze(app.db, due.issueId);
33 app.bus.append({
34 kind: "issue.snooze_ended",
35 repoId: repo.id,
36 actorId: actor?.id,
37 payload: { number: issue.number },
38 });
39 returned++;
40 }
41 return returned;
42 }
src/core/event_audience.ts +22 −9
@@ -45,7 +45,10 @@ function answersForDeleted(db: Database, viewer: User | undefined, event: ForgeE
4545 return typeof owner === "string" && (owner === viewer.id || personOwners(db, owner).includes(viewer.id));
4646 }
4747
48 /** A `repo.deleted` names its repository; unless it was public (said so outright), the name is not for readers. */
48 /**
49 * A `repo.deleted` names its repository; unless it was public (said so outright), the name is not
50 * for readers.
51 */
4952 const namesHiddenRepo = (event: ForgeEvent): boolean =>
5053 event.kind === "repo.deleted" &&
5154 event.payload.repo !== undefined &&
@@ -62,6 +65,8 @@ const READER_KINDS: ReadonlySet<string> = new Set([
6265 "week.retro",
6366 "issue.closed",
6467 "issue.gate_reviewed",
68 "issue.snoozed",
69 "issue.snooze_ended",
6570 "issue.commented",
6671 "usage.delta",
6772 "issue.raised",
@@ -237,9 +242,11 @@ export function classifiedAudience(kind: string): EventAudience | undefined {
237242 kind.startsWith("maintenance.") ||
238243 // The weekly model review's changes and results are the owner's (`actions/model_review.ts`).
239244 kind.startsWith("crew.model_") ||
240 // A child forge answering no one at its public address is the owner's to hear (`spawn/reach.ts`).
245 // A child forge answering no one at its public address is the owner's to hear
246 // (`spawn/reach.ts`).
241247 kind.startsWith("forge.child_") ||
242 // What a hosted forge asked to reach, was refused and was allowed is the owner's to answer (`spawn/child_reach.ts`).
248 // What a hosted forge asked to reach, was refused and was allowed is the owner's to answer
249 // (`spawn/child_reach.ts`).
243250 kind.startsWith("forge.reach_") ||
244251 // A failed production probe names the forge's own defect: the admins' (`maintain/proven.ts`).
245252 kind === "probe_defect" ||
@@ -247,11 +254,13 @@ export function classifiedAudience(kind: string): EventAudience | undefined {
247254 kind.startsWith("clog.") ||
248255 // What the throughput keeper did to lift a brake is the owner's too (`flow/keeper.ts`).
249256 kind.startsWith("keeper.") ||
250 // The flow keeper's acts on pulls, lulls and forge-down are the owner's too (`maintain/keeper/`, #7556).
257 // The flow keeper's acts on pulls, lulls and forge-down are the owner's too
258 // (`maintain/keeper/`, #7556).
251259 kind.startsWith("keeper_") ||
252260 kind === "forge_down" ||
253261 kind === "forge_up" ||
254 // Who is trusted to fold in, and the switch that stops it, are the owner's (`actions/trusted_sources.ts`).
262 // Who is trusted to fold in, and the switch that stops it, are the owner's
263 // (`actions/trusted_sources.ts`).
255264 kind.startsWith("trust.") ||
256265 kind.startsWith("foldin.") ||
257266 // A way-back link minted for an account the platform edge signed in (#11802).
@@ -291,18 +300,21 @@ export function classifiedAudience(kind: string): EventAudience | undefined {
291300 kind === "repo.crew_outsiders" ||
292301 // An outside agent's token and the owner's yes to them are the admins' (#12012).
293302 kind.startsWith("contribute.") ||
294 // A valve turn names a repository and the owner's budget: for those who administer it (`actions/valves.ts`).
303 // A valve turn names a repository and the owner's budget: for those who administer it
304 // (`actions/valves.ts`).
295305 kind === "valve.turned" ||
296306 // A clog starting names the forge's own pile-up: the owner's to hear (#6524).
297307 kind.startsWith("clog.") ||
298 // The release keeper's steps name images and probe numbers: the forge owner's (`keeper/keeper.ts`, #7557).
308 // The release keeper's steps name images and probe numbers: the forge owner's
309 // (`keeper/keeper.ts`, #7557).
299310 kind.startsWith("release.") ||
300311 // A file held against new work is its admins' book-keeping (#6522).
301312 kind === "repo.file_held" ||
302313 kind === "repo.file_released" ||
303314 // Which repositories New app offers is the admins' choice (`actions/app_templates.ts`).
304315 kind.startsWith("app_template.") ||
305 // What a parent lends a child's crew, by name and dollar, is the admins' business (`actions/child_credit.ts`, #10484).
316 // What a parent lends a child's crew, by name and dollar, is the admins' business
317 // (`actions/child_credit.ts`, #10484).
306318 kind === "forge.credit_set" ||
307319 // Which child forge was moved out of this forge's process, left there or put back, and why:
308320 // what its
@@ -331,7 +343,8 @@ export function classifiedAudience(kind: string): EventAudience | undefined {
331343 // A person's pinned panels changed (`actions/board-pins.ts`): theirs alone.
332344 kind === "board.pins" ||
333345 kind.startsWith("fleet.") ||
334 // A person's own ask to the forge that hosts this one, and how it was answered (`actions/ask_host.ts`).
346 // A person's own ask to the forge that hosts this one, and how it was answered
347 // (`actions/ask_host.ts`).
335348 kind.startsWith("reach.") ||
336349 kind.startsWith("thought.")
337350 )
src/core/gate_snooze.ts added +58
@@ -0,0 +1,58 @@
1 /**
2 * Snoozing an issue behind the Later gate until a date (#13113): the day is
3 * a calendar day (UTC) as `YYYY-MM-DD`, and the issue is due at that day's
4 * first instant. Rows only; `actions/gate.ts` lifts and `actions/gate_snooze.ts`
5 * returns what is due.
6 */
7 import type { Database } from "bun:sqlite";
8 import { err, ok, type Result } from "../kernel/result.ts";
9
10 /** The one sentence a refused date gets, the same on every surface. */
11 export const BAD_DATE = "Pick a day after today, written YYYY-MM-DD.";
12
13 /**
14 * The sentence for a date given with a revive: a closed idea comes back open, not held until a day.
15 */
16 export const REVIVE_UNTIL = "A closed idea is revived now; a day can only be set when lifting what is held.";
17
18 const DAY = /^(\d{4})-(\d{2})-(\d{2})$/;
19
20 /**
21 * The instant a day begins, or undefined when the text is no real calendar day,
22 * or is not after `now`.
23 */
24 export function parseUntil(text: string, now: Date): Result<string, "bad_date"> {
25 const m = DAY.exec(text.trim());
26 if (m === null) return err("bad_date");
27 const at = new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3])));
28 if (at.toISOString().slice(0, 10) !== text.trim()) return err("bad_date");
29 if (at.getTime() <= now.getTime()) return err("bad_date");
30 return ok(at.toISOString());
31 }
32
33 export interface Snooze {
34 readonly issueId: string;
35 readonly until: string;
36 readonly setBy: string;
37 }
38
39 export function setSnooze(db: Database, issueId: string, until: string, setBy: string, now: Date): void {
40 db.query(
41 `INSERT INTO gate_snooze (issue_id, until, set_by, created_at) VALUES (?1, ?2, ?3, ?4)
42 ON CONFLICT(issue_id) DO UPDATE SET until = ?2, set_by = ?3, created_at = ?4`,
43 ).run(issueId, until, setBy, now.toISOString());
44 }
45
46 export function clearSnooze(db: Database, issueId: string): void {
47 db.query(`DELETE FROM gate_snooze WHERE issue_id = ?1`).run(issueId);
48 }
49
50 /** The snoozes whose day has come, oldest first. */
51 export function dueSnoozes(db: Database, now: Date, limit = 200): Snooze[] {
52 return db
53 .query<{ issue_id: string; until: string; set_by: string }, [string, number]>(
54 `SELECT issue_id, until, set_by FROM gate_snooze WHERE until <= ?1 ORDER BY until LIMIT ?2`,
55 )
56 .all(now.toISOString(), limit)
57 .map((r) => ({ issueId: r.issue_id, until: r.until, setBy: r.set_by }));
58 }
src/core/migration-pins/20261115120000-gate-snooze.pin added +1
@@ -0,0 +1,1 @@
1 356ee20afc29c4e59b49cd967136d9b6c2885533de23937d196be1008784c9c5
src/core/migrations/20261115120000-gate-snooze.ts added +12
@@ -0,0 +1,12 @@
1 // An issue lifted from the Later gate until a date (#13113): one row per issue, the day the gate
2 // takes it back and who asked. The row goes when the day comes or the issue is held again.
3 // Additive.
4 export default `
5 CREATE TABLE IF NOT EXISTS gate_snooze (
6 issue_id TEXT PRIMARY KEY REFERENCES issue(id) ON DELETE CASCADE,
7 until TEXT NOT NULL,
8 set_by TEXT NOT NULL,
9 created_at TEXT NOT NULL
10 );
11 CREATE INDEX IF NOT EXISTS gate_snooze_due ON gate_snooze(until);
12 `;
src/engine/duties.ts +11 −4
@@ -17,6 +17,7 @@ import type { App } from "../app.ts";
1717 import { runModelReview } from "../actions/model_review.ts";
1818 import { expireCrewHolds } from "../actions/holds.ts";
1919 import { settleDue } from "../actions/estimates_settle.ts";
20 import { returnSnoozed } from "../actions/gate_snooze.ts";
2021 import { sweepStarts } from "../actions/start_sweep.ts";
2122 import { runDelivery } from "../core/webhooks.ts";
2223 import { pruneSessions } from "../core/sessions.ts";
@@ -57,6 +58,9 @@ export function startDuties(app: App, options: { onWorker: boolean }): () => voi
5758 during("delivery", delivery, undefined, app);
5859 // Estimates of "done" come due as time passes (#11955).
5960 timers.push(setInterval(() => during("estimates-due", () => void settleDue(app.db), undefined, app), 300_000));
61 // An issue snoozed behind the Later gate comes back on its day (#13113).
62 timers.push(setInterval(() => during("gate-snooze", () => void returnSnoozed(app), undefined, app), 60_000));
63 during("gate-snooze", () => void returnSnoozed(app), undefined, app);
6064 // Accounts an agent started and nobody claimed sleep after a week and are
6165 // archived after a month (`actions/start_sweep.ts`, #10912): hourly, and on boot.
6266 timers.push(setInterval(() => during("starts", () => void sweepStarts(app), undefined, app), HOUR_MS));
@@ -79,7 +83,8 @@ export function startDuties(app: App, options: { onWorker: boolean }): () => voi
7983 60_000,
8084 ),
8185 );
82 // The weekly model review (#7815): settles last week's changes, then proposes this week's; it runs once a week whatever the tick.
86 // The weekly model review (#7815): settles last week's changes, then proposes this week's; it
87 // runs once a week whatever the tick.
8388 timers.push(
8489 setInterval(
8590 () =>
@@ -93,7 +98,8 @@ export function startDuties(app: App, options: { onWorker: boolean }): () => voi
9398 HOUR_MS,
9499 ),
95100 );
96 // The week is the sprint (#8704): at each weekly reset the forge writes its retrospective, unasked.
101 // The week is the sprint (#8704): at each weekly reset the forge writes its retrospective,
102 // unasked.
97103 timers.push(
98104 setInterval(
99105 () =>
@@ -114,8 +120,9 @@ export function startDuties(app: App, options: { onWorker: boolean }): () => voi
114120 if (options.onWorker) {
115121 // What reads what the serving thread observes (`engine/observed.ts`) adopts its rows first.
116122 stops.push(startReaders(app, () => void adoptObserved(app.db)));
117 // The one checkpointer: the serving thread's commits never pay for it (`main.ts`). A passive one
118 // takes what no reader still needs and waits for none; a log nobody reads is reset by the next write.
123 // The one checkpointer: the serving thread's commits never pay for it (`main.ts`). A passive
124 // one takes what no reader still needs and waits for none; a log nobody reads is reset by the
125 // next write.
119126 timers.push(setInterval(() => during("checkpoint", () => app.db.exec("PRAGMA wal_checkpoint(PASSIVE)"), undefined, app), 2_000));
120127 }
121128 return () => {
src/http/mcp/tools/lift.ts +14 −5
@@ -1,14 +1,15 @@
11 import { liftHold } from "../../../actions/gate.ts";
2 import { BAD_DATE, REVIVE_UNTIL } from "../../../core/gate_snooze.ts";
23 import { THREAD_SAYS } from "../../../actions/thread_words.ts";
34 import { good, bad, type Tool, APP_ARG, planRepo, issueArg, isAnswer } from "../shared.ts";
45
56 export const tool: Tool = {
67 name: "lift",
7 doc: "`{ app, issue }`: let an issue out from behind the Later gate, as the page's Lift does; its `Later` label goes with it, and the answer carries the issue's URL",
8 doc: "`{ app, issue, until? }`: let an issue out from behind the Later gate, as the page's Lift does; `until` (YYYY-MM-DD) takes it back that day; its answer carries the URL",
89 description: "Lift an issue out from behind the Later gate.",
910 inputSchema: {
1011 type: "object",
11 properties: { app: APP_ARG, issue: { type: "integer", minimum: 1 } },
12 properties: { app: APP_ARG, issue: { type: "integer", minimum: 1 }, until: { type: "string", maxLength: 10 } },
1213 required: ["app", "issue"],
1314 },
1415 writes: true,
@@ -17,14 +18,22 @@ export const tool: Tool = {
1718 if (isAnswer(repo)) return repo;
1819 const issue = issueArg(ctx, repo, args, "issue");
1920 if ("ok" in issue) return issue;

A non-string until becomes undefined and the call turns into a plain lift. Refuse with bad_date.

20 const lifted = liftHold(ctx.app, user, repo, issue);
21 if (args["until"] !== undefined && typeof args["until"] !== "string") return bad("bad_date", BAD_DATE);
22 const until = args["until"];
23 const lifted = liftHold(ctx.app, user, repo, issue, until);
2124 if (!lifted.ok)
2225 return bad(
2326 lifted.error,
24 lifted.error === "not_held" ? `#${issue.number} is not behind the Later gate.` : THREAD_SAYS.planForbidden,
27 lifted.error === "not_held"
28 ? `#${issue.number} is not behind the Later gate.`
29 : lifted.error === "bad_date"
30 ? BAD_DATE
31 : lifted.error === "revive_until"
32 ? REVIVE_UNTIL
33 : THREAD_SAYS.planForbidden,
2534 );
2635 return good({
27 says: `#${issue.number} is lifted from behind the Later gate.`,
36 says: until ? `#${issue.number} is lifted until ${until}, when the Later gate takes it back.` : `#${issue.number} is lifted from behind the Later gate.`,
2837 url: `${ctx.url.origin}/${repo.ownerName}/${repo.name}/issues/${issue.number}`,
2938 });
3039 },
src/tui/screens/held.ts +30 −6
@@ -11,6 +11,7 @@
1111 * l lift (or revive, on a closed) enter open the issue
1212 */
1313
14 import { BAD_DATE, REVIVE_UNTIL } from "../../core/gate_snooze.ts";
1415 import { liftHold } from "../../actions/gate.ts";
1516 import { applyGateReview, reviewGate, type GateReview } from "../../actions/gate_review.ts";
1617 import { THREAD_SAYS } from "../../actions/thread_words.ts";
@@ -22,7 +23,7 @@ import type { Repo } from "../../core/repos.ts";
2223 import type { Ctx, Screen } from "../app/app.ts";
2324 import { binding } from "../app/keys.ts";
2425 import type { Session } from "../session.ts";
25 import { ListState, drawList, hitList, live, metaOf, runAsync, type ListRow } from "./common.ts";
26 import { ListState, drawList, hitList, live, metaOf, promptScreen, runAsync, type ListRow } from "./common.ts";
2627 import { issueScreen } from "./issue.ts";
2728 import { local } from "./where.ts";
2829 import { emptyState } from "../ui/widgets.ts";
@@ -88,15 +89,35 @@ export function heldScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
8889 state.clamp(lines().length);
8990 ctx.invalidate();
9091 };
91 const lift = (index: number): void => {
92 const lift = (index: number, until?: string): string | undefined => {
9293 const line = lines()[index];
9394 if (line === undefined) return;
9495 const issue = getIssue(f.db, repo.id, line.number);
9596 if (issue === undefined) return;
96 const done = liftHold(f.app, f.user, repo, issue);
97 if (done.ok) ctx.toast(`#${line.number} is lifted from behind the Later gate.`, "success");
97 const done = liftHold(f.app, f.user, repo, issue, until);
98 if (done.ok) {
99 ctx.toast(
100 until === undefined
101 ? `#${line.number} is lifted from behind the Later gate.`
102 : `#${line.number} is lifted until ${until}, when the Later gate takes it back.`,
103 "success",
104 );
105 } else if (done.error === "bad_date") return BAD_DATE;
106 else if (done.error === "revive_until") return REVIVE_UNTIL;
98107 else ctx.toast(done.error === "not_held" ? `#${line.number} is not behind the Later gate.` : THREAD_SAYS.planForbidden, "danger");
99108 reload();
109 return undefined;
110 };
111 const snooze = (index: number): void => {
112 if (lines()[index] === undefined) return;
113 if (lines()[index]!.closed) return void ctx.toast(REVIVE_UNTIL, "danger");
114 ctx.push(
115 promptScreen(ctx, screen, {
116 title: "Lift until a date",
117 label: "Day (YYYY-MM-DD)",
118 onSubmit: (raw) => lift(index, raw.trim()),
119 }),
120 );
100121 };
101122 const apply = (): void => {
102123 if (read === undefined) return;
@@ -129,13 +150,14 @@ export function heldScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
129150 if (!ticked.delete(line.number)) ticked.add(line.number);
130151 ctx.invalidate();
131152 };
132 return {
153 const screen: Screen = {
133154 title: `Held · ${repo.ownerName}/${repo.name}`,
134155 keys: [
135156 binding(["j", "k"], "move"),
136157 binding(["space"], "tick"),
137158 binding(["A"], "apply the ticked"),
138159 binding(["l"], "lift / revive"),
160 binding(["u"], "lift until a date"),
139161 binding(["enter"], "open"),
140162 binding(["esc", "q"], "close"),
141163 ],
@@ -156,10 +178,12 @@ export function heldScreen(f: Session, ctx: Ctx, repo: Repo): Screen {
156178 if (e.key === "esc" || e.key === "q") ctx.pop();
157179 else if (e.key === " " || e.key === "space") toggle(state.index);
158180 else if (e.key === "A") apply();
159 else if (e.key === "l") lift(state.index);
181 else if (e.key === "l") void lift(state.index);
182 else if (e.key === "u") snooze(state.index);
160183 else if (e.key === "enter") openAt(state.index);
161184 else state.key(e, lines().length);
162185 return true;
163186 },
164187 };
188 return screen;
165189 }
src/web/pages/gate.ts +29 −6
@@ -6,6 +6,7 @@
66
77 import { applyGateReview, reviewGate } from "../../actions/gate_review.ts";
88 import { liftHold } from "../../actions/gate.ts";
9 import { BAD_DATE, REVIVE_UNTIL } from "../../core/gate_snooze.ts";
910 import { startsTicked, tallyLine, type Theme, type Triaged } from "../../core/gate_triage.ts";
1011 import { pillarsOf } from "../../core/pillars.ts";
1112 import { THREAD_SAYS } from "../../actions/thread_words.ts";
@@ -22,6 +23,17 @@ import { flashTo, page } from "../layout.ts";
2223 import { btn, disclosure, time } from "../ui.ts";
2324 import { threadContext } from "./thread.ts";
2425
26 /** Tomorrow's UTC day, the earliest a snooze may end: the browser's help, the server checks. */
27 const tomorrow = (now: Date = new Date()): string => new Date(now.getTime() + 86_400_000).toISOString().slice(0, 10);
28
29 /** Lift until a day: the date field and its button, beside Lift. */
30 function snoozeForm(base: string, number: number): Html {
31 return html`<form method="post" action="${base}/issues/${number}/lift" class="inline">
32 <input type="date" name="until" min="${tomorrow()}" required aria-label="Lift #${number} until" />
33 ${btn("Lift until", { type: "submit", size: "sm", variant: "ghost" })}
34 </form>`;
35 }
36
2537 /** What the banner says about the hold, and the one button that ends it. */
2638 export function heldBanner(ctx: Ctx, repo: Repo, issue: Issue): Html | null {
2739 const user = ctx.auth.user;
@@ -50,7 +62,7 @@ export function heldBanner(ctx: Ctx, repo: Repo, issue: Issue): Html | null {
5062 ${mayLift
5163 ? html`<form method="post" action="${base}/issues/${issue.number}/lift" class="inline">
5264 ${btn("Lift", { type: "submit", variant: "primary", size: "sm" })}
53 </form>`
65 </form>${snoozeForm(base, issue.number)}`
5466 : null}
5567 </div>`;
5668 }
@@ -64,23 +76,34 @@ export async function liftHoldSubmit(ctx: Ctx): Promise<Response> {
6476 if (form instanceof Response) return form;
outdated

The flash says 'lifted until' even when the issue was a revive and nothing was snoozed. Also no test drives this handler.

6577 const repo = loadRepo(ctx) ?? found.repo;
6678 const dest = `${repoBase(repo)}/issues/${found.issue.number}`;
67 const lifted = liftHold(ctx.app, ctx.auth.user, repo, found.issue);
79 const until = form.get("until")?.toString().trim().slice(0, 32) ?? "";
80 const lifted = liftHold(ctx.app, ctx.auth.user, repo, found.issue, until);
6881 if (!lifted.ok)
6982 return flashTo(ctx, dest, {
7083 tone: "danger",
7184 message:
7285 lifted.error === "not_held"
7386 ? `#${found.issue.number} is not behind the Later gate.`
74 : THREAD_SAYS.planForbidden,
87 : lifted.error === "bad_date"
88 ? BAD_DATE
89 : lifted.error === "revive_until"
90 ? REVIVE_UNTIL
91 : THREAD_SAYS.planForbidden,
7592 });
7693 return flashTo(ctx, dest, {
77 message: `#${found.issue.number} is lifted from behind the Later gate.`,
94 message:
95 until === ""
96 ? `#${found.issue.number} is lifted from behind the Later gate.`
97 : `#${found.issue.number} is lifted until ${until}, when the Later gate takes it back.`,
7898 });
7999 }
80100
81101 // ---- the list, and the one pass over it ----
82102
83 /** One row of the review: ticked to close or merge, a keep with nothing to tick, and Lift to let it go instead. */
103 /**
104 * One row of the review: ticked to close or merge, a keep with nothing to tick, and Lift to let it
105 * go instead.
106 */
84107 function reviewRow(base: string, mayLift: boolean, item: Triaged): Html {
85108 return html`<li class="bar">
86109 ${item.verdict.kind === "keep"
@@ -94,7 +117,7 @@ function reviewRow(base: string, mayLift: boolean, item: Triaged): Html {
94117 ${mayLift
95118 ? html`<form method="post" action="${base}/issues/${item.number}/lift" class="inline">
96119 ${btn("Lift", { type: "submit", size: "sm", variant: "ghost" })}
97 </form>`
120 </form>${snoozeForm(base, item.number)}`
98121 : null}
99122 </li>`;
100123 }
test/gate-snooze.test.ts added +132
@@ -0,0 +1,132 @@
1 /**

Only the action is tested. The web form, MCP until and the TUI u key each add behaviour with no test that would fail without them.

2 * Lifting until a date (#13113): refused when past or invalid,
3 * back behind the gate on the day and not before.
4 */
5 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
6 import { mkdtemp, rm } from "node:fs/promises";
7 import { tmpdir } from "node:os";
8 import { join } from "node:path";
9 import { createApp, type App } from "../src/app.ts";
10 import { linkIssue } from "../src/actions/dependencies.ts";
11 import { applyGateReview, reviewGate } from "../src/actions/gate_review.ts";
12 import { liftHold } from "../src/actions/gate.ts";
13 import { returnSnoozed } from "../src/actions/gate_snooze.ts";
14 import { openIssue } from "../src/actions/issues.ts";
15 import { createRepo } from "../src/actions/repos.ts";
16 import { gateHolding } from "../src/core/gate_hold.ts";
17 import { parseUntil } from "../src/core/gate_snooze.ts";
18 import { getIssueById, type Issue } from "../src/core/issues.ts";
19 import { getRepoById, type Repo } from "../src/core/repos.ts";
20 import { createUser, type User } from "../src/core/users.ts";
21
22 let dataDir: string;
23 let app: App;
24 let alice: User;
25 let repo: Repo;
26 let gate: Issue;
27 const fresh = () => getRepoById(app.db, repo.id)!;
28 const current = (i: Issue) => getIssueById(app.db, i.id)!;
29 const open = (title: string): Issue => {
30 const made = openIssue(app, alice, fresh(), { title });
31 if (!made.ok) throw new Error(String(made.error));
32 return made.value;
33 };
34 const held = (i: Issue) => gateHolding(app.db, fresh(), current(i)) !== undefined;
35 const events = (kind: string) =>
36 app.db.query<{ n: number }, [string]>(`SELECT COUNT(*) AS n FROM event WHERE kind = ?1`).get(kind)!.n;
37
38 beforeAll(async () => {
39 dataDir = await mkdtemp(join(tmpdir(), "forge-gate-snooze-"));
40 app = createApp({ dataDir, port: 0 });
41 const a = await createUser(app.db, {
42 origin: "seed", trusted: true, username: "alice", email: "[email protected]",
43 password: "a-good-passphrase", adminIfFirst: true,
44 });
45 if (!a.ok) throw new Error(a.error);
46 alice = a.value;
47 const made = await createRepo(app, alice, { name: "notes", visibility: "public" });
48 if (!made.ok) throw new Error(String(made.error));
49 repo = made.value;
50 open("P0 Notes: keep notes");
51 gate = open("Later gate: nothing behind this starts until the owner opens it");
52 });
53 afterAll(async () => {
54 app.close();
55 await rm(dataDir, { recursive: true, force: true });
56 });
57
58 describe("parseUntil", () => {
59 const now = new Date("2026-11-15T12:00:00Z");
60 test("a later day is its first instant", () => {
61 expect(parseUntil("2026-11-16", now)).toEqual({ ok: true, value: "2026-11-16T00:00:00.000Z" });
62 });
63 test("today, the past, and non-days are refused", () => {
64 for (const bad of ["2026-11-15", "2026-11-14", "2026-02-30", "soon", "", "2026-1-20"])
65 expect(parseUntil(bad, now)).toEqual({ ok: false, error: "bad_date" });
66 });
67 });
68
69 describe("lift until a date", () => {
70 test("a bad date is refused and nothing moves", () => {
71 const issue = open("Rename a note");
72 expect(linkIssue(app, alice, fresh(), issue, gate).ok).toBe(true);
73 expect(liftHold(app, alice, fresh(), current(issue), "2020-01-01")).toEqual({ ok: false, error: "bad_date" });
74 expect(liftHold(app, alice, fresh(), current(issue), "tomorrow")).toEqual({ ok: false, error: "bad_date" });
75 expect(held(issue)).toBe(true);
76 });
77
78 test("it comes back on the day and not before, and both ends are recorded", () => {
79 const issue = open("Export as text");
80 expect(linkIssue(app, alice, fresh(), issue, gate).ok).toBe(true);
81 const now = new Date("2026-11-15T12:00:00Z");
82 expect(liftHold(app, alice, fresh(), current(issue), "2026-11-20", now).ok).toBe(true);
83 expect(held(issue)).toBe(false);
84 expect(events("issue.snoozed")).toBe(1);
85
86 expect(returnSnoozed(app, new Date("2026-11-19T23:59:59Z"))).toBe(0);
87 expect(held(issue)).toBe(false);
88 expect(returnSnoozed(app, new Date("2026-11-20T00:00:00Z"))).toBe(1);
89 expect(held(issue)).toBe(true);
90 expect(events("issue.snooze_ended")).toBe(1);
91 expect(returnSnoozed(app, new Date("2026-11-21T00:00:00Z"))).toBe(0);
92 });
93
94 test("a plain lift clears a snooze, so the day brings nothing back", () => {
95 const issue = open("Pin the title");
96 expect(linkIssue(app, alice, fresh(), issue, gate).ok).toBe(true);
97 const now = new Date("2026-11-15T12:00:00Z");
98 expect(liftHold(app, alice, fresh(), current(issue), "2026-11-20", now).ok).toBe(true);
99 expect(linkIssue(app, alice, fresh(), current(issue), gate).ok).toBe(true);
100 expect(liftHold(app, alice, fresh(), current(issue)).ok).toBe(true);
101 expect(returnSnoozed(app, new Date("2026-11-21T00:00:00Z"))).toBe(0);
102 expect(held(issue)).toBe(false);
103 });
104
105 test("a revive refuses a day, and the idea stays closed and unsnoozed", () => {
106 const issue = open("Idea nobody chose");
107 expect(linkIssue(app, alice, fresh(), issue, gate).ok).toBe(true);
108 const closed = applyGateReview(app, alice, fresh(), [issue.number], reviewGate(app, fresh())!.digest);
109 expect(closed.ok).toBe(true);
110 expect(liftHold(app, alice, fresh(), current(issue), "2099-01-01")).toEqual({ ok: false, error: "revive_until" });
111 expect(current(issue).state).toBe("closed");
112 expect(app.db.query(`SELECT 1 FROM gate_snooze WHERE issue_id = ?1`).get(issue.id)).toBeNull();
113 expect(liftHold(app, alice, fresh(), current(issue)).ok).toBe(true);
114 expect(current(issue).state).toBe("open");
115 });
116
117 test("a snooze whose return fails stays, and returns when it can", () => {
118 const issue = open("Return fails once");
119 expect(linkIssue(app, alice, fresh(), issue, gate).ok).toBe(true);
120 const now = new Date("2026-11-15T12:00:00Z");
121 expect(liftHold(app, alice, fresh(), current(issue), "2026-11-20", now).ok).toBe(true);
122 const db = app.db;
123 // The setter has lost the account the relink runs as.
124 db.query(`UPDATE gate_snooze SET set_by = 'nobody' WHERE issue_id = ?1`).run(issue.id);
125 expect(returnSnoozed(app, new Date("2026-11-21T00:00:00Z"))).toBe(0);
126 expect(db.query(`SELECT 1 FROM gate_snooze WHERE issue_id = ?1`).get(issue.id)).not.toBeNull();
127 db.query(`UPDATE gate_snooze SET set_by = ?2 WHERE issue_id = ?1`).run(issue.id, alice.id);
128 expect(returnSnoozed(app, new Date("2026-11-21T00:00:00Z"))).toBe(1);
129 expect(held(issue)).toBe(true);
130 expect(db.query(`SELECT 1 FROM gate_snooze WHERE issue_id = ?1`).get(issue.id)).toBeNull();
131 });
132 });
test/job-slices.test.ts +30 −11
@@ -68,11 +68,16 @@ import { fireDue } from "../src/apps/feature_schedule.ts";
6868 import { pullDue } from "../src/apps/pull_schedule.ts";
6969 import { startMaintain } from "../src/maintain/runner.ts";
7070 import { retentionJobs } from "../src/system/retention.ts";
71 import { returnSnoozed } from "../src/actions/gate_snooze.ts";
7172
72 /** Thousands of issues and pulls, as the issue asks; runs, comments and events thinned so the file runs in seconds (#1242). */
73 /**
74 * Thousands of issues and pulls, as the issue asks; runs, comments and events thinned so the file
75 * runs in seconds (#1242).
76 */
7377 const BUSY = { issues: 2000, pulls: 2000, requested: 100, runs: 5000, comments: 5000, events: 10000, reviewComments: 500 };
7478
75 // A job's warnings (a sandbox without git warns once per pull) are not its slice: the terminal's write is.
79 // A job's warnings (a sandbox without git warns once per pull) are not its slice: the terminal's
80 // write is.
7681 quietLogs();
7782
7883 let app: App;
@@ -94,7 +99,10 @@ afterAll(() => {
9499 rmSync(dir, { recursive: true, force: true });
95100 });
96101
97 /** The longest the loop stood still while `fn` ran, in ms: its synchronous call, or any continuation after. */
102 /**
103 * The longest the loop stood still while `fn` ran, in ms: its synchronous call, or any continuation
104 * after.
105 */
98106 async function slice(fn: () => unknown): Promise<number> {
99107 let last = performance.now();
100108 let worst = 0;
@@ -145,6 +153,7 @@ function jobs(): Record<string, () => unknown> {
145153 sampler: () => sampler.tick(),
146154 "memory-sampler": () => memory.tick(),
147155 keeper: () => tickKeeper(app, new Date(), () => {}),
156 "gate-snooze": () => returnSnoozed(app),
148157 // The pictures' keeper (`flow/keep.ts`): one look at what is kept; a due reading is started on
149158 // a worker, never read here.
150159 pictures: () => keepTick(app.db),
@@ -157,22 +166,26 @@ function jobs(): Record<string, () => unknown> {
157166 sweepAssigned(app);
158167 pump(app, NO_SLOT, new Map());
159168 },
160 // The orphan sweep reads the crew root (empty here); the claims it checks against are the fixture's.
169 // The orphan sweep reads the crew root (empty here); the claims it checks against are the
170 // fixture's.
161171 "clone-sweep": async () => {
162172 await sweepOrphanClones(crewRoot(app.config.dataDir), claimedClones(app.db));
163173 pruneRunFiles(app.config.dataDir);
164174 },
165 // The radar's night: every repository's pins (git fails fast: no repositories on disk), npm faked.
175 // The radar's night: every repository's pins (git fails fast: no repositories on disk), npm
176 // faked.
166177 nightly: () => radarNight(app, async () => "not looked up"),
167178 // The census of /proc main.ts logs each minute (`processTick`), without the crew's reaping.
168179 processes: () => censusWords(census(processRows())),
169 // The fixture has no origins, mirrors, children or parent link: each is its empty pass, one read.
180 // The fixture has no origins, mirrors, children or parent link: each is its empty pass, one
181 // read.
170182 ahead: () => runAheadReads(app),
171183 "guard-sweep": () => runGuardSweep(app),
172184 "mirror-pulls": () => sweepMirrorPulls(app),
173185 reach: () => sweepReach(app),
174186 upstream: () => checkParent(app),
175 // Its first pass on start tells and pages everyone (`tell(id, true)`, then `page`), a superset of the clock's tick.
187 // Its first pass on start tells and pages everyone (`tell(id, true)`, then `page`), a superset
188 // of the clock's tick.
176189 notify: async () => {
177190 const told = startNotifier(app, {
178191 forgeUrl: "https://forge.test/", send: async () => true, clockMs: 1e9,
@@ -186,7 +199,8 @@ function jobs(): Record<string, () => unknown> {
186199 "spawn-idle": () => sleepIdleChildren(app),
187200 // One renewal of every lease this process holds: the runs a dead forge left running.
188201 "lease-renew": () => heartbeatRuns(app.db, RUNNING),
189 // A minute's reads and page views, buffered then written in one flush: the noting is in the slice too.
202 // A minute's reads and page views, buffered then written in one flush: the noting is in the
203 // slice too.
190204 reads: () => {
191205 for (let n = 0; n < 1000; n++) readLedger.note(Date.now(), { repo: "r", ref: "main", path: `f${n % 400}` }, n % 2 === 0);
192206 reads.flush();
@@ -232,7 +246,8 @@ function jobs(): Record<string, () => unknown> {
232246 "feature-schedule": () => fireDue(app),
233247 "pull-schedule": () => pullDue(app),
234248 maintain: () => maintainer.tick(new Date(Date.now() + 1e9)),
235 // The retention slices, each as its timer calls it: bounded rows, paced by their own cost (`system/retention.ts`).
249 // The retention slices, each as its timer calls it: bounded rows, paced by their own cost
250 // (`system/retention.ts`).
236251 "retention-events": () => retention.events.slice(Date.now() + 40 * 86_400_000),
237252 "retention-live": () => retention.live.slice(Date.now()),
238253 "retention-samples": () => retention.samples.slice(Date.now()),
@@ -242,7 +257,8 @@ function jobs(): Record<string, () => unknown> {
242257 }
243258
244259 /**
245 * The jobs not timed here, each with why. The release keeper's are off unless a cluster turns them on.
260 * The jobs not timed here, each with why. The release keeper's are off unless a cluster turns them
261 * on.
246262 */
247263 const UNTIMED: Record<string, string> = {
248264 "drill-watch": "a /proc read of the drill child's memory and a state write every WATCH_MS, only while a restore drill runs in its own process; drill-job tests drive runDrillInChild directly",
@@ -310,7 +326,10 @@ const UNTIMED: Record<string, string> = {
310326 "spawn-due-wake": "a timer in the spawn host that wakes a due run: needs a spawned run; the fixture has none",
311327 };
312328
313 /** A job held past this in one slice fails the test: five times the issue's 50 ms, so no runner flakes it. */
329 /**
330 * A job held past this in one slice fails the test: five times the issue's 50 ms, so no runner
331 * flakes it.
332 */
314333 const CEILING_MS = 250;
315334
316335 /** Every name src/ passes to `during`: the list a new job joins, timed or not. */
test/later-gate.test.ts +42 −1
@@ -402,7 +402,8 @@ describe("the Later gate in plain sight", () => {
402402 expect(liftHold(app, alice, fresh(), current(a))).toEqual({ ok: false, error: "not_held" });
403403 expect(current(a).state).toBe("closed");
404404 expect(holds(a)).toBe(false);
405 // Reviewed-closed, then let out of the gate by another road: nothing to lift, and it stays closed.
405 // Reviewed-closed, then let out of the gate by another road: nothing to lift, and it stays
406 // closed.
406407 const b = held("Reviewed then unlinked");
407408 expect(applyGateReview(app, alice, fresh(), [b.number], proposal().digest).ok).toBe(true);
408409 expect(unlinkIssue(app, alice, fresh(), current(b), gate).ok).toBe(true);
@@ -482,6 +483,46 @@ describe("the Later gate in plain sight", () => {
482483 expect(page).not.toContain(`/issues/${a.number}/lift`);
483484 });
484485
486 test("the page's Lift until: a bad day flashes and holds, a good day snoozes, a revive refuses a day", async () => {
487 const path = (i: Issue) => `/alice/engine/issues/${i.number}/lift`;
488 const a = held("Snoozed from the page");
489 const refused = await as(cookie, path(a), { until: "2001-01-01" });
490 expect(refused.status).toBe(303);
491 const flash = (refused.headers.get("set-cookie") ?? "").split(";")[0]!;
492 expect(decodeURIComponent(flash)).toContain("Pick a day after today");
493 expect(holds(a)).toBe(true);
494 const ok = await as(cookie, path(a), { until: "2099-01-01" });
495 expect(ok.status).toBe(303);
496 expect(holds(a)).toBe(false);
497 expect(
498 app.db.query<{ until: string }, [string]>(`SELECT until FROM gate_snooze WHERE issue_id = ?1`).get(a.id)?.until,
499 ).toBe("2099-01-01T00:00:00.000Z");
500 // The date field is bounded to tomorrow or later, and a closed idea has none.
501 const b = held("Offered a day");
502 expect(await get(`/alice/engine/issues/${b.number}`)).toMatch(/name="until" min="\d{4}-\d{2}-\d{2}"/);
503 const c = held("Closed, then revived with a day");
504 expect(applyGateReview(app, alice, fresh(), [c.number], proposal().digest).ok).toBe(true);
505 const revive = await as(cookie, path(c), { until: "2099-01-01" });
506 expect(decodeURIComponent((revive.headers.get("set-cookie") ?? "").split(";")[0]!)).toContain("closed idea is revived now");
507 expect(current(c).state).toBe("closed");
508 });
509
510 test("the MCP lift with until: a bad, a non-string, and a revive's day are refused; a good day snoozes", async () => {
511 const a = held("Snoozed over MCP");
512 const args = { app: "alice/engine", issue: a.number };
513 expect((await mcp(aliceToken, "lift", { ...args, until: "2001-01-01" })).error).toContain("bad_date");
514 expect((await mcp(aliceToken, "lift", { ...args, until: 20991231 })).error).toBeDefined();
515 expect(holds(a)).toBe(true);
516 const ok = await mcp(aliceToken, "lift", { ...args, until: "2099-01-01" });
517 expect(ok.value.says).toContain("until 2099-01-01");
518 expect(holds(a)).toBe(false);
519 expect(app.db.query(`SELECT 1 FROM gate_snooze WHERE issue_id = ?1`).get(a.id)).not.toBeNull();
520 const b = held("Closed then revived over MCP with a day");
521 expect(applyGateReview(app, alice, fresh(), [b.number], proposal().digest).ok).toBe(true);
522 expect((await mcp(aliceToken, "lift", { app: "alice/engine", issue: b.number, until: "2099-01-01" })).error).toContain("revive_until");
523 expect(current(b).state).toBe("closed");
524 });
525
485526 test("the MCP lift and held tools hold the same line", async () => {
486527 const a = held("Lifted over MCP");
487528 const read = await mcp(aliceToken, "held", { app: "alice/engine" });
test/tui-held.test.ts +24
@@ -167,4 +167,28 @@ describe("the Later gate, in the terminal", () => {
167167 off();
168168 h.stop();
169169 });
170
171 test("u asks for a day: a bad one keeps the prompt open and changes nothing, a good one snoozes", async () => {
172 const alice = getUserByName(forge.db, "alice")!;
173 const made = openIssue(forge, alice, fresh(), { title: "Zzz snooze me" });
174 if (!made.ok) throw new Error("issue");
175 const snoozed = made.value;
176 linkIssue(forge, alice, fresh(), snoozed, gate);
177 const h = boot(alice);
178 await h.toHeld("alice/plan");
179 await h.press("u");
180 expect(h.text()).toContain("Lift until a date");
181 await h.typeText("2001-01-01");
182 await h.press("enter");
183 expect(h.text()).toContain("Pick a day after today");
184 expect(held(snoozed)).toBe(true);
185 await h.press("esc", "u");
186 await h.typeText("2099-01-01");
187 await h.press("enter");
188 expect(held(snoozed)).toBe(false);
189 expect(forge.db.query(`SELECT until FROM gate_snooze WHERE issue_id = ?1`).get(snoozed.id)).toEqual({
190 until: "2099-01-01T00:00:00.000Z",
191 });
192 h.stop();
193 });
170194 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs