Skip to content

Refine legacy test-first into complete base-aware package checks - #183

Merged
debuggingfuture merged 1 commit into
mainfrom
oct8/contextful-stage-refinement
Oct 7, 2026
Merged

debuggingfuture merged 1 commit into
mainfrom
oct8/contextful-stage-refinement

Conversation

@debuggingfuture

@debuggingfuture debuggingfuture commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

The Contextful gate runs one test-first check per changed package instead of repeating the legacy grouped check after complete discovery against the pull request's base. The grouped check otherwise repeats every package inside one command and can exhaust its wall clock despite the package checks succeeding.

The discovery result carries whether the exact base-aware command succeeded. Only that provenance, together with the split validation marker, refines the base's whole test-first check. Compatibility fallback retains the whole check. Unrelated base-only checks and split package names remain required; malformed or failed discovery dispatches no children and fails the parent. Validate-only discovery supports changes with no Rust source differences.

The canonical producer enumerates the changed source and test packages against that exact base, including source deletions inside retained packages. An unresolvable deleted package fails discovery. Stage parsing rejects oversized output, truncation breadcrumbs and empty lists; arbitrary stage names cannot supply base-aware provenance.

Validation: 2,468 tests pass with one existing skip across 185 files; typecheck and lint pass. Dispatcher and substrate Worker dry-runs compile without upload. The 14 recipe regressions cover refinement, fallback, base-only coverage, empty-change coverage and discovery refusal.

@debuggingfuture
debuggingfuture marked this pull request as ready for review October 7, 2026 21:00
@debuggingfuture
debuggingfuture marked this pull request as draft October 7, 2026 21:00

@flaredispatch-fractalboxdev flaredispatch-fractalboxdev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review — 💬 Comment

Risk tier: lite · 0 critical · 1 warnings · 1 suggestions

Reviewers: security 1 · code-quality 0 · performance 0 · documentation 1

1. ⚠️ Warning — Incomplete package discovery can suppress the legacy whole check

📍 runs/contextful-gate.ts:56-59

'splitTestFirst' is enabled whenever base-aware discovery returns 'test-first.validate', without verifying that all required 'test-first.*' parts were discovered. A partial or malformed successful discovery can therefore omit 'test-first' from the merged stages and bypass the legacy whole-package check. Require the complete expected part set (or otherwise prove the whole check is safely replaced) before filtering the base stage.

2. 💡 Suggestion — Comment overstates which checks are refined

📍 runs/contextful-gate.ts:54

The comment says that “complete base-aware parts” refine their legacy whole check, but the implementation only removes the legacy 'test-first' stage under a specific 'test-first.validate' condition. Update the comment to describe this exact behavior, or broaden the implementation if other package parts are intended to follow the documented rule.

📋 View full logs & reviewed diff ↗

@debuggingfuture
debuggingfuture marked this pull request as ready for review October 7, 2026 21:08
@debuggingfuture
debuggingfuture merged commit 0309131 into main Oct 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant