Repository navigation
fix(config): coordinate Grok and link writers - #6869
Conversation
Hold the canonical config lock through Grok injection and cleanup, validate publication destinations, and preserve refresh-only admission. Coordinate link store mutations and revalidate recorded links before activating a bound listener. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Grok config writes and remote-link store updates now coordinate through the shared config locks. Lock contention and unsafe states return explicit refusals, and listener binding rechecks the recorded links and port before it activates. No outstanding defects were identified, so the change appears ready to merge. Pre-merge checks |
|
|
✅ Deterministic PR hygiene checks passed. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
Coordinator security sign-off for squash merge at head An independent bounded review traced lock ordering, reentrancy and deadlock risk, rollback, and cross-process contention, and found no defects. Grok inject/strip take only the canonical file lock with synchronous callbacks. Link operations take only the SQLite mutation lock ( |
Summary
Grok injection and cleanup now hold the existing canonical config-write lock across read, transform, backup, and publication. A config alias retarget after the read previously allowed a write to the replacement target. Publication now validates the held destination before every rename, including retry hooks; a refresh-only destination change before rename returns the existing skip result while preserving files. Refresh-only admission and no-follow checks remain in place. Unsafe namespaces refuse without writes and remain distinct from retryable contention.
Link create/delete, compensation, and listener-port persistence now use the shared config mutation transaction. The listener rechecks the recorded links and port before activation: deleting the last link during bind closes the unneeded listener without publishing its port.
This is an independent backend change. Codex and agent-settings coordination already merged in #6811 is unchanged. Coupon state/route changes are submitted separately. The commits carry the original contributor credit.
Verification
At current head
9e9a4a552c4bcf1acd4a4e5514c160b44368f2aa(treed5c1258bcffa5caa92e006d63bd17395888e9db1), the affected Grok and unattended-refresh coverage passed:Result: 128 pass / 0 fail, including destination drift after temp write. Typecheck, structure, and privacy checks passed on the same tree. The initial hosted CI exposed one return-contract regression in that existing symlink test; the follow-up commit preserves the no-write result and restores refresh-only skip semantics.
Supporting validation at initial head
f8c00b579de8d6a508bfd8ca708eb700b7daa2cc(treeba24d78bac10cfa92a2f5bb6f793dab78e9569d0):Result: 124 pass / 0 fail. Alias retargets, held/unsafe locks, new and known-port bind deletion, cross-process DELETE contention, compensation, and refresh-only fanout are covered with synthetic fixtures and mocked transport.
bun run typecheck,bun run structure:check,bun run privacy:scan: pass.bun scripts/test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts: 28 pass / 0 fail.d25391ddccb0d9d03128ea5f9bc734e904c84e24. Current deva47a1b52a94ef3d65d8435944bd4e6bf34a2e622is two test-runner/CLI commits ahead; runtime and docs are identical, and the static merge is clean. The installed identity policy/hook is unchanged, and all candidate commits after the pinned base pass it.49bab6a0648592bc1bf5ff51bf3f708744f47cd8against dev. All four Linux shards, GUI gate (3,023 tests), type/privacy/structure gates, Docker, storage/API gates, and Ubuntu/Windows keyring and npm-global smokes passed. The original refresh-only symlink assertion also passed in hosted shard 3. Windows nine-shard and macOS jobs were skipped by path selection. The initial head failed the return-contract assertion and was superseded; it is not reported as passing. Author security review is complete for this exact head: the canonical lock is held through backup/publication, destination validation is passed to every rename attempt, refresh-only no-follow/admission checks remain, Link compensation preserves failure evidence, and no management-auth, key scope, remote-bind or secret-logging change is introduced. Existing exact-head CI and synthetic compensation/admission regressions passed. Ready for maintainer review; maintainer merge approval remains separate.Checklist
Summary by CodeRabbit