Repository navigation
feat(config): offload async health and audit persistence - #147256
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: blocked before merge. Reviewed September 13, 2026, 9:29 PM ET / September 14, 2026, 01:29 UTC (Revision 9). ClawSweeper reviewWhat this changesMoves asynchronous config health tracking and audit persistence onto the shared SQLite worker, preserves recovery outcomes, and updates lifecycle regression coverage. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful and has no remaining actionable correctness findings. The supplied final-candidate updater qualification addresses the previous review’s outstanding follow-up; current main still lacks this conversion. Priority: P2 Review scores
Verification
How this fits togetherConfig observation and Doctor recovery record health fingerprints and audit events used to diagnose and recover configuration files. The shared database worker now performs their asynchronous persistence while the existing config owner controls file recovery. flowchart TD
A[Config snapshots and Doctor] --> B[Observation and recovery owner]
B --> C[Current observation check]
C --> D[Shared SQLite worker]
D --> E[Conditional health updates]
D --> F[Bounded audit records]
C --> G[Guarded config file recovery]
G --> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource +568, Tests +1465, Docs +24, Other -2. Total +2055 across 36 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the shared worker for complete health and audit operations while retaining guarded recovery, existing persisted formats, and synchronous caller contracts. Do we have a high-confidence way to reproduce the issue? Not applicable to the internal conversion itself. The previous backup-retirement defect has a focused snapshot regression and a source-visible correction; this review did not execute tests. Is this the best way to solve the issue? Yes: the patch extends the existing shared worker and extracts connection-bound kernels while preserving the current schema, audit policy, and recovery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4846bf9e7d3e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
4998b48 to
f6267d3
Compare
|
Merged via squash.
|
…7256) * refactor(config): move health observations and audit writes to the shared worker * test(config): drain async owners before auth fixture cleanup * test(config): drain shared workers between write fixtures * test(gateway): await config settlement in lifecycle probes * test(gateway): settle startup config before channel reload * test(gateway): preserve registered probe reply shape * fix(config): preserve committed backup recovery after metadata retirement
Related: #144592
Async config observation, recovery health updates, and audit appends now run their SQLite work through the shared database worker. Health and audit writes acquire the common actor's retained native handle; final actor close releases it. Read-only Health operations remain noncreating. Audit fields, redaction, retention and existing synchronous APIs are unchanged. The audit-store edit extracts existing queries into a connection-bound kernel; table definitions and migrations are unchanged.
Bounded observation scopes stop superseded work before side effects. Health updates compare the persisted facts from their original read inside the write transaction and merge only changed fields, preserving sibling paths and newer synchronous observations. Prepared recovery replans through its existing owner. All three file-writing paths use the same post-commit metadata policy: ordinary metadata retirement cannot turn a committed file operation into failure, while ownership and maintenance refusals still propagate. Promotion preserves an existing 0750 parent and creates a 0600 last-good file; ordinary recovery retains its 0700 directory policy.
The review finding in
.bakrecovery is fixed at its actual post-commit call. The new snapshot regression failed on the previous production code after confirming the backup bytes were restored and canonical database closure completed. With the fix, it and the adjacent ordinary recovery case pass, including valid exact-byte reread, audit persistence, warning behavior and durable reopen. Fresh scoped P2 review, core/config-CLI types and typed lint passed. Earlier Health/Doctor/actor proof and fixture fixes remain covered; the final exact-head CI is green.The unchanged published
2026.9.4updater passed a fresh maintained Testbox qualification against exact candidate9f0a1453cea81f4d413f18e5b4fd0de57a607b82(run). Its 70,093,456-byte package has SHA-256cb1519c246a5ae035013d52b7600ab5b9d44e51d5a4af465ccb4fd11870199eb. Every one of the 9,499 installed dist files matched that package in six Health phases. All 47 phases passed, including actual worker read/patch/Doctor-audit calls, durable reopen, sibling-row preservation, retained task/flow equality after update and both Gateway starts, and three original backup rows plus two active backup files. The lease was stopped and verified completed.The local regression directly exercises the corrected
.bakpath. The unchanged live recipe explicitly exercises last-good recovery and final-artifact update/Health/Doctor continuity; it does not inject admission retirement. Gateway startup took 14 seconds. Readiness returned HTTP 200 withready: true, while reporting an 8,376 ms event-loop delay and an 8,717 ms sampling interval. This is persistence and upgrade proof, not whole-Gateway nonblocking performance evidence.