pi-aia-asf 0.17.3 → 0.17.5

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 (57) hide show
  1. package/CHANGELOG.md +89 -5
  2. package/index.ts +18 -1574
  3. package/lib/code-health/config.mjs +70 -62
  4. package/lib/code-health/detect.mjs +99 -81
  5. package/lib/code-health/eslint-run.mjs +156 -0
  6. package/lib/code-health/exec.mjs +26 -0
  7. package/lib/code-health/files.mjs +14 -8
  8. package/lib/code-health/index.mjs +1 -1
  9. package/lib/code-health/model-patterns.mjs +129 -0
  10. package/lib/code-health/model-scan.mjs +58 -0
  11. package/lib/code-health/model.mjs +105 -240
  12. package/lib/code-health/report.mjs +33 -30
  13. package/lib/code-health/run.mjs +12 -150
  14. package/lib/code-health/tools.mjs +60 -59
  15. package/lib/extension/commands/index.ts +61 -0
  16. package/lib/extension/commands/inspect.ts +125 -0
  17. package/lib/extension/commands/run-control.ts +58 -0
  18. package/lib/extension/commands/session.ts +85 -0
  19. package/lib/extension/commands/verify.ts +109 -0
  20. package/lib/extension/deps.ts +77 -0
  21. package/lib/extension/evidence.ts +51 -0
  22. package/lib/extension/gate-state.ts +71 -0
  23. package/lib/extension/handlers/lifecycle.ts +125 -0
  24. package/lib/extension/handlers/settle.ts +219 -0
  25. package/lib/extension/handlers/tool-call.ts +239 -0
  26. package/lib/extension/handlers/tool-result.ts +59 -0
  27. package/lib/extension/paths.ts +58 -0
  28. package/lib/extension/pi-ref.ts +18 -0
  29. package/lib/extension/run.ts +137 -0
  30. package/lib/extension/runtime.ts +59 -0
  31. package/lib/extension/specs.ts +77 -0
  32. package/lib/extension/state.ts +164 -0
  33. package/lib/extension/steer.ts +46 -0
  34. package/lib/extension/tools/health.ts +87 -0
  35. package/lib/extension/types.ts +93 -0
  36. package/lib/gates/authority.d.mts +6 -6
  37. package/lib/gates/authority.mjs +78 -73
  38. package/lib/gates/blockers.d.mts +1 -2
  39. package/lib/gates/blockers.mjs +80 -108
  40. package/lib/gates/config.mjs +80 -59
  41. package/lib/gates/declarations.mjs +61 -54
  42. package/lib/gates/defaults.mjs +79 -309
  43. package/lib/gates/drift.mjs +76 -43
  44. package/lib/gates/ledger.d.mts +3 -16
  45. package/lib/gates/ledger.mjs +58 -160
  46. package/lib/gates/math.mjs +9 -0
  47. package/lib/gates/params.mjs +242 -0
  48. package/lib/gates/refusals.d.mts +12 -0
  49. package/lib/gates/refusals.mjs +66 -0
  50. package/lib/gates/settle.mjs +81 -72
  51. package/lib/gates/suite-runs.d.mts +31 -0
  52. package/lib/gates/suite-runs.mjs +119 -0
  53. package/lib/parallel-estimate.mjs +85 -56
  54. package/lib/review.mjs +39 -36
  55. package/lib/run-card.mjs +25 -18
  56. package/lib/skill-budget.mjs +35 -19
  57. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,13 +7,97 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [0.17.3] - 2026-11-07
11
-
12
- ### Added
10
+ ## [0.17.5] - 2026-11-08
11
+
12
+ ### Fixed — the publish floor could be satisfied by a green that proved nothing
13
+
14
+ `push-without-recorded-green` asked for "a recorded full-suite green run in this
15
+ session" and accepted **any** green: a run from before the last edit, or a green
16
+ from earlier in the session that a red had since overtaken. It also disagreed
17
+ with the completion floor, which already required a passing run *started after
18
+ the last source change* — so the two ASF floors had different ideas about what
19
+ "green" means, and the weaker one guarded the only irreversible action.
20
+
21
+ The floor is now the same rule in both places: the **last** full run, green, and
22
+ started after the last source mutation. Passive mode keeps it — "no steering"
23
+ suspends guidance, not the irreversibility floor. The refusal now names which
24
+ condition failed (`no full-suite run recorded` / `the last full suite run exited
25
+ 1` / `the last full-suite green predates the most recent source change`), so the
26
+ autonomous exit is the specific action that closes it.
27
+
28
+ New assertions drive the real `tool_call`/`tool_result` pair rather than a
29
+ hand-built context, which is what pins the *recorder*: a floor whose demanded
30
+ action does not actually close it is the 2026-11-07 bug class, and the previous
31
+ tests could not see that path at all. Six mutations of the new guards (accept a
32
+ red, accept a stale green, take the oldest full run, drop the mutation clock,
33
+ never record the run, never set the clock) each fail at least one test.
34
+
35
+ ### Changed — two modules split to stay inside the limit ASF enforces
36
+
37
+ `lib/gates/ledger.mjs` (327 lines) and `lib/gates/blockers.mjs` (301) crossed the
38
+ 300-line file limit, so the two halves that changed for different reasons were
39
+ separated: `lib/gates/suite-runs.mjs` (suite-run recognition and the green-run
40
+ rule) and `lib/gates/refusals.mjs` (the refusal ladder and its per-rule text).
41
+ Both are imported explicitly — no re-export shim with two ways to reach one
42
+ function.
43
+
44
+ ### Removed — `deriveHealthRun`
45
+
46
+ It recognised a health run by matching `/asf health` in a command's text, which
47
+ is the class of bug that produced the endless loop of 2026-11-07: a human slash
48
+ command the agent has no tool for. The `asf_health` tool appends the `health-run`
49
+ ledger entry directly, so nothing called it and nothing tested it.
50
+
51
+ ## [0.17.4] - 2026-11-07
52
+
53
+ ### Changed — ASF now passes its own health gate, and the gate measures the right tree
54
+
55
+ ASF demanded code health of every project and did not meet it itself: 74
56
+ violations across `index.ts` and `lib/`. This release is that debt paid, and two
57
+ real defects the work exposed.
58
+
59
+ - `index.ts` is 37 lines of wiring. The extension lives in `lib/extension/`
60
+ (`commands/`, `tools/`, `handlers/`, plus state, specs, evidence, steer, run),
61
+ so no single file is the whole extension any more.
62
+ - `lib/gates/`: the parameter table moved to `params.mjs` (the table reads as a
63
+ table), `clamp`/`round2` to `math.mjs` (the table's calibrations use them, and
64
+ importing them from the resolver was a cycle), `ledger.mjs`/`drift.mjs`/
65
+ `settle.mjs`/`blockers.mjs`/`config.mjs`/`declarations.mjs`/`authority.mjs`
66
+ decomposed into named pieces instead of one long function each.
67
+ - `lib/code-health/`: `model-scan.mjs` (file selection and I/O), `model-patterns.mjs`
68
+ (the pattern tables), `eslint-run.mjs` (config generation and counting),
69
+ `exec.mjs` (the bounded spawn).
70
+ - Functions that took four or more positional arguments now take one options
71
+ object (`deriveSuiteRun`, `deriveHealthRun`, `transition`, `evaluateBlockers`,
72
+ `planMetrics`, `walk`, `resolveParam`'s resolvers, `runBlocker`).
73
+
74
+ ### Fixed — the gate wrote into the repo it was measuring
75
+
76
+ `jscpd`'s report went to `<project>/.asf-code-health-tmp`, which dirtied the
77
+ measured tree (it tripped ASF's own dirty-tree guards) and shipped a committed
78
+ temp file. It now writes to a `mktemp`-style directory under the OS temp root and
79
+ removes it. A test asserts the `--output` path is outside the project and that
80
+ the directory is gone afterwards.
81
+
82
+ ### Fixed — `asf_health` measured the session's cwd, not the run's project
83
+
84
+ A session started in `$HOME` measured the whole home directory: 960 "handwritten
85
+ cascade" findings from `site-packages`, and a fail verdict on a healthy repo.
86
+ Every consumer of "the project" (the health tool, `/asf health`, `/asf verify`,
87
+ `/asf config`, the project config read, the git-dirty probe, `PLAN.md`, spec
88
+ traces) now goes through `runRoot()` — the git work-tree root — instead of
89
+ `process.cwd()`. A test fails if any extension module measures
90
+ `process.cwd()` as the project.
91
+
92
+ ### Fixed — the tests stopped covering half the extension
93
+
94
+ The text-assertion helpers in `test-operator-surface.mjs`, `test-browser-touched.mjs`
95
+ and `test-model-gate.mjs` read `lib/extension/*.ts` non-recursively, so after the
96
+ split the `commands/`, `tools/` and `handlers/` modules were outside every text
97
+ assertion. They read recursively now.
13
98
 
14
- - (describe changes for 0.17.3)
15
99
 
16
- ## [0.17.2] - 2026-11-07
100
+ ## [0.17.3] - 2026-11-07
17
101
 
18
102
  ### Fixed — the tools were installed but never found
19
103