@cad0p/pi-steering 0.1.0 → 0.2.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 (69) hide show
  1. package/CHANGELOG.md +27 -4
  2. package/README.md +20 -6
  3. package/dist/__test-helpers__.d.ts +5 -4
  4. package/dist/__test-helpers__.d.ts.map +1 -1
  5. package/dist/__test-helpers__.js +5 -4
  6. package/dist/__test-helpers__.js.map +1 -1
  7. package/dist/bin/pi-steering.d.ts.map +1 -1
  8. package/dist/bin/pi-steering.js +22 -16
  9. package/dist/bin/pi-steering.js.map +1 -1
  10. package/dist/evaluator.d.ts +0 -41
  11. package/dist/evaluator.d.ts.map +1 -1
  12. package/dist/evaluator.js +42 -1
  13. package/dist/evaluator.js.map +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/internal/ref-text.d.ts.map +1 -1
  17. package/dist/internal/ref-text.js +1 -1
  18. package/dist/internal/ref-text.js.map +1 -1
  19. package/dist/internal/session-runtime.d.ts.map +1 -1
  20. package/dist/internal/session-runtime.js +3 -2
  21. package/dist/internal/session-runtime.js.map +1 -1
  22. package/dist/loader.d.ts +23 -18
  23. package/dist/loader.d.ts.map +1 -1
  24. package/dist/loader.js +91 -87
  25. package/dist/loader.js.map +1 -1
  26. package/dist/plugins/git/cwd-extensions.d.ts.map +1 -1
  27. package/dist/plugins/git/cwd-extensions.js.map +1 -1
  28. package/dist/schema.d.ts +4 -4
  29. package/dist/testing/index.d.ts +4 -5
  30. package/dist/testing/index.d.ts.map +1 -1
  31. package/dist/testing/index.js +4 -4
  32. package/dist/testing/index.js.map +1 -1
  33. package/examples/README.md +3 -3
  34. package/examples/combined-git-discipline/README.md +2 -2
  35. package/examples/combined-git-discipline/node_modules/.bin/pi-steering +16 -4
  36. package/examples/combined-git-discipline/package.json +16 -16
  37. package/examples/draft-prs-only/README.md +2 -2
  38. package/examples/draft-prs-only/node_modules/.bin/pi-steering +16 -4
  39. package/examples/draft-prs-only/package.json +16 -16
  40. package/examples/dynamic-reason-runtime-cwd/node_modules/.bin/pi-steering +16 -4
  41. package/examples/dynamic-reason-runtime-cwd/package.json +16 -16
  42. package/examples/dynamic-reason-runtime-cwd/steering.ts +5 -1
  43. package/examples/force-push-strict/README.md +1 -1
  44. package/examples/force-push-strict/node_modules/.bin/pi-steering +16 -4
  45. package/examples/force-push-strict/package.json +16 -16
  46. package/examples/no-amend/README.md +2 -2
  47. package/examples/no-amend/node_modules/.bin/pi-steering +16 -4
  48. package/examples/no-amend/package.json +16 -16
  49. package/examples/work-item-plugin/node_modules/.bin/pi-steering +16 -4
  50. package/examples/work-item-plugin/package.json +17 -17
  51. package/examples/work-item-plugin/src/observers/npm-test-tracker.ts +5 -1
  52. package/examples/work-item-plugin/src/observers/retest-required-tracker.ts +5 -1
  53. package/examples/work-item-plugin/src/rules/commit-requires-work-item.test.ts +5 -1
  54. package/package.json +2 -2
  55. package/src/__test-helpers__.ts +5 -4
  56. package/src/bin/pi-steering.test.ts +14 -4
  57. package/src/bin/pi-steering.ts +22 -16
  58. package/src/evaluator.ts +6 -6
  59. package/src/factory-time-load.test.ts +24 -18
  60. package/src/index.test.ts +4 -4
  61. package/src/index.ts +1 -1
  62. package/src/internal/ref-text.ts +5 -1
  63. package/src/internal/session-runtime.test.ts +2 -2
  64. package/src/internal/session-runtime.ts +3 -2
  65. package/src/loader.test.ts +226 -74
  66. package/src/loader.ts +99 -82
  67. package/src/plugins/git/cwd-extensions.ts +1 -1
  68. package/src/schema.ts +4 -4
  69. package/src/testing/index.ts +7 -7
@@ -82,8 +82,8 @@
82
82
  */
83
83
 
84
84
  import * as path from "node:path";
85
- import type { Word } from "unbash";
86
85
  import { isStaticallyResolvable, type Modifier } from "@cad0p/unbash-walker";
86
+ import type { Word } from "unbash";
87
87
 
88
88
  /** Regex matched against each `git`-command argument token. */
89
89
  const GIT_DIR_RE = /^--git-dir=(.+)$/;
package/src/schema.ts CHANGED
@@ -1631,8 +1631,8 @@ export interface SteeringConfig {
1631
1631
  * specify its own. Defaults to `true` (fail-closed - overrides
1632
1632
  * must be explicit opt-in per rule).
1633
1633
  *
1634
- * Walk-up merge: inner layer wins when specified; missing layer
1635
- * leaves the running value alone.
1634
+ * Layer merge: inner (project) layer wins when specified; missing
1635
+ * layer leaves the running value alone.
1636
1636
  *
1637
1637
  * `buildConfig` preserves `undefined` in the merged output so
1638
1638
  * downstream evaluators can distinguish "user didn't specify" from
@@ -1698,7 +1698,7 @@ export interface SteeringConfig {
1698
1698
  * to distinguish shape at a glance from the past-participle
1699
1699
  * {@link disabledRules} / {@link disabledPlugins} lists.
1700
1700
  *
1701
- * Walk-up merge: inner layer wins when specified.
1701
+ * Layer merge: inner (project) layer wins when specified.
1702
1702
  */
1703
1703
  disableDefaults?: boolean;
1704
1704
 
@@ -1714,7 +1714,7 @@ export interface SteeringConfig {
1714
1714
  * (e.g. tracker name collision, reserved name violation) — the
1715
1715
  * engine cannot operate safely with those issues present.
1716
1716
  *
1717
- * Walk-up merge: inner layer wins when specified, identical to
1717
+ * Layer merge: inner (project) layer wins when specified, identical to
1718
1718
  * {@link disableDefaults}.
1719
1719
  *
1720
1720
  * Prior art: Rollup's `failAfterWarnings`, Maven's `failOnWarning`.
@@ -12,9 +12,9 @@
12
12
  *
13
13
  * - {@link loadHarness} — build an evaluator + dispatcher
14
14
  * pair from a static
15
- * {@link SteeringConfig}. No walk-up
16
- * loading — tests pass explicit
17
- * config.
15
+ * {@link SteeringConfig}. No
16
+ * filesystem discovery — tests
17
+ * pass explicit config.
18
18
  * - {@link mockContext} — build a {@link PredicateContext}
19
19
  * for unit-testing predicate
20
20
  * handlers in isolation.
@@ -246,16 +246,16 @@ export interface LoadHarnessOptions {
246
246
  /**
247
247
  * Build an evaluator + observer dispatcher pair from a static
248
248
  * {@link SteeringConfig}. Tests drive rules through the same pipeline
249
- * production uses, without needing a pi runtime stub or walk-up
250
- * loading.
249
+ * production uses, without filesystem discovery.
251
250
  */
252
251
  export function loadHarness(options: LoadHarnessOptions): Harness {
253
252
  const inputConfig = options.config;
254
253
  const includeDefaults = options.includeDefaults ?? false;
255
254
 
256
255
  // Run the same merge that production does (single layer here, since
257
- // loadHarness operates on an in-memory config rather than a walk-up
258
- // chain). The shared helper short-circuits between buildConfig and
256
+ // loadHarness operates on an in-memory config rather than a
257
+ // filesystem discovery chain). The shared helper short-circuits
258
+ // between buildConfig and
259
259
  // resolvePlugins on error-class merge diagnostics so a
260
260
  // `tracker-name-collision` flagged by `buildConfig` is not also
261
261
  // re-flagged by `resolvePlugins`. The diagnostics surface within-