Skip to content

refactor(slack): exercise runtime owners in consolidated tests - #156344

Draft
vincentkoc wants to merge 13 commits into
mainfrom
test/slack-suite-cleanup-20260923
Draft

vincentkoc wants to merge 13 commits into
mainfrom
test/slack-suite-cleanup-20260923

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Related: #139428

What Problem This Solves

Slack tests duplicate fixtures and sometimes reproduce policy in mocks, leaving real routing, recording, interaction, download, and cleanup contracts insufficiently exercised.

User Impact

This is primarily test maintenance. QA Slack approval artifacts now distinguish native execution approvals from plugin approvals correctly, including Codex command and file approvals. Slack's normal question-resolution path is unchanged; its unused private test resolver injection is removed. No configuration change or migration is required.

Why This Change Was Made

Use independent literal expectations and exercise the existing runtime owners. Preserve routing inputs, asynchronous recording, state transitions, delivery ordering, and cleanup assertions while extracting stateless fixtures. Integrate the frozen October 16 baseline into the original signed branch and preserve both candidate assertions and current owner behavior.

The QA artifact fix uses the native-execution scenario identity. Suffix matching incorrectly classified Codex command approval, whose actual producer uses the plugin approval owner. All four admitted scenarios now agree with their producers and artifact consumer.

The latest correction types the exported missing-channel-info mock with the actual Slack method contract, fixing TS2883 during package compilation. It also makes the media timeout constant private after its last external use became an independent literal 60_000 assertion. Runtime behavior and assertions are preserved.

Evidence

Draft; final ready, approval, auto-merge and merge decisions remain with the maintainer.

  • Candidate: 39df3ce2284fdd6f490bf5eb263860218955d144, tree 0b99eed1c0dc139463bc6df2ba4791dfb3daa15d. Frozen product baseline: fd2d5d0ae8ca4fa7eb8f4ce4fddb03508713160e. The original seven signed commits, signed baseline merge and prior corrections remain in history.
  • Current correction: three complete suites / 136 cases passed (prepare.test.ts, media.test.ts, prepare-thread-context.test.ts), native Slack package compilation, two-file typed lint, formatting, whitespace and changed-source line-cap checks passed. Node 26.7.0, one worker. The compile-only boundary run did not rerun the negative canary.
  • Current full-tree native export scan no longer reports Slack. It remains failed for inherited packages/ai/src/transports/transport-utils.ts: redactSensitiveText; no scanner exemption or artificial consumer was added.
  • Earlier source-bound proof: 0693c070 passed 14 files / 523 cases, four type graphs and 44-file lint; 02ea3611 passed two affected suites / 163 cases, the affected test-type graph and four-file lint. Counts overlap and are not added together. Earlier mutation and 2bbc2803 proof remain historical.
  • Aggregate source review and the fixture extraction review found no actionable defects. The current two-file correction received a fresh exact-commit review with no findings. Static review is separate from executable proof.
  • Current native selection plans 933 targets / 72 shards, with all 35 required keeper files selected exactly once, for 52 physical changed paths. Selection is planning, not a hosted result.
  • Previous exact-head CI, attempt 1 completed failure on 02ea3611: 68 successful jobs, four failed jobs including the aggregate gate, and 23 skipped. Its Slack declaration and unused-export failures are repaired locally. Other failures are inherited: applyProviderAuthConfigPatch wrapper shadowing and AI/UI unused exports (redactSensitiveText, I18nController). Relevant source and checker/config bytes match the frozen baseline; these remain named provider-auth and AI/UI follow-ups.
  • Current exact-head CI, attempt 1 targets 39df3ce and was in progress at 2026-10-16T16:41:04Z (preflight running). Exactly one default-backend native dispatch was made after verifying the fresh merge ref's second parent. This manual run is separate from the required PR gate; hosted qualification is pending.
  • The earlier local global max-lines suppression guard also failed for unchanged UI chat/config/sessions files. That result remains recorded separately; the previous hosted checks-fast-baseline-ratchets job passed. No equivalence between those check surfaces is assumed.
  • Live Slack/Desktop/Codex, Bun, 28 conditional YAML scenarios, the full core-abort-to-Slack-preview bridge, and independent completion timing of the post-final task-identity row remain unproved.
Scope and dependency contract

Against the frozen baseline: 52 paths. Production +4/-4 (net 0) across three files; tests +2,240/-1,526 (net +714); support +669/-89 (net +580); CI/config +5/-2; guides +8/-0; trace fixtures +10/-10. The increase preserves assertions across baseline changes and extracts fixtures. Historical deletion totals are not counted again.

Installed Vitest 5.0.3 and Slack Bolt 5.1.0/Web API 8.2.0 types were inspected directly for the mock annotation. The timeout constant has no public API export or remaining external consumer.

The personally inspected Codex contract remains pinned to 414782450952a196bbb64b1605a458c2531c47b6: codex-rs/app-server-protocol/src/protocol/v2/item.rs:45-103,255-283,922-941,1127-1133,1201-1207,1324-1423 and codex-rs/app-server-protocol/src/protocol/common.rs:1445-1458,1622-1639. OpenClaw owns the approval-kind classification; the upstream protocol is unchanged.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: XL labels Sep 23, 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 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 2:49 AM ET / 06:49 UTC (Revision 3).

ClawSweeper review

What this changes

Consolidates Slack test fixtures, replaces simulated policy checks with owner-level coverage, and strengthens preview cleanup, abort, and media-download assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner-level test cleanup with no concrete source finding, but the final head’s execution evidence is incomplete.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This MEMBER-authored test-only PR is outside the external-contributor runtime-proof gate. It changes coverage around Slack adapters and shared owners, with reported intermediate in-process results and explicitly pending final-head execution; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Partial
Reason: The linked maintainer-requested audit establishes an operational need for this cleanup. Removing copied policy while retaining independent contracts is useful, but this batch does not complete the campaign’s aggregate targets.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this maintainer-authored PR contributes distinct work to the requested test audit. No concrete introduced defect was found, but final-head validation remains incomplete.

Priority: P3
Reviewed head: 9a64c0b0cbac045540f684b8700991b52dc55456

Before merge

  • Resolve merge risk (P1) - The final head has not demonstrated retained coverage and working new controls through the documented suites, test-type graphs, golden replay, targeted faults, and native preparation; materially changed test costs are also unrecorded.
  • Resolve merge risk (P1) - The branch conflicts with its target, and touched owners and tests have since changed on main; integration must preserve those changes and refresh the relevant validation.
  • Complete next step (P2) - Resolve the target-branch conflicts and, when campaign execution resumes, complete the documented final-head validation and native preparation with measured test costs.

Findings

None.

Provenance

  • extensions/slack/src/monitor/slash.test-harness.ts and slash.test.ts: original intent not found (unknown: File history was inspected, but the introducing simulated-metadata implementation could not be established because required historical blobs were unavailable.)

Tests

  • Missing end-to-end proof: The PR reports passing intermediate-head harness runs, but current-head media, suppression, cleanup, abort controls, golden replay, and test types remain unrun. No new user-facing behavior requires a live Slack demonstration.
Agent review details

How this fits together

The Slack plugin connects conversations, attachments, and interactive actions to OpenClaw’s shared session and reply services. These tests exercise that boundary and inspect prepared context, stored media, and outgoing delivery operations.

flowchart LR
  A[Slack event fixtures] --> B[Slack adapter tests]
  B --> C[Shared session and interaction owners]
  B --> D[Reply and progress owners]
  B --> E[Guarded media download and storage]
  C --> F[Context and authorization assertions]
  D --> G[Delivery and cleanup assertions]
  E --> H[Stored bytes and rejection assertions]
Loading

Technical review

Best possible solution:

Retain the owner-level cleanup, integrate it with current main, and substantiate coverage preservation with the campaign’s authorized final-head validation.

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

Not applicable: this PR addresses test maintenance and misleading simulated coverage rather than a reported production defect; no tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: consolidating fixtures and checking shared policy at its actual owner is appropriate for the requested audit, with final-head coverage preservation still to be demonstrated.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2f1f73ccb222.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the owner-level cleanup, integrate it with current main, and substantiate coverage preservation with the campaign’s authorized final-head validation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

Testing

Proof path: in-process harness. Added test files: 15.

Security

None.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head diff changes tests, test support, and trace fixtures only; no production implementation, dependency, configuration, public API, or migration changes were introduced. (9a64c0b0cbac)
  • Current main retains distinct cleanup opportunities: Current main still contains the simulated remote-media implementation and slash metadata-recording checks that this branch replaces. These central contributions are not already implemented there. (extensions/slack/src/monitor/media.test.ts:60, 2f1f73ccb222)
  • Maintainer-requested campaign: Test audit: reduce redundant test code and full-suite runtime #139428 remains open and assigned to vincentkoc. Its acceptance requires preserved independent contracts and stronger remaining proof for removed scenarios; this PR uses Related rather than claiming completion of the umbrella campaign.
  • Final-head validation is explicitly pending: The supplied full PR body, sourceRevision d44ee34a3cfd5616fc0e22d8ef4692a4afae53e39da8c83b12d2f3c585c1b8c5, states that current-head execution, test types, golden replay, native preparation, and targeted controls remain unrun following campaign cancellation. Earlier passing results are explicitly limited to intermediate head 1258f2f. The previous review’s validation rank-up remains unresolved. (9a64c0b0cbac)
  • Current merge state: GitHub REST confirms the exact reviewed head remains open, draft, mergeable=false, and mergeable_state=dirty. No pinned test merge is available, so no claim is made that merging would remove current-main changes. (9a64c0b0cbac)
  • Media tests reach the maintained owner: The replacement delegates to real saveRemoteMedia with deterministic DNS and terminal transport fixtures, uses isolated state, and joins pending work before cleanup. This is meaningful in-process coverage, without a live Slack claim. (extensions/slack/src/monitor/media.test.ts:98, 9a64c0b0cbac)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Source 0, Tests -1592. Total -1592 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 17 1137 2729 -1592
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 1138 2730 -1592

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR contributes a bounded Slack and shared-owner test-cleanup batch to the broader audit campaign.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal test maintenance with no introduced user-facing runtime change or urgent product failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record final-head suite, test-type, golden-replay, targeted-control, and native-preparation results, including measured costs for materially changed test files.
  • Resolve target-branch conflicts while preserving newer owner contracts, then validate the integrated revision.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-23T09:53:06.902Z sha ee375b4 :: needs changes before merge. :: none
  • reviewed 2026-09-23T11:03:32.624Z sha 9a64c0b :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 23, 2026
Baseline-Refresh: 8206c5f9111da546ed9503ef03c819ea1fa3ea0f
Classify only the native exec scenario as an exec checkpoint. Codex command approvals use plugin checkpoints, as emitted by the producer. Exercise the real completion, writer, artifact collector, and controlled operator path with independent four-scenario expectations and strict kind and identity rejection.
@vincentkoc vincentkoc changed the title refactor(slack): remove duplicated fixtures and simulated policy tests refactor(slack): exercise runtime owners in consolidated tests Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack extensions: qa-lab P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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