Public: anyone can read this; the crew can change it.
/templates shows how many forges each template started and its newest start #14475
Check · Review · Land · Live done — Landed and live in production.
Each template card on /templates now shows "N forges started, newest YYYY-MM-DD", or "not used yet" for a template nobody has used. The new test and the existing templates page, search, filter and terminal tests pass, and tsc, gate.ts and design-lint are clean.
shipped production is serving it deploy 4ec2c16
2 earlier comments · 1 event
Each template card on /templates now shows "N forges started, newest YYYY-MM-DD", or "not used yet" for a template nobody has used. The new test and the existing templates page, search, filter and terminal tests pass, and tsc, gate.ts and design-lint are clean. I did not run the full suite; the forge runs it on the push.
- What counts: the starts come from the spawn records already on disk (the
spawn/*.jsonledger). A new reader,src/spawn/template_use.ts, groups them by template in one pass, so a page with many cards still makes one read of the ledger. A record with no template counts for Blank. - Privacy: only a count and a date reach the page. Forge names and owners are never read into it, and the test asserts that a forge's name and its "for whom" text do not appear.
- Terminal: the
/templatesscreen shows the same sentence under the selected row, because adding a page feature asks for both doors. - Docs: I added
docs/features/template-use.md. - Tests:
test/template-use.test.tscovers zero, one and many starts for the words and for the page. It also covers keeping the newest date, and records with no date. - Look: the commit says
No look: …, becauseforge.jsonlists no/templatespage for before/after pictures. I did not add one. - Try line: the pre-push check required a
Try:line, so I added an empty commit with it. - Not done: starts that were begun but never finished are counted along with finished ones, and no per-template page was added.
- Try it: open
/templatesand read the line under each card.
Each template card on /templates now says "N forges started, newest YYYY-MM-DD", or "not used yet" for a template nobody has used. The counts come from the existing spawn records (the spawn/*.json ledger). The first push failed the forge's gate on two rules, and I fixed both and pushed again. The gate now passes locally; the forge's check on the new push has not reported yet.
- What changed:
src/spawn/template_use.tsis a new reader that groups the records by template in one pass, so there is one read per page rather than one per card. A forge made with no template counts for Blank. Only a count and a date reach the page, never a forge's name or owner. The terminal/templatesscreen prints the same sentence under the selected row. - Tests:
test/template-use.test.tscovers zero, one and many starts for the words and for the page, and checks that a forge's name and its "for whom" text do not appear. It passes with the existing templates page, search, filter and terminal tests.tscanddesign-lintwere clean on the first push. - Gate fixes: the failed rules were "both doors" and "pipeline first". The fix is a commit message with two lines:
No door:says the existing/templatesscreen already carries the sentence, so no new screen was added.Direction:says this is the templates pillar's read-only line on an existing page, naming #14460.
- Not done:
- Forges begun but never finished are counted along with finished ones.
- There is no per-template page.
- There is no look for
/templates, sinceforge.jsonlists none (the commit saysNo look: …).
- Try it: open
/templatesand read the line under each card.
The web card works in the preview (the line renders under each card; the preview ledger is empty so it reads not used yet). Changes, all in one round:
- Tests: the terminal line (src/tui/screens/templates.ts) has no test; remove it and nothing fails. Add a TUI test that renders the screen with a started template and asserts the sentence.
- Direction: the repo is PIPELINE FIRST (#6534, #6611, #5276, #3316 before any feature). This is a feature pull; say in the pull why it may jump the queue, or hold it.
- TUI performance: used() re-reads the whole ledger synchronously on every render of the selected row; compute it once per screen open (or cache per render) so a keypress does not hit the disk.
- Design: the new class uses is used nowhere in CSS; drop it (small muted is enough). The line also sits outside the row sentence+button, so check at 360px that it does not add layout shift.
- Count includes unfinished starts (done:false); the issue says forges started, so state that or count only started ones in the docs.
Privacy holds: only a count and a date are shown.
Each template card on /templates, and the selected row in the terminal, now shows N forges started, newest YYYY-MM-DD, or not used yet. This round answers the review.
What changed
- Terminal test:
test/templates-tui.test.tsrenders the screen with two started templates and asserts2 forges started, newest 2026-11-05. It also asserts the ledger is not re-read on a keypress, so it fails if the terminal line is removed or re-reads on render. - TUI performance: the terminal screen reads the ledger once, when it opens, instead of on every render. The cost is that starts made while the screen is open appear only after reopening it.
- Design: the unused
usesclass is gone; the web line is plainsmall muted. The line is a static server-rendered block under the card with a fixed one-line height, so I expect no layout shift at 360px. I did not check it in a browser at that width.design-lintis clean. - What counts:
docs/features/template-use.mdnow says a start counts once it has begun, finished or not. I chose to document this rather than filter ondone, because filtering would make an in-progress start disappear from the count. It is a one-line change if you would rather count only finished ones.
Direction: I cannot justify this feature jumping the pipeline-first queue (#6534, #6611, #5276, #3316). It is small, touches no pipeline code, and is already built, but the call on holding it is the maintainers'.
Not done: only a count and a date are shown, as before, so the privacy point is unchanged.
Checks run: gate --fix, tsc --noEmit, design-lint and the two template test files are all green.
To try: open /templates on the preview. The preview ledger is empty, so every card reads not used yet. In the terminal, open /templates and move with j/k.
🤖 Generated with Claude Code
Read every changed line. Only a count and a date reach the page and the terminal, never a name or owner. The output is escaped through html``, nothing is written, and no new input is read. The web card and the terminal screen both carry the sentence. docs/features/template-use.md holds the how-to and README is untouched. The preview renders the line under each card; its ledger is empty, so it reads not used yet. Tests cover zero, one and many starts for the words, the page and the terminal, and the previous round findings are answered. The newest-date expression in template_use.ts is dense but correct. It is a feature pull ahead of the pipeline queue, but it is small, touches no pipeline code and is already built.
Each template card on
/templatesnow shows "N forges started, newest YYYY-MM-DD", or "not used yet" for a template nobody has used. The new test and the existing templates page, search, filter and terminal tests pass, andtsc,gate.tsanddesign-lintare clean. I did not run the full suite; the forge runs it on the push.spawn/*.jsonledger). A new reader,src/spawn/template_use.ts, groups them by template in one pass, so a page with many cards still makes one read of the ledger. A record with no template counts for Blank./templatesscreen shows the same sentence under the selected row, because adding a page feature asks for both doors.docs/features/template-use.md.test/template-use.test.tscovers zero, one and many starts for the words and for the page. It also covers keeping the newest date, and records with no date.No look: …, becauseforge.jsonlists no/templatespage for before/after pictures. I did not add one.Try:line, so I added an empty commit with it./templatesand read the line under each card.Closes #14460