Repository navigation
refactor(config): share audit positional scanning - #148643
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: needs maintainer review before merge. Reviewed September 14, 2026, 8:28 PM ET / September 15, 2026, 00:28 UTC. ClawSweeper reviewWhat this changesThe PR shares command-line argument scanning within configuration audit redaction and adds four cases covering existing masking behavior. Merge readiness✅ Ready for maintainer review Keep open: this is a useful, behavior-preserving cleanup that remains absent from current main. No actionable introduced defect was found, and the maintainer-authored PR is protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherConfiguration auditing records diagnostic information about configuration reads and writes. Its argument redactor masks credentials before records reach SQLite and also sanitizes historical audit logs through Doctor. flowchart TD
A[Configuration reads and writes] --> B[Bounded process arguments]
C[Historical audit logs] --> D[Secret argument redaction]
B --> D
D --> E[Shared command and positional scanner]
E --> F[Batch and sensitive value masking]
F --> G[Sanitized audit records]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -14, Tests +60. Total +46 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one private positional scanner while preserving existing redaction order, argument bounds, and audit persistence contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR proposes behavior-preserving consolidation, not a bug fix; source comparison supports equivalence, and no tests were executed during this read-only review. Is this the best way to solve the issue? Yes: parameterizing the existing scanner removes duplicated logic without creating a parallel redaction policy or changing public contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6001ca4b418c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '0945dabbe487213e95e84a72ad1aae3659e0e000': (115 commits) fix: omit automation service aliases from squash coauthors (#148883) test: restore services typecheck shard headroom (#148885) perf(trajectory): avoid native probes for truncation records (#148870) improve(gateway): load cron only when reload requests it (#143500) fix: resolve issue #146088 — [Bug]: The most recent Linux AppImage does not ship with the correct versions of libs needed to run (#148174) refactor(theme): share nonvirtual ANSI color lookup (#148717) perf(gateway): scope exact session row topology reads (#148836) improve(memory): reduce vector replacement overhead (#148201) fix(i18n): keep HTTP headers out of native translations (#147119) refactor(plugins): share source-root display formatting (#148646) fix(cron): reject blank script paths before mutations (#148787) refactor(config): share audit positional scanning (#148643) fix(test): restore infrastructure typecheck shard headroom (#148861) fix(release): harden package validation fallbacks (#148729) refactor(config): share leaf and descendant unset pruning (#148216) test: reuse prepared runtime for pristine preflight (#148858) fix(ui): settle global model drafts across agent switches (#148843) fix(queue): avoid repeated scans when cancelling backlogs (#148754) fix(logging): orphaned \\\\?\\ path markers corrupt redacted Windows diagnostics (#147542) refactor(hooks): share optional reply metadata projection (#148641) ...
What Problem This Solves
This maintainer-requested refactor is part of the approved duplication and complexity reduction deliverable. Config-audit redaction repeats option and positional scanning for the
config setcommand and its path/value arguments. One bounded scanner now owns that logic.User Impact
Redaction behavior is unchanged. Command discovery accepts only the first meaningful positional when it is
set; value discovery collects the first two positionals and preserves their original indexes. Each scan starts with independent option-terminator state. Known value options, inline options, unknown dash options and dash-leading values keep their existing treatment.Why This Change Was Made
The shared scanner takes a start index and positional limit. Its caller still recognizes the command. Generic secret redaction runs first, batch-JSON masking covers the full tail, and sensitive positional masking runs last. The eight-argument cap for fresh records and uncapped historical scrub behavior are unchanged.
The scanner change leaves the asynchronous SQLite audit writer and separate synchronous API intact. Current-main source review also preserves its later authority callback and shared main-thread SQL spy helper; the merge must retain those newer changes along with the four authored cases.
Production: -14 lines. Tests: +60 lines. No config shape, schema, sensitive-path policy, storage or CLI parsing change. This mechanical refactor needs no changelog entry.
Evidence
fece6d724cc9a8f0b4d923ac975653ddc1392704.14da66fa0abd289b9c4fca3dedd45b0c696104ba. Its reviewed owner and test bytes were bound separately from current-main source admission.setcommand whose later positional isset. Existing cap, off-thread persistence, canonical async-close and historical-scrub coverage remains.0d081a0ee88ae9ee8c0049974ecf48a196bf5216reported no actionable finding. Broader executor and independent source reviews covered the complete audit owner, callers, redaction and sensitive-path callees, SQLite ownership, lifecycle, current-main changes and relevant history.This is fixture and source evidence for the audit boundary. No live operator CLI session or production historical-scrub execution is claimed.