@sgtbeatdown/pi-tasks 0.1.1 → 0.1.3
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 +80 -9
- package/package.json +6 -2
- package/skills/wolfpack-pi-task-delegation/SKILL.md +51 -27
- package/src/extension.ts +236 -137
- package/src/gateway-client.ts +32 -8
- package/src/in-memory-task-relay.ts +114 -0
- package/src/index.ts +35 -0
- package/src/legacy-extension.ts +248 -0
- package/src/legacy-task-inbox.ts +148 -0
- package/src/sqlite-database.ts +68 -0
- package/src/task-core.ts +430 -0
- package/src/task-inbox.ts +68 -90
- package/src/task-protocol.ts +164 -0
- package/src/task-relay-conformance.ts +23 -0
- package/src/task-store.ts +491 -0
- package/src/v1-compat-extension.ts +1 -0
- package/src/wolfpack-task-relay.ts +343 -0
package/README.md
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
# pi-tasks
|
|
2
2
|
|
|
3
|
-
`pi-tasks` is a Pi extension client for
|
|
3
|
+
`pi-tasks` is a Pi extension client for Wolfpack task transports. The default v2 adapter keeps endpoint-owned Pi task state locally and uses Wolfpack as a content-blind relay; the retained v1 adapter uses Wolfpack's machine-global `~/.wolfpack/tasks` store. Neither adapter writes assignments to terminals. Wolfpack's [relay v2 control-api contract](https://github.com/almogdepaz/wolfpack/blob/main/docs/control-api-schema.md#pi-tasks-relay-v2-boundary) is canonical for the default transport, while its [task gateway guide](https://github.com/almogdepaz/wolfpack/blob/main/docs/task-gateway.md) documents the explicit v1 compatibility transport.
|
|
4
|
+
|
|
5
|
+
## v2 endpoint-owned relay
|
|
6
|
+
|
|
7
|
+
The default extension uses the configured local Wolfpack relay v2 adapter, never the in-memory conformance relay. It registers an opaque endpoint with `POST /api/task-relay/v2/connect`, stores endpoint-owned task state at the deterministic per-session path `~/.pi/tasks/v2/sessions/<sha256(WOLFPACK_SESSION_NAME)>/tasks.sqlite`, and exchanges opaque relay envelopes through Wolfpack. The adapter needs a Wolfpack release exposing the stable [relay v2 control-api contract](https://github.com/almogdepaz/wolfpack/blob/main/docs/control-api-schema.md#pi-tasks-relay-v2-boundary); a v1-only gateway is incompatible and does not silently fall back.
|
|
8
|
+
|
|
9
|
+
Set `WOLFPACK_SESSION_NAME` for every Pi process. The adapter uses `WOLFPACK_PORT` when the local control port differs from `18790`; `WOLFPACK_SESSION_NAME` resolves the active Pi process to its relay endpoint. After the target extension registers, run `wolfpack session status <session> --json` and read its `taskEndpoint`. Pass that opaque `{ relay, id }` value unchanged; do not derive it from a session name, broker ID, terminal label, output, or prose.
|
|
10
|
+
|
|
11
|
+
### minimal valid v2 send envelope
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"to": {
|
|
16
|
+
"relay": "wolfpack-pi-tasks-v2",
|
|
17
|
+
"id": "target-opaque-endpoint-id"
|
|
18
|
+
},
|
|
19
|
+
"task": "implement the narrow change and run focused tests"
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The default `agent_task_send` schema is exactly `to`, `task`, and optional `timeoutMs`. v1-only context, role, metadata, preflight, idempotency, and completion-prompt fields are not silently accepted or translated.
|
|
24
|
+
|
|
25
|
+
Wolfpack's relay owns durable mailbox delivery and peer forwarding; Pi owns task lifecycle, logical event order, receipts, and its local SQLite state. `agent_task_send` returns after relay acceptance only, not Pi insertion or model execution. The receiver inserts model-visible events as structured `pi-tasks-event` custom messages through Pi's safe `deliverAs: "followUp"` queue and records structured `{ taskId, eventId }` insertion evidence. Replay after Pi has structurally recorded an event cannot create an additional logical receipt. `createInMemoryTaskRelay` remains exported solely as a deterministic conformance fixture.
|
|
26
|
+
|
|
27
|
+
### v2 delegation workflow
|
|
28
|
+
|
|
29
|
+
1. create or select a role session. For a disposable worker, omit an initial model prompt: `wolfpack agent spawn <project> --name <task-role> --json`. Put all worker instructions in `agent_task_send.task` so the new Pi process can become idle before assignment.
|
|
30
|
+
2. verify structured session readiness, wait for extension registration, and read `taskEndpoint` from `wolfpack session status <session> --json`.
|
|
31
|
+
3. call `agent_task_send` with that endpoint and the complete task instructions. Keep working; use `agent_task_status` or `agent_task_inbox` for structured evidence, and call `agent_task_wait` only when the user explicitly asks to block.
|
|
32
|
+
4. use `agent_task_message` for durable questions, answers, and information. The receiver calls `agent_task_done` as its final action; no completion prose follows.
|
|
33
|
+
5. independently verify the result, call `agent_task_ack({ taskId })` once for that terminal task, then explicitly retain or close only the role sessions the parent spawned.
|
|
34
|
+
|
|
35
|
+
### v2 worker-only execution gate
|
|
36
|
+
|
|
37
|
+
Set `PI_TASK_WORKER=1` only when launching a task-only worker. The exact value enables a fail-closed model `tool_call` gate; an absent value or any other value leaves ordinary interactive Pi behavior unchanged. Before assignment, only `agent_task_inbox`, `agent_task_status`, and `agent_task_wait` are allowed. Other current and future model tools are blocked with the stable reason `PI_TASK_WORKER_ASSIGNMENT_REQUIRED`. Explicit user `!`/`!!` shell commands are outside Pi's model `tool_call` event and are not intercepted.
|
|
38
|
+
|
|
39
|
+
The gate opens only when the current Pi session contains a structured `pi-tasks-event` entry for `task.created` and the same event belongs to a locally persisted active task targeted to the current endpoint. Rendered prompt text, terminal output, unknown events, foreign tasks, and stale terminal tasks do not authorize execution. On restart, durable session evidence reopens the gate only while the matching local task remains eligible.
|
|
40
|
+
|
|
41
|
+
Preflighting `agent_task_done` marks that task as closing before sibling calls are preflighted. Ordinary tools remain blocked for a closing, pending-terminal, accepted-terminal, or `delivery_blocked` task; an idempotent `agent_task_done` retry for that same assigned task remains allowed. Another independently active assignment can still authorize work.
|
|
42
|
+
|
|
43
|
+
### v2 terminal delivery and acknowledgment
|
|
44
|
+
|
|
45
|
+
A receiver task snapshot reports terminal transport separately as `terminalDelivery`: `not_submitted`, `pending`, `accepted`, or `delivery_blocked`. The blocked variant includes the stable intent/envelope identities, origin endpoint, timestamp, and structured non-retryable relay error. Canonical task `status` remains origin-owned and is never changed to `delivery_blocked`. Retryable failures keep the same pending terminal intent and envelope; permanent failures remain inspectable and are not rebound to a successor endpoint without a separate authenticated Wolfpack contract.
|
|
46
|
+
|
|
47
|
+
`agent_task_ack` is valid only for a terminal origin-owned task. Sequential, concurrent, and restart retries reuse one durable `task.parent_acknowledged` event and the same destination envelope identities while still retrying any pending physical delivery.
|
|
48
|
+
|
|
49
|
+
## v1 gateway adapter (retained)
|
|
50
|
+
|
|
51
|
+
The v1 gateway client is available only through the published `@sgtbeatdown/pi-tasks/v1-compat-extension` entry. This is an explicit opt-in: after resolving the installed package root, add `src/v1-compat-extension.ts` as an extension path in Pi settings instead of loading the package default. The package manifest loads only `src/extension.ts` (v2); v2 does not fall back to v1 when its relay is unavailable or incompatible. Its v1 behavior and operational requirements are documented below.
|
|
4
52
|
|
|
5
53
|
## requirements and trust boundary
|
|
6
54
|
|
|
@@ -29,6 +77,20 @@ A target is always `{ machine, sessionId }`, where `sessionId` is the stable opa
|
|
|
29
77
|
}
|
|
30
78
|
```
|
|
31
79
|
|
|
80
|
+
### v1 minimal valid send envelope
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"to": {
|
|
85
|
+
"machine": "local",
|
|
86
|
+
"sessionId": "receiver-broker-id"
|
|
87
|
+
},
|
|
88
|
+
"task": "implement the narrow change and run focused tests"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`INVALID_REQUEST.error.path` is an optional RFC 6901 JSON Pointer to the rejected send field, for example `/preflight/requiredProject`; use it rather than parsing error prose. A pre-persistence validation rejection creates no task, so correct the field and retry. If creation status is uncertain, idempotency remains necessary.
|
|
93
|
+
|
|
32
94
|
Remote addressing changes only `to.machine`:
|
|
33
95
|
|
|
34
96
|
```json
|
|
@@ -39,7 +101,7 @@ Context is optional, curated Markdown plus deliberately selected ref metadata. T
|
|
|
39
101
|
|
|
40
102
|
Initial limits are 16 KiB UTF-8 each for task instructions and context summary, 48 KiB for the assignment envelope, and 64 KiB for an HTTP request body. The initial size limits require representative payload benchmarking before adjustment.
|
|
41
103
|
|
|
42
|
-
`agent_task_send` waits for durable gateway
|
|
104
|
+
`agent_task_send` waits for durable gateway acceptance, not adapter insertion or task execution; delivery remains pending until `task.delivered`. A remote initial send has one initial attempt: the receiver persists a provisional receipt, then receives sender confirmation before Pi can see the assignment. Later peer confirmation, messages, terminal updates, cancellation, delivery notices, and parent acknowledgment have four total attempts: the initial attempt plus retries around 1, 2, and 4 seconds with jitter. Exhaustion is a visible local delivery failure, not a background queue or offline dispatch promise.
|
|
43
105
|
|
|
44
106
|
Normal delegation is fire-and-forget. Use `agent_task_wait` only when the user explicitly asks to block.
|
|
45
107
|
|
|
@@ -50,30 +112,39 @@ Normal delegation is fire-and-forget. Use `agent_task_wait` only when the user e
|
|
|
50
112
|
| `agent_task_send` | create a durable gateway assignment |
|
|
51
113
|
| `agent_task_status` | read task state, history, result, and warnings |
|
|
52
114
|
| `agent_task_wait` | explicitly poll a task until terminal or timeout |
|
|
53
|
-
| `agent_task_inbox` | read task events
|
|
115
|
+
| `agent_task_inbox` | read task events without acknowledgment |
|
|
116
|
+
| `agent_task_ack` | acknowledge one independently verified terminal task |
|
|
54
117
|
| `agent_task_message` | send a durable `question`, `answer`, or `information` event |
|
|
55
118
|
| `agent_task_cancel` | request cancellation |
|
|
56
119
|
| `agent_task_done` | receiver-only terminal completion; terminates the tool turn |
|
|
57
120
|
|
|
58
121
|
Use `agent_task_message` for clarification instead of terminal prose. Only one question can be unresolved per task; answers link to that question. Information is durable and does not change task state. An accepted receiver question terminates that receiver turn; a parent question does not.
|
|
59
122
|
|
|
60
|
-
|
|
123
|
+
Report source modifications in `result.changedFiles`. Artifacts are receiver-project-relative regular files for a parent to inspect, not a changed-file list:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{ "result": { "changedFiles": ["src/extension.ts"] }, "artifacts": [{ "path": "verification/task-2.md" }] }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
See the canonical Wolfpack artifact contract for provenance, containment, and warning behavior.
|
|
130
|
+
|
|
131
|
+
The sender gateway owns canonical event order, timeout, and terminal state. The first accepted terminal event wins. Sender timeout triggers best-effort remote cancellation; late terminals remain diagnostics. After independently verifying one terminal result, call `agent_task_ack({ taskId })`. Remote acknowledgment is two-phase: the receiver durably confirms pending acknowledgment before the sender records final parent acknowledgment. If that delivery fails, the task remains visible and a later explicit acknowledgment repairs it with the same event ID.
|
|
61
132
|
|
|
62
133
|
## structured delivery and replay
|
|
63
134
|
|
|
64
|
-
The extension polls the local gateway every five seconds
|
|
135
|
+
The extension polls the local gateway every five seconds. With no pending message, it submits each visible event as a structured custom message using Pi's safe `deliverAs: "followUp"` mode: idle Pi starts immediately, while an active turn finishes before the queued event starts the next turn. It never steers or interrupts active work. Delivery remains pending until `task.delivered`. The `{ taskId, eventId }` details let task context participate in the session without parsing prose.
|
|
65
136
|
|
|
66
|
-
On start or resume it rebuilds incorporated IDs from
|
|
137
|
+
On start or resume it rebuilds incorporated IDs from the full durable session entry set, not only active prompt context. A session gets only missing events; a new Pi session in the same Wolfpack PTY gets complete active history. The receiver records gateway delivery only after the structured insertion exists. A restart after insertion and before acknowledgment therefore acknowledges the existing entry without duplicate injection. Unknown model-visible events fail closed without advancing the cursor. Gateway delivery is at-least-once; this does not claim exactly-once model execution.
|
|
67
138
|
|
|
68
139
|
## parent workflow
|
|
69
140
|
|
|
70
|
-
1. create or select a Wolfpack Pi session with the canonical session-control workflow and retain its stable broker ID.
|
|
71
|
-
2. check the target's local
|
|
141
|
+
1. create or select a Wolfpack Pi session with the canonical session-control workflow and retain its stable broker ID. Spawn a disposable worker without an initial model prompt using `wolfpack agent spawn <project> --name <task-role> --json` so it reaches idle before assignment; put worker instructions in `agent_task_send.task`.
|
|
142
|
+
2. before remote dispatch, complete Wolfpack's [Live-peer readiness checklist](https://github.com/almogdepaz/wolfpack/blob/main/docs/task-gateway.md#live-peer-readiness-checklist) and retain operator-recorded package/reload evidence; only then check the target's local requirements and send compact instructions with curated context and selected refs when they save receiver investigation.
|
|
72
143
|
3. keep working; use `agent_task_status` or `agent_task_inbox` for structured follow-up, and `agent_task_message` for questions, answers, and decisions.
|
|
73
144
|
4. verify cited files, diffs, tests, and paths-only artifact metadata independently before reporting success.
|
|
74
145
|
5. acknowledge the accepted terminal result, then clean up only sessions this parent spawned. Keep a reusable implementer alive while review or correction remains possible; never make workers close their own sessions.
|
|
75
146
|
|
|
76
|
-
|
|
147
|
+
Isolated coverage is the deterministic acceptance gate, but a specific live peer still requires current readiness at the time of use. If the checklist cannot pass, stop before task creation and report fixture-only verification. Do not use direct peer URLs from Pi.
|
|
77
148
|
|
|
78
149
|
See `skills/wolfpack-pi-task-delegation/SKILL.md` for the operational workflow and `skills/task-context-summary/SKILL.md` for recovery/reuse summaries.
|
|
79
150
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sgtbeatdown/pi-tasks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Durable Pi agent delegation through the Wolfpack task gateway.",
|
|
5
|
-
"module": "src/
|
|
5
|
+
"module": "src/index.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./v1-compat-extension": "./src/v1-compat-extension.ts"
|
|
9
|
+
},
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
8
12
|
"url": "git+https://github.com/almogdepaz/pi-tasks.git"
|
|
@@ -1,44 +1,68 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wolfpack-pi-task-delegation
|
|
3
|
-
description: Use when opening, selecting, delegating to, checking, or cleaning up a Wolfpack Pi subagent through the
|
|
3
|
+
description: Use when opening, selecting, delegating to, checking, or cleaning up a Wolfpack Pi subagent through the endpoint-owned agent task tools.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# wolfpack pi task delegation
|
|
7
7
|
|
|
8
|
-
use `wolfpack-tailnet-control` for session control. this skill covers
|
|
8
|
+
use `wolfpack-tailnet-control` for session control. this skill covers endpoint-owned v2 task lifecycle, structured handoffs, and parent verification. The package default is the v2 extension described by Wolfpack's [relay v2 control-api contract](https://github.com/almogdepaz/wolfpack/blob/main/docs/control-api-schema.md#pi-tasks-relay-v2-boundary).
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## v2 requirements and addressing
|
|
11
11
|
|
|
12
|
-
- every participating Pi process
|
|
13
|
-
- `
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
12
|
+
- load this package's default extension in every participating Pi process and set `WOLFPACK_SESSION_NAME`. Set `WOLFPACK_PORT` only when the local Wolfpack control port differs from `18790`.
|
|
13
|
+
- address `agent_task_send` targets only as `to: { relay, id }`. For the default Wolfpack adapter, the relay is `wolfpack-pi-tasks-v2` and the ID is opaque.
|
|
14
|
+
- create a disposable worker without an initial model prompt: `wolfpack agent spawn <project> --name <task-role> --json`. Do not start a disposable worker with a blocking “wait for assignments” prompt. Put the complete instructions in `agent_task_send.task`.
|
|
15
|
+
- after the target extension registers, run structured session control (`wolfpack session status <session> --json`) and read its `taskEndpoint`. Do not derive endpoint IDs from session names, broker IDs, terminal labels, output, or prose.
|
|
16
|
+
- pass the returned endpoint without translation:
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"to": { "relay": "wolfpack-pi-tasks-v2", "id": "target-opaque-endpoint-id" },
|
|
21
|
+
"task": "implement the narrow change and run focused tests",
|
|
22
|
+
"timeoutMs": 1800000
|
|
23
|
+
}
|
|
24
|
+
```
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
2. send concise opaque task instructions with `agent_task_send`. Parent normally authors optional Markdown `context.summary` and deliberately selects `context.refs` with `path`, optional `selector`, and `purpose`; refs are metadata, not copied files or transcript. Use `task-context-summary` only for recovery/reuse.
|
|
22
|
-
3. include `role`, `metadata`, enforceable `preflight.requiredProject`, bounded timeout, idempotency key, and `onCompletePrompt` only when they apply. Timeout is 1000ms through 24h; default is 30 minutes. Task/context limits are 16 KiB each, assignment envelope 48 KiB, and request body 64 KiB.
|
|
23
|
-
4. after durable receipt, keep working. Do not call `agent_task_wait` unless the user explicitly asks to block. Use `agent_task_status` or `agent_task_inbox` for structured follow-up.
|
|
24
|
-
5. use `agent_task_message` for durable `question`, `answer`, or `information` flow. One question may be unresolved globally; answers link to it. A receiver question accepted by the sender ends the receiver turn; a parent question does not end the parent turn.
|
|
25
|
-
6. assignees call `agent_task_done` exactly once as their final action with `completed`, `failed`, or `cancelled`, concise summary, and optional structured result/error/paths-only artifact metadata. No prose completion afterward.
|
|
26
|
-
7. parent independently verifies files, diff, tests, and artifacts before reporting success. Then use `agent_task_inbox({ ack: true })`; remote acknowledgment is two-phase and failed propagation leaves the task visible for explicit repair. Cleanup applies only to sessions this parent spawned and only after result verification and acknowledgment. Retain reusable sessions while review or correction is pending.
|
|
26
|
+
The default `agent_task_send` schema is exactly `to`, `task`, and optional `timeoutMs`. v1-only fields such as context, role, metadata, preflight, idempotency keys, and completion prompts are not silently accepted or translated.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## phase roles and handoffs
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
For a multi-step project phase, retain one persistent implementer and one persistent read-only reviewer. Reuse a healthy role session for corrections and follow-up review; a completed task finishes one assignment, not the underlying session. Do not rotate a healthy role session for routine corrections. Rotate only for phase completion, material context degradation, harness failure, or required specialist independence. Keep at most one active assignment per role unless the user explicitly approves parallel work.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
After every verified and acknowledged terminal task, explicitly retain a parent-spawned session only when concrete follow-up is likely; otherwise close it through canonical Wolfpack session control. Workers never close their own sessions. terminal `send` is only for explicit human steering; it is not task state, completion evidence, or a substitute for `agent_task_message`.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
## v2 workflow
|
|
35
|
+
|
|
36
|
+
1. create or select the role session, verify its structured project and terminal readiness, then obtain its registered `taskEndpoint`.
|
|
37
|
+
2. call `agent_task_send` with the opaque endpoint and concise instructions in `task`. The tool returns after relay acceptance only, not Pi insertion or model execution. If submission reports a retryable delivery error after local persistence, use the structured task ID from the error and inspect it rather than creating an unrelated replacement.
|
|
38
|
+
3. keep working. Use `agent_task_status` or `agent_task_inbox` for structured evidence. Call `agent_task_wait` only when the user explicitly asks to block.
|
|
39
|
+
4. use `agent_task_message` for durable `question`, `answer`, or `information` flow. Do not use rendered text, terminal output, or logs as lifecycle evidence.
|
|
40
|
+
5. assignees call `agent_task_done` as their final action with the assigned task ID, terminal status, concise summary, and optional structured result, error, and artifact declarations. Report source modifications in `result.changedFiles`; artifacts are receiver-project-relative regular files for a parent to inspect, not changed-file lists: `{ "result": { "changedFiles": ["src/extension.ts"] }, "artifacts": [{ "path": "verification/task-2.md" }] }`. No prose completion afterward.
|
|
41
|
+
6. the parent independently verifies files, diff, tests, and artifacts. Then call `agent_task_ack({ taskId })` for that one terminal task and explicitly retain or close the spawned role session.
|
|
42
|
+
|
|
43
|
+
## v2 delivery and recovery
|
|
44
|
+
|
|
45
|
+
Wolfpack v2 is a content-blind relay; each Pi endpoint owns task lifecycle, canonical event order, receipts, and SQLite state. Relay acceptance does not prove model execution. The receiver inserts model-visible events as structured `pi-tasks-event` custom messages with Pi's safe `deliverAs: "followUp"` queue, then records insertion through structured `{ taskId, eventId }` evidence. Restart recovery reads durable session entries and local task state; it never parses rendered prompts or terminal prose.
|
|
46
|
+
|
|
47
|
+
Receiver terminal submission has one task-wide logical identity. Same-status retries reuse it; a conflicting terminal status fails closed. Canonical status remains origin-owned, while `terminalDelivery` separately exposes `not_submitted`, `pending`, `accepted`, or `delivery_blocked`. Parent acknowledgment is terminal-only and retries reuse one logical event and stable envelope identities.
|
|
48
|
+
|
|
49
|
+
Set `PI_TASK_WORKER=1` only for task-only workers. Before a valid structured assignment matches a locally owned active task, the worker gate allows only inbox/status/wait inspection and blocks other model tools with `PI_TASK_WORKER_ASSIGNMENT_REQUIRED`.
|
|
50
|
+
|
|
51
|
+
## v1 compatibility
|
|
52
|
+
|
|
53
|
+
The retained v1 workflow is available only through the explicit `@sgtbeatdown/pi-tasks/v1-compat-extension` entrypoint. It does not load by default, and v2 never falls back or translates its targets.
|
|
54
|
+
|
|
55
|
+
v1 uses a reachable local Wolfpack task gateway and addresses targets as `to: { machine, sessionId }`. Use `machine: "local"` for same-machine work; remote work uses only the receiver's canonical HTTPS Tailnet origin. v1 trusts local processes and trusted Tailnet machines, has no JWT federation, and follows Wolfpack's [task gateway guide](https://github.com/almogdepaz/wolfpack/blob/main/docs/task-gateway.md).
|
|
56
|
+
|
|
57
|
+
Before v1 remote dispatch, complete the [Live-peer readiness checklist](https://github.com/almogdepaz/wolfpack/blob/main/docs/task-gateway.md#live-peer-readiness-checklist), including operator-recorded package/reload evidence. If it cannot pass, stop before task creation and report fixture-only verification. Isolated coverage is the deterministic acceptance gate, but it does not prove a specific live peer.
|
|
58
|
+
|
|
59
|
+
Only v1 supports curated `context.summary`/refs, role, metadata, preflight, idempotency keys, and completion prompts. Use `context.summary` only for constraints, decisions, and recovery state. Refs are metadata, not copied files or transcript. A v1 remote initial send gets one initial attempt; later peer events get four total attempts. Retry exhaustion is surfaced; v1 has no offline queue or background dispatch promise.
|
|
35
60
|
|
|
36
61
|
## do not
|
|
37
62
|
|
|
38
|
-
- do not use terminal output
|
|
39
|
-
- do not ask workers to complete in prose.
|
|
40
|
-
- do not
|
|
41
|
-
-
|
|
42
|
-
- do not
|
|
43
|
-
- do not promise JWT federation, artifact byte transfer, or
|
|
44
|
-
- do not make workers close their own sessions.
|
|
63
|
+
- do not use terminal output, rendered prompts, logs, or error prose as task state.
|
|
64
|
+
- do not ask workers to complete in prose or close their own sessions.
|
|
65
|
+
- do not steer or interrupt an active Pi turn with task context; use the adapter's follow-up queue.
|
|
66
|
+
- Do not copy plans, source contents, or transcripts into task context.
|
|
67
|
+
- do not mix v1 and v2 target shapes or silently translate between them.
|
|
68
|
+
- do not promise JWT federation, artifact byte transfer, exactly-once model execution, or successor endpoint rebinding.
|