gcf-board 0.23.0 → 0.24.1

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 CHANGED
@@ -46,7 +46,7 @@ The board knows no domain by name: the project's board read gives its columns, m
46
46
  - **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.
47
47
  - **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}`).
48
48
  - **Log** (board 0.20.1, gcf-session 0.18.1): a subagent's lines say so (`subagent:`, `subagent tool:`, `subagent tool error:`), drawn as the main agent's kinds; the pulse's current action names a subagent's call as one.
49
- - **Play** (board 0.23.0, core 0.25.0): a card waiting for play shows its own build, **Play** per target of `play:`, **Stop** and **Build**, on its run's end card, in its window and on Playtest; a verdict stops the player and removes the build.
49
+ - **Play** (board 0.24.0, core 0.26.0): a card waiting for play shows its build (one per code, `Same build as` when shared), **Play** per target of `play:` that builds first when there is none, **Stop** and **Change** (find again with agent, edit, build again), on its run's end card, in its window and on Playtest; **Set up** opens a chat thread whose agent finds the commands, **by hand** opens the form; **Play main** and **Build main** play the checkout as it is; a verdict stops the card's player and removes a build no other card holds.
50
50
  - **Amend** (board 0.21.0, core 0.23.0): under "more" on a card: the form opens on its text, shows old and new lines before the move, and refuses an edit made meanwhile with the text you typed kept beside it. A chat agent's proposal shows the same lines. During that card's run it is refused, and the proposal offers **Send to the run**, to a live session only.
51
51
  - **Run again** (board 0.20.1): an item a main batch has ended, blocked for one, can be run again while the batch goes on: it queues behind the batch. An item the batch works or has yet to reach is still refused with `already running from this board`, and so is every item of a worktree batch until that batch ends.
52
52
  - **Changes** (board 0.20.0, core 0.22.0): what is not committed and how it differs, view only: the agent commits. The header's `● 7 changed` counts the main checkout, and says `run writing in main` while a run works there; the screen switches between the main checkout and each run's worktree. A text file opens its diff, a picture its before and after; a binary file, the project's `no_diff:` globs (one glob a line in Settings), links, submodules, nested repositories and Git LFS files are listed and open nothing. It follows a move, a commit or an add at once, a save in an editor within 30 s.
@@ -765,12 +765,23 @@ export function createApp(o) {
765
765
  throw new HttpError(400, `${what} is one word`);
766
766
  return v;
767
767
  };
768
+ const flag = (v, what) => {
769
+ if (v !== undefined && typeof v !== 'boolean')
770
+ throw new HttpError(400, `${what} is true or false`);
771
+ return v === true;
772
+ };
773
+ // A card, or the checkout as it is ("Play main", docs/Play-Setup-Plan.md d30).
774
+ const who = () => (flag(body.main, 'main') ? ['--main'] : [word(body.id, 'id')]);
768
775
  const args = m[2] === 'stop'
769
776
  ? ['gcf', 'playtest', 'stop', '--json']
770
777
  : m[2] === 'build'
771
- ? ['gcf', 'playtest', 'build', word(body.id, 'id'), '--json']
778
+ ? [
779
+ ...['gcf', 'playtest', 'build', ...who(), '--json'],
780
+ // "Build again" (d23): a snapshot of the same code is replaced, not taken.
781
+ ...(flag(body.fresh, 'fresh') ? ['--fresh'] : []),
782
+ ]
772
783
  : [
773
- ...['gcf', 'playtest', 'start', word(body.id, 'id'), '--json'],
784
+ ...['gcf', 'playtest', 'start', ...who(), '--json'],
774
785
  ...['--target', word(body.target, 'target')],
775
786
  ];
776
787
  // A build of a real game takes minutes.
@@ -140,11 +140,18 @@ export function talkSpec(p, board, mcp, start = null) {
140
140
  return {
141
141
  agent: process.env.GCF_SESSION_AGENT ?? DEFAULT_AGENT,
142
142
  rules: {
143
- deny: [...rules.deny, { kind: 'edit', pattern: '.gcf-session/**' }, ...homeRules()],
143
+ // A rule of a run's own (`run_only`, Play-Setup-Plan d32) is no thread's: the chat agent
144
+ // builds the game when the human asks.
145
+ deny: [
146
+ ...rules.deny.filter((r) => !r.run_only),
147
+ { kind: 'edit', pattern: '.gcf-session/**' },
148
+ ...homeRules(),
149
+ ],
144
150
  // Claude holds ask over allow: the blanket edit ask would shadow the start's edits. The
145
- // agent's own instructions and settings still ask, whatever the project allows.
151
+ // agent's own instructions and settings still ask, whatever the project allows. A start
152
+ // with no edits of its own keeps the edit ask: it would write files without a card.
146
153
  ask: [
147
- ...(own ? [...ASK.filter((r) => r.kind !== 'edit'), ...OWN_FILES] : ASK),
154
+ ...(own?.edits?.length ? [...ASK.filter((r) => r.kind !== 'edit'), ...OWN_FILES] : ASK),
148
155
  ...chat.confirm,
149
156
  ],
150
157
  // The center's own MCP server only proposes: the proposal card's Create is the
@@ -200,17 +207,21 @@ function playLines(board, item) {
200
207
  return [
201
208
  '',
202
209
  'To play it: how to play is not set up (no `play:` in gcf/config.yml), so it has no build.',
203
- "If the project's AGENTS.md says how the game builds and starts, call propose_play_setup.",
210
+ 'Find in the project (AGENTS.md, its build and serve scripts) the command that builds the',
211
+ 'game into a folder git ignores and the one that starts it from there, and call',
212
+ 'propose_play_setup; never ask the human for the commands. If the project has none, propose',
213
+ 'a tech card with propose_item_new that adds them and names them in AGENTS.md.',
204
214
  '',
205
215
  ];
206
216
  const b = item.build;
207
217
  const targets = board.play.targets.map((t) => `${t.name} (${t.open})`).join(', ') || 'none';
218
+ const shared = b?.shared_with?.length ? ` The same build as ${b.shared_with.join(', ')}.` : '';
208
219
  const said = b?.building
209
220
  ? 'its build is being made now.'
210
221
  : b?.ok
211
- ? `its build is ready: commit ${b.commit ?? 'unknown'}, built ${b.built_at}, ` +
212
- `${b.source === 'click' ? 'by hand, so it may hold later cards' : 'by its run'}.`
213
- : 'it has no build yet.';
222
+ ? `its build is ready: commit ${b.commit?.slice(0, 7) ?? 'unknown'}, built ${b.built_at}, ` +
223
+ `${b.source === 'click' ? 'by hand, so it may hold later cards' : 'by its run'}.${shared}`
224
+ : 'it has no build yet: its Play button builds it first.';
214
225
  const running = board.play.running?.id === item.id
215
226
  ? [`It plays now on ${board.play.running.target}: ${board.play.running.open}.`]
216
227
  : [];
@@ -220,8 +231,11 @@ function playLines(board, item) {
220
231
  ...(b?.problem ? [`The last build failed: ${b.problem.split('\n')[0]}`] : []),
221
232
  ...running,
222
233
  `Targets: ${targets}.`,
223
- 'Do not ask the human to build or start it by hand: the card has its Play and Build buttons;',
224
- 'to offer one here call propose_play with its id and a target. The verdict stops the player.',
234
+ 'Never answer that you cannot build it: the card has its Play button, which builds first;',
235
+ 'offer it here with propose_play (its id and a target), or the checkout as it is with',
236
+ 'propose_play_main. When the human asks you to build, run',
237
+ '`ai-factory gcf playtest build <id>` or `ai-factory gcf playtest build --main` yourself.',
238
+ 'Cards on the same code share one build. The verdict stops the player.',
225
239
  '',
226
240
  ];
227
241
  }
@@ -387,10 +401,11 @@ export function designTalk(p, board, start, given) {
387
401
  }
388
402
  }
389
403
  const say = s.say
390
- .replaceAll('{file}', file)
391
- .replaceAll('{unit}', given.unit ?? '')
392
- .replaceAll('{system}', given.system ?? '')
393
- .replaceAll('{text}', text);
404
+ // Functions: a `$` in the words (a shell command) is no replacement pattern.
405
+ .replaceAll('{file}', () => file)
406
+ .replaceAll('{unit}', () => given.unit ?? '')
407
+ .replaceAll('{system}', () => given.system ?? '')
408
+ .replaceAll('{text}', () => text);
394
409
  return { id: t, say };
395
410
  }
396
411
  /**
@@ -532,7 +547,10 @@ export function deniedGroupOf(events) {
532
547
  const start = events.findLastIndex((e) => e.type === 'session' && e.kind === 'start');
533
548
  const denied = events.slice(Math.max(0, start)).filter((e) => e.type === 'denied');
534
549
  const group = denied.at(-1)?.group ?? null;
535
- return group && !['git-history', 'git-destroy', 'human-moves'].includes(group) ? group : null;
550
+ // `run-play`: a run builds by the harness, never by its agent (Play-Setup-Plan d32).
551
+ return group && !['git-history', 'git-destroy', 'human-moves', 'run-play'].includes(group)
552
+ ? group
553
+ : null;
536
554
  }
537
555
  export function chatEvents(file) {
538
556
  let text = '';