Skip to content

test(doctor): scope maintenance authority fence to profiles - #170601

Merged
steipete merged 1 commit into
mainfrom
dbasync/redmain-maintenance-authority
Oct 13, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/redmain-maintenance-authority

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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 76edfee2d2202e1da8ea4274a05cb98ae1e723bf 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. Ordinary CI 38343428360 finished successfully with 18 passed and 29 skipped jobs. Its synthetic merge 3e5e41e9 on base 799b7a347c502 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.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T03:52:26.402599Z cb2a405 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +137 to +140
if (source === "profile") {
// The live owner grants storage access only inside its retained closure.
expect(assertCurrent).toThrow("undergoing offline maintenance");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit fad84f1 into main Oct 13, 2026
108 of 110 checks passed
@steipete
steipete deleted the dbasync/redmain-maintenance-authority branch October 13, 2026 03:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant