Skip to content

terragucci reads: the reports project follows the checkout ?repo= names (behold#749) - #750

Merged
lex00 merged 1 commit into
mainfrom
tg-project-per-repo
Oct 19, 2026
Merged

lex00 merged 1 commit into
mainfrom
tg-project-per-repo

Conversation

@lex00

@lex00 lex00 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Closes #749

Under serve --repos the kiosk frame switches ?repo= per scenario, but --terragucci-project pinned every request to one project. A frame for fan-out-tofu on a serve pinned to demo-choudoufu-fanout drew choudoufu's plan.

The mapping

I went with deriving it rather than a repeatable --terragucci-project <repo>=<project>. The serve already knows each checkout's remote, and the index already lists the projects.

  • A checkout's project is its remote's <host>/<path> when the index has that, else the one project in the index with the same <owner>/<name> (matchProject). The demo host's checkouts come from localhost:3300/terragucci-admin/<name> and the pipeline names forgejo:3000/terragucci-admin/<name>, so the host can't be the key. If two hosts carry the same path, neither matches.
  • --terragucci-project names the project of the command line's checkout only. A request whose ?repo= names any other checkout (readsOtherRepo) reads that checkout's own project, or none. This applies to /api/terragucci, the run view (/api/terragucci/progress) and the timeline. /api/project reports the pin only for the serve's own checkout.
  • When nothing matches for another checkout, the read is refused (422). It doesn't fall back to the pin or to the index's only project, so that frame draws no plan.

Single-repo serve

Nothing changes when there is no --repos, or for requests about the serve's own checkout. The one difference: a serve with no pin, whose remote matches a project by <owner>/<name> only, now picks that project. Before, it refused and asked for --terragucci-project.

Tests

src/terragucci-repos-project.test.ts covers matchProject, strict and non-strict pickProject, and the strict timeline. Over the example bucket with two projects it checks that, on a pinned serve with --repos, the serve's own checkout reads the pin and another checkout reads its own project; that a checkout with no project gets 422 from both the reports and the run view; that /api/project reports the pin correctly; and that single-repo serves behave as before.

npm test (232 files pass), tsc and npm run build pass.

🤖 Generated with Claude Code

…es, by <owner>/<name> (behold#749)

Under serve --repos the kiosk frame switches ?repo= per scenario, but
--terragucci-project pinned every request to one project, so a frame for
fan-out-tofu drew fan-out-choudoufu's plan and run view.

- --terragucci-project now names the command line checkout's project only.
  A request whose ?repo= names another checkout (view-repos.ts
  readsOtherRepo) reads that checkout's own project, or none: the reports,
  the run view (progress) and the timeline all take `strict`.
- The project is the checkout remote's <host>/<path> when the index has it,
  else the one project with the same <owner>/<name> (matchProject): the
  demo host clones from localhost:3300/terragucci-admin/<name> while its
  pipeline names forgejo:3000/terragucci-admin/<name>. Two hosts with the
  same path name none.
- A strict pick with no match refuses (422), never falling back to the
  pin or the index's only project, so that frame draws no plan.
- A single-repo serve reads as before; one with no pin whose remote matches
  by <owner>/<name> now picks that project where it used to ask for one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lex00

lex00 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Live check, on the shared stack's loop (terragucci demo-fanout-all 7fe79aa1, cycle 603):

🤖 Generated with Claude Code

@lex00
lex00 merged commit 246c477 into main Oct 19, 2026
3 checks passed
@lex00 lex00 mentioned this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kiosk: reports, plan and run view follow the scenario's repo, not the serve's one --terragucci-project

1 participant