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

Registry: per-app ownership records for installed items (#6009) #17055

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

opened this

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

5 earlier comments
commented

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.

commented

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_item table (migration 20261201140000) holds the record, following the app_flags shape.
  • GET, PUT and DELETE on /api/v1/repos/<owner>/<name>/app/registry list, note and forget items.
  • The app_registry MCP tool does the same with list, install and remove.
  • The terminal palette has a "Registry items" screen.
  • Noting or removing an item needs a repository admin and an admin-scope token. list is 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_registry is 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.ts pass, as do test/spawn-reach-door.test.ts and test/tui-app-templates.test.ts.
  • The failures in test/spawn-reach-door.test.ts and test/tui-app-templates.test.ts were 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 --noEmit is clean.

What I did not do

  • gate.ts still prints advisory similarity notes on the new core and terminal-screen files (recordInstalled, appRegistryCommands, appRegistryScreen). I left them, because folding them into first_admin, migration and appflags code would couple unrelated modules.

How to try it

  • Open GET /api/v1/repos/<owner>/<name>/app/registry on the preview.
  • In the terminal, open the palette's "Registry items".

🤖 Generated with Claude Code

commented

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

commented

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 rw token is refused on install, and an ro token 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 rw token gets 403 on PUT. An ro token 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+build is accepted.
  • app.registry_installed and app.registry_removed are 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 i and x write, and a reader's i and x do 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 i to note an install, then x on a row to forget it.
  • Call PUT or GET /api/v1/repos/<owner>/<name>/app/registry/<item>, or the app_registry MCP tool. An open terminal screen updates.

🤖 Generated with Claude Code

commented

The full gate on land was red and named no test; the pull is open again.

The gate's log: /api/v1/repos/trevato/forge/gates/1796136398302-2a486a5707c9/log

commented

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.ts and test/own-source.test.ts pass.
  • Dead-code export test: passes.
  • bun scripts/gate.ts: 0 rules fail. The output has two notes: the comment width note, which names only test/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.ts and docs/features/app-registry.md were already in place.
  • Name-the-issue and as never: the gate passes the name-the-issue rule, and test/app-registry-doors.test.ts has no as 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

Sign in to join this conversation.

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

Keyboard shortcuts

Docs