Repository navigation
test(doctor): scope maintenance authority fence to profiles - #170601
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb2a4051a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (source === "profile") { | ||
| // The live owner grants storage access only inside its retained closure. | ||
| expect(assertCurrent).toThrow("undergoing offline maintenance"); | ||
| } |
There was a problem hiding this comment.
Assert configured-owner authority outside the maintenance scope
When source === "configured-owner", this conditional now performs no check. If requester.isCurrent() regresses to touching SQLite and again throws outside the retained maintenance closure, the test still passes: its next non-revoked check occurs inside maintenance.run, where database access is allowed, and its later outside-scope check occurs only after the owner is intentionally revoked. Add a positive assertion for the configured-owner branch so the newly intended config-only behavior is actually protected.
AGENTS.md reference: AGENTS.md:L88-L89
Useful? React with 👍 / 👎.
…#170601) ## What Problem This Solves The Doctor maintenance requester-authority test still expected configured-owner authority to be rejected while the shared-state database was reserved for offline maintenance. The configured-owner case fails at that expectation after `c179f7016652c2475cf270bc2e75c79069bd01a5` (openclaw#170230) deliberately removed deferred-plugin migration reads from normal config loading. Configured owners now validate against current disk config without opening SQLite; profile owners still read database-backed authority and must stay within the maintenance owner’s retained closure. Limit the existing offline-maintenance rejection assertion to the profile case. Both complete cases remain, including configured-owner config publication and backup checks, profile identity replacement checks, cleanup, and revoked-write rejection with unchanged config bytes. This changes one test assertion’s scope and no production authorization or update behavior. ## Evidence The cached full-file baseline on main `829c79f933355d4fd66b68cecec6388f3cb7bcc6` failed only the configured-owner assertion at line 138: one failed, one passed, 359.03s Vitest duration, teardown completed. The same assertion failed in run 38339691726, job 115108412972. The culprit’s parent-relative diff removes `readDeferredPluginMigrations({ env: params.env })` from `readCurrentConfigForPolicyCheck`; the requester owner already selects config-only authorization for `configured-owner`. Validation completed: targeted donor formatting and lint, `git diff --check`, and the normal commit hook. Canonical Codex review completed in one round with `scoped-clean`, no findings, exit 0, and a validated report. Exact candidate `cb2a4051a2b49d43c3e7b94670a8131dc1a2020e` passed the complete file with `pnpm test src/commands/doctor-maintenance.requester-authority.test.ts --maxWorkers=1`: both cases passed, zero skips, 56.37s Vitest duration in [focused CI 38343570880](https://github.com/openclaw/openclaw/actions/runs/38343570880). [Ordinary CI 38343428360](https://github.com/openclaw/openclaw/actions/runs/38343428360) finished successfully with 18 passed and 29 skipped jobs. Its synthetic merge `3e5e41e9` on base `bb3c3eab00fd7` passed selected type-aware lint, test types, source contracts, and boundaries. Madge reports zero cycles; T1 live remains 455, compatibility 9, and dialect ratchets zero. Production types, Knip, build, and published-driver update were not selected for this test-only plan; no fresh passes are claimed for those checks. No local runtime tests, builds, or installs were run. No filters, skips, test timeout changes, or Knip job were added. Scope: one test file, +4/-2 lines; zero production LOC, new tests, or new processes. No production checks were removed. T1 calls and SQL statements/requests are unchanged by this test-only correction; no new SQL measurement is claimed. Published-driver cell not rerun for this test-only assertion correction; production update/Doctor code is unchanged by this patch. Direct-main writes are refused by the repository ruleset; this repair uses the authorized PR squash fallback.
What Problem This Solves
The Doctor maintenance requester-authority test still expected configured-owner authority to be rejected while the shared-state database was reserved for offline maintenance. The configured-owner case fails at that expectation after
20bd4bdcfac46628ee72abc1fcefa3f9406aaccd(#170230) deliberately removed deferred-plugin migration reads from normal config loading. Configured owners now validate against current disk config without opening SQLite; profile owners still read database-backed authority and must stay within the maintenance owner’s retained closure.Limit the existing offline-maintenance rejection assertion to the profile case. Both complete cases remain, including configured-owner config publication and backup checks, profile identity replacement checks, cleanup, and revoked-write rejection with unchanged config bytes. This changes one test assertion’s scope and no production authorization or update behavior.
Evidence
The cached full-file baseline on main
76edfee2d2202e1da8ea4274a05cb98ae1e723bffailed only the configured-owner assertion at line 138: one failed, one passed, 359.03s Vitest duration, teardown completed. The same assertion failed in run 38339691726, job 115108412972. The culprit’s parent-relative diff removesreadDeferredPluginMigrations({ env: params.env })fromreadCurrentConfigForPolicyCheck; the requester owner already selects config-only authorization forconfigured-owner.Validation completed: targeted donor formatting and lint,
git diff --check, and the normal commit hook. Canonical Codex review completed in one round withscoped-clean, no findings, exit 0, and a validated report. Exact candidatecb2a4051a2b49d43c3e7b94670a8131dc1a2020epassed the complete file withpnpm test src/commands/doctor-maintenance.requester-authority.test.ts --maxWorkers=1: both cases passed, zero skips, 56.37s Vitest duration in focused CI 38343570880. Ordinary CI 38343428360 finished successfully with 18 passed and 29 skipped jobs. Its synthetic merge3e5e41e9on base799b7a347c502passed selected type-aware lint, test types, source contracts, and boundaries. Madge reports zero cycles; T1 live remains 455, compatibility 9, and dialect ratchets zero. Production types, Knip, build, and published-driver update were not selected for this test-only plan; no fresh passes are claimed for those checks. No local runtime tests, builds, or installs were run. No filters, skips, test timeout changes, or Knip job were added.Scope: one test file, +4/-2 lines; zero production LOC, new tests, or new processes. No production checks were removed. T1 calls and SQL statements/requests are unchanged by this test-only correction; no new SQL measurement is claimed. Published-driver cell not rerun for this test-only assertion correction; production update/Doctor code is unchanged by this patch.
Direct-main writes are refused by the repository ruleset; this repair uses the authorized PR squash fallback.