Public: anyone can read this; the crew can change it.

A forge runs anywhere: a stated footprint, proven on a 1-CPU, 512 MiB machine #12093

Parked opened this in answer to
Closed without merging

This pull is only the measurement step of #12092. It does not cut any memory, and it does not prove the 1-CPU, 512 MiB case.

Notes

opened this

This pull is only the measurement step of #12092. It does not cut any memory, and it does not prove the 1-CPU, 512 MiB case.

What changed

  • New src/system/footprint.ts holds the stated budget and the reading: resident memory, heap, disk of the data directory, start-to-first-page time, architecture, CPUs and machine memory. The budget is 256 MiB at rest, first page within 5 s, and an empty forge under 64 MiB on disk.
  • It also lists what is optional and says plainly what is off and why: Chromium for looks, the crew's AI tool, and the serve/work threads. One process and one thread is what runs today.
  • release/prove.ts reads the footprint once the new version answers /healthz, before the smoke checks load it. It keeps the reading in release/proof.json as footprint.
  • main.ts marks the listener ready, which gives the start-to-first-page time.
  • /system gets a "What the forge costs" section: this process's last reading, else the proof's. It says "Over budget" when it is, and lists the optional parts.
  • New test/footprint.test.ts and docs/features/footprint.md.

What I did not do

  • I did not cut the largest memory holders. The roughly 400 MiB measured at rest is over the 256 MiB budget, so the section will say "Over budget" until that work lands.
  • I did not make the serve/work split switch on by core count. No such split exists in main.ts, so the page reports one thread.
  • I did not add an ARM or 1-CPU run of the check. The reading names the architecture, but nothing proves it on a Pi-class machine.
  • The memory-at-rest budget is my choice, not from the issue; adjust BUDGET in src/system/footprint.ts if you want a different number.
  • I added no terminal screen or MCP system field for it, only the web section.

Checks

  • bun test test/footprint.test.ts passes (3 tests).
  • test/release-prove.test.ts passed except one test I broke, which I then fixed; I did not re-run that file afterwards.
  • bun x tsc --noEmit and bun scripts/gate.ts were clean.
  • scripts/design-lint.ts reports one off-scale font size in src/web/studio/cards.ts:1216, a file I did not touch.

How to try it

  • Open /system and read "What the forge costs" (the section is hidden until the release proof has read a footprint, then shows).
  • After the proof runs, release/proof.json under the data directory has a footprint field.

Try: open /system and read What the forge costs.

🤖 Generated with Claude Code

Closes #12092

3 earlier comments
commented

This pull is only the measurement step of #12092. It does not cut any memory, and it does not prove the 1-CPU, 512 MiB case.

What changed

  • New src/system/footprint.ts holds the stated budget and the reading: resident memory, heap, disk of the data directory, start-to-first-page time, architecture, CPUs and machine memory. The budget is 256 MiB at rest, first page within 5 s, and an empty forge under 64 MiB on disk.
  • It also lists what is optional and says plainly what is off and why: Chromium for looks, the crew's AI tool, and the serve/work threads. One process and one thread is what runs today.
  • release/prove.ts reads the footprint once the new version answers /healthz, before the smoke checks load it. It keeps the reading in release/proof.json as footprint.
  • main.ts marks the listener ready, which gives the start-to-first-page time.
  • /system gets a "What the forge costs" section: this process's last reading, else the proof's. It says "Over budget" when it is, and lists the optional parts.
  • New test/footprint.test.ts and docs/features/footprint.md.

What I did not do

  • I did not cut the largest memory holders. The roughly 400 MiB measured at rest is over the 256 MiB budget, so the section will say "Over budget" until that work lands.
  • I did not make the serve/work split switch on by core count. No such split exists in main.ts, so the page reports one thread.
  • I did not add an ARM or 1-CPU run of the check. The reading names the architecture, but nothing proves it on a Pi-class machine.
  • The memory-at-rest budget is my choice, not from the issue; adjust BUDGET in src/system/footprint.ts if you want a different number.
  • I added no terminal screen or MCP system field for it, only the web section.

Checks

  • bun test test/footprint.test.ts passes (3 tests).
  • test/release-prove.test.ts passed except one test I broke, which I then fixed; I did not re-run that file afterwards.
  • bun x tsc --noEmit and bun scripts/gate.ts were clean.
  • scripts/design-lint.ts reports one off-scale font size in src/web/studio/cards.ts:1216, a file I did not touch.

How to try it

  • Open /system and read "What the forge costs" (the section is hidden until the release proof has read a footprint, then shows).
  • After the proof runs, release/proof.json under the data directory has a footprint field.

Try: open /system and read What the forge costs.

🤖 Generated with Claude Code

commented

This pull measures what a forge costs and shows it. It does not yet cut any memory or prove the 1-CPU, 512 MiB case that #12092 asks for. The push that follows the failed check fixes the four gate rules it named. Locally the gate now passes and the footprint tests pass; I did not re-run tsc after the rewrap, and the forge runs the full check on this push.

What changed

  • src/system/footprint.ts holds the stated budget (256 MiB resident at rest, first page within 5 s, an empty forge under 64 MiB on disk) and the reading.
  • The reading records memory, disk of the data directory, time from start to first page, architecture and CPUs. It lists the optional parts, Chromium, the crew's AI tool and the serve/work threads, and says plainly which are off and why.
  • src/release/prove.ts reads the footprint once the new version answers /healthz, before the smoke checks load it. It keeps the reading in release/proof.json.
  • main.ts marks the moment the listener is up, which gives the start-to-first-page time.
  • /system has a new "What the forge costs" section. It shows this process's last reading, else the proof's, and says "Over budget" when it is.
  • Added test/footprint.test.ts and docs/features/footprint.md.

This fix

  • Four comments (in prove.ts, footprint.ts twice and largest_dirs.ts) were over 100 columns and are rewrapped.
  • The "pipeline first" rule is answered with a Direction: line in the commit message, as the rule allows. I did not touch the pipeline.

What I chose not to do

  • I did not cut the largest memory holders. The roughly 400 MiB measured at rest is over the 256 MiB budget, so the section will say "Over budget" until that work lands.
  • I did not make the serve/work split switch on by core count. No such split exists today, so the page reports one thread.
  • I did not add an ARM or 1-CPU run of the check. The reading names the architecture, but nothing proves it on a Pi-class machine.
  • The 256 MiB budget is my own choice, not from the issue; change BUDGET in src/system/footprint.ts if you want another number.
  • There is no terminal screen or MCP system field for the footprint, only the web section.

scripts/design-lint.ts reports one off-scale font size in src/web/studio/cards.ts:1216, a file this pull does not touch.

How to try it Open /system and read "What the forge costs"; it shows once the release proof has read a footprint, and release/proof.json then has a footprint field.

Try: open /system and read What the forge costs.

🤖 Generated with Claude Code

commented

The forge's check on this pull should now lose one of its 16 failures; the other 15 are not caused by this change and I did not fix them. I haven't run the whole suite, only the tests below.

What I fixed: test/system-parts.test.ts lists every <h2> on /system. It didn't know about the new "What the forge costs" section, so I added the heading in its rendered position, after "Processes". test/system-parts.test.ts and test/footprint.test.ts pass, and tsc --noEmit is clean.

Failures I left alone: I ran these tests on the base commit, before the footprint work, and these four fail there too:

  • test/unreached.test.ts: src/crew/week_burn.ts is imported by nothing.
  • test/header-width.test.ts: over-long header comments in src/flow/lanes.ts and test/surfaces-adversarial.test.ts.
  • test/door-ssh-fingerprint.test.ts: the home page no longer shows the SSH fingerprint, after the commit that removed ssh from the public home page.
  • test/forge-looks.test.ts, test/attention.test.ts, test/app-home-batched.test.ts also fail there.

Failures I did not reproduce or trace:

  • bun scripts/design-lint.ts flags src/web/studio/cards.ts:1216 (font-size: 17px), a file this pull doesn't touch.
  • test/tui-system.test.ts passes when I run it alone.
  • I did not run the retention, builders/spend, MCP-docs or page-ceiling tests, so I can't say whether the footprint changes affect them.

The footprint change itself is unchanged.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs