Skip to content

test(postgres): preserve admitted profile action semantics - #201297

Closed
vincentkoc wants to merge 1 commit into
mainfrom
test/profile-admission-conformance-20261118
Closed

vincentkoc wants to merge 1 commit into
mainfrom
test/profile-admission-conformance-20261118

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

PostgreSQL conformance still expects a retained personal-profile request to lose authority when a role changes. #201083 intentionally changed that contract: admission fixes the request's role/scope ceiling, while cancellation and profile identity remain live.

Five cases now fail on the existing main inputs in https://github.com/openclaw/openclaw/actions/runs/44328056076/job/134885857495. Its tested merge changes no profile-authority source or test.

User Impact

Test-only correction. No production, schema/version, DDL, migration, persisted format, configuration, or public API change.

Why This Change Was Made

Require the admitted action and its preference write to survive role commit, rollback, and an uncertain role commit. Keep every role-reader pending, revoked, restored, and uncertain assertion, plus the dropped-COMMIT reply and real PostgreSQL persistence check. Test names now distinguish admitted action lifetime from role-reader fencing.

The existing real-RPC sibling test verifies the other half of the contract: a new request is refused after role revocation. This conformance fixture has no named role policy, so it does not invent that assertion here.

Evidence

@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes conformance tests expect admitted personal-profile actions to survive role changes and uncertain role commits.

Example: An admitted action writes synthetic.authority=false after its profile role changes to member.

  • Before: The test expects refusal because the retained role authority changed.
  • After: The test expects the write to succeed while independent role readers remain revoked or uncertain.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-supported test correction with no identified defect; the draft and pending checks remain workflow conditions.
Proof confidence 🌊 off-meta tidepool Not applicable: Only existing conformance expectations change, so shipped-entry-point proof is unnecessary; hosted baseline failures are verified and reviewed-head PostgreSQL results remain pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: PostgreSQL conformance rejects the intended admitted-request behavior and reports false failures.
Reason: The maintainer-authored correction follows an already merged owner decision and retains meaningful settlement controls.

Merge readiness

✅ Ready for maintainer review

This PR correctly updates stale conformance expectations to match the merged admission contract while preserving role-reader and durability checks. No actionable defect found; it remains a draft with PostgreSQL CI running.

Priority: P3
Reviewed head: de5debf39d7f52378def6719cb325c6c483bec16

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway admission captures a personal action's role ceiling and profile identity; state workers perform preference writes while separate authority readers track transaction settlement.

flowchart TD
  A[Gateway request] --> B[Personal profile admission]
  B --> C[Retained action and identity]
  C --> D[Preference state worker]
  D --> E[SQLite or PostgreSQL]
  E --> F[Role authority publication]
  F --> G[Independent role readers]
Loading

Technical review

Best possible solution:

Keep this focused expectation correction and land it once the draft is ready and required checks pass.

Do we have a high-confidence way to reproduce the issue?

Source and five hosted failure annotations establish that the old tests require revocation behavior the current admission owner intentionally removed; no local execution was performed.

Is this the best way to solve the issue?

Updating the existing assertions is the smallest complete fix and preserves the separate transaction-settlement coverage without restoring obsolete production behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7eb33ccb25f7.

Provenance checked

  • Personal action assertions in transaction conformance changes intended behavior with a stated reason (3d4a0d1: Exercise physical-COMMIT authority fencing, confirmed rollback, and uncertain settlement through production actions and independent readers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 3d4a0d1 adds src/infra/database-engine/profile-authority.conformance.test.ts:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d4a0d1bc1f6; files: src/infra/database-engine/profile-authority.conformance.test.ts)
  • Ayaan Zaidi: Raw commit 461319f adds src/gateway/server-methods/personal-profile-authorization.ts:130 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 461319f60bdc; files: src/gateway/server-methods/personal-profile-authorization.ts)

PR surface

Tests -1. Total -1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 6 7 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 6 7 -1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This is a focused test correction with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a focused test correction with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 10:22 AM ET / 15:22 UTC.

@vincentkoc

Copy link
Copy Markdown
Member Author

Superseded by #201273, landed as 05d1e6f1f1f31e43702cbefcdb296c04fa20b8d3. I compared the complete landed test with this PR: all five failing expectations are equivalently corrected, and all role-reader/rollback/lost-COMMIT controls remain. Differences are test names and factoring the same successful preference write out of the two branches.

This candidate also passed all 50 CI jobs at de5debf39d7f52378def6719cb325c6c483bec16: https://github.com/openclaw/openclaw/actions/runs/44332641314. Closing the duplicate; the landed fix provides the required behavior without another change.

@vincentkoc vincentkoc closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant