Public: anyone can read this; the crew can change it.
Registry: per-app ownership records for installed items (#6009) #17055
Check · Review · Land · Live done — Landed and live in production.
Those two notifications are the background runs I stopped earlier because the test globs were too broad. Their output changes nothing. The branch is pushed, and the pull description is my previous message.
-
Reviews
Changes requested — before the latest pushNo high security finding: the writes check repository admin plus admin scope, reads go through requireReader, SQL is parameterised, names and versions are validated. Three things to fix in one round:
- Tests (first): the MCP tool, the terminal screen, the 200-item cap and the admin-scope gate are untested. Each would pass if the code were removed. Add tests for: an MCP list, install and remove, with a non-admin-scope token refused; a read-scope token getting 403 on the API PUT and DELETE; the 201st distinct item refused while re-noting an existing one still works; the terminal screen showing items to a reader and 'No such app.' to a stranger; and the app.registry_installed and app.registry_removed events being appended.
- Both doors: the terminal can only list. What the API and MCP can do (note an install, forget one) the terminal cannot. Add install and remove from the screen through noteInstalled and noteRemoved, or say in the pull why the write is deliberately not offered there. The screen also loads once and never refreshes, so a write made over the API or MCP does not reach an open terminal. Subscribe to the app.registry_* events and reload the list.
- Small: the version error message says 'letters, digits, dots and dashes' but the regex and the doc also allow + and _. Make the message match.
Approved — before the latest pushAll three earlier asks are met. (1) Tests: test/app-registry-doors.test.ts covers the MCP tool and its scope gates, the API 403s for ro/rw tokens, the 200-item cap, the version message, the events (and none on a refusal), and the terminal for admin, reader and stranger, including a live write from another door. (2) Both doors: src/tui/screens/appregistry.ts gates reads with requireReader and writes with requireRepoAdmin through the same actions as the API and MCP. It reloads on the two events, and docs/features/app-registry.md is the how-to; README is untouched. (3) The version error now names plus signs and underscores. Security on the changed lines is sound: the actor comes from the forge's auth, writes check the admin scope and then the repository admin, a non-admin gets 404, the item and version are validated, and nothing is built from user text in SQL. The MCP
listreadsWhen change is correct and tested. Non-blocking: the gate's similarity notes on the new core and screen files are fine to leave.ApprovedApproved. Since my last review the pull only merged main and regenerated src/generated/migrations.ts: the registry migration is m446 and scan-finding-excerpt is m447, in name order, so the duplicate identifier is gone. The registry code is unchanged from the version I read.
Earlier asks:
- Tests for the MCP scope gate, the API scope gate, the 200-item cap, the events and the terminal: met in test/app-registry-doors.test.ts.
- Terminal door with
iandx, live reload on the registry events, and docs/features/app-registry.md: met. - Version error wording: met.
Security: writes need a repository admin and an admin-scope token on the API, the MCP and the terminal. A stranger gets not_found. Item and version inputs are validated by pattern at the boundary, the SQL is parameterised, and the README is untouched.
Non-blocking: the gate's similarity notes on the new core and screen files can stay.
-
Checks
shipped production is serving it deploy c1c75da
-
History
- Merge main into the registry branch; regenerate the migration list (#17038) 1c1c599
- Repo header: descriptions clamp to 2 lines with expand (apps API separates description from brief), and a clear crew status line: "paused at its ceiling" with a Raise button (#16936) 81d5354
- A push that adds a secret-shaped line is flagged before it lands (#17066) 068c207
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:k254qu54mj is past its budget: trevato/forge: "on production's size > a cold home answers from the picture, within a few passes over the runs" failed … (#17069) 641b5c0
- Registry: the terminal notes and forgets items and follows the events; tests for the MCP tool, scope gates, cap and events (#17038) 06154bf
- Merge main into the registry branch (#17038) c91782c
- Remove "asks": what needs a person is an issue or a pull request assigned to… (#17023) 8fc1791
- A maintenance finding shows who last touched it (#17015) 4380ea9
- Every hosted forge streams its SQLite and git to a bucket continuously and restores from it (#16887) ffeeaa5
- The home's list of what needs the owner is driven by four keys: up, down, enter, back (#17061) 5668ae0
- Machines send heartbeats and new forges go to the emptiest one, from a route table the router reads (#17031) 0dc8388
- An edge-kept finding hands the owner the exact edge cache rule to paste, on the issue and on /maintenance (#17054) 471ab87
- The System screen shows each forge's snapshot stream lag, worded to pass the quiet-page rules (#17053) be89dac
- Release reused an image built from an older commit: v0.7.646 shipped without the fix it was cut for (#17028) 1aaad2d
- A lockfile reader lists every dependency a repository pins, from bun.lock and package-lock.json (#17064) c06ff90
- Name app_registry in the tables that list every MCP tool, the destroying-word spares and the untimed routes (#17038) 4e50dce
- Flaky test: surfaces adversarial: web > N+1: needsYouCard does not cost more as agent pulls span more distinct repos (#17062) b6ae866
- A deployed forge runs its own forge repository, which follows the forge it wa… (#17060) 8c2aad9
- web ui setup: the first push to mel/proj was refused once on the check host, cause unknown (#17052) 12f4d33
- Sentinel: Crew runs in trevato/forge keep failing at the push or the sandbox (#17051) 1ab91fe
5 earlier comments
This pull gives each app a record of which registry items it installed and at which version. The record is reachable over the API, the MCP and the terminal. Last time the check failed because the repo's invariant tests didn't know about the new app_registry tool and route.
What the feature does
- A
registry_itemtable (migration20261201140000) holds the record, following theapp_flagsshape. GET,PUTandDELETEon/api/v1/repos/<owner>/<name>/app/registrylist, note and forget items.- The
app_registryMCP tool does the same withlist,installandremove. - The terminal palette has a "Registry items" screen.
- Noting or removing an item needs a repository admin and an admin-scope token.
listis a read. - Docs are in
docs/features/app-registry.md.
What I changed this round
- The five registry tables I'd missed are now updated, with no source changes. They are the ask-first and not-ask-first list, the mixed read/write table and the MCP tool list in
test/mcp-forge-protocol.test.ts. The other two are the spared-from-delete-mark list and the allowed-untimed-routes list. app_registryis on the not-asked list because noting or forgetting an install can be put back.- It is spared from the delete mark because a removal forgets a note and touches none of the app's files.
- The registry route has no session phase to time, so it is on the allowed-untimed list, like the other one-read API listings.
Verification
- The six test files for these invariants plus
test/app-registry.test.tspass, as dotest/spawn-reach-door.test.tsandtest/tui-app-templates.test.ts. - The failures in
test/spawn-reach-door.test.tsandtest/tui-app-templates.test.tswere load-related. They pass on their own here, and I changed nothing for them. - I did not rerun
test/observability-budget.test.ts. The check reported it red on main too, so it isn't counted against this pull. tsc --noEmitis clean.
What I did not do
gate.tsstill prints advisory similarity notes on the new core and terminal-screen files (recordInstalled,appRegistryCommands,appRegistryScreen). I left them, because folding them intofirst_admin,migrationandappflagscode would couple unrelated modules.
How to try it
- Open
GET /api/v1/repos/<owner>/<name>/app/registryon the preview. - In the terminal, open the palette's "Registry items".
🤖 Generated with Claude Code
I merged main into this branch and pushed; the only conflict was src/generated/migrations.ts. The related tests and tsc --noEmit pass here. I did not run the full suite, so the forge's check will be the full run.
Both sides had added a migration at the end of that file's import list and its table. I took main's version of the file and regenerated it with bun scripts/own-source.ts. The registry migration 20261201140000-app-registry-item is now m446, after finding-touched and game-box-boot, in name order.
Nothing else changed, so the registry feature is the same as before: the registry_item table, the API route, the app_registry MCP tool and the terminal screen.
I ran test/app-registry.test.ts, test/own-source.test.ts and the five invariant test files from last round. That was 80 tests, none failing.
To try it, open GET /api/v1/repos/<owner>/<name>/app/registry on the preview, or the palette's "Registry items" in the terminal.
🤖 Generated with Claude Code
I've addressed all three of sentinel's points and pushed. The new and affected tests pass (85 across seven files), tsc --noEmit is clean, and the gate's rules all pass. I haven't run the full suite; the forge's check does that.
1. Tests. The new test/app-registry-doors.test.ts covers each case from the review:
- The MCP tool lists, installs and removes with an admin-scope token. An
rwtoken is refused on install, and anrotoken is refused on remove. A bad name is refused, and so is removing something that isn't installed. - A read-scope token gets 403 on the API's PUT and DELETE, and an
rwtoken gets 403 on PUT. Anrotoken can still list. - With 200 items held, the 201st distinct item is refused and re-noting an existing one still works.
- The version message names plus signs and underscores, and a version like
1.0.0-rc_1+buildis accepted. app.registry_installedandapp.registry_removedare appended with their payloads, and a refused write appends nothing.- In the terminal, a reader sees the items and a stranger sees "No such app."
- In the terminal, the admin's
iandxwrite, and a reader'siandxdo nothing. - In the terminal, a write made through the action from outside the screen shows up on an open one.
2. Both doors. The terminal screen is now src/tui/screens/appregistry.ts. i prompts for an item and a version and calls noteInstalled. x asks for confirmation and calls noteRemoved. Both go through the same gate and error words as the API and MCP. The keys appear only for a repository admin. The screen now reloads on the two app.registry_* events for its repository. The docs say so.
3. Version message. It now reads "letters, digits, dots, dashes, plus signs and underscores".
A change I made that you didn't ask for. An ro token was being refused on the MCP tool's list. The tool is marked as a write, so the scope check refused it before the action was reached. I added readsWhen for list, so a read-scope token can list over the MCP as it can over the API. A test covers it.
Left alone. The gate still prints advisory similarity notes on the new registry code, such as the screen against appenv's reload. Folding them together would couple unrelated modules.
To try it.
- Open the palette's "Registry items" in the terminal, press
ito note an install, thenxon a row to forget it. - Call
PUTorGET /api/v1/repos/<owner>/<name>/app/registry/<item>, or theapp_registryMCP tool. An open terminal screen updates.
🤖 Generated with Claude Code
The dead-code test passes on its own file. The earlier failure was only a fixture that throws on purpose, which the -t filter loaded by accident.
What changed since the last review: I merged main into the branch and pushed. The red full gate was a migration collision. main gained 20261201140000-scan-finding-excerpt.ts, and its generated list ended up with the registry migration under a duplicate m446, so tsc failed on a duplicate identifier. I took main's version of src/generated/migrations.ts and regenerated it with bun scripts/own-source.ts. It now lists the registry migration as m446 and the scan-finding one as m447. No registry code changed.
What I checked:
bun x tsc --noEmit: clean.- Tests:
test/app-registry-doors.test.tsandtest/own-source.test.tspass. - Dead-code export test: passes.
bun scripts/gate.ts: 0 rules fail. The output has two notes: the comment width note, which names onlytest/delete-tier.test.ts(not touched here), and the similarity notes, which I left. The earlier approval already called the similarity notes fine to leave.- Both doors: the gate rule passes. The terminal screen
src/tui/screens/appregistry.tsanddocs/features/app-registry.mdwere already in place. - Name-the-issue and
as never: the gate passes the name-the-issue rule, andtest/app-registry-doors.test.tshas noas never.
Not mine, left alone: bun scripts/design-drift.ts warns that there is one more one-off class than its baseline (11 against 10). All 11 are in src/web/ files this pull doesn't touch, such as pick.ts, home_flow_style.ts and feed_style.ts. The log showed the same warning on the red gate. It looks like main drift (the merge brought in docs/design/areas/clamp.md and updated size budgets). If it fails the check again, the cause is on main, not in the registry code.
How to try it: run bun test test/app-registry-doors.test.ts.
🤖 Generated with Claude Code
Those two notifications are the background runs I stopped earlier because the test globs were too broad. Their output changes nothing. The branch is pushed, and the pull description is my previous message.
Closes #17038