pi-harness-runtime 1.1.482 → 1.1.484

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 (54) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/harness/auto-quota-resume.ts +33 -3
  3. package/harness/glm-quota-countdown.ts +23 -1
  4. package/harness/pending-actions.ts +408 -0
  5. package/harness/provider-failure.ts +344 -0
  6. package/harness/provider-recovery.ts +351 -0
  7. package/index.ts +471 -0
  8. package/package.json +1 -1
  9. package/packages/agent-policy/package.json +1 -1
  10. package/packages/auth/package.json +1 -1
  11. package/packages/autonomous-runtime/package.json +1 -1
  12. package/packages/checkpoint/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/codex-watcher/package.json +1 -1
  15. package/packages/config-capture/package.json +1 -1
  16. package/packages/contracts/package.json +1 -1
  17. package/packages/cookie-sanitizer/package.json +1 -1
  18. package/packages/evaluation-engine/package.json +1 -1
  19. package/packages/event-bus/package.json +1 -1
  20. package/packages/event-store/package.json +1 -1
  21. package/packages/experience-replay/package.json +1 -1
  22. package/packages/file-copy-helper/package.json +1 -1
  23. package/packages/intent-analyzer/package.json +1 -1
  24. package/packages/jev-judge/package.json +1 -1
  25. package/packages/knowledge-retrieval/package.json +1 -1
  26. package/packages/learning-engine/package.json +1 -1
  27. package/packages/logging/package.json +1 -1
  28. package/packages/memory-engine/package.json +1 -1
  29. package/packages/notification/package.json +1 -1
  30. package/packages/paperclip-integration/package.json +1 -1
  31. package/packages/performance-optimizer/package.json +1 -1
  32. package/packages/privilege-broker/package.json +1 -1
  33. package/packages/prompt-compiler/package.json +1 -1
  34. package/packages/providers/package.json +1 -1
  35. package/packages/qdrant-skills/package.json +1 -1
  36. package/packages/quota-manager/package.json +1 -1
  37. package/packages/relay/package.json +1 -1
  38. package/packages/skill-mcp-client/package.json +1 -1
  39. package/packages/skills/package.json +1 -1
  40. package/packages/todo-bd-sync/package.json +1 -1
  41. package/packages/token-estimation/package.json +1 -1
  42. package/packages/tooling-preference/package.json +1 -1
  43. package/packages/trajectory/package.json +1 -1
  44. package/packages/tui/dist/harness-footer.d.ts +10 -0
  45. package/packages/tui/dist/harness-footer.d.ts.map +1 -1
  46. package/packages/tui/dist/harness-footer.js +16 -1
  47. package/packages/tui/dist/harness-footer.js.map +1 -1
  48. package/packages/tui/package.json +1 -1
  49. package/packages/tui/src/harness-footer.ts +18 -1
  50. package/packages/two-phase-review/package.json +1 -1
  51. package/packages/types/package.json +1 -1
  52. package/packages/webmcp-tester/package.json +1 -1
  53. package/packages/wiki/package.json +1 -1
  54. package/packages/write-review/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,127 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.484](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.484) (2026-11-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * **actions:** register the job resume, the GLM countdown and the queued continuations ([177c964](https://github.com/ManotLuijiu/pi-harness-runtime/commit/177c964555b0057e6bc7d293dafab10c95eabbf9))
11
+ * **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
12
+ * **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
13
+ * **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
14
+ * **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
15
+ * **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
16
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
17
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
18
+ * **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
19
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
20
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
21
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
22
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
23
+ * **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
24
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
25
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
26
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
27
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
28
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
29
+ * **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
35
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
36
+ * **honcho:** a probe that the end of the session cuts off is not a failure ([493fd93](https://github.com/ManotLuijiu/pi-harness-runtime/commit/493fd938ba09fdcf57bed4aaf259d81c4040909e))
37
+ * **honcho:** a tools listing that the end of the session cuts off is not a failure ([62cc8c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/62cc8c376aade01c953ce2a1c6501ed07b74a1e9))
38
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
39
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
40
+ * **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
41
+ * **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
42
+ * **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
43
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
44
+ * **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
45
+ * **jev:** the action of the question on its own text, and a reply is not an authorization ([7c3fdd6](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7c3fdd6822b58bd6ccfa3bcdf1c5282cb3db52dd))
46
+ * **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
47
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
48
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
49
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
50
+ * **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
51
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
52
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
53
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
54
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
55
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
56
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
57
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
58
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
59
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
60
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
61
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
62
+ * **workspace:** a strong bench signal decides, and the question is not a fact of an option ([303a828](https://github.com/ManotLuijiu/pi-harness-runtime/commit/303a828f55aa7c4e0a611231f482489b530ff5a3))
63
+ * **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
64
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
65
+
66
+ ### [1.1.483](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.483) (2026-11-09)
67
+
68
+
69
+ ### Features
70
+
71
+ * **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
72
+ * **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
73
+ * **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
74
+ * **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
75
+ * **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
76
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
77
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
78
+ * **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
79
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
80
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
81
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
82
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
83
+ * **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
84
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
85
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
86
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
87
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
88
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
89
+ * **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
95
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
96
+ * **honcho:** a probe that the end of the session cuts off is not a failure ([493fd93](https://github.com/ManotLuijiu/pi-harness-runtime/commit/493fd938ba09fdcf57bed4aaf259d81c4040909e))
97
+ * **honcho:** a tools listing that the end of the session cuts off is not a failure ([62cc8c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/62cc8c376aade01c953ce2a1c6501ed07b74a1e9))
98
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
99
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
100
+ * **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
101
+ * **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
102
+ * **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
103
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
104
+ * **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
105
+ * **jev:** the action of the question on its own text, and a reply is not an authorization ([7c3fdd6](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7c3fdd6822b58bd6ccfa3bcdf1c5282cb3db52dd))
106
+ * **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
107
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
108
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
109
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
110
+ * **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
111
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
112
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
113
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
114
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
115
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
116
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
117
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
118
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
119
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
120
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
121
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
122
+ * **workspace:** a strong bench signal decides, and the question is not a fact of an option ([303a828](https://github.com/ManotLuijiu/pi-harness-runtime/commit/303a828f55aa7c4e0a611231f482489b530ff5a3))
123
+ * **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
124
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
125
+
5
126
  ### [1.1.482](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.482) (2026-11-08)
6
127
 
7
128
 
@@ -25,9 +25,32 @@ const MIN_RESUME_DELAY_MS = 5_000; // 5 seconds
25
25
  /** Map of jobId → active auto-resume timer handle. */
26
26
  const activeTimers = new Map<
27
27
  string,
28
- { timeout: ReturnType<typeof setTimeout>; resumeAt: number }
28
+ {
29
+ timeout: ReturnType<typeof setTimeout>;
30
+ resumeAt: number;
31
+ provider: string;
32
+ observer?: AutoQuotaResumeObserver;
33
+ }
29
34
  >();
30
35
 
36
+ /**
37
+ * The observer of the scheduled resumes.
38
+ *
39
+ * The module stays independent of the status display: it reports the
40
+ * deadline it scheduled and the moment the pending resume ended, and the
41
+ * caller decides how to show it.
42
+ */
43
+ export interface AutoQuotaResumeObserver {
44
+ /** A resume was scheduled for that deadline. */
45
+ scheduled(jobId: string, provider: string, resumeAt: number): void;
46
+ /**
47
+ * The pending resume of that job ended.
48
+ *
49
+ * It ran, or it was cancelled. Either way there is no countdown left.
50
+ */
51
+ ended(jobId: string, provider: string): void;
52
+ }
53
+
31
54
  /**
32
55
  * Schedule an auto-resume for a job that was paused due to quota exhaustion.
33
56
  *
@@ -42,6 +65,7 @@ export function scheduleAutoResume(
42
65
  provider: string,
43
66
  machine: JobStateMachine,
44
67
  mirrorStore: MirrorStore,
68
+ observer?: AutoQuotaResumeObserver,
45
69
  ): string | null {
46
70
  const jobId = machine.getCheckpoint()?.jobId;
47
71
  if (!jobId) return null;
@@ -75,6 +99,9 @@ export function scheduleAutoResume(
75
99
 
76
100
  const timeout = setTimeout(async () => {
77
101
  activeTimers.delete(jobId);
102
+ // The pending resume is over: there is no countdown left, not even
103
+ // when the quota is still exhausted and the resume moves.
104
+ observer?.ended(jobId, provider);
78
105
 
79
106
  const checkpoint = machine.getCheckpoint();
80
107
  if (!checkpoint || checkpoint.status !== "paused_quota") {
@@ -91,7 +118,7 @@ export function scheduleAutoResume(
91
118
  // `[auto-quota-resume] ${provider} still exhausted at scheduled time.` +
92
119
  // ` Re-scheduling...`,
93
120
  // );
94
- scheduleAutoResume(provider, machine, mirrorStore);
121
+ scheduleAutoResume(provider, machine, mirrorStore, observer);
95
122
  return;
96
123
  }
97
124
  }
@@ -108,7 +135,8 @@ export function scheduleAutoResume(
108
135
  }
109
136
  }, delayMs);
110
137
 
111
- activeTimers.set(jobId, { timeout, resumeAt });
138
+ activeTimers.set(jobId, { timeout, resumeAt, provider, observer });
139
+ observer?.scheduled(jobId, provider, resumeAt);
112
140
  return resumeAtIso;
113
141
  }
114
142
 
@@ -121,6 +149,8 @@ export function cancelAutoResume(jobId: string): void {
121
149
  if (existing) {
122
150
  clearTimeout(existing.timeout);
123
151
  activeTimers.delete(jobId);
152
+ // The pending resume is cancelled: the countdown leaves with it.
153
+ existing.observer?.ended(jobId, existing.provider);
124
154
  }
125
155
  }
126
156
 
@@ -171,6 +171,7 @@ export class GLMQuotaCountdown {
171
171
  private activeCountdowns: Map<string, GLMQuotaCountdownState> = new Map();
172
172
  private timers: Map<string, NodeJS.Timeout> = new Map();
173
173
  private tickCallbacks: Set<CountdownCallback> = new Set();
174
+ private endCallbacks: Set<(jobId: string) => void> = new Set();
174
175
  private notificationCenter: NotificationCenter | null = null;
175
176
  private jobContext: { jobId: string; requirement: string } | null = null;
176
177
 
@@ -196,6 +197,18 @@ export class GLMQuotaCountdown {
196
197
  return () => this.tickCallbacks.delete(callback);
197
198
  }
198
199
 
200
+ /**
201
+ * Register a callback that runs when a countdown ends.
202
+ *
203
+ * A countdown ends when it reaches the reset, and when it is
204
+ * cancelled. The caller uses it to drop the row of the countdown: a
205
+ * countdown that is over must not stay at 00:00.
206
+ */
207
+ onEnd(callback: (jobId: string) => void): () => void {
208
+ this.endCallbacks.add(callback);
209
+ return () => this.endCallbacks.delete(callback);
210
+ }
211
+
199
212
  /**
200
213
  * Check if there's an active countdown for a job
201
214
  */
@@ -295,8 +308,17 @@ export class GLMQuotaCountdown {
295
308
  clearTimeout(existingTimer);
296
309
  this.timers.delete(jobId);
297
310
  }
298
- this.activeCountdowns.delete(jobId);
311
+ const resumeTimer = this.timers.get(`${jobId}:resume`);
312
+ if (resumeTimer) {
313
+ clearTimeout(resumeTimer);
314
+ this.timers.delete(`${jobId}:resume`);
315
+ }
316
+ const had = this.activeCountdowns.delete(jobId);
299
317
  logCountdownCancelled(jobId);
318
+ // The countdown is over: the row of the countdown leaves with it.
319
+ if (had) {
320
+ for (const callback of [...this.endCallbacks]) callback(jobId);
321
+ }
300
322
  }
301
323
 
302
324
  /**
@@ -0,0 +1,408 @@
1
+ /**
2
+ * The pending automatic actions of a session.
3
+ *
4
+ * Every automatic action of the harness - a resume, a retry, a quota check,
5
+ * the decision of the judge - has one owner, and that owner schedules the
6
+ * action. This registry is the shared view of those actions: it holds what
7
+ * is pending, it renders it truthfully, and it never schedules anything
8
+ * itself.
9
+ *
10
+ * The rules of the registry:
11
+ *
12
+ * - The executor stays the owner of the execution. It registers the exact
13
+ * deadline it scheduled, updates the entry when it reschedules, and
14
+ * removes it when the action was cancelled, fired, completed or blocked.
15
+ * - The renderer observes. A tick draws a row; it never dispatches an
16
+ * action, never sends a message and never notifies a channel.
17
+ * - A row never claims a deadline that does not exist. An action without a
18
+ * known deadline shows its real state (queued, running, blocked) instead
19
+ * of an invented countdown.
20
+ */
21
+
22
+ /** What an automatic action does. */
23
+ export type PendingActionKind =
24
+ | "resume"
25
+ | "retry"
26
+ | "quota-check"
27
+ | "jev-decision";
28
+
29
+ /** Where an automatic action stands. */
30
+ export type PendingActionState =
31
+ /** The action is scheduled for a known deadline. */
32
+ | "scheduled"
33
+ /** The action is ready to run, but nothing runs it yet. */
34
+ | "queued"
35
+ /** The action runs right now. */
36
+ | "running"
37
+ /** The action cannot run, and nothing retries it. */
38
+ | "blocked";
39
+
40
+ /**
41
+ * One pending automatic action.
42
+ */
43
+ export interface PendingAction {
44
+ /** The identity of the action. It is unique in the registry. */
45
+ id: string;
46
+ /** The Pi session the action belongs to. */
47
+ sessionId: string;
48
+ /** The owner of the action: the code that scheduled it. */
49
+ owner: string;
50
+ /** What the action does. */
51
+ kind: PendingActionKind;
52
+ /** Where the action stands. */
53
+ state: PendingActionState;
54
+ /** The deadline of the action in milliseconds since the epoch. */
55
+ dueAt?: number;
56
+ /** The provider the action belongs to. */
57
+ provider?: string;
58
+ /** The code the provider reported (2067, 429, ...). */
59
+ code?: string;
60
+ /** The attempt the action is. */
61
+ attempt?: number;
62
+ /** The number of attempts the owner allows. */
63
+ maxAttempts?: number;
64
+ /** A short, truthful reason for the row. */
65
+ reason: string;
66
+ }
67
+
68
+ /**
69
+ * The registry of the pending automatic actions.
70
+ */
71
+ export interface PendingActionRegistry {
72
+ /**
73
+ * Register an action. An action with a known identity replaces the
74
+ * entry it replaces, so a reschedule is one move.
75
+ */
76
+ register(entry: PendingAction): PendingAction;
77
+ /** Change the fields of an action. */
78
+ update(
79
+ id: string,
80
+ patch: Partial<Omit<PendingAction, "id">>,
81
+ ): PendingAction | null;
82
+ /** Remove an action. It reports whether the action was there. */
83
+ remove(id: string): boolean;
84
+ /** The action with that identity, when it is there. */
85
+ get(id: string): PendingAction | null;
86
+ /** Every action, in the order they were registered. */
87
+ list(): PendingAction[];
88
+ /** Remove every action the predicate matches. It reports the count. */
89
+ removeWhere(predicate: (action: PendingAction) => boolean): number;
90
+ /**
91
+ * Listen for the changes of the registry.
92
+ *
93
+ * The listener is called after every change. It returns the function
94
+ * that removes the listener again.
95
+ */
96
+ subscribe(listener: () => void): () => void;
97
+ /** Remove every action. */
98
+ clear(): void;
99
+ }
100
+
101
+ /**
102
+ * The options of a registry.
103
+ */
104
+ export interface PendingActionRegistryOptions {
105
+ /**
106
+ * Called after every change of the registry.
107
+ *
108
+ * The ticker of the rows uses it to draw the rows at once, so a new
109
+ * action does not wait for the next tick.
110
+ */
111
+ onChange?: () => void;
112
+ }
113
+
114
+ /**
115
+ * Create a registry of pending automatic actions.
116
+ */
117
+ export function createPendingActionRegistry(
118
+ options: PendingActionRegistryOptions = {},
119
+ ): PendingActionRegistry {
120
+ const entries = new Map<string, PendingAction>();
121
+ const listeners = new Set<() => void>();
122
+ const changed = (): void => {
123
+ for (const listener of Array.from(listeners)) listener();
124
+ options.onChange?.();
125
+ };
126
+ return {
127
+ register(entry: PendingAction): PendingAction {
128
+ const stored: PendingAction = { ...entry };
129
+ entries.set(entry.id, stored);
130
+ changed();
131
+ return stored;
132
+ },
133
+ update(
134
+ id: string,
135
+ patch: Partial<Omit<PendingAction, "id">>,
136
+ ): PendingAction | null {
137
+ const current = entries.get(id);
138
+ if (!current) return null;
139
+ const updated: PendingAction = { ...current, ...patch, id };
140
+ entries.set(id, updated);
141
+ changed();
142
+ return updated;
143
+ },
144
+ remove(id: string): boolean {
145
+ const removed = entries.delete(id);
146
+ if (removed) changed();
147
+ return removed;
148
+ },
149
+ get(id: string): PendingAction | null {
150
+ return entries.get(id) ?? null;
151
+ },
152
+ list(): PendingAction[] {
153
+ return Array.from(entries.values());
154
+ },
155
+ removeWhere(predicate: (action: PendingAction) => boolean): number {
156
+ let removed = 0;
157
+ for (const [id, action] of Array.from(entries.entries())) {
158
+ if (!predicate(action)) continue;
159
+ entries.delete(id);
160
+ removed += 1;
161
+ }
162
+ if (removed > 0) changed();
163
+ return removed;
164
+ },
165
+ subscribe(listener: () => void): () => void {
166
+ listeners.add(listener);
167
+ return () => {
168
+ listeners.delete(listener);
169
+ };
170
+ },
171
+ clear(): void {
172
+ if (entries.size === 0) return;
173
+ entries.clear();
174
+ changed();
175
+ },
176
+ };
177
+ }
178
+
179
+ /**
180
+ * The remaining time as "MM:SS".
181
+ *
182
+ * A time that is not a number is shown as an empty countdown: a status row
183
+ * must never claim a time that does not exist.
184
+ */
185
+ export function formatRemainingTime(remainingMs: number): string {
186
+ const safeMs = Number.isFinite(remainingMs) ? Math.max(0, remainingMs) : 0;
187
+ const totalSeconds = Math.floor(safeMs / 1_000);
188
+ const minutes = Math.floor(totalSeconds / 60);
189
+ const seconds = totalSeconds % 60;
190
+ return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
191
+ }
192
+
193
+ /**
194
+ * The name of an action in a status row.
195
+ */
196
+ export function pendingActionLabel(action: PendingAction): string {
197
+ const provider = action.provider;
198
+ const code = action.code ? ` ${action.code}` : "";
199
+ switch (action.kind) {
200
+ case "jev-decision":
201
+ return "Jev decision";
202
+ case "quota-check":
203
+ return `${provider ?? "quota"}${code} quota check`;
204
+ case "retry":
205
+ return provider ? `${provider}${code}` : "provider retry";
206
+ case "resume":
207
+ default:
208
+ return provider ? `${provider}${code}` : "provider resume";
209
+ }
210
+ }
211
+
212
+ /**
213
+ * The verb of the row.
214
+ *
215
+ * The verb names what the countdown is waiting for, so a row never claims
216
+ * that a decision is a resume or the other way round.
217
+ */
218
+ function pendingActionVerb(action: PendingAction): string {
219
+ switch (action.kind) {
220
+ case "jev-decision":
221
+ return "decision";
222
+ case "quota-check":
223
+ return "check";
224
+ case "retry":
225
+ case "resume":
226
+ default:
227
+ return "auto-resume";
228
+ }
229
+ }
230
+
231
+ /**
232
+ * The row of one action.
233
+ *
234
+ * A scheduled action with a deadline counts down. Every other state shows
235
+ * what it really is: an action without a known deadline never shows a
236
+ * countdown.
237
+ */
238
+ export function formatPendingAction(
239
+ action: PendingAction,
240
+ now: number,
241
+ ): string {
242
+ const label = pendingActionLabel(action);
243
+ const attempt =
244
+ action.attempt !== undefined
245
+ ? `attempt ${action.attempt}${
246
+ action.maxAttempts !== undefined ? `/${action.maxAttempts}` : ""
247
+ }`
248
+ : "";
249
+ const reason = action.reason ? action.reason : "";
250
+
251
+ switch (action.state) {
252
+ case "scheduled": {
253
+ if (action.dueAt === undefined || !Number.isFinite(action.dueAt)) {
254
+ return row("WAIT", label, ["scheduled", attempt, reason]);
255
+ }
256
+ const remaining = formatRemainingTime(action.dueAt - now);
257
+ return row("WAIT", label, [
258
+ `${pendingActionVerb(action)} in ${remaining}`,
259
+ attempt,
260
+ reason,
261
+ ]);
262
+ }
263
+ case "queued":
264
+ return row("WAIT", label, ["queued", attempt, reason]);
265
+ case "running":
266
+ return row("RUN", label, ["running", attempt, reason]);
267
+ case "blocked":
268
+ default:
269
+ return row("BLOCKED", label, [reason]);
270
+ }
271
+ }
272
+
273
+ /**
274
+ * Join the parts of a row.
275
+ *
276
+ * Empty parts leave no gap behind, so a row never shows a dangling
277
+ * separator.
278
+ */
279
+ function row(state: string, label: string, parts: string[]): string {
280
+ const segments = parts.filter((part) => part.length > 0);
281
+ return segments.length > 0
282
+ ? `[${state}] ${label} | ${segments.join(" | ")}`
283
+ : `[${state}] ${label}`;
284
+ }
285
+
286
+ /**
287
+ * The rows of every action.
288
+ *
289
+ * The blocked actions come first: a blocked provider must stay visible even
290
+ * when another action has a countdown. The scheduled actions follow, the
291
+ * nearest deadline first.
292
+ */
293
+ export function formatPendingActions(
294
+ actions: PendingAction[],
295
+ now: number,
296
+ ): string[] {
297
+ const blocked = actions.filter((action) => action.state === "blocked");
298
+ const rest = actions.filter((action) => action.state !== "blocked");
299
+ const byDeadline = (a: PendingAction, b: PendingAction): number => {
300
+ const left = a.dueAt ?? Number.POSITIVE_INFINITY;
301
+ const right = b.dueAt ?? Number.POSITIVE_INFINITY;
302
+ if (left === right) return 0;
303
+ return left - right;
304
+ };
305
+ return [
306
+ ...blocked.map((action) => formatPendingAction(action, now)),
307
+ ...rest.sort(byDeadline).map((action) => formatPendingAction(action, now)),
308
+ ];
309
+ }
310
+
311
+ /**
312
+ * The dependencies of the ticker of the rows.
313
+ */
314
+ export interface PendingActionTickerDeps {
315
+ /** The registry the ticker observes. */
316
+ registry: PendingActionRegistry;
317
+ /** Draw the rows. The ticker never dispatches an action. */
318
+ render: (rows: string[]) => void;
319
+ /** The clock (the tests drive it). */
320
+ now?: () => number;
321
+ /** The timer that drives the ticks (the tests drive it). */
322
+ setInterval?: (callback: () => void, ms: number) => unknown;
323
+ /** The timer that stops the ticks (the tests drive it). */
324
+ clearInterval?: (handle: unknown) => void;
325
+ /** The tick interval in milliseconds. */
326
+ tickMs?: number;
327
+ }
328
+
329
+ /**
330
+ * The ticker of the rows.
331
+ */
332
+ export interface PendingActionTicker {
333
+ /** Start the ticker and draw the rows once. */
334
+ start(): void;
335
+ /** Stop the ticker. */
336
+ stop(): void;
337
+ /** Draw the rows once. The tests drive it. */
338
+ tick(): void;
339
+ /** Is the ticker running? */
340
+ readonly active: boolean;
341
+ }
342
+
343
+ /** The milliseconds between two ticks of the rows. */
344
+ const TICK_MS = 1_000;
345
+
346
+ /**
347
+ * Create the ticker of the rows.
348
+ *
349
+ * The ticker redraws once per second while an action is pending and stops
350
+ * itself when there is nothing to draw. A tick never dispatches an action:
351
+ * the display and the execution stay apart.
352
+ */
353
+ export function createPendingActionTicker(
354
+ deps: PendingActionTickerDeps,
355
+ ): PendingActionTicker {
356
+ const now = deps.now ?? (() => Date.now());
357
+ const setTimer = deps.setInterval ?? ((cb, ms) => setInterval(cb, ms));
358
+ const clearTimer =
359
+ deps.clearInterval ?? ((handle: unknown) => clearInterval(handle as never));
360
+ const tickMs = deps.tickMs ?? TICK_MS;
361
+
362
+ let handle: unknown = null;
363
+ let running = false;
364
+
365
+ const draw = (): void => {
366
+ const rows = formatPendingActions(deps.registry.list(), now());
367
+ deps.render(rows);
368
+ };
369
+
370
+ const ticker: PendingActionTicker = {
371
+ start(): void {
372
+ if (running) return;
373
+ running = true;
374
+ draw();
375
+ handle = setTimer(() => ticker.tick(), tickMs);
376
+ },
377
+ stop(): void {
378
+ running = false;
379
+ if (handle !== null) {
380
+ clearTimer(handle);
381
+ handle = null;
382
+ }
383
+ },
384
+ tick(): void {
385
+ if (!running) return;
386
+ draw();
387
+ // Nothing to draw: the ticker stops itself, so it never keeps the
388
+ // event loop of the harness busy for an empty row set. A new
389
+ // action starts it again.
390
+ if (deps.registry.list().length === 0) {
391
+ ticker.stop();
392
+ }
393
+ },
394
+ get active(): boolean {
395
+ return running;
396
+ },
397
+ };
398
+
399
+ // A change of the registry draws the rows at once: a new action does
400
+ // not wait for the next tick, and a removed action leaves the row at
401
+ // once.
402
+ deps.registry.subscribe(() => {
403
+ if (running) ticker.tick();
404
+ else ticker.start();
405
+ });
406
+
407
+ return ticker;
408
+ }