Repository navigation
CONTRACT: feat(ui-server): bound managed GitHub acquisition - #4001
Merged
Merged
Conversation
5 tasks done
schlessera
marked this pull request as ready for review
November 14, 2026 17:22
schlessera
marked this pull request as draft
November 14, 2026 17:44
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
Add a host-owned GitHub acquisition wire that binds one canonical repository and short branch/tag to a shared metadata/discovery/authentication/fetch byte budget. Public requests remain anonymous. Private requests require the existing live brain/principal grant and separate API credential-recipient permission; replacing or revoking that authority fences later dispatch. Owner identity uses a separate anonymous fixed endpoint. Git/API capabilities stay separate, and managed audit records grant no contacted-host allowance.
The Git adapter routes through this wire, retains cancellation after its own waits, and refuses a fetched commit that differs from discovery. Real Git waits for a standard proxy challenge before sending proxy credentials, so an unauthenticated CONNECT receives
407without upstream access. Worker headers cannot select the managed channel. This is the second internal foundation slice; it enables no repository trust rule or source-admission exemption.Why this shape
This implements #3613's managed-only selection from #3612 and its independent API-recipient ruling. A host-held credential, parsed identity document or source trust rule alone authorizes no credential dispatch. Existing ordinary egress restrictions, final safety fences and turn byte accounting apply to the new host operation.
Proof
At head
16c5354f4608f129457260eedaf55b450164c8c7, 94 focused/compatibility tests pass with 709 assertions across eleven files using CI's Bun 1.4.2. This includes all four actual-Git acquisition cases and the governance HTTP field inventory. Strict typecheck passes on identical TypeScript inputs; the final subsequent commit changes documentation only. All five contribution-preflight gates pass, including 1017 fast invariants / 6640 assertions / 42 files. Initial failures retain their original identities.Twenty-one restored mutation controls cover G6 narrowing, live/durable contacted-host exclusion, operation limits, channel separation, post-DNS authority, mixed DNS, repository/lifetime binding, selected grant/brain/credential/API permission, owner restrictions and identity refusal. Three run actual offline Git and fail the intended discovery, fetch-cap and moved-commit assertions. Original receipts retain their execution identities.
Candidate run 43620784764 failed in unit (4) before Git acquisition because its inherited sysfs mount listed the parent interfaces. The corrected harness queries current netlink state, asserts loopback-only interfaces and empty IPv4/IPv6 main routes, checks all five capability sets are zero, and emits its namespace receipt. The same stale-sysfs reproduction passes under Bun 1.4.2, while restoring the old sysfs query fails the original interface assertion. All three actual-Git mutation controls were repeated through that corrected harness. Unit (1) also caught the missing
managedReferenceentry in the canonical HTTP event field table; its failing-before and corrected inventory runs are retained. The cancelled remainder supplies no complete proof. That earlier run remains failed/cancelled; the corrected candidate and main qualification are recorded below.The actual-Git fixture verifies public and private TLS acquisition, operation-cap refusal and commit movement in a fresh loopback-only network namespace with empty IPv4/IPv6 main routes and all five capability sets zero. The diagnostic container has networking disabled independently. Its runner executes the production Git argv/environment directly; it does not establish production maintenance-worker, native Btrfs, sealed-source or backend equivalence. The local host namespace attempt remains a setup failure, separately retained.
Incoming socket data can cross the wire before an overflowing chunk is refused. The operation consumes the remaining allowance, closes all channels and retains separate observed socket counts; it does not claim zero physical-network overshoot.
{"version":1,"kind":"brain-check-pr-receipt","head":"16c5354f4608f129457260eedaf55b450164c8c7","base":"origin/main","mode":"focused","startedAt":"2026-11-14T17:56:43.578Z","finishedAt":"2026-11-14T17:57:50.691Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12266.816974},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":99.41407600000093},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":64.74309300000095},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":18.999047999997856},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":54647.088544000006}]}Refusals contain one acquisition and report a bounded cause through the existing transport error classes. A new request can recover after authority is restored; failed identity revalidation invalidates the old handle. No global latch or automatic request replay is added. Private/public and cross-brain/principal/repository controls prove scope separation. Incoming trust never grants a restricted recipient permission.
Collision inventory at head
16c5354f4608f129457260eedaf55b450164c8c7: shared API/documentation paths with #3393 (docs/integration-contract/package-api.md), #3622 (api-report/ui-server.txt,docs/http-api.md,docs/integration-contract/package-api.md) and #3806 (api-report/ui-server.txt,docs/integration-contract/package-api.md), plus closure overlaps with #3054, #3056, #3059, #3069, #3116, #3437, #3464 and #3581. Other branches retain their owners. #3622 still waits for the complete qualified resolver.Qualified delivery — 2026-11-14
Exact candidate run 43625154121 passed all eight selected jobs at merge checkout
31e35efcfeb4f4271c17a86838bb007150fdc765. Heavy categories were deferred to automatic main, rather than attributed to the candidate. Squash3f8ff29341fbe25665cea42659f92e6f3d3ccef0has verified parent03805baf5c0dc22e8dbd991956039c61b53641d0and tree0b310394279311ed134a8bde69a8bd0d89092323.Automatic main run 43627744227 passed all 17 actual selected jobs and all nine categories fresh, without retained categories. Initial checkout logs and immutable parent/tree identities were independently verified. Artifacts verify 35 installed-backend provider-history cases across both providers, three production Git transport cases and the managed Git wrapper's four acquisition cases on both candidate and main. Native main proof passed Claude/Pi at UID 1000/0, plus the separate intended Pi UID 0 automatic-index negative control and owned cleanup. The wrapper still does not establish managed-path native equivalence. Coordinator main status is green.
The confirmation helper's exit 2 followed a successful merge and requested this independent main reconciliation; it was not a merge failure.
Checklist
Anything left open
#3613 stays open with all five original criteria. Bind this transport to actual source acquisition/publication, persist sealed root/generation/ref/commit/tree/identity evidence, implement immutable regular-blob reads with returned range/digest evidence, enforce stable approved-owner/rename/transfer boundaries, and qualify both backend/native entry points. #3622 still depends on that complete resolver and the independent Settings publication authority; this slice does not unblock repository-rule creation or claim an approved owner boundary.