Skip to content

test(tlon): exercise sender roles through the real monitor - #134646

Merged
steipete merged 1 commit into
mainfrom
codex/test-tlon-real-sender-roles
Sep 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-tlon-real-sender-roles

Conversation

@steipete

@steipete steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Ten sender-role tests called two local copies of the monitor logic, so changing the actual role producer could leave them green. Replace those copies with twelve table rows in the existing real-monitor harness. Each row enters a subscription callback and checks the envelope label, both context role fields, completed dispatch, and absence of runtime errors.

All distinct normalization, null/empty owner, ordinary user, DM/group label, and owner-lookalike inputs remain. The hostile-text case now actually sends its claimed-owner text through the monitor. Preserve real channel-inbound exports with a partial mock so group mention handling uses its actual owner. Each new row aborts and joins its monitor in finally. Existing HTTP/SSE shutdown, reply-prefix, authorization and settings coverage remains unchanged.

Validation: 90 baseline cases and 92 candidate cases pass. Temporarily forcing the production monitor role to user leaves all ten original shadow cases passing but makes four new owner-output cases fail. Exact restoration passes all 92 cases. Full changed checks and Codex autoreview pass.

Production +0/-0; tests +133/-100. This improves sensitivity to real regressions and removes copied logic; no elapsed-time gain or live Urbit/model-authorization proof is claimed. It addresses the role-copy follow-up independently of the earlier channel-authorization cleanup.

@clawsweeper

clawsweeper Bot commented Sep 1, 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: M maintainer Maintainer-authored PR labels Sep 1, 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 Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 10:13 PM ET / September 1, 2026, 02:13 UTC.

ClawSweeper review

What this changes

The PR replaces Tlon sender-role tests that duplicated monitor logic with twelve table-driven cases that send DM and group events through the monitor subscription harness.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This active, maintainer-authored PR replaces shadow role tests with coverage that exercises the monitor’s subscribed event path; no introduced correctness or security defect was found.

Priority: P3
Reviewed head: 8475fa411f218f80b15536f78d1d0de139dd6fe0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-targeted test refactor that reaches the actual monitor role decision and removes duplicated shadow logic.
Proof confidence 🌊 off-meta tidepool Not applicable: This repository-member, test-only PR is exempt from the external-contributor real-behavior-proof gate; its supplied harness validation is supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This repository-member, test-only PR is exempt from the external-contributor real-behavior-proof gate; its supplied harness validation is supplemental evidence.
Evidence reviewed 5 items Production role owner: The monitor normalizes the configured owner and derives the sender role from the admitted sender before placing it in the envelope label, structured sender role, conversation label, and extra context.
Real monitor coverage: The introduced table invokes the subscribed chat or channels callback, then asserts the exact envelope label, both context role representations, dispatch, and absence of monitor errors.
SDK mock contract: The partial mock preserves the channel-inbound module’s actual exports while overriding only the two assertion seams; the SDK publicly exports the envelope builder used by the monitor.
Findings None None.
Security None None.

How this fits together

The Tlon monitor receives Urbit chat or group subscription events, derives the sender identity and role, creates an inbound envelope/context, and dispatches the turn to the agent runtime. This PR tests the role and label facts at that monitor boundary.

flowchart LR
  A[Urbit subscription event] --> B[Tlon monitor]
  B --> C[Normalize sender and decide role]
  C --> D[Build envelope and context]
  D --> E[Dispatch agent turn]
Loading

Before merge

  • Complete next step (P2) - No repair is needed; this is normal maintainer PR review pending the exact-head checks.
Agent review details

Security

None.

PR surface

Tests +33. Total +33 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 133 100 +33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 133 100 +33

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +133/-100 The net test-only change removes copied role logic and adds table-driven coverage at the monitor boundary.

Technical review

Best possible solution:

Land the focused real-monitor regression coverage once the exact-head required checks complete successfully.

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

Not applicable: this PR adds regression coverage rather than reporting a separate runtime failure; the supplied validation describes an intentional monitor-role mutation that the new cases detect.

Is this the best way to solve the issue?

Yes. Exercising subscribed events through the monitor is the narrowest maintainable replacement for copied helper tests because it covers the production role producer and its downstream context construction.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a focused test-harness improvement with no introduced 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 repository-member, test-only PR is exempt from the external-contributor real-behavior-proof gate; its supplied harness validation is supplemental evidence.

Label justifications:

  • P3: This is a focused test-harness improvement with no introduced 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 repository-member, test-only PR is exempt from the external-contributor real-behavior-proof gate; its supplied harness validation is supplemental evidence.

Evidence

What I checked:

  • Production role owner: The monitor normalizes the configured owner and derives the sender role from the admitted sender before placing it in the envelope label, structured sender role, conversation label, and extra context. (extensions/tlon/src/monitor/index.ts:504, ef6fe6638250)
  • Real monitor coverage: The introduced table invokes the subscribed chat or channels callback, then asserts the exact envelope label, both context role representations, dispatch, and absence of monitor errors. (extensions/tlon/src/monitor/index.test.ts:556, 8475fa411f21)
  • SDK mock contract: The partial mock preserves the channel-inbound module’s actual exports while overriding only the two assertion seams; the SDK publicly exports the envelope builder used by the monitor. (src/plugin-sdk/channel-inbound.ts:120, 8475fa411f21)
  • Current-main necessity: No Tlon path changed between the pinned PR base and fetched current main, and current main still lacks this real-monitor sender-role table; the PR is not already implemented on main. (extensions/tlon/src/monitor/index.test.ts:555, ef6fe6638250)
  • Recent area history: The immediately preceding Tlon monitor test change is a recent real channel-authorization resolver test by the same area contributor; older source-line origin is not claimed because the available blame boundary is grafted. (extensions/tlon/src/monitor/index.test.ts:556, 9ee4987810c3)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer source review and native preparation are complete for 8475fa4. The exact-head hosted checks are green. I read the latest ClawSweeper review in full: it found no actionable defect, and its remaining next step was normal maintainer review after exact-head checks. Both are now satisfied; no rank-up repair was requested. The selected suites pass 90 cases before and 92 after, with all distinct prior inputs retained at the actual monitor boundary. Forcing the production sender role to user leaves the ten removed shadow cases green but fails four new owner cases; exact restoration passes all 92. Production is unchanged; tests +133/-100. This verifies role/context production in the subscription harness, not live Urbit delivery or model authorization.

@steipete
steipete merged commit 77fee95 into main Sep 1, 2026
112 checks passed
@steipete
steipete deleted the codex/test-tlon-real-sender-roles branch September 1, 2026 02:20
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: M 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