Repository navigation
fix(cli): reject blank audit bounds - #137335
Patrick-Erichsen merged 1 commit into
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 10, 2026, 8:22 PM ET / September 11, 2026, 00:22 UTC (Revision 4). ClawSweeper reviewWhat this changesReject explicitly blank audit timestamps and limits before querying the Gateway, while preserving omitted defaults and valid values. Merge readiness⛔ Blocked before merge - 1 item remains The fix remains necessary on current main. No blocking defects were found, the supplied CLI proof covers the changed boundary, and a write-access reviewer has explicitly accepted the compatibility change. Priority: P2 Review scores
Verification
How this fits togetherThe audit CLI turns operator filters into bounded requests for activity records or execution explanations. Its parsers validate arguments before the Gateway request and subsequent terminal or JSON output. flowchart TD
A[Operator audit arguments] --> B[CLI argument validation]
B --> C{Bounds valid or omitted?}
C -->|Blank or invalid| D[Local validation error]
C -->|Valid or omitted| E[Bounded Gateway request]
E --> F[Activity or execution records]
F --> G[Terminal or JSON output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +14. Total +14 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the net-neutral correction in the existing parsers, preserving documented defaults and valid-input behavior under the accepted compatibility scope. Do we have a high-confidence way to reproduce the issue? Yes. Current-main guards demonstrably treat explicit blanks as omission, and the supplied baseline CLI trace corroborates that path; this review did not execute target code. Is this the best way to solve the issue? Yes. Correcting omission detection at the audit command owner reuses strict validation for all affected contexts; a new parser, Gateway change, or compatibility option would add unnecessary complexity. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8e2dbc7ca42. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Preparing this PR for maintainer landing at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
The audit parser correction is ready to land. Reviewed head 0cffbf8ea24063f4665493d0a2fee10cc8c8ae6f: explicit blank timestamps and list/explain limits now fail before RPC; omitted and valid inputs preserve the existing behavior. Current main still has the three falsy guards. Reused the exact-head source-CLI RED/GREEN trace and 21 focused passes in the body, plus green CI and fresh independent source review. This is a trivial three-guard repair; no new runtime execution or authenticated audit query is claimed. The intended blank-input tightening is accepted. Fresh CI/review timestamps are being obtained for the native landing gate.
|
Merged via squash.
|
What Problem This Solves
Fixes audit CLI bounds that silently accepted explicit blank values.
openclaw audit --after ""removed the time boundary and queried a broader result set; an empty--limitsilently selected the default page size. The same issue affected--beforeand the--explaindecision limit.Why This Change Was Made
The audit parsers now distinguish omission (
undefined) from present-but-invalid input. Blank timestamps reach the existing timestamp error, and blank limits reach the existing strict positive-integer bounds. This keeps validation at the canonical audit command owner with no new parser or policy branch.User Impact
Operators and scripts now get an explicit error when a shell-expanded audit bound is empty, instead of unknowingly querying a wider time range or larger page. Omitted values and valid timestamps/limits keep their existing behavior.
Evidence
Exact-head proof receipt
0cffbf8ea24063f4665493d0a2fee10cc8c8ae6fa4ad6c76a4d19ec47394f0a1905c749252d308c1openclaw audit --after "" --jsonparseAuditTimestamp,parseAuditLimit, andparseAuditDecisionLimitinsrc/commands/audit.ts--after/--before/--limitand explain-mode--limit, all beforeaudit.activity.listoraudit.run.inspect.--aftercommand on current main reachedgateway audit.activity.list requires credentials, proving the empty timestamp was silently omitted.--after must be an ISO timestamp or Unix millisecondsbefore any Gateway call. Tests cover empty/whitespace timestamps plus list and explain limits.--after 1234 --limit 1reachesaudit.activity.listGateway authorization, proving valid bounds still proceed.Inspectable RED -> GREEN terminal trace
<EMPTY>denotes the actual empty argv token. Nodev24.15.0; verified2026-09-03T13:52:34Z(RED) and2026-09-03T13:47:26Z(GREEN).The RED reaches Gateway authorization. At the product head:
Valid-value control:
Verification
node scripts/run-vitest.mjs run src/commands/audit.test.ts -t 'rejects invalid|explicit empty|keeps decision and run discovery queries bounded|converts ISO'— 21 passed, 19 skipped.src/commands/audit.test.ts— 40 tests passed; the final rebase did not touch either changed file.oxfmt --checkon both changed files — passed at exact head.git diff --check upstream/main...HEAD— passed.patch is correctwith confidence0.99.Scope and risk
+3/-3(net 0).+14/-0(net +14).parseStrictPositiveInteger; no new library, plugin, workflow, or parsing system.