fix/nuwayze-dogfood-findings #11

Merged
trevon merged 3 commits from fix/nuwayze-dogfood-findings into main 2026-09-27 13:32:46 +00:00
Owner

Problem

Solution

Rule changes

  • No rule behaviour change
  • New or changed rules (name + what now fires / no longer fires):
  • Precision measured for any new rule (fixture contract at minimum, real-code
    adjudication where possible — see tool/adjudicate.py)

Release Note

  • Internal only (no user-facing release note)
  • User-facing summary (1-2 bullets, outcome-focused):
  • Migration or operator note (if needed):

Breaking Changes

  • None
  • Yes — details:

Tests

  • Unit
  • Rule contract (positive and negative control)
  • Recall manifest still passes (pipe recall --root <dir> --strict)

Documentation

  • CHANGELOG entry: automated — release-please builds it from the
    Conventional Commit subjects, so check those read well; do not edit
    CHANGELOG.md by hand
  • README updated (rules table / precision numbers / flags and output)

AI usage

  • No AI used
  • AI used — what was delegated, and what was verified independently
## Problem ## Solution ## Rule changes - [ ] No rule behaviour change - New or changed rules (name + what now fires / no longer fires): - [ ] Precision measured for any new rule (fixture contract at minimum, real-code adjudication where possible — see `tool/adjudicate.py`) ## Release Note - [ ] Internal only (no user-facing release note) - User-facing summary (1-2 bullets, outcome-focused): - Migration or operator note (if needed): ## Breaking Changes - [ ] None - [ ] Yes — details: ## Tests - [ ] Unit - [ ] Rule contract (positive **and** negative control) - [ ] Recall manifest still passes (`pipe recall --root <dir> --strict`) ## Documentation - [ ] CHANGELOG entry: automated — release-please builds it from the Conventional Commit subjects, so check those read well; do not edit CHANGELOG.md by hand - [ ] README updated (rules table / precision numbers / flags and output) ## AI usage - [ ] No AI used - [ ] AI used — what was delegated, and what was verified independently
Found by dogfooding on nuwayze: `pipe check` reported

  _AgentHubController is consumed in the UI but 8 of its public
  member(s) are read by name nowhere outside the class ...

for a private ChangeNotifier whose widget, declared in the same file
(lib/screens/settings/agent_hub_screen.dart), renders every one of
those getters (`controller.authorizations`, `controller.hasLoadError`,
...).

The rule claims "outside the class" but discounted the notifier's
whole file: member reads were collected per file and the file that
declares the notifier was skipped. A private controller can only be
rendered from its own library, so that exclusion hid exactly the reads
that matter.

Member reads are now kept per scope: reads inside a ChangeNotifier
class body go under `memberUseScope(file, Class)`, everything else
under the file. The rule discounts only the notifier's own scope, so a
widget in the same file, or in a `part` of the library, counts as a
reader, while a notifier reading itself (`this.x`, `other.x`) still
does not. The model JSON keeps its shape (a map of name sets); only
the keys gained the class scope.

Tests (test/field_unread_scope_test.dart, a generated project): a
same-file widget read and a part-file read are not reported; a member
read nowhere and a member read only inside its own class are.

On nuwayze-w3 the finding is gone and nothing else moves: 65 findings
with the current release, 64 with this change, the only difference
being _AgentHubController. 221 tests pass.
`pipe verify .` failed with "verify needs --baseline" even in a repo
whose baseline sits where the README's CI recipe writes it. nuwayze's
scripts/testing/pipe_state_flow_gate.sh commits exactly that file,
.pipe-baseline.json at the repo root, so every verify there had to
repeat the path.

Without --baseline, verify now reads <path>/.pipe-baseline.json when it
exists and says so on stderr ("pipe: no --baseline given; using ..."),
so a run never silently picks a file nobody named. With neither, the
error names both remedies: pass --baseline, or write the conventional
file with `pipe check <path> --write-baseline <path>/.pipe-baseline.json`
before the fix. pipe had no baseline-name constant; defaultBaselineName
is now the one place it is spelled.

Tests (test/verify_default_baseline_test.dart): an explicit --baseline
wins and announces nothing; the conventional file is used and
announced; with neither the error carries both remedies; and end to
end, `pipe verify <copy>` against a baseline written at the copy's
root reads it (--expect-resolved fails on the 28 still-present
findings). README and docs/usage.md show the shorter form.

On nuwayze-w3, `pipe verify /Users/.../nuwayze-w3` with no flag reads
its .pipe-baseline.json (65 accepted findings). 225 tests pass.
fix(queries): resolve a subdirectory path to its enclosing package
Some checks failed
Lint Commits / commitlint (pull_request) Successful in 16s
Tests / Static Analysis (pull_request) Has been cancelled
Tests / Tests (pull_request) Has been cancelled
31607b5bcb
Found by dogfooding on nuwayze: `pipe queries lib` from the repo root
failed with

  no resolved package graph at .dart_tool/package_config.json
    remedy: run `flutter pub get` or `dart pub get` in .../nuwayze-w3/lib

It failed even with the package resolved, because the path was taken
as the project root: pipe looked for lib/.dart_tool/package_config.json,
which never exists, and the remedy sent the user to run pub get in a
directory that has no pubspec.

enclosingPackage() (project.dart) splits a path into the package that
contains it (the path itself when it holds a pubspec.yaml, else the
nearest ancestor that does) and the directory it names under that
root. `pipe queries` loads the package root and scans only that
directory, so `pipe queries lib/services` is `--dir lib/services` on
the package; an explicit --dir with such a path is relative to it.
Without a resolved graph the error now names the package root.

loadProject's own remedy uses the same lookup, so `pipe check lib`
(and the other commands, which still take the path as the root) now
says the path is inside the package at <root> and suggests passing
that with `--dir lib`, instead of pub get in lib.

Tests: enclosingPackage on a root, a nested directory, a nested
package and a missing path; loadProject's remedy for a directory
inside a package; and `pipe queries` on the fixture's lib/data
(root reported as the package, one file discovered), with
`lib --dir data`, and on an unresolved package where the remedy names
the root, not lib.

On nuwayze-w3: `pipe queries lib` exits 0 with 313 queries over 847
files, identical to `pipe queries .`; `pipe queries lib/services` scans
161 files and every one of its 212 queries sits under lib/services.
233 tests pass.
trevon merged commit 3c3eef40f7 into main 2026-09-27 13:32:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trevon/pipe!11
No description provided.