Skip to content

test(tlon): exercise the real channel authorization resolver - #134393

Merged
steipete merged 1 commit into
mainfrom
codex/test-tlon-authorization-owner
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-tlon-authorization-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Four Tlon authorization tests repeat policy expressions inside the test instead of calling the resolver used by the monitor. They can stay green when the actual default changes.

Why this approach?

Call resolveChannelAuthorization directly for unconfigured channels, explicit empty allowlists, explicit open policy, and settings-over-file precedence. Assert both the resolved mode and ships so the tests exercise the real configuration owner.

User impact

Test-only improvement: production +0/-0; tests +50/-40. All 60 security cases remain; four copied demonstrations become direct owner checks. This changes no authorization policy and makes no elapsed-time claim.

Evidence

All 60 original security tests passed. After the rewrite, all 60 security tests and 22 monitor siblings pass. Full changed-file checks and Codex autoreview pass.

A temporary mutation changed only the real resolver's default from restricted to open. All four old authorization cases still passed; the rewritten default and explicit-empty cases failed, while explicit-open and precedence cases still passed. Both joined diagnostics restored the production file exactly. This proves test sensitivity to an injected regression, not an existing production security defect.

node scripts/run-vitest.mjs extensions/tlon/src/security.test.ts extensions/tlon/src/monitor/index.test.ts

Follow-up: replace the ten remaining copied sender-role demonstrations with direct monitor admission evidence. This PR proves configuration resolution; it does not claim new coverage of every runtime sender/approval path.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: tlon Channel integration: tlon size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added 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. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:59 PM ET / 18:59 UTC.

ClawSweeper review

What this changes

The PR replaces four copied Tlon channel-policy demonstrations with direct tests of the resolver used by the channel monitor.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

The test calls the actual Tlon configuration resolver, whose result the monitor consumes before restricting a sender; no introduced correctness or security defect was found. Keep this maintainer-authored, maintainer-labeled PR open for the normal merge decision.

Priority: P3
Reviewed head: 8b5c819631de11af5296b6be7946b8ef27902067

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-neutral test improvement that targets the real configuration owner with no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR changes only local test coverage and does not change user-visible runtime behavior; the external-contributor real-behavior gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR changes only local test coverage and does not change user-visible runtime behavior; the external-contributor real-behavior gate does not apply.
Evidence reviewed 5 items Introduced tests exercise the real owner: The PR imports the resolver and asserts its default, explicit-empty allowlist, explicit-open, and settings-over-file outcomes rather than duplicating its expressions.
Current-main owner and caller agree: Current main resolves settings rules before file rules, defaults mode to restricted, and returns the selected ships; the monitor uses that result before its restricted-mode rejection path.
Configuration contract supports the cases: The Tlon schema permits per-channel restricted/open rules and allowed ships, while the settings store carries the same optional rule shape and default authorized ships.
Findings None None.
Security None None.

How this fits together

Tlon file configuration and hot-reloaded settings feed a channel authorization resolver. The monitor consumes its resolved mode and allowed ships before it dispatches a channel message.

flowchart LR
  A[File configuration] --> C[Authorization resolver]
  B[Hot-reloaded settings] --> C
  C --> D[Resolved channel policy]
  D --> E[Tlon monitor]
  E --> F[Dispatch or deny sender]
Loading

Before merge

  • Complete next step (P2) - No repair is needed; complete the ordinary maintainer merge decision after exact-head checks finish.
Agent review details

Security

None.

PR surface

Tests +10. Total +10 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 50 40 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 50 40 +10

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +50/-40 (net +10) All introduced lines are test coverage; the production authorization path is unchanged.

Technical review

Best possible solution:

Retain the direct resolver coverage and merge it once the normal exact-head maintainer and CI gates are satisfied.

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

Not applicable: this PR improves test sensitivity and does not report a current production failure.

Is this the best way to solve the issue?

Yes. Testing the resolver directly is the narrowest maintainable way to protect its policy defaults and precedence, while the monitor remains the separate consumer boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 72dab3e75198.

Labels

Label changes:

  • add P3: This is a small test-maintenance improvement 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. Not applicable: This member-authored PR changes only local test coverage and does not change user-visible runtime behavior; the external-contributor real-behavior gate does not apply.

Label justifications:

  • P3: This is a small test-maintenance improvement 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. Not applicable: This member-authored PR changes only local test coverage and does not change user-visible runtime behavior; the external-contributor real-behavior gate does not apply.

Evidence

What I checked:

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

I read the full latest ClawSweeper review (18:59 UTC): no findings or Rank-up moves remain. Exact-head CI has finished successfully, so its ordinary landing condition is satisfied. Maintainer review is complete.

All 60 security and 22 monitor tests pass, along with full changed checks and Codex autoreview. The restricted-to-open mutation left all four old demonstrations passing but caused exactly the two expected new resolver failures; both diagnostics joined their processes and restored the production source exactly. Production +0/-0; tests +50/-40. The remaining copied sender-role coverage is explicitly recorded as a follow-up. Proceeding through native landing gates.

@steipete
steipete merged commit 9ee4987 into main Aug 31, 2026
112 checks passed
@steipete
steipete deleted the codex/test-tlon-authorization-owner branch August 31, 2026 19:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: tlon Channel integration: tlon maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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