Skip to content

test(compaction): consolidate classification proof at its owner - #139564

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-compaction-classification
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-compaction-classification

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

Compaction integration suites repeat direct classifier checks through test-only exports, incurring the suites' workspace/database setup for pure predicates and maintaining redundant entry points.

Why This Change Was Made

Move the unique classification cases to the existing canonical unit suite. Remove duplicate predicate assertions, obsolete test exports, and the direct diagnostics alias. Keep the production classifier and transcript-wide wrapper, along with all real compaction, summary-anchor, anti-loop, hook and context-report integration proof.

User Impact

No production behavior changes. The same classification contracts have one owner. Net removal: 103 test lines, two support lines, and 11 production lines.

Evidence

All 365 cases pass before and after across the canonical classifier, compact hooks, safeguard and context-report suites. Preserved cases include both user-anchor positions, silent-reply context, custom anchors, excluded events, summaries, thinking/reasoning blocks, and wrapped heartbeat tokens. Full changed gate, formatting, diff check and independent P2 review pass.

Raw grouped timing was 140.74s before and 94.00s after, but cold/warm/load differences prevent attribution; this is not a full-suite speedup claim. Seven original predicate cases reported 307ms total and their canonical replacements reported below 1ms each.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 00:38
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 11:05 PM ET / September 6, 2026, 03:05 UTC.

ClawSweeper review

What this changes

Moves repeated conversation-classification tests into their owning suite and removes unused internal exports without changing compaction behavior.

Merge readiness

✅ Ready for maintainer review

Useful, bounded cleanup with no actionable correctness findings. The consolidation is not present on inspected main, and it supports the explicitly requested test-audit campaign.

Priority: P3
Reviewed head: bc1dfcc5cfb82202682b7d04e0a848f02bd30160

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with retained scenario coverage and no identified merge-blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored cleanup preserves the production classifier and does not change authority; the external-contributor live-proof gate does not apply, and reported focused test results remain supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored cleanup preserves the production classifier and does not change authority; the external-contributor live-proof gate does not apply, and reported focused test results remain supplemental validation.
Evidence reviewed 10 items Verified introduced change: The complete merge-base-to-head diff matches the supplied introduction evidence: tests move to the classifier owner, internal test exports disappear, and the diagnostics wrapper calls the same classifier directly. No classifier decision logic changes.
Classification coverage preserved: The canonical suite retains summaries, excluded custom events, tool-call-only messages and orphan results, and now covers thinking/reasoning blocks, wrapped heartbeat tokens, both meaningful user-anchor positions, silent-reply context, and custom anchors across assistant tool calls.
Removed seams have no remaining callers: A repository-wide search found hasMeaningfulConversationContent only inside its owning implementation and no remaining hasRealConversationContent references. The unchanged production classifier imports OpenClaw heartbeat/token helpers and a local message type; this change does not establish a Codex dependency-contract requirement.
Findings None None.
Security None None.

How this fits together

Compaction summarizes older conversation history so sessions can continue within model context limits. Its conversation classifier distinguishes meaningful transcript content from boilerplate and feeds compaction guards and context reports.

flowchart TD
  A[Session transcript] --> B[Conversation classifier]
  B --> C[Meaningful content and anchors]
  B --> D[Boilerplate and orphan tool output]
  C --> E[Compaction guards]
  D --> E
  E --> F[Summarize or skip]
  B --> G[Context report]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -11, Tests -105. Total -116 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 3 14 -11
Tests 4 68 173 -105
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 71 187 -116

Review metrics

None.

Technical review

Best possible solution:

Keep classification contracts in the canonical predicate suite while retaining compaction and context-report integration coverage.

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

Not applicable: this consolidates existing tests rather than repairing a reported runtime defect; the repeated predicate assertions are directly visible in the introduced diff.

Is this the best way to solve the issue?

Yes: testing through the existing classifier preserves the removed scenarios while eliminating internal forwarding seams and leaving integration behavior checks intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded test-maintenance cleanup with unchanged runtime classification behavior.
  • 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 maintainer-authored cleanup preserves the production classifier and does not change authority; the external-contributor live-proof gate does not apply, and reported focused test results remain supplemental validation.

Evidence

What I checked:

  • Verified introduced change: The complete merge-base-to-head diff matches the supplied introduction evidence: tests move to the classifier owner, internal test exports disappear, and the diagnostics wrapper calls the same classifier directly. No classifier decision logic changes. (src/agents/compaction-real-conversation.ts:32, bc1dfcc5cfb8)
  • Classification coverage preserved: The canonical suite retains summaries, excluded custom events, tool-call-only messages and orphan results, and now covers thinking/reasoning blocks, wrapped heartbeat tokens, both meaningful user-anchor positions, silent-reply context, and custom anchors across assistant tool calls. (src/agents/compaction-real-conversation.test.ts:81, bc1dfcc5cfb8)
  • Removed seams have no remaining callers: A repository-wide search found hasMeaningfulConversationContent only inside its owning implementation and no remaining hasRealConversationContent references. The unchanged production classifier imports OpenClaw heartbeat/token helpers and a local message type; this change does not establish a Codex dependency-contract requirement. (src/agents/compaction-real-conversation.ts:5, bc1dfcc5cfb8)
  • Integration protection retained: The compact hooks suite still exercises successful compaction of a summary-anchored transcript and transcript-wide boilerplate rejection. Inspected safeguard tests retain custom-prefix handling and the tool-only anti-loop boundary; context-report tests retain observable compactable-message counts. (src/agents/embedded-agent-runner/compact.hooks.test.ts:3162, bc1dfcc5cfb8)
  • Cleanup remains absent from main: The classifier, canonical tests, and diagnostics owner are unchanged between the pinned merge base and fetched main. Main therefore still contains the exported predicate and forwarding alias targeted by this cleanup. (src/agents/compaction-real-conversation.ts:32, cbcc1df2b32b)
  • Latest release comparison: The supplied latest release also retains the exported predicate and the same classifier logic; this is pending cleanup rather than a shipped behavior fix. (src/agents/compaction-real-conversation.ts:32, 3928bad9badf)

Likely related people:

  • Peter Steinberger: 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 (3 earlier review cycles)
  • reviewed 2026-09-06T00:43:20.103Z sha 05d1044f09dd4ac04dac164d985406a03cadd1b0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T01:06:53.199Z sha 9ce6413 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T02:35:53.744Z sha 36141294ed38febb6ecaca21fcb3329feb1aef04 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/test-audit-compaction-classification branch 2 times, most recently from 9ce6413 to 3614129 Compare September 6, 2026 02:30
@steipete
steipete force-pushed the codex/test-audit-compaction-classification branch from 3614129 to bc1dfcc Compare September 6, 2026 03:00
@steipete
steipete merged commit 8d53f30 into main Sep 6, 2026
173 checks passed
@steipete
steipete deleted the codex/test-audit-compaction-classification branch September 6, 2026 03:10
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit 'a2886546df92c3a601db538b1b70125e3519a16f':
  test(reports): deduplicate native process census setup (#139596)
  fix(ui): avoid refetching unrelated catalog hosts (#139570)
  test(compaction): consolidate classification proof at its owner (#139564)
  fix(apple): harden native state file permissions (#139623)
  improve(skills): review retained conversation for durable learning (#139656)
  fix(docker): stage bundled plugin runtime dependencies under the packaged plugin root (#139117)
  test: close HTTP fixtures before destroying their sockets (#139595)
  refactor(agents): simplify attempt execution and recovery (#139597)
  test(gateway): share HTTP authority scenarios (#139611)
  test(gateway): distinguish final CLI results from draft text (#139605)
  fix(shell-env): preserve CLI terminal ownership during login imports (#139308)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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