gcf-board 0.11.0 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -17
- package/dist/server/app.js +133 -12
- package/dist/server/moves.js +9 -2
- package/dist/server/propose.js +30 -3
- package/dist/server/runs.js +16 -10
- package/dist/server/talks.js +109 -13
- package/dist/server/themes.js +12 -2
- package/dist/shared/board.js +11 -1
- package/dist/web/assets/index-BKzKQnZ5.css +1 -0
- package/dist/web/assets/index-C9MtdvLc.js +51 -0
- package/dist/web/index.html +2 -2
- package/node_modules/gcf-session/lib/adapter/claude.js +7 -2
- package/node_modules/gcf-session/lib/adapter/index.js +8 -1
- package/node_modules/gcf-session/lib/chat.js +1 -1
- package/node_modules/gcf-session/lib/index.js +1 -1
- package/node_modules/gcf-session/lib/thread.js +19 -10
- package/node_modules/gcf-session/package.json +1 -1
- package/node_modules/gcf-session/types/index.d.ts +16 -3
- package/package.json +2 -1
- package/themes/cream-medium.json +41 -0
- package/themes/dusk.json +41 -0
- package/themes/paper-soft.json +41 -0
- package/themes/sand-contrast.json +41 -0
- package/dist/web/assets/index-9AdVt1Kf.js +0 -39
- package/dist/web/assets/index-xG2PuBXE.css +0 -1
package/README.md
CHANGED
|
@@ -5,9 +5,10 @@ A local web board for game projects on [GCF](../gcf-aif-ext): the items by statu
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
7
|
- Node.js ≥ 22.18
|
|
8
|
-
- [`ai-factory`](https://www.npmjs.com/package/ai-factory) installed globally, and in each project [`gcf-aif-ext`](../gcf-aif-ext) ≥ 0.
|
|
8
|
+
- [`ai-factory`](https://www.npmjs.com/package/ai-factory) installed globally, and in each project [`gcf-aif-ext`](../gcf-aif-ext) ≥ 0.18 (`gcf board --json` with `schema: 4`: the columns, the moves, the item's fields, the blocks and the Help terms come from it as data)
|
|
9
9
|
- for runs: [`gcf-harness-aif-ext`](../gcf-harness-aif-ext) ≥ 0.11 (every board run opens its chat: `--chat`, `gcf-harness chat`; it waits the project's answer time) and Claude Code (`claude -p`); ≥ 0.12 to wait for the usage limit's reset and for queued runs (`--wait-limit`)
|
|
10
10
|
- for the project chat: `gcf-aif-ext` ≥ 0.12 (`domain.chat`, `agent.rules`) and Claude Code
|
|
11
|
+
- for 0.12: `gcf-aif-ext` ≥ 0.16 for the chat's proposals of moves on items and inbox entries (an older core proposes only new items) and an item's own run mode; `gcf-harness-aif-ext` ≥ 0.16 to run main and worktree side by side safely (the main run's queue in the gate, a merge that waits)
|
|
11
12
|
- for 0.11: `gcf-aif-ext` ≥ 0.12.1 for **waiting for me** and the human columns of Command (an older core marks no column `human`: they stay empty); ≥ 0.15 names a session mark's life (`domain.session_ttl_min`; older: 120 minutes)
|
|
12
13
|
- for 0.10: `gcf-aif-ext` ≥ 0.14 for an item's attachments and the project's model and effort; `gcf-harness-aif-ext` ≥ 0.14 for the run gate's refusal before the click (an older one: the click is gated, as before)
|
|
13
14
|
- for board v2 (0.9): `gcf-aif-ext` ≥ 0.13 for an item's History, `needs`, the design units, filters and lanes; `gcf-harness-aif-ext` ≥ 0.13 for past runs and a run's model and effort. On older ones these hide or say which version they need
|
|
@@ -34,11 +35,11 @@ It puts **GCF Board** on the desktop (Windows: a shortcut whose server console s
|
|
|
34
35
|
|
|
35
36
|
## What it does
|
|
36
37
|
|
|
37
|
-
The board knows no domain by name: the project's board read gives its columns, moves with their forms, item fields, blocks and Help terms (`domain`, Board-PRD decision 16). The page follows design B (`docs/design/mockup`): a left nav with the project switcher (add a project, take one off the board), the screens **Command**, **Board**, **Chat**, **Inbox**, **Runs**, **Playtest**, **Ended**, **Agent
|
|
38
|
+
The board knows no domain by name: the project's board read gives its columns, moves with their forms, item fields, blocks and Help terms (`domain`, Board-PRD decision 16). The page follows design B (`docs/design/mockup`): a left nav with the project switcher (add a project, take one off the board), the screens **Command**, **Board**, **Chat**, **Inbox**, **Design**, **Runs**, **Playtest**, **Ended**, **Agent** and **Metrics** (a domain without a block has no screen for it, a project without a harness no Runs and no Metrics), and a header with the phase, the runs, the limit wait, the quota, WIP, the release, **waiting for me**, **+ item**, the gear (**Settings**, a dialog over the screen; on a phone in More) and **?**. The project and the screen are in the URL hash. On a phone a bottom bar holds Command, Board, Chat, Inbox and More. When the server is gone, the page says so and reconnects by itself. For a GCF project:
|
|
38
39
|
|
|
39
|
-
- **Command**: **waiting for me**, what only the operator moves on (Board-PRD §1.3), by group: failed run reports and a paused queue, a card waiting in a chat (
|
|
40
|
+
- **Command**: **waiting for me**, what only the operator moves on (Board-PRD §1.3), by group, each a grid of tiles (board 0.16.0, the designer's final round): failed run reports and a paused queue (its tile opens Runs), a card waiting in a chat (its tile opens the chat), the decisions, the items to play and judge, to decide, to unblock (the columns the domain marks `human`), and a `paused: limit` item to resume. Beside it **Live**: the runs going on with their plan progress, **Follow** and **Stop**, the console runs and sessions, **Run next**, the queue, the run reports, and what the board did by itself.
|
|
40
41
|
- **Board**: columns ready, running, blocked, awaiting-verdict, awaiting-decision, unplayed, parked. A card shows the type, the gate, the plan progress (`2/5`), the severity, `verified`, the model, **needs N** and **needed by N**. A running card shows when its run log was last written (`active 12 s ago`), and `quiet 6 min` when the log has been silent for 5 minutes or more. A run's end report gives each item's cost when the agent reported it. Pointing at a card (or focusing it from the keyboard) lights up the cards it needs and the cards that need it, each saying how, and dims the rest. The toolbar (board 0.9.0, core 0.13.0) searches ids and titles, keeps **waiting for me**, filters by the fields the domain marks `filter` (GCF: type, gate, severity, system, milestone; several values at once, each a chip to take off) and lays the board out in lanes by a field it marks `group` (system, parent, milestone): an item with two systems stands in both lanes, one with none in **none**, a parent lane is named by the feature's title. The mouse drags the board sideways from its empty space; the wheel over a column with no scroll of its own pans it.
|
|
41
|
-
- **An item
|
|
42
|
+
- **An item** (a window over the screen, dragged by its head; a page on a phone; board 0.14.0): its **Status** (why it is blocked or waits, its fields, its dependencies; it opens there when it is blocked or waits), its file (the front matter folded, a `key:` body by sections), its plan and its run log as it grows, its **Lessons**, and the moves the core offers for it (`items[].moves`, Methodology §4.1): run, verdict, decide, block, unblock, drop, close, submit, depends. Each move's form comes from the core; the core still checks the rest itself, and the board shows its answer. **Dependencies**: what it needs that has not ended in history (an item with its column, a design unit with its TBDs or the questions that block it, a graveyard line, an unknown id) and the items that need it, each a link; **Edit…** opens the picker of the board's items and design units (search by id and title, or type an id), and Save sends the `depends` move's adds and removes. **History** (core 0.13.0): its moves newest first, when, which, who (a run, your session, you; unknown on a commit older than the framework's marks), the commit and its subject; then its runs, as on the Runs screen. **Related**: its feature's other children, and the graveyard lines tagged with its system ("did we kill this before?"). An item that ended opens from **Ended** with its History.
|
|
42
43
|
- **Runs** (harness 0.13.0): what runs now with the run's model and effort, its last log lines, **Whole log** and **Stop**; the queue with what each item will run on; the past runs of the harness's run log, newest first, 50 at a time: start, end, mode, cost, and per item its result word, the reason word for word, cost, tokens, turns, handoffs, a broken step and what it ran on. **log** opens the part of the item's log that run wrote, **chat** that run's chat. Every start the operator asks for (Run selected, Run next, a drop on running, this screen) asks first with a model and effort picker for that run only (**default: each item's own**); the drawer's Run is one click. An older harness shows the active runs only, and the dialog has no pickers. The API: `GET /api/p/<project>/runs/past?limit=` (`gcf-harness runs --json`; 404 without a harness that keeps them), `GET …/item/<id>/history` (`{id, moves, runs}`), `GET …/log/<id>?from=&to=` (a past run's part, once: `{text, cut}`, at most its last 2 MB; without `from` and `to` the log as it grows), `POST …/run` with `model` and `effort`, `POST …/inbox/<entry>/draft` (`{thread, created}`).
|
|
43
44
|
- **Drag**:
|
|
44
45
|
- a ready card into **running** starts its run;
|
|
@@ -46,28 +47,29 @@ The board knows no domain by name: the project's board read gives its columns, m
|
|
|
46
47
|
- a card onto **graveyard** drops it.
|
|
47
48
|
|
|
48
49
|
Every other move is a button.
|
|
49
|
-
- **Run**: **run** on an item, or select ready cards and **Run selected**. It starts `ai-factory gcf-harness run <ids> --json`
|
|
50
|
-
-
|
|
51
|
-
-
|
|
50
|
+
- **Run**: **run** on an item, or select ready cards and **Run selected**. It starts `ai-factory gcf-harness run <ids> --json --mode <mode>`, each item where it runs: the start dialog's **Where this run goes**, else the item's own **run mode** (core 0.16: the drawer's fact and **More**, `gcf item mode`), else the project's `run_mode` (board 0.12.0, Board-PRD decision 28). A start with both kinds is two runs; the dialog's hints say only what the framework knows (a spike on main, a merge or a main run that waits):
|
|
51
|
+
- worktree: one worktree and one agent session per item, all at once, then the integrator; while a main run works in the project folder its green branch reads **verified** and merges when that run ends (core and harness 0.16);
|
|
52
|
+
- main: one item at a time in the project folder. A main run asked for meanwhile waits in the board's **queue**; **remove from queue** takes it out.
|
|
52
53
|
|
|
53
54
|
A run asks first: it spends the subscription. **Stop** on a running item ends its session; the item stays ready and its work is kept. **Stop** during the wait for the usage limit's reset leaves the item **paused: limit** with its reset, and the queue goes on. A queued main run that the next one would repeat (the harness did not start, or another run works the checkout) pauses the queue: the header shows **queue paused — resume**; fix the cause, then resume. A card marked **interrupted** had a run that stopped (a timeout, a stop, a crash, the usage limit): **resume** continues its agent session with all its context, **start fresh** drops it. After the usage limit the run itself waits for the reset and goes on in the same session (harness 0.12): the card reads **limit: resumes HH:MM**, and **Stop** ends the wait. A run that could not wait (the week's limit, an unknown reset) ends **paused: limit** and pauses the main queue; **resume** on the header goes on after the reset. When a run ends, a report card lists each item's result and stays until closed, across page reloads. **What the board did by itself** lists its automatic acts with their times: a usage limit, a context handoff, the queue paused, resumed or started. A run confirmation names what each interrupted item picks up. The header shows the usage limit as the last run read it, from the newest `.gcf-session/runs/quota.json` of the board's projects: `quota 19% left · resets 03:00`, the window with the least left, every window in its tooltip; `quota ?` before any reading, or once every window has reset since. The queue, its pause, the reports and that list live in the board home too (`~/.gcf/queue.json`, board 0.10): a board started again goes on with them. It first takes in its runs; then a queue not paused, with no main run going, goes on (`queue-restored` in the list); a run that died while the board was down (a restart of the machine) pauses it, and a limit's pause shows its reset time. Two boards on one home both go on with the same queue: start one. A run itself outlives the board: closing it or Ctrl+C in its console leaves the run going, and the board started again shows it running, then its report (a run in flight keeps its record in `~/.gcf/runs/`).
|
|
54
55
|
- **Who runs it** (core 0.7.13): a running card tells a console run and **your session** (a `gcf claim` mark) from the board's own run; a session offers **release mark** instead of **stop**. A ready card whose dependencies are not built yet shows **waits for <dep>**; the drawer shows when an item began to wait (`since_at`).
|
|
55
56
|
- **Run next N independent**: the framework's gate picks the ready items that can run together now, by priority, and the board runs them after asking.
|
|
56
57
|
- **Priority**: drop a ready card on another to put it before; the column's ranks are committed (`gcf prioritize`).
|
|
57
58
|
- **Questions**: each D1 shows its question and proposed answer; **Answer** writes yours into its record (`gcf question answer`), and the next agent on its units puts it in place.
|
|
58
|
-
- **New item**: `gcf item new … --commit`, its form from the core: a bug asks its severity, a release its version and channel. The item's `model` and `effort` go to its run.
|
|
59
|
+
- **New item**: `gcf item new … --commit`, its form from the core: a title and a type, no id (the core makes it from the title; board 0.15.0, Board-PRD decision 34); a bug asks its severity, a release its version and channel; the parent is one live feature and the dependencies are picked by title, each row "title (id)". The item's `model` and `effort` go to its run.
|
|
59
60
|
- **Help** (**?**): the domain's terms, columns, moves and field values with what each means, and the words of runs, under one filter.
|
|
60
|
-
- **Settings
|
|
61
|
-
- **Theme** (board 0.11.0, Board-PRD decision 26): Settings, "Board · this browser": **Dark (built-in)
|
|
61
|
+
- **Settings** (the header's gear): the keys of `gcf/config.yml` and the agents' language (`language.ui`, `language.artifacts` of `.ai-factory/config.yaml`), by the core's groups, each a `gcf config set` commit.
|
|
62
|
+
- **Theme** (board 0.11.0, Board-PRD decision 26): Settings, "Board · this browser": **Dark (built-in)**, the designer's themes the board ships (`themes/`: Paper · soft, Cream · medium, Sand · contrast, Dusk · soft dark; board 0.14.0), or a theme file of `~/.gcf/themes/<id>.json`, which replaces a shipped one of its id — `{"gcf_theme": 1, "name", "scheme": "light" | "dark", "tokens": {…}}`, the colour tokens of `web/tokens.css` without `--gcf-` over the built-in dark (a template: docs/design/theme-sample.json). Each browser keeps its own choice; a file that cannot be read is listed with its reason, and the page falls back to dark when the chosen one is gone. Reload the page after changing a file. `GET /api/themes` lists the files.
|
|
62
63
|
- **Agent**: the deny groups to tick, the rules the ticked groups add, the operator's own deny rules (add, remove) and the allow rules of `agent.allow`, apart; the context limits, read only.
|
|
63
64
|
- **An item's chat** (its drawer's **Chat** tab; harness 0.11.1, core 0.11.1): every run the board starts keeps its agent sessions open; the project's `chat:` settings (Settings: `chat.ask`, `chat.answer_timeout_min`) say what the agent asks and how long a question waits. The tab shows the run's chat, then the item's own thread of the project chat: the talk, question cards (picks, several questions, **Submit**), the run's milestones, its sessions, the limit wait, the context share. A message goes where the server puts it: the live run (its limit wait too), else the item's thread, and the line under the box says where it went. `GET /api/p/<project>/chat/<id>` follows the item's chat from its start, in raw chunks of JSON lines (the page splits them). `POST` there sends `{type: 'say', text, images?, attach?}`, `{type: 'interrupt'}` or `{type: 'answer', request_id, answers}` through `gcf-harness chat`; with no live run a message goes to the item's thread (answer `{talk}`), else a message with no session to read it gets 409, bad input 400. `attach` (`[{kind: item | unit | file, ref}]`) goes into the message's text as a line the agent reads; a design unit (the composer's **+ unit**, from the board read's `units`) goes as `unit <id> (<file>)`. `GET /api/p/<project>/chat/<id>/att/<file>` serves a chat picture; **attach to item…** under a picture gives it to an item (`gcf item attach`).
|
|
64
|
-
- **Functional base A** (board 0.10.0, core and harness 0.14.0; docs/Base-A-Plan.md): Settings has `session_timeout_min` and the project's `agent.model` / `agent.effort
|
|
65
|
-
- **Model and effort** (board 0.8.0, core 0.12.3): pickers in the New item form, in the drawer (**change** beside the model and effort, and **model / effort** under **More**)
|
|
66
|
-
- **Project chat** (the **Chat** screen; core 0.12): threads of an agent in the project's folder, listed newest first and filtered by their item; a new thread is made when its first message is sent. Each thread is run by the bundled session engine (`gcf-session`) through the same detached relay as runs. It asks a card before each edit, git command and framework move (**allow once**, **always** — saved in `.claude/settings.local.json`; the card says saved only when it was — or **deny**); a new item it proposes through the board's MCP server `gcf` (tool `propose_item_new`, asked with no card: the proposal card is the question), the proposal card shows every field it proposed, and the operator's **Create** makes it with `POST /move` (`proposal: {talk, id}`), **Edit…** first in the new-item form. A thread's list entry names the card that waits in it and its limit wait (`card`, `limit_until`); a running item names the card of its run's chat (`chat_card`). A long talk hands over to a fresh agent from a summary; an idle agent closes after `chat.answer_timeout_min` (0 means 15) and the next message resumes it. Each item has at most one thread: a message to an item with no live run goes there. `GET /api/p/<project>/talks[?item=]` lists the threads with their proposals' states; `POST` there makes one (`{item?}`); `GET /api/p/<project>/talk/<t>` follows a thread's events; `POST` there sends `say`, `interrupt`, `answer`, `allow`, `deny` or `handoff`; `POST …/talk/<t>/stop` is the composer's **close agent** (board 0.8.1): the thread's agent ends with everything it started, or its limit wait does, and what it had not taken in is dropped with a "not sent" line; the next message resumes the talk; `GET …/talk/<t>/att/<file>` serves its pictures. The files live in `.gcf-session/chats/` (docs/Chat-Plan.md §3).
|
|
67
|
-
- **Inbox
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
65
|
+
- **Functional base A** (board 0.10.0, core and harness 0.14.0; docs/Base-A-Plan.md): Settings has `session_timeout_min` and the project's `agent.model` / `agent.effort`; the drawer shows the project's model on an item without its own, "(project)". The drawer's Run is off with the run gate's reason when the gate refuses the item now, and the start dialog marks each refused item and runs the rest (`GET /api/p/<project>/gate?ids=` runs `gcf-harness gate --each`). An item's attachments and an inbox entry's pictures are links (`GET /api/p/<project>/attachment?path=`: only `gcf/work/<id>/attachments/` and `gcf/inbox/in-<hex>/attachments/`, no `..`, no link on the way, a picture shown, any other file a download, `nosniff` and `default-src 'none'`), and a picture or link in File or Plan that points there loads through it. A permission card for one MCP tool offers Always, saying it allows every call of the tool with any arguments.
|
|
66
|
+
- **Model and effort** (board 0.8.0, core 0.12.3; a closed select since board 0.15.0, Board-PRD decision 33): pickers in the New item form, in the drawer (**change** beside the model and effort, and **model / effort** under **More**), in a thread's composer and in Settings (`agent.model` / `agent.effort`). Each is one select: Default first — "Default (Opus)" / "Default (High)", or "Default - project setting (Sonnet)" when the project sets one, and "Default - each item's own" in the run dialog; Default sends `default` — then the agent's presets by name (Fable, Opus, xHigh). Nothing set anywhere runs on Opus / High (decision 36). A thread's composer has no Default row: it shows what holds, and **↺ project** takes the thread's own pick off (board 0.16.2). No own word; a value set from the console that the presets lack shows as its own row, so a form sent unchanged keeps it. An item's next run takes them; a thread's next session does (`chats/<t>/agent.json`), and its line in the chat says so.
|
|
67
|
+
- **Project chat** (the **Chat** screen; core 0.12): threads of an agent in the project's folder, listed newest first and filtered by their item; a new thread is made when its first message is sent. Each thread is run by the bundled session engine (`gcf-session`) through the same detached relay as runs. It asks a card before each edit, git command and framework move (**allow once**, **always** — saved in `.claude/settings.local.json`; the card says saved only when it was — or **deny**); a new item it proposes through the board's MCP server `gcf` (tool `propose_item_new`, asked with no card: the proposal card is the question), the proposal card shows every field it proposed, and the operator's **Create** makes it with `POST /move` (`proposal: {talk, id}`), **Edit…** first in the new-item form. A proposed item has no id: the server asks `gcf item new --dry-run` for it, records it, then creates the item with it, so a board that stops halfway does not make it twice. An inbox entry the agent proposed is filed with origin `agent`: the server adds `--origin=agent`, never from the request. With core 0.16 (board 0.12.0, Board-PRD decision 27) it also proposes a move on an item or an inbox entry already there — `block`, `drop`, `depends`, and the inbox's `add` (with its category), sort, Later and erase (sort and Later with core 0.18, board 0.15.0) — naming it in `id`: the card shows the item's id, title and status now (or the entry's first line), warns when the item does not take the move now or is not on the board, its button is the move's name (a drop or an erase asks first), and **Edit…** opens that move's form. A thread's list entry names the card that waits in it and its limit wait (`card`, `limit_until`); a running item names the card of its run's chat (`chat_card`). A long talk hands over to a fresh agent from a summary; an idle agent closes after `chat.answer_timeout_min` (0 means 15) and the next message resumes it. Each item has at most one thread: a message to an item with no live run goes there. `GET /api/p/<project>/talks[?item=]` lists the threads with their proposals' states; `POST` there makes one (`{item?}`); `GET /api/p/<project>/talk/<t>` follows a thread's events; `POST` there sends `say`, `interrupt`, `answer`, `allow`, `deny` or `handoff`; `POST …/talk/<t>/stop` is the composer's **close agent** (board 0.8.1): the thread's agent ends with everything it started, or its limit wait does, and what it had not taken in is dropped with a "not sent" line; the next message resumes the talk; `GET …/talk/<t>/att/<file>` serves its pictures. The files live in `.gcf-session/chats/` (docs/Chat-Plan.md §3).
|
|
68
|
+
- **Inbox** (categories since board 0.15.0, core 0.18.0; Board-PRD decision 32): add an entry (Ctrl+Enter adds, Enter breaks the line; a category of the ones you may file, Note by default, and a detail), **Sort…** it into another category, put it away to **Later** and take it **Back**, erase it, or turn it into an item (its first line the title, the rest the note). Each entry shows its category and detail, its origin, its lines and date. Search the entries, filter them by category (or "in Later") and by detail. Since board 0.16.0 each group is a panel of tiles, Needs you first; a tile opens the record in the detail window (the item window's frame); the filter takes a category, its details, the origin, an item and the text; on the Inbox `j` / `k` move between tiles, Enter opens, `s` sorts, `l` puts Later or Back, `e` erases. The decisions and the agent's assumptions are records of their own categories there too. **Draft with agent** opens a project chat thread bound to the entry and sends "Draft an item from inbox entry <id>:" with its text; a second click opens the same thread. The first proposal's **Create** takes the entry (it is erased); a later one makes an item with no entry. Off while the usage limit holds.
|
|
69
|
+
- **Design**: where a game starts and its design changes. The steps from an empty project to the first work (the design, the pillars, the open questions, a ready unit), each with what does it: **Import GDD** (a markdown file), **Review GDD first**, **Create with agent**, **Draft with agent** for the glossary, **Pillars interview**, **Name with agent** for pillars without a name; each opens a project chat thread that follows its own skill and writes the design files without a card. **Record design** commits what a thread wrote, and **Discard draft…** takes an agent's unrecorded draft back (`gcf design discard`); a form save of the drafted part takes the draft along. The pillars, the vision, the glossary, a subsystem's purpose and each unit open in a form whose fields come from the core; a save goes through the core's checks, a refusal says why. A pillar is edited by its name, its id read-only (a changed name renames the id after the save); Retire. **Add unit** asks a subsystem, a type and a title, no id, and opens the new unit. A subsystem's purpose has **Draft with agent**. A unit's Drop, the design questions with their answer box, the designer's Export and Import. Until the first work, while steps are left, Command says how many and opens Design.
|
|
70
|
+
- **Keys**: `/` search, `i` a new inbox entry, `n` a new item, `j` / `k` between cards, Enter opens one, `r` runs the focused card (it asks), `1`–`7` a column, `?` Help, `g` then a letter goes to a screen (`g c` Command, `g b` Board, `g t` Chat, `g i` Inbox, `g d` Design, `g r` Runs, `g p` Playtest, `g e` Ended, `g a` Agent, `g m` Metrics, `g s` Settings; the nav's icons say theirs), Esc closes a dialog, Help, the item's or the detail window; none while a field has the focus. Board 0.16.0: the nav is a rail of icons, the project switcher sits at the header's left.
|
|
71
|
+
- **Lessons** (core 0.7.10, harness 0.9.2): what got in an agent's way, asked at the end of each session, lands in the inbox as the category Lesson, its kind (`tool`, `rules`, `framework`, `template`, `other`) the detail, with its item. The inbox filters them; a card shows `N lessons`, and the item's **Lessons** tab lists them with the inbox's buttons. A run's report line ends with `, N lessons`, and with `— code written outside aif-implement` when a session skipped that skill.
|
|
72
|
+
- **Playtest**: `gcf playtest session` with the checklist grouped by subsystem; keep, tune or kill each item from the list. **Build** runs `dod.build`. A note goes to the inbox as `--category playtest`.
|
|
71
73
|
- **Ended**: history (accepted) and graveyard (killed, dropped, won't-fix); a line opens the item's History.
|
|
72
74
|
- **Metrics**: `gcf-harness metrics --json` of the project — how many runs reached submit or close, what they cost, handoffs, plan checks, DoD attempts, guard firings, block reasons — and, with harness 0.9.5, the cost per item over all its runs and per week and day.
|
|
73
75
|
|
package/dist/server/app.js
CHANGED
|
@@ -11,7 +11,7 @@ import { lstat, mkdtemp, readFile, rm, stat } from 'node:fs/promises';
|
|
|
11
11
|
import { pipeline } from 'node:stream/promises';
|
|
12
12
|
import os from 'node:os';
|
|
13
13
|
import path from 'node:path';
|
|
14
|
-
import { BOARD_SCHEMA, } from '../shared/board.js';
|
|
14
|
+
import { BOARD_SCHEMA, runModeOf, } from '../shared/board.js';
|
|
15
15
|
import { admit, cookieName, hostAllowed, tokenInUrl } from './auth.js';
|
|
16
16
|
import { briefError, runCli } from './cli.js';
|
|
17
17
|
import { broadcast, planRev, SESSION_TTL_MIN, subscribe, watchProject } from './events.js';
|
|
@@ -20,9 +20,9 @@ import { attachmentOf, follow, followLog, logPart, readShown, shownShape } from
|
|
|
20
20
|
import { HttpError } from './http-error.js';
|
|
21
21
|
import { isCenterMove, moveArgs, moveInput, runIds } from './moves.js';
|
|
22
22
|
import { addProject, listProjects, projectOf, removeProject } from './registry.js';
|
|
23
|
-
import {
|
|
24
|
-
import { adoptRuns, keepProjects, sweepRuns, closeReport, forgetProject, resumeQueue, runsOf, startRun, unqueue, } from './runs.js';
|
|
25
|
-
import { acceptProposal, agentPresets, chatCard, chatOf, entryTalk, listTalks, openTalk, pickTalk, prepareTalk, startTalk, stopTalk, talkEntry, talkId, talkLive, talkSaid, talkWaits, watchTalks, writeTalk, } from './talks.js';
|
|
23
|
+
import { allThemes } from './themes.js';
|
|
24
|
+
import { adoptRuns, busyCheck, keepProjects, sweepRuns, closeReport, forgetProject, resumeQueue, runsOf, startRun, unqueue, } from './runs.js';
|
|
25
|
+
import { acceptProposal, agentDefaults, agentPresets, chatCard, chatOf, designTalk, entryTalk, listTalks, openTalk, pickTalk, prepareTalk, startTalk, stopTalk, talkEntry, talkId, talkLive, talkSaid, talkWaits, watchTalks, writeTalk, } from './talks.js';
|
|
26
26
|
import { threadDir, threadOfEntry } from 'gcf-session';
|
|
27
27
|
const send = (res, status, body) => {
|
|
28
28
|
res.writeHead(status, { 'content-type': 'application/json; charset=utf-8' });
|
|
@@ -97,8 +97,34 @@ function runAgent(body) {
|
|
|
97
97
|
}
|
|
98
98
|
return pick.model || pick.effort ? pick : undefined;
|
|
99
99
|
}
|
|
100
|
-
// The Drafts whose first message goes now, `<project path> <entry>`: a second click sends none
|
|
100
|
+
// The Drafts whose first message goes now, `<project path> <entry>`: a second click sends none;
|
|
101
|
+
// the design starts that send now, `<project path> start <key>`.
|
|
101
102
|
const drafting = new Set();
|
|
103
|
+
// A design start's body: a GDD up to 5 MB, its JSON escaping on top.
|
|
104
|
+
const GDD_MAX = 5_000_000;
|
|
105
|
+
const GDD_BODY_MAX = 2 * GDD_MAX;
|
|
106
|
+
/** `item new`'s words with the id the core made in a dry run: after `new`, before the flags. */
|
|
107
|
+
export function withItemId(args, id) {
|
|
108
|
+
const at = args.indexOf('new');
|
|
109
|
+
return at < 0 ? args : [...args.slice(0, at + 1), id, ...args.slice(at + 1)];
|
|
110
|
+
}
|
|
111
|
+
/** What a design start was given: an uploaded GDD, a unit id, a subsystem, the operator's words. */
|
|
112
|
+
function startGiven(b) {
|
|
113
|
+
const f = b.file;
|
|
114
|
+
if (f !== undefined && (typeof f?.name !== 'string' || typeof f.text !== 'string'))
|
|
115
|
+
throw new HttpError(400, 'file is {name, text}');
|
|
116
|
+
if (f && Buffer.byteLength(f.text) > GDD_MAX)
|
|
117
|
+
throw new HttpError(413, 'a GDD of 5 MB at most');
|
|
118
|
+
for (const k of ['unit', 'system', 'text'])
|
|
119
|
+
if (b[k] !== undefined && typeof b[k] !== 'string')
|
|
120
|
+
throw new HttpError(400, `${k} must be text`);
|
|
121
|
+
return {
|
|
122
|
+
...(f ? { file: { name: f.name, text: f.text } } : {}),
|
|
123
|
+
...(typeof b.unit === 'string' ? { unit: b.unit } : {}),
|
|
124
|
+
...(typeof b.system === 'string' ? { system: b.system } : {}),
|
|
125
|
+
...(typeof b.text === 'string' ? { text: b.text } : {}),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
102
128
|
/** The project's HEAD commit, or null: a new commit (a move, a merge) tells an open History. */
|
|
103
129
|
const headOf = (dir) => new Promise((resolve) => execFile('git', ['rev-parse', 'HEAD'], { cwd: dir, windowsHide: true }, (e, out) => resolve(e ? null : out.trim())));
|
|
104
130
|
/** Whether the usage limit holds for the account now (decision 22): Draft waits for its reset. */
|
|
@@ -262,7 +288,7 @@ export function createApp(o) {
|
|
|
262
288
|
const routes = [
|
|
263
289
|
['GET', /^\/api\/events$/, async (_req, res) => subscribe(res)],
|
|
264
290
|
['GET', /^\/api\/projects$/, async (_req, res) => send(res, 200, await listProjects())],
|
|
265
|
-
['GET', /^\/api\/themes$/, async (_req, res) => send(res, 200, await
|
|
291
|
+
['GET', /^\/api\/themes$/, async (_req, res) => send(res, 200, await allThemes())],
|
|
266
292
|
[
|
|
267
293
|
'POST',
|
|
268
294
|
/^\/api\/projects$/,
|
|
@@ -301,6 +327,7 @@ export function createApp(o) {
|
|
|
301
327
|
board_version: o.version,
|
|
302
328
|
quota: await lastQuota(),
|
|
303
329
|
presets: agentPresets(),
|
|
330
|
+
defaults: agentDefaults(),
|
|
304
331
|
head: await headOf(p.path),
|
|
305
332
|
};
|
|
306
333
|
const board = await boardOf(p);
|
|
@@ -602,7 +629,8 @@ export function createApp(o) {
|
|
|
602
629
|
/^\/api\/p\/([^/]+)\/move$/,
|
|
603
630
|
async (req, res, m) => {
|
|
604
631
|
const p = await projectOf(m[1]);
|
|
605
|
-
|
|
632
|
+
// A designer's bundle comes back through a move: as large as a GDD.
|
|
633
|
+
const body = await bodyOf(req, GDD_BODY_MAX);
|
|
606
634
|
const domain = isCenterMove(body.cmd)
|
|
607
635
|
? undefined
|
|
608
636
|
: (domains.get(p.name) ?? (await boardOf(p)).domain);
|
|
@@ -620,7 +648,7 @@ export function createApp(o) {
|
|
|
620
648
|
board.inbox?.some((e) => e.id === entry))
|
|
621
649
|
body.from = entry;
|
|
622
650
|
}
|
|
623
|
-
|
|
651
|
+
let args = moveArgs(body, domain?.moves);
|
|
624
652
|
const run = () => cli(p, args, undefined, moveInput(body, domain?.moves));
|
|
625
653
|
// An agent's proposal made (AD-16, AD-33): its record goes with the move.
|
|
626
654
|
const { talk, id } = (body.proposal ?? {});
|
|
@@ -633,9 +661,26 @@ export function createApp(o) {
|
|
|
633
661
|
// Only a move an agent may propose: a line planted in the chat is no proposal of one.
|
|
634
662
|
if (!domain?.moves[String(body.cmd)]?.propose)
|
|
635
663
|
throw new HttpError(400, `${String(body.cmd)} is not a move an agent proposes`);
|
|
664
|
+
// An agent's entry is the agent's (decision 32): the server says so, never the body.
|
|
665
|
+
if (body.cmd === domain?.sections.inbox?.add)
|
|
666
|
+
args = [...args, '--origin=agent'];
|
|
667
|
+
// A new item's id is the core's (decision 34): asked first, then given, so a board that
|
|
668
|
+
// stops after the item is made finds it by that id and does not make it twice.
|
|
669
|
+
if (body.cmd === domain?.new_item) {
|
|
670
|
+
const dryArgs = [...args.filter((a) => a !== '--commit'), '--dry-run'];
|
|
671
|
+
const dry = await cli(p, dryArgs, undefined, moveInput(body, domain?.moves));
|
|
672
|
+
if (!dry.ok) {
|
|
673
|
+
send(res, 200, { ok: false, out: dry.out.trim(), err: briefError(dry.err) });
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
body.id = dry.out.trim().split(/\s/)[0];
|
|
677
|
+
// Its commit names the proposal: a recovery tells it from another's of one id.
|
|
678
|
+
args = [...withItemId(args, String(body.id)), `--proposal=${talk}/${id}`];
|
|
679
|
+
}
|
|
680
|
+
const mark = body.cmd === domain?.new_item ? `${talk}/${id}` : undefined;
|
|
636
681
|
const item = typeof body.id === 'string' ? body.id : '';
|
|
637
682
|
const ids = idsOf(await boardOf(p));
|
|
638
|
-
r = await acceptProposal(p, talk, id, String(body.cmd), item, ids, run);
|
|
683
|
+
r = await acceptProposal(p, talk, id, String(body.cmd), item, ids, run, mark);
|
|
639
684
|
broadcast({ type: 'talks', project: p.name });
|
|
640
685
|
}
|
|
641
686
|
broadcast({ type: 'board', project: p.name });
|
|
@@ -710,19 +755,95 @@ export function createApp(o) {
|
|
|
710
755
|
send(res, created ? 201 : 200, { thread: id, created });
|
|
711
756
|
},
|
|
712
757
|
],
|
|
758
|
+
[
|
|
759
|
+
// A design start (Board-PRD §5.24): a thread of its own follows the start's skill, its
|
|
760
|
+
// first message sent at once. Each click is a thread of its own; one that is still
|
|
761
|
+
// sending refuses a second.
|
|
762
|
+
'POST',
|
|
763
|
+
/^\/api\/p\/([^/]+)\/start\/([a-z0-9][a-z0-9-]*)$/,
|
|
764
|
+
async (req, res, m) => {
|
|
765
|
+
const p = await projectOf(m[1]);
|
|
766
|
+
const body = await bodyOf(req, GDD_BODY_MAX);
|
|
767
|
+
const board = await boardOf(p);
|
|
768
|
+
chatOf(board);
|
|
769
|
+
const key = `${p.path} start ${m[2]}`;
|
|
770
|
+
if (drafting.has(key))
|
|
771
|
+
throw new HttpError(409, `${m[2]} is starting already`);
|
|
772
|
+
if (limitHolds(await lastQuota()))
|
|
773
|
+
throw new HttpError(409, 'the usage limit holds for the account: start after its reset');
|
|
774
|
+
drafting.add(key);
|
|
775
|
+
try {
|
|
776
|
+
const { id, say } = designTalk(p, board, m[2], startGiven(body));
|
|
777
|
+
await prepareTalk(p, board, id);
|
|
778
|
+
await sendTalk(p, id, { type: 'say', text: say }, board);
|
|
779
|
+
broadcast({ type: 'talks', project: p.name });
|
|
780
|
+
send(res, 201, { thread: id });
|
|
781
|
+
}
|
|
782
|
+
finally {
|
|
783
|
+
drafting.delete(key);
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
],
|
|
787
|
+
[
|
|
788
|
+
// One part of the design as its form shows it (`gcf design part`, core 0.17).
|
|
789
|
+
'GET',
|
|
790
|
+
/^\/api\/p\/([^/]+)\/design\/part$/,
|
|
791
|
+
async (_req, res, m, url) => {
|
|
792
|
+
const p = await projectOf(m[1]);
|
|
793
|
+
const [kind, name, type] = ['kind', 'name', 'type'].map((k) => url.searchParams.get(k));
|
|
794
|
+
if (!['doc', 'system', 'unit'].includes(kind ?? ''))
|
|
795
|
+
throw new HttpError(400, 'kind is doc, system or unit');
|
|
796
|
+
if (!SLUG.test(name ?? '') || (type !== null && !SLUG.test(type)))
|
|
797
|
+
throw new HttpError(400, 'name and type are lowercase hyphen slugs');
|
|
798
|
+
const args = ['gcf', 'design', 'part', String(kind), String(name), '--json'];
|
|
799
|
+
const r = await cli(p, type ? [...args, '--type', type] : args);
|
|
800
|
+
if (!r.ok)
|
|
801
|
+
throw new HttpError(400, briefError(r.err || r.out));
|
|
802
|
+
send(res, 200, jsonOf(r, 'gcf design part'));
|
|
803
|
+
},
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
// The design as one bundle a designer edits (`gcf design export`): a download.
|
|
807
|
+
'GET',
|
|
808
|
+
/^\/api\/p\/([^/]+)\/design\/export$/,
|
|
809
|
+
async (_req, res, m) => {
|
|
810
|
+
const r = await cli(await projectOf(m[1]), ['gcf', 'design', 'export']);
|
|
811
|
+
if (!r.ok)
|
|
812
|
+
throw new HttpError(500, briefError(r.err || r.out));
|
|
813
|
+
res.writeHead(200, {
|
|
814
|
+
'content-type': 'text/markdown; charset=utf-8',
|
|
815
|
+
'content-disposition': 'attachment; filename="design.md"',
|
|
816
|
+
'x-content-type-options': 'nosniff',
|
|
817
|
+
'content-security-policy': "default-src 'none'",
|
|
818
|
+
});
|
|
819
|
+
res.end(r.out);
|
|
820
|
+
},
|
|
821
|
+
],
|
|
713
822
|
[
|
|
714
823
|
'POST',
|
|
715
824
|
/^\/api\/p\/([^/]+)\/run$/,
|
|
716
825
|
async (req, res, m) => {
|
|
717
826
|
const p = await projectOf(m[1]);
|
|
718
827
|
const body = await bodyOf(req);
|
|
719
|
-
const
|
|
720
|
-
|
|
828
|
+
const board = await boardOf(p);
|
|
829
|
+
const { harness } = board.domain;
|
|
830
|
+
if (!harness)
|
|
721
831
|
throw new HttpError(400, 'this project has no harness: its items run from a console');
|
|
832
|
+
if (body.mode !== undefined && body.mode !== 'main' && body.mode !== 'worktree')
|
|
833
|
+
throw new HttpError(400, `mode is main or worktree: ${String(body.mode)}`);
|
|
722
834
|
const ids = runIds(body);
|
|
723
835
|
const fresh = body.fresh === true;
|
|
724
836
|
const agent = runAgent(body);
|
|
725
|
-
|
|
837
|
+
// One run per mode: a main one queues behind the main run going, a worktree one starts.
|
|
838
|
+
const parts = Map.groupBy(ids, (id) => runModeOf(board, id, body.mode));
|
|
839
|
+
// Each part checks first: a refused one starts no other.
|
|
840
|
+
for (const part of parts.values())
|
|
841
|
+
busyCheck(p, part);
|
|
842
|
+
const started = [...parts].map(([mode, part]) => startRun(o.entry, p, part, mode, fresh, harness, agent));
|
|
843
|
+
send(res, 202, {
|
|
844
|
+
started: started.flatMap((s) => s.started ?? []),
|
|
845
|
+
queued: started.flatMap((s) => s.queued ?? []),
|
|
846
|
+
});
|
|
726
847
|
},
|
|
727
848
|
],
|
|
728
849
|
[
|
package/dist/server/moves.js
CHANGED
|
@@ -92,8 +92,13 @@ function fieldArgs(f, b) {
|
|
|
92
92
|
return many(b, f.key, flag);
|
|
93
93
|
if (f.kind === 'remove')
|
|
94
94
|
return remove(b, f.key, flag);
|
|
95
|
-
if (f.kind === 'ids')
|
|
96
|
-
|
|
95
|
+
if (f.kind === 'ids') {
|
|
96
|
+
const ids = idList(b, f.key, flag);
|
|
97
|
+
// One id only (a parent): a list is no value of it.
|
|
98
|
+
if (f.single && String(ids[0] ?? '').includes(','))
|
|
99
|
+
throw new HttpError(400, `${f.key} is one id`);
|
|
100
|
+
return ids;
|
|
101
|
+
}
|
|
97
102
|
if (f.kind === 'tags')
|
|
98
103
|
return tagList(b, f.key, flag);
|
|
99
104
|
if (f.kind === 'choice')
|
|
@@ -101,6 +106,8 @@ function fieldArgs(f, b) {
|
|
|
101
106
|
// Its text goes on stdin (moveInput): the file `-`.
|
|
102
107
|
if (f.stdin)
|
|
103
108
|
return (f.required ? required(b, f.key) : text(b, f.key)) ? [`--${flag}-file=-`] : [];
|
|
109
|
+
if (f.clear && b[f.key] === '')
|
|
110
|
+
return [`--${flag}=`];
|
|
104
111
|
return f.required ? [`--${flag}=${required(b, f.key)}`] : opt(b, f.key, flag);
|
|
105
112
|
}
|
|
106
113
|
/** A move by its domain form: its words with the target, then each field that goes. */
|
package/dist/server/propose.js
CHANGED
|
@@ -6,6 +6,16 @@ const TAG = '^[a-z0-9][a-z0-9:-]{0,39}$';
|
|
|
6
6
|
export const toolOf = (key) => `propose_${key.replaceAll('-', '_')}`;
|
|
7
7
|
/** The fields an agent may propose: the form's, without the hidden ones and the run's. */
|
|
8
8
|
export const proposed = (spec) => spec.fields.filter((f) => !f.hidden && !NOT_PROPOSED.has(f.key));
|
|
9
|
+
/**
|
|
10
|
+
* Whether a move acts on an item or an inbox entry already there (`{id}` in its words, no field
|
|
11
|
+
* of its own names it): the agent names it in `id`.
|
|
12
|
+
*/
|
|
13
|
+
export const targeted = (spec) => spec.args.includes('{id}') && !spec.fields.some((f) => f.key === 'id');
|
|
14
|
+
const TARGET = {
|
|
15
|
+
type: 'string',
|
|
16
|
+
pattern: SLUG,
|
|
17
|
+
description: 'The id of the item it acts on (of the inbox entry, for an inbox move).',
|
|
18
|
+
};
|
|
9
19
|
/** The schema of one field by its kind; every kind has one (`never` holds the switch whole). */
|
|
10
20
|
export function fieldSchema(f) {
|
|
11
21
|
const about = [f.label, f.help].filter(Boolean).join(': ');
|
|
@@ -27,7 +37,12 @@ export function fieldSchema(f) {
|
|
|
27
37
|
s = { type: 'array', items: { type: 'string' } };
|
|
28
38
|
break;
|
|
29
39
|
case 'ids':
|
|
30
|
-
|
|
40
|
+
// A parent is one id: a list of two is no value of it.
|
|
41
|
+
s = {
|
|
42
|
+
type: 'array',
|
|
43
|
+
items: { type: 'string', pattern: SLUG },
|
|
44
|
+
...(f.single && { maxItems: 1 }),
|
|
45
|
+
};
|
|
31
46
|
break;
|
|
32
47
|
case 'tags':
|
|
33
48
|
s = { type: 'array', items: { type: 'string', pattern: TAG } };
|
|
@@ -53,10 +68,17 @@ export function fieldSchema(f) {
|
|
|
53
68
|
/** A move's tool input schema: an object of its proposed fields, nothing else. */
|
|
54
69
|
export function toolSchema(spec) {
|
|
55
70
|
const fields = proposed(spec);
|
|
71
|
+
const target = targeted(spec);
|
|
56
72
|
return {
|
|
57
73
|
type: 'object',
|
|
58
|
-
properties:
|
|
59
|
-
|
|
74
|
+
properties: {
|
|
75
|
+
...(target && { id: TARGET }),
|
|
76
|
+
...Object.fromEntries(fields.map((f) => [f.key, fieldSchema(f)])),
|
|
77
|
+
},
|
|
78
|
+
required: [
|
|
79
|
+
...(target ? ['id'] : []),
|
|
80
|
+
...fields.filter((f) => f.required && !f.when).map((f) => f.key),
|
|
81
|
+
],
|
|
60
82
|
additionalProperties: false,
|
|
61
83
|
};
|
|
62
84
|
}
|
|
@@ -70,8 +92,13 @@ export function checkProposal(spec, args) {
|
|
|
70
92
|
const fields = new Map(spec.fields.map((f) => [f.key, f]));
|
|
71
93
|
const values = Object.fromEntries(spec.fields.filter((f) => f.default !== undefined).map((f) => [f.key, f.default]));
|
|
72
94
|
const problems = [];
|
|
95
|
+
const target = targeted(spec);
|
|
96
|
+
if (target && (typeof args.id !== 'string' || !new RegExp(SLUG).test(args.id)))
|
|
97
|
+
problems.push('id is required: the item (or inbox entry) it acts on');
|
|
73
98
|
for (const [key, v] of Object.entries(args)) {
|
|
74
99
|
const f = fields.get(key);
|
|
100
|
+
if (target && key === 'id')
|
|
101
|
+
continue;
|
|
75
102
|
if (!f)
|
|
76
103
|
problems.push(`${key} is not a field of this move`);
|
|
77
104
|
else if (f.hidden || NOT_PROPOSED.has(key))
|
package/dist/server/runs.js
CHANGED
|
@@ -358,7 +358,8 @@ function spawnRun(q, mode) {
|
|
|
358
358
|
const effort = q.agent?.effort ?? null;
|
|
359
359
|
const run = { project: p.name, ids, started: new Date().toISOString(), mode, model, effort };
|
|
360
360
|
active.add(run);
|
|
361
|
-
|
|
361
|
+
// The board says where it goes: it queued it by that mode (an item's own, the run's pick).
|
|
362
|
+
const args = [entry, harness, 'run', ...ids, '--json', '--mode', mode];
|
|
362
363
|
if (q.fresh)
|
|
363
364
|
args.push('--fresh');
|
|
364
365
|
// This run's pick: the items keep their own (Board-V2-Data-Plan §2.5).
|
|
@@ -622,20 +623,25 @@ export function adoptRuns(entry, p) {
|
|
|
622
623
|
}
|
|
623
624
|
changed(p.name);
|
|
624
625
|
}
|
|
626
|
+
/** A 409 for the ids a run of this board drives or queues: a second click on the same card. */
|
|
627
|
+
export function busyCheck(p, ids) {
|
|
628
|
+
const { active: going, queued } = runsOf(p.name);
|
|
629
|
+
const busy = ids.filter((id) => queued.includes(id) || going.some((r) => r.ids.includes(id)));
|
|
630
|
+
if (busy.length)
|
|
631
|
+
throw new HttpError(409, `already running from this board: ${busy.join(', ')}`);
|
|
632
|
+
}
|
|
625
633
|
/**
|
|
626
|
-
* Start a batch in the
|
|
627
|
-
* is a run report with the harness report, or what went wrong.
|
|
628
|
-
* sessions where the harness would resume the interrupted ones.
|
|
629
|
-
* (`domain.harness`); the tests take GCF's. Its sessions are open to
|
|
630
|
-
* `agent`: a model and effort for this run only, over each item's own.
|
|
634
|
+
* Start a batch in run mode `mode` (the harness's `--mode`), or queue a main one behind the
|
|
635
|
+
* main run going on. Its end is a run report with the harness report, or what went wrong.
|
|
636
|
+
* `fresh` starts new agent sessions where the harness would resume the interrupted ones.
|
|
637
|
+
* `harness` is the domain's (`domain.harness`); the tests take GCF's. Its sessions are open to
|
|
638
|
+
* the operator's chat. `agent`: a model and effort for this run only, over each item's own.
|
|
631
639
|
*/
|
|
632
640
|
export function startRun(entry, p, ids, mode = 'worktree', fresh = false, harness = 'gcf-harness', agent) {
|
|
633
641
|
// A second click on the same card: the harness would refuse it on its lock, noisily.
|
|
634
642
|
paths.set(p.name, p.path);
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
if (busy.length)
|
|
638
|
-
throw new HttpError(409, `already running from this board: ${busy.join(', ')}`);
|
|
643
|
+
busyCheck(p, ids);
|
|
644
|
+
const { active: going } = runsOf(p.name);
|
|
639
645
|
// A paused queue holds a new main run too: it would repeat the failure, and jump the queue.
|
|
640
646
|
if (mode === 'main' && (paused.has(p.name) || going.some((r) => r.mode === 'main'))) {
|
|
641
647
|
queues.set(p.name, [
|