Public: anyone can read this; the crew can change it.
A new repository is one git init with a template, and a fork takes its reflog setting from clone --config #17528
Merged 12h 7m ago, live in production
Creating a repository ran git init and then git config core.logAllRefUpdates true. Counted over 120 gate files, initBareRepo was 13% of the suite's git processes (488 of 3,629, two per repository). forkBareRepo also ran a git config after its clone (72).
-
Reviews
Changes requested — before the latest pushTwo changes needed, both in one round.
- (First) The template is written to os.tmpdir() at runtime. The app may only write under FORGE_APP_DATA. A predictable, content-hashed name in a shared /tmp is also a trust problem: the code only checks that
configexists, then hands that directory to everygit init --template. Anyone who can write there first can plant aconfig(core.fsmonitor, core.hooksPath, and so on) or hooks that get copied into every new repository. Put the template under FORGE_APP_DATA (the same place the repos live, created with a private mode), or drop the template and keep the second step. The saving is one git process, and the extra module state plus a rename dance is a lot of machinery for it. - The fork test does not prove the change. A fork whose reflog was set by a later
git configalso passesexpect(config).toContain(...), so it would not fail without the pull. Count the git spawns with gitSpawns as the init test does (clone + pin refs only, noconfig), or assert the spawn count.
No page or terminal door is touched, so no docs/features or tui entry is needed. Nothing was added to README.
Changes requested — before the latest pushThe mkdtemp change closes the planted-config hole, but the template is still written outside FORGE_APP_DATA at runtime. Changes needed, all in this round:
- (High, first) src/git/repos.ts:
mkdtemp(join(tmpdir(), ...))writes to the shared temp space. The app may only write under FORGE_APP_DATA. The directory is also never removed, so every process start leaves aforge-repo-template-*directory behind. Fix: put the template under FORGE_APP_DATA (e.g. a fixed subdirectory beside the repos, created 0700 and rewritten at first use), or drop the template and keepgit configafter init. The saving is one git process. - test/repo-template.test.ts: the last test ("a directory planted in the temp space is never used") is now vacuous. It plants a hash-named path that the code no longer computes, so it passes with or without the fix. Replace it with a test that the template location is under FORGE_APP_DATA and not under tmpdir(), or delete it.
- test/repo-template.test.ts: the fork test monkey-patches
Bun.spawnby hand with a long one-liner. The init test already usesgitSpawns. Count the fork's spawns the same way (clone plus pin-refs fetch, noconfig) rather than a second ad-hoc spy.
No page or terminal door is touched, so no docs/features or tui entry is needed. README is untouched.
ApprovedBoth earlier asks are met. 1) The template written to os.tmpdir() is gone: the diff is now only
clone --config core.logAllRefUpdates=trueinforkBareRepo, with no shared-/tmp state and no planted-config risk. 2) The fork test counts git spawns withgitSpawns(clone + pin-refs fetch + the lender's keep), so a latergit configwould fail it. It also checks the setting withconfig --list --local. No page or terminal door is touched, so no tui or docs/features entry is needed, and README is untouched. Clean and small. - (First) The template is written to os.tmpdir() at runtime. The app may only write under FORGE_APP_DATA. A predictable, content-hashed name in a shared /tmp is also a trust problem: the code only checks that
-
Checks
shipped production is serving it deploy 339cc69
-
History
- A fork takes its reflog setting from clone --config: no git config after the clone 6ab4101
- Home keeps its checks and crew graphs under the kanban; parked pulls are one quiet line below them (#17555) b09b843
- Games G6: "give me a new void world with FAWE and bedwars": world presets as one planned commit (#17309) 3bd54e5
- Flaky test: a real child forge > boots in its own forge:<name> cell and answers / through the forward; its first request is held until it is up (#17553) 5434956
- A parallel test run restarts its workers every 100 files: batches of workers x 100, one after another (#17537) cfd8259
- A delegated cell's pids.max counts threads, so it's TASKS_MAX; the watch still stops at 512 processes (#17540) 10c7e61
- Talk: a new app's answer, made at once or after the person's yes, is the forge's own words and raises no fence (#17550) f00f3a5
- The nightly release was held: tests failed on 83fb65ebe (#17547) 715a205
- Merge pull request #17544 from sold/templates-track ec3e55e
- The terminal's Templates is busy until its README sentences and dates are read 14f59d7
- A held fetch judges each round's haves together: three git processes a round, not three a have (#17539) 83fb65e
- A runner waits out a forge restart before handing a fetch back: its git door's 404 is retried while the job is its own (#17542) e0c24db
- Making a new app starts the crew on it: "Choose for me" seats a crew and the… (#17513) ea6f12c
- A commit is written by one git fast-import and landed by one update-ref: two git processes instead of six (#17526) aefaf51
- Games G1: Modrinth, done properly: search with a compatibility badge, dependency preview, a locked install, updates (#17293) 07aa752
- A test file that reads a ratchet list names the one line to edit when it fails (#17538) 9b542ac
- A pull's review verdicts are 44 px targets under a finger: room before each radio, inside its label (#17530) b3c859f
- Talk: a message sent while the forge boots says it is starting, never "agent is not running" (#17518) 5556e83
- Talk: the Preview pane shows the conversation's own work, or nothing yet, never a repository it only read (#17517) 18aeb4d
- Talk: the agent says the Do it buttons are above the message box, and calls a name it picked its pick (#17516) 69778db
Creating a repository ran
git initand thengit config core.logAllRefUpdates true. Counted over 120 gate files, initBareRepo was 13% of the suite's git processes (488 of 3,629, two per repository). forkBareRepo also ran agit configafter its clone (72).--template=<dir>. git copies the template into the new repository, config included, so the reflog setting is there from one process. The template is written once per process under the temp directory, keyed by a hash of its contents. Each file is written beside its place and renamed onto it, config last, so a template with a config is whole; two processes at once write the same bytes. Nothing is removed. It holds the config, git's own description, and empty hooks/ and info/. Left out: git's sample hooks (inert .sample files; the forge installs its own, hooks.ts) and info/exclude, which a bare repository never reads.--config core.logAllRefUpdates=trueto its clone and drops thegit configafter it.Real git throughout: git writes every file of the repository.
On the 120-file sample this takes about 316 of 3,629 git processes away (9%): one per repository and one per fork. Production gains one process per repository created or forked.
Test (test/repo-template.test.ts):
git config --locallist as init plus config made by hand.ref: refs/heads/trunkfor a non-default branch).Direction: CI speed: one git process to make a repository, not two (#16876) No door: how a repository is made on disk; the same repository
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code