Skip to content

fix(scope,review,ship): recognise Dart and Flutter in diff scope and test detection - #3284

Closed
arlophoenix wants to merge 9 commits into
garrytan:mainfrom
arlophoenix:fix/dart-scope-detection
Closed

arlophoenix wants to merge 9 commits into
garrytan:mainfrom
arlophoenix:fix/dart-scope-detection

Conversation

@arlophoenix

@arlophoenix arlophoenix commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Part 3 of 3 split from #3193 at maintainer request.

Why (in your own words)

On a Flutter or pure-Dart repo, /review and /ship now run the frontend and backend reviewers on a .dart diff, and Step 4 recognises an existing flutter test / dart test suite instead of offering to bootstrap a framework over it. Before this, gstack-diff-scope matched no category for .dart, so a widget-only change set SCOPE_FRONTEND=false SCOPE_BACKEND=false and those reviewers were skipped without a word.

.dart counts as both frontend and backend, because the extension cannot tell a widget from a repository class. pubspec.lock counts as config. The design detector drops .dart from --changed, since impeccable reads web sources, so Dart files get the checklist pass only (noted in docs/skills.md). The review-army stack hint reports dart and TEST_FW reports flutter-test or dart-test. The Step 4 bootstrap and Step 7 coverage-audit marker blocks report RUNTIME:dart, FRAMEWORK:flutter (an indented sdk: flutter line, quoted or not; a commented-out one does not count), dart_test.yaml and *_test.dart. Adversarial DIFF_SIZE now sums git diff --numstat, which also fixes a deletion-only diff reading as 0.

To fit ship's parity cap without raising it, existing prose in scripts/resolvers/testing.ts was trimmed. Bash comments in both the bootstrap and coverage-audit marker blocks were shortened, keeping their meaning. The bootstrap "A marker tells you which ecosystem…" sentence was tightened, dropping its "installing a second framework over a working one is worse" clause, which the section repeats later. The sentence "A green python manage.py test with no pytest.ini is a tested project, not a bootstrap candidate." was dropped, because the sentence before it makes the same point. No test pins any of them. test/frontend-scope.test.ts's sampled parity test got a 30s timeout: it measured 4.15s for 33 samples under nice against bun's 5s default.

Live evidence

A throwaway git clone --shared of a real Flutter app (flutter-bbtm), branched from its develop, with a comment appended to lib/theme.dart, a drawer widget and its widget test. The clone was deleted afterwards. Captured at 07f6754. Later commits changed the Flutter grep, the coverage-audit block and a comment, which the tests below cover.

$ <upstream/main c5c2f2899> gstack-diff-scope develop
SCOPE_FRONTEND=false
SCOPE_BACKEND=false
SCOPE_TESTS=true
(all other SCOPE_* false)
$ <this branch 07f6754e1> gstack-diff-scope develop
SCOPE_FRONTEND=true
SCOPE_BACKEND=true
SCOPE_TESTS=true
(all other SCOPE_* false)

In the same clone, the rendered review-army block printed STACK: node dart, DIFF_LINES: 3 and TEST_FW: flutter-test. The bootstrap block printed RUNTIME:node, RUNTIME:dart, FRAMEWORK:flutter, SCRIPT:package.json test and TESTFILES:1141.

Scope

  • Changed: bin/gstack-diff-scope, lib/frontend-scope.ts, bin/gstack-design-detect.ts, the review-army, testing and outside-voice resolvers plus their regenerated sections, docs/skills.md, and tests. 20 files, +207/−60.
  • Verified live by: the shared-clone run above, plus a synthetic Flutter fixture running the four rendered snippets (diff-scope, review-army, bootstrap, DIFF_SIZE).
  • Did NOT test: paid evals (eval:select picked about 110 probes and 24 judges through frontend-scope.ts), the full bun run test, Linux or Windows, or /ship end to end on a Flutter repo.

Liveness proof (required for external contributors)

Screenshot 2026-10-19 at 10 10 17 AM

Checklist

  • Liveness screenshot attached (GSTACK PR typed live into a real surface) or PR author is @garrytan (owner exemption)
  • This is not a generated-file-only diff (I edited the source/template and regenerated)
  • No ETHOS.md edits, and no changes to voice / founder perspective / YC references
  • New public command / external service / host adapter has an accepted issue linked (or N/A)
  • Linked issue or reproduction: v1.91.102.0 fix(pregate): run Dart and Flutter test lanes #3193

Test plan

  • Run singly with nice on macOS, all green: diff-scope 40, frontend-scope 35, gstack-design-detect 108, ship-test-detection-markers 7, gen-skill-docs 486, skill-validation 336, touchfiles 69. The parity, context-budget and skill-size budget tests also pass, and bun run typecheck is clean.
  • ship-test-detection-markers runs the rendered bootstrap, coverage-audit and review-army blocks in temp repos. Mutation checks: each assertion fails with its fix reverted, covering a commented sdk: flutter, a quoted sdk: "flutter", dart_test.yaml and the coverage-audit RUNTIME:dart.
  • bun test test/pregate-selection.test.ts: 4 failures on both this branch and pristine upstream/main a2a6cab (named below), plus 1–2 more per branch run that time out at 5s under load (see below).
  • Manual test pass (see checklist below)

Manual test pass

  • In a Flutter repo, change one lib/**/*.dart file and run /review: expect the frontend and backend specialists to be dispatched, and the stack line to read dart with TEST_FW: flutter-test.
  • In a repo with pubspec.yaml and test/*_test.dart but no test command in CLAUDE.md, run /ship: expect Step 4 to print "Existing tests detected" and offer flutter test or dart test, not a bootstrap.

Test failures not caused by this branch

test/pregate-selection.test.ts fails these 4 on both this branch and upstream/main a2a6cab (24 pass, 4 fail there): "a clean branch passes every check…", "lanes: a touched file with no test lane is FAIL lanes…", "p0-4-windows-lane-unrun…" and "lanes prints the lane list with platform tiers…". On darwin the linux and windows lanes become requires-remote. On this branch, 1–2 more tests fail per run, all at bun's 5s timeout under a load average of about 25, and a different test each run (five names across three runs). Upstream's single run under the same load had none, so those are not proven unrelated. This branch does not touch pregate code.

test/outside-voice-preflight.test.ts fails 2 tests on both this branch and upstream, because macOS resolves /var to /private/var: "a repo-local installation resolves before any preamble exports exist" and "valid explicit runtime roots take priority and stale roots fall back locally".

gstack-pregate stage 2 selected 618 test files for this diff, hit its 600s timeout and is incomplete. It reported 4 failures, including a gstack-ff-update rescue-ref 5s timeout and a shared-libs-checker beforeEach timeout. Both files are outside this diff, and neither is proven to fail on upstream. Its linux and windows requires-remote obligations are uncleared.

Not addressed

  • Only a root pubspec.yaml is read for the stack and test hints, so a monorepo with nested packages is detected only when the root has one.
  • Generated *.g.dart files count toward diff size and scope like any source file.
  • The flow-map form flutter: {sdk: flutter} reads as dart-test. flutter create never writes it.
  • TEST_FW stays last-match-wins, so a root with both go.mod and pubspec.yaml reports only the Dart runner.
  • The bootstrap table mentions an fvm prefix for .fvmrc but emits no FVM marker. The fallback "which runtime?" question has no Dart option.
  • gstack-design-detect --changed on a Dart-only diff exits with DETECT_NO_TARGETS and does not say the .dart files were skipped.

🤖 Generated with Claude Code

arlophoenix and others added 9 commits October 18, 2026 14:13
gstack-diff-scope matched no category for .dart, so a Flutter widget PR
with a test set SCOPE_TESTS alone and silently skipped the design,
performance and security reviewers. The extension cannot tell a widget
from a repository, so .dart is both; pubspec.lock is config.
lib/frontend-scope.ts mirrors the frontend half, and design-detect skips
.dart because impeccable reads web sources.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…etection

The review-army stack hint called a Flutter repo `node` and test
bootstrap had no Dart runtime. Adds STACK dart, TEST_FW
flutter-test/dart-test, RUNTIME:dart and FRAMEWORK:flutter markers,
*_test.dart in the TESTFILES count, a pubspec.yaml candidate row and
dart_test.yaml in the coverage audit. The adversarial DIFF_TOTAL uses
--numstat like review-army already does.

To stay inside ship's parity byte cap, four bootstrap comments are
shortened, the "a marker is not proof" sentence is tightened (its
second-framework clause is repeated later in the section) and a
redundant manage.py sentence is dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Coverage-audit detection now names Dart and counts *_test.dart like the
bootstrap block (two comments shortened to fit the parity caps), with a
test that runs the rendered block; diff-scope's Dart comment no longer
calls the extra frontend pass cheap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A commented-out 'sdk: flutter' made a pure-Dart package report Flutter, and a
quoted 'sdk: "flutter"' fell back to dart test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dart_test.yaml can move test discovery off *_test.dart, so a configured
suite read TESTFILES:0 and was offered a bootstrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trunk-io

trunk-io Bot commented Oct 18, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thanks @arlophoenix. This is ported as #3300, squashed with you as co-author. The only change on top: it pushed /design-review 51 characters over its SKILL.md size pin, so one bootstrap comment is shortened (# Ecosystem markers) and the 31 pins that shrank are lowered. The trimmed prose was checked against every test and eval (no clause is asserted anywhere), and the 30 s parity-test budget is justified: it already timed out at 5 s on main on a 4-core box. I'll close this once #3300 is through its gate.

@capy-ai

capy-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Closing in favour of #3300, which carries this change with @arlophoenix as co-author and has passed its free CI and paid gate (108/108 rule cases, 24/24 judges). Thank you for the careful split and the mutation-checked tests.

@capy-ai capy-ai Bot closed this Oct 19, 2026
capy-ai Bot added a commit that referenced this pull request Oct 20, 2026
…f scope and test detection (#3284) (#3300)

* fix(scope,review,ship): recognise Dart and Flutter in diff scope and test detection (#3284)

Port of arlophoenix's #3284 onto current main, squashed:
- gstack-diff-scope: .dart is frontend and backend; pubspec.lock is config.
- lib/frontend-scope.ts mirrors the frontend half; gstack-design-detect
  never sends .dart to the impeccable engine.
- Test bootstrap, coverage audits and review-army detect Dart/Flutter
  (RUNTIME:dart, FRAMEWORK:flutter, dart_test.yaml, *_test.dart).
- Adversarial DIFF_SIZE sums git diff --numstat.

On top of the contributor's diff: shorten the bootstrap's ecosystem-marker
comment so /design-review stays at its SKILL.md size pin, lower the 31 pins
that shrank, and add the CHANGELOG entry.

Co-authored-by: arlophoenix <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* v1.91.160.0 fix(scope,review,ship): recognise Dart and Flutter in diff scope and test detection (#3300)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: arlophoenix <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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