policy: repair automatic narrowing findings#99690
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (21 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review I restacked the policy series onto current Fresh proof from the top of the stack (
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review of the Automatic Narrowing PR. Findings:
Best-fix verdict: too broad for merge as automatic repair. The repair layer should prove the write target is the exact scoped config surface, or downgrade the unsafe cases to skipped/review-required with surfaced guidance. Evidence checked: |
|
Addressed Omar's automatic narrowing findings in |
|
@clawsweeper re-review Reviewer-requested fixes are pushed on this updated head. Fresh local proof before push: focused policy/core/CLI/tooling Vitest passed, |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated this PR body with current stack heads and final-stack proof after the #99686 proof refresh. The foundation proof now shows policy-owned policy.fixRecommendation in public policy JSON and recommendation-free attestation hashing, and this PR includes that fix via the forward-merged stack. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
809e943 to
a5b42a5
Compare
|
Restacked #99690 cleanly onto current main and dropped the stale merged policy stack history. New head: Final diff is scoped back to the six policy/docs files:
Validation on the clean restack:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
Summary
doctor --fixrepairs for the first safe policy narrowing checks.plugins.entries.policy.config.workspaceRepairs=truebefore policy config repairs mutate workspace config.diagnostics.otel.captureContentpreferences by setting onlycaptureContent.enabled=false.Validation
node scripts/run-vitest.mjs extensions/policy/src/doctor/register.test.ts extensions/policy/src/doctor/metadata.test.ts src/flows/doctor-repair-flow.test.ts --reporter=dotpassed: 2 Vitest shards / 299 tests.node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfopassed.OPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/policy/src/doctor/automatic-repairs.ts extensions/policy/src/doctor/register.test.ts extensions/policy/src/doctor/metadata.test.tspassed.git diff --checkpassed.Real behavior proof
Behavior or issue addressed:
doctor --fixshould repair automatic policy telemetry content-capture findings without discarding granular object-form telemetry preferences.Real environment tested:
Windows PowerShell, source checkout
C:\src\openclaw-fork, PR head525e492752. The full dev CLI was invoked with an isolatedOPENCLAW_CONFIG_PATH; local full doctor execution reached the policy repair and printed the expected repair, then stalled in a later unrelated post-security doctor stage before the final config writer. The persisted-config proof therefore uses the same registered policy health check,runDoctorHealthRepairs, andreplaceConfigFilewriter in-process.Exact steps or command run after this patch:
diagnostics.otel.captureContent={ enabled:true, toolInputs:true, toolOutputs:true }and policydataHandling.telemetry.denyContentCapture=true.node --import tsx src/entry.ts doctor --fix --yes --non-interactive --no-workspace-suggestionswith isolatedOPENCLAW_CONFIG_PATH,OPENCLAW_STATE_DIR, andOPENCLAW_HOME.policy/data-handling-telemetry-content-capture, calledrunDoctorHealthRepairs, persisted withreplaceConfigFile, and reread the config file.Evidence after fix:
CLI transcript included
Set diagnostics.otel.captureContent.enabled=false for policy conformance.The persisted proof printed:Observed result after fix:
The telemetry policy finding is repaired, no telemetry finding remains, and object-form
captureContentsubkeys are preserved while the masterenabledswitch is disabled.What was not tested:
The packaged binary path and live LLM/provider calls were not tested. The full dev CLI did not reach final config persistence locally because it stalled after the Security doctor section in an unrelated later doctor probe.
Stack
Stacked on merged #99686. Downstream stack should be refreshed after this head: #99700, #99720, #99731, #99776.
Notes
Normal local build/prep wrappers hit the known Windows Rolldown boundary error (
TypeError: Cannot convert undefined or null to object), so lint was run with the repo-supportedOPENCLAW_OXLINT_SKIP_PREPARE=1path after the focused source checks passed.