Repository navigation
fix: start Gateway with conflicting legacy exec approvals - #196401
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs real behavior proof before merge. What this changesAllows Gateway and node startup to retain conflicting legacy approvals while using canonical SQLite policy and reporting degraded state. Example: SQLite specifies security="deny", while exec-approvals.json specifies security="full".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 6 items remain Keep open: this maintainer-authored PR addresses a current startup failure, but its changed behavior leaves three existing CI assertions failing. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherStartup credential preparation inspects legacy approval files; the shared approval store supplies canonical policy to runtime authorization, mutations, and cron execution. flowchart LR
A[Gateway or node startup] --> B[Credential preparation]
C[Legacy approvals file] --> B
B --> D[Retained input warning]
B --> E[Canonical SQLite policy]
E --> F[Runtime authorization]
F --> G[Host execution guard]
Technical reviewBest possible solution: Keep the centralized canonical-policy boundary and existing migration owner, complete the affected consumer tests, and establish execution and upgrade safety. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically rejects conflicting legacy approvals during startup preparation; the PR reports a red-on-parent Gateway regression, but no target code was executed in this read-only review. Is this the best way to solve the issue? Moving the gate to the existing canonical snapshot owner is a focused solution that preserves migration ownership and avoids competing policy sources. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f9f10abb24a. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was found, but the changed execution gate needs final-effect authority evidence. EvidenceWhat I checked:
PR surfaceSource +13, Tests +127, Docs +8, Other +219. Total +367 across 18 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 9, 2026, 9:57 PM ET / November 10, 2026, 02:57 UTC. |
|
Merged via squash auto-merge.
|
|
Post-merge closeout of all six items in the review of
The compatibility writer is the old maintenance transaction owner; the current authorization kernel requires the durable exact-command grant. Fixture stores and commands are entirely synthetic; no production data or service was accessed. Fresh focused test command, at the main SHA above: pnpm test src/node-host/startup-state-readiness.test.ts src/flows/doctor-health.managed-approvals.test.ts --maxWorkers=1
# Test Files 2 passed (2); Tests 15 passed (15)Actual host-execution results (all with the same retained permissive legacy file):
Complete live Gateway proof driver and commandSave the two files below in a fresh scratch directory outside the checkout. Run from the pinned main checkout with its existing dependencies and supported Node 24. The driver asserts the Git SHA, seeds canonical state in a separate process (so startup sees the foreign file on its first inspection), starts the real Gateway, waits for readiness, performs the four real exec calls, asserts the outcomes, writes node --import ./scripts/tsx.mjs "$PROOF_DIR/proof.mts"
# PROOF_PASS
const {updateExecApprovalsForMaintenance}=await import(process.cwd()+'/src/infra/exec-approvals-store.ts');
const {closeOpenClawStateDatabaseAsync}=await import(process.cwd()+'/src/state/openclaw-state-db.ts');
updateExecApprovalsForMaintenance(()=>({version:1,defaults:{security:'deny',ask:'off'},agents:{}}));
await closeOpenClawStateDatabaseAsync();
import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert/strict';
import { ChildProcess, execFileSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
import net from 'node:net';
import os from 'node:os';
const repo = process.cwd();
assert.equal(execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8'}).trim(),'c7152f3bda8e52c24fc2fda83911e7e1c24fb0f2');
const root = path.dirname(new URL(import.meta.url).pathname);
const cache = fs.mkdtempSync(path.join(os.tmpdir(),'lane2353-private-cache-'));
const state = path.join(root, 'state-' + Date.now());
fs.mkdirSync(state, {recursive:true});
process.env={PATH:process.env.PATH};
Object.assign(process.env, {HOME:state, OPENCLAW_STATE_DIR:state, OPENCLAW_CONFIG_PATH:path.join(state,'openclaw.json'), XDG_CONFIG_HOME:path.join(state,'config'), XDG_CACHE_HOME:cache});
const workspace=path.join(state,'workspace'); fs.mkdirSync(workspace);
const probe=path.join(workspace,'lane2353-probe');
fs.writeFileSync(probe, '#!/bin/sh\nprintf "executed:%s\\n" "$$" > "$1"\nprintf "LANE2353_EXECUTED\\n"\n', {mode:0o755});
const launches:any[]=[];
let phase='startup';
const nativeSpawn=ChildProcess.prototype.spawn;
ChildProcess.prototype.spawn=function(options:any) {
if (JSON.stringify(options.args).includes(probe)) launches.push({phase,file:options.file,args:options.args});
return nativeSpawn.call(this,options);
};
const listener=net.createServer(); await new Promise<void>(r=>listener.listen(0,'127.0.0.1',r));
const port=(listener.address() as net.AddressInfo).port; await new Promise<void>(r=>listener.close(()=>r()));
const token=randomUUID();
const config={agents:{defaults:{workspace,model:{primary:'openai/gpt-5.6-sol'}}}, tools:{exec:{host:'gateway',mode:'full'}},gateway:{mode:'local',port,bind:'loopback',auth:{mode:'token',token},controlUi:{enabled:false},tools:{allow:['exec']}},plugins:{enabled:false},cron:{enabled:false},discovery:{mdns:{mode:'off'}}};
fs.writeFileSync(process.env.OPENCLAW_CONFIG_PATH!,JSON.stringify(config));
const source=(name:string)=>import(path.join(repo,'src',name));
execFileSync(process.execPath,['--import',path.join(repo,'scripts/tsx.mjs'),path.join(root,'seed.mts')],{env:process.env,stdio:'inherit'});
const legacy=JSON.stringify({version:1,defaults:{security:'full',ask:'off'},agents:{}});
const legacyPath=path.join(state,'exec-approvals.json'); fs.writeFileSync(legacyPath,legacy);
const {runStartupConfigPreflight}=await source('commands/startup-config-preflight.ts');
const preflight=await runStartupConfigPreflight({gateway:true,observe:false});
const {startGatewayServer}=await source('gateway/server.ts');
const server=await startGatewayServer(port,{bind:'loopback',controlUiEnabled:false,startupConfigSnapshotRead:preflight});
const results:any={head:'c7152f3bda8e52c24fc2fda83911e7e1c24fb0f2',state,route:'production createExecTool.execute(host=gateway), live Gateway approvals RPC',cases:[]};
try {
await server.startupSettled;
let ready; for(let i=0;i<120;i++){ready=await fetch(`http://127.0.0.1:${port}/readyz`);if(ready.status===200)break;await new Promise(r=>setTimeout(r,500));} assert.equal(ready!.status,200,await ready!.text());
const {readStartupMigrationWarning}=await source('infra/state-migrations.messages.ts');
assert.match(readStartupMigrationWarning(),/legacy-exec-approvals-conflict/);
const {callGateway}=await source('gateway/call.ts');
const rpc=(method:string,params?:unknown)=>callGateway({url:`ws://127.0.0.1:${port}`,token,config,method,params,skipImplicitAuth:true,timeoutMs:30000});
const setPolicy=async(file:any)=>{const snapshot=await rpc('exec.approvals.get'); await rpc('exec.approvals.set',{baseHash:snapshot.hash,file});};
const {createExecTool}=await source('agents/bash-tools.ts');
const execTool=createExecTool({host:'gateway',security:'full',ask:'off',safeBins:[],cwd:workspace,agentId:'main'});
async function invoke(label:string,allowed:boolean){
phase=label; const marker=path.join(workspace,label+'.marker'); const before=launches.length;
let body:any; try {body={ok:true,result:await execTool.execute(label,{command:`${probe} ${marker}`,workdir:workspace,yieldMs:10000})};} catch(error){body={ok:false,error:String(error)};}
const result={label,body,observedNativeLaunches:launches.length-before,markerExists:fs.existsSync(marker)}; results.cases.push(result); console.log('CASE',JSON.stringify(result));
if(allowed){assert.equal(result.markerExists,true);assert.ok(result.observedNativeLaunches>0);}
else {assert.equal(result.markerExists,false);assert.equal(result.observedNativeLaunches,0);assert.match(JSON.stringify(body),/denied|deny|allowlist|approval changed/i);}
assert.equal(fs.readFileSync(legacyPath,'utf8'),legacy);
}
await invoke('canonical-deny',false);
const grant={version:1,defaults:{security:'allowlist',ask:'off'},agents:{main:{allowlist:[{id:'synthetic-path-grant',pattern:probe}]}}};
await setPolicy(grant);
await invoke('canonical-allow-control',true);
await setPolicy({...grant,agents:{main:{allowlist:[]}}});
await invoke('canonical-revoked',false);
await setPolicy(grant);
const {getProcessSupervisor}=await source('process/supervisor/index.ts');
const supervisor=getProcessSupervisor(); const realSupervisorSpawn=supervisor.spawn.bind(supervisor);
let barrierReached=false;
supervisor.spawn=async(input:any)=>{
if(phase==='prepared-then-revoked' && JSON.stringify(input.argv).includes(probe)){
barrierReached=true;
await setPolicy({...grant,agents:{main:{allowlist:[]}}});
}
return realSupervisorSpawn(input);
};
try {await invoke('prepared-then-revoked',false);assert.equal(barrierReached,true);}
finally {supervisor.spawn=realSupervisorSpawn;}
results.preparedRevocationBarrierReached=barrierReached;
results.legacyUnchanged=true;results.pass=true;
} finally {
fs.writeFileSync(path.join(root,'results.json'),JSON.stringify({...results,launches},null,2));
await server.close({reason:'Synthetic proof complete'});
await preflight.pluginCache?.[Symbol.asyncDispose]();
}
fs.rmSync(cache,{recursive:true,force:true});
console.log('PROOF_PASS');
process.exit(0);Complete pre-change SQLite compatibility driver and commandsUse existing dependency-ready checkouts at the exact # BASE = checkout at 2609b4f93bf851274e94635bc19ebe10cb624236
# MAIN = checkout at c7152f3bda8e52c24fc2fda83911e7e1c24fb0f2
mkdir "$PROOF_DIR/compat-replay"
for scenario in deny allowed revoked; do
node --import "$BASE/scripts/tsx.mjs" "$PROOF_DIR/compat.mjs" --repo "$BASE" --root "$PROOF_DIR/compat-replay/$scenario" --mode seed --scenario "$scenario"
node --import "$BASE/scripts/tsx.mjs" "$PROOF_DIR/compat.mjs" --repo "$BASE" --root "$PROOF_DIR/compat-replay/$scenario" --mode probe --scenario "$scenario" --output "$PROOF_DIR/compat-replay/$scenario-before.json"
node --import "$MAIN/scripts/tsx.mjs" "$PROOF_DIR/compat.mjs" --repo "$MAIN" --root "$PROOF_DIR/compat-replay/$scenario" --mode probe --scenario "$scenario" --output "$PROOF_DIR/compat-replay/$scenario-main.json"
node --import "$MAIN/scripts/tsx.mjs" "$PROOF_DIR/compat.mjs" --repo "$MAIN" --root "$PROOF_DIR/compat-replay/$scenario" --mode probe --scenario "$scenario" --conflict --output "$PROOF_DIR/compat-replay/$scenario-main-conflict.json"
done
# All 9 probes pass: canonicalUnchanged=true, socketUnchanged=true;
# conflicting-file probes also legacyUnchanged=true.
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { createHash } from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
import { parseArgs } from 'node:util';
const {values}=parseArgs({options:{repo:{type:'string'},root:{type:'string'},mode:{type:'string'},scenario:{type:'string'},conflict:{type:'boolean'},output:{type:'string'}}});
assert(values.repo && values.root && values.mode && values.scenario);
const repo=path.resolve(values.repo),root=path.resolve(values.root);
const scenario=values.scenario;
assert(['deny','allowed','revoked'].includes(scenario));
const sha=execFileSync('git',['-C',repo,'rev-parse','HEAD'],{encoding:'utf8'}).trim();
assert(['2609b4f93bf851274e94635bc19ebe10cb624236','c7152f3bda8e52c24fc2fda83911e7e1c24fb0f2'].includes(sha));
if(values.mode==='seed') {assert(sha==='2609b4f93bf851274e94635bc19ebe10cb624236');fs.mkdirSync(root);}
process.env={PATH:process.env.PATH,HOME:root,USERPROFILE:root,OPENCLAW_HOME:root,OPENCLAW_STATE_DIR:root,OPENCLAW_CONFIG_PATH:path.join(root,'openclaw.json'),NO_COLOR:'1',OPENCLAW_DISABLE_BUNDLED_PLUGINS:'1'};
const load=(file)=>import(pathToFileURL(path.join(repo,file)).href);
const [store,authorization,credentials,state,snapshots,lifecycle]=await Promise.all([
load('src/infra/exec-approvals-store.ts'),load('src/infra/exec-approvals-authorization.ts'),load('src/infra/client-credential-store.ts'),load('src/state/openclaw-state-db.ts'),load('src/infra/sqlite-readonly-location-cleanup.ts'),load('src/infra/worker-native-lifecycle.ts')]);
const hash=(value)=>createHash('sha256').update(typeof value==='string'?value:JSON.stringify(value)).digest('hex');
const command='/usr/bin/printf compatibility';
const grant={id:'compatibility-grant',pattern:'=command:'+hash(command).slice(0,16),source:'allow-always'};
const policy={version:1,defaults:{security:scenario==='deny'?'deny':'allowlist',ask:'on-miss',askFallback:'deny',autoAllowSkills:false},agents:{main:{allowlist:[grant]}}};
const legacyPath=path.join(root,'exec-approvals.json');
try {
if(values.mode==='seed') {
store.updateExecApprovalsForMaintenance(()=>policy);
if(scenario==='revoked') store.updateExecApprovalsForMaintenance((file)=>({...file,agents:{...file.agents,main:{allowlist:[]}}}));
credentials.runClientCredentialOperation(process.env,{kind:'socket.ensure',fallback:{socket_key:'current',socket_path:path.join(root,'canonical.sock'),socket_token:'synthetic-canonical-compatibility-socket',updated_at_ms:123},requested:{path:path.join(root,'canonical.sock'),token:'synthetic-canonical-compatibility-socket'}});
const canonical=store.readExecApprovalsSnapshot();
const socket=credentials.runClientCredentialOperation(process.env,{kind:'socket.read'});
assert(socket.kind==='socket' && socket.socket?.socket_path===path.join(root,'canonical.sock') && socket.socket?.socket_token==='synthetic-canonical-compatibility-socket','Canonical synthetic socket must exist');
fs.writeFileSync(path.join(root,'expected.json'),JSON.stringify({writer:sha,canonical,socketHash:hash(socket),expected:scenario==='allowed'?'allowed':'denied'}),{flag:'wx',mode:0o600});
console.log(JSON.stringify({scenario,writer:sha,canonicalHash:hash(canonical.raw),socketHash:hash(socket)}));
} else {
const expected=JSON.parse(fs.readFileSync(path.join(root,'expected.json'),'utf8'));
assert.equal(expected.writer,'2609b4f93bf851274e94635bc19ebe10cb624236');
if(values.conflict)fs.writeFileSync(legacyPath,JSON.stringify({version:1,defaults:{security:'full',ask:'off'},agents:{},socket:{path:path.join(root,'foreign.sock'),token:'synthetic-foreign-compatibility-socket'}})+'\n',{flag:'wx',mode:0o600});
const legacyBefore=values.conflict?fs.readFileSync(legacyPath):undefined;
const canonical=store.readExecApprovalsSnapshot();
assert.deepEqual(canonical,expected.canonical);
assert.deepEqual(store.loadExecApprovals(),expected.canonical.file);
assert.deepEqual(store.loadExecApprovalsReadOnly(),expected.canonical.file);
assert.deepEqual(await store.loadExecApprovalsReadOnlyAsync(),expected.canonical.file);
let outcome='allowed';
try {
const assertCurrent=await authorization.commitExecAuthorizationLocked({agentId:'main',matches:[],command,authorization:{source:'current-policy',security:'allowlist',ask:'on-miss',allowlistSatisfied:true,requireExactCommandApproval:true}});
assertCurrent();
} catch(error) {
assert(error instanceof Error && error.message==='Exec approval changed before execution',String(error));
outcome='denied';
}
assert.equal(outcome,expected.expected);
assert.deepEqual(store.readExecApprovalsSnapshot(),expected.canonical);
const socket=credentials.runClientCredentialOperation(process.env,{kind:'socket.read'});
assert(socket.kind==='socket' && socket.socket?.socket_path===path.join(root,'canonical.sock') && socket.socket?.socket_token==='synthetic-canonical-compatibility-socket','Canonical synthetic socket must exist');
assert.equal(hash(socket),expected.socketHash);
if(legacyBefore)assert.deepEqual(fs.readFileSync(legacyPath),legacyBefore);
const result={scenario,node:process.version,writer:expected.writer,reader:sha,conflictingLegacy:!!values.conflict,outcome,canonicalUnchanged:true,canonicalHash:hash(canonical.raw),socketUnchanged:true,socketHash:hash(socket),legacyUnchanged:values.conflict?true:null,readers:['snapshot','sync','sync-readonly','async-readonly'],authorization:'commitExecAuthorizationLocked + retained final guard; requireExactCommandApproval; no usage mutation'};
assert(values.output);fs.writeFileSync(values.output,JSON.stringify(result,null,2));console.log(JSON.stringify(result));
}
} finally {
await state.closeOpenClawStateDatabaseAsync();
await snapshots.cleanupSnapshotOperations();
await lifecycle.closeDefaultRetainedNativeWorkerSource();
}No source/schema/config-contract change was needed for this closeout (additional production LOC: 0). The separate Windows-node test HOME/state-isolation follow-up remains outside this PR. Please evaluate all six items against this evidence, including the previously reviewed older head; none should be waived based on head age. @clawsweeper re-review |
|
ClawSweeper could not start a re-review for this item. |
…96401) * fix: preserve Gateway startup with retained legacy exec approvals * test: cover degraded legacy approvals in startup siblings
Retain conflicting, invalid, or unreadable legacy input with an actionable warning while canonical SQLite approvals remain authoritative. When no canonical policy exists, keep execution unavailable rather than importing legacy authority or blocking unrelated Gateway startup. Adapt credential preparation to the release branch and retain its database admission and runtime intent ownership. Cover native Gateway startup, canonical policy reads/writes, node readiness, and Doctor consumers. Independent local review omitted by explicit release-owner instruction. Full release qualification remains separate from this bounded backport. (cherry picked from commit a0ec2b5) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit 74e2e4117388338a1f362c2b276b2d3b02cbbde7)
Release-specific port of openclaw#196401. Preserve missing-canonical refusal and malformed-policy fail-closed behavior across workers, Node readiness and Doctor. Independent local review waived by Dallin; full CI qualification pending. (cherry picked from commit a0ec2b5) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes Gateway restart loops when an older node host or another writer leaves conflicting or invalid
exec-approvals.jsonbeside canonical SQLite approvals.User Impact
Gateway and node startup retain the legacy file and report degraded state through the existing status/Doctor warning report. Canonical approvals remain authoritative; no conflicting policy or socket credential is imported. Runtime reads and authorized edits use canonical policy. Legacy-only execution remains unavailable until migration succeeds. Valid legacy-only imports and byte-identical source retirement keep their existing migration owner.
Why This Change Was Made
The SQLite cutover (#114063) refused legacy presence to prevent silently serving empty/default policy, and automatic credential preparation (#178998) promoted that refusal into a startup failure. The protection now belongs at the canonical snapshot boundary: only absent canonical policy requires the legacy gate. Preparation returns a typed, redacted retained-input diagnostic instead of treating a conflict as a service-wide failure. Doctor retains reconciliation ownership and the existing stop/reconcile instructions; the warning explicitly identifies a possible older node host or external writer.
No configuration, schema, cache, or policy default changes. Related open #153405 adds an explicit reconciliation surface to the same migration owner; this fix does not add that surface or archive conflicting files.
Follow-up outside this repository: investigate
openclaw-windows-nodetray tests writing the real~/.openclaw/exec-approvals.jsonwithout HOME/state isolation.Evidence
Acceptance for the owner measurement: real
prepareLegacyExecApprovals, 316-byte synthetic conflicting legacy file and canonical deny policy in the existing synthetic team-scale fixture; five alternating fresh-process baseline/candidate pairs and baseline A/A controls. Separate first-call and 100-call warm wall time, process/thread CPU, and V8 allocation. Success means baseline refusal becomes a diagnostic, with exact canonical/source preservation. Timing compares owner work, not a speedup against a failed Gateway startup. macOS/APFS proof does not establish Linux/btrfs timings.211 distinct focused cases pass across Gateway startup, state migration/canonical repair, credential startup, Doctor policy/security/settlement, and runtime/cron authorization. The new real Gateway preflight regression fails on the original owner and passes with HTTP readiness, canonical deny policy, unchanged source bytes, and redacted diagnostics. Final Gateway test: 23.426s (71.52s wrapper with cold compilation); runtime conflict case: 1.189s. No inference/channel or packaged-upgrade claim is made. Three existing final-effect node tests also pass on head 58311e6: an allowed
/bin/lslaunches and produces output, while revocation after authorization commit or in the pre-spawn callback yieldsSYSTEM_RUN_DENIED, no output, and no completion event. These use canonical policy without retained legacy input; retained-input authority/preservation is covered separately by the Gateway and worker regressions. This is complementary boundary evidence, not a combined retained-input host-launch claim.pnpm check:changedcompleted. Core/scripts/test typechecks and other guards passed. Its own lint findings were fixed and both affected files passed focused lint afterward. Its remaining dead-export findings reproduce exactly on parent2609b4f93bf851274e94635bc19ebe10cb624236; attribution is below. Production/full-tree unused-file scans pass. Test-line ratchet and diff checks pass. No changed module is imported byui/src.Independent Codex autoreview of the complete implementation against that parent is scoped-clean through P2. A subsequent Codex review of the CI test repair is also scoped-clean through P2. No unresolved actionable review finding.
Initial exact-head CI run 42744343690 exposed three stale assertions in two sibling files: managed Doctor expected retained malformed/conflicting input to throw, and node startup expected a malformed approvals claim to veto admission. Those three failures reproduced locally. The test-only repair retains source bytes, canonical deny, missing-canonical execution refusal, and warning assertions; all 15 tests in those two files pass (197.34s Vitest, 241.81s wrapper). Production code is unchanged by this repair. The changed-file pass also caught an extra argument in the new test assertion; it was removed to match the existing zero-argument reader, then the node test and affected typecheck graphs were rerun.
The inherited macOS Doctor fixture failure also reproduces on the exact parent. #189246 (
0a02f57ab706) added restoration reservation → process namespace → native boot observation. A seven-line test-only fix supplies a synthetic boot identity while retaining the strict no-native-process assertion; all 5 readiness and 49 settlement/refusal cases pass.Production source is net +13 LOC: runtime consolidation removes 22 lines, while typed reporting and startup scheduling require the remaining growth. Tests/support add 133 lines with the focused allocation and existing ratchet headroom; the reproducible benchmark adds 217 tooling lines. No production compatibility path was added.
Synthetic fixture: 8 agents, 10,000 sessions, 35.09 GiB largest agent DB, 12.03 GiB shared DB, 62,000 workspace files/1.181 GB, 46 synthetic plugins. Five interleaved A/B pairs and five A/A pairs. All 505 baseline calls refused; all 505 candidate calls returned a diagnostic, preserving source/canonical state. The owner receives admitted canonical facts; unchanged DB snapshot preparation and unrelated agent/workspace reads are excluded.
The required cold diagnostic adds ~18.77ms wall, ~21.84ms CPU, and ~3.42MB allocation. Separate profiles attribute the extra work to warning recording/redaction. This is the cost of observable degraded startup instead of termination, not a speedup. Warm A/A medians: wall 0.481→0.448ms, CPU 0.660→0.618ms, allocation 309,182→405,308 bytes; no allocation improvement is claimed. Five samples make p95 the observed maximum, not a robust tail estimate. Host load 12.66–16.94, macOS/APFS/Node26.12.1; no btrfs qualification or Team data/access. Final lint-only explicit empty returns affect no measured conflict branch.
Reproduction:
scripts/perf/exec-approvals-startup-measure.tsheader commands, using the existingbench-gateway-startup.ts --case teamBoot --team-scale --seed-onlyfixture. The large task fixture has been removed.Inherited main dead-export failures (exact-parent reproduction)
Only the failed
scripts/check-deadcode-exports.mtscommand was replayed on the exact parent. All 28 ordered finding lines match byte-for-byte (21 production, 7 full-tree); no dependency-resolution errors. These are main regressions for follow-up, not ignored noise. No unrelated export cleanup is included.src/daemon/launchd.ts:isLaunchctlNotLoadedb4262689db5dbb4b88660119f67ae6fc4372cd97/ #130634launchd.jstolaunchd-exec.js; exact-ref grep finds only the unused facade export and direct leaf consumers. Production + full-tree.src/daemon/launchd.ts:parseLaunchAgentEnabled7713e8fb749e0dec479c088b672d99e26df59b55/ #103537src/daemon/launchd.ts:resolveLaunchAgentPlistPath5e591205828657a5a20f5aa81f75f35b6a414f91/ #151777service-audit-launchd.tsand importslaunchd-service-files.jsdirectly. Production-only.src/gateway/server-methods/config-write-flow.ts:replyWithBillingRouteWarnings56617cd00086481212d29745ed71f5feb8a40b9e/ #191326src/plugins/types.ts:ProviderAuthOptionBag,ProviderNonInteractiveApiKeyCredentialParams,ProviderNonInteractiveApiKeyResult,ProviderResolveNonInteractiveApiKeyParamscf1ae7bb6a729a7f13a28ca2ef9d6f108c00566f/ #190544provider-auth-types.ts; unused explicit facade reexports remain intypes.ts. Production + full-tree.src/plugins/provider-runtime.ts:augmentModelCatalogWithProviderPlugins,formatProviderAuthProfileApiKeyWithPlugin,loginProviderOAuthWithPlugin,refreshProviderOAuthCredentialWithPlugin,resolveProviderOAuthCredentialWithPlugin,resolveProviderOAuthRefreshCapabilityWithPluginf63e5cd0f6d38f1d0438978255d9e244183864c3/ #190205src/plugins/provider-runtime.ts:classifyProviderFailoverSignalWithPlugin,resolveExternalAuthProfilesWithPlugins964fa991c0aff81e2ae46a0c9f99ebc0ab349d1a/ #132716agents/failover/provider-patterns.tsswitches from runtime barrel toprovider-failover.ts;agents/auth-profiles/external-auth.tsswitches from runtime barrel toprovider-external-auth.ts. Both barrel reexports remain. Exact-ref grep confirms only direct leaf production consumers. Production-only.src/plugins/provider-runtime.ts:resolveProviderModernModelRef33d8f24c9926f8b291b71785c5b4dea4181a8128/ #129184agents/live-model-filter.tsintoagents/test-helpers/live-model-dynamic-candidates.ts; export becomes test-only. Production-only.src/plugins/provider-external-auth.ts:resolveExternalAuthProfilesWithPlugins071f606eae77a13f6c4c161da009dd2ba31a1c10/ #139911agents/auth-profiles/external-auth.tsswitches from facade import to injected native-loader binding; thin facade remains. Production-only.src/plugins/provider-runtime.ts:resolveProviderRuntimePlugina7436c8b4a93bff59d099661d2b206bb0627ac2b(no associated PR returned by GitHub commit-pulls API)agents/transcript-policy.tsmoves directly toprovider-hook-runtime.ts; barrel reexport remains. Production-only.src/shared/browser-pair.ts:BROWSER_PAIR_CODE_LENGTHd85ebfe8daad438c8141b9efada73d5c05e174a3/ #191513ui/src/pages/dashboards/dashboard-tools.tsx:authorDisplayNamecde34f111b4d893d0ce03d6c80094203690d5d22/ #194455view.tsx; exact-ref grep thereafter finds declaration and two same-module uses only. Its introduction in #194450 was valid and is not the regression. Production + full-tree.Review disposition: the two concrete old-head ClawSweeper findings are fixed in 58311e6. The review found no concrete execution bypass or data-model incompatibility. Final-effect authority checks are unchanged and their real-process regression passes; canonical conflict reads/writes are separately proven. No schema, policy format, credential format, or import algorithm changes, so a packaged latest-stable upgrade campaign is outside this startup-availability fix. Its absence remains explicit rather than being presented as completed proof.
Final validation: CI run 42747571732 completed successfully on
58311e643816648999c66fc0a8140cbc04a9e1ae: 51 successful jobs, zero failed or running. Merged through ordinary gated auto-merge asa0ec2b5b4ba6532237705777a470a1d154cd1ccc; no admin exception or CI rerun.