pi-harness-runtime 1.1.467 → 1.1.469

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 (55) hide show
  1. package/AGENTS.md +52 -5
  2. package/CHANGELOG.md +93 -0
  3. package/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/auth/package.json +1 -1
  6. package/packages/autonomous-runtime/package.json +1 -1
  7. package/packages/checkpoint/package.json +1 -1
  8. package/packages/clipboard/package.json +1 -1
  9. package/packages/codex-watcher/package.json +1 -1
  10. package/packages/config-capture/package.json +1 -1
  11. package/packages/contracts/dist/workspace-env-format.d.ts +75 -0
  12. package/packages/contracts/dist/workspace-env-format.js +125 -12
  13. package/packages/contracts/dist/workspace-env.d.ts +24 -0
  14. package/packages/contracts/dist/workspace-env.js +439 -19
  15. package/packages/contracts/package.json +1 -1
  16. package/packages/contracts/src/workspace-env-format.ts +209 -12
  17. package/packages/contracts/src/workspace-env.ts +458 -20
  18. package/packages/cookie-sanitizer/package.json +1 -1
  19. package/packages/evaluation-engine/package.json +1 -1
  20. package/packages/event-bus/package.json +1 -1
  21. package/packages/event-store/package.json +1 -1
  22. package/packages/experience-replay/package.json +1 -1
  23. package/packages/file-copy-helper/package.json +1 -1
  24. package/packages/intent-analyzer/package.json +1 -1
  25. package/packages/jev-judge/dist/decision-context.d.ts +12 -0
  26. package/packages/jev-judge/dist/decision-context.d.ts.map +1 -1
  27. package/packages/jev-judge/dist/decision-context.js +144 -9
  28. package/packages/jev-judge/dist/decision-context.js.map +1 -1
  29. package/packages/jev-judge/package.json +1 -1
  30. package/packages/jev-judge/src/decision-context.ts +156 -8
  31. package/packages/knowledge-retrieval/package.json +1 -1
  32. package/packages/learning-engine/package.json +1 -1
  33. package/packages/logging/package.json +1 -1
  34. package/packages/memory-engine/package.json +1 -1
  35. package/packages/notification/package.json +1 -1
  36. package/packages/paperclip-integration/package.json +1 -1
  37. package/packages/performance-optimizer/package.json +1 -1
  38. package/packages/privilege-broker/package.json +1 -1
  39. package/packages/prompt-compiler/package.json +1 -1
  40. package/packages/providers/package.json +1 -1
  41. package/packages/qdrant-skills/package.json +1 -1
  42. package/packages/quota-manager/package.json +1 -1
  43. package/packages/relay/package.json +1 -1
  44. package/packages/skill-mcp-client/package.json +1 -1
  45. package/packages/skills/package.json +1 -1
  46. package/packages/todo-bd-sync/package.json +1 -1
  47. package/packages/token-estimation/package.json +1 -1
  48. package/packages/tooling-preference/package.json +1 -1
  49. package/packages/trajectory/package.json +1 -1
  50. package/packages/tui/package.json +1 -1
  51. package/packages/two-phase-review/package.json +1 -1
  52. package/packages/types/package.json +1 -1
  53. package/packages/webmcp-tester/package.json +1 -1
  54. package/packages/wiki/package.json +1 -1
  55. package/packages/write-review/package.json +1 -1
package/AGENTS.md CHANGED
@@ -730,9 +730,11 @@ bun run build && bun run start # Server deployment
730
730
  mode (`*_ENV`, `*_ENVIRONMENT`, `*_MODE`, `*_STAGE`, e.g. `AMOS_ENV`), then
731
731
  any other environment shaped key - and only then an environment shaped key
732
732
  of the process env → development/production/test
733
- - The facts about the repository (only when NO variable names the environment
734
- at all) → a published source repository without a runtime of its own is a
735
- development checkout; a `develop`/`development` branch is the fallback
733
+ - The facts about a Frappe bench (when no variable names a KNOWN mode) → the
734
+ bench is the runtime of a site: its facts name the mode
735
+ - The facts about the repository (when no variable names a KNOWN mode) → a
736
+ published source repository without a runtime of its own is a development
737
+ checkout; a `develop`/`development` branch is the fallback
736
738
  - System RAM → Low RAM warning (<4GB free, or a small machine (<16GB total)
737
739
  with less than 6GB free). The warning is about the headroom that is
738
740
  actually free, not about the size of the machine: a 15GB laptop with 6.5GB
@@ -753,8 +755,13 @@ desktop session, never the environment of a workspace. Some of them end in
753
755
  `_MODE` or `_ENV`, so they are excluded from the candidates by NAMESPACE,
754
756
  not by value: their value ("ubuntu", "wayland") says nothing about the mode.
755
757
 
756
- **The repository tier (last resort, never production).** It runs only when
757
- no variable names the environment at all. A published package (a
758
+ **The repository tier (never production).** It runs when no variable names a
759
+ KNOWN mode. A variable whose value names no known mode does not decide: a
760
+ virtualenv path (`VIRTUAL_ENV=/home/user/.venvs/app`) and a value this
761
+ detector does not know ("staging") say nothing about the environment of the
762
+ workspace, so the shape of the checkout may still name the mode. An explicit
763
+ `NODE_ENV` keeps deciding - a deliberate "staging" is not replaced by the
764
+ shape of the checkout. A published package (a
758
765
  `package.json` with a name, a version and declared content - `files`,
759
766
  `bin` or `publishConfig`) without a deployment configuration (no Dockerfile,
760
767
  compose file, Procfile, fly.toml, render.yaml, railway.json, vercel.json,
@@ -765,6 +772,41 @@ their own machine → `DEVELOPMENT (source-only repository)`. A branch named
765
772
  develop)`. A production branch is NEVER a development checkout, and this
766
773
  tier never claims production.
767
774
 
775
+ **The Frappe bench tier comes before the repository.** A bench is the runtime
776
+ of a Frappe site, so it says more about the environment than the shape of a
777
+ checkout. The bench is the workspace itself, one of its parents (a bench
778
+ holds its apps) or one of its children. The signals are weighed:
779
+
780
+ | Signal | Names | Weight |
781
+ |--------|-------|--------|
782
+ | supervisor manages the bench, nginx serves it | production | strong |
783
+ | a development server of the bench runs (`bench serve`) | development | strong |
784
+ | `developer_mode` on, `live_reload` on, a development branch | development | medium |
785
+ | a site in maintenance mode, `bench start` runs, a deployment configuration | production | medium |
786
+ | `developer_mode` off | production | weak |
787
+ | the scheduler is paused (`pause_scheduler`) | development | weak |
788
+
789
+ A strong signal decides, unless a strong signal of the other kind contradicts
790
+ it - then no mode is claimed. Otherwise the weights decide, and a tie is no
791
+ claim. `developer_mode` is deliberately NOT a strong signal: a production
792
+ bench with the flag left on is still a production bench, and a development
793
+ bench with the flag off is still a development bench. The label names the
794
+ deciding signals: `DEVELOPMENT (frappe bench: live reload on, git branch
795
+ develop)`.
796
+
797
+ **The repository is found in the workspace, in its parents, or in a child.**
798
+ `git rev-parse` walks up, so a folder inside a repository (a package of a
799
+ monorepo) finds the repository of its parent. When the workspace is not in a
800
+ repository at all, the children are searched (two levels deep, the heavy
801
+ directories are skipped, the first repository in a stable order wins): the
802
+ workspace is often the folder above the repository - the root of a monorepo, a
803
+ directory of applications, a directory of workspaces.
804
+
805
+ **The label names what decided.** A mode that came from the repository says
806
+ so: `DEVELOPMENT (source-only repository)`. When a variable was seen but did
807
+ not decide, the label names it too:
808
+ `DEVELOPMENT (source-only repository; VIRTUAL_ENV names no known mode)`.
809
+
768
810
  **This info is shown in UI and delivered to agent context:**
769
811
  ```text
770
812
  Workspace: ~/pi-harness-runtime | OS: Linux | mode: DEVELOPMENT (from AMOS_ENV in .env) | dev server: running | dev script: available | build script: available | RAM: 10/16
@@ -810,9 +852,14 @@ Check the .env and .env.* files of the workspace second
810
852
  (NODE_ENV, then an environment shaped key whose value names a mode,
811
853
  then any other environment shaped key)
812
854
  Only then an environment shaped key of the process env (e.g. AMOS_ENV)
855
+ A variable whose value names no known mode does not decide
856
+ (VIRTUAL_ENV, a path, a value this detector does not know)
857
+ Only then the facts about a Frappe bench
858
+ (the bench is the runtime of a site: its signals decide)
813
859
  Only then the facts about the repository
814
860
  (a published source repository without a runtime of its own,
815
861
  or a develop/development branch)
862
+ The repository is found in the workspace, in its parents, or in a child
816
863
  Presence of dev script = capability, not proof of mode
817
864
  UNKNOWN requires investigation, not auto-build
818
865
  Production detection ≠ deployment authorization
package/CHANGELOG.md CHANGED
@@ -2,6 +2,99 @@
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.469](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.469) (2026-11-07)
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:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
14
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
15
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
16
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
17
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
18
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
19
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
20
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
21
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
22
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
23
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
24
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
25
+ * **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
31
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
32
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
33
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
34
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
35
+ * **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
36
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
37
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
38
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
39
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
40
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
41
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
42
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
43
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
44
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
45
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
46
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
47
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
48
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
49
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
50
+ * **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
51
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
52
+
53
+ ### [1.1.468](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.468) (2026-11-07)
54
+
55
+
56
+ ### Features
57
+
58
+ * **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
59
+ * **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
60
+ * **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
61
+ * **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
62
+ * **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
63
+ * **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
64
+ * **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
65
+ * **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
66
+ * **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
67
+ * **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
68
+ * **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
69
+ * **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
70
+ * **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
71
+ * **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
72
+ * **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
73
+
74
+
75
+ ### Bug Fixes
76
+
77
+ * **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
78
+ * **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
79
+ * **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
80
+ * **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
81
+ * **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
82
+ * **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
83
+ * **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
84
+ * **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
85
+ * **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
86
+ * **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
87
+ * **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
88
+ * **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
89
+ * **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
90
+ * **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
91
+ * **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
92
+ * **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
93
+ * **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
94
+ * **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
95
+ * **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
96
+ * **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
97
+
5
98
  ### [1.1.467](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.467) (2026-11-07)
6
99
 
7
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "1.1.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
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.467",
3
+ "version": "1.1.469",
4
4
  "description": "Auto-capture API-fetched configuration values to AGENTS.md",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -233,6 +233,16 @@ export interface ModeResolution {
233
233
  mode: WorkspaceMode;
234
234
  hint: DotenvVar | null;
235
235
  source: "process.env" | ".env file" | null;
236
+ /**
237
+ * The variable decides the mode.
238
+ *
239
+ * A variable whose value names a known mode always decides. A variable
240
+ * whose value names no known mode ("staging", a virtualenv path) only
241
+ * decides when it is an explicit NODE_ENV: the shape of the checkout may
242
+ * still name the mode, and a deliberate "staging" must not be replaced by
243
+ * it.
244
+ */
245
+ decides?: boolean;
236
246
  }
237
247
  /**
238
248
  * The deployment configuration of a repository.
@@ -289,6 +299,71 @@ export interface RepositoryModeDetection {
289
299
  * 2. a branch that names a development line of work ("develop")
290
300
  */
291
301
  export declare function modeFromRepositoryFacts(facts: RepositoryFacts): RepositoryModeDetection | null;
302
+ /**
303
+ * The facts about a Frappe bench the workspace belongs to.
304
+ *
305
+ * A bench is the runtime of a Frappe site, and it says much more about the
306
+ * environment than a single flag. `developer_mode` in
307
+ * `sites/common_site_config.json` says that the developer conveniences are
308
+ * on - it does NOT say that the server is a development server. A bench that
309
+ * supervisor and nginx manage is a deployed bench, a bench that runs a
310
+ * development server is a bench somebody works on.
311
+ */
312
+ export interface FrappeBenchFacts {
313
+ /** The bench root ("" when the workspace is not inside a bench). */
314
+ benchRoot: string;
315
+ /**
316
+ * The `developer_mode` of the bench.
317
+ *
318
+ * null when the bench does not declare it.
319
+ */
320
+ developerMode: boolean | null;
321
+ /** A site of the bench is in maintenance mode. */
322
+ maintenanceMode: boolean | null;
323
+ /** The bench reloads the code on a change ("live_reload"). */
324
+ liveReload: boolean;
325
+ /** The scheduled jobs of the bench are paused ("pause_scheduler"). */
326
+ pauseScheduler: boolean;
327
+ /** A supervisor program group manages the bench. */
328
+ supervisorManaged: boolean;
329
+ /** Nginx serves the bench. */
330
+ nginxManaged: boolean;
331
+ /** The bench carries a deployment configuration (Dockerfile, compose, ...). */
332
+ deploymentMarker: boolean;
333
+ /** A development server of the bench runs ("bench serve"). */
334
+ devServerRunning: boolean;
335
+ /** A production-style run of the bench is active ("bench start"). */
336
+ productionRun: boolean;
337
+ /** The branch of the checkout the workspace belongs to ("" when unknown). */
338
+ branch: string;
339
+ }
340
+ /**
341
+ * A mode that the facts about a Frappe bench named.
342
+ */
343
+ export interface FrappeBenchModeDetection {
344
+ mode: WorkspaceMode;
345
+ /** The phrase that names the detection ("frappe bench: supervisor, nginx"). */
346
+ key: string;
347
+ }
348
+ /**
349
+ * Name the mode of a workspace from the facts about its Frappe bench.
350
+ *
351
+ * The bench is the runtime of a site, so its facts are stronger than the
352
+ * shape of the checkout. The signals are weighed:
353
+ *
354
+ * - a strong signal decides (supervisor, nginx, a running development
355
+ * server). Two strong signals of opposite kinds are a conflict: no mode is
356
+ * claimed, because the facts contradict each other.
357
+ * - otherwise the sum of the weights decides: the configuration of the bench
358
+ * (developer_mode, a site in maintenance, a deployment configuration, the
359
+ * branch) against the way it runs.
360
+ * - a tie is no claim: the bench does not say which environment it is.
361
+ *
362
+ * `developer_mode` is deliberately not a strong signal: a production bench
363
+ * with the flag left on is still a production bench, and a development bench
364
+ * with the flag off is still a development bench.
365
+ */
366
+ export declare function modeFromFrappeBenchFacts(facts: FrappeBenchFacts): FrappeBenchModeDetection | null;
292
367
  /**
293
368
  * Resolve the workspace mode from the variables that were found.
294
369
  *
@@ -440,6 +440,92 @@ export function modeFromRepositoryFacts(facts) {
440
440
  }
441
441
  return null;
442
442
  }
443
+ const BENCH_SIGNAL_WEIGHT = {
444
+ weak: 1,
445
+ medium: 2,
446
+ strong: 3,
447
+ };
448
+ /**
449
+ * Name the mode of a workspace from the facts about its Frappe bench.
450
+ *
451
+ * The bench is the runtime of a site, so its facts are stronger than the
452
+ * shape of the checkout. The signals are weighed:
453
+ *
454
+ * - a strong signal decides (supervisor, nginx, a running development
455
+ * server). Two strong signals of opposite kinds are a conflict: no mode is
456
+ * claimed, because the facts contradict each other.
457
+ * - otherwise the sum of the weights decides: the configuration of the bench
458
+ * (developer_mode, a site in maintenance, a deployment configuration, the
459
+ * branch) against the way it runs.
460
+ * - a tie is no claim: the bench does not say which environment it is.
461
+ *
462
+ * `developer_mode` is deliberately not a strong signal: a production bench
463
+ * with the flag left on is still a production bench, and a development bench
464
+ * with the flag off is still a development bench.
465
+ */
466
+ export function modeFromFrappeBenchFacts(facts) {
467
+ if (!facts.benchRoot)
468
+ return null;
469
+ const { development, production } = benchSignals(facts);
470
+ const strongDevelopment = development.filter((signal) => signal.strength === "strong");
471
+ const strongProduction = production.filter((signal) => signal.strength === "strong");
472
+ // A contradiction is not a mode: the facts say both, so nothing is claimed.
473
+ if (strongDevelopment.length > 0 && strongProduction.length > 0)
474
+ return null;
475
+ const score = (signals) => signals.reduce((total, signal) => total + BENCH_SIGNAL_WEIGHT[signal.strength], 0);
476
+ const developmentScore = score(development);
477
+ const productionScore = score(production);
478
+ if (developmentScore === productionScore)
479
+ return null;
480
+ const deciding = developmentScore > productionScore ? development : production;
481
+ const mode = developmentScore > productionScore ? "development" : "production";
482
+ return {
483
+ mode,
484
+ key: `frappe bench: ${deciding.map((signal) => signal.reason).join(", ")}`,
485
+ };
486
+ }
487
+ /**
488
+ * The signals of a bench, grouped by the environment they name.
489
+ */
490
+ function benchSignals(facts) {
491
+ const development = [];
492
+ const production = [];
493
+ if (facts.developerMode === true) {
494
+ development.push({ reason: "developer_mode on", strength: "medium" });
495
+ }
496
+ if (facts.developerMode === false) {
497
+ production.push({ reason: "developer_mode off", strength: "weak" });
498
+ }
499
+ if (facts.devServerRunning) {
500
+ development.push({ reason: "development server running", strength: "strong" });
501
+ }
502
+ if (facts.productionRun) {
503
+ production.push({ reason: "bench start running", strength: "medium" });
504
+ }
505
+ if (facts.supervisorManaged) {
506
+ production.push({ reason: "supervisor", strength: "strong" });
507
+ }
508
+ if (facts.nginxManaged) {
509
+ production.push({ reason: "nginx", strength: "strong" });
510
+ }
511
+ if (facts.maintenanceMode === true) {
512
+ production.push({ reason: "site in maintenance mode", strength: "medium" });
513
+ }
514
+ if (facts.liveReload) {
515
+ development.push({ reason: "live reload on", strength: "medium" });
516
+ }
517
+ if (facts.pauseScheduler) {
518
+ development.push({ reason: "scheduler paused", strength: "weak" });
519
+ }
520
+ if (facts.deploymentMarker) {
521
+ production.push({ reason: "deployment configuration", strength: "medium" });
522
+ }
523
+ const branch = facts.branch.trim().toLowerCase();
524
+ if (DEVELOPMENT_BRANCHES.has(branch)) {
525
+ development.push({ reason: `git branch ${branch}`, strength: "medium" });
526
+ }
527
+ return { development, production };
528
+ }
443
529
  /**
444
530
  * Resolve the workspace mode from the variables that were found.
445
531
  *
@@ -457,20 +543,27 @@ export function resolveWorkspaceMode(processVars, dotenvVars) {
457
543
  if (processNodeEnv) {
458
544
  const mode = modeFromValue(processNodeEnv.value);
459
545
  if (mode)
460
- return { mode, hint: processNodeEnv, source: "process.env" };
546
+ return { mode, hint: processNodeEnv, source: "process.env", decides: true };
461
547
  // An explicit NODE_ENV that names no known mode decides: the mode
462
548
  // stays unknown instead of falling through to the files.
463
- return { mode: "unknown", hint: processNodeEnv, source: "process.env" };
549
+ return { mode: "unknown", hint: processNodeEnv, source: "process.env", decides: true };
464
550
  }
465
551
  const dotenvHint = detectModeHint(dotenvVars, { allowValueMatch: true });
466
552
  if (dotenvHint) {
467
553
  const mode = modeFromValue(dotenvHint.value);
468
554
  if (mode)
469
- return { mode, hint: dotenvHint, source: ".env file" };
470
- // The workspace file is explicit - even when its value names no known
471
- // mode ("APP_MODE=staging"). It must not be replaced by an unrelated
472
- // variable of the process env.
473
- return { mode: "unknown", hint: dotenvHint, source: ".env file" };
555
+ return { mode, hint: dotenvHint, source: ".env file", decides: true };
556
+ // The workspace file is the declaration of the workspace: a value that
557
+ // names a known mode decides. A value that names no known mode
558
+ // ("APP_MODE=staging") does not decide - unless it is an explicit
559
+ // NODE_ENV, which is a deliberate value.
560
+ const explicit = dotenvHint.key === "NODE_ENV";
561
+ return {
562
+ mode: "unknown",
563
+ hint: dotenvHint,
564
+ source: ".env file",
565
+ decides: explicit,
566
+ };
474
567
  }
475
568
  // Last resort: an environment shaped key of the process env (the files
476
569
  // are silent).
@@ -478,10 +571,14 @@ export function resolveWorkspaceMode(processVars, dotenvVars) {
478
571
  if (processEnvHint) {
479
572
  const mode = modeFromValue(processEnvHint.value);
480
573
  if (mode)
481
- return { mode, hint: processEnvHint, source: "process.env" };
482
- return { mode: "unknown", hint: processEnvHint, source: "process.env" };
574
+ return { mode, hint: processEnvHint, source: "process.env", decides: true };
575
+ // The value names no known mode, so the variable does not decide: a
576
+ // virtualenv path (VIRTUAL_ENV) says nothing about the environment
577
+ // of the workspace, and the facts about the repository may still
578
+ // name the mode.
579
+ return { mode: "unknown", hint: processEnvHint, source: "process.env", decides: false };
483
580
  }
484
- return { mode: "unknown", hint: null, source: null };
581
+ return { mode: "unknown", hint: null, source: null, decides: false };
485
582
  }
486
583
  /**
487
584
  * The evidence entry that names the environment (if any).
@@ -515,12 +612,29 @@ function findDetectionEvidence(env) {
515
612
  export function describeWorkspaceMode(env) {
516
613
  const hint = findModeEvidence(env);
517
614
  const where = hint?.file ? ` in ${hint.file}` : "";
615
+ const detection = findDetectionEvidence(env);
616
+ // A variable decides only when its value names a known mode. When the
617
+ // repository named the mode instead, the variable was seen but did not
618
+ // decide, and the label says so.
619
+ const hintDecides = hint ? modeFromValue(hint.value) !== null : false;
518
620
  if (env.mode !== "unknown") {
621
+ if (detection && !hintDecides) {
622
+ const named = modeFromValue(detection.value);
623
+ if (named) {
624
+ // The variable was seen but did not decide: the label names it,
625
+ // so the reason for the mode stays visible.
626
+ let note = "";
627
+ if (hint) {
628
+ const state = hint.value ? "names no known mode" : "is empty";
629
+ note = `; ${hint.key}${where} ${state}`;
630
+ }
631
+ return `${env.mode.toUpperCase()} (${detection.key}${note})`;
632
+ }
633
+ }
519
634
  if (hint)
520
635
  return `${env.mode.toUpperCase()} (from ${hint.key}${where})`;
521
636
  // The mode came from the repository, not from a variable: the label
522
637
  // names the reason ("DEVELOPMENT (source-only repository)").
523
- const detection = findDetectionEvidence(env);
524
638
  if (detection)
525
639
  return `${env.mode.toUpperCase()} (${detection.key})`;
526
640
  return env.mode.toUpperCase();
@@ -544,7 +658,6 @@ export function describeWorkspaceMode(env) {
544
658
  }
545
659
  // A stale cache row can carry a detection next to an unknown mode: the
546
660
  // detection names a mode, so the mode is shown.
547
- const detection = findDetectionEvidence(env);
548
661
  if (detection) {
549
662
  const named = modeFromValue(detection.value);
550
663
  if (named)
@@ -22,6 +22,30 @@ export { collectDotenvVars, collectProcessEnvVars, describeCwdCommand, describeO
22
22
  export { canShowModeValue, isEnvShapedKey, isSecretLikeKey, MASKED_MODE_VALUE } from "./workspace-env-format.js";
23
23
  export { isTemplateDotenvName, listDotenvFiles, readDotenvFiles } from "./workspace-dotenv.js";
24
24
  export type { DotenvVar, EnvEvidence, ServerState, WorkspaceEnvResult, WorkspaceMode };
25
+ /**
26
+ * The child of a workspace that holds a repository.
27
+ *
28
+ * A workspace is often the folder above the repository: the root of a
29
+ * monorepo, a directory of applications, a directory of workspaces. The
30
+ * repository of such a workspace is below it, and the search finds the
31
+ * nearest one in a stable order.
32
+ *
33
+ * @param workspacePath The workspace
34
+ * @returns The directory that holds the repository ("" when there is none)
35
+ */
36
+ export declare function findRepositoryChild(workspacePath: string): string;
37
+ /**
38
+ * The child of a workspace that matches a predicate.
39
+ *
40
+ * A workspace is often the folder above the repository: the root of a
41
+ * monorepo, a directory of applications, a directory of workspaces. The
42
+ * nearest match in a stable order is returned.
43
+ *
44
+ * @param workspacePath The workspace
45
+ * @param matches The predicate of a directory
46
+ * @returns The directory that matches ("" when there is none)
47
+ */
48
+ export declare function findChildDirectory(workspacePath: string, matches: (directory: string) => boolean): string;
25
49
  /**
26
50
  * Detect and store workspace environment
27
51
  */