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

/apps asks private-app access once per row: one grouped read, and the N+1 test green again #1012

Closed opened this in answer to
Closed without merging

The shelf's /apps row words now reuse the page's one grouped access answer instead of asking again per app. The main fix was already on this branch. Commit 1b2878f computes who may enter which private app once for the whole shelf and once for search.

Notes

stopped closed without shipping deploy a8d1123

opened this

The shelf's /apps row words now reuse the page's one grouped access answer instead of asking again per app.

The main fix was already on this branch. Commit 1b2878f computes who may enter which private app once for the whole shelf and once for search. The N+1 test for /apps already passed, so I'm not claiming that fix as part of this pull. The earlier decline was wrong not to push something, so this pull closes the one per-row ask I found that was still there.

What changed

  • pullWord in src/web/studio/words.ts still looked up the repo and ran canEnterApp for every merged-pull row. WordCtx now has an optional enterable field. When a page sets it, pullWord uses that answer and skips the lookup. When it's unset, pullWord asks as before, so the tell, change, run and lists pages behave the same.
  • shelfRows in src/web/studio/shelf.ts sets enterable: true, because a row only gets that far once the grouped read has let the viewer in. Sealed private apps still render as a name with no state, word or crew.
  • A new test in test/private-app.test.ts shows that with enterable: true, pullWord runs zero queries. With enterable: false it still reads only "merged", even for the owner.

Tests

  • private-app, surfaces-adversarial and counts pass: 33 tests, and the refusing tests are untouched. I ran them outside the sandbox because the test server's unix socket was refused inside it.
  • I could not run the type check here: bunx tsc fails with "Cannot find type definition file for 'bun'".

Not done

  • The other pages that build a WordCtx (tell, change, run, lists) still ask per row. They don't show an app shelf, and each would need its own grouped read.

Closes #869

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs