pipe/test
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
..
fixtures merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
baseline_test.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
cli_edges_test.dart fix(baseline): record the project root relative to the baseline file 2026-09-22 15:30:46 -06:00
cli_options_test.dart feat(queries): inventory firestore query surfaces as typed records 2026-09-23 18:03:09 -06:00
cpp_front_test.dart fix(cpp-front): discover libclang on Linux, not only on Homebrew macOS 2026-09-24 19:54:23 -06:00
excerpt_test.dart fix(guide): quote analysed source as bounded, delimited data 2026-09-22 12:05:12 -06:00
excluded_files_test.dart chore: apply dart format to the files this branch changed 2026-09-22 12:22:02 -06:00
field_unread_scope_test.dart fix(provider): count same-file reads for notifier-field-unread 2026-09-25 20:09:21 -06:00
fingerprint_test.dart fix(baseline): make every fingerprint independent of position 2026-09-22 13:47:40 -06:00
firestore_queries_test.dart fix(queries): resolve a subdirectory path to its enclosing package 2026-09-25 20:16:23 -06:00
flag_state_test.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
guide_test.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
model_cli_test.dart feat(check): run the rules on a state model written by any front end 2026-09-22 14:31:03 -06:00
package_target_test.dart fix(queries): resolve a subdirectory path to its enclosing package 2026-09-25 20:16:23 -06:00
policy_test.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
project_scan_test.dart fix(cli): reject a missing --dir and report filesystem errors cleanly 2026-09-22 12:05:12 -06:00
provider_note_test.dart fix(providers): drop the dangling "by type" clause when there are no declarations 2026-09-20 21:34:42 -06:00
recall_test.dart style: apply dart format to the two tests added in 4c65166 2026-09-20 21:59:32 -06:00
riverpod_test.dart merge: bring main into the audit and state-map work 2026-09-24 07:33:53 -06:00
rule_contract_test.dart fix(riverpod): recognise AsyncError patterns and follow stored values 2026-09-22 13:45:11 -06:00
rule_scope_claim_test.dart fix(cli): reject a missing --dir and report filesystem errors cleanly 2026-09-22 12:05:12 -06:00
sdk_test.dart fix(sdk): refuse an unreadable SDK clearly, and fix the runtime fallback 2026-09-22 13:36:10 -06:00
sdk_unreadable_test.dart fix(analysis): report an unreadable SDK cleanly instead of crashing 2026-09-22 12:22:03 -06:00
state_flow_test.dart refactor(rules): provider rules judge facts; runChecks takes only the model 2026-09-22 14:23:39 -06:00
state_map_roundtrip_test.dart feat(check): run the rules on a state model written by any front end 2026-09-22 14:31:03 -06:00
stdout_json_test.dart fix(cli): keep status messages off stdout so JSON output stays parseable 2026-09-22 11:58:20 -06:00
subset_scan_test.dart fix(cli): refuse subset baselines and scope verify to --rule 2026-09-22 13:30:41 -06:00
suggest_test.dart test(suggest): match the judgement label the scorer prints 2026-09-22 12:22:04 -06:00
unreadable_test.dart fix(cli): refuse subset baselines and scope verify to --rule 2026-09-22 13:30:41 -06:00
unresolved_test.dart fix(check): lower confidence where unresolved code can hide evidence 2026-09-22 14:04:32 -06:00
verify_default_baseline_test.dart feat(verify): default --baseline to <path>/.pipe-baseline.json 2026-09-25 20:11:34 -06:00
verify_removed_test.dart feat(verify): report a deleted subject as removed, not resolved 2026-09-24 20:04:52 -06:00
verify_test.dart feat(verify): report a deleted subject as removed, not resolved 2026-09-24 20:04:52 -06:00