Repository navigation
CONTRACT: feat(ui-server): bind managed references and metadata recipients - #4000
Merged
Merged
Conversation
5 tasks done
schlessera
marked this pull request as ready for review
November 14, 2026 15:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3613
What changed
Managed acquisition refuses a ref that moves between resolution and fetch, ambiguous branch/tag names, raw refs/object IDs, and malformed or foreign advertisements. Invalid resolution gives an actionable source refusal before private fallback. Owners can separately grant the fixed
https://api.github.commetadata credential recipient through the existing reference-grant API; legacy grants retain their original recipient authority. Data-only GitHub metadata validation binds canonical names/transport and exact stable repository/owner IDs, without asserting source trust.Why this shape
This completes the first guard and grant-storage slice of the selected managed-only qualification. The existing API, shared FULL SQLite writer and live grant/principal lifecycle own the additional permission. There is no new worker-facing authenticated relay or production trust exemption. A minor changeset and the HTTP/MCP contracts accompany the changes.
Proof
Head
8cab65afcb542b32bcecdd9347bfbf3b20d4c9a5; independently read main/basefaa480e8c864d547cd8b4eb75965b7d609284770. Exact selected hosted candidate and automatic-main qualification remain pending. The current synthetic mergec5695c330326651ef83c5e1de390544daa0297a4has the independently verified parents above and tree0328b25b4dae9666d63295c7a0e46d9c45b39bf6; actual hosted job checkouts remain to be verified.REFERENCE_MOVED_REF_NOT_PUBLISHED,REFERENCE_API_RECIPIENT_EXPLICITLY_PERSISTED,REFERENCE_API_RECIPIENT_BOUNDARY,REFERENCE_AMBIGUOUS_REF_NEVER_SELECTED,REFERENCE_ADVERTISED_REF_EXACT,REFERENCE_RAW_REF_NOT_DISPATCHEDandREFERENCE_AMBIGUOUS_SOURCE_ACTIONABLE_REFUSAL. Ten source mutations fail at their named assertions and restored controls pass. Each receipt retains its original execution head/source identity.unshare: write failed /proc/self/uid_map: Operation not permitted; it is not failing-first/runtime qualification. Both installed-backend history guards and relevant native proof are hosted obligations for this candidate.bun run test ./packages/ui-server/tests/github-reference-identity.test.ts ./packages/ui-server/tests/reference-ref-validation.test.ts ./packages/ui-server/tests/reference-source.test.ts ./packages/ui-server/tests/reference-grants.test.ts ./packages/ui-server/tests/account-writes-offloop.test.ts NODE_OPTIONS=--max-old-space-size=6144 bun run typecheck NODE_OPTIONS=--max-old-space-size=6144 bun run check:pr --base origin/main{"version":1,"kind":"brain-check-pr-receipt","head":"8cab65afcb542b32bcecdd9347bfbf3b20d4c9a5","base":"origin/main","mode":"focused","startedAt":"2026-11-14T15:16:58.573Z","finishedAt":"2026-11-14T15:18:04.928Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12225.655087000001},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":102.86729000000196},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":69.27510099999927},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.013091999997414},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":53920.84819399999}]}The guards restrict one invalid source selection or one unapproved credential recipient. An ambiguous or moved target cannot authorize a new publication; existing separately validated stale-source behavior remains bounded by its original authority window. No safe narrower selection exists for an ambiguous ref. Omitted API permission preserves anonymous/no-API-credential behavior. Only explicit owner permission adds the API recipient. Source refusal clears on an unambiguous retry, with no global latch; changing recipient authority requires the owner to revoke/recreate that grant. Tool refusals expose the scoped cause; owner create/list receipts expose the explicit recipient. The source refusal/recovery case and principal/repository-bound grant cases prove isolation.
Collision scan at head
8cab65afcb542b32bcecdd9347bfbf3b20d4c9a5: textual overlaps with #3464 indocs/decisions/managed-worktrees.md(this PR refreshes citations only there) and downstream #3622 indocs/http-api.md. Closure overlap with #3056, #3059, #3069, #3116, #3393, #3437, #3581 and #3806 is recorded. No other branch is rewritten or taken over; #3622 will refresh after its repository resolver prerequisite is delivered.Checklist
Anything left open
#3613 remains open with all five original acceptance criteria. Fixed live metadata dispatch/recipient rechecks, actual operation/turn wire-byte accounting, immutable regular-blob/range/digest acquisition evidence, stable-owner/rename/transfer enforcement and the complete supported-host real-Git/native/both-backend qualification remain. The data parser and stored permission enable none of those capabilities by themselves. #3622 remains downstream. This PR uses
Refs, not a closing keyword.