pi-usereq 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.gitignore +3 -0
  2. package/CHANGELOG.md +31 -0
  3. package/README.md +1 -1
  4. package/package.json +1 -1
  5. package/{req → pi-usereq}/docs/REFERENCES.md +196 -159
  6. package/{req → pi-usereq}/docs/REQUIREMENTS.md +65 -44
  7. package/{req → pi-usereq}/docs/WORKFLOW.md +66 -73
  8. package/src/core/config.ts +39 -12
  9. package/src/core/extension-status.ts +94 -58
  10. package/src/core/pi-notify.ts +198 -11
  11. package/src/core/runtime-project-paths.ts +3 -32
  12. package/src/core/settings-menu.ts +9 -4
  13. package/src/core/static-check.ts +35 -171
  14. package/src/index.ts +281 -86
  15. package/tests/attended-results-scenarios.ts +3 -13
  16. package/tests/cli-command-option-parity.test.ts +21 -12
  17. package/tests/debug-extension-harness.test.ts +11 -7
  18. package/tests/extension-registration.test.ts +371 -71
  19. package/tests/oracle-project.test.ts +8 -3
  20. package/tests/oracle-standalone.test.ts +7 -13
  21. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_c.c.json +0 -5
  22. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_cpp.cpp.json +0 -5
  23. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_csharp.cs.json +0 -5
  24. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_elixir.ex.json +0 -5
  25. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_go.go.json +0 -5
  26. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_haskell.hs.json +0 -5
  27. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_java.java.json +0 -5
  28. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_javascript.js.json +0 -5
  29. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_kotlin.kt.json +0 -5
  30. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_lua.lua.json +0 -5
  31. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_perl.pl.json +0 -5
  32. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_php.php.json +0 -5
  33. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_python.py.json +0 -5
  34. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_ruby.rb.json +0 -5
  35. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_rust.rs.json +0 -5
  36. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_scala.scala.json +0 -5
  37. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_shell.sh.json +0 -5
  38. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_swift.swift.json +0 -5
  39. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_typescript.ts.json +0 -5
  40. package/tests/fixtures_attended_results/standalone/test-static-check-pylance/fixture_zig.zig.json +0 -5
  41. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_c.c.json +0 -5
  42. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_cpp.cpp.json +0 -5
  43. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_csharp.cs.json +0 -5
  44. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_elixir.ex.json +0 -5
  45. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_go.go.json +0 -5
  46. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_haskell.hs.json +0 -5
  47. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_java.java.json +0 -5
  48. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_javascript.js.json +0 -5
  49. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_kotlin.kt.json +0 -5
  50. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_lua.lua.json +0 -5
  51. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_perl.pl.json +0 -5
  52. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_php.php.json +0 -5
  53. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_python.py.json +0 -5
  54. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_ruby.rb.json +0 -5
  55. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_rust.rs.json +0 -5
  56. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_scala.scala.json +0 -5
  57. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_shell.sh.json +0 -5
  58. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_swift.swift.json +0 -5
  59. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_typescript.ts.json +0 -5
  60. package/tests/fixtures_attended_results/standalone/test-static-check-ruff/fixture_zig.zig.json +0 -5
@@ -583,6 +583,14 @@ const TARGET_CASES: TargetParityCase[] = [
583
583
  assert.equal(result.status, 1);
584
584
  assert.match(result.stderr, /not an executable program/);
585
585
  assert.ok(!fs.existsSync(getProjectConfigPath(projectBase)));
586
+
587
+ const removedModule = runNodeCli(
588
+ ["--base", projectBase, "--enable-static-check", "Python=Ruff"],
589
+ projectBase,
590
+ );
591
+ assert.equal(removedModule.status, 1);
592
+ assert.match(removedModule.stderr, /unknown module/i);
593
+ assert.ok(!fs.existsSync(getProjectConfigPath(projectBase)));
586
594
  },
587
595
  },
588
596
  {
@@ -594,16 +602,19 @@ const TARGET_CASES: TargetParityCase[] = [
594
602
  "--base",
595
603
  projectBase,
596
604
  "--enable-static-check",
597
- "Python=Pylance",
605
+ "Python=Command,git,--version",
598
606
  "--enable-static-check",
599
607
  "C=Command,git,--version",
600
608
  "--enable-static-check",
601
- "Python=Ruff",
609
+ "Python=Command,git,--help",
602
610
  ],
603
611
  projectBase,
604
612
  );
605
613
  assert.equal(persisted.status, 0, persisted.stderr);
606
- assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [{ module: "Pylance" }, { module: "Ruff" }]);
614
+ assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [
615
+ { module: "Command", cmd: "git", params: ["--version"] },
616
+ { module: "Command", cmd: "git", params: ["--help"] },
617
+ ]);
607
618
  assert.deepEqual(getStaticCheckEntries(projectBase, "C"), [{ module: "Command", cmd: "git", params: ["--version"] }]);
608
619
  },
609
620
  },
@@ -616,9 +627,9 @@ const TARGET_CASES: TargetParityCase[] = [
616
627
  "--base",
617
628
  projectBase,
618
629
  "--enable-static-check",
619
- "Python=Ruff",
630
+ "Python=Command,git,--version",
620
631
  "--enable-static-check",
621
- "Python=Ruff",
632
+ "Python=Command,git,--version",
622
633
  "--enable-static-check",
623
634
  "C=Command,git,--version",
624
635
  "--enable-static-check",
@@ -627,7 +638,7 @@ const TARGET_CASES: TargetParityCase[] = [
627
638
  projectBase,
628
639
  );
629
640
  assert.equal(result.status, 0, result.stderr);
630
- assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [{ module: "Ruff" }]);
641
+ assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [{ module: "Command", cmd: "git", params: ["--version"] }]);
631
642
  assert.deepEqual(getStaticCheckEntries(projectBase, "C"), [
632
643
  { module: "Command", cmd: "git", params: ["--version"] },
633
644
  { module: "Command", cmd: "git", params: ["--help"] },
@@ -641,7 +652,7 @@ const TARGET_CASES: TargetParityCase[] = [
641
652
  const preloaded = {
642
653
  ...config,
643
654
  "static-check": {
644
- Python: [{ module: "Pylance", meta: "legacy-note" } as unknown as Record<string, unknown>],
655
+ Python: [{ module: "Dummy", meta: "debug-note" } as unknown as Record<string, unknown>],
645
656
  JavaScript: [{ module: "Command", cmd: "git", params: ["--version"] }],
646
657
  } as unknown as UseReqConfig["static-check"],
647
658
  } as UseReqConfig;
@@ -651,9 +662,7 @@ const TARGET_CASES: TargetParityCase[] = [
651
662
  "--base",
652
663
  projectBase,
653
664
  "--enable-static-check",
654
- "Python=Pylance",
655
- "--enable-static-check",
656
- "Python=Ruff",
665
+ "Python=Command,git,--version",
657
666
  "--enable-static-check",
658
667
  "JavaScript=Command,git,--help",
659
668
  ],
@@ -661,8 +670,8 @@ const TARGET_CASES: TargetParityCase[] = [
661
670
  );
662
671
  assert.equal(result.status, 0, result.stderr);
663
672
  assert.deepEqual(getStaticCheckEntries(projectBase, "Python"), [
664
- { module: "Pylance", meta: "legacy-note" },
665
- { module: "Ruff" },
673
+ { module: "Dummy" },
674
+ { module: "Command", cmd: "git", params: ["--version"] },
666
675
  ]);
667
676
  assert.deepEqual(getStaticCheckEntries(projectBase, "JavaScript"), [
668
677
  { module: "Command", cmd: "git", params: ["--version"] },
@@ -246,18 +246,21 @@ test("replaySessionStart captures active tools, statuses, and cwd semantics", as
246
246
  assert.deepEqual([...report.activeTools].sort(), ["git-path", "static-check"]);
247
247
  assert.equal(report.effectiveCtxCwd, projectBase);
248
248
  assert.equal(report.effectiveProcessCwd, projectBase);
249
- assert.match(
250
- status,
251
- /<accent>git:<\/accent><warning>.*<\/warning><dim> • <\/dim><accent>base:<\/accent><warning>\.<\/warning><dim> • <\/dim><accent>docs:<\/accent><warning>pi-usereq\/docs<\/warning><dim> • <\/dim><accent>tests:<\/accent><warning>tests<\/warning><dim> • <\/dim><accent>src:<\/accent><warning>src<\/warning><dim> • <\/dim><accent>tools:<\/accent><warning>2<\/warning>/,
249
+ const normalizedBasePath = projectBase.split(path.sep).join("/");
250
+ assert.ok(
251
+ status.includes(
252
+ `<accent>base:</accent><warning>${normalizedBasePath}</warning><dim> • </dim><accent>docs:</accent><warning>pi-usereq/docs</warning><dim> • </dim><accent>src:</accent><warning>src</warning><dim> • </dim><accent>tests:</accent><warning>tests</warning>`,
253
+ ),
252
254
  );
253
255
  assert.match(
254
256
  status,
255
257
  /<accent>context:<\/accent><bg-from-fg-accent><warning>CLEAR<\/warning><\/bg-from-fg-accent>/,
256
258
  );
257
- assert.match(status, /<accent>elapsed:<\/accent><warning>idle<\/warning>/);
258
- assert.match(status, /<accent>last:<\/accent><warning>N\/A<\/warning>/);
259
- assert.match(status, /<accent>beep:<\/accent><warning>none<\/warning>/);
259
+ assert.match(status, /<accent>et:<\/accent><warning>▶idle,↻--:--,Σ--:--<\/warning>/);
260
+ assert.match(status, /<accent>beep:<\/accent><warning>end,esc,err<\/warning>/);
260
261
  assert.match(status, /<accent>sound:<\/accent><warning>none<\/warning>/);
262
+ assert.doesNotMatch(status, /<accent>git:<\/accent>/);
263
+ assert.doesNotMatch(status, /<accent>tools:<\/accent>/);
261
264
  assert.equal(report.ui.notifications.length, 0);
262
265
  } finally {
263
266
  fs.rmSync(projectBase, { recursive: true, force: true });
@@ -294,7 +297,8 @@ test("replayCommand captures interactive UI side effects", async () => {
294
297
 
295
298
  assert.deepEqual(report.activeTools, []);
296
299
  assert.ok(report.ui.notifications.some((entry) => entry.message === "Disabled all configurable active tools"));
297
- assert.match(report.ui.statuses["pi-usereq"] ?? "", /<accent>tools:<\/accent><warning>0<\/warning>/);
300
+ assert.doesNotMatch(report.ui.statuses["pi-usereq"] ?? "", /<accent>tools:<\/accent>/);
301
+ assert.match(report.ui.statuses["pi-usereq"] ?? "", /<accent>et:<\/accent><warning>▶idle,↻--:--,Σ--:--<\/warning>/);
298
302
  } finally {
299
303
  fs.rmSync(projectBase, { recursive: true, force: true });
300
304
  }