Skip to content

fix(ci): isolate native Claude tests from host managed settings - #4314

Draft
schlessera wants to merge 118 commits into
mainfrom
fix/native-claude-isolation
Draft

schlessera wants to merge 118 commits into
mainfrom
fix/native-claude-isolation

Conversation

@schlessera

@schlessera schlessera commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Refs #4313

Installed Claude can consult machine-managed settings and credential helpers despite a temporary HOME and SDK settings flags. This PR keeps the test guard global: actual native launches require live scripted authority and an offline OS/kernel boundary; unknown shells retain the product view with installed/selected native executables replaced by refusal stubs.

Native admission preserves the product environment except documented guard-owned transport, isolation, synthetic-credential and evidence keys. Credential variables are removed by explicit name/pattern, rather than a product-key allowlist. The invariant consumes real SDK/worker launch environments across direct, worker, relayed, separate-UID and prewarm paths, including unlisted keys. Production source policy and product deadlines remain unchanged.

Unknown launches receive no native receipt capability. Existing product bwraps get mask binds in their own argv. The exact source-discovered product unshare keeper uses a mount-only helper before its original shell, preserving its PID and sole-child topology. Other unknown launches use distribution bwrap with kernel parent-death ties and signal/status forwarding. The product /dev view is retained. Missing or non-filesystem classification candidates are skipped; candidate-only ENOTDIR/ELOOP/ENAMETOOLONG skip, while other metadata failures and mask-path errors refuse. Computed hash-equal copies have diagnostic exec auditing; that is not a synchronous protection against arbitrary byte copies.

The broker copies only approved socket operations. Inference uses the declared guard transport; the product turn proxy and title collector get exact launch-owned endpoints. No other loopback service is admitted. Native children retain socket restrictions, private networking, synthetic host metadata and declared fixture provenance. Fixed read-only distribution inputs are derived from production. Managed checkpoint/tree/keeper/private-index registrations are scoped to their actual allocator, live view and awaited turn; canonical inode, kernel owner, namespace and lifecycle facts are rechecked before launch.

U1–U12 regression batch

Heavy run 45014338287 at 906745512 eliminated the preceding 131 keeper failures across 22 files, but exposed these remaining groups. Each was reproduced on boat before repair.

Group Cause and final change Focused proof
U1 Admitted workers inherited a keeper's runtime mask. Pin the admitted executable in the unmasked guard parent, recheck identity/hash and authority, transfer once to the exact owned PID/start carrier after the unchanged bootstrap, then project its descriptor bytes read-only/executable at the selected path. Other paths stay masked. Masked keeper → real admitted execution; revoked authority, replaced inode, wrong peer, replay, unknown stub and payload-FD-leak negatives.
U2 Plan construction attempted an ACL for an unmapped UID. Apply ACLs immediately before launch; unused plans stay 0700/0600 and unmapped launches refuse. Hold the audit inode open so unlink/recreate cannot recycle it. Unused-plan and unmapped-launch proofs; real numeric cross-UID helper in network-disabled scratch Docker, already an established unit-category dependency.
U3 Provider-history and maintenance fixtures started their history host without pinning the real fixture origin. Both adapters' history files and the host-authority suite.
U4 Autonomous app authority declared the fixture root but omitted its distinct brain. All six whole-app cases; inventory asserts the parsed required roots.
U5 An outer unknown envelope already traced the server, so a second strace failed before the worker ran. Reuse only its owned PID/start and pinned private trace inode; attribute evidence to the inner subtree and kill/refuse if attestation or heartbeat fails. Nested harmless/native-stub, forged/expired ownership, tracer death and PID-generation cases; actual worker-state file.
U6 The held-FD lifetime fixture introduced a shell wrapper PID; the allocator observer also recursed when Bun reused a spy. Keep the explicit FD holder's PID and capture the real allocator once. Whole worker-steps-event-loop file, including final-handle broker closure.
U7 Detached compute's envelope hid its terminal payload from classification. Preserve the original script and $0 semantics while making that harmless payload explicit. Whole compute CLI file, including detached rebuild.
U8 An orphan builder inherited a receipt token whose owner no longer existed. Use write-nothing degraded receipt mode on owner disappearance; PID/start mismatch still refuses. Whole invocation-lifetime file.
U9 Static fixture inventory expected a literal singleton root list. Parse the actual declaration and assert its required roots. Whole worker-fixture inventory.
U10 A fully shadowed raw brain bind was scanned as exposure; the broker also changes native network errno. Recognize only the exact live copied-tree overlay role without rewriting product argv. Retain native restrictions and separately replay the actual guard spawn-record product bwrap with only its terminal command replaced by Python plus O1 masks. Real-view fsmonitor absence, overlay negatives; both adapters' containment cases. Companion proves original product errno/netns, mounts, secrets, writes and relay boundaries without the broker.
U11 The product title collector's separate OTLP POST was denied. Transparently register the real collector until stop and transport only its authenticated POST /v1/logs to its exact launch-owned loopback sockaddr. Product OTLP env passes unchanged. Endpoint negatives for stale/token/path/scope/address and product title cases.
U12 Subscription fixture launches did not hold their actual loopback service authority. Whole subscription-login file, including expected fake-token rejection.

Current candidate: fable 25 and timing

4c53162b5b1adf178c0c9ef19d9d37ba285130d0 keeps the global guard and the original product deadlines. Fable 25 is recorded at its reviewed a7240d4 head; it is not independent approval of this candidate.

F1. U1 still uses bubblewrap --perms 0555 --ro-bind-data from the single-use pinned executable descriptor, at the selected path only. It now hashes once at pin time and rechecks dev/ino/size/mtime/ctime plus live authority before launch and transfer. The projected-byte hash remains a test proof, not product-path work. Other masks stay installed.

F2. The direct SDK --version path never uses U1's carrier or copy. It already uses an ordinary read-only bind. The original hosted failure's expected:1, completed:5 matches its bwrap → Bun egress wrapper → socket broker → Python transport → Claude chain. It does not establish which stage consumed the five seconds. Neither the isolated full probe nor the exact five-file ordering reproduced the hosted timeout on boat.

Measurement under four CPU burners Median Maximum / scope
Unguarded native --version, after spawn 13.8 ms 5 repetitions
Strace-only --version, after spawn 34.8 ms 5 repetitions
Original complete guarded product probe, after spawn returns 201.3 ms 226.1 ms; 10 repetitions
Fixed complete guarded product probe, after spawn returns 36.9 ms 54.9 ms; 10 repetitions
Fixed synchronous guard setup, before the product timer 1,887.6 ms 2,274.1 ms; 10 repetitions

F3. A separate read-only observer sampled the original guard's actual strace exec records at 1 ms intervals. Approximate median intervals: bwrap to Bun 41.6 ms; Bun egress startup to broker 50.4 ms; broker to Python 3.2 ms; Python to native exec 26.7 ms. These are observed intervals in separate repetitions, not additive isolated CPU costs. The direct probe has no tripwire supervisor, runtime masks, descriptor carrier or copy; those costs are zero on this path. Strace's syscall-filtering mode was measured but not adopted, because socket-notification audit semantics need separate validation.

F4. A private pre-exec readiness barrier now completes the direct probe's guard setup before Bun.spawn returns. The helper execs in place. PID/start identity and authority recheck at release; unavailable setup refuses and only the same owned process generation is eligible for cleanup. Its descriptors close before payload exec and its files are removed. Both original product deadlines are unchanged. The keyless test spends 5.1 seconds in setup and then succeeds within the original five-second product window; the inverse proof still rejects a slow payload at five seconds. Identity-loss, authority-revocation and omitted-wait mutations fail the named assertions.

F5. U1's 250 MiB harmless-executable keeper/namespace benchmark includes the real pin, carrier, nsenter, final bwrap and the test-only projected-byte hash. Under four CPU burners, first/warm changed from 1,258 / 833 ms to 646 / 530 ms. Peak added shared memory is approximately 250 MiB and returns within about 0.1 MiB of baseline on exit. This shows no measured projection-cost threat to ten seconds; it is not a full managed separate-UID runtime_host identity result. Fresh hosted identity proof remains required.

F6. The P2 repeated trap was a test sender feedback loop: every stdout chunk after ready caused another SIGTERM. The caller now sends once and the real trap is counted. The hosted-profile loaded run passes 50/50; double-forward mutation fails ONE_CALLER_SIGNAL_RUNS_TRAP_ONCE. An initial custom driver used a 30 s outer cap against its 40 s scaled child watchdog and had one unresolved stall (49/50); its failing JUnit is preserved and the limitation is filed on #4410. It is not relabelled green.

F7. Fable 25's four code fixes are implemented: exact collector mode despite umask 077; cleanup listeners prepended before refusal exit; dead-owner/orphaned write-nothing proofs restored while refusals still fail locally; and Pi's transferRefusal must be absent so every descriptor assertion runs. The tracker comparison on one VM gives head 39/39 and unmodified main 38/39, reproducing the original cold-reload announcement assertion without an injected delay; recorded on #4479. The original local-process-provider sh -c fixture is restored. Detached unknowns wait for their masks before the fixture parent can exit, fixing the bind-source startup race; compute CLI passes 31/31.

F8. Evidence: 214/214 broad cases at the earlier batch implementation; 186/186 loaded cases across nine files after readiness identity/authority strengthening; final tip 80/80 loaded cases across four files after a type-only test annotation fix. The guard implementation's source hashes match the final-tip boat archive. The prior complete 1,666-file unit selection remains at a7240d4 with 11 documented failures; it is not a current-head full-unit pass. Fresh heavy proof and independent review are pending.

F9. Fable 25 is recorded at reviewed a7240d4: four fixed code findings, tracker attribution filed, two deferrals filed, two rejected; zero undisposed. No production source, deadline, workflow gate, budget, repetition floor or image pin changed. Both boat VMs are archived and deleted.

Current exact-head preflight, typecheck and build: passed: all five check:pr gates (1,233 tests across 52 files), typecheck with a command-scoped 8 GiB Node heap, and build..

Previous complete unit evidence

Previous complete-unit selection head: a7240d48711c8fed4ddd88d44bb19061e43b0ae2.

File Tests Fail Skip
packages/core/tests/compute-cli.test.ts 31 0 0
packages/ui-backend-claude/tests/provider-history.test.ts 21 0 0
packages/ui-backend-claude/tests/transcript-prefix.test.ts 2 0 0
packages/ui-backend-pi/tests/provider-history.test.ts 18 0 0
packages/ui-react/tests/api-client-sync.test.ts 22 0 0
packages/ui-sdk/tests/startup-input-accounting.test.ts 4 0 0
packages/ui-sdk/tests/worker-startup-view.test.ts 22 0 0
packages/ui-sdk/tests/worker-steps-event-loop.test.ts 22 0 0
packages/ui-server/tests/app-state-isolation.test.ts 2 0 0
packages/ui-server/tests/brain-client.test.ts 37 0 0
packages/ui-server/tests/close-cancels-shared-runs.test.ts 7 0 0
packages/ui-server/tests/credential-maintenance-exclusion.test.ts 6 0 0
packages/ui-server/tests/cron-maintain-provider-relay.test.ts 4 0 0
packages/ui-server/tests/cron-scratch-prune.test.ts 13 0 0
packages/ui-server/tests/host-execution-boundary.test.ts 17 0 0
packages/ui-server/tests/host-git-credentials.test.ts 6 0 0
packages/ui-server/tests/host-version-requirements.test.ts 31 0 0
packages/ui-server/tests/hygiene-review.test.ts 36 0 0
packages/ui-server/tests/maintenance-launch-release.test.ts 2 0 0
packages/ui-server/tests/maintenance-probe-admission.test.ts 1 0 0
packages/ui-server/tests/maintenance-provider-relay.test.ts 6 0 0
packages/ui-server/tests/maintenance-startup-view.test.ts 28 0 0
packages/ui-server/tests/module-settings-http.test.ts 2 0 0
packages/ui-server/tests/native-host-inputs.test.ts 6 0 0
packages/ui-server/tests/origin-policy.test.ts 20 0 0
packages/ui-server/tests/storage-maintenance-owners.test.ts 5 0 0
packages/ui-server/tests/storage-removal-worker.test.ts 1 0 0
packages/ui-server/tests/subscription-login.test.ts 2 0 0
packages/ui-server/tests/sync-mirror.test.ts 15 0 0
tests/autonomous-app.test.ts 6 0 0
tests/autonomous-containment.test.ts 4 0 0
tests/claude-title-provenance.test.ts 3 0 0
tests/claude-worker.test.ts 4 0 0
tests/native-copied-turn-tree.test.ts 14 0 0
tests/native-guard-copy-closure.test.ts 4 0 0
tests/native-offline-boundary.test.ts 39 0 0
tests/native-runtime-pin.test.ts 6 0 0
tests/native-shared-audit.test.ts 7 0 0
tests/native-socket-broker-exit.test.ts 1 0 0
tests/native-title-collector.test.ts 7 0 0
tests/native-worker-admission.test.ts 17 0 0
tests/native-worker-fixture-inventory.test.ts 87 0 0
tests/pi-worker-runtime.test.ts 33 0 0
tests/policy-write-boundary.test.ts 20 0 0
tests/private-fixture-directory-access.test.ts 1 0 0
tests/provider-history-host-authority.test.ts 4 0 0
tests/shipped-claude-runtime-pin.test.ts 1 0 0
tests/test-git-maintenance.test.ts 8 0 0
tests/test-invocation-lifetime.test.ts 15 0 0
tests/worker-state-tmpfs.test.ts 7 0 0
{"version":1,"kind":"brain-check-pr-receipt","head":"4c53162b5b1adf178c0c9ef19d9d37ba285130d0","base":"origin/main","mode":"focused","startedAt":"2026-11-22T21:09:06.059Z","finishedAt":"2026-11-22T21:10:55.612Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":14868.952125000002},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":118.1505900000011},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":85.46707400000014},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":26.72557500000039},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":94436.031835}]}

Baseline and unresolved intermittent failures are filed without milestones. The unmodified-main tracker reproduction and isolated session-taint non-reproduction are distinguished explicitly. No assertion or product deadline is weakened to hide them:

Issue Baseline evidence
#3763 The unchanged session-taint file fails its clean-session curl assertion with HTTP 403 / exit 22 in this complete run. The same assertion was reported in an earlier independent hosted candidate before this guard work. Unchanged main passed three isolated plus ten CPU-loaded repetitions here; this does not reproduce the category ordering, whose exact cause remains unresolved.
#4471 Moved hardlink alias scan: main failed 87/100 repetitions; equal directory timestamps explain the diagnostic cases. Neither scanner nor test is changed here.
#4472 Metadata-only home snapshots: main failed 28/30 repeated same-size overwrite cases.
#4475 Answer-card count: main passed its first full 24-case file, then failed 14/40 loaded online cases with expected 1 / received 2 after one accepted answer.
#4476 Dialogue queue pressure: main failed 7/10 repetitions of the unchanged real-writer proof. The product's ten-second storage settlement boundary remains intact.
#4477 Waiting service-worker update: a main selection reproduced all four staged-track reload failures at the same assertion. Isolated main and PR-head full files also passed; the underlying ordering cause is still open.
#4478 New-chat send: main independently failed to observe a sent message in the per-session draft case. The category run also lost a new active session after the same helper; an exact common cause is not claimed.
#4479 Same-VM clean-checkout comparison under four CPU burners, three full-file repetitions per checkout: a7240d4 passed 39/39; unmodified main 7e861bd passed 38/39. Main reproduced the identical cold-reload live-region assertion at line 284 without an injected sleep. The exact internal ordering cause remains open.

One earlier unnamed title hook timeout remains separately filed on #4410. It did not recur in the 15-case ordering check, three loaded title repetitions or either fresh 390-case regression run; its cause is not claimed fixed.

The U10 companion is branded by the guard's actual afterSpawn record; it cannot be satisfied by a reconstructed workerCommand plan. Normalization permits exactly terminal-command replacement and inserted O1 mask binds, with no broker or added network namespace. Its live startup view remains held until replay finishes. Removing production netns isolation leaves the native arm EPERM but makes the companion's original ECONNREFUSED assertion fail.

Mutation receipts include: skip U1 peer identity; use pathname descriptor projection; admit any loopback port; drop the copied-view overlay or accept a different root; accept an arbitrary running strace; remove product netns; omit broker child-exit reaping; omit launch ACL or widen helper ACL; remove pinned audit FD; and permit a malformed multi-script copy destination. Each fails its named behavioral assertion, and every mutation is restored. Earlier O1 mask/alias/availability, scope proportionality, supervisor signal/lifetime, keeper topology and retained-fork cleanup receipts remain part of this PR.

Earlier U1 copy-cost qualification (before the hash-once optimization) used a 250 MiB executable with four CPU burners on the four-CPU boat VM. First admission was 1.122 s and warm admission 0.914 s against the unchanged ten-second boundary; projected bytes matched the pin. Peak added shared memory was approximately 250 MiB and returned to baseline after namespace exit (residual measurement +238 KiB / -405 KiB). Three loaded runtime-probe repetitions passed the unchanged five-second --version deadline. This accepts the measured copy cost rather than claiming the projection is zero-copy.

Full-category findings

  • F1: The policy fixture still attempted obsolete /witness POSTs through a model relay that never carries that route. Reports already come from the held worker scratch; remove those unused attempts. Its descriptor-transfer probe also encountered the native broker's SCM_RIGHTS denial. Keep that explicit EPERM in the native arm and replay the actual product plan through O1 with Python to retain the original successful-transfer, readonly descriptor, mapping and /proc assertions. The companion must have no native-broker refusal and must receive one real descriptor.
  • F2: The shipped-version fixture used synchronous installed-native execution. Use the established asynchronous admitted launch with an actual fixture listener and live scripted authority, preserving the exact SDK/CLI version assertions.
  • F3: O1's unknown-shell path used the caller env before the existing test Git policy was applied. Carry the same maintenance.auto=false and gc.auto=0 configuration main already supplies. No new guard key or authority.
  • F4: Pi's independent host web executor was created before the native app fixture but lazily started its CONNECT proxy inside that fixture's unrelated native scope. Bind its dispatch to its original host context. Its original product route, TLS, key, state and four-tool assertions pass without a native-route exemption or broker change.

Both companions preserve the actual product namespace/filter prefixes. Their branded spawn record identifies only the already-validated outer status-FIFO handoff: the replay supplies independent status descriptors instead of consuming the original turn's one-shot FIFO. Normalization compares the captured product plan after terminal replacement and inserted O1 masks. Dropping nsenter fails the real staging-source proof; the mutation is restored.

Follow-ups exposed by the complete unit selection

Code Cause and correction Proof
V1 Origin's four-app setup exceeded the default watchdog, then teardown dereferenced the unassigned fourth app before closing the first three. Their acquisition stand-ins leaked into managed-tree and egress tests. Give hooks explicit watchdogs and make partial setup teardown safe. Origin 20/20; origin → tree-placement → egress selection 30/30.
V2 An interrupted HTTP fixture left a route observer active; the next fixture captured that observer and recursed. Capture the real Hono method before observers. Multi-app tests and awaited cleanup receive explicit hang watchdogs. Account, external speech and HTTP mounted-contract files: 180/180.
V3 Real fixture startup and cleanup exceeded default test/receipt hang waits. Scope longer watchdogs to recovery listener setup, real inner-worker diagnostics and the changed-file accounting case. Recovery 6/6; turn-scope 17/17. Product timing assertions are unchanged.
V4 A broad receipt-default change would break the existing five-second protocol proof. Keep that default; only real-worker startup diagnostics request the longer optional caller watchdog. Bounded stderr, original inner exit 23 and cleanup assertions remain. The final 55-case refinement set includes the original five-second deadline proof and real nested worker diagnostics.
V5 Dictation's two raw fixture SQLite writers had no busy timeout and raced startup writes. Apply production's existing five-second busy timeout to those fixture connections only. Whole dictation file passed in the 55-case refinement set; all settings/revision/policy assertions remain.
V6 Two newly inventoried inner hang waits were literal values. Apply watchdogMs without changing their base durations. Native timeout inventory, Pi history and subscription cases passed in the 55-case refinement set.
V7 The receipt reused-owner test expected degradation, contradicting the approved rule that a start-time mismatch refuses. Correct the test; the implementation is unchanged. Owner disappearance still degrades to write-nothing. Four focused cases pass; removing the owner start-time check fails INVALID_AUTHORITY_MUST_REFUSE_NOT_DEGRADE, then the source is restored.

The initial complete run at 4d6fa52fc reconciled all 1,666 files against both JUnit and timing manifests, with cleanup confirmed for every worker: 22,006 tests, 31 failures and 46 skips. This is a failing diagnostic receipt, not green proof. The final-head full-category result is recorded above. Expected optional skips and inverse sqlite-vec sentinels are distinguished from assertions skipped by a failed hook.

Determinism budget

The large native-boundary file is split into two independently runnable files with a shared driver: 39 + 17 cases, preserving every original test body, including the two-case loop. Reviewed weights come from completed JUnit durations in hosted heavy run 45014338287, not local or boat timings. The same source supplies weights for 26 previously unweighted files. Current selection: 125 changed Bun files, two repetitions, seven shards with 16/17/18/18/19/18/19 files. Their weighted repeated work is 298.33–298.53 seconds each, about 34.01–34.04 minutes at the previously measured hosted load ratio, plus the existing four-minute watchdog headroom. No capacity, repetition floor, workflow gate, version or pinned browser image changes.

Proportionate containment checklist

The checklist applies: its scope has no exemption for test guards.

  • C1 — Trigger and limits. Positive native identity requires admission, command agreement, scripted authority and enforceable isolation. Unknown launches mask every discovered installed/selected path and canonical target; reaching a stub refuses that launch. Unavailable enforcement or unproven chains refuse. Hash-equal computed copies and remapped/unlinked-byte-copy residuals are explicitly tracked in ci: native Claude tests can escape offline isolation through managed settings #4313/ci: harden native fixture stderr privacy, bounds and shutdown cleanup #4410; diagnostic audit is not a synchronous safety barrier.
  • C2 — Narrowest restriction. Restrict one launch, retaining harmless unknown shells' product env, files, network and exact /dev view except runtime masks and private guard evidence. Only already-admitted native launches get a selected-path descriptor projection and live transport authority. No host-wide latch or production authority change.
  • C3 — Restricted before refusal. Unknown shells run with O1 masks before any payload executes. Native launches use the qualified offline broker/view. The guard refuses when that restricted mode cannot be enforced, rather than running a native executable unmasked. Unknowns get no receipt/transfer capability. The developer-host native ban is unchanged, including --version. The separately authorized boat native proof first checks absent managed settings/helpers and real credentials, then asserts offline receipts.
  • C4 — Clearing. Scoped declarations expire at turn/fixture cleanup; mask/audit resources are released after final inspection or the exact retained descendant's exit. Gone/reused descendants and process exit release resources. Receipt owner disappearance degrades to write-nothing; a reused owner PID refuses. Refusal remains failed evidence for that invocation but does not prevent an independent valid same-process launch.
  • C5 — Durable cause. Fixed refusal records and guard-owned receipts appear in test/CI output. Scrubbed owner-only boundary artifacts retain phase/stage/source-role and bounded qualification stderr. Borrowed-audit failure is recorded and kills/refuses the owned launch. Evidence contains no credential values.
  • C6 — Independent scope proof. native-tripwire T7 first reaches a stub, then succeeds with an independent harmless launch in the same process. The global-refusal-latch mutation fails REFUSAL_IS_LOCAL_TO_FAILED_LAUNCH. Separate tests cover unavailable masking, canonical aliases, nested native attempts, peer/authority loss and cross-namespace descriptor identity.

Reviews, earlier fixture repairs and remaining proof

Fable 24 is recorded at reviewed 906745512: two fixed, two filed on #4410, one rejected, zero undisposed. Earlier fable findings and O1 residuals remain filed on #4410; the maintainer widened #4313. This is not independent approval of the new head. Fresh GitHub heavy runtime/runtime_host and independent review remain required; no whole-heavy green claim or merge is made.

The 17 classification-only sweep edits were reverted: private-index-stdio-release, autonomous-provider-masks, ws-scope-caps, helpers/scope-fixture, turn-scope, private-index, provider-continuation-state, Pi early-cancel-lifecycle/duplicate-acquisition, worker-steps-event-loop, Claude worker/worker-event-loop/state-room-warning/provider-denied-memory, governed-worker, worker-status and governance-policy. Later substantive fixture repairs remain where needed. The origin/main startup-view omissions are filed separately without a milestone in #4456 and receive only the acquired-view property, preserving all policy assertions.

Local continuation evidence (not proof of the pushed head)

Fable 26 is recorded at 4c53162b5. The current fixture-inspection batch remains local; the push is held on the actual-native strict acknowledgement proof and outstanding mutation receipts. The 5 s probe deadline and 10 s acknowledgement limit remain unchanged.

S1 — Latest local timing gate remains red: actual installed-native strict acknowledgement is 10,535.845 ms against the unchanged 10,000 ms limit. Initial inspection is 4,732 ms including its initial 630.430 ms complete freshness check; four complete checks total 2,493.798 ms. Non-overlapping inspection plus checks total 6,595.368 ms, down from about 23.8 s. A complete fresh check follows the synchronous launch walk; the earlier timing variant without that final post-walk check is not accepted as gate proof. Actual receipt: peak concurrent capture readers 3, peak buffered data 237,568 bytes, process lifetime peak RSS 316,544 KiB, drained=true. The process RSS figure is not incremental or whole-VM memory. Focused inspection tests pass 29/29; reader-limit and skip-drain mutations fail their intended assertions. The real mid-walk write / skip-final-check proof, replacement first/repeated/warm timings and clean full-identity proof are outstanding. No further mechanism is being added and no push is being made on this result.

S2 — Bounded manager comparison: the completed manager-only proof passed once on main (7e861bdb3) and once with the local batch fixture overlay, using each checkout's own preload on the same boat VM. Both reached the real manager proof and owned cleanup. EPIPE was not reproduced, so the earlier failure remains unattributed; this does not establish it as pre-existing. Transfer/module-load setup failures were excluded from this comparison. The earlier failed head setup is not a manager failure. Logs and the final head receipt are archived locally.

@schlessera
schlessera marked this pull request as draft November 20, 2026 18:57
@schlessera schlessera added area: backends AgentBackend implementations and the seam they share. area: ci CI workflows, the gates they run, release scripts, packaging. priority: p1 Scheduled into the current or next milestone. security Auth, isolation, egress, secrets, or anything in the threat model. type: fix Something is broken and must behave the way it is documented. labels Nov 20, 2026 — with schlessera-agent-fleet
@schlessera schlessera added this to the 0.45.0 milestone Nov 20, 2026 — with schlessera-agent-fleet

Copy link
Copy Markdown
Owner Author

Independent review, reviewed head 71d5949a084363807e3a24dd79acdfe7136e64aa. Findings recorded unchanged; dispositions will follow the fixes and hosted proof.

[
  {
    "summary": "scripts/test-native-guard.ts:142 — The relay resolves a request-controlled path against the scripted service URL. URL resolution can change the destination origin, and the outer fetch guard permits other loopback services. The relay must verify the final origin before forwarding request headers and body."
  },
  {
    "summary": "scripts/test-native-guard.ts:171 — The fixed PATH, omitted USE_BUILTIN_RIPGREP setting and missing fixture mounts prevent the retention suite from invoking its instrumented rg. The running, duplicate and retooled cases depend on the marker that wrapper writes. The denied-search case can pass its missing-marker assertion even if the search ran."
  },
  {
    "summary": "scripts/test-native-guard.ts:89 — Bun.spawnSync throws ENOENT when bwrap is missing. That exception bypasses refuse(), so the guard emits no failed receipt and does not latch the refusal. A caller that catches the exception can exit successfully despite missing isolation."
  },
  {
    "summary": "tests/native-offline-boundary.test.ts:103 — The synthetic child prints NATIVE_TCP_DENIED itself. A real native runtime or helper that catches a denied TCP connection produces no guard record because the attempt never reaches the Unix relay. The test therefore passes without the required denied-attempt reporting."
  },
  {
    "summary": "scripts/test-native-guard.ts:62 — Runtime detection resolves the executable using the parent PATH and working directory. Bun can launch using a child-specific PATH or cwd, so the executable the guard classifies can differ from the one Bun starts. An installed runtime selected through those supported spawn options can miss admission entirely."
  },
  {
    "summary": "docs/process/testing.md:1141 — The PR reports hosted proof as pending. There is no passing receipt for this head with the complete native retention and provider-history test inventory required by #4313."
  }
]

Copy link
Copy Markdown
Owner Author

Independent review of #4314 at 71d5949a084363807e3a24dd79acdfe7136e64aa found that its native OS boundary intentionally supplies a fixed runtime PATH and isolated mounts. The retention fixtures in this PR therefore need to integrate their instrumented rg into that boundary (PATH, USE_BUILTIN_RIPGREP, and the fixture executable/mounts), with positive invocation witnesses for the running, duplicate, and retooled cases and a control showing that the denied-search witness cannot pass merely because rg was unavailable. This fixture integration and the complete retention inventory remain part of #4274 / this PR; #4314 qualifies the generic boundary and native suites already on main. No retention qualification is claimed by #4314 before this integration.

Copy link
Copy Markdown
Owner Author

Independent re-review, reviewed head 3e0f005583f572b39aa8ebdfb99f3ffd58a4dda2. Findings recorded unchanged:

[
  {
    "summary": "scripts/test-native-guard.ts:260 admits an existing worker relay based on socket ownership and location. Those checks cannot establish which service the socket forwards to. A different same-user relay passes admission, so the worker lacks the exact scripted-destination guarantee that direct SDK launches receive."
  },
  {
    "summary": "scripts/test-native-guard.ts:150 emits nativeLaunched:true whenever cleanup reads the trace. The spawn error handler also calls cleanup, and a failed bubblewrap setup can leave an empty trace. Both paths can therefore report a native launch when no native process started, instead of the required failed receipt."
  },
  {
    "summary": "scripts/test-native-guard.ts:42 silently accepts SDK discovery failure. If a workspace package can resolve its SDK but the root preload cannot, installedRuntimes stays empty and every executable passes classification as non-native. The affected launch then proceeds without isolation or a refusal receipt."
  },
  {
    "summary": "docs/process/testing.md:1146 leaves complete retention qualification to #4274. Issue #4313 explicitly requires passing hosted retention and provider-history receipts naming the reviewed head and complete test inventory. Deferring the retention run leaves that acceptance criterion open."
  }
]

Copy link
Copy Markdown
Owner Author

Re-review fixes are committed at e402ec98b1063d42ae9e20f9c796e676ef7caa10. Unknown pre-existing relays now refuse; fixture-declared scripted service authority lets the guard construct/start Unix servers with handler fetch/TCP/Unix transports pinned to that exact physical service. Empty/missing/launcher-only traces produce a failed nativeLaunched:false receipt; only successful native exec evidence permits true. SDK discovery checks all workspace owners and refuses unresolved declared SDKs, without runtime auto-install. Local boundary inventory: 13 pass. Disabling relay ownership/forwarding, launch evidence and discovery latching produced 8 pass / 5 fail; restoring produced 13 pass. A separate root-only SDK discovery mutation failed on the expected workspace-native assertion. The retention qualification finding is filed to #4274, with the reason and acceptance split in #4313's body and dated comment. Exact-head preflight, types and hosted feedback are running; no installed native runtime was launched locally.

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 3ffa915 against base 0996839. Reviewer: agent. 5 findings: 1 fixed, 2 filed, 1 rejected, 1 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4314,
  "head": "3ffa915b52d728292766432d08c7d46a986609dd",
  "base": "099683923ff8764686c9b92fc2dfb021f1d01f67",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "Fable 23 FIX 1: replace custom unshare masking on AppArmor-restricted hosts while preserving product namespace keeper PID and child topology; design pending maintainer review."
    },
    {
      "summary": "Fable 23 FIX 2: candidate-only ENOTDIR and ELOOP skips; installed runtime mask-path errors remain strict.",
      "disposition": "fixed",
      "commit": "8686fa8744c4eaca048f4fd42322aed022049acb"
    },
    {
      "summary": "Fable 23 deferred runtime-directory alternate destination and inherited/unlinked-fd byte-copy residual.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 23 deferred shared static stub directory cleanup on refused preload exit.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 23 redundant isAbsolute mutation.",
      "disposition": "rejected",
      "reason": "Reviewer marked DROP: the mutation is redundant with the following metadata handling and does not establish another defect."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 3ffa915 against base 0996839. Reviewer: agent. 5 findings: 2 fixed, 2 filed, 1 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4314,
  "head": "3ffa915b52d728292766432d08c7d46a986609dd",
  "base": "099683923ff8764686c9b92fc2dfb021f1d01f67",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "Fable 23 FIX 1: replace custom unshare masking with the exact product keeper mount-only path and bwrap lifetime supervisor; preserve sole-child topology and signals.",
      "disposition": "fixed",
      "commit": "416bd10e2804838c83bba6c5c6caa4cccc565807"
    },
    {
      "summary": "Fable 23 FIX 2: candidate-only ENOTDIR and ELOOP skips; installed runtime mask-path errors remain strict.",
      "disposition": "fixed",
      "commit": "8686fa8744c4eaca048f4fd42322aed022049acb"
    },
    {
      "summary": "Fable 23 deferred runtime-directory alternate destination and inherited/unlinked-fd byte-copy residual.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 23 deferred shared static stub directory cleanup on refused preload exit.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 23 redundant isAbsolute mutation.",
      "disposition": "rejected",
      "reason": "Reviewer marked DROP: the mutation is redundant with the following metadata handling and does not establish another defect."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 9067455 against base 0996839. Reviewer: agent. 5 findings: 2 fixed, 2 filed, 1 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4314,
  "head": "906745512f216b71c958c46ac0e685dddfa64ae9",
  "base": "099683923ff8764686c9b92fc2dfb021f1d01f67",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "Fable 24 FIX 1: run tripwire finalizers before the refusal exit listener; refused processes release per-launch and shared stub directories.",
      "disposition": "fixed",
      "commit": "de2869c68af576d3d0cbb1667a6396bdb3e2c9a9"
    },
    {
      "summary": "Fable 24 FIX 2: parse scripted fixture root arrays and assert root plus brainPath for autonomous-runtime.",
      "disposition": "fixed",
      "commit": "de2869c68af576d3d0cbb1667a6396bdb3e2c9a9"
    },
    {
      "summary": "Fable 24 defer: owner-discovery deadline is armed for a disposed fork plan that was never launched.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 24 defer: captureSurface leaves one native receipt directory per run.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 24 local product-keeper proof is blocked by the product own unshare on the reviewer host.",
      "disposition": "rejected",
      "reason": "Reviewer marked DROP: this host limitation is not a guard defect. P1 qualification depends on hosted evidence; no local pass is claimed for that reviewer host."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Fable fix check 25, reviewed at a7240d487. Four code fixes, one baseline attribution filed, two deferrals filed and two rejected findings; zero undisposed. This records that reviewed head, not independent approval of the timing barrier added afterward.

Independent review

Reviewed head a7240d4 against base 0996839. Reviewer: agent. 9 findings: 4 fixed, 3 filed, 2 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4314,
  "head": "a7240d48711c8fed4ddd88d44bb19061e43b0ae2",
  "base": "099683923ff8764686c9b92fc2dfb021f1d01f67",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "Fable 25 FIX 1: title collector entry chmod restores its exact read-only mode under private umask.",
      "disposition": "fixed",
      "commit": "1b69a4371f79ec5cc1695628ea97d2d0a9d19028"
    },
    {
      "summary": "Fable 25 FIX 2: guard cleanup finalizers run before the refusal exit listener.",
      "disposition": "fixed",
      "commit": "fb7867c4a169d2cdcafbe423201397455b985ef9"
    },
    {
      "summary": "Fable 25 FIX 3: dead-owner and orphaned receipt degradation retains write-nothing proofs while every refusal fails locally.",
      "disposition": "fixed",
      "commit": "1b69a4371f79ec5cc1695628ea97d2d0a9d19028"
    },
    {
      "summary": "Fable 25 FIX 4: Pi requires an undefined transferRefusal and retains every real descriptor-transfer assertion.",
      "disposition": "fixed",
      "commit": "1b69a4371f79ec5cc1695628ea97d2d0a9d19028"
    },
    {
      "summary": "Fable 25 FIX 5: same-VM paired repetitions reproduce the original tracker cold-reload assertion on unmodified main; exact internal cause remains open.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4479"
    },
    {
      "summary": "Fable 25 DEFER a: carrier directory cleanup under Bun test is filed with receipt-directory leaks.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 25 DEFER b: script-file shells need O1 classification; the classification-only local-process-provider edit has been reverted.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4410"
    },
    {
      "summary": "Fable 25 DROP: intermediate-bind check.",
      "disposition": "rejected",
      "reason": "The existing socket scan already covers that exposure, as the binding triage states."
    },
    {
      "summary": "Fable 25 DROP: summary note.",
      "disposition": "rejected",
      "reason": "Rejected by the binding triage; it does not identify a separate defect to implement."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Fable fix check 26 at 4c53162b5: binding dispositions recorded below. This records the reviewed head, not independent approval of the subsequent fixes.

Independent review

Reviewed head 4c53162 against base 0996839. Reviewer: agent. 3 findings: 2 fixed, 0 filed, 1 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4314,
  "head": "4c53162b5b1adf178c0c9ef19d9d37ba285130d0",
  "base": "099683923ff8764686c9b92fc2dfb021f1d01f67",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "Fable 26 FIX 1: owner sink cleanup no longer loses exit refusal receipts; owner-exit proof and close-first mutation pass.",
      "disposition": "fixed",
      "commit": "714170a077b765db01bc4af19bed4fccac39a0b2"
    },
    {
      "summary": "Fable 26 FIX 2: detached spawnSync disarms async readiness, including pre-built plans; native synchronous refusal remains.",
      "disposition": "fixed",
      "commit": "ccd01c2d2036f4668667d934d8297376640d4048"
    },
    {
      "summary": "U1 cheap metadata stamp",
      "disposition": "rejected",
      "reason": "Accepted by review: identity stamp rechecks before launch; projected-byte hash remains in the behavioral proof."
    }
  ]
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backends AgentBackend implementations and the seam they share. area: ci CI workflows, the gates they run, release scripts, packaging. priority: p1 Scheduled into the current or next milestone. security Auth, isolation, egress, secrets, or anything in the threat model. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant