Repository navigation
refactor: delete the unreachable redaction policy check - #113993
Conversation
The policy/data-handling-redaction-disabled check could never emit a finding: scanPolicyDataHandling records the sensitiveLoggingRedaction evidence with a hardcoded value true, and the finding builder only fired on value !== true. Redaction is unconditional in src/logging/redact.ts, which hardcodes tools mode and reads only redactPatterns, so no config can turn it off. Delete the check, its finding builder, check id, and the validateOnly fix class that existed solely for it. Keep the public dataHandling.sensitiveLogging.requireRedaction policy key: it is a policy.jsonc contract, it still drives openclaw policy compare baseline strictness, and its shape stays validated. Make the key's satisfied status explicit instead of silent: the policy rule declares satisfiedByInvariant pointing at the evidence source policy state records (oc://openclaw.invariant/logging/redaction), which openclaw policy check emits in dataHandling evidence and the attestation. A metadata test asserts every rule names either its checks or its invariant, never both and never neither, and that policy state actually emits the declared source. Also drop the stale logging.redactSensitive entry from the policy config coverage manifest; that config key is retired.
|
Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 10:54 PM ET / July 26, 2026, 02:54 UTC. ClawSweeper reviewWhat this changesThis PR removes the policy doctor check that could never report disabled logging redaction, while retaining the policy key and recording its satisfaction through an always-on runtime invariant. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep open for maintainer review: the branch replaces a named policy-doctor check with invariant-backed evidence, which needs an explicit compatibility decision. Likely related people: steipete (high confidence; recent merged policy cleanup in the same surface). Priority: P3 Review scores
Verification
How this fits togetherThe policy plugin reads operator policy rules, evaluates runtime and configuration posture, and emits doctor findings plus policy evidence for flowchart LR
A[Operator policy file] --> B[Policy rule metadata]
C[Logging redaction runtime] --> D[Policy evidence scan]
B --> E[Policy evaluation]
D --> E
E --> F[Doctor findings]
E --> G[Policy check output and attestation]
Decision needed
Why: The implementation establishes that the check cannot fire, but code inspection alone cannot decide whether external operators or automation rely on the named check ID as a compatibility contract. Before merge
Agent review detailsSecurityNone. PR surfaceSource -25, Tests +23, Docs +4, Other -9. Total -7 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm that retiring the documented check ID is acceptable while the policy field remains invariant-backed, then add redacted live policy-command evidence showing the rule’s evidence and attestation behavior after the change. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the supplied diff shows the old finding path only reported evidence whose value was not Is this the best way to solve the issue? Unclear: deleting an unreachable finding is leaner than preserving dead registration, but retiring a named policy check remains a maintainer compatibility decision rather than a purely mechanical cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 77b44473c71c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…penclaw#113993) The policy/data-handling-redaction-disabled check could never emit a finding: scanPolicyDataHandling records the sensitiveLoggingRedaction evidence with a hardcoded value true, and the finding builder only fired on value !== true. Redaction is unconditional in src/logging/redact.ts, which hardcodes tools mode and reads only redactPatterns, so no config can turn it off. Delete the check, its finding builder, check id, and the validateOnly fix class that existed solely for it. Keep the public dataHandling.sensitiveLogging.requireRedaction policy key: it is a policy.jsonc contract, it still drives openclaw policy compare baseline strictness, and its shape stays validated. Make the key's satisfied status explicit instead of silent: the policy rule declares satisfiedByInvariant pointing at the evidence source policy state records (oc://openclaw.invariant/logging/redaction), which openclaw policy check emits in dataHandling evidence and the attestation. A metadata test asserts every rule names either its checks or its invariant, never both and never neither, and that policy state actually emits the declared source. Also drop the stale logging.redactSensitive entry from the policy config coverage manifest; that config key is retired.
What Problem This Solves
policy/data-handling-redaction-disabledcannot fire.scanPolicyDataHandlingpushes thesensitiveLoggingRedactionevidence with a literalvalue: true, and the finding builderfilters on
entry.value !== true, so the check evaluates on every run and can never produce afinding. Redaction is unconditional:
resolveConfigRedaction()hardcodes the mode and readsonly
redactPatterns.This is the remainder of the cleanup started in #113961, which removed the check's automatic
repair and flagged the check itself as a follow-up.
Why This Change Was Made
A check that structurally cannot report is dead weight, and leaving it registered implies the
requirement is being actively evaluated when it is not.
Two things that looked removable turned out not to be, and shaped the result:
openclaw policy checkemits it, andpolicyWorkspaceHashcomputessha256(stableJson(evidence))for the attestation. Deletingit would change every operator's attestation hash, making
openclaw policy watchreportstale until they re-accept, while removing the only visible proof the requirement is met.
openclaw policy compare, so thekey still enforces baseline strictness between a baseline and a candidate policy.
So the public
dataHandling.sensitiveLogging.requireRedactionkey is deliberately kept. It isa
policy.jsonccontract still validated bydata-auth-shapes.ts; retiring it would rejectexisting operator policy files.
That leaves the risk that the key becomes silently accepted-but-unenforced. It is made
explicit instead: the rule now declares
satisfiedByInvariant: "oc://openclaw.invariant/logging/redaction"alongsidecheckIds: [], reusing the existingoc://openclaw.invariant/...convention already used for Control UI device-identity posture.User Impact
No behavior change. The check could not fire, so no finding disappears, no repair is lost, and
attestation hashes are unchanged.
Operators declaring the key keep everything that actually did something: shape validation,
policy comparebaseline strictness, and invariant evidence in bothpolicy checkoutput andthe attestation.
docs/cli/policy.mdnow states that explicitly rather than describing acheck id that no longer exists.
One detail preserved on purpose:
dataHandlingPolicyHasRuleskeeps itsrequireRedactionclause, because
evaluatePolicyonly collects data-handling evidence when the policy declaresdata-handling rules. Removing it would make an operator who declares only this key get silence.
Evidence
node scripts/run-vitest.mjs extensions/policy- 10 files, 364 tests passing.both and never neither, and that policy state actually emits the declared source. The guard
was confirmed to bite by temporarily pointing it at a bogus source and observing the failure.
This also gives
checkIdsits first real consumer; nothing else in the repo read that field.node scripts/run-tsgo.mjsgreen fortsconfig.extensions.json, the extensions testtsconfig, and
tsconfig.scripts.json.oxfmt --checkandoxlintclean on every touched file.gpt-5.6-sol, xhigh): clean, no accepted or actionable findings.Also removed a stale
scripts/lib/policy-config-coverage.jsoncentry mapping the retiredlogging.redactSensitiveconfig key to this rule; that key is listed insrc/config/dead-config-keys.test.ts.Pre-existing and untouched:
pnpm policy:config-coveragereportedok: falsebefore and afterthis change, from an unrelated stale
gateway.controlUi.allowInsecureAuthentry.LOC delta: +59 / -66, production code -32.