ptbk 0.119.0-21 → 0.119.0-26

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 (223) hide show
  1. package/README.md +16 -9
  2. package/dist/browser/browser.d.ts +50 -36
  3. package/dist/browser/browser.js +162 -118
  4. package/dist/browser/browser.js.map +1 -1
  5. package/dist/browser/fleet.d.ts +59 -0
  6. package/dist/browser/fleet.js +148 -0
  7. package/dist/browser/fleet.js.map +1 -0
  8. package/dist/browser/recording.js +2 -2
  9. package/dist/browser/recording.js.map +1 -1
  10. package/dist/chats/conversation.d.ts +1 -1
  11. package/dist/chats/conversation.js +8 -6
  12. package/dist/chats/conversation.js.map +1 -1
  13. package/dist/chats/local.js +5 -5
  14. package/dist/chats/local.js.map +1 -1
  15. package/dist/cli/commands/add.js +1 -1
  16. package/dist/cli/commands/add.js.map +1 -1
  17. package/dist/cli/commands/boilerplates.js +1 -1
  18. package/dist/cli/commands/boilerplates.js.map +1 -1
  19. package/dist/cli/commands/find.js +1 -1
  20. package/dist/cli/commands/find.js.map +1 -1
  21. package/dist/cli/commands/fix.js +9 -4
  22. package/dist/cli/commands/fix.js.map +1 -1
  23. package/dist/cli/commands/init.d.ts +5 -0
  24. package/dist/cli/commands/init.js +279 -118
  25. package/dist/cli/commands/init.js.map +1 -1
  26. package/dist/cli/commands/migrate.js +1 -1
  27. package/dist/cli/commands/migrate.js.map +1 -1
  28. package/dist/cli/commands/ping.js +20 -12
  29. package/dist/cli/commands/ping.js.map +1 -1
  30. package/dist/cli/commands/plan.js +20 -12
  31. package/dist/cli/commands/plan.js.map +1 -1
  32. package/dist/cli/commands/recover.js +1 -1
  33. package/dist/cli/commands/recover.js.map +1 -1
  34. package/dist/cli/commands/restart.js +6 -5
  35. package/dist/cli/commands/restart.js.map +1 -1
  36. package/dist/cli/commands/run.js +26 -15
  37. package/dist/cli/commands/run.js.map +1 -1
  38. package/dist/cli/commands/start.js +11 -7
  39. package/dist/cli/commands/start.js.map +1 -1
  40. package/dist/cli/commands/tool.d.ts +19 -0
  41. package/dist/cli/commands/tool.js +320 -0
  42. package/dist/cli/commands/tool.js.map +1 -0
  43. package/dist/cli/commands/verify.js +1 -1
  44. package/dist/cli/commands/verify.js.map +1 -1
  45. package/dist/cli/common.d.ts +7 -1
  46. package/dist/cli/common.js +37 -20
  47. package/dist/cli/common.js.map +1 -1
  48. package/dist/cli/compatibility.d.ts +8 -0
  49. package/dist/cli/compatibility.js +32 -0
  50. package/dist/cli/compatibility.js.map +1 -0
  51. package/dist/cli/parser.js +7 -3
  52. package/dist/cli/parser.js.map +1 -1
  53. package/dist/cli/registry.js +182 -7
  54. package/dist/cli/registry.js.map +1 -1
  55. package/dist/cli/service-view.js +1 -1
  56. package/dist/cli/service-view.js.map +1 -1
  57. package/dist/cli/sources.js +2 -0
  58. package/dist/cli/sources.js.map +1 -1
  59. package/dist/cli/spec.js +8 -6
  60. package/dist/cli/spec.js.map +1 -1
  61. package/dist/common/naming.d.ts +53 -0
  62. package/dist/common/naming.js +90 -0
  63. package/dist/common/naming.js.map +1 -0
  64. package/dist/engine/agenda.d.ts +70 -9
  65. package/dist/engine/agenda.js +294 -61
  66. package/dist/engine/agenda.js.map +1 -1
  67. package/dist/engine/executor.d.ts +5 -0
  68. package/dist/engine/executor.js +24 -11
  69. package/dist/engine/executor.js.map +1 -1
  70. package/dist/engine/harnesses.d.ts +82 -18
  71. package/dist/engine/harnesses.js +191 -39
  72. package/dist/engine/harnesses.js.map +1 -1
  73. package/dist/engine/preview.js +2 -2
  74. package/dist/engine/preview.js.map +1 -1
  75. package/dist/engine/routing.d.ts +10 -0
  76. package/dist/engine/routing.js +67 -28
  77. package/dist/engine/routing.js.map +1 -1
  78. package/dist/engine/snapshot.d.ts +107 -7
  79. package/dist/engine/state.d.ts +4 -2
  80. package/dist/engine/state.js.map +1 -1
  81. package/dist/engine/sync.d.ts +96 -0
  82. package/dist/engine/sync.js +199 -0
  83. package/dist/engine/sync.js.map +1 -0
  84. package/dist/engine/team.d.ts +1 -0
  85. package/dist/engine/team.js +12 -8
  86. package/dist/engine/team.js.map +1 -1
  87. package/dist/expert/_main.md +96 -67
  88. package/dist/expert/agents/_index.md +10 -7
  89. package/dist/expert/agents/core-agents.md +4 -2
  90. package/dist/expert/agents/fixer.md +15 -12
  91. package/dist/expert/cli/acceptance.md +96 -78
  92. package/dist/expert/cli/api.md +26 -14
  93. package/dist/expert/cli/autonomous-operation.md +17 -19
  94. package/dist/expert/cli/browser.md +24 -24
  95. package/dist/expert/cli/checks.md +18 -10
  96. package/dist/expert/cli/cli.md +48 -41
  97. package/dist/expert/cli/configuration-migrations.md +43 -0
  98. package/dist/expert/cli/configuration.md +24 -14
  99. package/dist/expert/cli/controls.md +23 -11
  100. package/dist/expert/cli/dashboard-details.md +28 -10
  101. package/dist/expert/cli/dashboard-layout.md +15 -15
  102. package/dist/expert/cli/dashboard.md +8 -10
  103. package/dist/expert/cli/environment.md +33 -0
  104. package/dist/expert/cli/execution.md +10 -8
  105. package/dist/expert/cli/git-persistence.md +27 -21
  106. package/dist/expert/cli/git-preflight.md +8 -4
  107. package/dist/expert/cli/git-synchronization.md +32 -6
  108. package/dist/expert/cli/harness-plugins.md +12 -12
  109. package/dist/expert/cli/harnesses.md +22 -16
  110. package/dist/expert/cli/initialization-ui.md +14 -14
  111. package/dist/expert/cli/initialization.md +31 -21
  112. package/dist/expert/cli/installation.md +6 -0
  113. package/dist/expert/cli/isolation.md +5 -3
  114. package/dist/expert/cli/releasing.md +17 -3
  115. package/dist/expert/cli/retries.md +10 -8
  116. package/dist/expert/cli/run.md +7 -5
  117. package/dist/expert/cli/start.md +21 -15
  118. package/dist/expert/cli/status-view.md +15 -17
  119. package/dist/expert/cli/synchronization-setup.md +24 -0
  120. package/dist/expert/cli/terminal.md +14 -16
  121. package/dist/expert/cli/tool-management.md +60 -0
  122. package/dist/expert/cli/tool-runtime.md +35 -0
  123. package/dist/expert/cli/tools-migration.md +50 -0
  124. package/dist/expert/cli/tools.md +73 -0
  125. package/dist/expert/cli/trace-configuration.md +9 -11
  126. package/dist/expert/cli/updates.md +7 -7
  127. package/dist/expert/cli/windows-installer.md +67 -0
  128. package/dist/expert/cli/workspace.md +2 -0
  129. package/dist/expert/coding-standards/_index.md +11 -0
  130. package/dist/expert/coding-standards/naming.md +30 -0
  131. package/dist/expert/coding-standards/shared-logic.md +27 -0
  132. package/dist/expert/concepts/automatic-repair.md +33 -0
  133. package/dist/expert/concepts/engine-and-project.md +7 -5
  134. package/dist/expert/dictionary.md +18 -18
  135. package/dist/harness/plugins/claude-code/index.js +4 -2
  136. package/dist/harness/plugins/claude-code/index.js.map +1 -1
  137. package/dist/harness/plugins/cline/index.js +1 -0
  138. package/dist/harness/plugins/cline/index.js.map +1 -1
  139. package/dist/harness/plugins/gemini/index.js +2 -0
  140. package/dist/harness/plugins/gemini/index.js.map +1 -1
  141. package/dist/harness/plugins/github-copilot/index.js +1 -0
  142. package/dist/harness/plugins/github-copilot/index.js.map +1 -1
  143. package/dist/harness/plugins/openai-codex/index.js +13 -9
  144. package/dist/harness/plugins/openai-codex/index.js.map +1 -1
  145. package/dist/harness/plugins/opencode/index.js +1 -0
  146. package/dist/harness/plugins/opencode/index.js.map +1 -1
  147. package/dist/harness/plugins/qwen-code/index.js +1 -0
  148. package/dist/harness/plugins/qwen-code/index.js.map +1 -1
  149. package/dist/harness/types.d.ts +16 -5
  150. package/dist/project/config.d.ts +135 -48
  151. package/dist/project/config.js +331 -119
  152. package/dist/project/config.js.map +1 -1
  153. package/dist/project/configuration.d.ts +43 -0
  154. package/dist/project/configuration.js +165 -0
  155. package/dist/project/configuration.js.map +1 -0
  156. package/dist/project/defaults.d.ts +4 -2
  157. package/dist/project/defaults.js +10 -5
  158. package/dist/project/defaults.js.map +1 -1
  159. package/dist/project/git.d.ts +28 -0
  160. package/dist/project/git.js +81 -0
  161. package/dist/project/git.js.map +1 -1
  162. package/dist/project/migrations.d.ts +96 -0
  163. package/dist/project/migrations.js +301 -0
  164. package/dist/project/migrations.js.map +1 -0
  165. package/dist/project/publication.d.ts +57 -0
  166. package/dist/project/publication.js +117 -0
  167. package/dist/project/publication.js.map +1 -0
  168. package/dist/project/readiness.d.ts +14 -5
  169. package/dist/project/readiness.js +23 -22
  170. package/dist/project/readiness.js.map +1 -1
  171. package/dist/project/setup.js +2 -0
  172. package/dist/project/setup.js.map +1 -1
  173. package/dist/service/actions.d.ts +12 -4
  174. package/dist/service/actions.js +32 -2
  175. package/dist/service/actions.js.map +1 -1
  176. package/dist/service/control.d.ts +1 -1
  177. package/dist/service/control.js +1 -1
  178. package/dist/service/host.d.ts +5 -2
  179. package/dist/service/host.js +26 -16
  180. package/dist/service/host.js.map +1 -1
  181. package/dist/service/http.js +7 -2
  182. package/dist/service/http.js.map +1 -1
  183. package/dist/service/launcher.d.ts +2 -1
  184. package/dist/service/launcher.js +1 -0
  185. package/dist/service/launcher.js.map +1 -1
  186. package/dist/service/records.d.ts +3 -0
  187. package/dist/service/records.js +1 -1
  188. package/dist/service/records.js.map +1 -1
  189. package/dist/service/spa/app.css +39 -0
  190. package/dist/service/spa/app.js +242 -39
  191. package/dist/service/worker.js +1 -0
  192. package/dist/service/worker.js.map +1 -1
  193. package/dist/tools/environment.d.ts +122 -0
  194. package/dist/tools/environment.js +199 -0
  195. package/dist/tools/environment.js.map +1 -0
  196. package/dist/tools/model.d.ts +180 -0
  197. package/dist/tools/model.js +111 -0
  198. package/dist/tools/model.js.map +1 -0
  199. package/dist/tools/normalize.d.ts +51 -0
  200. package/dist/tools/normalize.js +321 -0
  201. package/dist/tools/normalize.js.map +1 -0
  202. package/dist/tools/operations.d.ts +198 -0
  203. package/dist/tools/operations.js +378 -0
  204. package/dist/tools/operations.js.map +1 -0
  205. package/dist/tools/readiness.d.ts +72 -0
  206. package/dist/tools/readiness.js +160 -0
  207. package/dist/tools/readiness.js.map +1 -0
  208. package/dist/ui/dashboard.d.ts +3 -0
  209. package/dist/ui/dashboard.js +173 -2
  210. package/dist/ui/dashboard.js.map +1 -1
  211. package/dist/ui/details.d.ts +35 -1
  212. package/dist/ui/details.js +103 -2
  213. package/dist/ui/details.js.map +1 -1
  214. package/dist/ui/secret.d.ts +8 -0
  215. package/dist/ui/secret.js +41 -0
  216. package/dist/ui/secret.js.map +1 -0
  217. package/dist/ui/status-view.d.ts +1 -0
  218. package/dist/ui/status-view.js +33 -8
  219. package/dist/ui/status-view.js.map +1 -1
  220. package/dist/ui/tool-forms.d.ts +24 -0
  221. package/dist/ui/tool-forms.js +133 -0
  222. package/dist/ui/tool-forms.js.map +1 -0
  223. package/package.json +1 -1
@@ -1,39 +1,37 @@
1
1
  # Unattended agenda operation
2
2
 
3
- [Main specification](../_main.md) · [Start](start.md)
3
+ [Main specification](../_main.md) · [Start](start.md) · [Automatic repair principle](../concepts/automatic-repair.md)
4
4
 
5
- **Once started, the agenda must keep doing useful authorized work without routine human attendance.** Keeping a daemon alive while its queue silently waits for a trivial question is not successful autonomous operation. This is a primary product requirement across scheduling, agents, harnesses, browser use, repairs and persistence.
5
+ **Once started, the agenda should keep doing useful authorized work without routine human attendance.** An alive service silently waiting for trivial decisions does not satisfy this primary product requirement. The separate [automatic-repair contract](../concepts/automatic-repair.md) is a first-class foundation across scheduling, configuration, migrations, tools, execution, persistence and synchronization, not an incidental Fixer implementation detail.
6
6
 
7
7
  ## Attended setup, unattended work
8
8
 
9
- [Initialization](initialization.md) is a finite attended phase for project intent, configuration, known access requirements and usable tools. It ends by starting the service. After that, neither the launching terminal nor a terminal/browser dashboard needs to remain open. The dashboard is a monitoring/control point, not an operator required to advance each task.
9
+ Init is finite attended setup for intent, choices, known access and initially usable tools. It ends with background start, without needing an open launching terminal/dashboard. The cockpit observes and directs work; it is not an operator required to advance every task. The simple check placeholder is honest absent automated validation, not another setup question or readiness gate.
10
10
 
11
- Begin the initial Expert task automatically and continue with eligible tasks and their follow-ups. Perform Manager assignment, due recurrence and goal discovery through the existing normal lifecycle. Respect legitimate future schedules, cooldowns, explicit pauses, task dependencies and an empty queue; autonomous does not mean inventing pointless work or making paid calls while idle.
11
+ Begin Expert bootstrap and continue eligible work/follow-ups, Manager assignment, recurrence and due discovery through the ordinary lifecycle. Respect schedules, cooldowns, explicit pause/stop, dependencies and legitimate idle. Autonomy does not mean pointless work or paid calls while waiting.
12
12
 
13
- ## Avoid routine approval stalls
13
+ ## Ordinary recovery before human decisions
14
14
 
15
- Use project intent, task instructions, established rules, available context and already granted permissions to resolve ordinary choices. Do not ask the user to repeat the task, confirm every tool call, choose routine implementation details or reapprove each instance of an explicitly authorized recurring action. For example, an authorized agenda for publishing AI news to a specified Facebook account should publish under its established rules without asking "May I post?" on each occurrence.
15
+ Use task intent, project rules, existing context and granted authority to resolve routine choices. Do not repeat every task question, tool approval or permission for an already authorized recurring action. Harnesses use supported noninteractive execution within project scope; detect real hidden prompts/stalls without treating normal silence as failure.
16
16
 
17
- Selected harnesses run in their supported noninteractive/autonomous mode within the project's authority. Their permission configuration must not secretly turn unattended execution into a terminal prompt. Detect stalled subprocesses and unexpected input requests, retain diagnostics, and recover or classify the affected task rather than hang forever on invisible stdin. Do not treat ordinary lack of output during real work as proof of a stall.
17
+ Resolve deterministic problems safely, with bounded reconnect/retry/backoff, native refresh, tool fallback, profile ownership checks, check repair and correct-phase persistence retry. Known configuration spelling fixes commit their scoped changes. Difficult/ambiguous problems route to ordinary Fixer, which can consult other agents and by default User, learning verified preferences through normal Teacher work. The user may customize its all/some/no-consultation policy; no privileged worker or special question channel is introduced.
18
18
 
19
- Resolve recoverable technical problems automatically within bounded budgets: reconnect, back off for provider/network availability, reuse valid authentication, recheck transient browser ownership, repair check failures and resume failed persistence at the correct phase. A provider reset, remote-tunnel outage or temporary sharing error is not automatically a question for the user. Never repeat successful external effects just because saving a result failed.
19
+ A missing/disabled/unavailable browser or harness is a concrete resource wait, not technical engine exit or pause. Refresh tools/configuration/`.env` before tasks and during active/idle states; newly added tools may serve current work. Do not undo deliberate disablement. Fixer also needs resources: preserve its pending problem rather than pretending it executes without a harness.
20
20
 
21
- ## Exceptional human involvement
21
+ Git synchronization is independent of local execution. Failed pull/push stays pending with backoff while safe local tasks and commits continue. Preserve dirty work, use visible immutable merges and hand difficult conflicts to the shared repair path. Do not rerun successful external effects just because saving/publishing a result failed.
22
22
 
23
- Create or continue an **agent-authored [human chat](user-interactions.md)** only for a concrete condition the system cannot safely resolve, such as required login/2FA, genuinely missing authority, an irreconcilable user edit, or a consequential ambiguity not settled by the task. Explain what is blocked, what recovery was attempted and the minimum action needed. Retain one actionable waiting conversation and notify through the configured channels; do not repeatedly ask the same question or require a dashboard to be open for its record to exist.
23
+ ## Genuine human involvement and authority
24
24
 
25
- Autonomy is not blanket permission: authenticated access alone does not authorize unrelated publication, purchases, destructive changes or spending. Preserve task/project boundaries, paid-use limits, explicit review requirements and platform safeguards. Silence is never a new approval. Do not bypass authentication or weaken rules to avoid reporting an exceptional blocker.
25
+ An agent can ask its team when a problem requires help under its current instructions, such as login/2FA, missing authority, an irreconcilable user edit or consequential ambiguity. Retain the ordinary attributed question with context and minimum needed action; suppress repeated unresolved notifications for the same condition. Transport/presentation follows existing [human interaction](user-interactions.md), not a new autofix-specific mechanism.
26
26
 
27
- Checkpoint blocked work and release its resources when safe so independent eligible work can continue, still with at most one executing project task. Waiting tasks are not completed tasks. If owned edits, an unresolved external effect or a shared resource make switching unsafe, report that specific project-wide blocker; never overlap mutations or hide the risk merely to keep the queue moving. After a reply or recovered prerequisite, resume the correct phase automatically without another Start/Run action.
27
+ Minimal user interruption is a default policy, not permission to ignore explicit review instructions or remove the user from decision-making against their wishes. Authenticated access alone never authorizes unrelated purchases/publication/destruction, extra billing accounts or bypassing safeguards. No consultation policy can invent missing authority or treat silence as approval.
28
28
 
29
- ## Continuity and observability
29
+ Checkpoint task-local blockers and release resources where safe so independent work can continue with one task owner. Waiting is not completion. If shared edits or uncertain external effects make switching unsafe, report that concrete project-wide blocker instead of overlapping mutations. A failed synchronization alone is not such a blocker; preserve/defer remote integration safely. Resume the correct phase after repair/reply without another Start/Run action.
30
30
 
31
- Persist work, waits, retry opportunities and effect evidence across process restarts. Use [recovery](recovery.md) and [startup persistence](persistence.md) rather than routine manual restarts. An explicit stop remains effective until an authorized start, including the start operation in a subsequent explicit init. Distinguish working, scheduled idle, automatic recovery, waiting for provider, task-local human wait and a genuine project-wide blocker.
31
+ ## Continuity and acceptance
32
32
 
33
- Provide per-task [audit traces](traces.md), not merely a global log. Optional monitoring, tunnel or recording degradation must not unnecessarily stop otherwise safe work; report any missing evidence honestly. Resource use and retries remain bounded. A month-long unattended run is a product scenario, not a promise that a sleeping/offline machine or an expired external account can execute work.
33
+ Persist work, waits, retry opportunities and effect evidence across restarts under [recovery](recovery.md) and [startup persistence](persistence.md). Deliberate stop remains effective until an authorized start. Distinguish active work, scheduled idle, resource/provider waits, automatic recovery, human waits and real unsafe ownership.
34
34
 
35
- ## Acceptance outcomes
35
+ Retain per-task [traces](traces.md). Optional tunnel/recording degradation must not unnecessarily halt safe work; report missing evidence honestly and keep resources/retries bounded. Extended unattended operation is not a guarantee that a sleeping machine, revoked account or unavailable provider can perform work.
36
36
 
37
- With an awake supported host, available dependencies, an authenticated selected browser and a configured, authorized recurring AI-news publishing agenda, leave all dashboards closed for a simulated month. Scheduled work and follow-ups continue without routine confirmation; returning users can inspect each result, task name, Git history and retained logs/video. Include temporary network/provider failures and restarts: work resumes without duplicated posts or model calls for idle waits.
38
-
39
- Inject an avoidable harness confirmation and a recoverable technical failure: neither silently stops the agenda awaiting an operator. Inject genuine expired authentication or missing authority: retain one clear agent-authored waiting chat, preserve effects and continue independent work where safe. Resume after resolution without manual dispatch. Explicit review requirements and stop/pause controls remain respected.
37
+ With an awake supported host and an authorized recurring publishing agenda, simulate a month without dashboards: eligible work continues without routine confirmation and retained task/Git evidence explains outcomes. Inject provider/network failures, hidden prompts and restarts; recover without duplicated publication or idle paid loops. Inject genuine authentication/authority requirements and honor configured consultation policy. Disable the last tool, observe a running wait, then add one from another terminal and resume automatically. Preserve explicit pause/stop and review requirements throughout.
@@ -1,44 +1,44 @@
1
- # Shared project browser and profile selection
1
+ # Browser tools and profile selection
2
2
 
3
- [Main specification](../_main.md) · [Initialization](initialization.md) · [Project configuration](configuration.md)
3
+ [Main specification](../_main.md) · [Tools](tools.md) · [Live tool use](tool-runtime.md) · [Initialization](initialization.md)
4
4
 
5
- Each selected project has one browser configuration and, while active, one coordinated browser instance shared by its agents. Automation ownership is **per project**, not one process per agent/task/harness; underlying **profile storage may be shared across projects** when selected. Browser website sessions and harness/model authentication are independent.
5
+ A project may configure **multiple named browser tools**. Each enabled/acquired instance has coordinated automation ownership shared by the project's agents, not a separate browser per agent/task/harness. Browser storage may also be shared across projects when explicitly selected. Browser website sessions and harness/model authentication remain independent.
6
6
 
7
- ## Four explicit profile sources
7
+ Normal init still configures one browser through its familiar simple choices. More profiles, accounts and browsers are added later through the common [tool management](tool-management.md). No advanced pooling wizard is required.
8
8
 
9
- Offer all four choices during attended init and equivalent noninteractive configuration:
9
+ ## Four explicit profile sources
10
10
 
11
- 1. **Promptbook-managed global profile (DEFAULT):** create a dedicated persistent Chrome-compatible profile in the OS user's Promptbook application-data location on first use, and reuse that Promptbook-only profile for other projects on the same machine/account. It is not the regular Chrome profile, is not copied from it and does not live in a project directory.
12
- 2. **Isolated project profile:** create/reuse an independent persistent profile under the project's ignored `.ptbk/`. No other project implicitly gets that profile.
13
- 3. **User's existing Chrome profile:** explicitly reuse the ordinary Chrome-compatible profile and its authenticated sessions. Never select/copy it implicitly.
14
- 4. **Custom existing profile path:** use a user-supplied path elsewhere on the permitted machine.
11
+ Each browser tool stores `profile.source` and, where appropriate, `profile.path`:
15
12
 
16
- Save the per-project selection as a portable source kind in `ptbk.json`; resolve the managed global path for the current OS user at runtime. Do not version machine-specific global absolute paths or session secrets. Isolated storage is project-relative. Explicit custom paths follow precedence and existence/ownership checks. Existing selections survive reinit; the new default applies only when no choice is saved. Do not silently migrate cookies/sessions while switching; explain sharing/privacy tradeoffs.
13
+ 1. **MANAGED_GLOBAL (default):** a dedicated persistent Chrome-compatible profile in the OS user's Promptbook app-data location, reused by that user's projects. It is not personal Chrome, is not copied from it and does not live in a versioned project directory.
14
+ 2. **PROJECT:** an isolated persistent profile under the project's ignored `.ptbk/`, with separate storage for separately configured instances unless sharing is explicit.
15
+ 3. **USER_EXISTING:** the user's explicitly selected ordinary Chrome-compatible profile and sessions, never selected/copied implicitly.
16
+ 4. **CUSTOM:** an explicit existing profile path on the permitted machine.
17
17
 
18
- Headless/headful is independent of profile source. `--browser-profile <path>` and `--browser-mode headless|headful` are temporary overrides, not saved-default writes. Shared controls switch safely at a boundary. All four sources retain sessions across engine/system restarts, subject to site expiry.
18
+ Resolve portable sources at runtime. Preserve existing selections/sessions on reinit and migration; never silently copy cookies when switching. Explain sharing/privacy tradeoffs. Multiple records referencing the same underlying profile do not constitute separate logged-in identities and still obey exclusive safe ownership. Distinct Facebook accounts require distinct profile/session contexts.
19
19
 
20
- ## Shared profiles and safe ownership
20
+ `isHeadless` is independent of profile source and defaults to the existing headless behavior. Temporary legacy `--browser-profile` and `--browser-mode headless|headful` overrides apply only when their target instance is unambiguous; with multiple browsers require an explicit named target rather than silently modifying all. Saved management uses per-tool fields. All sources retain sessions across engine/system restarts, subject to actual site expiry.
21
21
 
22
- A global Promptbook profile can be reused across projects, but sharing never authorizes competing processes to lock/corrupt it. Coordinate safe handover/serialization. Never seize/copy a busy profile or kill an unrelated user browser. Each project still has one automation owner at a time. Report known busy/conflicting ownership and retry or request genuinely necessary user action. Personal/custom shared profiles require the same checks.
22
+ ## Choosing and owning browsers
23
23
 
24
- Profile contents, cookies and tokens never enter Git, trace text, chat Books or model-visible context as credentials. Promptbook is not a password database. Attended setup resolves known logins when possible; later login/2FA needs become attributed [human chats](user-interactions.md), with a genuine browser action on a desktop. Headless hosts must not pretend a window appeared. Preserve authorization and unattended-work constraints.
24
+ Use task purpose, tool names/descriptions, permissions and actual session state to choose the appropriate browser. A project can prefer its dedicated browser, then try an explicitly configured personal browser when the needed login is absent, or route Facebook and LinkedIn work to separate profiles. A fallback must still match the intended account and authorized action; a logged-in different account is not automatic permission to post/pay from it.
25
25
 
26
- ## Inspection, automatic diagnosis and recovery
26
+ Coordinate use of each profile across instances/projects; never corrupt a busy profile, seize/copy it, kill an unrelated browser or bypass another owner. Keep actual in-use/draining state per named tool. Disabling/removal affects new selections; a previously acquired use may continue only under [in-use confirmation rules](tool-management.md). Removing a configuration record never deletes its profile.
27
27
 
28
- The engine exposes its **effective** browser/profile source, resolved profile path, selected browser, headless/headful mode, known launch/connection health and ownership/busy state to authorized controls. Distinguish active configuration, saved defaults and pending changes. A profile path is diagnostic data, not permission to disclose its contents or credentials. Unknown/not-started state is labelled rather than inferred from a saved configuration.
28
+ Cookies, tokens and profile contents never enter Git, text traces, chat Books or model-visible credentials. Promptbook is not a password database. Resolve known login needs during attended setup where possible; later login/2FA uses ordinary human interaction. Headless hosts must not pretend a desktop window appeared.
29
29
 
30
- Detect launch failures, lost connections and known ownership conflicts automatically. Retain the actual redacted cause/evidence, recovery actions and outcomes; use bounded safe retries/repair under ordinary [retry](retries.md) and [unattended-operation](autonomous-operation.md) rules. A healthy recovery must not depend on an open dashboard or routine human Restart clicks. Explain the remaining blocker and next retry/action when automatic repair cannot safely succeed.
30
+ ## Inspection and recovery
31
31
 
32
- Shared controls provide diagnostic recheck, retry startup and restart of the **project's owned browser**. Manual controls call the same engine-owned diagnosis/recovery operations, with visible accepted, deferred, successful or failed outcomes. Preserve selected profile and sessions; do not silently switch to a fresh profile, erase login data, kill all Chrome/Node processes or restart the engine as a substitute for browser repair.
32
+ Expose each tool's saved and effective variant/profile source, resolved path for authorized inspection, headless mode, launch/connection health, ownership and current/retained uses. Distinguish configured, enabled, not-started, usable and actually active. A path is diagnostic information, not permission to expose its contents. Also identify which browser the current task actually uses, rather than displaying the first saved browser as active.
33
33
 
34
- If browser use or profile ownership makes an immediate restart unsafe, wait for a safe boundary or explain why it cannot proceed. Never terminate another project's/user's browser to satisfy a restart request. Preserve the active task's checkpoint/evidence and avoid replaying external effects after reconnect. Coordinate simultaneous automatic/manual repair so it cannot launch duplicate owners or restart the browser twice unknowingly.
34
+ Automatically diagnose launch failures, lost connections and ownership conflicts. Preserve actual redacted evidence, recovery attempts and outcomes; use bounded retries and the shared [automatic repair principle](../concepts/automatic-repair.md). Recovery cannot depend on an open dashboard or routine Restart clicks. Explain a remaining blocker and next retry/action.
35
35
 
36
- The [browser detail panel](dashboard-details.md) presents this information and controls separately from compact main status. A significant failure remains visible in main attention/activity while details are closed. Runtime-only diagnostics/restarts create no Git commits; explicitly saved configuration follows normal authoring rules.
36
+ Manual recheck, retry-start and restart target one named **project-owned browser** and call the same engine-owned recovery operations. Preserve profile/session state, task checkpoints and effect evidence. Do not switch to an empty profile, erase data, kill all browsers or restart the whole engine as a substitute for one-browser repair. Defer an unsafe restart to a safe boundary and label it; never terminate another project's/user's browser. Coordinate automatic/manual recovery to avoid duplicate owners or duplicate effects.
37
37
 
38
- ## Task evidence
38
+ The [tools/browser detail view](dashboard-details.md) shows these controls with compact failure summaries in the main cockpit. Inspection and runtime repair create no commit; explicitly saved tool changes do. No enabled/usable browser is a running engine's resource wait, not evidence that the service is stopped.
39
39
 
40
- When enabled, record only attributable task browser activity in headless/headful use, with separate attempts/occurrences under the task's [source-filename-based trace directory](traces.md). Mask authentication material and exclude unrelated desktop/other-project activity. Recording/video Git inclusion remain independent of profile choice. Unsupported/failed recording is explicit; optional capture failure does not unnecessarily block safe work. Neither stopping Promptbook nor restarting its browser deletes a persistent profile.
40
+ ## Task evidence and acceptance
41
41
 
42
- ## Acceptance outcomes
42
+ Record only attributable activity from the browsers actually used by the task when [recording is enabled](trace-configuration.md). Separate tool/attempt attribution under the task's source-filename trace directory; exclude unrelated desktop and other-project activity and mask authentication data. Recording failure is explicit but need not block otherwise safe work. Stopping/restarting a tool or engine never deletes persistent profiles.
43
43
 
44
- Initialize two projects with defaults: both reuse the dedicated managed global profile without touching personal Chrome. Verify isolated, personal and custom sources, preserved choices on reinit, independent headless/headful/recording flags and safe concurrent ownership. Inspect the actual resolved profile in each mode. Inject launch/connection failure, observe automatic bounded recovery with no dashboard, then use recheck/retry/restart manually. Report true outcomes and deferred busy ownership; retain sessions and task provenance without unrelated kills, duplicate browser owners or secret disclosure.
44
+ Verify default managed-profile reuse, isolated/personal/custom sources, multiple website/account profiles, preserved migration choices and safe shared-profile ownership. Add a new usable browser during a task and select it without restart. Test per-instance diagnostics, bounded automatic recovery, manual restart, retained in-use configuration and last-enabled-browser confirmation. No operation may silently change the target account, disclose secrets, duplicate effects or kill unrelated browsers.
@@ -1,19 +1,27 @@
1
- # Project checks and repairs
1
+ # Project checks, placeholders and repairs
2
2
 
3
- [Main specification](../_main.md)
3
+ [Main specification](../_main.md) · [Initialization](initialization.md) · [Automatic repair](../concepts/automatic-repair.md)
4
4
 
5
- Every task accepted by start must satisfy the project's configured checks and its requested outcome. Run checks on the content intended for the result commit, including changes made by formatters and other checks. A successful process exit is not sufficient evidence of task completion.
5
+ A task's requested outcome must be satisfied independently of its check command's exit status. Run configured real checks against the content intended for the result commit, including formatter/check-generated changes. A successful process or informational placeholder is not sufficient evidence of task completion.
6
6
 
7
- Checks are project-defined, not restricted to software builds. Missing or uninitialized validation is a setup problem, never an automatic pass. Preserve existing checks during initialization. Do not remove assertions, lower thresholds or disable validation merely to make a task pass.
7
+ ## Initialization without a validation question
8
8
 
9
- Initialization and interactive start share a finite check configuration step. Init completes it before reporting ready, saving a real project default with available prerequisites so that a subsequent plain start needs no check-setup request. Validate commands, referenced npm scripts and dependency availability without running project checks; empty commands, unresolved references, recursive script graphs and generated setup placeholders remain unresolved. A non-software project can save a direct validation command in `ptbk.json.execution.check` without replacing its npm scripts.
9
+ Do not ask users to configure checking commands during init or make a check-setup wizard a prerequisite of plain start. Preserve real existing validation. When absent on initialization, save a harmless successful placeholder such as:
10
10
 
11
- Fresh sample projects include meaningful validation for their actual initial content. Neither an always-failing stub nor an unconditional successful exit qualifies. Existing projects retain their real validation; missing check dependencies or a deferred check make initialization incomplete. Configuration readiness does not mean tests have passed: the first runnable task must actually satisfy the configured checks before completion.
11
+ ```sh
12
+ echo "Configure project checks in ptbk.json execution.check"
13
+ ```
12
14
 
13
- On failure, feed the actual check result into repair of the same active work, then recheck within the configured budget. Preserve attempts and diagnostics. If repair cannot proceed safely, keep the supervisor available with blocked work and an actionable request. Check-generated changes join the task's single result commit.
15
+ The placeholder explicitly means **real automated project validation is not configured**. Show that state honestly instead of claiming tests passed. It does not block init, bootstrap or ordinary work. It must not be an always-failing stub or an invisible unconditional pass presented as meaningful validation. An explicit supplied check can still configure the project; no interactive decision is required.
14
16
 
15
- For finite run, `--check` selects a shell command and `--check-before` supports `no`, `yes-and-fail` and `yes-and-fix`. Optional checks that were not requested are visibly skipped, not passed. An enabled default software check uses `npm run check`; a non-software project can supply its own command.
17
+ Expert's ordinary bootstrap or later authorized work may replace the placeholder with appropriate validation for the actual project. Checks can validate non-software projects too. Do not require a meaningless software build or invent a second onboarding gate. Existing invalid/failing real checks are genuine repair problems; never downgrade them to the placeholder, remove assertions, lower thresholds or disable validation merely to pass a task.
16
18
 
17
- `ptbk fix` checks and repairs only failing validation; it does not consume the ordinary queue. On a healthy unchanged project it needs no model and creates no repair task or empty commit. A check-only transformation is recorded as its own explicit maintenance task when there is no active task to own it.
19
+ ## Execution and repair
18
20
 
19
- See [execution](execution.md), [retries](retries.md) and [Git persistence](git-persistence.md).
21
+ For an actual configured check, inspect command references/dependencies and retain the real result. A broken command is not silently treated as the informational placeholder. Feed failure into repair of the same active work and recheck within budget; use the normal Fixer/problem path when needed. Preserve attempts and diagnostics. Block only unsafe or unresolved affected work while the supervisor remains available. Check-generated edits join the task's result commit.
22
+
23
+ For finite run, `--check` selects a command and `--check-before` accepts the documented CLI modes `no`, `yes-and-fail` and `yes-and-fix`; their stored enum values are canonical uppercase. An explicitly enabled software check can use `npm run check`; a non-software project may specify a direct command. Unrequested/skipped validation and the placeholder are labelled, never reported as real checks passed.
24
+
25
+ `ptbk fix` addresses failing validation without consuming the ordinary queue. A healthy unchanged project requires no model, repair task or empty commit. A placeholder alone is not a failed check that should cause endless repair. A check-only transformation with no owning task is recorded as its own ordinary maintenance operation.
26
+
27
+ See [execution](execution.md), [retries](retries.md), [first task](first-task.md) and [Git persistence](git-persistence.md).
@@ -2,74 +2,81 @@
2
2
 
3
3
  [Main specification](../_main.md)
4
4
 
5
- The command root is `ptbk`. Bare invocation displays [top-level help](help.md), in both interactive and noninteractive environments, without starting work or asking to start. Successful `ptbk init` prepares the project and automatically starts its background agenda; the optional next command is `ptbk dashboard`. An already initialized, cloned or stopped project can also be started explicitly with `ptbk start`.
5
+ The root command is `ptbk`. Bare invocation shows [top-level help](help.md) without starting work or asking to start. Successful init performs finite setup and starts the background agenda; `ptbk dashboard` is the optional next view. An initialized/cloned/stopped project can be started explicitly.
6
6
 
7
7
  ## Commands
8
8
 
9
9
  | Command | Purpose |
10
10
  | --- | --- |
11
- | `init`, `initialize` | Complete finite technical setup, preserve initial input, initialize missing core roles, create an ordinary Expert bootstrap task and start the background agenda. |
12
- | `start` | Start the ongoing agenda's daemon and report one status snapshot; explicit foreground operation is available. |
13
- | `pause` | Stop new task claims, drain current work and keep the engine alive in pause. |
14
- | `resume` | Resume pause or cancel a pending pause/stop/restart and return to running. |
15
- | `stop` | Gracefully drain and stop the selected service; `--force` or `-F` requests immediate owned-work termination. |
16
- | `restart` | Gracefully stop and start one replacement for the same project and effective configuration. |
17
- | `dashboard` | Continuously observe/control an existing project service without starting or owning it. |
18
- | `dashboard --global` | Continuously list host-wide project engines across installations, independently of CWD, and attach to a selected project view. |
19
- | `status`, `show` | One shared project-state snapshot, including chat attention and connection information, without lifecycle changes. |
20
- | `chat` | New persistent user conversation with Chatter by default, or explicitly reopen a named existing thread; no dashboard required. |
21
- | `ask` | Compatibility/quick task-submission or enquiry using the same chat/task model, not a separate request store. |
22
- | `answer` | Select a waiting chat and append a user answer. |
23
- | `run` | Execute a finite existing queue with one selected configuration. |
24
- | `help` | Top-level or command/subcommand-scoped help in pretty/raw presentation. |
25
- | `about` | Short product overview and running engine version. |
26
- | `add` | Create/commit a task through wizard, supplied description, stdin or template without a model call. |
27
- | `generate-boilerplates` | Create unfinished non-runnable task templates. |
28
- | `plan` | Discuss and save approved tasks without implementing them. |
11
+ | `init`, `initialize` | Preserve intent, prepare missing support/core roles/simple tools, ask optional sync, save ordinary Expert bootstrap and start the agenda. No check-command question. |
12
+ | `start` | Start ongoing daemon and report one snapshot; explicit foreground mode is available. |
13
+ | `pause` | Stop new claims, drain current work and remain alive in pause. |
14
+ | `resume` | Resume or cancel pending pause/stop/restart and return to running. |
15
+ | `stop` | Graceful drain/stop; `--force` or `-F` immediately terminates owned execution. |
16
+ | `restart` | Gracefully stop and start one replacement for the selected project. |
17
+ | `dashboard` | Continuously observe/control an existing project, without owning or starting it. |
18
+ | `dashboard --global` | Live host-wide engine table, independent of CWD, with project attachment and meaningful zero-entry state. |
19
+ | `status`, `show` | One shared project-state snapshot, including tools and enabled synchronization, without lifecycle changes. |
20
+ | `tool` | Named tool list/show/add/modify/move/enable/disable/remove using shared saved management. See [tool commands](tool-management.md). |
21
+ | `chat` | New Chatter-first persistent conversation or explicit existing thread, without a dashboard requirement. |
22
+ | `ask` | Compatibility/quick submission or enquiry using the same chat/task model. |
23
+ | `answer` | Select a waiting chat and append a human reply. |
24
+ | `run` | Execute a finite existing queue with selected configuration and live resource checks. |
25
+ | `help` | Top-level or command/subcommand-scoped help in pretty/raw form. |
26
+ | `about` | Product overview and actual running engine version. |
27
+ | `add` | Create/commit a task through wizard, description, stdin or template, without a model call. |
28
+ | `generate-boilerplates` | Create unfinished non-runnable templates. |
29
+ | `plan` | Discuss and save approved tasks, not implement them. |
29
30
  | `list` | Read-only queue, filters and readiness explanations. |
30
31
  | `fix` | Project validation/repair, not ordinary queue execution. |
31
- | `verify` | Human review, follow-up and archiving; not a check run. |
32
- | `migrate` | Explicit local Markdown-to-Book conversion. |
33
- | `recover` | Inspect/explicitly resolve interrupted work; ordinary safe recovery remains automatic. |
32
+ | `verify` | Human review, follow-up and archiving, not a check run. |
33
+ | `migrate` | Explicit local Markdown-to-Book conversion, distinct from automatic configuration migrations. |
34
+ | `recover` | Inspect/explicitly resolve interrupted work; routine safe recovery is automatic. |
34
35
  | `find-unwritten`, `find-refactor-candidates`, `find-fresh-emoji-tags` | Authoring helpers. |
35
36
  | `ping` | Explicit small harness/model call, optionally repeated with `--period`. |
36
37
 
37
38
  ## Project selection and lifecycle
38
39
 
39
- `--path` selects the project; `--tasks` selects its source. `dashboard --global` is the explicit exception: launch directory is irrelevant, no project is initialized, and the view stays open with zero services. An explicit conflicting project selector is diagnosed. [Global discovery](global-dashboard.md) spans installations/versions; there is no global engine or new stop-all operation.
40
+ `--path` selects the project and `--tasks` its task source. Global dashboard is the explicit directory-independent exception and diagnoses conflicting project selection; it never initializes a project or creates a global engine. Discovery spans installations/versions, with no new stop-all command.
40
41
 
41
- Pause/resume/stop/restart invoke the same [engine lifecycle operations](service-lifecycle.md) as dashboards/API. Live states are running, pausing, pause and stopping. `ptbk stop --force` and `ptbk stop -F` are equivalent immediate actions, not another state. There is no hard pause. Resume cancels pending pause/stop without replaying active work. Stop-to-pause replacement requires confirmation; a noninteractive caller can explicitly resume/cancel before requesting pause. Repeating ordinary stop is not force escalation.
42
+ Lifecycle commands use the [shared four-state machine](service-lifecycle.md): running, pausing, pause, stopping. `ptbk stop --force` and `-F` are equivalent immediate actions, not another state or a hard pause. Resume cancels pending pause/stop without replaying current work. Stop-to-pause replacement confirms intent; noninteractive callers can explicitly cancel/resume first. Repeated graceful stop does not escalate.
42
43
 
43
- One-shot results distinguish request acceptance/pending intent from completed, failed or unconfirmed outcomes, without attaching a live view. A lost endpoint is not proof of completed stop. Only the verified owner is controlled; [owner lock cleanup](locking.md) is attempted during controlled shutdown, including internal force, but is not guaranteed after an external hard kill.
44
+ One-shot outcomes distinguish acceptance/draining, actual completion and failure/unconfirmed status. Lost connection alone does not prove termination. Only the verified owner is controlled; [lock cleanup](locking.md) is best-effort during handled force stop and not guaranteed after external hard kill. Opening/closing dashboards/chat leaves ownership alone. Per-project missing service is an error, not implicit startup; the global empty state remains usable.
44
45
 
45
- Opening/closing dashboard or chat leaves the engine alone. Multiple clients may attach to one service, but a second engine cannot own the same project. Missing per-project service is an actionable error, not startup; the global zero-entry case remains usable. See [process modes](process-modes.md).
46
+ Resource availability is separate: an initialized service can start and remain running while waiting for tools. Recheck before every task and during waits, not just launch. A new/reenabled tool can help current work without restart. See [tool runtime](tool-runtime.md).
46
47
 
47
- ## Shared configuration and presentation
48
+ ## Configuration and presentation
48
49
 
49
- [Configuration precedence](configuration.md) defines engine defaults, versioned `ptbk.json` and temporary CLI overrides, including legacy environment defaults. Task requirements cannot be silently overridden by an incompatible invocation choice.
50
+ Use shared [precedence](configuration.md), [version migrations](configuration-migrations.md) and [naming](../coding-standards/naming.md). Saved keys are camelCase, booleans use `is`, user tool names are kebab-case and fixed enum values uppercase. CLI flags keep conventional dashed spellings; tolerant accepted CLI enums save canonically. Task requirements remain constraints.
50
51
 
51
- `--agent`, `--harness`, `--model`, `--thinking-level` and `--context` configure finite work. Agent, harness and model are separate. Agent selection uses the shared [resolver](../book-language/references.md). Run/fix/plan default to Developer when no agent is selected; explicit Planner is supported. Start discovers project roles/enabled harnesses and uses Manager subject to restrictions/preferences, not hidden fixed Developer routing.
52
+ `--agent`, `--harness`, `--model`, `--thinking-level` and `--context` configure finite work. Agent, tool instance/variant and model are distinct. Agent references use the shared Book resolver. Run/fix/plan default to Developer unless selected otherwise; start uses Manager and enabled tools subject to requirements. When selecting a harness by variant, use that variant's eligible ordered instance fallback; a named-instance restriction must remain explicit rather than silently broadened.
52
53
 
53
- [Presentation and interaction](interactive-ui.md) defines pretty defaults, `--raw` and input policy via `--interactive`/`--non-interactive`. Init/add use finite wizards; project/global dashboards are continuous; lifecycle commands report once. Run/explicit foreground start share the live project view. Noninteractive init accepts destination/child strategy, intent/attachments, installation, harness, browser, trace and update choices in advance; help documents them without provider configuration dumps.
54
+ Pretty/raw and interactive/noninteractive follow [CLI presentation](interactive-ui.md). Init/add are finite wizards; dashboards continuous; lifecycle/management commands report once. Noninteractive init accepts destination/nesting, intent/assets, installation, harness/browser, trace, update and synchronization choices. No required check-command choice is added; explicit `--check` is still supported. Help must not dump every provider's configuration into the initial view.
54
55
 
55
- New `ptbk chat` without an explicit target offers **Chat with Chatter** as focused default and **Choose another agent** second. Enter proceeds with Chatter; the latter opens the full valid target list including hidden/core roles and Expert. Explicit `--agent` bypasses the picker; noninteractive default is Chatter. Existing chats/answers retain their real participant. User/Void/Null are not speakers. Ctrl+C closes chat only. Replies can propose/create ordinary authorized tasks, but opening chat never creates work or starts an engine. See [chats](chats.md) and [chat UI](chat-ui.md).
56
+ New chat without an explicit target offers Chatter (focused default/Enter) or Choose another agent; the latter opens all valid core/specialist/Expert targets. Explicit `--agent` bypasses selection; noninteractive default is Chatter. Existing threads retain participants; User/Void/Null are not speakers. Ctrl+C leaves chat only. Authorized execution requested in chat uses ordinary tasks and respects pause/ownership.
56
57
 
57
- Live/snapshot project views follow [status](status-view.md) and [layout](dashboard-layout.md). Lifecycle controls are directly visible; actual execution configuration and browser profile/diagnostics use [expandable detail panels](dashboard-details.md). `--no-qr` suppresses code in dashboard, status/show, start/restart and run without disabling HTTP/remote access. Waiting chats, status and connection are not mutually exclusive screens. Init's finite finish hints at dashboard without opening it.
58
+ Start supports `--daemon` (default), `--foreground`, `--no-persist`, `--no-server`, `--port`, `--no-qr`, `--browser-mode headless|headful` and `--browser-profile <path>`. With several browsers, `--browser-tool <name>` disambiguates temporary browser overrides; never silently apply them to every instance. Saved per-tool changes instead use `ptbk tool modify`.
58
59
 
59
- Start supports `--daemon` (default), `--foreground`, `--no-persist`, `--no-server`, `--port`, `--no-qr`, `--browser-mode headless|headful` and `--browser-profile <path>`, alongside shared presentation/input options. [Remote access](remote-access.md) adds `--tunnel`, `--no-tunnel` and `--tunnel-provider <provider>` for HTTP-launching workflows, including finite run and init's start. Protected tunnelling defaults on with HTTP; no-server suppresses it and conflicts with explicit tunnel. Initial provider values remain cloudflare-quick (default) and configured cloudflare-named.
60
+ HTTP workflows support `--tunnel`, `--no-tunnel`, `--tunnel-provider`; CLI provider spellings remain `cloudflare-quick`/`cloudflare-named` and saved enums are canonical uppercase. No-server suppresses implicit tunnelling and conflicts with explicit enablement. HTTP exposure is not Git autosync. Raw does not select foreground or change exposure. Dashboard/status do not apply launch-only options or create tunnels.
60
61
 
61
- Daemon/foreground conflict; raw never implicitly selects foreground or changes tunnelling. Init stays finite and hands off to the daemon. Dashboard/status/show do not create tunnels or apply launch-only settings. `--help`, trailing help and `ptbk help <command-path>` show only selected scope; no path means top-level. These and `--version` follow [help/version](help.md). Global-dashboard help documents directory independence and its continuous empty state.
62
+ `--help`, trailing `help` and `ptbk help <command-path>` show only the selected scope, including `tool add`/`modify`/`disable` and global-dashboard help. No path means top-level. Help/version/read-only inspection require no service/setup and never run the selected command.
62
63
 
63
- ## Persistence and finite-run options
64
+ ## Saved tools and synchronization
65
+
66
+ Tool subcommands, options, protected secret input, ordering and examples are specified once in [tool management](tool-management.md). Enable/disable are primary, permanent removal secondary. Every real saved change commits independently and promptly, even during active task work; read/no-op/cancel does not. API key values are `${{ env.NAME }}` references; actual secrets enter only protected local editing, not command arguments or Git.
67
+
68
+ For an in-use modification/disable/remove, CLI refuses without writes and prints the same command with `--force`/`-F` (save while existing use finishes), plus the alternative standalone `ptbk stop --force`, followed after stop by the original command. There is **no tool `--force-stop` option**. Last-enabled-type confirmation is independent: explicit `--yes` accepts that warning noninteractively and does not imply in-use `--force` or vice versa.
64
69
 
65
- Mutating workflows commit their own versioned changes by default under [Git persistence](git-persistence.md), with `PTBK: ` subjects and Task-Name/Chat-Name correlation. Human-facing messages commit individually; task-internal consultations join their result; conversation-only consultation uses scoped authoring persistence. This includes init/add/other authoring and start/run work. `--no-commit` opts out for that workflow, including init's service; `--commit` explicitly states the default. Neither grants unrelated ownership. Runtime-only/read-only/no-op actions create no commits, and commit alone does not imply push.
70
+ Root `isAutoSync` defaults false. `--auto-sync`/`--no-auto-sync` override the invocation. Legacy `--auto-pull`/`--auto-push` are documented compatibility opt-ins to the same combined policy, not independent persisted settings; explain both directions. Use the existing Git origin/current started branch, periodic and boundary attempts, immutable merges and nonblocking remote failure under [synchronization](git-synchronization.md). Manual dashboard synchronization uses that same coordinator.
71
+
72
+ ## Persistence and finite-run options
66
73
 
67
- Preserve `--min-priority`, `--max-priority`, `--priority` lower-bound alias, successful-task `--limit`, `--git-changes fail|ignore|continue`, `--no-auto`, `--auto-pull`, `--auto-push`, `--check`, `--check-before`, `--isolate`, `--no-normalize-line-endings`, `--no-ui`, `--preserve-logs`, `--no-questions` and `--allow-credits`.
74
+ Normal mutating workflows commit scoped changes by default with `PTBK: ` and relevant Task-Name/Chat-Name correlation. Human messages commit individually, task consultations with their result, conversation-only advice as scoped authoring. `--no-commit` opts out for an ordinary workflow, including init's service, but cannot silently suppress required configuration-migration or explicit tool-management commits; incompatible requests fail before those writes. Runtime-only/read-only/no-op actions do not commit; a commit alone does not imply push.
68
75
 
69
- Pacing uses `--wait-between-prompts`, `--wait-after-prompt` and `--wait-after-error`, accepting `30m`/`1h30m` and equivalent durations. Defaults are zero between/after tasks and ten minutes after a technical error. Thinking levels low/medium/high/xhigh/max apply only where supported; unsupported settings are diagnosed, not falsely accepted.
76
+ Preserve `--min-priority`, `--max-priority`, `--priority` lower-bound alias, successful-task `--limit`, `--git-changes fail|ignore|continue`, `--no-auto`, `--check`, `--check-before`, `--isolate`, `--no-normalize-line-endings`, `--no-ui`, `--preserve-logs`, `--no-questions` and `--allow-credits`. Pacing options `--wait-between-prompts`, `--wait-after-prompt`, `--wait-after-error` accept durations such as `30m`/`1h30m`; defaults are zero between/after work and ten minutes after a technical error. Thinking selections low/medium/high/xhigh/max apply only where supported, not as invented provider equivalence.
70
77
 
71
- Validate combinations before work: invalid priority bounds fail; no-auto requires interactive input and conflicts with no-questions/noninteractive; isolation requires commits and conflicts with continue; continue conflicts with pre-check repair. No-commit conflicts with isolation and auto-pull/push, but does not require ignore merely to allow its own writes. Pre-existing dirt follows ownership policy. Start cannot become a finite limit run or require routine no-auto approvals; diagnose incompatible attended-only options rather than silently stall.
78
+ Validate incompatible priorities and flags before work. No-auto requires interactive input and conflicts with no-questions/noninteractive; start cannot become a finite limit run or require routine no-auto approval. Isolation requires commits and conflicts with continue; continue conflicts with pre-check repair. No-commit conflicts with isolation and autosync (including compatibility flags), not merely with owned dirty work. No option takes ownership of unrelated edits.
72
79
 
73
- Authoring saves/commits one approved operation; optional push requires a commit. Add retains template/priority input; boilerplate count supports N or N*M (default 5*1); verify supports review order/repeatable ignore filters. Optional auto-migrate is a configured project hook, distinct from task conversion; destructive permission requires its explicit enablement.
80
+ Authoring saves one approved operation; push requires a commit. Add keeps template/priority input; boilerplate count accepts N or N*M (default 5*1); verify retains review order/repeatable ignore filters. A configured project migration hook is distinct from Book conversion and mandatory engine-configuration evolution; its optional enablement must not disable the latter. Diagnose unsupported flags rather than ignoring them.
74
81
 
75
- List/help/about/version/dry-run must not install/update tools, initialize/authenticate, start tunnels, call models or modify Git. Never ignore unsupported flags silently. Inspection reports missing capabilities without repairing them. Ongoing operation follows [unattended service](autonomous-operation.md) and explicit lifecycle intent.
82
+ List/help/about/version/dry-run never install/update/authenticate, start tunnels, call models, normalize/migrate files or modify Git. Report missing capabilities and needed repairs without performing them. See [Git persistence](git-persistence.md), [unattended operation](autonomous-operation.md) and [acceptance](acceptance.md).
@@ -0,0 +1,43 @@
1
+ # Versioned project configuration migrations
2
+
3
+ [Main specification](../_main.md) · [Configuration](configuration.md) · [First tools migration](tools-migration.md) · [Automatic repair](../concepts/automatic-repair.md)
4
+
5
+ ## Version contract
6
+
7
+ `ptbk.json.promptbookVersion` is the engine version that initialized or last successfully migrated the configuration. New initialization writes the actual running engine version. It is not a second independent schema-version counter and is not permanently frozen at the creation version.
8
+
9
+ Use one semantic-version comparator for engine/project compatibility and migration ordering. Compare major, minor and patch numerically, then prerelease precedence; numeric prerelease identifiers are numeric, not lexicographic. The project's release convention uses numeric prereleases, not invented alpha/beta labels. For example, `0.119.0-9 < 0.119.0-10 < 0.119.0 < 0.120.0`. Build metadata does not change precedence. Malformed versions are configuration problems, not permission to assume zero or downgrade.
10
+
11
+ Let C be the saved configuration version and E the executing engine version:
12
+
13
+ - **E = C:** no version migration or version-only commit. Independent deterministic normalization can still repair a noncanonical setting.
14
+ - **E < C:** before starting project work or modifying its configuration, explain both versions and offer to update the invoked installation through the ordinary [update workflow](updates.md). Preserve the project, do not downgrade it or pretend it is compatible. After updating, rerun with the new engine. Unattended use reports the required action without a hidden prompt.
15
+ - **E > C:** perform the ordered migration pass below before affected new work.
16
+
17
+ Read-only inspection can report compatibility and required migrations but never writes or commits them. Reloaded configuration is also checked, not only initial process startup. If a running older engine encounters a newer configuration, preserve active work and controls, stop taking incompatible new work and request the engine update; do not overwrite the newer format.
18
+
19
+ ## Fixed legacy baseline
20
+
21
+ When `promptbookVersion` is absent, assume the fixed unversioned baseline **`0.119.0-21`**, the version inspected before this mechanism was introduced. Do not inspect the document's shape, guess its age, search Git history or invoke Fixer merely because the field is missing. This baseline never moves with future releases. Apply the ordinary forward migration chain from that point. Other genuine parse/validation problems still use automatic repair.
22
+
23
+ The first release implementing the versioned tools format must bind [its migration](tools-migration.md) to that release's exact version, greater than the baseline. Future releases retain both the baseline and that historical migration target. This specification change does not bump the package version or claim the migration is already implemented.
24
+
25
+ ## Sparse, ordered migration chain
26
+
27
+ A migration belongs to a particular target engine version. Many releases have no migration. Select every registered step with `C < target <= E`, sort by semantic version and apply them in that order to the configuration. A migration spanning ten releases may execute zero, one or many steps; gaps are normal and do not require dummy steps.
28
+
29
+ A step transforms its assigned configuration behavior. It must not advance `promptbookVersion`, create an independent commit or perform ordinary task work. The coordinator owns those actions: after all selected steps succeed, validate/canonicalize the result, set `promptbookVersion` to E and persist **one dedicated commit for the whole pass**. Even with no selected steps, changing the version is a real committed operation. Do not fold task changes, unrelated configuration edits or another operation's files into it.
30
+
31
+ Use an automatic `PTBK: ` subject describing migration from C to E; the body can identify the applied migration targets. This is the runtime engine's commit convention, distinct from commits that edit these specification documents. No empty commit is needed when E and C are already equal and nothing else changes.
32
+
33
+ ## Safety and recovery
34
+
35
+ Coordinate migration with other configuration writers and project Git ownership. Preserve unrelated settings, explicit false values, custom paths, staging and work in progress. Prepare the complete result before replacing the live configuration. A failed step must not advertise an advanced version, expose a partially migrated configuration to work, discard the original or commit a partial success.
36
+
37
+ Keep enough bounded recovery information to resume or safely retry an interrupted pass without duplicate transformations/commits. If the commit fails, retain the prepared result as pending migration work and retry persistence, not already successful tasks or external actions. Report the actual failure through the shared automatic-repair path. A migration must not use blanket staging, destructive reset or history rewriting to force success.
38
+
39
+ Migration commits are required. An invocation explicitly forbidding commits must report the required migration and how to run it in committed mode before making migration writes; it must neither silently violate `--no-commit` nor apply an untracked migration. Subsequent task work may still use its separately selected persistence policy. Credential changes, if required, obey [environment-file safety](environment.md); secrets never enter the migration commit.
40
+
41
+ ## Acceptance outcomes
42
+
43
+ Compare numeric patches/prereleases and stable releases correctly. Verify equal versions are a no-op, an older engine offers an update without writes, and a newer engine selects exactly the applicable ordered steps. Cover zero steps, gaps, many steps and one scoped commit including the final version. A versionless configuration always uses the fixed baseline without shape analysis. Inject a step failure, concurrent edit, failed signing/hook and crash around commit: preserve recoverability, do not stamp false success or include task changes. Repeated successful startup creates no migration commit.
@@ -1,27 +1,37 @@
1
1
  # Project configuration and precedence
2
2
 
3
- [Main specification](../_main.md)
3
+ [Main specification](../_main.md) · [Configuration migrations](configuration-migrations.md) · [Tools](tools.md) · [Naming](../coding-standards/naming.md)
4
4
 
5
- `ptbk.json` in the selected project directory is the human-readable, Git-versioned configuration for Promptbook. It describes project choices, not machine runtime state. `.ptbk/` remains Git-ignored runtime storage; it is not the configuration file. Task audit evidence lives separately in root-level `traces/`, with recording and Git inclusion controlled by this configuration.
5
+ `ptbk.json` in the selected project directory is the human-readable, Git-versioned configuration for Promptbook. It describes project choices, not machine runtime state. `.ptbk/` remains ignored runtime storage; task evidence lives separately in root-level `traces/`. The root includes `promptbookVersion`, ordered `tools` and `isAutoSync` (default false).
6
6
 
7
- Resolve each supported setting in this order, from lowest to highest priority:
7
+ `promptbookVersion` records the initializing/last-migrating engine version. Apply the shared [version/migration contract](configuration-migrations.md), including the fixed baseline for absent versions, rather than treating a version as arbitrary metadata. All Promptbook-owned JSON keys are lower camelCase, all boolean properties begin with `is`, user tool identifiers are kebab-case and fixed enum values are SCREAMING_SNAKE_CASE. Known spelling errors are normalized and committed; ambiguous configuration uses [automatic repair](../concepts/automatic-repair.md).
8
8
 
9
- 1. Engine defaults, usable without a configuration file.
10
- 2. Values explicitly stored in the selected project's `ptbk.json`.
11
- 3. Explicit CLI flags for this invocation.
9
+ ## Resolution and effective state
12
10
 
13
- Omitted values inherit; explicit false, empty or disabled values must not be mistaken for omission. Legacy `PTBK_HARNESS`, `PTBK_MODEL` and `PTBK_THINKING_LEVEL` fill otherwise unspecified defaults before project settings, never override `ptbk.json` or CLI flags. Environment-provided credentials are secret inputs, not another project configuration file.
11
+ Resolve each supported setting from engine defaults, then the selected project's explicit `ptbk.json`, then explicit CLI overrides. Omitted values inherit; false, empty and disabled values are not omission. Legacy `PTBK_HARNESS`, `PTBK_MODEL` and `PTBK_THINKING_LEVEL` fill otherwise unspecified defaults before project settings and never override project/CLI choices. Credentials are secret inputs, resolved through [environment references](environment.md), not a second project configuration file.
14
12
 
15
- Configuration covers enabled harnesses and their non-secret setup, routing/model preferences, one browser configuration (including portable profile-source selection and independent headless/headful mode), [trace settings](trace-configuration.md) and supported operating/update policies. Multiple harnesses and the single browser are independent settings. A task's explicit requirements remain constraints, not lower-priority defaults to overwrite.
13
+ Configuration covers named browser/harness tool instances, routing/model preferences, checks, [trace settings](trace-configuration.md), operating/update policies and optional synchronization. A task's explicit requirements constrain selection; they are not lower-priority defaults to overwrite. Multiple browsers and harnesses coexist in `tools`; the old singleton browser and separate harness map are [migrated](tools-migration.md), not retained as competing live configuration sources.
16
14
 
17
- Save `traces.commit`, `traces.ignoreVideos` and `traces.recordVideo` from initialization's Traces step. These distinguish Git inclusion of all traces, exclusion of video, and actual browser recording. Preserve stored false values and explain effective precedence when the whole trace tree is ignored. Their defaults and ignore rules are defined only in [trace configuration](trace-configuration.md), not independently by individual harnesses.
15
+ Project-scoped paths resolve relative to the project; CLI paths resolve relative to the invocation directory. Managed-global browser profiles resolve per OS user, not as Git-versioned absolute machine paths. Existing/custom paths follow explicit ownership checks. Do not inherit another project's configuration merely because it is an ancestor or contains the installation. Preserve unrelated fields and diagnose problems at their actual location.
18
16
 
19
- Remote HTTP exposure follows [tunnel configuration](remote-access.md): default enabled when HTTP runs, provider selection and non-secret options are discoverable and can be saved, while `--no-tunnel`/`--tunnel` and `--tunnel-provider` override this invocation. No-server suppresses implicit tunneling. Save credential references rather than provider tokens, pairing links or device sessions. Generated ephemeral URLs and tunnel processes are runtime state, not versioned defaults.
17
+ Load/revalidate before every task and refresh promptly during work and waits. File edits, another terminal's tool command and dashboard saves become effective without restart. New tools can serve current work; changes to an already acquired tool retain its current use only under [runtime consistency](tool-runtime.md). Genuine startup-only placement/HTTP settings may still require restart and are labelled as such; that is not permission to make all configuration startup-only.
20
18
 
21
- Resolve project-scoped paths in the file relative to its project; resolve CLI paths relative to the invocation directory. A selected **Promptbook-managed global** browser profile is a source kind, not a project-relative or Git-versioned absolute machine path: resolve it in the current OS user's Promptbook application-data directory. Project-isolated, user-existing and custom-path profiles remain explicit alternatives. See [browser](browser.md). Do not inherit another project's configuration merely because it is an ancestor or contains the installation. Diagnose invalid settings before affected work, with their location; do not silently fall back after a configuration error.
19
+ ## Persistence boundaries
22
20
 
23
- CLI overrides do not rewrite `ptbk.json`. Live control changes are temporary unless explicitly saved. A confirmed save of versioned settings is an [authoring operation](authoring.md), committed by default; temporary control changes need no commit. Recovery may retain a running process's effective settings; a new independent invocation resolves its own configuration. Show effective settings and their sources on request, without secrets. Init's automatic start preserves applicable explicit overrides for that workflow rather than resolving a contradictory service configuration.
21
+ Invocation-only CLI overrides and generic temporary runtime controls do not rewrite defaults. Explicit saves are scoped authoring operations. **Tool management is explicitly saved management**, not a temporary runtime-control variant: its changes commit immediately and publish their new revision to the engine. Configuration migrations and deterministic normalization also create their own scoped audit commits, excluding task work. A no-op/read-only load does not commit.
24
22
 
25
- Check setup is an explicit configuration operation: when the default validation is missing or invalid, a confirmed setup choice or `init --check COMMAND` saves its replacement. Existing valid defaults remain intact; other commands' `--check` flags and an init override of valid validation remain temporary.
23
+ Recovery may retain a particular active use's effective settings without restoring an obsolete whole-project snapshot. A new invocation resolves its own overrides. Init's automatic start preserves applicable explicit workflow overrides. Show effective values and their sources without secrets, and distinguish saved state, active retained use, pending changes and restart-only settings.
26
24
 
27
- Store credential references, not API keys, login tokens or browser sessions. New unconfigured projects default to the dedicated reusable global Promptbook browser profile; reinitialization preserves an already selected profile kind and sessions. Machine-specific paths can be supplied as temporary overrides. Initialization preserves existing choices and adds only missing required settings. See [initialization](initialization.md), [harnesses](harnesses.md), [browser](browser.md) and [controls](controls.md).
25
+ ## Traces, synchronization and access
26
+
27
+ Save `traces.isCommitted`, `traces.isVideoIgnored` and `traces.isVideoRecordingEnabled` from the Traces step. Their defaults and parent/video ignore precedence are defined only in [trace configuration](trace-configuration.md). Recording is independent of Git inclusion and applies to attributable activity of any selected browser tool.
28
+
29
+ `isAutoSync` is the single saved opt-in for ongoing pull/push through the repository's existing origin and current branch; remote/branch definitions stay in Git, not duplicate JSON fields. New initialization asks, while migrated projects default off. See [Git synchronization](git-synchronization.md).
30
+
31
+ Remote HTTP exposure still defaults on with HTTP under [remote access](remote-access.md); this is unrelated to Git autosync. Persisted booleans use `server.isEnabled` and `server.tunnel.isEnabled`, with canonical provider enums. CLI `--no-tunnel`/`--tunnel` and `--tunnel-provider` remain invocation overrides; no-server suppresses implicit tunneling. Store references rather than provider secrets, pairing links or device sessions. Runtime URLs/processes are not versioned defaults.
32
+
33
+ ## Initialization and checks
34
+
35
+ Init uses the same tool operations but keeps its simple selection UX; it does not ask users to design account pools or fallback chains. Preserve existing selections, profiles, native logins and explicit false values. New browser defaults remain the dedicated reusable global Promptbook profile, not personal Chrome.
36
+
37
+ Init no longer asks for a checking command. Preserve an existing real `execution.check`; when absent, save an explicit successful informational placeholder such as `echo "Configure project checks in ptbk.json execution.check"`. It is not evidence of real validation and does not block bootstrap. A supplied `init --check COMMAND` can fill the missing choice without a question; existing valid defaults and temporary overrides retain their precedence. See [checks](checks.md) and [initialization](initialization.md).