Skip to content

CONTRACT: feat(ui-server): bound managed GitHub acquisition - #4001

Merged
schlessera merged 3 commits into
mainfrom
feat/3613-qualified-transport-20261114
Nov 14, 2026
Merged

schlessera merged 3 commits into
mainfrom
feat/3613-qualified-transport-20261114

Conversation

@schlessera

@schlessera schlessera commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

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 407 without 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 managedReference entry 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. Squash 3f8ff29341fbe25665cea42659f92e6f3d3ccef0 has verified parent 03805baf5c0dc22e8dbd991956039c61b53641d0 and tree 0b310394279311ed134a8bde69a8bd0d89092323.

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

  • Complete selected hosted candidate and automatic-main proof passed with actual checkout evidence.
  • This slice is implemented; remaining ui-server: bind trusted Git reads to the qualified host acquisition transport #3613 acceptance work is named below.
  • PR and advanced issue use verified release milestone 0.45.0; the registry remains at 0.44.0.
  • Changesets, authoritative event/internal contract components, API reports and relevant documentation are updated.
  • Leakage gates pass and moved source citations are refreshed.
  • Changed guards have scoped refusal/recovery behavior and meaningful failing/restored controls.
  • Both actual installed-backend provider-history guards pass for this candidate and automatic main.

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.

@schlessera schlessera added this to the 0.45.0 milestone Nov 14, 2026
@schlessera schlessera added type: feat A new capability or a change in user-visible behaviour. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. security Auth, isolation, egress, secrets, or anything in the threat model. labels Nov 14, 2026
@schlessera
schlessera marked this pull request as ready for review November 14, 2026 17:22
@schlessera
schlessera marked this pull request as draft November 14, 2026 17:44
@schlessera
schlessera marked this pull request as ready for review November 14, 2026 18:10
@schlessera
schlessera merged commit 3f8ff29 into main Nov 14, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. security Auth, isolation, egress, secrets, or anything in the threat model. type: feat A new capability or a change in user-visible behaviour.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant