pi-harness-runtime 1.1.497 → 1.1.499
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 +151 -0
- package/harness/jev-request-scope.ts +0 -0
- package/harness/jev-wait-eligibility.ts +139 -27
- package/index.ts +93 -26
- 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,157 @@
|
|
|
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.499](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.499) (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
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
25
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
26
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
27
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
28
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
29
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
30
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
36
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
37
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
38
|
+
* **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))
|
|
39
|
+
* **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))
|
|
40
|
+
* **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))
|
|
41
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
42
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
43
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
44
|
+
* **jev:** a new request does not inherit the completion of the old one ([0f863c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0f863c7fcaf35e261beabebef15b8ab634132fdc))
|
|
45
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
46
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
47
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
48
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
49
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
50
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
51
|
+
* **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))
|
|
52
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
53
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
54
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
55
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
56
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
57
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
58
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
59
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
60
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
61
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
62
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
63
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
64
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
65
|
+
* **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))
|
|
66
|
+
* **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))
|
|
67
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
68
|
+
* **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))
|
|
69
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
70
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
71
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
72
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
73
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
74
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
75
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
76
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
77
|
+
* **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))
|
|
78
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
79
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
80
|
+
|
|
81
|
+
### [1.1.498](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.498) (2026-11-09)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Features
|
|
85
|
+
|
|
86
|
+
* **actions:** register the job resume, the GLM countdown and the queued continuations ([177c964](https://github.com/ManotLuijiu/pi-harness-runtime/commit/177c964555b0057e6bc7d293dafab10c95eabbf9))
|
|
87
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
88
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
89
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
90
|
+
* **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
|
|
91
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
92
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
93
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
94
|
+
* **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
|
|
95
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
96
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
97
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
98
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
99
|
+
* **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
|
|
100
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
101
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
102
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
103
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
104
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
105
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
106
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
112
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
113
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
114
|
+
* **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))
|
|
115
|
+
* **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))
|
|
116
|
+
* **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))
|
|
117
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
118
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
119
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
120
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
121
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
122
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
123
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
124
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
125
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
126
|
+
* **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))
|
|
127
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
128
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
129
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
130
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
131
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
132
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
133
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
134
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
135
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
136
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
137
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
138
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
139
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
140
|
+
* **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))
|
|
141
|
+
* **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))
|
|
142
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
143
|
+
* **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))
|
|
144
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
145
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
146
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
147
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
148
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
149
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
150
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
151
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
152
|
+
* **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))
|
|
153
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
154
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
155
|
+
|
|
5
156
|
### [1.1.497](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.497) (2026-11-09)
|
|
6
157
|
|
|
7
158
|
|
|
Binary file
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
* preserved.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import {
|
|
22
|
+
itemsOfRequest,
|
|
23
|
+
isOpenTodo,
|
|
24
|
+
scopeSubjects,
|
|
25
|
+
type JevRequestScope,
|
|
26
|
+
type RequestTodoLike,
|
|
27
|
+
} from "./jev-request-scope.ts";
|
|
28
|
+
|
|
21
29
|
/**
|
|
22
30
|
* The state of the work of the current request.
|
|
23
31
|
*
|
|
@@ -43,7 +51,7 @@ export type JevQuestionRelevance =
|
|
|
43
51
|
| "final-request";
|
|
44
52
|
|
|
45
53
|
/** The part of a todo item the rules need. */
|
|
46
|
-
export interface TodoStateLike {
|
|
54
|
+
export interface TodoStateLike extends RequestTodoLike {
|
|
47
55
|
/** The status of the item ("pending", "in_progress", "completed", ...). */
|
|
48
56
|
status: string;
|
|
49
57
|
}
|
|
@@ -198,16 +206,16 @@ const TASK_VERBS: ReadonlySet<string> = new Set([
|
|
|
198
206
|
]);
|
|
199
207
|
|
|
200
208
|
/**
|
|
201
|
-
* The kinds of a question
|
|
209
|
+
* The kinds of a question whose relevance is uncertain.
|
|
202
210
|
*
|
|
203
|
-
* A question of such a kind
|
|
204
|
-
* continue the requested work without the answer.
|
|
205
|
-
*
|
|
206
|
-
*
|
|
211
|
+
* A question of such a kind asks for information that the request does not
|
|
212
|
+
* name: the agent cannot continue the requested work without the answer.
|
|
213
|
+
* The kind preserves the question, but it never establishes a permission:
|
|
214
|
+
* a choice may name work that was not asked for, and the scope decides
|
|
215
|
+
* that.
|
|
207
216
|
*/
|
|
208
|
-
const
|
|
217
|
+
const PRESERVING_KINDS: ReadonlySet<string> = new Set([
|
|
209
218
|
"clarification",
|
|
210
|
-
"choice",
|
|
211
219
|
"routine",
|
|
212
220
|
]);
|
|
213
221
|
|
|
@@ -276,7 +284,7 @@ export function classifyQuestionRelevance(
|
|
|
276
284
|
return { offer: false, reason: "the question has no text" };
|
|
277
285
|
}
|
|
278
286
|
const kind = (options.kind ?? "").trim().toLowerCase();
|
|
279
|
-
if (
|
|
287
|
+
if (PRESERVING_KINDS.has(kind)) {
|
|
280
288
|
return {
|
|
281
289
|
offer: false,
|
|
282
290
|
reason: `the question asks for information (${kind}) and is needed for the requested work`,
|
|
@@ -337,6 +345,91 @@ export function ownsQuestion(
|
|
|
337
345
|
return current != null && current.requestId === requestId;
|
|
338
346
|
}
|
|
339
347
|
|
|
348
|
+
/**
|
|
349
|
+
* The state of the work and the scope that was requested.
|
|
350
|
+
*
|
|
351
|
+
* The two belong together: the scope is the work that was asked for, and
|
|
352
|
+
* the state says whether that work remains. A reading that returns one
|
|
353
|
+
* without the other can disagree with itself.
|
|
354
|
+
*/
|
|
355
|
+
export interface JevWorkContext {
|
|
356
|
+
/** The state of the work of the request. */
|
|
357
|
+
work: JevWorkState;
|
|
358
|
+
/** The work that was requested: the subjects of the todos of the request. */
|
|
359
|
+
scope: string[];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* The state of the work of the request, and the scope it asked for.
|
|
364
|
+
*
|
|
365
|
+
* The list is the history of the session, so the scope of the request
|
|
366
|
+
* delimits what belongs to it:
|
|
367
|
+
*
|
|
368
|
+
* - A todo that the request created or changed belongs to the request.
|
|
369
|
+
* - A todo that was already finished when the request started belongs to
|
|
370
|
+
* the request that finished it. Its completion says nothing about the
|
|
371
|
+
* request that is running, so the request is not complete because of it:
|
|
372
|
+
* there is no evidence, and no evidence is never a completion.
|
|
373
|
+
* - A todo that is still open is work that remains, whoever made it.
|
|
374
|
+
*
|
|
375
|
+
* Without a scope the whole list is the work of the request: the harness
|
|
376
|
+
* reads the list this way when it cannot tell the requests apart.
|
|
377
|
+
*/
|
|
378
|
+
export function jevWorkContext(
|
|
379
|
+
items: readonly TodoStateLike[] | null | undefined,
|
|
380
|
+
options: {
|
|
381
|
+
/**
|
|
382
|
+
* The scope of the request that is running.
|
|
383
|
+
*
|
|
384
|
+
* Without it the whole list belongs to the request.
|
|
385
|
+
*/
|
|
386
|
+
scope?: JevRequestScope | null | undefined;
|
|
387
|
+
/**
|
|
388
|
+
* Is a required validation still pending for this item?
|
|
389
|
+
*
|
|
390
|
+
* A todo that is marked complete while its final tier has not passed
|
|
391
|
+
* is not done: the required validation is work that remains, so the
|
|
392
|
+
* request is not finished.
|
|
393
|
+
*/
|
|
394
|
+
validationPending?: (item: TodoStateLike) => boolean;
|
|
395
|
+
} = {},
|
|
396
|
+
): JevWorkContext {
|
|
397
|
+
if (!items) return { work: "unknown", scope: [] };
|
|
398
|
+
const relevant = items.filter((item) => item.status !== "deleted");
|
|
399
|
+
if (relevant.length === 0) {
|
|
400
|
+
// There was no work to do. That is not a proof that the request is
|
|
401
|
+
// finished: a question can be the reason no task was ever created.
|
|
402
|
+
return { work: "unknown", scope: [] };
|
|
403
|
+
}
|
|
404
|
+
const open = relevant.filter((item) => isOpenTodo(item));
|
|
405
|
+
// The todos of the request: what it created or changed.
|
|
406
|
+
const own = options.scope
|
|
407
|
+
? itemsOfRequest(relevant, options.scope)
|
|
408
|
+
: [...relevant];
|
|
409
|
+
// The work that the request is responsible for: what it created or
|
|
410
|
+
// changed, and what is still open.
|
|
411
|
+
const responsible = options.scope
|
|
412
|
+
? [...new Set([...own, ...open])]
|
|
413
|
+
: [...relevant];
|
|
414
|
+
const scope = scopeSubjects(responsible);
|
|
415
|
+
if (open.length > 0) return { work: "unfinished", scope };
|
|
416
|
+
const validationPending = responsible.some((item) =>
|
|
417
|
+
Boolean(options.validationPending?.(item)),
|
|
418
|
+
);
|
|
419
|
+
if (validationPending) {
|
|
420
|
+
// The todos are done, but the required validation has not passed.
|
|
421
|
+
// The request is not finished.
|
|
422
|
+
return { work: "unfinished", scope };
|
|
423
|
+
}
|
|
424
|
+
if (options.scope && own.length === 0) {
|
|
425
|
+
// Nothing of the request is in the list: the finished todos belong
|
|
426
|
+
// to an earlier request. Their completion is not the completion of
|
|
427
|
+
// this one, and there is no evidence about this one.
|
|
428
|
+
return { work: "unknown", scope };
|
|
429
|
+
}
|
|
430
|
+
return { work: "complete", scope };
|
|
431
|
+
}
|
|
432
|
+
|
|
340
433
|
/**
|
|
341
434
|
* The state of the work, from the task list.
|
|
342
435
|
*
|
|
@@ -365,22 +458,10 @@ export function workStateFromTodos(
|
|
|
365
458
|
if (!items) {
|
|
366
459
|
return "unknown";
|
|
367
460
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return "unknown";
|
|
373
|
-
}
|
|
374
|
-
const unfinished = relevant.some(
|
|
375
|
-
(item) => item.status === "pending" || item.status === "in_progress",
|
|
376
|
-
);
|
|
377
|
-
if (unfinished) return "unfinished";
|
|
378
|
-
if (options.validationPending === true) {
|
|
379
|
-
// The todos are done, but the required validation has not passed.
|
|
380
|
-
// The request is not finished.
|
|
381
|
-
return "unfinished";
|
|
382
|
-
}
|
|
383
|
-
return "complete";
|
|
461
|
+
return jevWorkContext(items, {
|
|
462
|
+
validationPending:
|
|
463
|
+
options.validationPending === true ? () => true : undefined,
|
|
464
|
+
}).work;
|
|
384
465
|
}
|
|
385
466
|
|
|
386
467
|
/**
|
|
@@ -408,6 +489,37 @@ export function questionRelevance(input: {
|
|
|
408
489
|
return "current-request";
|
|
409
490
|
}
|
|
410
491
|
|
|
492
|
+
/**
|
|
493
|
+
* May the question be kept open?
|
|
494
|
+
*
|
|
495
|
+
* Keeping a question open and letting the judge answer it are two
|
|
496
|
+
* decisions. A question that stays open holds the continuation and can be
|
|
497
|
+
* answered by the human. A question that the judge may answer gets a
|
|
498
|
+
* countdown, and its silence decides.
|
|
499
|
+
*
|
|
500
|
+
* A question is kept open while the request runs, whatever it proposes: an
|
|
501
|
+
* offer of work that was not asked for is still a question of the human,
|
|
502
|
+
* and the human may answer it. A question that is asked when the work of
|
|
503
|
+
* the request is done is moot and stays closed.
|
|
504
|
+
*/
|
|
505
|
+
export function jevWaitRegistration(input: {
|
|
506
|
+
/** What the question is about. */
|
|
507
|
+
relevance: JevQuestionRelevance;
|
|
508
|
+
/** The state of the work now. */
|
|
509
|
+
work: JevWorkState;
|
|
510
|
+
}): { register: boolean; reason: string } {
|
|
511
|
+
if (input.work === "complete") {
|
|
512
|
+
return {
|
|
513
|
+
register: false,
|
|
514
|
+
reason: "the work of the request is done; the question is moot",
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return {
|
|
518
|
+
register: true,
|
|
519
|
+
reason: "the question stays open until the human answers it",
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
|
|
411
523
|
/**
|
|
412
524
|
* Is the open question obsolete?
|
|
413
525
|
*
|
|
@@ -421,10 +533,10 @@ export function isObsoleteQuestion(input: {
|
|
|
421
533
|
/** The state of the work now. */
|
|
422
534
|
work: JevWorkState;
|
|
423
535
|
}): { obsolete: boolean; reason: string } {
|
|
424
|
-
if (input.relevance
|
|
536
|
+
if (input.relevance === "final-request") {
|
|
425
537
|
return {
|
|
426
538
|
obsolete: false,
|
|
427
|
-
reason: "the question
|
|
539
|
+
reason: "the question was asked after the work of the request was done",
|
|
428
540
|
};
|
|
429
541
|
}
|
|
430
542
|
if (input.work === "complete") {
|
package/index.ts
CHANGED
|
@@ -43,12 +43,15 @@ import {
|
|
|
43
43
|
clearObsoleteWait,
|
|
44
44
|
isObsoleteQuestion,
|
|
45
45
|
jevWaitEligibility,
|
|
46
|
+
jevWaitRegistration,
|
|
47
|
+
jevWorkContext,
|
|
46
48
|
ownsQuestion,
|
|
47
49
|
questionRelevance,
|
|
48
|
-
workStateFromTodos,
|
|
49
50
|
type JevQuestionRelevance,
|
|
50
51
|
type JevWorkState,
|
|
52
|
+
type TodoStateLike,
|
|
51
53
|
} from "./harness/jev-wait-eligibility.ts";
|
|
54
|
+
import { RequestScopeTracker } from "./harness/jev-request-scope.ts";
|
|
52
55
|
import { describeInboundAccess, getAllowedUserIds } from "./harness/telegram-auth.ts";
|
|
53
56
|
import { buildTelegramCallbackUpdate, buildTelegramMessageUpdate } from "./harness/telegram-update.ts";
|
|
54
57
|
import { installConsoleGuard } from "./harness/console-guard.ts";
|
|
@@ -586,6 +589,31 @@ const sharedState = {
|
|
|
586
589
|
workspaceEnvMessage: null as string | null,
|
|
587
590
|
};
|
|
588
591
|
|
|
592
|
+
/**
|
|
593
|
+
* The scope of the request that is running.
|
|
594
|
+
*
|
|
595
|
+
* The task list is the history of the session: the todos of a request that
|
|
596
|
+
* was finished stay in it. A new request therefore inherits a list that is
|
|
597
|
+
* already complete, and the completion of the old request says nothing
|
|
598
|
+
* about the new one.
|
|
599
|
+
*
|
|
600
|
+
* The tracker remembers the list as it was when the request started, so the
|
|
601
|
+
* work of the request is told apart from the work that was done before it.
|
|
602
|
+
* Nothing is deleted: the history stays a record of what happened.
|
|
603
|
+
*/
|
|
604
|
+
const requestScopeTracker = new RequestScopeTracker({
|
|
605
|
+
readTodos: async () => {
|
|
606
|
+
const controller = sharedState.todoContinuationController as {
|
|
607
|
+
getSnapshot?: () => Promise<{ items?: TodoStateLike[] }>;
|
|
608
|
+
} | null;
|
|
609
|
+
if (!controller || typeof controller.getSnapshot !== "function") {
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
const snapshot = await controller.getSnapshot();
|
|
613
|
+
return snapshot?.items ?? null;
|
|
614
|
+
},
|
|
615
|
+
});
|
|
616
|
+
|
|
589
617
|
/**
|
|
590
618
|
* Apply an approval decision from a channel to the pending question.
|
|
591
619
|
*
|
|
@@ -1316,23 +1344,26 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
1316
1344
|
const controller = todoContinuationController;
|
|
1317
1345
|
if (!controller) return { work: "unknown", scope: [] };
|
|
1318
1346
|
try {
|
|
1319
|
-
|
|
1347
|
+
// The scope of the request delimits the work that belongs to
|
|
1348
|
+
// it: the todos of an earlier request are history, and their
|
|
1349
|
+
// completion is not the completion of this one. The list and
|
|
1350
|
+
// the scope are read together, so they belong to the same
|
|
1351
|
+
// request.
|
|
1352
|
+
const read = await requestScopeTracker.read();
|
|
1353
|
+
if (!read.items) return { work: "unknown", scope: [] };
|
|
1320
1354
|
// A todo that is marked complete while its final tier has not
|
|
1321
1355
|
// passed is not done: the required validation is work that
|
|
1322
1356
|
// remains, so the request is not finished.
|
|
1323
|
-
const validationPending =
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1357
|
+
const validationPending = (item: TodoStateLike) =>
|
|
1358
|
+
Boolean(
|
|
1359
|
+
validationLedger?.isFinalTierPending(
|
|
1360
|
+
item as unknown as import("./packages/jev-judge/dist/todo-provider.js").TodoItem,
|
|
1361
|
+
),
|
|
1362
|
+
);
|
|
1363
|
+
return jevWorkContext(read.items, {
|
|
1364
|
+
scope: read.scope,
|
|
1330
1365
|
validationPending,
|
|
1331
1366
|
});
|
|
1332
|
-
const scope = snapshot.items
|
|
1333
|
-
.map((item) => (item.subject ?? "").trim())
|
|
1334
|
-
.filter((subject) => subject.length > 0);
|
|
1335
|
-
return { work, scope };
|
|
1336
1367
|
} catch {
|
|
1337
1368
|
return { work: "unknown", scope: [] };
|
|
1338
1369
|
}
|
|
@@ -1947,18 +1978,19 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
1947
1978
|
action: questionAction,
|
|
1948
1979
|
kind: questionKind,
|
|
1949
1980
|
});
|
|
1950
|
-
|
|
1981
|
+
// Keeping the question open and letting the judge answer it
|
|
1982
|
+
// are two decisions. The question stays open while the
|
|
1983
|
+
// request runs: it holds the continuation and the human can
|
|
1984
|
+
// answer it.
|
|
1985
|
+
const registration = jevWaitRegistration({
|
|
1951
1986
|
relevance,
|
|
1952
1987
|
work: workState,
|
|
1953
1988
|
});
|
|
1954
|
-
if (!
|
|
1955
|
-
// The question is not answered by silence: it waits for
|
|
1956
|
-
// the user, and no countdown, no row and no notification
|
|
1957
|
-
// claim that the agent is waiting.
|
|
1989
|
+
if (!registration.register) {
|
|
1958
1990
|
logToFile(
|
|
1959
1991
|
"[auto-continue]",
|
|
1960
|
-
"The question
|
|
1961
|
-
|
|
1992
|
+
"The question is not registered:",
|
|
1993
|
+
registration.reason,
|
|
1962
1994
|
);
|
|
1963
1995
|
return;
|
|
1964
1996
|
}
|
|
@@ -1988,11 +2020,20 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
1988
2020
|
// Use question.requestId as the jobId for callback matching
|
|
1989
2021
|
const questionJobId = question.requestId;
|
|
1990
2022
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2023
|
+
// The wait starts here. The controller owns the question,
|
|
2024
|
+
// the moment it was asked and the countdown, so the
|
|
2025
|
+
// deadline of the decision and the deadline of the
|
|
2026
|
+
// countdown are the same moment. A question that replaces
|
|
2027
|
+
// this one invalidates the evaluation of this one.
|
|
2028
|
+
//
|
|
2029
|
+
// The wait counts down only when the judge may answer the
|
|
2030
|
+
// question: a question that offers work that was not asked
|
|
2031
|
+
// for stays open, but its silence decides nothing.
|
|
2032
|
+
const eligibility = jevWaitEligibility({
|
|
2033
|
+
relevance,
|
|
2034
|
+
work: workState,
|
|
2035
|
+
});
|
|
2036
|
+
if (eligibility.eligible) {
|
|
1996
2037
|
waitLifecycle.begin({
|
|
1997
2038
|
requestId: questionJobId,
|
|
1998
2039
|
sessionId: _sessionId,
|
|
@@ -2003,6 +2044,13 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
2003
2044
|
alternatives: result.alternatives,
|
|
2004
2045
|
relevance,
|
|
2005
2046
|
});
|
|
2047
|
+
} else {
|
|
2048
|
+
logToFile(
|
|
2049
|
+
"[auto-continue]",
|
|
2050
|
+
"The question does not wait for an automatic decision:",
|
|
2051
|
+
eligibility.reason,
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2006
2054
|
|
|
2007
2055
|
// Get task context for additional info
|
|
2008
2056
|
const taskContext = await getTaskContext().catch(() => ({ total: 0, completed: 0, remaining: [] as string[] }));
|
|
@@ -2012,7 +2060,9 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
2012
2060
|
const taskInfo = taskContext.total > 0
|
|
2013
2061
|
? `Tasks: ${taskContext.completed}/${taskContext.total} done`
|
|
2014
2062
|
: "No active tasks";
|
|
2015
|
-
const contextInfo =
|
|
2063
|
+
const contextInfo = eligibility.eligible
|
|
2064
|
+
? `Waiting: ${waitMinutes}m | ${taskInfo}`
|
|
2065
|
+
: `Waiting for your answer | ${taskInfo}`;
|
|
2016
2066
|
|
|
2017
2067
|
// Emit WaitingForUserInput to Telegram and LINE with the same
|
|
2018
2068
|
// Yes/No actions. The canonical request ID is the correlation
|
|
@@ -2742,6 +2792,12 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
2742
2792
|
// The runtime of the provider recovery reads the pause state
|
|
2743
2793
|
// of the user through this handle.
|
|
2744
2794
|
todoContinuationHandle = todoContinuationController;
|
|
2795
|
+
// The callbacks that answer a question in a channel, and the
|
|
2796
|
+
// replies of the user, reach the controller through the
|
|
2797
|
+
// shared state. Without it every pause and every resume of
|
|
2798
|
+
// the work was a call on nothing, so a decline of the user
|
|
2799
|
+
// never stopped the work.
|
|
2800
|
+
sharedState.todoContinuationController = todoContinuationController;
|
|
2745
2801
|
logToFile("[auto-continue]", "Todo continuation controller initialized");
|
|
2746
2802
|
} catch (err) {
|
|
2747
2803
|
logToFile("[auto-continue]", "Failed to create todo continuation controller:", String(err));
|
|
@@ -2755,6 +2811,7 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
2755
2811
|
todoContinuationController?.dispose?.();
|
|
2756
2812
|
todoContinuationController = null;
|
|
2757
2813
|
todoContinuationHandle = null;
|
|
2814
|
+
sharedState.todoContinuationController = null;
|
|
2758
2815
|
sharedState.validationLedger = null;
|
|
2759
2816
|
});
|
|
2760
2817
|
|
|
@@ -3683,6 +3740,11 @@ async function initTelegram(pi: ExtensionAPI): Promise<void> {
|
|
|
3683
3740
|
// The user's own words stay out of the log files: only the length
|
|
3684
3741
|
// is recorded.
|
|
3685
3742
|
logToFile("[TelegramInbound]", `Forwarding message to Pi (${text.length} chars)`);
|
|
3743
|
+
// A message of the human begins a new request: the work of the
|
|
3744
|
+
// request that ran before it is history now. The message reaches
|
|
3745
|
+
// Pi as a message of the harness, so the input event cannot
|
|
3746
|
+
// tell that it is a request.
|
|
3747
|
+
requestScopeTracker.begin();
|
|
3686
3748
|
// Forward the message to Pi as a user message
|
|
3687
3749
|
await pi.sendUserMessage(text, { deliverAs: "steer" });
|
|
3688
3750
|
});
|
|
@@ -6744,6 +6806,11 @@ Run \`bd ready\` to see current bd issues.
|
|
|
6744
6806
|
pi.on("input", (event) => {
|
|
6745
6807
|
if (event.source === "extension") return;
|
|
6746
6808
|
providerRecoveryRuntime?.cancelPending();
|
|
6809
|
+
// A request of the human begins a new scope: the todos of the
|
|
6810
|
+
// previous request are history, and the completion of that request
|
|
6811
|
+
// is not the completion of this one. The message of the harness
|
|
6812
|
+
// itself carries the source `extension` and begins nothing.
|
|
6813
|
+
requestScopeTracker.begin();
|
|
6747
6814
|
});
|
|
6748
6815
|
|
|
6749
6816
|
// The run settled: the internal retries of Pi are over, so a failure
|
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.499",
|
|
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",
|