Skip to content

fix(qa): validate Slack run artifacts and approval identities - #117344

Merged
steipete merged 3 commits into
mainfrom
codex/qa400-slack-mantis-artifact-freshness
Sep 21, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/qa400-slack-mantis-artifact-freshness

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Mantis Slack Desktop QA can report success using stale or mixed inputs when an output directory is reused or two runs overlap. Approval checkpoints can also describe different interactions while passing shape-only checks.

User Impact

Each invocation derives its verdict only from its own incoming artifacts. Missing screenshots, metadata, or selected checkpoints fail visibly; pending and resolved approval evidence must identify the same producer channel, message, and opaque approval ID. Invalid options preserve prior reports, while unrelated diagnostics and unselected checkpoints remain intact.

Published files retain their existing fixed paths. Concurrent runs sharing an output directory can interleave files and summaries; they must use separate output directories for coherent per-run bundles. This repair isolates verdict inputs without adding cross-process publication serialization, locks, or artifact history.

Why This Change Was Made

One private artifact owner handles staging, validation, publication, and staging cleanup. Existing nested cleanup still releases sessions, heartbeat workers, and credential leases when copying, validation, publication, or cleanup fails. Traversal uses the existing narrow SDK root-walk contract. The tests use the documented temp-directory helper and local deterministic Promise barriers.

Approval evidence follows the actual producer contract: both Codex QA scenarios use plugin approvals, Convex may select the channel, and mutable Slack thread metadata does not redefine message identity. No approval authorization policy changed.

Evidence

Unchanged production reproduced ten false-pass cases for stale or mismatched evidence plus a separate overlapping-run failure through runMantisSlackDesktopSmoke. The final artifact suite passed all 16 cases with zero skips; the unchanged 17-case runtime-owner proof is retained. Fixtures use synthetic command-runner and credential responses; this is not live Slack, Gateway, or provider execution.

The latest pnpm test <file> --maxWorkers=1 file walls were 24.44 seconds for the artifact suite and 29.69 seconds for the existing owner suite. Earlier cold artifact runs measured 40.77–42.66 seconds. Latest test bodies took 2.99 and 2.57 seconds respectively; cold transforms account for most of the full file cost. The actual runtime boundary is needed to exercise copying, verdict selection, publication, and cleanup together. No performance claim is inferred from timing variation.

Hosted CI is green for head 1c5080b7a5ef. Both containing jobs checked out generated merge fb19d82a950a against base c371f5f0a57b and passed all 33 Slack cases:

Suite Passed cases Sum of reported CI case durations Containing shard command wall Whole job wall
Artifact suite 16 4.035 s 160.55 s 293 s
Runtime-owner suite 17 1.945 s 115.69 s 205 s

These sums use rounded per-case durations, not full-file wall time. Hosted CI does not report isolated file walls: the containing shards ran 73 files / 712 cases and 74 files / 1,292 cases respectively, and whole-job times include setup and the shared runtime build. The separately measured 24.44 s / 29.69 s full-file walls above remain the file-cost evidence.

Final affected proof passed the artifact cases, source/import/format guards, extension-test types, and targeted lint. The canonical selected-check categories are covered using those results plus explicitly reused successful production/core, plugin, script, and remaining guard checks. Earlier aggregate changed-check failures are retained rather than represented as a single green aggregate invocation. All final downloaded proof artifacts match the owning run's emitted hash manifest. The final difference after runtime proof is a documentation paragraph and an ordinary source comment; complete-candidate P2 review is clean.

Validation findings and repairs
  • An initial positive case exposed an overly strict host-channel assumption. Evidence now follows the actual producer-selected channel and message identity.
  • Assertion-safety checks rejected moved casts. Canonical record narrowing removed them, and the canonical generator supplied the exact Slack baseline shrink from four assertions to one. Unrelated inherited baseline increases were excluded.
  • Boundary and type checks exposed a private test-helper import, use of intentionally omitted Root.walk, and direct Promise.withResolvers outside the test project's TypeScript library target. Existing narrow SDK surfaces and local standard-Promise barriers resolved these; no library target or SDK surface was expanded. Targeted lint also caught and resolved one shadowed callback parameter.
  • Full review found that “latest publisher” wording overstated coherence of shared fixed outputs. Comparison with the original copy and summary phases confirmed the existing interleaving behavior. The runbook and source comment now state that limitation explicitly; cross-process serialization remains outside this input-freshness repair.
  • An early source capture failed for lack of disk space, and native Blacksmith full-sync fallback later timed out before the payload. The reviewed capsule repair in fix(testbox): retain comparison base for native capsule sync #154796 restored targeted sync. Final source identities, checks, downloads, and lease cleanup were verified normally.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 10:19 AM ET / 14:19 UTC (Revision 17).

ClawSweeper review

What this changes

The PR isolates incoming Slack desktop QA artifacts per run, validates matching approval identities, and adds regression coverage and output-directory guidance.

Merge readiness

✅ Ready for maintainer review

The repair remains useful on current main. No blocking introduced defect was found, and the earlier directory-validation finding is resolved.

Priority: P2
Reviewed head: 1c5080b7a5efb2937f5b7b3df45ca6584f569fa5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with meaningful regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies. The submitted runtime-entrypoint tests exercise staging, validation, publication, and cleanup with real files but synthetic command and credential responses; they are not live Slack proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies. The submitted runtime-entrypoint tests exercise staging, validation, publication, and cleanup with real files but synthetic command and credential responses; they are not live Slack proof.
Evidence reviewed 9 items Introduced change and ownership: Reviewed the pinned merge-base-to-head changes. The runtime now copies into invocation-specific staging and validates that staging before publication; existing nested session and credential cleanup remains intact.
Current-main necessity: Current main still copies directly into outputDir and reads metadata and checkpoints from that reused directory. Successful copying does not remove missing old artifacts, leaving the reported stale-input mechanism present.
Latest release comparison: The supplied latest release also reads remote metadata from outputDir and retains the existing checkpoint collector; this repair is not demonstrated as shipped.
Findings None None.
Security None None.

How this fits together

Mantis Slack desktop QA collects screenshots and metadata from a remote QA run. Its artifact validator turns that evidence into a pass/fail result and publishes reports for operators.

flowchart TD
  A[Remote Slack QA run] --> B[Incoming artifacts]
  B --> C[Private run staging]
  C --> D[Validate files and approval identities]
  D --> E[Pass or fail verdict]
  C --> F[Publish artifact files]
  E --> G[Operator report]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +163, Tests +234, Docs +6, Other 0. Total +403 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 380 217 +163
Tests 3 370 136 +234
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 7 757 354 +403

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +163 lines; tests and test support net +234 lines Production growth implements invocation isolation and identity validation while consolidating artifact ownership; tests exercise the runtime boundary.

Technical review

Best possible solution:

Keep verdict validation within the single artifact owner, preserving existing report paths and the documented separate-directory contract for concurrent bundles.

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

Yes, source establishes a clear path: reuse an output directory, copy incomplete new artifacts, and let current main read the retained successful metadata or checkpoints. This review did not execute that path.

Is this the best way to solve the issue?

Yes. Invocation-specific staging addresses the stale-input cause at the existing runtime boundary without adding public APIs, locks, or another publication owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs false-positive results in a bounded developer QA workflow.
  • 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: The maintainer-author exemption applies. The submitted runtime-entrypoint tests exercise staging, validation, publication, and cleanup with real files but synthetic command and credential responses; they are not live Slack proof.

Evidence

What I checked:

  • Introduced change and ownership: Reviewed the pinned merge-base-to-head changes. The runtime now copies into invocation-specific staging and validates that staging before publication; existing nested session and credential cleanup remains intact. (extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.ts:1156, 1c5080b7a5ef)
  • Current-main necessity: Current main still copies directly into outputDir and reads metadata and checkpoints from that reused directory. Successful copying does not remove missing old artifacts, leaving the reported stale-input mechanism present. (extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.ts:1352, b517ee030f2d)
  • Latest release comparison: The supplied latest release also reads remote metadata from outputDir and retains the existing checkpoint collector; this repair is not demonstrated as shipped. (extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.ts:1366, ec9c1a13db89)
  • Directory rejection verified in dependency: Inspected the published @openclaw/fs-safe 0.17.0 archive in memory. dist/local-file-descriptor.js rejects non-files both before opening and after fstat. npm metadata identifies openclaw/fs-safe as its repository. This confirms that the new owner.open call resolves the earlier directory-as-screenshot concern.
  • Producer contract and authority boundary: The OpenClaw checkpoint writer supplies approvalId, channelId, messageTs, kind, and decision. Both Codex-named QA scenarios explicitly produce plugin approvals in OpenClaw's scenario definitions. The patch validates these recorded facts after execution; it does not consume them to authorize an action or change the Codex protocol. (extensions/qa-lab/src/live-transports/slack/slack-live.approval-checkpoint.ts:74, 1c5080b7a5ef)
  • Regression coverage and proof limits: The 16-case artifact suite exercises the production runtime entrypoint with real temporary files and synthetic command responses, covering overlap, missing artifacts, invalid options, mismatched identities, duplicate interactions, and valid producer kinds. The captured PR body reports 33 passing cases across both suites and explicitly disclaims live Slack, Gateway, or provider execution. No tests were executed during this read-only review. (extensions/qa-lab/src/mantis/slack-desktop-smoke.artifacts.test.ts:90, 1c5080b7a5ef)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • kevinslin: 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.

History

Review history (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T22:45:53.218Z sha ec68d10 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T23:37:56.504Z sha ec68d10 :: needs changes before merge. :: [P2] Reject directories when validating screenshot artifacts
  • reviewed 2026-08-14T16:13:36.950Z sha ec68d10 :: found issues before merge. :: [P2] Reject directory artifacts as screenshots
  • reviewed August 15, 2026, 5:51 PM ET / 21:51 UTC sha unknown :: found issues before merge. :: [P2] Reject directory artifacts as screenshots
  • reviewed 2026-08-19T04:07:40.354Z sha ec68d10 :: found issues before merge. :: [P2] Reject directory artifacts before accepting a pass
  • reviewed 2026-08-25T05:26:01.105Z sha ec68d10 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T23:16:30.261Z sha ec68d10 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T13:29:44.476Z sha 1c5080b :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 2, 2026
@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
Validate each invocation in a private staging directory before publishing to
the existing artifact paths. Bind approval evidence to the producer channel,
message and opaque approval identity, preserving the existing cleanup owner.
Keep unrelated and unselected evidence and preserve prior reports on invalid
options. Public output remains latest-publisher, not an atomic snapshot.

The prior artifact implementation reproduced eleven distinct false passes.
Thirty-three behavior cases passed before the final mechanical type narrowing;
independent P2 review is clean. Final selected gates remain pending after host
disk exhaustion interrupted source preparation before upload.
Use the existing root-walk and test-environment SDK entry points, keep overlap barriers local to the fixture, and adopt the canonical generated Slack assertion baseline shrink.

Clarify that each verdict uses its own staging inputs while shared fixed output paths may interleave across concurrent runs. Coherent concurrent bundles require separate output directories.
@steipete steipete self-assigned this Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL and removed size: M labels Sep 21, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 21, 2026
@steipete
steipete merged commit 28ae31a into main Sep 21, 2026
114 checks passed
@steipete
steipete deleted the codex/qa400-slack-mantis-artifact-freshness branch September 21, 2026 15:40
@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 22, 2026
…aw#117344)

* fix(qa): reject stale Slack desktop workflow evidence

* fix(qa): align Slack artifact proof with SDK boundaries

Use the existing root-walk and test-environment SDK entry points, keep overlap barriers local to the fixture, and adopt the canonical generated Slack assertion baseline shrink.

Clarify that each verdict uses its own staging inputs while shared fixed output paths may interleave across concurrent runs. Coherent concurrent bundles require separate output directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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