Skip to content

fix(ci): select channel chunking suites for shared Markdown chunker changes - #168467

Merged
steipete merged 1 commit into
mainfrom
steipete/markdown-chunker-test-selection
Oct 10, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/markdown-chunker-test-selection

Conversation

@steipete

@steipete steipete commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #167958

What Problem This Solves

Fixes: channel chunking regressions escape PR CI and pnpm test:changed when the shared Markdown render-aware chunker in packages/markdown-core changes.

User Impact

No user-visible product change. Maintainers now get the Google Chat, Signal, Slack, SMS, Telegram, and WhatsApp chunk-contract suites on PRs and in pnpm test:changed whenever the chunker or the IR/render modules it depends on change, so a red like the WhatsApp delivery-recovery break after #167958 fails on that PR instead of surfacing later on main or in an unrelated PR.

Why This Change Was Made

#167958 (69bfe7b) changed render-aware-chunking.ts, and extensions/whatsapp/src/send.delivery-recovery.test.ts went red on main (repaired in 281379b). It only surfaced when #168139's package.json edit widened selection.

Channels import the chunker through the Plugin SDK facade (openclaw/plugin-sdk/text-chunking → src/plugin-sdk/text-chunking.ts → packages/markdown-core). PR CI's aggressive import walk stops at depth 2, but the channel format suites sit at depth 3 and the WhatsApp delivery-recovery suite at depth 5. Locally, test:changed short-circuits to the sibling test and does not resolve SDK aliases, so it reached no extension test at all.

This PR adds one explicit mapping in SOURCE_TEST_TARGETS, the documented owner that both test:changed and the CI bounded planner already consume as explicit-owner. It covers render-aware-chunking, its in-package IR dependencies (ir, ir-annotations, ir-slice, ir-spans), and the render/render-attributed modules the channel render callbacks use. Each maps to the markdown-core IR/render/chunker suites, the two SDK facade suites, and the channel format/send/delivery suites. No new mechanism, workflow, or job.

Tradeoff: for ir-slice, ir-spans, and ir-annotations, local test:changed previously walked about 12,024 core tests (effectively the whole core suite, yet zero extension tests). The explicit mapping replaces that with the 14 targeted suites, consistent with explicit mappings winning locally. PR CI remains strictly additive for every file.

Evidence

Selection before → after, from the real owners (resolveChangedTestTargetPlan for local test:changed, resolveChangedNodeTestTargets with the PR options selectionMode: "aggressive" and PR-exempt/release-only excluded):

Changed file Local test:changed PR CI selected files Channel suites (before → after)
render-aware-chunking.ts 1 → 14 52 → 60 (0 dropped) 0 → 8
ir.ts 1 → 14 25 → 35 (0 dropped) 0 → 8
ir-slice.ts 12,024 → 14 25 → 35 (0 dropped) 0 → 8
ir-spans.ts 12,024 → 14 59 → 67 (0 dropped) 0 → 8
ir-annotations.ts 12,024 → 14 25 → 35 (0 dropped) 0 → 8
render.ts 6 → 14 (superset) 52 → 60 (0 dropped) 0 → 8
render-attributed.ts 4 → 14 (superset) 52 → 60 (0 dropped) 0 → 8

node scripts/check-changed.mjs --dry-run -- packages/markdown-core/src/render-aware-chunking.ts still reports lanes=core, coreTests. That gate owns static checks; product test selection lives in SOURCE_TEST_TARGETS.

  • Contract proof: with render-aware-chunking.ts swapped back to 69bfe7b645c8^, extensions/whatsapp/src/send.delivery-recovery.test.ts fails ("preserves long styles and quotes only the first chunk"). All selected channel suites pass on current main.
  • CI cost (hybrid PR plan for a chunker change): still 8 Node rows with no new dist or build mode. The eight channel suites join the existing changed-extensions-bundle-1 row (28 → 36 files), so no extra runner registrations. These seven files were touched by 23 of 15,781 main commits in the last 30 days. Local cold run of the eight channel suites, --maxWorkers=1: 209s wall, dominated by transform (WhatsApp delivery-recovery ~6s of test time). The planner prices files without timings at its 20s default.
  • Regression test: test/scripts/ci-changed-node-test-plan.integration.test.ts › "selects channel chunk-contract suites when …" fails on the pre-change mapping (52/25 selected, no channel suites) and passes after. pnpm test test/scripts/ci-changed-node-test-plan.integration.test.ts --maxWorkers=1: 15/15 passed, 101s for the file. The two new cases take about 50ms each on the shared import-graph cache, about 6s cold when run alone.
  • PR-selected suites for this diff (34 files, same planner): 33 of 34 passed in one pnpm test <34 files> run (490s wall). The 34th, test/vitest-projects-config.test.ts, hit a spawnSync … ETIMEDOUT while resolving the full root project graph inside the 28-file parallel tooling shard, then passed 44/44 alone in 54s. An earlier attempt's tooling Vitest process exited with SIGSEGV mid-run with no failing assertion. Both are recorded as investigated local failures in the review artifact, not claimed as passes.
  • Codex autoreview: scoped-clean at --max-priority P2 (no actionable P0–P2 findings).
  • Inherited CI failure (not caused by this PR): check-source-contracts → lint:tmp:session-accessor-boundary reports six legacy session reads in src/auto-reply/reply/dispatch-from-config.test-support.ts. On main, 228ba9d renamed dispatch-from-config.test-harness.ts to that .test-support.ts name, and the guard scans that suffix; the hourly main run 38056049112 fails identically. This PR touches neither that file nor the debt baseline. Fixed directly on main in 2f968aa (baseline regenerated with the guard's generator; guard and test/scripts/check-session-accessor-boundary.test.ts pass). Every other check on this head passed. This PR lands through the native pre-existing-failure admin route instead of a CI rerun.

…hanges

#167958 (69bfe7b) changed packages/markdown-core/src/render-aware-chunking.ts
and turned extensions/whatsapp/src/send.delivery-recovery.test.ts red on main
(repaired in 281379b). Neither PR CI nor local test:changed selected any
channel suite: channels import the chunker through the Plugin SDK text-chunking
facade, so the format suites sit three importer hops away and the WhatsApp
delivery suite five, beyond the aggressive PR walk's depth of two. Locally, the
sibling test short-circuits the walk and SDK aliases are not resolved.

Map the chunker, its IR dependencies (ir, ir-annotations, ir-slice, ir-spans),
and the render modules the channel render callbacks use (render,
render-attributed) through SOURCE_TEST_TARGETS to the markdown-core IR/render/
chunker suites, the SDK facade suites, and the Google Chat, Signal, Slack, SMS,
Telegram, and WhatsApp format/send/delivery suites. PR CI receives them as
explicit owners beside its import consumers (strictly additive; a chunker PR
keeps 8 Node rows). Local test:changed for ir-slice/ir-spans/ir-annotations
narrows from a ~12k-test core walk to the 14 targeted suites.
@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@steipete
steipete marked this pull request as ready for review October 10, 2026 13:54
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR selects channel chunk-contract suites when shared Markdown chunking, IR, or rendering modules change.

Example: A PR changes packages/markdown-core/src/render-aware-chunking.ts.

  • Before: Aggressive PR selection omits all eight channel chunk-contract suites.
  • After: The explicit ownership mapping adds those eight suites alongside existing import consumers.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, coherent repair with meaningful planner regressions and no actionable findings; supplied behavior evidence remains at the in-process planner boundary.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored CI tooling change is outside the ordinary contributor proof gate; supplied evidence exercises the real local and CI planner owners in process, rather than a shipped command or hosted selection scenario.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Maintainers can merge shared Markdown changes without running the channel contracts those changes affect.
Reason: The escaped failure establishes concrete value, and the maintainer-authored direction accepts the targeted local-selection tradeoff.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a concrete test-selection gap through the existing shared owner, with no actionable patch findings; the earlier CI attribution question is resolved by matching main failures and a separate repair.

Priority: P2
Reviewed head: 7e83cc70d7b852de4719aafa3574541300f7fbc0

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared test-selection owner converts changed repository paths into test targets consumed by local test:changed and CI shard planning.

flowchart TD
  A[Changed Markdown paths] --> B[Shared ownership map]
  B --> C[Local test selection]
  B --> D[CI bounded selection]
  E[Import consumers] --> D
  C --> F[Selected test suites]
  D --> F
Loading

Technical review

Best possible solution:

Retain the focused mappings in the shared selection owner and the regression coverage at its CI consumer boundary.

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

Source confirms the local sibling-test shortcut and aggressive CI depth limit; the PR supplies before/after planner results and reports that the added regression fails before the mapping.

Is this the best way to solve the issue?

The existing explicit-owner map is a narrow, coherent repair for SDK-mediated consumers without broadening global traversal or introducing a competing selector.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Explicit source ownership keeps the original intent (ea2e7f4: Replace duplicated routing inventories with discovery while retaining explicit exceptions for ambiguous shared ownership.)
  • Bounded aggressive CI traversal keeps the original intent (bbb074a: Limit import depth and hub expansion to control PR cost while retaining explicit ownership and full hourly coverage.)
  • Local explicit mappings keeps the original intent (refactor(test): derive changed tooling routes #117407: Explicit mappings take precedence locally; the PR documents and accepts replacing broad IR traversal with the targeted contract family.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit bbb074a adds scripts/test-projects.test-support.mts:4376 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bbb074a4a8f4; files: scripts/test-projects.test-support.mts)

PR surface

Tests +53, Docs 0. Total +53 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 53 0 +53
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 54 1 +53

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A demonstrated selection gap lets shared Markdown changes escape channel contract validation, with no direct runtime behavior change.
  • 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.

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 (1 earlier review cycle)
  • reviewed 2026-10-10T14:00:23.652Z sha 7e83cc7 :: needs changes before merge. :: none

Reviewed October 10, 2026, 10:21 AM ET / 14:21 UTC (Revision 2).

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@steipete
steipete merged commit f694a7e into main Oct 10, 2026
188 of 193 checks passed
@steipete
steipete deleted the steipete/markdown-chunker-test-selection branch October 10, 2026 14:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…hanges (openclaw#168467)

openclaw#167958 (ff91e9f) changed packages/markdown-core/src/render-aware-chunking.ts
and turned extensions/whatsapp/src/send.delivery-recovery.test.ts red on main
(repaired in d17a849). Neither PR CI nor local test:changed selected any
channel suite: channels import the chunker through the Plugin SDK text-chunking
facade, so the format suites sit three importer hops away and the WhatsApp
delivery suite five, beyond the aggressive PR walk's depth of two. Locally, the
sibling test short-circuits the walk and SDK aliases are not resolved.

Map the chunker, its IR dependencies (ir, ir-annotations, ir-slice, ir-spans),
and the render modules the channel render callbacks use (render,
render-attributed) through SOURCE_TEST_TARGETS to the markdown-core IR/render/
chunker suites, the SDK facade suites, and the Google Chat, Signal, Slack, SMS,
Telegram, and WhatsApp format/send/delivery suites. PR CI receives them as
explicit owners beside its import consumers (strictly additive; a chunker PR
keeps 8 Node rows). Local test:changed for ir-slice/ir-spans/ir-annotations
narrows from a ~12k-test core walk to the 14 targeted suites.
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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