pi-harness-runtime 1.1.504 → 1.1.506
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.
- package/CHANGELOG.md +161 -0
- package/harness/provider-quota-reset.ts +91 -0
- package/harness/provider-recovery-runtime.ts +57 -2
- package/harness/startup-report.ts +42 -0
- package/harness/tool-availability.ts +126 -0
- package/index.ts +36 -0
- package/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/write-review/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,167 @@
|
|
|
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.506](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.506) (2026-11-11)
|
|
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
|
+
* **harness:** the startup tells the user that the session keeps its issues with bd ([81d63c5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/81d63c5dc2452b9f08001756866db80046a2532a))
|
|
14
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
15
|
+
* **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
|
|
16
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
17
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
18
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
19
|
+
* **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
|
|
20
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
21
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
22
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
23
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
24
|
+
* **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
|
|
25
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
26
|
+
* **recovery:** a MiniMax quota exhaustion waits for the captured reset plus ten minutes ([5af08a0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5af08a0e86c8c93fa5b7ff64a7b08e4514bc68f3))
|
|
27
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
28
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
29
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
30
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
31
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
32
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
38
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
39
|
+
* **harness:** a raw control byte hid the request scope from the review ([852b1ff](https://github.com/ManotLuijiu/pi-harness-runtime/commit/852b1ff3afc21adb71e92b85d21ff1c88e14816a))
|
|
40
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
41
|
+
* **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))
|
|
42
|
+
* **honcho:** a slow connector is not a failed one, the row is corrected when the tools appear ([b62ac5b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b62ac5b16ad93e2bfb10cbec589b80a09b7e20b3))
|
|
43
|
+
* **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))
|
|
44
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
45
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
46
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
47
|
+
* **jev:** a new request does not inherit the completion of the old one ([0f863c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0f863c7fcaf35e261beabebef15b8ab634132fdc))
|
|
48
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
49
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
50
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
51
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
52
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
53
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
54
|
+
* **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))
|
|
55
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
56
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
57
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
58
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
59
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
60
|
+
* **jev:** the scope of a request on every human path, and the todos it touched ([cec8f36](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cec8f3644333b1d13a203340df80a30fef5c1ac0))
|
|
61
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
62
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
63
|
+
* **logging:** the sanitizer of a message writes its control characters as escapes ([f4bbdb9](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f4bbdb94bc1801d4228142bc1a1b31505c42a575))
|
|
64
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
65
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
66
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
67
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
68
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
69
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
70
|
+
* **providers:** the escape of the user stops the recovery, and a permanent failure clears it ([cfe5797](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cfe57976bf463c327e45b874fd297c3e942246b8))
|
|
71
|
+
* **providers:** the pause wins over a retry, and the retry starts when the run settles ([e016dd2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e016dd2a5add5b0f3c848a225a28a59e0f5fc7f3))
|
|
72
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
73
|
+
* **recovery:** a cancelled retry of Pi is a cancelled decision, a spent budget is not ([7e13f15](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7e13f156a279cded2b2d4b0c99358100b3d5e038))
|
|
74
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
75
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
76
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
77
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
78
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
79
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
80
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
81
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
82
|
+
* **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))
|
|
83
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
84
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
85
|
+
|
|
86
|
+
### [1.1.505](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.505) (2026-11-10)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* **actions:** register the job resume, the GLM countdown and the queued continuations ([177c964](https://github.com/ManotLuijiu/pi-harness-runtime/commit/177c964555b0057e6bc7d293dafab10c95eabbf9))
|
|
92
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
93
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
94
|
+
* **harness:** the startup tells the user that the session keeps its issues with bd ([81d63c5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/81d63c5dc2452b9f08001756866db80046a2532a))
|
|
95
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
96
|
+
* **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
|
|
97
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
98
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
99
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
100
|
+
* **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
|
|
101
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
102
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
103
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
104
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
105
|
+
* **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
|
|
106
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
107
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
108
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
109
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
110
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
111
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
112
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Bug Fixes
|
|
116
|
+
|
|
117
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
118
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
119
|
+
* **harness:** a raw control byte hid the request scope from the review ([852b1ff](https://github.com/ManotLuijiu/pi-harness-runtime/commit/852b1ff3afc21adb71e92b85d21ff1c88e14816a))
|
|
120
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
121
|
+
* **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))
|
|
122
|
+
* **honcho:** a slow connector is not a failed one, the row is corrected when the tools appear ([b62ac5b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b62ac5b16ad93e2bfb10cbec589b80a09b7e20b3))
|
|
123
|
+
* **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))
|
|
124
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
125
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
126
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
127
|
+
* **jev:** a new request does not inherit the completion of the old one ([0f863c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0f863c7fcaf35e261beabebef15b8ab634132fdc))
|
|
128
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
129
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
130
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
131
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
132
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
133
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
134
|
+
* **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))
|
|
135
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
136
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
137
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
138
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
139
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
140
|
+
* **jev:** the scope of a request on every human path, and the todos it touched ([cec8f36](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cec8f3644333b1d13a203340df80a30fef5c1ac0))
|
|
141
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
142
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
143
|
+
* **logging:** the sanitizer of a message writes its control characters as escapes ([f4bbdb9](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f4bbdb94bc1801d4228142bc1a1b31505c42a575))
|
|
144
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
145
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
146
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
147
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
148
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
149
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
150
|
+
* **providers:** the escape of the user stops the recovery, and a permanent failure clears it ([cfe5797](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cfe57976bf463c327e45b874fd297c3e942246b8))
|
|
151
|
+
* **providers:** the pause wins over a retry, and the retry starts when the run settles ([e016dd2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e016dd2a5add5b0f3c848a225a28a59e0f5fc7f3))
|
|
152
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
153
|
+
* **recovery:** a cancelled retry of Pi is a cancelled decision, a spent budget is not ([7e13f15](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7e13f156a279cded2b2d4b0c99358100b3d5e038))
|
|
154
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
155
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
156
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
157
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
158
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
159
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
160
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
161
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
162
|
+
* **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))
|
|
163
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
164
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
165
|
+
|
|
5
166
|
### [1.1.504](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.504) (2026-11-10)
|
|
6
167
|
|
|
7
168
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ProviderMirrorRecord } from "../mirror.ts";
|
|
2
|
+
import type { ProviderFailure } from "./provider-failure.ts";
|
|
3
|
+
import {
|
|
4
|
+
MAX_RESET_EVIDENCE_AGE_MS,
|
|
5
|
+
normalizeProviderIdentity,
|
|
6
|
+
type RecoveryResetEvidence,
|
|
7
|
+
} from "./provider-recovery.ts";
|
|
8
|
+
|
|
9
|
+
/** Give the quota service time to settle before probing it again. */
|
|
10
|
+
export const QUOTA_RESET_BUFFER_MS = 10 * 60_000;
|
|
11
|
+
|
|
12
|
+
/** The name of a quota window of the provider. */
|
|
13
|
+
type QuotaWindowName = "h5" | "weekly";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A failed request plus fresh, fully consumed quota can identify a reset
|
|
17
|
+
* even when the provider's generic error does not name its window.
|
|
18
|
+
*
|
|
19
|
+
* The selector reads the capture that the harness already has. It never
|
|
20
|
+
* scrapes again and never parses the text of the console: a capture that is
|
|
21
|
+
* not fresh, not complete or not for this provider proves nothing.
|
|
22
|
+
*/
|
|
23
|
+
export function confirmedQuotaReset(
|
|
24
|
+
failure: ProviderFailure,
|
|
25
|
+
provider: string,
|
|
26
|
+
mirror: ProviderMirrorRecord | null | undefined,
|
|
27
|
+
now: number,
|
|
28
|
+
): RecoveryResetEvidence | undefined {
|
|
29
|
+
if (failure.kind !== "usage-exhausted" && failure.kind !== "rate-limit") {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (
|
|
33
|
+
!mirror ||
|
|
34
|
+
normalizeProviderIdentity(mirror.provider) !==
|
|
35
|
+
normalizeProviderIdentity(provider)
|
|
36
|
+
) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const observedAt = Date.parse(mirror.synced_at);
|
|
40
|
+
if (
|
|
41
|
+
!Number.isFinite(observedAt) ||
|
|
42
|
+
observedAt > now ||
|
|
43
|
+
now - observedAt > MAX_RESET_EVIDENCE_AGE_MS
|
|
44
|
+
) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const windows: {
|
|
48
|
+
window: QuotaWindowName;
|
|
49
|
+
used: number | undefined;
|
|
50
|
+
resetAt: number | undefined;
|
|
51
|
+
}[] = [
|
|
52
|
+
{
|
|
53
|
+
window: "h5",
|
|
54
|
+
used: mirror.h5_used_pct,
|
|
55
|
+
resetAt: mirror.h5_resets_at_epoch,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
window: "weekly",
|
|
59
|
+
used: mirror.weekly_used_pct,
|
|
60
|
+
resetAt: mirror.weekly_resets_at_epoch,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
const exhausted = windows.filter(
|
|
64
|
+
({ used }) =>
|
|
65
|
+
typeof used === "number" && Number.isFinite(used) && used >= 100,
|
|
66
|
+
);
|
|
67
|
+
if (exhausted.length === 0) return undefined;
|
|
68
|
+
|
|
69
|
+
// If an exhausted window has no usable reset, another window cannot
|
|
70
|
+
// establish when the account becomes usable. Keep bounded recovery.
|
|
71
|
+
let latest: { window: QuotaWindowName; resetAt: number } | undefined;
|
|
72
|
+
for (const { window, resetAt } of exhausted) {
|
|
73
|
+
if (
|
|
74
|
+
typeof resetAt !== "number" ||
|
|
75
|
+
!Number.isFinite(resetAt) ||
|
|
76
|
+
resetAt <= now
|
|
77
|
+
) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (!latest || resetAt > latest.resetAt) latest = { window, resetAt };
|
|
81
|
+
}
|
|
82
|
+
if (!latest) return undefined;
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
provider: normalizeProviderIdentity(provider),
|
|
86
|
+
window: latest.window,
|
|
87
|
+
resetAt: latest.resetAt,
|
|
88
|
+
observedAt,
|
|
89
|
+
source: mirror.source,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -34,6 +34,8 @@ import type {
|
|
|
34
34
|
ProviderRecoveryController,
|
|
35
35
|
RecoveryResetEvidence,
|
|
36
36
|
} from "./provider-recovery.ts";
|
|
37
|
+
import { MAX_RESET_EVIDENCE_AGE_MS, normalizeProviderIdentity } from "./provider-recovery.ts";
|
|
38
|
+
import { QUOTA_RESET_BUFFER_MS } from "./provider-quota-reset.ts";
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* The state of the session, read when a resume would run.
|
|
@@ -158,6 +160,8 @@ export interface ProviderRecoveryRuntimeOptions {
|
|
|
158
160
|
clearTimeout?: (handle: unknown) => void;
|
|
159
161
|
/** The reset evidence of the provider, when the harness observed one. */
|
|
160
162
|
resetEvidence?: (failure: ProviderFailure) => RecoveryResetEvidence | undefined;
|
|
163
|
+
/** Fresh evidence that quota is fully consumed, including for generic 2067 errors. */
|
|
164
|
+
quotaResetEvidence?: (failure: ProviderFailure, provider: string) => RecoveryResetEvidence | undefined;
|
|
161
165
|
/** The number of attempts the cycle allows. */
|
|
162
166
|
maxAttempts: number;
|
|
163
167
|
/** The wait of the overload executor, in milliseconds. */
|
|
@@ -354,6 +358,9 @@ export class ProviderRecoveryRuntime {
|
|
|
354
358
|
private startRecovery(candidate: ProviderFailureCandidate): void {
|
|
355
359
|
const { failure, failureKey, provider } = candidate;
|
|
356
360
|
const sessionId = this.options.context().sessionId;
|
|
361
|
+
// A real quota reset is a different wait from a transient retry.
|
|
362
|
+
// It remains available even after the four short retries were used.
|
|
363
|
+
if (this.scheduleQuotaReset(candidate, sessionId)) return;
|
|
357
364
|
const outcome = this.options.controller.noteFailure(
|
|
358
365
|
{
|
|
359
366
|
failureKey,
|
|
@@ -372,7 +379,7 @@ export class ProviderRecoveryRuntime {
|
|
|
372
379
|
this.log(
|
|
373
380
|
`Provider recovery attempt ${outcome.attempt}/${this.maxAttempts} at ${new Date(outcome.dueAt).toISOString()} (bound=${outcome.boundBy})`,
|
|
374
381
|
);
|
|
375
|
-
this.scheduleAttempt(outcome.dueAt, outcome.attempt,
|
|
382
|
+
this.scheduleAttempt(outcome.dueAt, outcome.attempt, candidate, sessionId);
|
|
376
383
|
return;
|
|
377
384
|
}
|
|
378
385
|
|
|
@@ -389,6 +396,50 @@ export class ProviderRecoveryRuntime {
|
|
|
389
396
|
);
|
|
390
397
|
}
|
|
391
398
|
|
|
399
|
+
private scheduleQuotaReset(candidate: ProviderFailureCandidate, sessionId: string): boolean {
|
|
400
|
+
const { failure, provider } = candidate;
|
|
401
|
+
if (failure.kind !== "usage-exhausted" && failure.kind !== "rate-limit") return false;
|
|
402
|
+
const evidence = this.options.quotaResetEvidence?.(failure, provider);
|
|
403
|
+
const now = this.now();
|
|
404
|
+
if (!evidence || normalizeProviderIdentity(evidence.provider) !== normalizeProviderIdentity(provider) ||
|
|
405
|
+
!Number.isFinite(evidence.resetAt) || evidence.resetAt <= now ||
|
|
406
|
+
!Number.isFinite(evidence.observedAt) || evidence.observedAt > now ||
|
|
407
|
+
now - evidence.observedAt > MAX_RESET_EVIDENCE_AGE_MS) return false;
|
|
408
|
+
const dueAt = Math.max(evidence.resetAt + QUOTA_RESET_BUFFER_MS, now + (failure.retryAfterMs ?? 0));
|
|
409
|
+
this.cancelRecoveryAttempt();
|
|
410
|
+
this.options.controller.invalidatePending({ sessionId });
|
|
411
|
+
this.options.actions.remove(this.options.blockedActionId);
|
|
412
|
+
this.options.actions.register({
|
|
413
|
+
id: this.options.recoveryActionId,
|
|
414
|
+
sessionId,
|
|
415
|
+
owner: "provider-recovery",
|
|
416
|
+
kind: "retry",
|
|
417
|
+
state: "scheduled",
|
|
418
|
+
dueAt,
|
|
419
|
+
provider,
|
|
420
|
+
...(failure.code ? { code: failure.code } : {}),
|
|
421
|
+
reason: `${evidence.window} quota exhausted; waiting for reset + 10m`,
|
|
422
|
+
});
|
|
423
|
+
this.log(`Provider quota reset wait until ${new Date(dueAt).toISOString()} (${evidence.window})`);
|
|
424
|
+
const arm = () => {
|
|
425
|
+
// Node timers longer than roughly 24 days otherwise fire immediately.
|
|
426
|
+
this.recoveryTimer = this.setTimer(() => {
|
|
427
|
+
if (this.now() < dueAt) { arm(); return; }
|
|
428
|
+
this.recoveryTimer = null;
|
|
429
|
+
this.options.actions.remove(this.options.recoveryActionId);
|
|
430
|
+
if (!mayDispatchResume({ scheduledSessionId: sessionId, current: this.options.context() }).allowed) return;
|
|
431
|
+
// A newly observed exhausted window may have a later reset.
|
|
432
|
+
if (this.scheduleQuotaReset(candidate, sessionId)) return;
|
|
433
|
+
// The reset itself does not prove success. Give the request a
|
|
434
|
+
// fresh bounded budget if it still fails after this one probe.
|
|
435
|
+
this.options.controller.cancel({ sessionId, provider });
|
|
436
|
+
this.dispatchIfOwned(sessionId, "provider-recovery");
|
|
437
|
+
}, Math.min(2_147_483_647, Math.max(0, dueAt - this.now())));
|
|
438
|
+
};
|
|
439
|
+
arm();
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
|
|
392
443
|
/**
|
|
393
444
|
* The number of attempts the cycle allows.
|
|
394
445
|
*/
|
|
@@ -419,9 +470,10 @@ export class ProviderRecoveryRuntime {
|
|
|
419
470
|
private scheduleAttempt(
|
|
420
471
|
dueAt: number,
|
|
421
472
|
attempt: number,
|
|
422
|
-
|
|
473
|
+
candidate: ProviderFailureCandidate,
|
|
423
474
|
sessionId: string,
|
|
424
475
|
): void {
|
|
476
|
+
const { failure } = candidate;
|
|
425
477
|
this.cancelRecoveryAttempt();
|
|
426
478
|
this.options.actions.register({
|
|
427
479
|
id: this.options.recoveryActionId,
|
|
@@ -442,6 +494,9 @@ export class ProviderRecoveryRuntime {
|
|
|
442
494
|
// The row leaves when the attempt runs: a countdown must not stay
|
|
443
495
|
// at 00:00.
|
|
444
496
|
this.options.actions.remove(this.options.recoveryActionId);
|
|
497
|
+
if (!mayDispatchResume({ scheduledSessionId: sessionId, current: this.options.context() }).allowed) return;
|
|
498
|
+
// Quota may have become exhausted while a short retry counted down.
|
|
499
|
+
if (this.scheduleQuotaReset(candidate, sessionId)) return;
|
|
445
500
|
this.dispatchIfOwned(sessionId, "provider-recovery");
|
|
446
501
|
}, delayMs);
|
|
447
502
|
}
|
|
@@ -90,6 +90,48 @@ export function jevMissingKeyReport(fixes: string[]): StartupReport {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* The Beads line for the issue tracker of the session.
|
|
95
|
+
*
|
|
96
|
+
* The harness keeps its issues with bd (beads): the loop of the session
|
|
97
|
+
* closes an issue with it, and the checklist before a commit asks for the
|
|
98
|
+
* open ones. A user without bd gets a session where a part of the harness
|
|
99
|
+
* is silently missing, so the notice names the dependency and the way to
|
|
100
|
+
* install it.
|
|
101
|
+
*
|
|
102
|
+
* The notice is shown when the tracker is there as well: a dependency the
|
|
103
|
+
* user cannot see is a dependency the user cannot install.
|
|
104
|
+
*/
|
|
105
|
+
export function beadsReport(options: {
|
|
106
|
+
/** Is bd installed? */
|
|
107
|
+
available: boolean;
|
|
108
|
+
/** The version of bd, when it was read. */
|
|
109
|
+
version?: string | undefined;
|
|
110
|
+
}): StartupReport {
|
|
111
|
+
if (options.available) {
|
|
112
|
+
const version = options.version ? ` ${options.version}` : "";
|
|
113
|
+
return {
|
|
114
|
+
label: "Beads",
|
|
115
|
+
text: `bd (beads) is the issue tracker of this session${version}`,
|
|
116
|
+
status: "info",
|
|
117
|
+
details: [
|
|
118
|
+
"The harness keeps its issues with bd: `bd ready` lists the open ones.",
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
label: "Beads",
|
|
124
|
+
text: "bd (beads) not installed; the issue tracker of the session is unavailable",
|
|
125
|
+
status: "warn",
|
|
126
|
+
details: [
|
|
127
|
+
"Install beads: npm install -g @beads/bd",
|
|
128
|
+
"or: brew install beads",
|
|
129
|
+
"or: curl -fsSL https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh | bash",
|
|
130
|
+
"The harness keeps its issues with bd: the loop of the session and the checklist before a commit need it.",
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
93
135
|
/**
|
|
94
136
|
* Should the relay be reported at all?
|
|
95
137
|
*
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command line tools the harness uses outside of Pi.
|
|
3
|
+
*
|
|
4
|
+
* The harness leans on a few tools: bd (beads) keeps the issues of the
|
|
5
|
+
* session, and the notices of the startup tell the user when one of them is
|
|
6
|
+
* missing and how to install it.
|
|
7
|
+
*
|
|
8
|
+
* The lookup reads the path instead of running the command: a tool that
|
|
9
|
+
* hangs would hang the startup, and the startup is the first thing the user
|
|
10
|
+
* sees.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { accessSync, constants } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import { execFile } from "node:child_process";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The default check: is the candidate a file that can be run?
|
|
19
|
+
*/
|
|
20
|
+
function defaultExists(candidate: string): boolean {
|
|
21
|
+
try {
|
|
22
|
+
accessSync(candidate, constants.X_OK);
|
|
23
|
+
return true;
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The extensions a command can have on Windows.
|
|
31
|
+
*/
|
|
32
|
+
function windowsExtensions(pathext: string | undefined): string[] {
|
|
33
|
+
const extensions = (pathext ?? ".COM;.EXE;.BAT;.CMD")
|
|
34
|
+
.split(";")
|
|
35
|
+
.map((extension) => extension.trim())
|
|
36
|
+
.filter((extension) => extension.length > 0);
|
|
37
|
+
return extensions.length > 0 ? extensions : [""];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The path of a command, or null when it is not installed.
|
|
42
|
+
*
|
|
43
|
+
* The search follows the PATH of the environment. A directory that does not
|
|
44
|
+
* exist is skipped, and a command that is not runnable is not a command.
|
|
45
|
+
*/
|
|
46
|
+
export function findOnPath(
|
|
47
|
+
command: string,
|
|
48
|
+
options: {
|
|
49
|
+
/** The PATH to search. */
|
|
50
|
+
path?: string | undefined;
|
|
51
|
+
/** The platform the lookup runs on. */
|
|
52
|
+
platform?: string | undefined;
|
|
53
|
+
/** The PATHEXT of the environment (Windows). */
|
|
54
|
+
pathext?: string | undefined;
|
|
55
|
+
/** Is the candidate runnable? The default checks the file system. */
|
|
56
|
+
exists?: (candidate: string) => boolean;
|
|
57
|
+
} = {},
|
|
58
|
+
): string | null {
|
|
59
|
+
const pathValue = options.path ?? "";
|
|
60
|
+
const platform = options.platform ?? process.platform;
|
|
61
|
+
const exists = options.exists ?? defaultExists;
|
|
62
|
+
const separator = pathValue.includes(";") ? ";" : ":";
|
|
63
|
+
const extensions =
|
|
64
|
+
platform === "win32" ? windowsExtensions(options.pathext) : [""];
|
|
65
|
+
for (const directory of pathValue.split(separator)) {
|
|
66
|
+
if (!directory) continue;
|
|
67
|
+
for (const extension of extensions) {
|
|
68
|
+
const candidate = join(directory, `${command}${extension}`);
|
|
69
|
+
if (exists(candidate)) return candidate;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The version a tool reports, or undefined when it does not report one.
|
|
77
|
+
*
|
|
78
|
+
* The tool is run with a timeout: a tool that hangs must not hang the
|
|
79
|
+
* startup. A tool that fails is not an error of the startup - the version is
|
|
80
|
+
* a convenience, not a fact the session depends on.
|
|
81
|
+
*/
|
|
82
|
+
export async function readToolVersion(
|
|
83
|
+
command: string,
|
|
84
|
+
options: {
|
|
85
|
+
/** How long the tool may take. */
|
|
86
|
+
timeoutMs?: number | undefined;
|
|
87
|
+
} = {},
|
|
88
|
+
): Promise<string | undefined> {
|
|
89
|
+
try {
|
|
90
|
+
const output = await new Promise<string>((resolve, reject) => {
|
|
91
|
+
execFile(
|
|
92
|
+
command,
|
|
93
|
+
["--version"],
|
|
94
|
+
{
|
|
95
|
+
timeout: options.timeoutMs ?? 2000,
|
|
96
|
+
windowsHide: true,
|
|
97
|
+
encoding: "utf8",
|
|
98
|
+
},
|
|
99
|
+
(error, stdout) => {
|
|
100
|
+
if (error) reject(error);
|
|
101
|
+
else resolve(String(stdout ?? ""));
|
|
102
|
+
},
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
const line = output
|
|
106
|
+
.split("\n")
|
|
107
|
+
.map((part) => part.trim())
|
|
108
|
+
.find((part) => part.length > 0);
|
|
109
|
+
return line && line.length > 0 ? line : undefined;
|
|
110
|
+
} catch {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The version number of a version line.
|
|
117
|
+
*
|
|
118
|
+
* The tools report their version in their own words ("bd version 1.1.2
|
|
119
|
+
* (20e493e56)"). The number is what the user compares with the release
|
|
120
|
+
* notes, so the rest of the line is dropped.
|
|
121
|
+
*/
|
|
122
|
+
export function versionNumber(line: string | undefined): string | undefined {
|
|
123
|
+
if (!line) return undefined;
|
|
124
|
+
const match = line.match(/\d+\.\d+\.\d+[^\s]*/);
|
|
125
|
+
return match ? match[0] : undefined;
|
|
126
|
+
}
|
package/index.ts
CHANGED
|
@@ -56,6 +56,7 @@ import { describeInboundAccess, getAllowedUserIds } from "./harness/telegram-aut
|
|
|
56
56
|
import { buildTelegramCallbackUpdate, buildTelegramMessageUpdate } from "./harness/telegram-update.ts";
|
|
57
57
|
import { installConsoleGuard } from "./harness/console-guard.ts";
|
|
58
58
|
import {
|
|
59
|
+
beadsReport,
|
|
59
60
|
exposedKeyFilesReport,
|
|
60
61
|
jevMissingKeyReport,
|
|
61
62
|
lineConfigurationReport,
|
|
@@ -63,6 +64,11 @@ import {
|
|
|
63
64
|
relayEndpointReport,
|
|
64
65
|
relayShouldBeReported,
|
|
65
66
|
} from "./harness/startup-report.ts";
|
|
67
|
+
import {
|
|
68
|
+
findOnPath,
|
|
69
|
+
readToolVersion,
|
|
70
|
+
versionNumber,
|
|
71
|
+
} from "./harness/tool-availability.ts";
|
|
66
72
|
import { localSkillsReport, skillsReport } from "./harness/skills-startup.ts";
|
|
67
73
|
import {
|
|
68
74
|
PendingQuestionCountdown,
|
|
@@ -79,6 +85,7 @@ import {
|
|
|
79
85
|
readPiRetrySettings,
|
|
80
86
|
} from "./harness/pi-retry-policy.ts";
|
|
81
87
|
import { ProviderRecoveryRuntime } from "./harness/provider-recovery-runtime.ts";
|
|
88
|
+
import { confirmedQuotaReset } from "./harness/provider-quota-reset.ts";
|
|
82
89
|
import type { ProviderFailure } from "./harness/provider-failure.ts";
|
|
83
90
|
import {
|
|
84
91
|
createProviderRecoveryController,
|
|
@@ -327,6 +334,28 @@ function reportExposedKeyFiles(): void {
|
|
|
327
334
|
addHarnessMessage(report.label, report.text, report.status, report.details);
|
|
328
335
|
}
|
|
329
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Report the issue tracker of the session.
|
|
339
|
+
*
|
|
340
|
+
* The harness keeps its issues with bd (beads): the loop of the session
|
|
341
|
+
* closes an issue with it, and the checklist before a commit asks for the
|
|
342
|
+
* open ones. A user without bd gets a session where a part of the harness
|
|
343
|
+
* is silently missing, so the notice names the dependency and the way to
|
|
344
|
+
* install it.
|
|
345
|
+
*
|
|
346
|
+
* The notice is shown when the tracker is there as well: a dependency the
|
|
347
|
+
* user cannot see is a dependency the user cannot install.
|
|
348
|
+
*/
|
|
349
|
+
async function reportBeadsTracker(): Promise<void> {
|
|
350
|
+
const path = findOnPath("bd", {
|
|
351
|
+
path: process.env.PATH ?? process.env.Path ?? "",
|
|
352
|
+
pathext: process.env.PATHEXT,
|
|
353
|
+
});
|
|
354
|
+
const version = path ? versionNumber(await readToolVersion("bd")) : undefined;
|
|
355
|
+
const report = beadsReport({ available: Boolean(path), version });
|
|
356
|
+
addHarnessMessage(report.label, report.text, report.status, report.details);
|
|
357
|
+
}
|
|
358
|
+
|
|
330
359
|
/**
|
|
331
360
|
* The `echo` commands that create the missing key files of one feature.
|
|
332
361
|
*
|
|
@@ -6129,6 +6158,10 @@ export default async function (pi: ExtensionAPI) {
|
|
|
6129
6158
|
// secret can surface.
|
|
6130
6159
|
reportExposedKeyFiles();
|
|
6131
6160
|
|
|
6161
|
+
// The issue tracker of the session. The harness leans on bd (beads),
|
|
6162
|
+
// so the user is told that it is there - or how to install it.
|
|
6163
|
+
void reportBeadsTracker();
|
|
6164
|
+
|
|
6132
6165
|
// --- console-guard: keep the TUI prompt input field clean ----
|
|
6133
6166
|
// A library that writes to the console would put its text into the
|
|
6134
6167
|
// prompt input field. The guard sends it to the harness log instead.
|
|
@@ -6829,6 +6862,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
6829
6862
|
sessionBusy: activeExtensionContext?.isIdle?.() === false,
|
|
6830
6863
|
}),
|
|
6831
6864
|
resetEvidence: (failure) => applicableResetEvidence(failure),
|
|
6865
|
+
quotaResetEvidence: (failure, provider) => confirmedQuotaReset(
|
|
6866
|
+
failure, provider, mirrorStore.readProvider(provider.toLowerCase()), Date.now(),
|
|
6867
|
+
),
|
|
6832
6868
|
overloadDelayMs: () => getProviderOverloadResumeDelayMs(),
|
|
6833
6869
|
overloadMaxAttempts: PROVIDER_OVERLOAD_AUTO_RESUME_LIMIT,
|
|
6834
6870
|
dispatch: async (reason) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/two-phase-review",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.506",
|
|
4
4
|
"description": "pi-harness-runtime — two-phase implementation and review workflow (queue review signals, gate the phase, scope the diff)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|