pi-background-tasks 0.9.0 → 1.0.4
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/BACKGROUND-TASKS-INSTRUCTIONS.md +63 -0
- package/PUBLISHING.md +43 -29
- package/README.md +233 -441
- package/TESTING.md +16 -10
- package/TEST_PLAN.md +43 -17
- package/docs/INDEX.md +157 -0
- package/docs/api/eventbus-v1.md +166 -0
- package/docs/assets/architecture.svg +78 -0
- package/docs/assets/footer-dock.svg +47 -0
- package/docs/assets/logo.svg +49 -0
- package/docs/attestations.json +189 -0
- package/docs/choose-a-workflow.md +98 -0
- package/docs/commands/bg-clear.md +70 -0
- package/docs/commands/bg-update.md +82 -0
- package/docs/commands/bg.md +90 -0
- package/docs/commands/fusion-models.md +70 -0
- package/docs/commands/fusion.md +69 -0
- package/docs/commands/jobs.md +74 -0
- package/docs/commands/kill.md +82 -0
- package/docs/commands/logs.md +90 -0
- package/docs/commands/task-manager.md +109 -0
- package/docs/concepts/completion-delivery.md +66 -0
- package/docs/concepts/context-projection-and-budgeting.md +79 -0
- package/docs/getting-started.md +122 -0
- package/docs/manifest.json +1825 -0
- package/docs/operations/configuration.md +110 -0
- package/docs/operations/releasing.md +67 -0
- package/docs/operations/testing.md +101 -0
- package/docs/operations/troubleshooting.md +38 -0
- package/docs/read-before-edit.md +94 -0
- package/docs/reference/runtime-contracts.md +213 -0
- package/docs/reference/shortcuts-and-dock.md +70 -0
- package/docs/subsystems/attested-pi-runs.md +141 -0
- package/docs/subsystems/background-task-runtime.md +85 -0
- package/docs/subsystems/child-launch-durability-and-safety.md +57 -0
- package/docs/subsystems/delegation.md +190 -0
- package/docs/subsystems/docs-freshness-gate.md +26 -0
- package/docs/subsystems/fusion.md +123 -0
- package/docs/subsystems/host-ui-and-telemetry.md +83 -0
- package/docs/tools/bg_delegate.md +193 -0
- package/docs/tools/bg_kill.md +114 -0
- package/docs/tools/bg_logs.md +133 -0
- package/docs/tools/bg_result.md +120 -0
- package/docs/tools/bg_run.md +168 -0
- package/docs/tools/bg_run_pi_attested.md +170 -0
- package/docs/tools/bg_status.md +111 -0
- package/docs/tools/fusion_investigate.md +116 -0
- package/docs/tools/fusion_reason.md +75 -0
- package/docs/tools/fusion_research.md +162 -0
- package/docs/tools/fusion_validate.md +206 -0
- package/logo.png +0 -0
- package/package.json +27 -9
- package/src/core/delegate/budget.ts +1 -1
- package/src/core/delegate/launch.ts +5 -0
- package/src/core/fusion/artifacts.ts +34 -4
- package/src/core/fusion/budget.ts +112 -20
- package/src/core/fusion/child-protocol.ts +82 -0
- package/src/core/fusion/clean-context.ts +91 -0
- package/src/core/fusion/config.ts +124 -35
- package/src/core/fusion/context.ts +29 -7
- package/src/core/fusion/evaluation.ts +392 -15
- package/src/core/fusion/orchestrator.ts +217 -23
- package/src/core/fusion/pi-child.ts +227 -24
- package/src/core/fusion/prompts.ts +39 -26
- package/src/core/fusion/source-policy.ts +257 -0
- package/src/core/fusion/types.ts +156 -11
- package/src/core/fusion/web-fetch.ts +104 -15
- package/src/core/fusion/workflows.ts +119 -65
- package/src/extension.ts +3 -3
- package/src/fusion-child-extension.ts +375 -141
- package/src/fusion-extension.ts +585 -240
- package/src/testing/normalize.ts +0 -22
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc_id: api/eventbus-v1
|
|
3
|
+
audience: maintainer
|
|
4
|
+
mode: mixed
|
|
5
|
+
review_policy: behavioral
|
|
6
|
+
stability: evolving
|
|
7
|
+
covers_surfaces: [eventbus:background-task-v1]
|
|
8
|
+
covers_sources: [src/core/extension-api.ts]
|
|
9
|
+
---
|
|
10
|
+
# EventBus API v1
|
|
11
|
+
|
|
12
|
+
<!-- pi-docs:begin name="eventbus-contract" generator="scripts/docs/generate.mjs" -->
|
|
13
|
+
| Channel purpose | Channel | Schema |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| Request | `pi-background-tasks:request:v1` | `pi-background-tasks.extension-request.v1` |
|
|
16
|
+
| Response | `pi-background-tasks:response:v1` | `pi-background-tasks.extension-response.v1` |
|
|
17
|
+
| Terminal | `pi-background-tasks:terminal:v1` | `pi-background-tasks.extension-terminal.v1` |
|
|
18
|
+
|
|
19
|
+
Operations: `capabilities`, `kill`, `logs`, `run`, `status`.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"api_version": 1,
|
|
25
|
+
"kill": true,
|
|
26
|
+
"logs": true,
|
|
27
|
+
"logs_bounded": true,
|
|
28
|
+
"run": true,
|
|
29
|
+
"run_completion_trigger": true,
|
|
30
|
+
"run_is_agent": true,
|
|
31
|
+
"status": true
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
<!-- pi-docs:end name="eventbus-contract" -->
|
|
35
|
+
|
|
36
|
+
Primary source: `src/core/extension-api.ts`. Code is authoritative.
|
|
37
|
+
|
|
38
|
+
## Channels and schema ids
|
|
39
|
+
|
|
40
|
+
| Purpose | Channel | `schema_version` |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Requests | `pi-background-tasks:request:v1` | `pi-background-tasks.extension-request.v1` |
|
|
43
|
+
| Responses | `pi-background-tasks:response:v1` | `pi-background-tasks.extension-response.v1` |
|
|
44
|
+
| Terminal events | `pi-background-tasks:terminal:v1` | `pi-background-tasks.extension-terminal.v1` |
|
|
45
|
+
|
|
46
|
+
## Request frame
|
|
47
|
+
|
|
48
|
+
Closed object; unknown keys fail.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
{
|
|
52
|
+
schema_version: 'pi-background-tasks.extension-request.v1',
|
|
53
|
+
request_id: string, // non-empty, max 200 chars
|
|
54
|
+
operation: 'capabilities' | 'run' | 'status' | 'logs' | 'kill',
|
|
55
|
+
payload: object // operation-specific closed object
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Payloads:
|
|
60
|
+
|
|
61
|
+
- `capabilities`: `{}` only.
|
|
62
|
+
- `run`: `{ name, command, isAgent, notifyOnCompletion, triggerOnCompletion, timeoutSeconds? }`; strings are non-empty, booleans are booleans, `timeoutSeconds` is a positive integer when present.
|
|
63
|
+
- `status`: `{ taskId? }`; `taskId` is non-empty when present.
|
|
64
|
+
- `logs`: `{ taskId, maxBytes?, tail? }`; `maxBytes` is positive when present and is still bounded by runtime log caps.
|
|
65
|
+
- `kill`: `{ taskId }`.
|
|
66
|
+
|
|
67
|
+
Malformed frames still receive a response where possible: `request_id` and `operation` echo valid non-empty input strings, otherwise `malformed`.
|
|
68
|
+
|
|
69
|
+
## Response frame
|
|
70
|
+
|
|
71
|
+
Closed by construction through the exported union:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// success
|
|
75
|
+
{
|
|
76
|
+
schema_version: 'pi-background-tasks.extension-response.v1',
|
|
77
|
+
request_id: string,
|
|
78
|
+
operation: string,
|
|
79
|
+
ok: true,
|
|
80
|
+
result: BackgroundTaskExtensionResult
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// error
|
|
84
|
+
{
|
|
85
|
+
schema_version: 'pi-background-tasks.extension-response.v1',
|
|
86
|
+
request_id: string,
|
|
87
|
+
operation: string,
|
|
88
|
+
ok: false,
|
|
89
|
+
error: string // whitespace-compacted, max 240 chars
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Duplicate `request_id` values are rejected. The service rejects requests before `session_start` and while shutting down. Calling `close()` unsubscribes the request listener, so later requests are not handled and receive no service response.
|
|
94
|
+
|
|
95
|
+
## Capabilities
|
|
96
|
+
|
|
97
|
+
`capabilities` returns exactly:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"api_version": 1,
|
|
102
|
+
"run": true,
|
|
103
|
+
"run_is_agent": true,
|
|
104
|
+
"run_completion_trigger": true,
|
|
105
|
+
"status": true,
|
|
106
|
+
"logs": true,
|
|
107
|
+
"logs_bounded": true,
|
|
108
|
+
"kill": true
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Terminal frames
|
|
113
|
+
|
|
114
|
+
Terminal events are emitted on `pi-background-tasks:terminal:v1`:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
{
|
|
118
|
+
schema_version: 'pi-background-tasks.extension-terminal.v1',
|
|
119
|
+
task: BgTaskSnapshot
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The terminal event carries no request id; consumers correlate by `task.id` returned from `run`/`kill`/`status`.
|
|
124
|
+
|
|
125
|
+
## Ordering and durability barrier
|
|
126
|
+
|
|
127
|
+
For `run` and `kill` requests, the service installs a terminal-publication gate. After the response is emitted, the gate waits one microtask before releasing terminal publication, so immediate-exit tasks cannot publish terminal before the caller has observed the task id.
|
|
128
|
+
|
|
129
|
+
The registry publishes terminal snapshots only after the output stream has finished/closed and durable terminal metadata has been written. Successful publication is latched and not emitted again. If `EventBus.emit` throws, the failure is loud and the registry retries; because one listener may have received a frame before another listener threw, delivery is **at least once under emission failure**. Consumers must deduplicate by `task.id`.
|
|
130
|
+
|
|
131
|
+
## Operations
|
|
132
|
+
|
|
133
|
+
- `run` starts a background task through the registry and returns a `BgTaskSnapshot`.
|
|
134
|
+
- `status` returns `{ tasks }`; with `taskId`, the array has one resolved task or errors loudly.
|
|
135
|
+
- `logs` returns bounded log details plus `text`; full bytes stay in `.pi/tasks/...output`.
|
|
136
|
+
- `kill` stops a running task and returns `{ task, message }` after the stop path.
|
|
137
|
+
- `capabilities` is pure and does not require a task.
|
|
138
|
+
|
|
139
|
+
## Integration example
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
const requestId = crypto.randomUUID();
|
|
143
|
+
const terminal = new Promise((resolve) => {
|
|
144
|
+
const off = events.on('pi-background-tasks:terminal:v1', (frame) => {
|
|
145
|
+
if (frame?.schema_version === 'pi-background-tasks.extension-terminal.v1') {
|
|
146
|
+
off();
|
|
147
|
+
resolve(frame.task);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
events.emit('pi-background-tasks:request:v1', {
|
|
153
|
+
schema_version: 'pi-background-tasks.extension-request.v1',
|
|
154
|
+
request_id: requestId,
|
|
155
|
+
operation: 'run',
|
|
156
|
+
payload: {
|
|
157
|
+
name: 'Example',
|
|
158
|
+
command: 'printf eventbus-ok',
|
|
159
|
+
isAgent: false,
|
|
160
|
+
notifyOnCompletion: true,
|
|
161
|
+
triggerOnCompletion: true
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Listen for the matching response on `pi-background-tasks:response:v1`, deduplicate terminal frames by `task.id`, and treat the frame's metadata-backed status as terminal truth; do not poll status merely to reconfirm it.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc" viewBox="0 0 1200 820">
|
|
2
|
+
<title id="title">pi-background-tasks architecture</title>
|
|
3
|
+
<desc id="desc">Pi session routes to a background registry, delegate child process, and Fusion candidates that flow through blind evaluation, optional repair, and merger.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="panel" x1="0" x2="1">
|
|
6
|
+
<stop offset="0" stop-color="#071a33"/>
|
|
7
|
+
<stop offset="1" stop-color="#0e3157"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="cyan" x1="0" x2="1">
|
|
10
|
+
<stop offset="0" stop-color="#77f5ff"/>
|
|
11
|
+
<stop offset="1" stop-color="#18bde7"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<linearGradient id="amber" x1="0" x2="1">
|
|
14
|
+
<stop offset="0" stop-color="#ffd987"/>
|
|
15
|
+
<stop offset="1" stop-color="#ffa51f"/>
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<marker id="arrowCyan" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
|
|
18
|
+
<path d="M2,2 L10,6 L2,10" fill="none" stroke="#37d7ef" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
19
|
+
</marker>
|
|
20
|
+
<marker id="arrowAmber" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
|
|
21
|
+
<path d="M2,2 L10,6 L2,10" fill="none" stroke="#ffb43d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
22
|
+
</marker>
|
|
23
|
+
<style>
|
|
24
|
+
.bg{fill:#061529}.panel{fill:url(#panel);stroke:#2ed7ef;stroke-opacity:.45;stroke-width:2}.node{fill:#0b2848;stroke:#64ecff;stroke-width:2}.amber{stroke:#ffbd4b}.txt{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;fill:#eefbff}.muted{fill:#a9c7d8}.small{font-size:22px}.label{font-size:26px;font-weight:700}.tiny{font-size:18px}.line{fill:none;stroke:#37d7ef;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker-end:url(#arrowCyan)}.lineA{fill:none;stroke:#ffb43d;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker-end:url(#arrowAmber)}
|
|
25
|
+
</style>
|
|
26
|
+
</defs>
|
|
27
|
+
<rect class="bg" width="1200" height="820" rx="34"/>
|
|
28
|
+
<circle cx="100" cy="78" r="6" fill="#72f3ff" opacity=".7"/><circle cx="1090" cy="82" r="5" fill="#ffbd4b" opacity=".8"/><circle cx="1028" cy="760" r="5" fill="#72f3ff" opacity=".6"/>
|
|
29
|
+
|
|
30
|
+
<rect class="panel" x="50" y="70" width="250" height="126" rx="24"/>
|
|
31
|
+
<text class="txt label" x="175" y="122" text-anchor="middle">Pi session</text>
|
|
32
|
+
<text class="muted small" x="175" y="158" text-anchor="middle">commands · tools · EventBus</text>
|
|
33
|
+
|
|
34
|
+
<rect class="panel" x="430" y="46" width="300" height="170" rx="26"/>
|
|
35
|
+
<text class="txt label" x="580" y="98" text-anchor="middle">Background registry</text>
|
|
36
|
+
<text class="muted small" x="580" y="134" text-anchor="middle">spawn · track · kill</text>
|
|
37
|
+
<text class="muted small" x="580" y="168" text-anchor="middle">closed output + durable metadata</text>
|
|
38
|
+
|
|
39
|
+
<rect class="panel" x="858" y="70" width="292" height="126" rx="24"/>
|
|
40
|
+
<text class="txt label" x="1004" y="122" text-anchor="middle">Notification</text>
|
|
41
|
+
<text class="muted small" x="1004" y="158" text-anchor="middle">footer · follow-up turn</text>
|
|
42
|
+
|
|
43
|
+
<path class="line" d="M300 132 C350 132 378 132 430 132"/>
|
|
44
|
+
<path class="line" d="M730 132 C782 132 807 132 858 132"/>
|
|
45
|
+
|
|
46
|
+
<rect class="panel" x="72" y="284" width="268" height="118" rx="24"/>
|
|
47
|
+
<text class="txt label" x="206" y="334" text-anchor="middle">Projected seed</text>
|
|
48
|
+
<text class="muted small" x="206" y="370" text-anchor="middle">visible conversation only</text>
|
|
49
|
+
|
|
50
|
+
<rect class="panel" x="462" y="274" width="278" height="138" rx="24"/>
|
|
51
|
+
<text class="txt label" x="601" y="326" text-anchor="middle">Delegate child</text>
|
|
52
|
+
<text class="muted small" x="601" y="362" text-anchor="middle">isolated · inspect-only</text>
|
|
53
|
+
|
|
54
|
+
<rect class="panel" x="870" y="284" width="250" height="118" rx="24"/>
|
|
55
|
+
<text class="txt label" x="995" y="334" text-anchor="middle">Verified result</text>
|
|
56
|
+
<text class="muted small" x="995" y="370" text-anchor="middle">hash-checked retrieval</text>
|
|
57
|
+
|
|
58
|
+
<path class="line" d="M300 196 C290 240 254 252 225 284"/>
|
|
59
|
+
<path class="line" d="M340 343 C392 343 410 343 462 343"/>
|
|
60
|
+
<path class="line" d="M740 343 C790 343 820 343 870 343"/>
|
|
61
|
+
|
|
62
|
+
<text class="txt label" x="72" y="502">Fusion workflow</text>
|
|
63
|
+
<text class="muted small" x="72" y="534">fixed purpose · clean stage policies · no silent fallback</text>
|
|
64
|
+
|
|
65
|
+
<g transform="translate(76 570)">
|
|
66
|
+
<rect class="node" x="0" y="0" width="160" height="62" rx="18"/><text class="txt small" x="80" y="39" text-anchor="middle">Candidate 1</text>
|
|
67
|
+
<rect class="node" x="0" y="78" width="160" height="62" rx="18"/><text class="txt small" x="80" y="117" text-anchor="middle">Candidate 2</text>
|
|
68
|
+
<rect class="node" x="0" y="156" width="160" height="62" rx="18"/><text class="txt small" x="80" y="195" text-anchor="middle">Candidate 3</text>
|
|
69
|
+
</g>
|
|
70
|
+
<rect class="node" x="372" y="648" width="160" height="62" rx="18"/><text class="txt small" x="452" y="687" text-anchor="middle">Blind eval</text>
|
|
71
|
+
<rect class="node amber" x="620" y="648" width="188" height="62" rx="18"/><text class="txt small" x="714" y="687" text-anchor="middle">Optional repair</text>
|
|
72
|
+
<rect class="node amber" x="896" y="648" width="154" height="62" rx="18"/><text class="txt small" x="973" y="687" text-anchor="middle">Merger</text>
|
|
73
|
+
<path class="line" d="M236 601 C292 601 310 662 372 679"/>
|
|
74
|
+
<path class="line" d="M236 679 H372"/>
|
|
75
|
+
<path class="line" d="M236 757 C292 757 310 696 372 679"/>
|
|
76
|
+
<path class="lineA" d="M532 679 H620"/>
|
|
77
|
+
<path class="lineA" d="M808 679 H896"/>
|
|
78
|
+
</svg>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc" viewBox="0 0 1200 560">
|
|
2
|
+
<title id="title">pi-background-tasks footer dock illustration</title>
|
|
3
|
+
<desc id="desc">A stable illustrative Pi terminal footer and focused background task dock with running, completed, and failed tasks plus controls.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="screen" x1="0" x2="1" y1="0" y2="1">
|
|
6
|
+
<stop offset="0" stop-color="#061528"/>
|
|
7
|
+
<stop offset="1" stop-color="#0b294b"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="footer" x1="0" x2="1">
|
|
10
|
+
<stop offset="0" stop-color="#b7e7ff"/>
|
|
11
|
+
<stop offset="1" stop-color="#7df4ff"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<style>
|
|
14
|
+
.screen{fill:url(#screen)}.dock{fill:#071a30;stroke:#50e5ff;stroke-width:2}.row{fill:#0c2847;stroke:#1f6d89;stroke-width:1}.row2{fill:#0a223d;stroke:#1f6d89;stroke-width:1}.footer{fill:url(#footer)}.text{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;fill:#effcff}.muted{fill:#a7c3d6}.navy{fill:#093456}.cyan{fill:#64edff}.amber{fill:#ffbd4b}.green{fill:#5ff2b3}.red{fill:#ff6b7a}.small{font-size:22px}.tiny{font-size:18px}.label{font-size:26px;font-weight:700}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
|
15
|
+
</style>
|
|
16
|
+
</defs>
|
|
17
|
+
<rect class="screen" x="34" y="34" width="1132" height="492" rx="34"/>
|
|
18
|
+
<rect x="74" y="78" width="1052" height="310" rx="18" fill="#041120" stroke="#173956"/>
|
|
19
|
+
<text class="text small mono" x="104" y="126">› Working in your project while background tasks run…</text>
|
|
20
|
+
<text class="muted small mono" x="104" y="170">The main conversation stays usable.</text>
|
|
21
|
+
<text class="muted small mono" x="104" y="214">Completion arrives as a durable task notification.</text>
|
|
22
|
+
|
|
23
|
+
<rect class="footer" x="74" y="410" width="1052" height="48" rx="18"/>
|
|
24
|
+
<text class="navy label" x="104" y="442">bg 1 running · 1 done · Shift↓ · /bg-clear</text>
|
|
25
|
+
<circle cx="1074" cy="434" r="10" fill="#093456" opacity=".75"/>
|
|
26
|
+
|
|
27
|
+
<rect class="dock" x="178" y="206" width="844" height="260" rx="26"/>
|
|
28
|
+
<text class="text label" x="218" y="254">Background tasks</text>
|
|
29
|
+
<text class="muted small" x="218" y="290">focused bottom dock · stable task controls</text>
|
|
30
|
+
|
|
31
|
+
<rect class="row" x="218" y="318" width="764" height="46" rx="14"/>
|
|
32
|
+
<circle class="cyan" cx="244" cy="341" r="8"/>
|
|
33
|
+
<text class="text small" x="266" y="348">Docs preview</text>
|
|
34
|
+
<text class="muted tiny" x="520" y="347">running · ctx — · output tail available</text>
|
|
35
|
+
|
|
36
|
+
<rect class="row2" x="218" y="374" width="764" height="46" rx="14"/>
|
|
37
|
+
<path d="M237 397 l8 9 l18 -22" fill="none" stroke="#5ff2b3" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
38
|
+
<text class="text small" x="266" y="404">Config audit</text>
|
|
39
|
+
<text class="muted tiny" x="520" y="403">completed · verified result ready</text>
|
|
40
|
+
|
|
41
|
+
<rect class="row2" x="218" y="430" width="764" height="46" rx="14"/>
|
|
42
|
+
<path d="M236 442 l22 22 M258 442 l-22 22" stroke="#ff6b7a" stroke-width="5" stroke-linecap="round"/>
|
|
43
|
+
<text class="text small" x="266" y="460">Old watcher</text>
|
|
44
|
+
<text class="muted tiny" x="520" y="459">failed · open logs for details</text>
|
|
45
|
+
|
|
46
|
+
<text class="muted tiny" x="218" y="504">↑/↓ select · Enter details · k stop · R rerun · c path · Esc close</text>
|
|
47
|
+
</svg>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc" viewBox="0 0 512 512">
|
|
2
|
+
<title id="title">pi-background-tasks dispatcher logo</title>
|
|
3
|
+
<desc id="desc">A friendly futuristic dispatcher coordinates three parallel task nodes that converge into a completed result, using navy, cyan, and amber.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<radialGradient id="bg" cx="50%" cy="38%" r="70%">
|
|
6
|
+
<stop offset="0" stop-color="#12365f"/>
|
|
7
|
+
<stop offset="0.58" stop-color="#08233f"/>
|
|
8
|
+
<stop offset="1" stop-color="#041528"/>
|
|
9
|
+
</radialGradient>
|
|
10
|
+
<linearGradient id="cyan" x1="72" y1="96" x2="420" y2="410" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<stop offset="0" stop-color="#7cf7ff"/>
|
|
12
|
+
<stop offset="1" stop-color="#19bfe8"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
<linearGradient id="amber" x1="326" y1="180" x2="440" y2="316" gradientUnits="userSpaceOnUse">
|
|
15
|
+
<stop offset="0" stop-color="#ffd37a"/>
|
|
16
|
+
<stop offset="1" stop-color="#ff9f1c"/>
|
|
17
|
+
</linearGradient>
|
|
18
|
+
<filter id="softShadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
19
|
+
<feDropShadow dx="0" dy="14" stdDeviation="14" flood-color="#000000" flood-opacity="0.28"/>
|
|
20
|
+
</filter>
|
|
21
|
+
</defs>
|
|
22
|
+
<circle cx="256" cy="256" r="220" fill="url(#bg)"/>
|
|
23
|
+
<circle cx="256" cy="256" r="219" fill="none" stroke="#1fc7e9" stroke-opacity="0.32" stroke-width="3"/>
|
|
24
|
+
<g fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
25
|
+
<path d="M142 168 C184 126 235 119 256 181" stroke="#59e6ff" stroke-width="15" opacity="0.9"/>
|
|
26
|
+
<path d="M142 256 C188 240 219 240 256 256" stroke="#59e6ff" stroke-width="15" opacity="0.9"/>
|
|
27
|
+
<path d="M142 344 C184 386 235 393 256 331" stroke="#59e6ff" stroke-width="15" opacity="0.9"/>
|
|
28
|
+
<path d="M274 183 C320 187 354 210 376 246" stroke="#f8b84e" stroke-width="15"/>
|
|
29
|
+
<path d="M274 329 C320 325 354 302 376 266" stroke="#f8b84e" stroke-width="15"/>
|
|
30
|
+
</g>
|
|
31
|
+
<g filter="url(#softShadow)">
|
|
32
|
+
<circle cx="142" cy="168" r="34" fill="#0d2d50" stroke="url(#cyan)" stroke-width="10"/>
|
|
33
|
+
<circle cx="142" cy="256" r="34" fill="#0d2d50" stroke="url(#cyan)" stroke-width="10"/>
|
|
34
|
+
<circle cx="142" cy="344" r="34" fill="#0d2d50" stroke="url(#cyan)" stroke-width="10"/>
|
|
35
|
+
<circle cx="256" cy="256" r="62" fill="#0b2a4b" stroke="url(#cyan)" stroke-width="12"/>
|
|
36
|
+
<path d="M224 269 q32 28 64 0" fill="none" stroke="#7cf7ff" stroke-width="10" stroke-linecap="round"/>
|
|
37
|
+
<circle cx="236" cy="244" r="7" fill="#d9fbff"/>
|
|
38
|
+
<circle cx="276" cy="244" r="7" fill="#d9fbff"/>
|
|
39
|
+
<circle cx="392" cy="256" r="52" fill="#102b45" stroke="url(#amber)" stroke-width="12"/>
|
|
40
|
+
<path d="M368 257 l15 16 l34 -38" fill="none" stroke="#fff2ca" stroke-width="14" stroke-linecap="round" stroke-linejoin="round"/>
|
|
41
|
+
</g>
|
|
42
|
+
<g opacity="0.72" fill="#83f6ff">
|
|
43
|
+
<circle cx="110" cy="103" r="5"/>
|
|
44
|
+
<circle cx="210" cy="74" r="4"/>
|
|
45
|
+
<circle cx="344" cy="88" r="5"/>
|
|
46
|
+
<circle cx="424" cy="363" r="4"/>
|
|
47
|
+
<circle cx="236" cy="438" r="5"/>
|
|
48
|
+
</g>
|
|
49
|
+
</svg>
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "pi-background-tasks.docs-attestations.v1",
|
|
3
|
+
"receipts": [
|
|
4
|
+
{
|
|
5
|
+
"authored_body_sha256": "sha256:8b8a883eb261dd221d348724fb43ae13fac19eb52a30f688d55ff80b2039be98",
|
|
6
|
+
"covers_sources": [
|
|
7
|
+
"src/core/extension-api.ts"
|
|
8
|
+
],
|
|
9
|
+
"doc_id": "api/eventbus-v1",
|
|
10
|
+
"notes": "Reviewed EventBus channels, closed schemas, operations, request correlation and rejection, close unsubscribe behavior, terminal ordering, latched publication, retry semantics, and at-least-once deduplication guidance.",
|
|
11
|
+
"reviewer": "gpt-5.5-final-eventbus-reviewer",
|
|
12
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
13
|
+
"source_sha256": {
|
|
14
|
+
"src/core/extension-api.ts": "sha256:f4132ea103f075d14bf8f3936f1a71e3fc46a53083cd7e8f563f9d45e4d74072"
|
|
15
|
+
},
|
|
16
|
+
"verdict": "PASS"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"authored_body_sha256": "sha256:36942d62aa217dad07813c7900291adbc39b1ac859b18d94f606db0ce2e13a9f",
|
|
20
|
+
"covers_sources": [
|
|
21
|
+
"src/core/context/parent-snapshot.ts",
|
|
22
|
+
"src/core/context/token-budget.ts",
|
|
23
|
+
"src/core/context/visible-conversation-v2.ts"
|
|
24
|
+
],
|
|
25
|
+
"doc_id": "concepts/context-projection-and-budgeting",
|
|
26
|
+
"notes": "Reviewed visible conversation transform identity, active-branch snapshotting, omission receipts and hashes, text/tool/thinking/image dispositions, token estimators, calibration, reserves, warnings, and fail-loud no-truncation behavior.",
|
|
27
|
+
"reviewer": "gpt-5.5-final-context-projection-reviewer",
|
|
28
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
29
|
+
"source_sha256": {
|
|
30
|
+
"src/core/context/parent-snapshot.ts": "sha256:94c68a3c971f97ab7f23315db07b67a98f9c3bb1d0b75c07ec9fdd7f2f00d343",
|
|
31
|
+
"src/core/context/token-budget.ts": "sha256:24ac96fe436263859222668da1537e645c649f37979942d3d856fedf6d54f008",
|
|
32
|
+
"src/core/context/visible-conversation-v2.ts": "sha256:f12cd1e59339db768c8dd5c9ff241e06ece2ce96896811d828e2700a7d6e69c0"
|
|
33
|
+
},
|
|
34
|
+
"verdict": "PASS"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"authored_body_sha256": "sha256:4d3d0ba1534c8ea5368e201fbf8fc7d52f2fbb353262d4af1ead263548547356",
|
|
38
|
+
"covers_sources": [
|
|
39
|
+
"src/core/attested-pi-run.ts"
|
|
40
|
+
],
|
|
41
|
+
"doc_id": "subsystems/attested-pi-runs",
|
|
42
|
+
"notes": "Reviewed attested Pi event parsing, last-reported stopReason semantics, OAuth route observation, argv/environment safeguards, git authority, hashes, failure handling, and atomic sidecar durability.",
|
|
43
|
+
"reviewer": "gpt-5.5-final-attested-safety-reviewer",
|
|
44
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
45
|
+
"source_sha256": {
|
|
46
|
+
"src/core/attested-pi-run.ts": "sha256:cf57b3245c506a9051a3886dc58c8e7b117e27532fb758fe85047bf7f4d82980"
|
|
47
|
+
},
|
|
48
|
+
"verdict": "PASS"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"authored_body_sha256": "sha256:66b00ffbb82fdbfb860a689b83d8766cb6753156d6d43817f4ccfed581de977e",
|
|
52
|
+
"covers_sources": [
|
|
53
|
+
"src/core/common.ts",
|
|
54
|
+
"src/core/registry.ts",
|
|
55
|
+
"src/core/windows-taskkill.ts"
|
|
56
|
+
],
|
|
57
|
+
"doc_id": "subsystems/background-task-runtime",
|
|
58
|
+
"notes": "Independent GPT-5.5 panel reviewed runtime statuses, files, shell, limits, telemetry, kill and shutdown behavior; final correction review verified close-without-fsync and response-gated EventBus emission versus notification ordering.",
|
|
59
|
+
"reviewer": "gpt-5.5-final-background-runtime-review-panel",
|
|
60
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
61
|
+
"source_sha256": {
|
|
62
|
+
"src/core/common.ts": "sha256:748d5714ba0b7a4b307d9b4f2b068aa5c11451a465bb4085266f193070d6d809",
|
|
63
|
+
"src/core/registry.ts": "sha256:b78383bad62aa1cf0fb526d917fb77a080fe6ff5ebc47f59567fffb59e18bec0",
|
|
64
|
+
"src/core/windows-taskkill.ts": "sha256:d8e21e077720f408a5b181b200924363ad75fd7b3acbafeabb6a2662a9d1fad1"
|
|
65
|
+
},
|
|
66
|
+
"verdict": "PASS"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"authored_body_sha256": "sha256:d5a27cd6a1f78820fe6a39996f8c64c5924efaf2dba99ea44415c1e770dc45bb",
|
|
70
|
+
"covers_sources": [
|
|
71
|
+
"src/core/durable-fs.ts",
|
|
72
|
+
"src/core/pi-launch.ts"
|
|
73
|
+
],
|
|
74
|
+
"doc_id": "subsystems/child-launch-durability-and-safety",
|
|
75
|
+
"notes": "Reviewed durable file replacement and child launch sources, including file fsync, POSIX directory sync, Windows limitation, ordinary versus attested output wording, and loud launch/durability failures.",
|
|
76
|
+
"reviewer": "gpt-5.5-final-attested-safety-reviewer",
|
|
77
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
78
|
+
"source_sha256": {
|
|
79
|
+
"src/core/durable-fs.ts": "sha256:be112873d9e405d38883fc8531db368675e056aacea90cf74d6283c9b0443768",
|
|
80
|
+
"src/core/pi-launch.ts": "sha256:858ed1398d3f033c3c8fd5c454ff44414e3677ee5ecfdf9f2a3cb720374fd06d"
|
|
81
|
+
},
|
|
82
|
+
"verdict": "PASS"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"authored_body_sha256": "sha256:a60f4f25e266ea5cf9e5c89b1b6fbf7bf7fc07d2600a6b82bc5bd9d39eb60438",
|
|
86
|
+
"covers_sources": [
|
|
87
|
+
"extensions/delegate-child.ts",
|
|
88
|
+
"src/core/delegate/artifacts.ts",
|
|
89
|
+
"src/core/delegate/budget.ts",
|
|
90
|
+
"src/core/delegate/hook-contract-evidence.json",
|
|
91
|
+
"src/core/delegate/hook-contract.ts",
|
|
92
|
+
"src/core/delegate/launch.ts",
|
|
93
|
+
"src/core/delegate/result-package.ts",
|
|
94
|
+
"src/core/delegate/runner.ts",
|
|
95
|
+
"src/core/delegate/seed.ts",
|
|
96
|
+
"src/core/delegate/types.ts",
|
|
97
|
+
"src/delegate-child-extension.ts",
|
|
98
|
+
"src/delegate-extension.ts"
|
|
99
|
+
],
|
|
100
|
+
"doc_id": "subsystems/delegation",
|
|
101
|
+
"notes": "Independent GPT-5.5 panel reviewed all delegation behavior; final delta reviewer verified the 1200-second default, positive override handling, generated schema description, tests, and authored timeout documentation.",
|
|
102
|
+
"reviewer": "gpt-5.5-final-delegation-review-panel-plus-timeout-delta",
|
|
103
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
104
|
+
"source_sha256": {
|
|
105
|
+
"extensions/delegate-child.ts": "sha256:b19cce44e888696c046481b133b769d9427e7ef48e9d2cccb8b5abf058f21b9f",
|
|
106
|
+
"src/core/delegate/artifacts.ts": "sha256:a1555c3e3f0d7d0ba7ffa7e4d882eb61b4350293597ed479e5c4786969f1be4d",
|
|
107
|
+
"src/core/delegate/budget.ts": "sha256:dbb4921ce41e13c44512eed5458670ab35259040c128ec5f86001c35ed9e32d0",
|
|
108
|
+
"src/core/delegate/hook-contract-evidence.json": "sha256:e662e8fff72c69fe95c5c48df2be4abab93f720e149c28420423687803b99080",
|
|
109
|
+
"src/core/delegate/hook-contract.ts": "sha256:d640d0624c69d16993a2ff9bc6b985d53b54b79a4da74d79cfee57dcf5636de1",
|
|
110
|
+
"src/core/delegate/launch.ts": "sha256:bc79dc4ee159b4364df10d4ef2211d16fee8eed2f88152ef8c5870201fc68308",
|
|
111
|
+
"src/core/delegate/result-package.ts": "sha256:690013b4db06dda53b358bc3aebb0ac76e9a0dca9f1b69639d2758c42bb07731",
|
|
112
|
+
"src/core/delegate/runner.ts": "sha256:4c6703f2c79858f9ec36e3960e8c981d2c1b35e1e156079dcdb62f9f0448da2a",
|
|
113
|
+
"src/core/delegate/seed.ts": "sha256:624d2c5193d3f4988f3f50f601702123a44956cf6d6205a04f528b4cc2f07881",
|
|
114
|
+
"src/core/delegate/types.ts": "sha256:303d5fc40a526a8fc75f9dee510599e2a3221fe7b9e798410a00cf271ed0d1c5",
|
|
115
|
+
"src/delegate-child-extension.ts": "sha256:7ada043ffcbe895a66192055ec2a7678c12e70b45bf8c654bcfe491d1f9300e8",
|
|
116
|
+
"src/delegate-extension.ts": "sha256:2a0b00e0d6631282d9f71a749a8bc9343c47f602edccd4e5f891affd01d71c2b"
|
|
117
|
+
},
|
|
118
|
+
"verdict": "PASS"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"authored_body_sha256": "sha256:6b1afc2083d3f21c704d5af62c6b2259217169002daedb5aa604b8631d4d2fd8",
|
|
122
|
+
"covers_sources": [
|
|
123
|
+
"extensions/fusion-child.ts",
|
|
124
|
+
"src/core/fusion/artifacts.ts",
|
|
125
|
+
"src/core/fusion/budget.ts",
|
|
126
|
+
"src/core/fusion/child-protocol.ts",
|
|
127
|
+
"src/core/fusion/clean-context.ts",
|
|
128
|
+
"src/core/fusion/config.ts",
|
|
129
|
+
"src/core/fusion/context.ts",
|
|
130
|
+
"src/core/fusion/evaluation.ts",
|
|
131
|
+
"src/core/fusion/orchestrator.ts",
|
|
132
|
+
"src/core/fusion/pi-child.ts",
|
|
133
|
+
"src/core/fusion/prompts.ts",
|
|
134
|
+
"src/core/fusion/source-policy.ts",
|
|
135
|
+
"src/core/fusion/types.ts",
|
|
136
|
+
"src/core/fusion/web-fetch.ts",
|
|
137
|
+
"src/core/fusion/workflows.ts",
|
|
138
|
+
"src/fusion-child-extension.ts",
|
|
139
|
+
"src/fusion-extension.ts",
|
|
140
|
+
"src/ui/fusion-model-selector.ts"
|
|
141
|
+
],
|
|
142
|
+
"doc_id": "subsystems/fusion",
|
|
143
|
+
"notes": "Fusion investigate established agent_settled as the terminal audit boundary and required strict parser behavior; final implementation uses exclusive durable journal/seal I/O, rejects extension diagnostics, and focused lifecycle/incident/compatibility tests pass.",
|
|
144
|
+
"reviewer": "fusion-investigate-agent-settled-panel-plus-regression-evidence",
|
|
145
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
146
|
+
"source_sha256": {
|
|
147
|
+
"extensions/fusion-child.ts": "sha256:832937c8431d25f73215951d0446f5fa9e4394f0b03b8a9423fb19561eeba31a",
|
|
148
|
+
"src/core/fusion/artifacts.ts": "sha256:7f93070d3d9db18b69b87fef32a71d23f4d532aeff89bbbc61bef52f65722dc9",
|
|
149
|
+
"src/core/fusion/budget.ts": "sha256:19f8c4dba9f64d612b3dc33ae06a1c870dae918a7c783dc8f9a6ff3dbcd8e6c0",
|
|
150
|
+
"src/core/fusion/child-protocol.ts": "sha256:9f1f6defeb2045748e9e18a287bfc5e2c57cc6203abfa2697df4459e83f77d2f",
|
|
151
|
+
"src/core/fusion/clean-context.ts": "sha256:98230be181964c8309c27e58182bb172f9f30f0fdf76d70868daa5d4e9138ce2",
|
|
152
|
+
"src/core/fusion/config.ts": "sha256:6f792fb1329cca2c0b33d0bdd82eb6a77a14a8be6ed18b3e9c0573bda52b3000",
|
|
153
|
+
"src/core/fusion/context.ts": "sha256:fefec409354e14acce8e401f7bcb70265eb0c1f4562fa3321508074e7ad1d96a",
|
|
154
|
+
"src/core/fusion/evaluation.ts": "sha256:5ced311dbd03b177701c8acfb1782f48033d3c1d800d9f58fd4dbbfe7dc1fed3",
|
|
155
|
+
"src/core/fusion/orchestrator.ts": "sha256:f0d8437d2c649f70b35ff550fee3b4a18a4e4501c8ee0bd2fd3c1f6984de88c2",
|
|
156
|
+
"src/core/fusion/pi-child.ts": "sha256:bfc4981a9bedca50ff92ac7aaec7dfa93036bbdca2caf0261f4263b489868415",
|
|
157
|
+
"src/core/fusion/prompts.ts": "sha256:0462a496fcf682c6e4cef87bafb1fd6d45f23e367ef83c2c8418126d4a1ee766",
|
|
158
|
+
"src/core/fusion/source-policy.ts": "sha256:17718fe6c55bfacaaed0beebd6c8f4fbf477ec0f8210ae1ba038167231cc5f4d",
|
|
159
|
+
"src/core/fusion/types.ts": "sha256:01a57512044c034aecd9dd304cedcc40fae737d87a3a93cae1027eb8b31a875d",
|
|
160
|
+
"src/core/fusion/web-fetch.ts": "sha256:5aca8d9c8e7bb58f483cc17f60163e431e09e91dc80c299b1e0280a3b96e42aa",
|
|
161
|
+
"src/core/fusion/workflows.ts": "sha256:1960784b7f9fd8cb62bf48c0a04261359e19b59a18146d32583b619db17f7394",
|
|
162
|
+
"src/fusion-child-extension.ts": "sha256:5ce9cbe5de1a69d791dc8a8a40c05f3ac6ffca607677e150408bf9e385f9aabb",
|
|
163
|
+
"src/fusion-extension.ts": "sha256:ecaf4f6619652029333c626a73e86d25174715864ad0a79a8558700f3eb224e0",
|
|
164
|
+
"src/ui/fusion-model-selector.ts": "sha256:c6c080c7063d1fbf157c720d60dd0b634ef8e5767e004c632c011a7e543e9a34"
|
|
165
|
+
},
|
|
166
|
+
"verdict": "PASS"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"authored_body_sha256": "sha256:185e4ec320770ededfce51e1e8a5a166be8b4b11275b7515737f0305820555fe",
|
|
170
|
+
"covers_sources": [
|
|
171
|
+
"extensions/background-tasks.ts",
|
|
172
|
+
"src/core/update-check.ts",
|
|
173
|
+
"src/extension.ts",
|
|
174
|
+
"src/ui/background-tasks-manager.ts"
|
|
175
|
+
],
|
|
176
|
+
"doc_id": "subsystems/host-ui-and-telemetry",
|
|
177
|
+
"notes": "Existing independent GPT-5.5 panel reviewed the host subsystem; operator delta review verified /bg-update no longer derives git tags from npm versions and SDK assertions pin main plus explicit tag verification.",
|
|
178
|
+
"reviewer": "existing-gpt-5.5-host-panel-plus-operator-update-delta",
|
|
179
|
+
"schema_version": "pi-background-tasks.docs-attestation.v1",
|
|
180
|
+
"source_sha256": {
|
|
181
|
+
"extensions/background-tasks.ts": "sha256:b221129d3a1449606de6e7c04bd8989c6b7feee3eaf5122339c2d45cffadf74f",
|
|
182
|
+
"src/core/update-check.ts": "sha256:7f754a43288c8c7dae1518f4a8c3fa7f1b5499864c5c54ae279188661aa0412d",
|
|
183
|
+
"src/extension.ts": "sha256:65b8d2a23555a244eb1ed1ef5ad5ab3aa1d70eb59e3f4f4d69efdfb553e34218",
|
|
184
|
+
"src/ui/background-tasks-manager.ts": "sha256:96c71807767499887ab3417e5eabac973a19221e4f2e985e2218d4ad672dd687"
|
|
185
|
+
},
|
|
186
|
+
"verdict": "PASS"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc_id: choose-a-workflow
|
|
3
|
+
audience: user
|
|
4
|
+
mode: authored
|
|
5
|
+
review_policy: contract
|
|
6
|
+
stability: stable
|
|
7
|
+
covers_surfaces: []
|
|
8
|
+
covers_sources: []
|
|
9
|
+
---
|
|
10
|
+
# Choose a workflow
|
|
11
|
+
|
|
12
|
+
## Quick decision tree
|
|
13
|
+
|
|
14
|
+
1. **Is the work short and interactive?** Use ordinary foreground Pi work.
|
|
15
|
+
2. **Is it a long shell command?** Use `/bg` if you are typing it; use `bg_run` if the agent is launching it.
|
|
16
|
+
3. **Does a second agent need this conversation as context while the parent continues?** Use `bg_delegate`, then `bg_result` after completion.
|
|
17
|
+
4. **Do you need local evidence from one direct Pi child run?** Use `bg_run_pi_attested`.
|
|
18
|
+
5. **Do you want multiple model perspectives on one fixed-purpose prompt?** Use the matching Fusion tool.
|
|
19
|
+
|
|
20
|
+
## Comparison table
|
|
21
|
+
|
|
22
|
+
| Option | Sync/async | Context sent | Can read repo? | Can use network? | Can write? | Route behavior | Use when |
|
|
23
|
+
|---|---|---|---:|---:|---:|---|---|
|
|
24
|
+
| Foreground work | Synchronous | Current session | Depends on active tools | Depends on active tools | Depends on active tools | Current session route | You need live interaction. |
|
|
25
|
+
| `/bg` | Async | None by package | Command decides | Command decides | Command decides | Not a model route unless command invokes one | You manually start a long local command. |
|
|
26
|
+
| `bg_run` | Async | None by package | Command decides | Command decides | Command decides | Not a model route unless command invokes one | Pi should launch a long command and resume later. |
|
|
27
|
+
| `bg_delegate` + `bg_result` | Async launch, point-in-time retrieval | Frozen visible conversation projection | Yes, inspect-only | No | No | Pinned at launch; no substitution | Context-aware read-only investigation. |
|
|
28
|
+
| `bg_run_pi_attested` | Async | Prompt only | Child Pi decides from prompt/tools | Child Pi route/tools decide | Report path requested | Structured provider/model; OAuth observed for supported subscription routes | Local evidence-producing Pi run. |
|
|
29
|
+
| `fusion_reason` / `/fusion` | Synchronous | Versioned conversation projection plus prompt | No | No | No | Configured Fusion slots; no silent fallback | Self-contained reasoning/synthesis. |
|
|
30
|
+
| `fusion_investigate` | Synchronous | Clean task input only | Candidate read-only tools | No | No | Configured Fusion slots; no silent fallback | Independent repository investigation. |
|
|
31
|
+
| `fusion_research` | Synchronous | Clean task input only | Candidate read-only tools | Only declared public URLs | No | Configured Fusion slots; no silent fallback | Targeted URL-backed synthesis, not search. |
|
|
32
|
+
| `fusion_validate` | Synchronous | Clean task input only | Candidate read-only tools | No | No | Configured Fusion slots; no silent fallback | Advisory review of completed work. |
|
|
33
|
+
|
|
34
|
+
## Tradeoffs and boundaries
|
|
35
|
+
|
|
36
|
+
### Foreground vs background shell
|
|
37
|
+
|
|
38
|
+
Foreground commands are best when the next answer depends on immediate output. Background commands are best when the command may take long enough that Pi can do other useful work or yield until completion.
|
|
39
|
+
|
|
40
|
+
`/bg` and `bg_run` are not sandboxes. They spawn local shell commands with the permissions, environment, network access, and credentials available to the Pi process. A background command can itself call paid services.
|
|
41
|
+
|
|
42
|
+
### `bg_run` defaults
|
|
43
|
+
|
|
44
|
+
`bg_run` requires:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{"name":"Short label","command":"shell command","isAgent":false}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defaults are `notifyOnCompletion:true` and `triggerOnCompletion:true`. With those defaults, Pi should not poll `bg_status` or `bg_logs` merely to wait.
|
|
51
|
+
|
|
52
|
+
### Delegate boundaries
|
|
53
|
+
|
|
54
|
+
`bg_delegate` supports only `capability:"inspect"`. The child is seeded with a deterministic visible-conversation projection, but omitted parent tool payloads are not available. Restate any needed facts in the delegate prompt.
|
|
55
|
+
|
|
56
|
+
Use `bg_result` for retrieval. It verifies hashes before returning content and reports oversized answers as artifacts instead of silently truncating.
|
|
57
|
+
|
|
58
|
+
### Fusion boundaries
|
|
59
|
+
|
|
60
|
+
Fusion is a fixed workflow, not a free-form mode switch:
|
|
61
|
+
|
|
62
|
+
1. Three candidate child Pi runs.
|
|
63
|
+
2. One blind evaluator.
|
|
64
|
+
3. One bounded conditional evaluator repair only if the evaluator JSON is invalid.
|
|
65
|
+
4. One merger.
|
|
66
|
+
|
|
67
|
+
`fusion_research` performs targeted retrieval of caller-supplied public URLs. It does not search the web, browse arbitrary links, fetch private URLs, or treat fetched content as instructions.
|
|
68
|
+
|
|
69
|
+
## Examples
|
|
70
|
+
|
|
71
|
+
### Long command
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{"name":"Build watch","command":"npm run build -- --watch","isAgent":false,"timeoutSeconds":7200}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Delegate investigation
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"name": "Docs locator",
|
|
82
|
+
"prompt": "Find the docs that explain shell selection and update checks. Return exact file paths and a concise summary.",
|
|
83
|
+
"capability": "inspect"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Fusion validation
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"objective": "Review docs readiness",
|
|
92
|
+
"background": ["Only package-local Markdown and image assets changed."],
|
|
93
|
+
"changeSummary": "README became a landing page; detailed setup moved into docs.",
|
|
94
|
+
"scope": ["README.md", "docs"],
|
|
95
|
+
"acceptanceCriteria": ["Links resolve", "Examples match schemas", "Safety caveats are explicit"],
|
|
96
|
+
"verification": {"status":"not_run", "reason":"Manual review requested before checks."}
|
|
97
|
+
}
|
|
98
|
+
```
|