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

Move in: bring all of GitHub and Vercel into the forge through one trusted flow (inventory → plan → paced copy → verify), read-only toward the sources; clean-up is a separate, later step #18000

opened this in answer to

Merged 11h 19m ago, live in production

This is the first pull of #6007: a bigger inventory table with a disk-floor check, GitHub only and read-only toward GitHub. It serves the issue's first-pull scope only, not the whole of Move in. The inventory page at /migrate/inventory already existed for connected origins, with the already-on-the-forge badge.

Notes

opened this

This is the first pull of #6007: a bigger inventory table with a disk-floor check, GitHub only and read-only toward GitHub. It serves the issue's first-pull scope only, not the whole of Move in.

The inventory page at /migrate/inventory already existed for connected origins, with the already-on-the-forge badge. I extended it rather than build a second table.

  • Columns: each row now shows size (as the origin reports it, history included), last push, public/private and fork. It also shows a suggested default: forks → Link only, untouched over a year → Bring in archived, the rest → Bring in. The suggestion is only shown, not yet something the owner can change.
  • Filters: All, Forks, Stale (over a year), Large (over 100 MiB) and Apps, as plain GET links.
  • Disk floor: a line above the list adds up what the default plan would copy (forks count as zero) and compares it with the forge's free disk. It says Refused when the copy would leave less than the 15% the forge keeps for itself (DISK_FLOOR in src/spawn/disk_floor.ts). If the disk can't be read, nothing is refused.
  • Export: ?format=csv or ?format=json, with the active filter applied. The CSV writer is the existing formula-safe one. Only secret names are included, never values.
  • Terminal: each row's line carries size, last push and the suggestion. The header line carries the room check.
  • Code: the new module is src/origins/move_plan.ts: pure rows in, plain data out, no new dependency. It reuses formatKib, toCsv, readDisk and DISK_FLOOR, and moveRoom in src/actions/inventory.ts feeds the page and the terminal.
  • Docs: docs/features/bring.md is updated.
  • Tests: test/move-plan.test.ts covers the defaults, filters, floor refusal and export. test/origin-inventory.test.ts gains a page test for the columns, filter, room line and both exports.

What I ran: tsc, test/move-plan.test.ts, test/origin-inventory.test.ts, test/origin-inventory-edges.test.ts, test/doorless.test.ts, test/feature-doors.test.ts and test/unused-exports.test.ts all pass. bun scripts/gate.ts --explain ran with 0 failing rules (30 satisfied, 2 noted). --fix rewrapped one file, which is committed. design-lint is clean. bun scripts/fast.ts named 2715 files, far too many to run, so the full suite was not run: the forge's check runs it.

Left out on purpose:

  • Vercel inventory: nothing yet.
  • Org-approval message: the plain "this org must approve the app" message is not written.
  • Plan and run: the owner's per-row choice, the paced copy, the audit rows and the verify step.
  • Archived flag: the origin sync doesn't store it, so there is no column or filter for it.
  • Branch and tag counts: not shown, for the same reason.
  • Clean up: the later, separate flow is untouched.

To try it: connect GitHub at /migrate, open /migrate/inventory, then try ?show=forks, ?show=stale and ?format=csv.

[
  {"go": "/migrate/inventory", "look": "each row's Size, Last push and Suggested facts, and the room line above the filter row", "expect": "forks suggest Link only, stale ones Bring in archived; the room line says the default plan fits the disk, or Refused when it would pass the 15% floor"},
  {"go": "/migrate/inventory?show=forks", "look": "the filter row and the list", "expect": "only forks remain and the Forks segment is current"},
  {"go": "/migrate/inventory?format=csv", "look": "the download", "expect": "a CSV with size_kib, suggested and secret_names columns, no secret values"}
]

🤖 Generated with Claude Code

Closes #6007

3 earlier comments
commented

This is the first pull of #6007: a bigger inventory table with a disk-floor check, GitHub only and read-only toward GitHub. It serves the issue's first-pull scope only, not the whole of Move in.

The inventory page at /migrate/inventory already existed for connected origins, with the already-on-the-forge badge. I extended it rather than build a second table.

  • Columns: each row now shows size (as the origin reports it, history included), last push, public/private and fork. It also shows a suggested default: forks → Link only, untouched over a year → Bring in archived, the rest → Bring in. The suggestion is only shown, not yet something the owner can change.
  • Filters: All, Forks, Stale (over a year), Large (over 100 MiB) and Apps, as plain GET links.
  • Disk floor: a line above the list adds up what the default plan would copy (forks count as zero) and compares it with the forge's free disk. It says Refused when the copy would leave less than the 15% the forge keeps for itself (DISK_FLOOR in src/spawn/disk_floor.ts). If the disk can't be read, nothing is refused.
  • Export: ?format=csv or ?format=json, with the active filter applied. The CSV writer is the existing formula-safe one. Only secret names are included, never values.
  • Terminal: each row's line carries size, last push and the suggestion. The header line carries the room check.
  • Code: the new module is src/origins/move_plan.ts: pure rows in, plain data out, no new dependency. It reuses formatKib, toCsv, readDisk and DISK_FLOOR, and moveRoom in src/actions/inventory.ts feeds the page and the terminal.
  • Docs: docs/features/bring.md is updated.
  • Tests: test/move-plan.test.ts covers the defaults, filters, floor refusal and export. test/origin-inventory.test.ts gains a page test for the columns, filter, room line and both exports.

What I ran: tsc, test/move-plan.test.ts, test/origin-inventory.test.ts, test/origin-inventory-edges.test.ts, test/doorless.test.ts, test/feature-doors.test.ts and test/unused-exports.test.ts all pass. bun scripts/gate.ts --explain ran with 0 failing rules (30 satisfied, 2 noted). --fix rewrapped one file, which is committed. design-lint is clean. bun scripts/fast.ts named 2715 files, far too many to run, so the full suite was not run: the forge's check runs it.

Left out on purpose:

  • Vercel inventory: nothing yet.
  • Org-approval message: the plain "this org must approve the app" message is not written.
  • Plan and run: the owner's per-row choice, the paced copy, the audit rows and the verify step.
  • Archived flag: the origin sync doesn't store it, so there is no column or filter for it.
  • Branch and tag counts: not shown, for the same reason.
  • Clean up: the later, separate flow is untouched.

To try it: connect GitHub at /migrate, open /migrate/inventory, then try ?show=forks, ?show=stale and ?format=csv.

[
  {"go": "/migrate/inventory", "look": "each row's Size, Last push and Suggested facts, and the room line above the filter row", "expect": "forks suggest Link only, stale ones Bring in archived; the room line says the default plan fits the disk, or Refused when it would pass the 15% floor"},
  {"go": "/migrate/inventory?show=forks", "look": "the filter row and the list", "expect": "only forks remain and the Forks segment is current"},
  {"go": "/migrate/inventory?format=csv", "look": "the download", "expect": "a CSV with size_kib, suggested and secret_names columns, no secret values"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 5bc8f2646e7d --> Look pages for 5bc8f26, from the gate:

  • look pages (none): this pull changes src/web/pages/inventory.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

I fixed the failing duplicate-import check by merging the two imports of actions/inventory.ts into one in src/tui/screens/inventory.ts and src/web/pages/inventory.ts. Each file now imports moveRoom alongside holds and inventoryOfOrigins. Nothing else changed.

bun test test/dup-imports.test.ts passes (6 of 6) and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check does that on the push.

bun scripts/gate.ts --fix reported one thing: it can't infer a look page for src/web/pages/inventory.ts. The commit message says "No look:" because only imports changed and the rendered output is the same.

commented

I've addressed all four fixes and pushed. tsc is clean, gate --fix has been run and committed, design-lint is clean, and the move-plan, inventory, terminal and import-rule tests pass. I didn't run the full suite, so the dead-code and shared-state tests ran only if their file names matched my filter. The forge's check runs everything.

What changed

  • Disk unknown (1). A disk that can't be read now says "Disk size unknown, nothing checked" instead of "fits the disk". roomFor gained a known flag, and a new roomLine in src/origins/move_plan.ts writes the sentence for both the page and the terminal. Tests cover the unknown case, the Refused page (data-refused="yes"), and the terminal line.
  • Both doors (2). The terminal inventory screen has f to cycle the filter (all, forks, stale, large, apps) and c to copy the shown rows as CSV to the clipboard. The header names the active filter. docs/features/bring.md says so. The terminal has no JSON export.
  • Unread rows (3). The export has a scanned column in both CSV and JSON. The Apps filter says "N not read yet, so not counted here" on the page and in the terminal. The room line says when an origin did not answer and so isn't counted.
  • Tests and one query helper (4). A single query helper now builds the filter links and the export links. A test covers an unknown ?format= (it returns the HTML page) and checks the hrefs the helper builds.
  • Smaller.
    • The stray blank line is gone and comments are rewrapped.
    • "Secret names only, never values" is out of the export line and stays in the docs.
    • "Suggested" is folded into the row's meta line, so each row keeps only Size and Last push as facts.

Where I differ from your review

  • Room total. Sizes come from the repo list, not from reading each repository. So rows past the 40-per-visit read cap are already included in the total. The partial case is an origin that didn't answer, and that's what the line now says.
  • Filter labels. The segmented control scrolls sideways by default rather than wrapping. I shortened the labels to All, Forks, Stale, Large and Apps, which fit at 360px, instead of adding a wrapping variant. The 100 MiB and one-year thresholds are in the docs. I haven't checked the layout in a browser; I judged it from the markup and CSS.
  • MCP. I did not add show or format to the origins inventory action. Export from the terminal is the clipboard CSV only.

To try it

  • Page: sign in and open /migrate/inventory, then try ?show=app and ?format=csv.
  • Terminal: open "What is left to bring over" from the palette and press f and c.

Review block:

[
  {"go": "/migrate/inventory", "look": "the room line and the row meta", "expect": "one sentence on disk room; each row ends its meta with the suggested action; filter labels All, Forks, Stale, Large, Apps fit at 360px"},
  {"go": "/migrate/inventory?show=app", "look": "the line under the filter row", "expect": "'N not read yet, so not counted here' when any row is unread"},
  {"go": "/migrate/inventory?format=csv", "look": "the header row", "expect": "a scanned column; false for rows not read yet"}
]
Sign in to join this conversation.

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

Keyboard shortcuts

Docs