pi-harness-runtime 1.1.476 → 1.1.478

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/AGENTS.md +18 -0
  2. package/CHANGELOG.md +109 -0
  3. package/harness/key-file-audit.ts +106 -6
  4. package/harness/pending-question-state.ts +74 -0
  5. package/harness/startup-report.ts +101 -8
  6. package/index.ts +60 -8
  7. package/package.json +1 -1
  8. package/packages/agent-policy/package.json +1 -1
  9. package/packages/auth/package.json +1 -1
  10. package/packages/autonomous-runtime/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/clipboard/package.json +1 -1
  13. package/packages/codex-watcher/package.json +1 -1
  14. package/packages/config-capture/package.json +1 -1
  15. package/packages/contracts/package.json +1 -1
  16. package/packages/cookie-sanitizer/package.json +1 -1
  17. package/packages/evaluation-engine/package.json +1 -1
  18. package/packages/event-bus/package.json +1 -1
  19. package/packages/event-store/package.json +1 -1
  20. package/packages/experience-replay/package.json +1 -1
  21. package/packages/file-copy-helper/package.json +1 -1
  22. package/packages/intent-analyzer/package.json +1 -1
  23. package/packages/jev-judge/dist/question-risk.d.ts +7 -1
  24. package/packages/jev-judge/dist/question-risk.d.ts.map +1 -1
  25. package/packages/jev-judge/dist/question-risk.js +15 -2
  26. package/packages/jev-judge/dist/question-risk.js.map +1 -1
  27. package/packages/jev-judge/package.json +1 -1
  28. package/packages/jev-judge/src/question-risk.ts +15 -2
  29. package/packages/knowledge-retrieval/package.json +1 -1
  30. package/packages/learning-engine/package.json +1 -1
  31. package/packages/logging/package.json +1 -1
  32. package/packages/memory-engine/package.json +1 -1
  33. package/packages/notification/package.json +1 -1
  34. package/packages/paperclip-integration/package.json +1 -1
  35. package/packages/performance-optimizer/package.json +1 -1
  36. package/packages/privilege-broker/package.json +1 -1
  37. package/packages/prompt-compiler/package.json +1 -1
  38. package/packages/providers/package.json +1 -1
  39. package/packages/qdrant-skills/package.json +1 -1
  40. package/packages/quota-manager/package.json +1 -1
  41. package/packages/relay/package.json +1 -1
  42. package/packages/skill-mcp-client/package.json +1 -1
  43. package/packages/skills/package.json +1 -1
  44. package/packages/todo-bd-sync/package.json +1 -1
  45. package/packages/token-estimation/package.json +1 -1
  46. package/packages/tooling-preference/package.json +1 -1
  47. package/packages/trajectory/package.json +1 -1
  48. package/packages/tui/package.json +1 -1
  49. package/packages/two-phase-review/package.json +1 -1
  50. package/packages/types/package.json +1 -1
  51. package/packages/webmcp-tester/package.json +1 -1
  52. package/packages/wiki/package.json +1 -1
  53. package/packages/write-review/package.json +1 -1
package/AGENTS.md CHANGED
@@ -563,6 +563,24 @@ Use tools in this order (highest to lowest priority):
563
563
  - Wiki/documentation changes go in `wiki/` (gitignored)
564
564
  - API keys, tokens, credentials: **never commit**
565
565
 
566
+ ### Key Files That Need `sudo` (CRITICAL)
567
+
568
+ The startup summary names every key file that other accounts on the machine can
569
+ read. The harness repairs the permissions itself whenever it can, and a file it
570
+ cannot repair is reported with the reason and with the command.
571
+
572
+ **When the startup report offers a `sudo` command:**
573
+
574
+ - **Ask the user once.** Offer the command that is in the report: "May I run
575
+ this command for you?" The user decides.
576
+ - **Run it with `sudo -n`.** The agent never waits for a password: `sudo -n`
577
+ fails immediately when a password is required.
578
+ - **Never ask for a password in the chat.** A password belongs in the terminal
579
+ of the user. When `sudo -n` fails, tell the user to run the command in their
580
+ own terminal.
581
+ - **Never run `sudo` without the answer of the user.** The harness repairs what
582
+ it owns; everything else needs the permission of the user.
583
+
566
584
  ---
567
585
 
568
586
  ## React Best Practices (CRITICAL)
package/CHANGELOG.md CHANGED
@@ -2,6 +2,115 @@
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.478](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.478) (2026-11-08)
6
+
7
+
8
+ ### Features
9
+
10
+ * **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
11
+ * **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
12
+ * **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
13
+ * **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
14
+ * **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
15
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
16
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
17
+ * **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
18
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
19
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
20
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
21
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
22
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
23
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
24
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
25
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
26
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
27
+ * **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
33
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
34
+ * **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))
35
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
36
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
37
+ * **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
38
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
39
+ * **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
40
+ * **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
41
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
42
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
43
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
44
+ * **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
45
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
46
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
47
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
48
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
49
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
50
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
51
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
52
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
53
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
54
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
55
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
56
+ * **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))
57
+ * **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
58
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
59
+
60
+ ### [1.1.477](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.477) (2026-11-08)
61
+
62
+
63
+ ### Features
64
+
65
+ * **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
66
+ * **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
67
+ * **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
68
+ * **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
69
+ * **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
70
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
71
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
72
+ * **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
73
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
74
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
75
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
76
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
77
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
78
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
79
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
80
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
81
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
82
+ * **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
83
+
84
+
85
+ ### Bug Fixes
86
+
87
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
88
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
89
+ * **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))
90
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
91
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
92
+ * **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
93
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
94
+ * **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
95
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
96
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
97
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
98
+ * **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
99
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
100
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
101
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
102
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
103
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
104
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
105
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
106
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
107
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
108
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
109
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
110
+ * **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))
111
+ * **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
112
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
113
+
5
114
  ### [1.1.476](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.476) (2026-11-08)
6
115
 
7
116
 
@@ -358,6 +358,8 @@ export interface KeyEntryInfo {
358
358
  isDirectory?: boolean;
359
359
  /** Is it a symbolic link? */
360
360
  isSymbolicLink?: boolean;
361
+ /** The owner of the entry (Unix only). */
362
+ uid?: number;
361
363
  }
362
364
 
363
365
  /** How deep the audit walks into the key tree. */
@@ -396,12 +398,35 @@ export interface KeyFileAuditResult {
396
398
  exposedDirectories: ExposedKeyDirectory[];
397
399
  }
398
400
 
401
+ /**
402
+ * An entry of the key tree that the harness could not restrict.
403
+ *
404
+ * The reason is the part the user needs: "it belongs to another account" and
405
+ * "the file system is read-only" ask for two different actions, and a report
406
+ * that names neither leaves the user without a way to act.
407
+ */
408
+ export interface SecureKeyTreeFailure {
409
+ /** The path the harness could not restrict. */
410
+ path: string;
411
+ /** What the path is. */
412
+ kind: "file" | "directory";
413
+ /** Why the harness could not restrict it. */
414
+ reason:
415
+ | "owned by another account"
416
+ | "not permitted"
417
+ | "read-only"
418
+ | "gone"
419
+ | "unknown";
420
+ }
421
+
399
422
  export interface SecureKeyTreeResult {
400
423
  /** False on platforms where chmod does not express the required ACL. */
401
424
  supported: boolean;
402
425
  securedFiles: number;
403
426
  securedDirectories: number;
404
427
  failedPaths: string[];
428
+ /** The failed paths with the reason of each failure. */
429
+ failures: SecureKeyTreeFailure[];
405
430
  }
406
431
 
407
432
  /**
@@ -421,12 +446,24 @@ export function secureKeyTree(
421
446
  securedFiles: 0,
422
447
  securedDirectories: 0,
423
448
  failedPaths: [],
449
+ failures: [],
424
450
  };
425
451
  if (!result.supported) return result;
426
452
 
453
+ // A failure is recorded with the reason, so the report can tell the user
454
+ // what to do instead of naming a path it cannot explain.
455
+ const recordFailure = (
456
+ path: string,
457
+ kind: "file" | "directory",
458
+ error: unknown,
459
+ ): void => {
460
+ result.failedPaths.push(path);
461
+ result.failures.push({ path, kind, reason: failureReason(path, error) });
462
+ };
463
+
427
464
  const root = defaultStat(keysDir);
428
465
  if (!root?.isDirectory || root.isSymbolicLink) {
429
- result.failedPaths.push(keysDir);
466
+ recordFailure(keysDir, "directory", new Error("the key directory is not a directory"));
430
467
  return result;
431
468
  }
432
469
 
@@ -435,8 +472,8 @@ export function secureKeyTree(
435
472
  chmodSync(path, 0o700);
436
473
  result.securedDirectories++;
437
474
  return true;
438
- } catch {
439
- result.failedPaths.push(path);
475
+ } catch (error) {
476
+ recordFailure(path, "directory", error);
440
477
  return false;
441
478
  }
442
479
  };
@@ -445,8 +482,8 @@ export function secureKeyTree(
445
482
  try {
446
483
  chmodSync(path, 0o600);
447
484
  result.securedFiles++;
448
- } catch {
449
- result.failedPaths.push(path);
485
+ } catch (error) {
486
+ recordFailure(path, "file", error);
450
487
  }
451
488
  };
452
489
 
@@ -502,12 +539,54 @@ function defaultStat(path: string): KeyEntryInfo | undefined {
502
539
  isFile: info.isFile(),
503
540
  isDirectory: info.isDirectory(),
504
541
  isSymbolicLink: info.isSymbolicLink(),
542
+ uid: info.uid,
505
543
  };
506
544
  } catch {
507
545
  return undefined;
508
546
  }
509
547
  }
510
548
 
549
+ /**
550
+ * The reason a permission could not be changed.
551
+ *
552
+ * The mapping is pure, so every reason can be tested without a second
553
+ * account and without a read-only file system.
554
+ */
555
+ export function keyPermissionFailureReason(options: {
556
+ /** The error code of the failed change (e.g. "EPERM"). */
557
+ code?: string;
558
+ /** Does the entry belong to another account? */
559
+ ownedByAnother?: boolean;
560
+ }): SecureKeyTreeFailure["reason"] {
561
+ const code = options.code;
562
+ if (code === "ENOENT") return "gone";
563
+ if (code === "EROFS") return "read-only";
564
+ if (code === "EPERM" || code === "EACCES") {
565
+ return options.ownedByAnother ? "owned by another account" : "not permitted";
566
+ }
567
+ return "unknown";
568
+ }
569
+
570
+ /**
571
+ * Why the harness could not restrict an entry of the key tree.
572
+ *
573
+ * The reason decides what the user has to do: a file of another account is
574
+ * changed with `sudo` or by its owner, a read-only file system is changed
575
+ * nowhere, and a file that is gone needs nothing at all.
576
+ */
577
+ function failureReason(path: string, error: unknown): SecureKeyTreeFailure["reason"] {
578
+ const code = (error as NodeJS.ErrnoException | undefined)?.code;
579
+ let ownedByAnother = false;
580
+ if (code === "EPERM" || code === "EACCES") {
581
+ const uid = typeof process.getuid === "function" ? process.getuid() : undefined;
582
+ const info = defaultStat(path);
583
+ ownedByAnother = Boolean(
584
+ info && uid !== undefined && info.uid !== undefined && info.uid !== uid,
585
+ );
586
+ }
587
+ return keyPermissionFailureReason({ code, ownedByAnother });
588
+ }
589
+
511
590
  /**
512
591
  * The default directory reader.
513
592
  */
@@ -707,7 +786,7 @@ export function formatExposedKeyFileFix(
707
786
  entry: ExposedKeyFile,
708
787
  keysDir: string,
709
788
  ): string {
710
- return `chmod 600 ${join(displayKeysDir(keysDir), entry.file)}`;
789
+ return `chmod 600 ${shellQuoteIfNeeded(join(displayKeysDir(keysDir), entry.file))}`;
711
790
  }
712
791
 
713
792
  /**
@@ -721,6 +800,27 @@ export function shellQuote(value: string): string {
721
800
  return `'${value.replace(/'/g, `'\\''`)}'`;
722
801
  }
723
802
 
803
+ /**
804
+ * Quote a path for a POSIX shell, but only when it needs it.
805
+ *
806
+ * A plain path stays readable (`chmod 600 ~/.pi-harness-runtime/keys/x.txt`)
807
+ * and a path with a space or a quote becomes one quoted argument.
808
+ */
809
+ function shellQuoteIfNeeded(value: string): string {
810
+ return /^[A-Za-z0-9_@%+=:,./~-]+$/.test(value) ? value : shellQuote(value);
811
+ }
812
+
813
+ /**
814
+ * The command that makes an entry of another account private.
815
+ *
816
+ * The command needs `sudo`, so it is not a command the harness runs: the
817
+ * report offers it to the user as a question.
818
+ */
819
+ export function formatUnrepairableKeyFix(failure: SecureKeyTreeFailure): string {
820
+ const mode = failure.kind === "directory" ? "700" : "600";
821
+ return `sudo chmod ${mode} ${shellQuote(failure.path)}`;
822
+ }
823
+
724
824
  /**
725
825
  * The one command that makes the whole key tree private again.
726
826
  *
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The state of a question that waits for an answer.
3
+ *
4
+ * The runtime asks two questions about an open question, and both have the
5
+ * same answer: "is there still a question that waits for an answer?"
6
+ *
7
+ * - a reply of the user closes it, so its buttons cannot inject a second
8
+ * answer into a question that is done,
9
+ * - the work does not continue behind it, no matter why the wait is over.
10
+ *
11
+ * The rules live here, so the two places in the runtime cannot disagree.
12
+ */
13
+
14
+ /** The part of a pending question the rules need. */
15
+ export interface QuestionStateLike {
16
+ /** The state of the question ("pending", "evaluating", ...). */
17
+ state: string;
18
+ }
19
+
20
+ /**
21
+ * Is the question still waiting for an answer?
22
+ *
23
+ * A question that was answered, cancelled or expired is closed: its buttons
24
+ * are stale and it blocks nothing.
25
+ */
26
+ export function isQuestionOpen(
27
+ question: QuestionStateLike | null | undefined,
28
+ ): boolean {
29
+ if (!question) return false;
30
+ return question.state === "pending" || question.state === "evaluating";
31
+ }
32
+
33
+ /**
34
+ * May the work continue?
35
+ *
36
+ * A question that waits for an answer blocks the work - also when the wait
37
+ * itself is over: Jev asked a human, or the evaluation of the question
38
+ * failed. The question is the thing that needs an answer, so it blocks until
39
+ * it is answered or cancelled.
40
+ */
41
+ export function mayContinue(options: {
42
+ /** Is the wait of the question still running? */
43
+ waiting: boolean;
44
+ /** Is the question still open? */
45
+ questionOpen: boolean;
46
+ }): boolean {
47
+ return !(options.waiting || options.questionOpen);
48
+ }
49
+
50
+ /**
51
+ * What a reply of the user does to the wait and to the question.
52
+ *
53
+ * - `cancelled-wait-and-question`: the wait was running. The reply ends the
54
+ * wait and closes the question.
55
+ * - `cancelled-question`: the wait was over, but the question was still
56
+ * open. The reply closes the question. The work that was paused for the
57
+ * answer continues, because the human is here.
58
+ * - `none`: there is nothing to close.
59
+ */
60
+ export type UserReplyEffect =
61
+ | "cancelled-wait-and-question"
62
+ | "cancelled-question"
63
+ | "none";
64
+
65
+ export function userReplyEffect(options: {
66
+ /** Is the wait of the question still running? */
67
+ waiting: boolean;
68
+ /** Is the question still open? */
69
+ questionOpen: boolean;
70
+ }): UserReplyEffect {
71
+ if (options.waiting) return "cancelled-wait-and-question";
72
+ if (options.questionOpen) return "cancelled-question";
73
+ return "none";
74
+ }
@@ -153,30 +153,123 @@ export function relayEndpointReport(options: {
153
153
  * the harness reads the file successfully, so no feature fails and no other
154
154
  * line warns. This line is the only place where the fact can surface.
155
155
  *
156
- * The line names the count and the command. It never names a value.
156
+ * The line tells the user what to do. A fact without an action leaves the
157
+ * reader with a warning they cannot act on, so the text carries the command
158
+ * itself: "make it private: chmod 600 <file>". The line names the count, the
159
+ * command and the reason a repair did not happen - and never a value.
157
160
  */
158
161
  export function exposedKeyFilesReport(options: {
159
162
  /** The key files that other users can read. */
160
163
  exposed: ExposedKeyFile[];
161
164
  /** The directories of the key tree that other users can reach. */
162
165
  exposedDirectories?: ExposedKeyDirectory[];
163
- /** The `chmod` command for each of them. */
166
+ /** The `chmod` command that repairs the whole key tree. */
164
167
  fixes: string[];
168
+ /** The `chmod` command that repairs one exposed key file. */
169
+ fileFixes?: string[];
170
+ /** The entries the harness could not repair itself. */
171
+ unrepairable?: {
172
+ /** The path as the user reads it (the home directory as "~"). */
173
+ path: string;
174
+ /** The command that repairs it (with sudo). */
175
+ command: string;
176
+ /** Why the harness could not repair it. */
177
+ reason: string;
178
+ }[];
165
179
  }): StartupReport | null {
166
180
  const directories = options.exposedDirectories ?? [];
167
181
  if (options.exposed.length === 0 && directories.length === 0) return null;
168
182
  const files = options.exposed.length;
169
183
  const dirs = directories.length;
170
- const text = exposedPermissionText(files, dirs);
171
- const details = [...options.fixes];
172
- if (details.length === 0) {
173
- details.push(
174
- "Make the key directory private: chmod 700 ~/.pi-harness-runtime/keys",
175
- );
184
+ const fact = exposedPermissionText(files, dirs);
185
+ const details: string[] = [];
186
+
187
+ // The entries the harness could not repair: the user has to do it, and
188
+ // the reason decides how.
189
+ for (const failure of options.unrepairable ?? []) {
190
+ details.push(...unrepairableAdvice(failure));
191
+ }
192
+
193
+ const fileFixes = options.fileFixes ?? [];
194
+ const oneFile = files === 1 && dirs === 0 && fileFixes.length === 1;
195
+ const oneDirectory = files === 0 && dirs === 1 && options.fixes.length > 0;
196
+
197
+ let text: string;
198
+ if (oneFile) {
199
+ text = `${fact} - make it private: ${fileFixes[0]}`;
200
+ } else if (oneDirectory) {
201
+ text = `${fact} - make it private: ${options.fixes[0]}`;
202
+ } else {
203
+ text = `${fact} - make them private with the command below`;
204
+ details.push(...options.fixes);
205
+ if (options.fixes.length === 0) {
206
+ details.push(
207
+ "Make the key directory private: chmod 700 ~/.pi-harness-runtime/keys",
208
+ );
209
+ }
176
210
  }
211
+
212
+ // Why the warning appears on some machines and not on others.
213
+ details.push(
214
+ "A key file is private with the mode 600. The mode comes from the shell that created the file: the umask 022 gives a new file the mode 644. That is why the warning appears on some machines and not on others.",
215
+ );
216
+
177
217
  return { label: "Keys", text, status: "warn", details };
178
218
  }
179
219
 
220
+ /**
221
+ * What the user has to do about an entry the harness could not repair.
222
+ *
223
+ * The reason decides the action: another account needs `sudo` or its owner,
224
+ * a read-only file system cannot be changed at all, and a file that is gone
225
+ * needs nothing. The path is a line of its own, so the instruction that
226
+ * follows stays readable on a narrow terminal.
227
+ */
228
+ function unrepairableAdvice(failure: {
229
+ path: string;
230
+ command: string;
231
+ reason: string;
232
+ }): string[] {
233
+ const path = failure.path;
234
+ const command = failure.command;
235
+ switch (failure.reason) {
236
+ case "owned by another account":
237
+ return [
238
+ path,
239
+ "The harness could not change it: the file belongs to another account.",
240
+ sudoAsk(),
241
+ command,
242
+ ];
243
+ case "not permitted":
244
+ return [
245
+ path,
246
+ "The harness could not change it: the permissions are not yours to change.",
247
+ sudoAsk(),
248
+ command,
249
+ ];
250
+ case "read-only":
251
+ return [
252
+ path,
253
+ "The harness could not change it: the file system is read-only. Run the command where the file can be written.",
254
+ ];
255
+ case "gone":
256
+ return [path, "The harness could not change it: the file is gone. Nothing to do."];
257
+ default:
258
+ return [path, "The harness could not change it. Run the command yourself."];
259
+ }
260
+ }
261
+
262
+ /**
263
+ * The offer to run the command with `sudo`.
264
+ *
265
+ * The offer is a question, so the user decides. The command runs with
266
+ * `sudo -n`, so it never waits for a password: a password belongs in the
267
+ * terminal of the user and never in the chat of the agent.
268
+ */
269
+ function sudoAsk(): string {
270
+ return "May the agent run the command below with sudo for you? It uses `sudo -n`, so it never waits for a password. If your sudo asks for one, run the command in your own terminal. A password never belongs in the chat.";
271
+ }
272
+
180
273
  /**
181
274
  * The text of the exposure line.
182
275
  *
package/index.ts CHANGED
@@ -22,14 +22,22 @@ import type {
22
22
  import { HarnessStartupStatus, harnessStatusMarker, type HarnessStatus } from "./harness-startup-status.ts";
23
23
  import {
24
24
  auditKeyFiles,
25
+ displayKeysDir,
25
26
  fallbackKeyFileFixes,
27
+ formatExposedKeyFileFixes,
26
28
  formatKeyFileFixes,
27
29
  formatKeyPermissionFixes,
30
+ formatUnrepairableKeyFix,
28
31
  selectKeyFileFixes,
29
32
  secureKeyTree,
30
33
  type KeyFileAuditResult,
31
34
  } from "./harness/key-file-audit.ts";
32
35
  import { renderDetailLines } from "./harness/startup-lines.ts";
36
+ import {
37
+ isQuestionOpen,
38
+ mayContinue,
39
+ userReplyEffect,
40
+ } from "./harness/pending-question-state.ts";
33
41
  import { describeInboundAccess, getAllowedUserIds } from "./harness/telegram-auth.ts";
34
42
  import { buildTelegramCallbackUpdate, buildTelegramMessageUpdate } from "./harness/telegram-update.ts";
35
43
  import { installConsoleGuard } from "./harness/console-guard.ts";
@@ -259,16 +267,30 @@ function reportExposedKeyFiles(): void {
259
267
  }
260
268
  }
261
269
 
270
+ // The entries the harness could not repair are only reported when they
271
+ // are the exposed ones: an entry that is already private needs nothing.
272
+ const exposedPaths = new Set<string>();
273
+ for (const entry of exposed) exposedPaths.add(join(harnessKeysDir(), entry.file));
274
+ for (const entry of exposedDirectories) {
275
+ exposedPaths.add(join(harnessKeysDir(), entry.name));
276
+ }
277
+ const unrepairable = repair.failures
278
+ .filter((failure) => exposedPaths.has(failure.path))
279
+ .map((failure) => ({
280
+ path: displayKeysDir(failure.path),
281
+ command: formatUnrepairableKeyFix(failure),
282
+ reason: failure.reason,
283
+ }));
284
+
262
285
  const report = exposedKeyFilesReport({
263
286
  exposed,
264
287
  exposedDirectories,
265
288
  fixes: formatKeyPermissionFixes({ keysDir: harnessKeysDir() }),
289
+ fileFixes: formatExposedKeyFileFixes(exposed, harnessKeysDir()),
290
+ unrepairable,
266
291
  });
267
292
  if (!report) return;
268
- const failedPaths = repair.failedPaths.length > 0
269
- ? [`Could not change permissions for: ${repair.failedPaths.join(", ")}`]
270
- : [];
271
- addHarnessMessage(report.label, report.text, report.status, [...failedPaths, ...report.details]);
293
+ addHarnessMessage(report.label, report.text, report.status, report.details);
272
294
  }
273
295
 
274
296
  /**
@@ -1012,6 +1034,18 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
1012
1034
  );
1013
1035
  }
1014
1036
 
1037
+ /**
1038
+ * Is the question of this session still open?
1039
+ *
1040
+ * The wait can be over while the question is not: after the decision
1041
+ * of Jev asked a human, and after an evaluation that failed, the
1042
+ * question stays open so the human can still answer it. Its buttons
1043
+ * stay valid with it, so a later click would inject a second answer.
1044
+ */
1045
+ function hasOpenQuestion(): boolean {
1046
+ return isQuestionOpen(sharedState.pqController?.getCurrentQuestion?.());
1047
+ }
1048
+
1015
1049
  // A continuation was dispatched and its turn has not settled yet.
1016
1050
  // The gate owns that state: the status stays "RUN" until the turn
1017
1051
  // settles, and no timer may clear it in the meantime.
@@ -1653,14 +1687,25 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
1653
1687
  }
1654
1688
  }
1655
1689
  lastUserMessage = new Date();
1656
- if (isWaitingForUser()) {
1690
+ const replyEffect = userReplyEffect({
1691
+ waiting: isWaitingForUser(),
1692
+ questionOpen: hasOpenQuestion(),
1693
+ });
1694
+ if (replyEffect !== "none") {
1657
1695
  // The user answered in Pi: the wait and the countdown of
1658
- // the wait are over with it.
1696
+ // the wait are over with it, and the question is closed
1697
+ // so that its buttons cannot inject a second answer.
1659
1698
  clearWait();
1660
1699
  updateAutoContinueStatus("IDLE");
1661
1700
  // Cancel pending question on user response
1662
1701
  // (User answered via Pi instead of button)
1663
1702
  sharedState.pqController?.cancel("User responded via Pi");
1703
+ if (replyEffect === "cancelled-question") {
1704
+ // The wait was over - Jev asked a human, or the
1705
+ // evaluation failed - and the work was paused for the
1706
+ // answer. The human is here: the work continues.
1707
+ (sharedState.todoContinuationController as any)?.resume?.();
1708
+ }
1664
1709
  }
1665
1710
  }
1666
1711
  });
@@ -2099,6 +2144,11 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
2099
2144
  logToFile("[auto-continue]", "The evaluation of the question failed:", message);
2100
2145
  _inferenceInProgress = false;
2101
2146
  updateAutoContinueStatus("ERROR");
2147
+ // The question is still open: the work must not continue
2148
+ // behind it. The pause ends when the question is answered
2149
+ // (a channel answer resumes it) or cancelled (a reply of
2150
+ // the user in Pi cancels it).
2151
+ (sharedState.todoContinuationController as any)?.explicitPause?.();
2102
2152
  addHarnessMessage("Jev", "auto-continue evaluation failed", "err", [
2103
2153
  "How to fix: Check logs at /tmp/pi-harness.log for API errors",
2104
2154
  "Ensure TYPESAFE_API_KEY is valid, then restart.",
@@ -2361,8 +2411,10 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
2361
2411
  updateAutoContinueStatus("IDLE");
2362
2412
  }
2363
2413
 
2364
- // Don't continue if user is waiting for response
2365
- if (isWaitingForUser()) {
2414
+ // Don't continue if user is waiting for response, and do not
2415
+ // continue behind a question that is still open: the work waits
2416
+ // for the answer, also when the wait itself is over.
2417
+ if (!mayContinue({ waiting: isWaitingForUser(), questionOpen: hasOpenQuestion() })) {
2366
2418
  todoContinuationController?.clearQueue();
2367
2419
  return;
2368
2420
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/agent-policy",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Agent policy runtime for pi-harness - enforces mandatory rule delivery and mutation gating",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/auth",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-runtime",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Autonomous Operations Runtime — task inbox, lease management, and worker lifecycle (RFC-0101)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/checkpoint",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Enhanced checkpoint system with incremental snapshots, diff-based storage, and recovery strategies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/clipboard",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/codex-watcher",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Watches Codex CLI sessions and emits visible messages for PING-PONG monitoring",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/config-capture",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Auto-capture API-fetched configuration values to AGENTS.md",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/contracts",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "description": "RPC schema definitions for pi-harness runtime",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/evaluation-engine",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-bus",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-store",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/experience-replay",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Experience replay for debugging and reproducibility (RFC-0059)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/file-copy-helper",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Injects cp/sudo cp rule when user asks to mimic/copy files",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/intent-analyzer",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -57,7 +57,13 @@ export declare const MAX_ACTION_CHARS = 600;
57
57
  * The message carries the ask ("may I proceed?") and the action ("I will
58
58
  * delete the branch"). The risk is about the action, so the action is
59
59
  * extracted: the sentences of the message that state what happens. The
60
- * question sentence itself is not an action - it asks, it does not act.
60
+ * question sentence itself is not an action - it asks, it does not act -
61
+ * unless it names an action itself.
62
+ *
63
+ * The question is assessed when it names an action: "I can update the status
64
+ * text. Want me to delete the production database?" states a harmless action
65
+ * in the message and asks for a deletion in the question. The action of the
66
+ * question is therefore always part of the action that is classified.
61
67
  *
62
68
  * When the message names no action, the question text is the action: the
63
69
  * risk of the question is then the risk of the ask.
@@ -1 +1 @@
1
- {"version":3,"file":"question-risk.d.ts","sourceRoot":"","sources":["../src/question-risk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,eAAe,GACf,UAAU,GACV,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,6BAA6B,EAAE,OAAO,CAAC;IACvC,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD;;GAEG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAYpC;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,CAgBR;AA2KD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,iBAAiB,GACtB,iBAAiB,CAoDnB"}
1
+ {"version":3,"file":"question-risk.d.ts","sourceRoot":"","sources":["../src/question-risk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,eAAe,GACf,UAAU,GACV,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,6BAA6B,EAAE,OAAO,CAAC;IACvC,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD;;GAEG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAYpC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,CAuBR;AA2KD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,iBAAiB,GACtB,iBAAiB,CAoDnB"}
@@ -29,7 +29,13 @@ const ACTION_VERBS = /\b(delete|deletes|deleted|deleting|remove|removes|removed|
29
29
  * The message carries the ask ("may I proceed?") and the action ("I will
30
30
  * delete the branch"). The risk is about the action, so the action is
31
31
  * extracted: the sentences of the message that state what happens. The
32
- * question sentence itself is not an action - it asks, it does not act.
32
+ * question sentence itself is not an action - it asks, it does not act -
33
+ * unless it names an action itself.
34
+ *
35
+ * The question is assessed when it names an action: "I can update the status
36
+ * text. Want me to delete the production database?" states a harmless action
37
+ * in the message and asks for a deletion in the question. The action of the
38
+ * question is therefore always part of the action that is classified.
33
39
  *
34
40
  * When the message names no action, the question text is the action: the
35
41
  * risk of the question is then the risk of the ask.
@@ -47,7 +53,14 @@ export function extractProposedAction(contextText, questionText) {
47
53
  if (actionSentences.length === 0) {
48
54
  return question.slice(0, MAX_ACTION_CHARS);
49
55
  }
50
- return actionSentences.join(" ").slice(0, MAX_ACTION_CHARS);
56
+ // The question can carry the action that the message does not name. It is
57
+ // assessed together with the sentences of the message: the risk of the
58
+ // proposal is the risk of everything that is proposed.
59
+ const questionIsAction = question.length > 0 && ACTION_VERBS.test(question);
60
+ const parts = questionIsAction
61
+ ? [...actionSentences, question]
62
+ : actionSentences;
63
+ return parts.join(" ").slice(0, MAX_ACTION_CHARS);
51
64
  }
52
65
  /**
53
66
  * Words that name an action that destroys, drops or overwrites something.
@@ -1 +1 @@
1
- {"version":3,"file":"question-risk.js","sourceRoot":"","sources":["../src/question-risk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoDH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,YAAY,GAChB,2nDAA2nD,CAAC;AAE9nD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAA+B,EAC/B,YAAgC;IAEhC,MAAM,QAAQ,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,IAAI,O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X,mDAAmD;QACnD,UAAU,EAAE,CAAC,WAAW;QACxB,QAAQ;QACR,OAAO;KACP,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/jev-judge",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Jev Judge - Structured decision model for agent routing, E2E testing, and automated decisions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -83,7 +83,13 @@ const ACTION_VERBS =
83
83
  * The message carries the ask ("may I proceed?") and the action ("I will
84
84
  * delete the branch"). The risk is about the action, so the action is
85
85
  * extracted: the sentences of the message that state what happens. The
86
- * question sentence itself is not an action - it asks, it does not act.
86
+ * question sentence itself is not an action - it asks, it does not act -
87
+ * unless it names an action itself.
88
+ *
89
+ * The question is assessed when it names an action: "I can update the status
90
+ * text. Want me to delete the production database?" states a harmless action
91
+ * in the message and asks for a deletion in the question. The action of the
92
+ * question is therefore always part of the action that is classified.
87
93
  *
88
94
  * When the message names no action, the question text is the action: the
89
95
  * risk of the question is then the risk of the ask.
@@ -106,7 +112,14 @@ export function extractProposedAction(
106
112
  if (actionSentences.length === 0) {
107
113
  return question.slice(0, MAX_ACTION_CHARS);
108
114
  }
109
- return actionSentences.join(" ").slice(0, MAX_ACTION_CHARS);
115
+ // The question can carry the action that the message does not name. It is
116
+ // assessed together with the sentences of the message: the risk of the
117
+ // proposal is the risk of everything that is proposed.
118
+ const questionIsAction = question.length > 0 && ACTION_VERBS.test(question);
119
+ const parts = questionIsAction
120
+ ? [...actionSentences, question]
121
+ : actionSentences;
122
+ return parts.join(" ").slice(0, MAX_ACTION_CHARS);
110
123
  }
111
124
 
112
125
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/knowledge-retrieval",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Knowledge retrieval via TencentDB-Agent-Memory MCP (RFC-0105)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/learning-engine",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Learning engine for extracting lessons from runtime execution (RFC-0058)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/logging",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "description": "Centralized structured application logging with buffered Cloudflare R2 and webhook transports",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/memory-engine",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Memory engine with OKF integration for durable knowledge management (RFC-0060)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/notification",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — notification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/paperclip-integration",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Paperclip API integration: poll agent inbox, route tasks to pi.dev, Telegram alerts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/performance-optimizer",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Performance optimization analyzer for pi-harness runtime (RFC-0056)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/privilege-broker",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Privilege Broker — capability registry and command executor for autonomous runtime (RFC-0101 §7)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/relay",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "type": "module",
5
5
  "description": "Cloud relay for remote access - T3 Connect style for pi-harness",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skills",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "File-based skill system with pi.dev compatibility and Hermes self-improvement",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/todo-bd-sync",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Two-way sync between rpiv-todo overlay and bd issue tracker",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-estimation",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — token-estimation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tooling-preference",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — JS/TS tooling preference (Biome vs ESLint/Prettier) proposal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Trajectory capture for the write-review loop — persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "pi-harness-runtime — tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/two-phase-review",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.476",
3
+ "version": "1.1.478",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",