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.
- package/README.md +16 -9
- package/dist/browser/browser.d.ts +50 -36
- package/dist/browser/browser.js +162 -118
- package/dist/browser/browser.js.map +1 -1
- package/dist/browser/fleet.d.ts +59 -0
- package/dist/browser/fleet.js +148 -0
- package/dist/browser/fleet.js.map +1 -0
- package/dist/browser/recording.js +2 -2
- package/dist/browser/recording.js.map +1 -1
- package/dist/chats/conversation.d.ts +1 -1
- package/dist/chats/conversation.js +8 -6
- package/dist/chats/conversation.js.map +1 -1
- package/dist/chats/local.js +5 -5
- package/dist/chats/local.js.map +1 -1
- package/dist/cli/commands/add.js +1 -1
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/boilerplates.js +1 -1
- package/dist/cli/commands/boilerplates.js.map +1 -1
- package/dist/cli/commands/find.js +1 -1
- package/dist/cli/commands/find.js.map +1 -1
- package/dist/cli/commands/fix.js +9 -4
- package/dist/cli/commands/fix.js.map +1 -1
- package/dist/cli/commands/init.d.ts +5 -0
- package/dist/cli/commands/init.js +279 -118
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrate.js +1 -1
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/ping.js +20 -12
- package/dist/cli/commands/ping.js.map +1 -1
- package/dist/cli/commands/plan.js +20 -12
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recover.js +1 -1
- package/dist/cli/commands/recover.js.map +1 -1
- package/dist/cli/commands/restart.js +6 -5
- package/dist/cli/commands/restart.js.map +1 -1
- package/dist/cli/commands/run.js +26 -15
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/start.js +11 -7
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/tool.d.ts +19 -0
- package/dist/cli/commands/tool.js +320 -0
- package/dist/cli/commands/tool.js.map +1 -0
- package/dist/cli/commands/verify.js +1 -1
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/common.d.ts +7 -1
- package/dist/cli/common.js +37 -20
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/compatibility.d.ts +8 -0
- package/dist/cli/compatibility.js +32 -0
- package/dist/cli/compatibility.js.map +1 -0
- package/dist/cli/parser.js +7 -3
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/registry.js +182 -7
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli/service-view.js +1 -1
- package/dist/cli/service-view.js.map +1 -1
- package/dist/cli/sources.js +2 -0
- package/dist/cli/sources.js.map +1 -1
- package/dist/cli/spec.js +8 -6
- package/dist/cli/spec.js.map +1 -1
- package/dist/common/naming.d.ts +53 -0
- package/dist/common/naming.js +90 -0
- package/dist/common/naming.js.map +1 -0
- package/dist/engine/agenda.d.ts +70 -9
- package/dist/engine/agenda.js +294 -61
- package/dist/engine/agenda.js.map +1 -1
- package/dist/engine/executor.d.ts +5 -0
- package/dist/engine/executor.js +24 -11
- package/dist/engine/executor.js.map +1 -1
- package/dist/engine/harnesses.d.ts +82 -18
- package/dist/engine/harnesses.js +191 -39
- package/dist/engine/harnesses.js.map +1 -1
- package/dist/engine/preview.js +2 -2
- package/dist/engine/preview.js.map +1 -1
- package/dist/engine/routing.d.ts +10 -0
- package/dist/engine/routing.js +67 -28
- package/dist/engine/routing.js.map +1 -1
- package/dist/engine/snapshot.d.ts +107 -7
- package/dist/engine/state.d.ts +4 -2
- package/dist/engine/state.js.map +1 -1
- package/dist/engine/sync.d.ts +96 -0
- package/dist/engine/sync.js +199 -0
- package/dist/engine/sync.js.map +1 -0
- package/dist/engine/team.d.ts +1 -0
- package/dist/engine/team.js +12 -8
- package/dist/engine/team.js.map +1 -1
- package/dist/expert/_main.md +96 -67
- package/dist/expert/agents/_index.md +10 -7
- package/dist/expert/agents/core-agents.md +4 -2
- package/dist/expert/agents/fixer.md +15 -12
- package/dist/expert/cli/acceptance.md +96 -78
- package/dist/expert/cli/api.md +26 -14
- package/dist/expert/cli/autonomous-operation.md +17 -19
- package/dist/expert/cli/browser.md +24 -24
- package/dist/expert/cli/checks.md +18 -10
- package/dist/expert/cli/cli.md +48 -41
- package/dist/expert/cli/configuration-migrations.md +43 -0
- package/dist/expert/cli/configuration.md +24 -14
- package/dist/expert/cli/controls.md +23 -11
- package/dist/expert/cli/dashboard-details.md +28 -10
- package/dist/expert/cli/dashboard-layout.md +15 -15
- package/dist/expert/cli/dashboard.md +8 -10
- package/dist/expert/cli/environment.md +33 -0
- package/dist/expert/cli/execution.md +10 -8
- package/dist/expert/cli/git-persistence.md +27 -21
- package/dist/expert/cli/git-preflight.md +8 -4
- package/dist/expert/cli/git-synchronization.md +32 -6
- package/dist/expert/cli/harness-plugins.md +12 -12
- package/dist/expert/cli/harnesses.md +22 -16
- package/dist/expert/cli/initialization-ui.md +14 -14
- package/dist/expert/cli/initialization.md +31 -21
- package/dist/expert/cli/installation.md +6 -0
- package/dist/expert/cli/isolation.md +5 -3
- package/dist/expert/cli/releasing.md +17 -3
- package/dist/expert/cli/retries.md +10 -8
- package/dist/expert/cli/run.md +7 -5
- package/dist/expert/cli/start.md +21 -15
- package/dist/expert/cli/status-view.md +15 -17
- package/dist/expert/cli/synchronization-setup.md +24 -0
- package/dist/expert/cli/terminal.md +14 -16
- package/dist/expert/cli/tool-management.md +60 -0
- package/dist/expert/cli/tool-runtime.md +35 -0
- package/dist/expert/cli/tools-migration.md +50 -0
- package/dist/expert/cli/tools.md +73 -0
- package/dist/expert/cli/trace-configuration.md +9 -11
- package/dist/expert/cli/updates.md +7 -7
- package/dist/expert/cli/windows-installer.md +67 -0
- package/dist/expert/cli/workspace.md +2 -0
- package/dist/expert/coding-standards/_index.md +11 -0
- package/dist/expert/coding-standards/naming.md +30 -0
- package/dist/expert/coding-standards/shared-logic.md +27 -0
- package/dist/expert/concepts/automatic-repair.md +33 -0
- package/dist/expert/concepts/engine-and-project.md +7 -5
- package/dist/expert/dictionary.md +18 -18
- package/dist/harness/plugins/claude-code/index.js +4 -2
- package/dist/harness/plugins/claude-code/index.js.map +1 -1
- package/dist/harness/plugins/cline/index.js +1 -0
- package/dist/harness/plugins/cline/index.js.map +1 -1
- package/dist/harness/plugins/gemini/index.js +2 -0
- package/dist/harness/plugins/gemini/index.js.map +1 -1
- package/dist/harness/plugins/github-copilot/index.js +1 -0
- package/dist/harness/plugins/github-copilot/index.js.map +1 -1
- package/dist/harness/plugins/openai-codex/index.js +13 -9
- package/dist/harness/plugins/openai-codex/index.js.map +1 -1
- package/dist/harness/plugins/opencode/index.js +1 -0
- package/dist/harness/plugins/opencode/index.js.map +1 -1
- package/dist/harness/plugins/qwen-code/index.js +1 -0
- package/dist/harness/plugins/qwen-code/index.js.map +1 -1
- package/dist/harness/types.d.ts +16 -5
- package/dist/project/config.d.ts +135 -48
- package/dist/project/config.js +331 -119
- package/dist/project/config.js.map +1 -1
- package/dist/project/configuration.d.ts +43 -0
- package/dist/project/configuration.js +165 -0
- package/dist/project/configuration.js.map +1 -0
- package/dist/project/defaults.d.ts +4 -2
- package/dist/project/defaults.js +10 -5
- package/dist/project/defaults.js.map +1 -1
- package/dist/project/git.d.ts +28 -0
- package/dist/project/git.js +81 -0
- package/dist/project/git.js.map +1 -1
- package/dist/project/migrations.d.ts +96 -0
- package/dist/project/migrations.js +301 -0
- package/dist/project/migrations.js.map +1 -0
- package/dist/project/publication.d.ts +57 -0
- package/dist/project/publication.js +117 -0
- package/dist/project/publication.js.map +1 -0
- package/dist/project/readiness.d.ts +14 -5
- package/dist/project/readiness.js +23 -22
- package/dist/project/readiness.js.map +1 -1
- package/dist/project/setup.js +2 -0
- package/dist/project/setup.js.map +1 -1
- package/dist/service/actions.d.ts +12 -4
- package/dist/service/actions.js +32 -2
- package/dist/service/actions.js.map +1 -1
- package/dist/service/control.d.ts +1 -1
- package/dist/service/control.js +1 -1
- package/dist/service/host.d.ts +5 -2
- package/dist/service/host.js +26 -16
- package/dist/service/host.js.map +1 -1
- package/dist/service/http.js +7 -2
- package/dist/service/http.js.map +1 -1
- package/dist/service/launcher.d.ts +2 -1
- package/dist/service/launcher.js +1 -0
- package/dist/service/launcher.js.map +1 -1
- package/dist/service/records.d.ts +3 -0
- package/dist/service/records.js +1 -1
- package/dist/service/records.js.map +1 -1
- package/dist/service/spa/app.css +39 -0
- package/dist/service/spa/app.js +242 -39
- package/dist/service/worker.js +1 -0
- package/dist/service/worker.js.map +1 -1
- package/dist/tools/environment.d.ts +122 -0
- package/dist/tools/environment.js +199 -0
- package/dist/tools/environment.js.map +1 -0
- package/dist/tools/model.d.ts +180 -0
- package/dist/tools/model.js +111 -0
- package/dist/tools/model.js.map +1 -0
- package/dist/tools/normalize.d.ts +51 -0
- package/dist/tools/normalize.js +321 -0
- package/dist/tools/normalize.js.map +1 -0
- package/dist/tools/operations.d.ts +198 -0
- package/dist/tools/operations.js +378 -0
- package/dist/tools/operations.js.map +1 -0
- package/dist/tools/readiness.d.ts +72 -0
- package/dist/tools/readiness.js +160 -0
- package/dist/tools/readiness.js.map +1 -0
- package/dist/ui/dashboard.d.ts +3 -0
- package/dist/ui/dashboard.js +173 -2
- package/dist/ui/dashboard.js.map +1 -1
- package/dist/ui/details.d.ts +35 -1
- package/dist/ui/details.js +103 -2
- package/dist/ui/details.js.map +1 -1
- package/dist/ui/secret.d.ts +8 -0
- package/dist/ui/secret.js +41 -0
- package/dist/ui/secret.js.map +1 -0
- package/dist/ui/status-view.d.ts +1 -0
- package/dist/ui/status-view.js +33 -8
- package/dist/ui/status-view.js.map +1 -1
- package/dist/ui/tool-forms.d.ts +24 -0
- package/dist/ui/tool-forms.js +133 -0
- package/dist/ui/tool-forms.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
# Shared runtime controls
|
|
1
|
+
# Shared runtime and saved-management controls
|
|
2
2
|
|
|
3
|
-
[Main specification](../_main.md) · [Service lifecycle](service-lifecycle.md)
|
|
3
|
+
[Main specification](../_main.md) · [Service lifecycle](service-lifecycle.md) · [Shared domain logic](../coding-standards/shared-logic.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One engine-owned control model serves any number of terminal dashboards, foreground views, browser clients and independent [API](api.md) clients. They inspect and operate the same project; none starts a second scheduler. The engine continues with zero clients. Information and applicable operations are equivalent even where layouts/gestures differ.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Lifecycle, work and conversation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Expose actual engine version, four live service states, pause/resume, cancellation/replacement of pending pause/stop, graceful stop, explicit force stop and restart. These are precisely the operations behind `ptbk pause`, `ptbk resume`, `ptbk stop`, `ptbk stop --force`/`-F` and `ptbk restart`. Keep lifecycle controls visible in the main cockpit, distinguishing accepted/draining/completed/failed/unconfirmed outcomes.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Also expose real pacing/backoff wait skipping, current agent/task, ordered queue, outcomes, waits, errors, actionable/unread chat counts and effective routing. Missing tools mean running with a resource wait, not technical pause or stop. Skip wait cannot bypass readiness, authority or task conditions. Explicit pause/stop prevents new claims and is not undone by automatic repair or a new tool.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
New/open/list/append/reply chat operations use the same durable chat model. New human chat uses the [Chatter-first picker](chat-ui.md); an existing request retains its author. Read-only browsing creates no message/commit. Every accepted human-facing message commits independently; task-internal exchanges join their result and conversation-only consultations use ordinary scoped persistence. Fixer questions use ordinary agent/TEAM communication, not another control channel.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Tools, settings and diagnostics
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
[Tool management](tool-management.md) provides list/show/add/modify/reorder/enable/disable/remove through the same operations and types as CLI and init. **These are saved configuration operations**, committed immediately and reflected in every client. They are not temporary controls needing a second Save action. Show canonical records and actual readiness/use state; do not leak secret values or present supported-but-unconfigured integrations as enabled resources. Catalogs retain featured/More navigation, while configured inventories distinguish every named instance.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Use the shared in-use protections and separate last-enabled-type confirmation. Saving with the in-use acknowledgement lets previously acquired work finish; it is not a kill. The emergency alternative is the existing whole-engine force stop, followed by a separate tool operation. No tool-local force-stop flag/endpoint is introduced. Disable retains credentials/configuration; permanent removal follows conservative environment-reference handling.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Generic invocation/runtime settings remain temporary unless explicitly saved under [configuration precedence](configuration.md). Preserve actual-task context and show active, retained-current-use, pending-safe-boundary and restart-required states accurately. Placement/HTTP port can be genuine startup-only exceptions; tool inventory and `.env` changes must be detected live. Newly added tools can be used by the current task at a subsequent selection, not only after restart or task completion.
|
|
22
|
+
|
|
23
|
+
Per-tool browser recheck, startup retry and restart use the same engine-owned [browser recovery](browser.md) as automatic diagnosis. They respect profile/session/ownership safety and do not delete a tool, kill unrelated browsers or restart the engine. Runtime-only diagnostics/recovery creates no commit. [Expandable details](dashboard-details.md) expose actual execution metadata and individual profile/health state without hiding main actionable failures.
|
|
24
|
+
|
|
25
|
+
## Synchronization controls
|
|
26
|
+
|
|
27
|
+
When effective autosync is enabled, expose its compact dashboard status, redacted details and **Synchronize now** through the existing drill-down pattern. The action requests one shared [coordinator](git-synchronization.md) cycle, serialized/coalesced with timer and operation-boundary attempts. It does not run a second scheduler or bypass dirty-work safety. Report queued/running/deferred/failure/success distinctly; a fetch alone is not successful integration.
|
|
28
|
+
|
|
29
|
+
With autosync off, omit its dedicated dashboard panel/manual-cycle action. General settings can still show the disabled choice. Failed remote synchronization is distinct from local work and never implicitly pauses/stops the engine. All configuration, environment and Git mutations obey shared ownership/revision checks; a tool commit during task execution must remain scoped.
|
|
30
|
+
|
|
31
|
+
Leaving a dashboard/chat is not a service stop. Force stop is explicit, never an ambiguous second Stop press. Only the owner performs its [lock cleanup](locking.md) when possible; external hard kill has no cleanup guarantee. Inspection/navigation and runtime-only actions create no commits, and no saved operation is reported complete before required persistence succeeds.
|
|
32
|
+
|
|
33
|
+
See [channels](channels.md), [dashboard](dashboard.md), [terminal](terminal.md), [status](status-view.md), [global overview](global-dashboard.md) and [Git persistence](git-persistence.md).
|
|
@@ -1,23 +1,41 @@
|
|
|
1
|
-
# Expandable execution and
|
|
1
|
+
# Expandable execution, tools and synchronization details
|
|
2
2
|
|
|
3
|
-
[Main specification](../_main.md) · [Panel layout](dashboard-layout.md) · [
|
|
3
|
+
[Main specification](../_main.md) · [Panel layout](dashboard-layout.md) · [Shared controls](controls.md) · [Shared status](status-view.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The project dashboard is the engine's **cockpit**: a compact overview of its important parts, with consistent drill-down into each. Keep attention, current work, service controls and compact tools status visible. Verbose execution, individual-tool and synchronization details are initially collapsed and reachable through labelled terminal shortcuts and equivalent accessible browser controls. Opening/closing a detail is inspection, not mutation. Keep focus and drafts stable; global shortcuts never intercept composers or pickers. Exact keys and grid placement remain presentation choices.
|
|
6
6
|
|
|
7
7
|
## Execution detail
|
|
8
8
|
|
|
9
|
-
For the selected current task/run,
|
|
9
|
+
For the selected current task/run, show the agent, named tool instance, harness variant, effective model identifier/name and thinking level together. These are separate concepts. Include applicable overrides, phase and attempt/consultation attribution. When several harnesses/accounts or models are involved, show actual contexts rather than one misleading project-wide provider label.
|
|
10
10
|
|
|
11
|
-
Use
|
|
11
|
+
Use execution metadata, not merely saved defaults. Preserve provider-native thinking terminology where returned. Distinguish unknown/not reported, unresolved automatic choice and unsupported/not applicable. Refresh with activity; label last-run data as historical and do not invent inference while idle. Raw/API/detail snapshots retain the same information.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Tools overview and management
|
|
14
14
|
|
|
15
|
-
Show the
|
|
15
|
+
Show the ordered [tool inventory](tools.md), identifying each instance by name, type and variant, with enabled, usable, currently used and retained-current-use/draining states distinguished. The compact overview shows resource health and missing browser/harness warnings without a configuration dump. A shortcut opens the full inventory and then one instance's details; preserve the existing dashboard drill-down pattern instead of adding a separate management application.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Provide add, modify, reorder, **enable and disable as primary actions**, and clearly secondary permanent removal. Editing exposes the variant's applicable fields, optional description and safe credential-reference input. Explain actual account/profile identity; do not imply that two names referencing one native login or browser profile are two separate accounts. Secret values are write-only inputs and never shown in ordinary detail responses.
|
|
18
18
|
|
|
19
|
-
[
|
|
19
|
+
All actions call the same [management operations](tool-management.md) as CLI and init. Configuration changes commit immediately; they are not generic temporary dashboard controls. Display applied, committed, pending-persistence, refused and failed outcomes honestly. A live refresh or opening a form never performs a save. Protect stale edit revisions and preserve another client's accepted changes.
|
|
20
|
+
|
|
21
|
+
For an in-use modify/disable/remove, offer the shared alternatives: save the change while current work finishes with its acquired context, or invoke the existing **whole-engine force stop** and then separately apply/reconfirm the tool change after termination. Do not invent a tool-specific force-stop operation or suggest that disable cancelled an in-flight payment/post. Removing/disabling the last enabled instance of a type requires the additional specific confirmation about effective inability to start new work. Neither removal nor disable automatically puts the service into pause/stopped.
|
|
22
|
+
|
|
23
|
+
## Individual browser diagnostics
|
|
24
|
+
|
|
25
|
+
For the selected named browser tool, show saved and effective variant, profile source, authorized resolved path, `isHeadless`, actual launch/connection health, ownership/busy state and retained active uses. Distinguish newly saved settings from an old context still used by current work. A profile path does not grant access to its contents, cookies or credentials. Keep multiple browser instances independently identifiable.
|
|
26
|
+
|
|
27
|
+
Show real redacted failure evidence, automatic recovery attempts/outcomes and next retry where known. Recheck, retry startup and restart target this **owned browser instance**, calling the same [browser recovery](browser.md) as automatic repair. Label deferred safe-boundary actions; do not claim they have already happened. Preserve sessions, task checkpoints and external-effect evidence, and never kill unrelated user/project browsers or restart the entire engine as ordinary browser repair.
|
|
28
|
+
|
|
29
|
+
Automatic repair does not depend on an open panel or routine manual Restart clicks. Significant resource failures remain visible in the main overview/attention area while verbose details are closed. Runtime-only diagnosis/restart creates no Git commit; saved tool configuration does.
|
|
30
|
+
|
|
31
|
+
## Synchronization detail, only when enabled
|
|
32
|
+
|
|
33
|
+
Render a dedicated compact synchronization panel **only while effective Git autosync is enabled**. Expand it using the same navigation pattern to show redacted Git origin/tracking branch, observed phase, last attempt and successful integration/publication, known pending incoming/outgoing work, errors/conflicts, deferred integration and next retry. Unknown or stale information is explicit. A failed remote operation is not a stopped-engine indication.
|
|
34
|
+
|
|
35
|
+
Provide **Synchronize now**, invoking one cycle of the shared [synchronization coordinator](git-synchronization.md), with accepted/queued/running/success/deferred/failure outcomes. Coalesce overlapping requests with scheduled/boundary attempts. The button does not create another scheduler, rewrite configuration, enable a disabled policy, bypass ownership checks or guarantee that fetch has already integrated dirty files. Successful merges may create their ordinary commit; merely opening the panel does not.
|
|
36
|
+
|
|
37
|
+
When autosync is off, omit this dedicated panel and its manual action rather than showing a permanently inactive box. General configuration inspection can still report the stored choice. Changing the policy refreshes the view without losing unrelated drafts or misleading users about an already-running attempt.
|
|
20
38
|
|
|
21
39
|
## Acceptance outcomes
|
|
22
40
|
|
|
23
|
-
|
|
41
|
+
Open each applicable detail by its discoverable shortcut and return without mutation. Verify actual execution metadata with multiple instances/consultations and unknown model data. Add/enable a tool from another terminal during active work and observe immediate availability; save management changes with their own commits and the exact shared protections. Test every browser profile source and per-instance automatic/manual recovery without secret disclosure or unrelated kills. Toggle autosync: its panel appears only when enabled, reports real pending/failing state and triggers the shared cycle. Lifecycle controls and important waits remain visible in all layouts.
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[Main specification](../_main.md) · [Shared status view](status-view.md) · [Expandable details](dashboard-details.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Terminal and browser project dashboards are a coherent **operational cockpit** with separated labelled panels, not one rectangle of logs. Use consistent padding, spacing, alignment and boundaries. The hierarchy also applies to pretty one-shot snapshots; exact grid/rendering technology is not prescribed. The [global dashboard](global-dashboard.md) remains a separate host-wide table, not this project panel grid or another engine.
|
|
6
6
|
|
|
7
|
-
Keep a compact project/version/service-state header
|
|
7
|
+
Keep a compact project/version/service-state header and these functional regions:
|
|
8
8
|
|
|
9
9
|
| Region | Content and priority |
|
|
10
10
|
| --- | --- |
|
|
11
|
-
| Needs your attention |
|
|
12
|
-
| Current work | Agent
|
|
13
|
-
| Service controls | Always-discoverable
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
11
|
+
| Needs your attention | Actual agent-authored chats awaiting User, linked work and direct thread actions. Unread and all-chats access are distinct. Highest priority. |
|
|
12
|
+
| Current work | Agent identity, task, phase and truthful wait/blocker, with execution-detail access. |
|
|
13
|
+
| Service controls | Always-discoverable pause/resume, pending-intent cancellation/change, graceful stop, explicit whole-engine force stop and restart. |
|
|
14
|
+
| Tools | Compact named browser/harness availability, enabled/in-use summaries and access to shared tool management and individual diagnostics. |
|
|
15
|
+
| Synchronization | Compact Git synchronization state and drill-down/manual-cycle access, **only when autosync is enabled**. |
|
|
16
|
+
| Queue | Upcoming work and readiness/dependency summaries with bounded detail access. |
|
|
17
|
+
| Results and activity | Compact outcomes/statistics and a separately bounded diagnostic/activity area. |
|
|
18
|
+
| Connection | Verified local/remote dashboard availability, URL/QR and access guidance, secondary to work and attention. |
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Verbose execution, tool configuration/individual browser diagnostics and synchronization status use the same **initially collapsed detail pattern**, keyboard-accessible with labelled controls. Follow [detail contracts](dashboard-details.md); never dump every model/credential field into the main view. A concise actionable failure remains visible while details are closed. Enabling/disabling is the primary tool-management path; permanent removal is secondary, not an easy accidental primary action.
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
Show engine lifecycle states `running`, `pausing`, `pause` and `stopping` independently of task/resource/synchronization phases. Waiting for a missing browser/harness is compatible with running, not a new lifecycle state or a technical pause. Failed pull/push can coexist with active local work. Lifecycle controls are not hidden in tools or synchronization details. Shared confirmations and outcomes come from [service lifecycle](service-lifecycle.md), not UI-specific semantics; an observed exited service is not a fifth live state.
|
|
21
23
|
|
|
22
|
-
On
|
|
24
|
+
On wide terminals/screens, several panels remain simultaneously distinguishable with aligned edges. On narrow screens, stack/compact by priority while retaining attention, live state and lifecycle actions. Secondary detail can scroll/collapse in labelled regions. Never hide required actions under logs, shrink text to unreadability, clip QR codes or let agent artwork cover controls. Empty queues and resource waits have meaningful concise states.
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Update live regions without flicker, focus moves, lost drafts or scroll resets, or repeated frames in scrollback. New activity cannot displace a response being edited. Show applicable keys/focus and accessible browser labels. A snapshot renders the grouping once; raw output uses clear text sections without borders/cursor control. A viewer's collapsed panels and focus are presentation state only; changing them never changes the engine or another viewer's layout.
|
|
26
|
+
Update live regions without flicker, moved focus, lost drafts, reset scroll or repeated frames in scrollback. Background tool/sync updates must not steal the current editor. A snapshot renders once; raw output uses labelled plain sections. A viewer's focus and collapsed panes are local presentation state and do not change the engine or another viewer.
|
|
27
27
|
|
|
28
28
|
## Acceptance outcomes
|
|
29
29
|
|
|
30
|
-
Exercise wide/narrow terminal/browser
|
|
30
|
+
Exercise wide/narrow terminal/browser layouts, zero tools, busy work, empty queues, long identifiers/URLs, multiple waiting chats and resizing during replies/tool edits. Main lifecycle actions and concrete resource waits stay visible. Drill into execution, tools, a browser and enabled synchronization with keyboard-only navigation. Disabled sync has no dedicated panel. Two clients show the same shared state and accepted changes while preserving their independent focus/panel choices. No log, avatar or connection box obscures required controls.
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[Main specification](../_main.md) · [Project service API](api.md)
|
|
4
4
|
|
|
5
|
-
Serve a lightweight JavaScript
|
|
5
|
+
Serve a lightweight JavaScript SPA at `/` on the project's HTTP server. It is a frontend for the independent authenticated API, not another service/queue. No separate frontend server/setup is needed. The engine runs with zero clients and many browser/terminal/API clients may attach without owning its lock.
|
|
6
6
|
|
|
7
|
-
Load
|
|
7
|
+
Load static shell/assets, then obtain live state and send controls only through API. Render in the browser without server-rendered runtime fragments, page reloads or server-side form actions. Keep it small, without React or another frontend application framework. Scheduling, validation, management, synchronization and recovery live in the shared engine/domain operations, not duplicated UI code.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use the [status view](status-view.md) and [cockpit hierarchy](dashboard-layout.md): actual project/version/lifecycle, current work, queue, tools, outcomes/errors, attention and connection. A visible main lifecycle panel exposes pause/resume, pending-intent changes, graceful stop, explicit whole-engine force stop and restart. Stop/restart are not hidden in diagnostics or equivalent to closing the page.
|
|
10
10
|
|
|
11
|
-
Use
|
|
11
|
+
Use consistent [expandable details](dashboard-details.md) for actual execution metadata, named tool management and individual browser profiles/health/recovery. Primary tool actions are enable/disable; permanent removal is secondary. All management persists scoped configuration commits and uses the same protections and types as CLI/init. New tools can serve current work without page or engine restart. A no-tools wait is not a technically stopped service.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
When and only when autosync is enabled, show its compact panel with real status, drill-down details and Synchronize now through the shared coordinator. Omit the panel while off. Pending/failed remote operations do not obscure successful local work. Do not implement a separate frontend pull loop or claim fetch equals safe integration.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Chats awaiting User are the highest-priority attention area, with actual agent, reason, links and direct thread action. New chat uses [Chatter-first entry](chat-ui.md); existing questions keep their authors, including Fixer. All chats remain accessible and unread is distinct from actionable. No new Fixer-specific UI/channel is introduced. Main actionable failures remain noticeable on narrow screens without scrolling through logs.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Updates never steal focus, reset collapsed choices or discard drafts/secret-entry input. Reading alone does not answer a question or save settings. Viewer focus/layout is local; accepted state mutations propagate to all clients. Harness adapter catalogs use featured/More, while configured same-variant instances remain individually visible. No secret is echoed in ordinary state or diagnostic errors.
|
|
18
18
|
|
|
19
|
-
Show loading, disconnection, observed service exit and failed/unconfirmed
|
|
20
|
-
|
|
21
|
-
The [global dashboard](global-dashboard.md) is a separate host-wide terminal feature; this per-project SPA does not create a global engine or silently acquire machine-wide access. See [controls](controls.md), [channels](channels.md) and [start output](start.md).
|
|
19
|
+
Show loading, disconnection, observed service exit and failed/unconfirmed/pending operations truthfully. Refresh/closure/failure never starts/stops/recreates the service or duplicates work/messages. Mutations obey authorization and revision/ownership checks; explicit whole-engine stop affects all viewers. The global dashboard remains a separate host-wide terminal feature, not silent machine-wide authority in this SPA. See [controls](controls.md), [channels](channels.md) and [start output](start.md).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Environment references and non-destructive secret editing
|
|
2
|
+
|
|
3
|
+
[Main specification](../_main.md) · [Tools](tools.md) · [Tool management](tool-management.md) · [Git persistence](git-persistence.md)
|
|
4
|
+
|
|
5
|
+
## References, never inline keys
|
|
6
|
+
|
|
7
|
+
An API tool stores `apiKey: "${{ env.VARIABLE_NAME }}"` in `ptbk.json`. Resolve it at execution time from the process environment or the project's ignored `.env`; an explicitly supplied process-environment value takes precedence over the file. Report which source is effective without revealing its value. Changing a parent shell cannot magically change an already running process's inherited environment; project `.env` edits and tool changes must nevertheless be reloaded without restart.
|
|
8
|
+
|
|
9
|
+
Support only this bounded environment-reference notation, including optional surrounding whitespace inside the delimiters. It is not the GitHub Actions expression language, a JavaScript evaluator, shell expansion or permission to execute code. The variable name must be a valid supported environment identifier. A missing/empty required value makes that instance unavailable and invokes normal fallback/repair; never send the reference string as the actual credential or fall back to an unrelated key.
|
|
10
|
+
|
|
11
|
+
The versioned configuration, commits, traces, API snapshots and diagnostic output retain the reference only. Never persist a resolved key there, echo it in an error, include it in a commit message or interpolate it into logged commands. Inline credential values are invalid and handled without reproducing the secret. Native login stores, browser sessions and process-level credentials remain separate from `.env` editing.
|
|
12
|
+
|
|
13
|
+
## Audit trail inside .env
|
|
14
|
+
|
|
15
|
+
Because `.env` is not in Git, every engine-authored addition or modification must include an adjacent comment with an unambiguous timestamp (including timezone), reason and affected operation/tool where applicable. Put that comment immediately above the added assignment or the newly commented-out assignment. The comment contains no secret value.
|
|
16
|
+
|
|
17
|
+
Never delete an existing assignment or its history. To change a value, retain the old assignment commented out with a timestamped explanation, then add the new active assignment with its own explanation. To retire an unused credential after tool removal, comment it out and explain when and why. Keep unrelated lines, comments, formatting, quoting, newline conventions and content intact; do not parse the file into a dictionary and regenerate it destructively. Never source/execute the file as shell code.
|
|
18
|
+
|
|
19
|
+
Disabling a tool never comments out or removes its credentials. Removing one tool does not imply its environment variable is unused: consider every remaining reference, including disabled tools, project scripts and other known consumers. If **anything** uses it, or complete non-use cannot be established safely, leave it active. Do not alter an inherited process variable or another application's/native account store. An engine-managed reference with proven no remaining consumer may be retired by commenting, never deletion.
|
|
20
|
+
|
|
21
|
+
Ambiguous duplicate assignments, incompatible syntax, stale concurrent edits or uncertain value ownership are repair problems; do not choose a destructive interpretation. Preserve existing environment-variable names rather than applying tool-name normalization to them.
|
|
22
|
+
|
|
23
|
+
## Coordinated changes and secret input
|
|
24
|
+
|
|
25
|
+
Use one shared safe editor for init, CLI and dashboard, with coordinated writers, revision/conflict detection and atomic file replacement where available. Prepare and validate the intended configuration/environment changes together, preserve restricted file access, and leave a recoverable outcome if either persistence step fails. Do not report a tool as ready when its required secret was not safely stored. Retrying must not duplicate assignments or audit comments for the same completed edit.
|
|
26
|
+
|
|
27
|
+
Ensure `.env` and sensitive local stores are ignored before writing secrets. If a file is already tracked, ignore rules alone do not untrack it: preserve it, report the problem and require safe remediation; never commit the secret or silently rewrite Git history. Configuration/ignore-rule changes belong to their scoped commit; `.env` itself never does.
|
|
28
|
+
|
|
29
|
+
Prefer existing environment references. New secrets are accepted through concealed interactive input or an explicitly selected protected stdin path, not ordinary command-line arguments that enter shell history. Dashboard responses must not echo submitted values. Annotate additions just like removals and replacements. Tool management commits only non-secret configuration and related authorized metadata.
|
|
30
|
+
|
|
31
|
+
## Acceptance outcomes
|
|
32
|
+
|
|
33
|
+
Resolve a reference from environment and from `.env`, verify precedence and refresh, and reject missing/invalid references without secret disclosure. Add, rotate, remove and disable tools sharing a key; preserve all historical assignments and annotate each real edit. A disabled or unrelated known consumer keeps the variable active; uncertainty also keeps it active. Race two edits, interrupt persistence, and inspect malformed/duplicate assignments and an already tracked `.env`: preserve content and report recovery, with no secret in Git, logs, output or API state.
|
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
[Main specification](../_main.md)
|
|
4
4
|
|
|
5
|
-
One project executes one task at a time, including assignment, teaching, bootstrap and goal-enquiry
|
|
5
|
+
One project executes one task at a time, including assignment, teaching, bootstrap, repair and goal-enquiry work. TEAM consultations remain within the owning task/conversation. Entry points share lifecycle/acceptance rules; the [engine owns execution](process-modes.md), while dashboards request controls.
|
|
6
6
|
|
|
7
|
-
Select eligible work only while
|
|
7
|
+
Select eligible work only while lifecycle state is `running`. Before each claim, refresh configuration/version and `.env`, check current enabled/usable tools and actual task constraints, and perform the required opt-in synchronization attempt. A failed remote attempt does not itself block work. Missing resources leave the service running with an explicit tool wait. Establish current source, normalized [task name](task-identity.md) and actual execution context.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Perform work, verify outcome and applicable real checks, prepare completion/follow-ups, attempt pre-commit synchronization safely and commit the accepted result. An informational check placeholder is not real validation evidence. Record actual agent, named tool instance/variant, model/thinking selection, actions/checks/outcomes, available harness output, scoped chats and attributable browser recordings in the [literal source-filename trace directory](traces.md).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The registry remains live during work. Newly added/enabled tools can be used at the next appropriate selection. An already acquired tool affected by a confirmed configuration change may retain its original context under [tool runtime](tool-runtime.md); do not freeze the whole list or restore an old configuration at completion. Tool/normalization commits can occur independently during the task and must not absorb its unfinished changes.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A task may change project materials, agents and other tasks. Accepted changes, completion, generated follow-ups and eligible evidence form one task result commit correlated by Task-Name. Follow-ups get distinct readable names/source-based traces; Teacher learning runs as its own later task. Init has no separate inline bootstrap execution path. Preserve intervening scoped commits and reconcile shared-file changes before validation/persistence.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Failed real checks cause bounded repair/recheck, not false completion. Persistence retries resume the right phase; failed push never repeats accepted work/effects. Human-waiting/recovery tasks remain unfinished with evidence preserved. Problems use the shared [automatic repair](../concepts/automatic-repair.md) and ordinary Fixer, not another worker or communication channel.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
After completion, claim further work only if lifecycle still permits it. Pausing/stopping drain or checkpoint current work without starting follow-ups. Cancelling/replacing pending intent does not restart the task. Force stop interrupts owned execution without false completion and retains available recovery evidence. See [service lifecycle](service-lifecycle.md).
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Checkpoint a blocked task and release ownership for independent work only when safe; no concurrent task mutations or mixing unresolved edits into another result. A human wait is not permission to discard work. Start keeps supervising empty queues and recoverable/resource waits; finite run may finish with an honest incomplete outcome. Shared unsafe ownership may block affected work, but a network synchronization failure alone does not.
|
|
20
|
+
|
|
21
|
+
See [checks](checks.md), [Git persistence](git-persistence.md), [Git synchronization](git-synchronization.md), [recovery](recovery.md), [traces](traces.md) and [task origins](task-origins.md).
|
|
@@ -4,48 +4,54 @@
|
|
|
4
4
|
|
|
5
5
|
## Commit by default
|
|
6
6
|
|
|
7
|
-
Every successful Promptbook operation
|
|
7
|
+
Every successful Promptbook operation changing versioned project content commits its own authorized changes by default: initialization, task/chat authoring, approved planning saves, templates, saved configuration, repair/recovery and task execution, including Manager, Teacher, Fixer, discovery and Chatter-requested work. CLI, terminal, browser and API share the rule; a separate `--commit` is not required.
|
|
8
8
|
|
|
9
|
-
A logical operation is the boundary, not each file write or UI step.
|
|
9
|
+
A logical operation is the boundary, not each file write or UI step. Each accepted human-facing message and chat creation commits independently. Task-internal consultations join the task's single result commit; conversation-only consultations use ordinary scoped authoring persistence. See [chats](chats.md).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
[Configuration migrations](configuration-migrations.md) commit the whole successful multi-version pass once, including the final version even if there are no transformation steps. [Tool management](tool-management.md) commits add/modify/reorder/enable/disable/remove immediately and separately. Deterministic normalization saves an isolated correction, or joins the owning configuration operation when already being prepared there. None may absorb task changes or create an empty commit for a no-op. Secret-file edits follow their own [timestamped local audit](environment.md), never a Git commit of `.env`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A clean repository is clean at completed operation boundaries unless another owned operation is still active. Read-only commands, cancelled previews, no-ops and runtime/session changes create no commits. Pause/resume/stop/restart, browser repair and viewer navigation are runtime-only unless explicitly saving defaults. Trace inclusion never authorizes versioning `.ptbk/`, credentials or profiles. Push is governed separately by [autosynchronization](git-synchronization.md).
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Report saved completion only after commit success. Dispatch does not race ahead of a task's authoring commit. Failed persistence remains recoverable/pending, not completion and not a reason to rerun successful model work.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Commit messages and history
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Every automatic engine commit starts with exact `PTBK: ` plus a meaningful operation summary. Apply the prefix once. A task result uses `PTBK: <task title>` with its descriptive assignment and task-local rules retained in the body. Other subjects identify setup, tool changes, migration, normalization, maintenance or integration. Chat commits retain Chat-Name correlation.
|
|
20
20
|
|
|
21
|
-
Task-attributable commits carry `Task-Name: <declared name>` and source/revision context, not
|
|
21
|
+
Task-attributable commits carry `Task-Name: <declared name>` and source/revision context, not generated IDs or filename identity. Creation, assignment, result, repair, integration and recurrence retain the name valid for that operation; explicit renames relate old/new names. Multi-task records distinguish executing work from generated follow-ups.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
History is append-only for automatic engine operations. Never rebase, amend, squash away commits, reset away history or force-push to manufacture cleanliness. Real integrations use visible non-fast-forward merge commits under [synchronization](git-synchronization.md) and [isolation](isolation.md); already up-to-date input does not require an empty merge. Preserve each original result commit and its provenance. Specification-editing commits in this repository follow their requested `Specs - ...` convention, not the runtime `PTBK: ` convention.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Concurrent operations and task results
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Each completed task/occurrence has one result commit containing its accepted changes, formatter/check changes, completion, follow-ups and eligible artifacts in **`traces/<task-file-basename>/`**, including finalized selected video. This literal source filename without final `.book`/`.md` is independent of Task-Name. Failed attempts remain evidence, not successful result commits. A separate later integration merge is not a second task execution/result.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
A tool may be added/modified in another terminal during an active task: commit that tool operation immediately, make newly available resources usable by the task, and commit the task result later. Preserve the intervening commit and configuration. Coordinate file/index ownership at the required granularity; never stage the active task's unfinished work in the tool commit or restore an obsolete `ptbk.json` snapshot when the task ends. Same-file concurrent edits require reconciliation, not blanket replacement. A safe tool operation need not wait for the whole task to finish merely to keep commits separate.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Only attributable changes may enter a commit. Preserve unrelated staged/unstaged content, hooks, signing and ignore rules. No blanket staging or destructive cleanup/stashing. Validate the actual intended committed content; post-check external/synchronization edits require reconciliation and affected checks. A user's dirty state is not automatically adopted by another operation.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Apply trace/video exclusions before staging and never force-add ignored evidence. Preserve local traces regardless of inclusion. Finalize pre-commit artifacts; record later commit/push events without embedding a commit's own SHA in its tree or producing endless bookkeeping commits. Keep source/name/trace rename provenance.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Start may refuse unrelated dirty initial state; subsequently it manages its own pending/interleaved writes rather than treating every owned change as fatal. Ambiguous shared ownership prevents unsafe progress while controls remain available. Intentionally ignored traces are not such a blocker.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Publish task-source updates atomically. Transient Windows sharing failures allow bounded retry of the same prepared update with ownership, confinement and original revision rechecked. Never delete the destination to force replacement; exhaustion preserves work without rerunning agents or false completion.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
<a id="explicit-uncommitted-mode"></a>
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
## Explicit uncommitted workflows
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
`--no-commit` disables automatic commits for an ordinary invoked task/authoring workflow and its spawned work, including init's service, not another owner or future invocation. `--commit` spells the default; contradictory flags fail before writes. Keep the uncommitted state visible and retain checks, names, source revisions, traces and recovery without inventing SHAs or rerunning accepted work.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Required configuration migrations and explicit saved `ptbk tool` management do not silently become uncommitted: diagnose an incompatible no-commit request before their writes, and explain the committed operation needed. A fresh init can still batch initial tool preparation into its explicitly uncommitted setup; later management commands remain separate committed operations. A configuration repair requiring a commit cannot silently violate an explicit no-write/no-commit invocation.
|
|
46
|
+
|
|
47
|
+
An uncommitted workflow may process its proven owned work, not adopt unrelated changes. Reentering committed mode requires reconciliation, never a surprise aggregate commit. Preserve `--git-changes fail|ignore|continue`: default refuses unrelated dirt, ignore retains it, continue resumes one proven interrupted task. No flag transfers unknown ownership. No-commit conflicts with isolation and autosync, including legacy auto-pull/push aliases.
|
|
48
|
+
|
|
49
|
+
Respect configured Git identity/signing, including `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, `CODING_AGENT_GIT_SIGNING_KEY` and `CODING_AGENT_GPG_KEY_ID`; report the effective identity when falling back to Git configuration.
|
|
50
|
+
|
|
51
|
+
A full revert may reverse result/completion together or remove a task created there. Reverts add history rather than rewriting it. Git cannot undo browser/external effects; preserve their evidence and never repeat them solely because a completion stamp disappeared.
|
|
46
52
|
|
|
47
53
|
## Acceptance outcomes
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
Verify creation commits before dispatch, one meaningful PTBK prefix, task/chat name correlation and one result per occurrence. Interleave tool changes and task work, including same-file edits: preserve both scoped histories and unrelated staging. Test mandatory version-only migration commits, normalization no-ops, secret exclusion, failed hooks/signing and explicit uncommitted workflows. Pull/push failure does not rerun successful work; visible merge commits retain original results. Runtime controls and navigation create no commits.
|
|
50
56
|
|
|
51
57
|
See [authoring](authoring.md), [checks](checks.md), [recovery](recovery.md), [Git synchronization](git-synchronization.md) and [isolation](isolation.md).
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[Main specification](../_main.md)
|
|
4
4
|
|
|
5
|
-
Read-only inspection may operate without Git.
|
|
5
|
+
Read-only inspection may operate without Git. Initialization and mutating task execution establish a valid working tree before bootstrap writes, project dependency installation or model calls. Interactive start reuses the shared [init workflow](initialization.md) for genuine missing setup; explicit init authorizes a missing repository, not an unspecified nested strategy. The separately authorized [engine self-update](updates.md) is not project bootstrap.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Reuse existing repositories, including unborn branches, nested project directories and worktrees where `.git` is a file. Preserve the current branch/history. Explicitly use `main` only when creating a new repository. Never create accidental nested Git; use the existing [ignored-child/submodule choices](nested-projects.md). Distinguish missing Git, damaged and bare repositories from ordinary absent initialization.
|
|
8
8
|
|
|
9
|
-
Default
|
|
9
|
+
Default init commits only authorized setup as an initial/scoped `PTBK: ` commit, preserving unrelated files/staging, hooks, identity and signing. Repeated satisfied setup produces no empty commit. Failed local persistence remains incomplete; explicit `--no-commit` labels its exception and obeys migration/synchronization compatibility rules.
|
|
10
10
|
|
|
11
|
-
Establish a committed baseline or explicitly owned bootstrap
|
|
11
|
+
Establish a committed baseline or explicitly owned uncommitted bootstrap before unattended work. Authoring normally creates its own scoped baseline. Validate source revisions and ownership in either mode; a newly committed tool change during another owned task is not unrelated dirt to erase.
|
|
12
|
+
|
|
13
|
+
Do not add/change remotes by default. The explicit opt-in [synchronization setup](synchronization-setup.md) may create a private-by-default GitHub repository or configure the supplied origin/upstream; remote publication failure remains separate from local readiness. Never rewrite history, force-push or accidentally commit parent metadata. Required configuration migrations use their own coordinated committed pass before affected work.
|
|
14
|
+
|
|
15
|
+
See [workspace](workspace.md), [configuration migrations](configuration-migrations.md) and [Git persistence](git-persistence.md).
|
|
@@ -1,11 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Automatic Git synchronization
|
|
2
2
|
|
|
3
|
-
[Main specification](../_main.md)
|
|
3
|
+
[Main specification](../_main.md) · [Synchronization setup](synchronization-setup.md) · [Git persistence](git-persistence.md) · [Automatic repair](../concepts/automatic-repair.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Explicit opt-in, existing Git identity
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Root-level `ptbk.json.isAutoSync` is the single saved switch and defaults to false. Migrated projects stay off unless they already contain an explicit canonical choice. With synchronization disabled, perform no automatic remote pull/push, run no synchronization timer and show no dedicated synchronization dashboard panel. Local commits and normal work remain available.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
When enabled, use the selected repository's existing `origin` and the tracking destination for the branch on which this engine started. Read that information from Git, not duplicated JSON remote/branch settings. The engine does not routinely create, rename, check out or choose branches/remotes. New-repository init uses `main` and may configure publication through its explicit [setup step](synchronization-setup.md). Diagnose absent/ambiguous destinations without guessing, overwriting origin or stopping otherwise safe local work. An external branch switch requires safe ownership reconciliation, not silent continuation on a different project history.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`--auto-sync` and `--no-auto-sync` are invocation overrides. Legacy `--auto-pull`/`--auto-push` are explicitly documented compatibility opt-ins to this same combined synchronization capability, not separate persisted policies; explain that both directions are enabled. Contradictory overrides fail before mutation. Automatic synchronization requires committed operation and is incompatible with `--no-commit`.
|
|
12
|
+
|
|
13
|
+
## Timed and operation-boundary attempts
|
|
14
|
+
|
|
15
|
+
Use a default **60-second pull interval**, without adding a required user configuration question. In addition, always attempt pull before a new task or another logical mutating operation begins, and again before its local commit, regardless of the timer. This applies to authoring, tool/configuration changes and task results, not to every low-level file write. Push after completed local work/commits, including setup, tool changes and accepted repair results. Periodic/manual cycles also retry pending publication when no new task has completed.
|
|
16
|
+
|
|
17
|
+
These are attempts, not prerequisites of local progress. Network, authentication, missing remote or rejected-push failures must not stop otherwise safe local task execution or local commits. Keep pending synchronization with its real cause, latest attempt/success and next retry. Back off repeated failures within bounds and avoid tight loops. Coalesce concurrent timer, boundary and manual requests through one coordinator; do not run competing Git mutations or flood the remote with duplicate requests. Synchronization's own merge commit must not recursively trigger another pre-commit pull.
|
|
18
|
+
|
|
19
|
+
A pull is a fetch plus safe integration. Fetching may occur during work; integrating remote files may not overwrite active task/tool edits or alter files under a running check. At a pre-commit attempt with owned dirty work, preserve that work: safely reconcile when possible, otherwise record integration as deferred, commit only the verified local operation and integrate at the next safe boundary. Do not claim a successful integration when only fetch succeeded. Never automatically stash/drop unknown changes, reset the worktree or mix unrelated staging to make pull succeed.
|
|
20
|
+
|
|
21
|
+
After successful integration, refresh tasks, configuration version, tools and relevant readiness before selecting new work. If integration changes the content intended for a task result, rerun affected validation rather than commit an invalidated checked snapshot. New remotely authored tasks become ordinary eligible work. In isolated execution, synchronize/publish the integrated project branch, not temporary worktree branches.
|
|
22
|
+
|
|
23
|
+
## Visible merges and immutable history
|
|
24
|
+
|
|
25
|
+
Integrate fetched changes using a normal **non-fast-forward merge**: when remote changes need integration, retain a visible merge commit even if fast-forward would have been possible. An already up-to-date branch does not produce an empty merge commit. Never use rebase, squash, amend, destructive reset, force-push or another history rewrite as an automatic synchronization strategy. Preserve existing commits and both parents of real merges. Automatic merge/repair commits use the normal `PTBK: ` subjects and remain separate from task-result or tool-management commits.
|
|
26
|
+
|
|
27
|
+
Resolve ordinary conflict-free merges automatically. Problems needing judgment go to the ordinary **Fixer**, which may resolve straightforward conflicts using evidence and project policy or consult its team, including User by default, when necessary. Do not automatically make every conflict a human question or silently choose ours/theirs and lose work.
|
|
28
|
+
|
|
29
|
+
For a difficult merge, retain both histories and enough recoverable conflict context without leaving the sole working tree stuck in a half-merged state that unnecessarily prevents local tasks. Integrate in a safe coordinated context, or defer unresolved remote integration while restoring/preserving the exact pre-attempt local state. A genuinely unsafe shared-ownership problem may block affected work, but a failed synchronization alone must not stop local progress. Respect pause/stop when scheduling Fixer work.
|
|
30
|
+
|
|
31
|
+
Two different clones may accidentally execute the same task differently. Git synchronization is not a distributed execution lock and does not promise exactly-once external actions across machines. Preserve both results/provenance, surface task/occurrence conflicts to Fixer, and never replay payments/posts or erase one result merely to obtain a clean merge. Git history cannot undo external effects.
|
|
32
|
+
|
|
33
|
+
## Cockpit controls and acceptance
|
|
34
|
+
|
|
35
|
+
Only while synchronization is enabled, show a compact status panel with drill-down through the existing dashboard pattern. Details include redacted origin/branch, current phase, last attempt/success, known pending incoming/outgoing work, error/conflict/deferred-integration reason and next retry. Unknown data is labelled. Provide **Synchronize now** through the same coordinator, with truthful queued/running/success/deferred/failure outcomes. It requests one immediate cycle, not a second scheduler, configuration change or unconditional model call. See [dashboard details](dashboard-details.md).
|
|
36
|
+
|
|
37
|
+
Verify off means no automatic network traffic or dedicated panel. With opt-in, discover a task added remotely through the periodic cycle and attempt pull at every required operation boundary. Exercise network/authentication failure, active dirty work, pending push and manual trigger: local work/commits continue, effects are not repeated and retry state remains visible. Check non-fast-forward history on both divergent and fast-forwardable input, no empty up-to-date commits, no rebase/force-push, automatic simple repair and ordinary Fixer escalation for genuine ambiguity.
|