pipe/lib/src
trvon 31607b5bcb
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
fix(queries): resolve a subdirectory path to its enclosing package
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.
2026-09-25 20:16:23 -06:00
..
analysis.dart feat(verify): report a deleted subject as removed, not resolved 2026-09-24 20:04:52 -06:00
cli.dart fix(queries): resolve a subdirectory path to its enclosing package 2026-09-25 20:16:23 -06:00
dart_facts.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
dart_provider_facts.dart fix(provider): count same-file reads for notifier-field-unread 2026-09-25 20:09:21 -06:00
errors.dart feat: phase 1 ingestion harness + Phase 2 state-flow IR 2026-09-20 13:46:54 -06:00
excerpt.dart fix(guide): quote analysed source as bounded, delimited data 2026-09-22 12:05:12 -06:00
facts.dart fix(provider): count same-file reads for notifier-field-unread 2026-09-25 20:09:21 -06:00
firestore_facts.dart feat(queries): inventory firestore query surfaces as typed records 2026-09-23 18:03:09 -06:00
gateway_facts.dart feat(queries): inventory firestore query surfaces as typed records 2026-09-23 18:03:09 -06:00
guide.dart fix(cli): close the remaining rough edges in paths, recall and yams 2026-09-22 15:26:30 -06:00
index.dart fix(verify): a finding in an excluded file is not scanned, not resolved 2026-09-22 11:58:20 -06:00
model.dart feat: rule contracts + recall measurement (5/5 real bugs) + real --fail-on gate 2026-09-20 16:00:10 -06:00
pipeline.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
pool.dart feat: phase 1 ingestion harness + Phase 2 state-flow IR 2026-09-20 13:46:54 -06:00
project.dart fix(queries): resolve a subdirectory path to its enclosing package 2026-09-25 20:16:23 -06:00
provider_rules.dart fix(provider): count same-file reads for notifier-field-unread 2026-09-25 20:09:21 -06:00
recall.dart fix(cli): close the remaining rough edges in paths, recall and yams 2026-09-22 15:26:30 -06:00
rules.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
sdk.dart fix(sdk): refuse an unreadable SDK clearly, and fix the runtime fallback 2026-09-22 13:36:10 -06:00
state_flow.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
suggest.dart fix(suggest): drop "work them in this order" from the agent plan 2026-09-22 12:22:05 -06:00
verify.dart feat(verify): report a deleted subject as removed, not resolved 2026-09-24 20:04:52 -06:00