@henryqw/pi-subagent 29.1.2 → 30.0.0

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/dist/schema.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const MAX_EXECUTE_REQUEST_BYTES: number;
5
5
  export declare const MAX_PERSISTED_RUNTIME_TEXT_BYTES: number;
6
6
  export declare const MAX_POSSIBLE_RESOURCES = 32;
7
7
  export type ModelClass = Static<typeof ModelClassSchema>;
8
- declare const ModelClassSchema: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
8
+ declare const ModelClassSchema: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
9
9
  export declare const CheckCommandSchema: Type.TObject<{
10
10
  command: Type.TString;
11
11
  args: Type.TArray<Type.TString>;
@@ -17,12 +17,12 @@ export declare function formatCheckCommand({ command, args }: {
17
17
  }): string;
18
18
  export declare const JudgmentSchema: Type.TObject<{
19
19
  role: Type.TString;
20
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
20
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
21
21
  criterion: Type.TString;
22
22
  }>;
23
23
  declare const TextTaskRequestSchema: Type.TObject<{
24
24
  role: Type.TString;
25
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
25
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
26
26
  requirements: Type.TString;
27
27
  deliverable: Type.TString;
28
28
  dependsOn: Type.TArray<Type.TString>;
@@ -32,7 +32,7 @@ declare const TextTaskRequestSchema: Type.TObject<{
32
32
  }>;
33
33
  declare const ChangesetTaskRequestSchema: Type.TObject<{
34
34
  role: Type.TString;
35
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
35
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
36
36
  requirements: Type.TString;
37
37
  deliverable: Type.TString;
38
38
  dependsOn: Type.TArray<Type.TString>;
@@ -45,13 +45,13 @@ declare const ChangesetTaskRequestSchema: Type.TObject<{
45
45
  }>>;
46
46
  judgment: Type.TOptional<Type.TObject<{
47
47
  role: Type.TString;
48
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
48
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
49
49
  criterion: Type.TString;
50
50
  }>>;
51
51
  }>;
52
52
  export declare const TaskRequestSchema: Type.TUnion<[Type.TObject<{
53
53
  role: Type.TString;
54
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
54
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
55
55
  requirements: Type.TString;
56
56
  deliverable: Type.TString;
57
57
  dependsOn: Type.TArray<Type.TString>;
@@ -60,7 +60,7 @@ export declare const TaskRequestSchema: Type.TUnion<[Type.TObject<{
60
60
  kind: Type.TLiteral<"text">;
61
61
  }>, Type.TObject<{
62
62
  role: Type.TString;
63
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
63
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
64
64
  requirements: Type.TString;
65
65
  deliverable: Type.TString;
66
66
  dependsOn: Type.TArray<Type.TString>;
@@ -73,7 +73,7 @@ export declare const TaskRequestSchema: Type.TUnion<[Type.TObject<{
73
73
  }>>;
74
74
  judgment: Type.TOptional<Type.TObject<{
75
75
  role: Type.TString;
76
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
76
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
77
77
  criterion: Type.TString;
78
78
  }>>;
79
79
  }>]>;
@@ -83,7 +83,7 @@ export declare const ExecuteRequestSchema: Type.TObject<{
83
83
  goal: Type.TString;
84
84
  tasks: Type.TArray<Type.TUnion<[Type.TObject<{
85
85
  role: Type.TString;
86
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
86
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
87
87
  requirements: Type.TString;
88
88
  deliverable: Type.TString;
89
89
  dependsOn: Type.TArray<Type.TString>;
@@ -92,7 +92,7 @@ export declare const ExecuteRequestSchema: Type.TObject<{
92
92
  kind: Type.TLiteral<"text">;
93
93
  }>, Type.TObject<{
94
94
  role: Type.TString;
95
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
95
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
96
96
  requirements: Type.TString;
97
97
  deliverable: Type.TString;
98
98
  dependsOn: Type.TArray<Type.TString>;
@@ -105,7 +105,7 @@ export declare const ExecuteRequestSchema: Type.TObject<{
105
105
  }>>;
106
106
  judgment: Type.TOptional<Type.TObject<{
107
107
  role: Type.TString;
108
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
108
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
109
109
  criterion: Type.TString;
110
110
  }>>;
111
111
  }>]>>;
@@ -115,7 +115,7 @@ export declare const ExecuteRequestSchema: Type.TObject<{
115
115
  }>>>;
116
116
  finalJudgment: Type.TOptional<Type.TObject<{
117
117
  role: Type.TString;
118
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
118
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
119
119
  criterion: Type.TString;
120
120
  }>>;
121
121
  }>;
@@ -1763,7 +1763,7 @@ declare const RunStateSchema: Type.TObject<{
1763
1763
  goal: Type.TString;
1764
1764
  tasks: Type.TArray<Type.TUnion<[Type.TObject<{
1765
1765
  role: Type.TString;
1766
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1766
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
1767
1767
  requirements: Type.TString;
1768
1768
  deliverable: Type.TString;
1769
1769
  dependsOn: Type.TArray<Type.TString>;
@@ -1772,7 +1772,7 @@ declare const RunStateSchema: Type.TObject<{
1772
1772
  kind: Type.TLiteral<"text">;
1773
1773
  }>, Type.TObject<{
1774
1774
  role: Type.TString;
1775
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1775
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
1776
1776
  requirements: Type.TString;
1777
1777
  deliverable: Type.TString;
1778
1778
  dependsOn: Type.TArray<Type.TString>;
@@ -1785,7 +1785,7 @@ declare const RunStateSchema: Type.TObject<{
1785
1785
  }>>;
1786
1786
  judgment: Type.TOptional<Type.TObject<{
1787
1787
  role: Type.TString;
1788
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1788
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
1789
1789
  criterion: Type.TString;
1790
1790
  }>>;
1791
1791
  }>]>>;
@@ -1795,7 +1795,7 @@ declare const RunStateSchema: Type.TObject<{
1795
1795
  }>>>;
1796
1796
  finalJudgment: Type.TOptional<Type.TObject<{
1797
1797
  role: Type.TString;
1798
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
1798
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
1799
1799
  criterion: Type.TString;
1800
1800
  }>>;
1801
1801
  }>;
package/dist/schema.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { isAbsolute } from "node:path";
2
+ import { PROFILE_NAMES } from "@henryqw/pi-task-models";
2
3
  import { parseRoleName } from "./index.js";
3
4
  import { Type } from "typebox";
4
5
  import { Check, Errors } from "typebox/value";
@@ -16,12 +17,7 @@ const RoleNameSchema = Type.String({ minLength: 1, maxLength: 32_000 });
16
17
  const RuntimeTextSchema = Type.String({ minLength: 1, maxLength: MAX_PERSISTED_RUNTIME_TEXT_BYTES });
17
18
  const OptionalRuntimeTextSchema = Type.Optional(Type.String({ maxLength: MAX_PERSISTED_RUNTIME_TEXT_BYTES }));
18
19
  const TimestampSchema = Type.Integer({ minimum: 0 });
19
- const ModelClassSchema = Type.Union([
20
- Type.Literal("fast"),
21
- Type.Literal("balanced"),
22
- Type.Literal("frontier"),
23
- Type.Literal("fav"),
24
- ]);
20
+ const ModelClassSchema = Type.Enum(PROFILE_NAMES, { type: "string" });
25
21
  export const CheckCommandSchema = Type.Object({
26
22
  command: TextSchema,
27
23
  args: Type.Array(Type.String({ maxLength: 16_000 }), { maxItems: 128 }),
@@ -7,7 +7,7 @@ export declare const WorkspaceCheckSchema: Type.TObject<{
7
7
  }>;
8
8
  export declare const WorkspaceTaskSchema: Type.TObject<{
9
9
  role: Type.TString;
10
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
10
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
11
11
  requirements: Type.TString;
12
12
  deliverable: Type.TString;
13
13
  dependsOn: Type.TArray<Type.TString>;
@@ -16,7 +16,7 @@ export declare const WorkspaceTaskSchema: Type.TObject<{
16
16
  kind: Type.TLiteral<"changeset">;
17
17
  judgment: Type.TOptional<Type.TObject<{
18
18
  role: Type.TString;
19
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
19
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
20
20
  criterion: Type.TString;
21
21
  }>>;
22
22
  checks: Type.TArray<Type.TObject<{
@@ -32,13 +32,13 @@ export declare const WorkspaceRequestSchema: Type.TObject<{
32
32
  goal: Type.TString;
33
33
  finalJudgment: Type.TOptional<Type.TObject<{
34
34
  role: Type.TString;
35
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
35
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
36
36
  criterion: Type.TString;
37
37
  }>>;
38
38
  repositories: Type.TRecord<"^.*$", Type.TString>;
39
39
  tasks: Type.TArray<Type.TObject<{
40
40
  role: Type.TString;
41
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
41
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
42
42
  requirements: Type.TString;
43
43
  deliverable: Type.TString;
44
44
  dependsOn: Type.TArray<Type.TString>;
@@ -47,7 +47,7 @@ export declare const WorkspaceRequestSchema: Type.TObject<{
47
47
  kind: Type.TLiteral<"changeset">;
48
48
  judgment: Type.TOptional<Type.TObject<{
49
49
  role: Type.TString;
50
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
50
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
51
51
  criterion: Type.TString;
52
52
  }>>;
53
53
  checks: Type.TArray<Type.TObject<{
@@ -95,13 +95,13 @@ export declare const WorkspaceStateSchema: Type.TObject<{
95
95
  goal: Type.TString;
96
96
  finalJudgment: Type.TOptional<Type.TObject<{
97
97
  role: Type.TString;
98
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
98
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
99
99
  criterion: Type.TString;
100
100
  }>>;
101
101
  repositories: Type.TRecord<"^.*$", Type.TString>;
102
102
  tasks: Type.TArray<Type.TObject<{
103
103
  role: Type.TString;
104
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
104
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
105
105
  requirements: Type.TString;
106
106
  deliverable: Type.TString;
107
107
  dependsOn: Type.TArray<Type.TString>;
@@ -110,7 +110,7 @@ export declare const WorkspaceStateSchema: Type.TObject<{
110
110
  kind: Type.TLiteral<"changeset">;
111
111
  judgment: Type.TOptional<Type.TObject<{
112
112
  role: Type.TString;
113
- modelClass: Type.TUnion<[Type.TLiteral<"fast">, Type.TLiteral<"balanced">, Type.TLiteral<"frontier">, Type.TLiteral<"fav">]>;
113
+ modelClass: Type.TEnum<["fast", "balanced", "frontier", "ultra", "fav"]>;
114
114
  criterion: Type.TString;
115
115
  }>>;
116
116
  checks: Type.TArray<Type.TObject<{
@@ -39,13 +39,13 @@ export declare class WorkspaceRunner {
39
39
  goal: string;
40
40
  finalJudgment?: {
41
41
  role: string;
42
- modelClass: "balanced" | "fast" | "fav" | "frontier";
42
+ modelClass: "balanced" | "fast" | "fav" | "frontier" | "ultra";
43
43
  criterion: string;
44
44
  } | undefined;
45
45
  repositories: Record<string, string>;
46
46
  tasks: {
47
47
  role: string;
48
- modelClass: "balanced" | "fast" | "fav" | "frontier";
48
+ modelClass: "balanced" | "fast" | "fav" | "frontier" | "ultra";
49
49
  requirements: string;
50
50
  deliverable: string;
51
51
  dependsOn: string[];
@@ -54,7 +54,7 @@ export declare class WorkspaceRunner {
54
54
  kind: "changeset";
55
55
  judgment?: {
56
56
  role: string;
57
- modelClass: "balanced" | "fast" | "fav" | "frontier";
57
+ modelClass: "balanced" | "fast" | "fav" | "frontier" | "ultra";
58
58
  criterion: string;
59
59
  } | undefined;
60
60
  checks: {
@@ -0,0 +1,62 @@
1
+ # Direct delegation measurement
2
+
3
+ Pi Subagent runs native Pi workers through Herdr. Billion Context build `0.0.1373-master.1f3fcb5` also starts a native Pi child on a Pi host. Its Pi path passes the task through standard input, reads child output, and keeps the full result separately. Despite the tool name `acp_delegate`, this path does not need an Agent Client Protocol handshake. Pi Subagent reuses its existing session reader, concurrency limits, model routes, and checkout protection.
4
+
5
+ ## Parent result benchmark
6
+
7
+ Eight read workers use the same role, route and tasks in both runs. One returns 420 file check results. Seven each return `exact answer`. A simulated Herdr process drives the real `delegate_task` tool and result formatter. The fixture checks the full saved report against its source. Count the model-visible follow-up text including the recovery references.
8
+
9
+ | Measurement | Archived behavior | Local development |
10
+ | --- | ---: | ---: |
11
+ | Total inline worker answer budget | 40,960 bytes | 4,096 bytes |
12
+ | Parent follow-up | 8,234 bytes | 3,257 bytes |
13
+ | Parent follow-up tokens | 2,612 | 1,066 |
14
+
15
+ This fixture saves 1,546 tokens (59.2%) on the result message. Both versions save the complete report. The benchmark replaces temporary paths with equal fixed paths and random worker and task identities with fixed identities of the same length. Counts use `o200k_base` from `gpt-tokenizer@4.1.2`. Actual token counts depend on the model, content and path lengths. Child requests, parent prompts, cache activity and subsequent evidence reads fall outside this measurement. A parent that needs the full report must pay to read it.
16
+
17
+ From the repository root, capture the current result to a new file. The capture test uses the installed workspace dependencies and needs no provider credentials.
18
+
19
+ ```sh
20
+ PI_SUBAGENT_RESULT_CAPTURE="$PWD/parallel-result.txt" node --test --test-name-pattern='complete report and delivers' extensions/pi-subagent/test/subagent.test.ts
21
+ ```
22
+
23
+ Before tokenization, replace `/direct-[\da-f]{8}-[\da-f-]{27}/g` with `direct-00000000-0000-4000-8000-000000000000`. Replace `/\bagent d-[0-9a-f]{24}/g` with `agent d-000000000000000000000000`. Elapsed times in the measured run rounded to `0s`.
24
+
25
+ ## Live Pi and Herdr measurements
26
+
27
+ Pi 1.8.0 and Herdr 0.9.5 ran the single, parallel, and chain fixtures with `magpie/vps/group/fast`. Each worker had to return its assigned identifier. The chain also checked the next worker's saved prompt against the preceding answer. The parent and worker counts come from their separate assistant usage records. All records included all four token fields. Each row represents one run.
28
+
29
+ | Workflow | Participant | Requests | Input | Output | Cache read | Cache write | Elapsed to settled parent |
30
+ | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
31
+ | No delegation | Parent | 1 | 3,547 | 8 | 0 | 0 | Unmeasured |
32
+ | Single | Parent | 3 | 688 | 119 | 12,544 | 0 | 9.5 s |
33
+ | Single | Worker | 1 | 8,486 | 69 | 0 | 0 | |
34
+ | Parallel | Parent | 3 | 7,435 | 255 | 10,624 | 0 | 16.9 s |
35
+ | Parallel | Two workers | 2 | 12,073 | 72 | 11,264 | 0 | |
36
+ | Chain | Parent | 3 | 7,512 | 183 | 8,448 | 0 | 22.8 s |
37
+ | Chain | Two workers | 4 | 31,554 | 312 | 28,160 | 0 | |
38
+
39
+ The control used the same model route to echo an identifier in print mode with tools disabled. The delegation trials used a remote control parent with the delegation tool enabled. The control measures the overhead of delegation for trivial work. Prompts, cache hits and requests vary between runs. A model route can select different underlying models. This comparison does not establish total savings over the archived implementation or predict the cost of coding tasks.
40
+
41
+ Run the live check from a Herdr pane with configured Pi models. It opens temporary worker tabs and calls the configured provider. It prints per-participant usage and elapsed time.
42
+
43
+ ```sh
44
+ PI_SUBAGENT_E2E=1 node --test extensions/pi-subagent/test/direct-e2e.test.ts
45
+ ```
46
+
47
+ A separate live JSON parent received the exact worker answer in one tool result and produced a final answer. It received no background follow-up. Both print and JSON delivery also have deterministic tool tests.
48
+
49
+ ## Comparison with Billion Context
50
+
51
+ Two bounded repository tasks ran once per tool on 2026-12-04. Each run used a fresh Pi JSON parent and one worker. All eight sessions reported the route `magpie/vps/group/fast` with `max` thinking requested. A route can select different underlying models. The installed Billion Context version was `0.0.1373-master.1f3fcb5`. Its Pi delegation path also launched native Pi processes. The Pi Subagent arm used Herdr and inline delivery. These trials preceded the final recovery fixes.
52
+
53
+ | Task | Tool | Parent + worker requests | Input + output tokens | Cache-read tokens | Total tokens | Elapsed | Answer |
54
+ | --- | --- | ---: | ---: | ---: | ---: | ---: | --- |
55
+ | Trace a retry limit | `acp_delegate` | 3 + 4 | 47,700 | 84,608 | 132,308 | 79.1 s | Correct |
56
+ | Trace a retry limit | `delegate_task` | 2 + 2 | 18,151 | 7,168 | 25,319 | 38.4 s | Correct |
57
+ | Review session expiry | `acp_delegate` | 3 + 2 | 36,870 | 41,728 | 78,598 | 52.1 s | Found one defect |
58
+ | Review session expiry | `delegate_task` | 2 + 2 | 25,933 | 10,496 | 36,429 | 61.1 s | Found two defects |
59
+
60
+ Both research answers identified four calls against a three-call default and cited the inclusive loop bound. Both reviewers found that a failed refresh returns expired cached data. Pi Subagent also found that a successful refresh can return an already expired session. The latter defect was scored after the run against the fixture contract. All four usage fields came from saved assistant messages. Cache writes were zero. Total tokens count cached input each time the model read it. The table measures token traffic, not billing. The Billion Context parent made one additional read to retrieve each worker's answer.
61
+
62
+ Separately, the serialized model-facing `delegate_task` schema fell from 11,219 to 6,753 bytes, or 3,144 to 1,981 `o200k_base` tokens. This compares the initial reactivation with the final tool contract. Providers can encode schemas differently. The strict per-mode parsers still validate the actual request.
@@ -3,7 +3,7 @@
3
3
  `pi-subagent` owns both delegation paths behind `delegate_task`:
4
4
 
5
5
  ```text
6
- ┌─ direct ─── authorized shared-checkout Herdr tab
6
+ ┌─ direct ─── shared checkout, native Pi or Herdr tab
7
7
  request + Role + route ──┤
8
8
  └─ isolated ─ Herdr worktree, checked candidate, durable state
9
9
  ```
@@ -16,7 +16,7 @@ Main chooses the mode from your request. You do not need to select one. Words su
16
16
 
17
17
  | Mode | Request that triggers it | Checkout behavior |
18
18
  | --- | --- | --- |
19
- | `direct` | Bounded research, review, or explicitly authorized writes and commits in the shared checkout | Opens Herdr tabs without focus in Main's current workspace. Creates no worktree. |
19
+ | `direct` | Bounded research, review, or explicitly authorized writes and commits in the shared checkout | Runs native Pi workers outside Herdr. In Herdr, opens worker tabs without focus. Creates no worktree. |
20
20
  | `isolated` | Implementation or a checked task graph | Runs changesets in owned Herdr worktrees. Main selects, validates, and promotes exact candidates. |
21
21
 
22
22
  Keep trivial mechanically verifiable work in Main. Keep tightly coupled changes under one owner. Do not split them by file count.
@@ -72,7 +72,7 @@ Each entry has:
72
72
  | `paths` | no | Write tasks only: 1 to 32 repo-relative globs (`path.matchesGlob` syntax, such as `src/**`). The change report flags changed paths outside them. A report only, not enforced |
73
73
  | `continueFrom` | no | Direct reference such as `D7.1`; continues that finished worker's Pi session. `role` must equal the recorded Role |
74
74
  | `kind` | no | `text` only (default); direct `changeset` is rejected |
75
- | `modelClass` | no | `fast`, `balanced`, `frontier`, or `fav` route |
75
+ | `modelClass` | no | `fast`, `balanced`, `frontier`, `ultra`, or `fav` route |
76
76
  | `model` | no | `provider/modelId`; replaces only the route model |
77
77
 
78
78
  An explicit model must support the route's thinking level. A launched child is never retried automatically after provider or process failure.
@@ -87,6 +87,10 @@ The result is a bounded plan. It shows each task's Role, resolved `provider/mode
87
87
 
88
88
  Read requests skip checkout admission and return plain text. Parallel `tasks` run concurrently up to `maxSubagents`; chains stay ordered. The extension does not enforce `read`. Results stay in request order.
89
89
 
90
+ Outside Herdr, direct mode uses a native Pi child. Before a write starts, Main saves its session and process lease identity in the admission journal. A write batch runs serially. Release requires the observed child exit and two empty scans of the original lease. Failed work retains admission until explicit cleanup. After a restart, `/subagent` provides journal recovery.
91
+
92
+ Native workers save a private Pi session and process lease. To continue a native worker, Main must have observed its process exit in this Pi process. The Role, checkout and last saved turn must match. Two lease scans must be empty. An interrupted turn can resume after these checks. Continuation after a Pi restart is unavailable. Use `{"mode":"cancel","id":"<exact workflow ID>"}` to stop locally owned work on the current branch. The `/subagent` menu also provides Close. Cancellation does not prove that detached descendants stopped.
93
+
90
94
  Direct tasks use the declared tools, extensions, Skills, and MCP servers of the selected Role, including resources that can write. Authorization comes from your request and Main's bounded task packet, not from the capabilities of the Role. Name the permitted paths, actions, and exclusions. Preserve unrelated edits and staged changes. Authorize commits or external actions explicitly.
91
95
 
92
96
  For example, a configured Git operator with `bash` can stage named pending files and commit them on the `fast` route. Use isolated mode for a checked changeset.
@@ -166,7 +170,7 @@ Admission coordinates only this Main's Pi calls. Other Pi sessions and external
166
170
 
167
171
  ### Continue or stop one direct worker
168
172
 
169
- Main can continue a finished direct worker, so it does not have to start a new one. It adds `continueFrom` with the reference of the worker, such as `"continueFrom": "D7.1"`, to any single, parallel, or chain task. It uses the same `role` that the worker ran with. The worker resumes its saved Pi session in a new Herdr tab without focus, so it keeps its earlier context.
173
+ Main can continue a finished direct worker, so it does not have to start a new one. It adds `continueFrom` with the reference of the worker, such as `"continueFrom": "D7.1"`, to any single, parallel, or chain task. It uses the same `role` that the worker ran with. In Herdr, the worker resumes its saved Pi session in a new tab without focus, so it keeps its earlier context. Outside Herdr, it resumes in a native Pi process after the checks above.
170
174
 
171
175
  The new tab gets a new agent name and reference. Its record points to the same session and private lease file. The launch handle and the result say `continued from D7.1`. Access, admission, write rules, and model routes are the same as for a new task.
172
176
 
@@ -188,16 +192,18 @@ If the extension cannot prove termination of the stopped worker, the workflow ke
188
192
 
189
193
  The extension retrieves each final answer from its exact Pi session file, not its possibly truncated screen. Idle, blocked, unknown, or malformed answers fail with recoverable tab and session identities. No whole-run deadline applies.
190
194
 
191
- The tasks in a request share a 40 KiB inline answer budget. Each worker prompt states its share. A longer exact answer is still a success. The result shows a UTF-8-safe prefix and a truncation marker. The marker gives the path of a private `answer-<turn>.md` file beside the session file, which holds the full answer. For a write task, the budget applies to the `answer` field of the completion object. A chain step receives the full answer of the previous step in `{previous}`; the budget applies only to the result for Main. The result details keep `answerFile` for each full-answer file. Recovery text includes these paths outside the output limit, even when checkout notes remove the inline link.
195
+ The tasks in a request share a 4 KiB inline answer budget. Each worker prompt states its share. A longer exact answer is still a success. The result shows a UTF-8-safe prefix and a truncation marker. The recovery section links to a private `answer-<turn>.md` file beside the session file, which holds the full answer. For a write task, the budget applies to the `answer` field of the completion object. A chain step receives the full answer of the previous step in `{previous}`; the budget applies only to the result for Main. The result details keep `answerFile` for each full-answer file. Recovery text includes these paths outside the output limit, even when checkout notes fill the result. A one-line answer that fits the status summary appears only once.
192
196
 
193
197
  Herdr accepts prompt text as one command argument. To stay below the operating system's argument limit, a task packet above 64 KiB uses a private, exclusively created `task-<turn>.md` file beside the session file. This packet includes the full chain context. The worker prompt requires the Role's `read` tool to read all parts with line offsets before work starts. Pi's native `read` can return a line of exactly 50 KiB (51,200 bytes), but not a longer line. If any packet line is longer, or `read` is absent, the worker uses the Role's `bash` tool. If a line is too long and `bash` is absent, the task fails before tab creation with the read limit and a request for `bash` or shorter lines. A Role with neither tool also fails before tab creation; the extension adds no tool. The task file stays available for recovery.
194
198
 
195
- The tool returns a task ID and the first Herdr tab after launch, not the answer. The extension observes each worker and sends one result to Main when the workflow finishes. If Main is busy, Pi queues the result after the current turn. If Main is idle, the result starts a turn. The extension does not report a blocked, stalled, or unknown result as success.
199
+ In interactive and RPC modes, the tool returns a task ID. Herdr also returns the first verified tab. Native Pi returns the handle before the first worker starts. In these modes the extension observes each worker and sends one result to Main when the workflow finishes. If Main is busy, Pi queues the result after the current turn. If Main is idle, the result starts a turn. The extension does not report a blocked, stalled, or unknown result as success.
196
200
 
197
201
  In the result, each launched worker has a line with its model, thinking level, measured task tokens, cost, and elapsed time. For example: `✓ [1/2] Check · worker · provider/model · thinking high · 1.5k tok · $0.12 · 42s`. The first line also shows the request total, such as `total $0.12`. Unknown and zero cost are not shown. If Pi recorded no usage, the line shows `tokens unknown`. Failed and stopped workers show the usage that the extension measured until they ended. A worker that the extension skipped before launch shows no usage.
198
202
 
199
203
  The result details contain the same values in each entry as `model`, `thinkingLevel`, `tokens`, `cost`, and `elapsedMs`, and the request total as `cost`. When a value is unknown, its field is absent. If a task fails after its worker produced text, the result keeps a bounded excerpt marked as partial output. This excerpt is never success.
200
204
 
205
+ In print and JSON modes the direct tool waits for completion and returns the result inline.
206
+
201
207
  Every worker result delivered to Main starts with a header. The header states that the text is the output of the worker and carries no user authority. The extension inserts a backslash in text that imitates harness framing. Examples are `<system-reminder>`-style tags and lines that start with `Human:` or `Assistant:`. Nothing else changes. Isolated status and follow-up answer previews use the same header.
202
208
 
203
209
  A session switch or shutdown stops observation and preserves tab identities for recovery. To inspect exact tabs, agents, and Pi session files, open `/subagent` on the session branch. This includes tabs launched after the first. The menu has one row for each workflow.
@@ -221,7 +227,7 @@ Outside a Git repository, the extension makes no report and the task continues.
221
227
 
222
228
  ### Status widgets
223
229
 
224
- The TUI has two separate compact status widgets. Each widget has one row for each visible worker or task. `D` marks direct work, and `I` marks isolated work. Badges such as `[S]` and `[I3]` identify the Role initial. Isolated badges also include the model class: `1` fast, `2` balanced, `3` frontier, `*` fav.
230
+ The TUI has two separate compact status widgets. Each widget has one row for each visible worker or task. `D` marks direct work, and `I` marks isolated work. Badges such as `[S]` and `[I3]` identify the Role initial. Isolated badges also include the model class: `1` fast, `2` balanced, `3` frontier, `4` ultra, `*` fav.
225
231
 
226
232
  Each direct row starts with a saved direct reference such as `D7.1`. `D7` is the workflow number in this Pi session, and `.1` is the position of the worker in the original request. `/subagent` uses the same reference and name. The Herdr tab label shows them at launch. Numbers continue after reload, and the session never uses a number again.
227
233
 
@@ -707,3 +713,17 @@ Worktree finalization returns one of:
707
713
  - `recovery`: cleanup or measurement needs deliberate action and reports only proved fields.
708
714
 
709
715
  No cleanup path uses `git clean`, force deletion, hidden fallback to Main, or deletion of unproved work. The one exception is user-confirmed discard: after the user selects **Close and delete worktrees (discard work)** in `/subagent` and confirms, it force-removes the reviewed owned worktrees.
716
+
717
+ ### Moving delegation from Billion Context
718
+
719
+ Use `delegate_task` with the fields `role`, `name`, `task`, and `access`. Use one request for independent tasks. Use `chain` when a later worker needs the preceding answer. Keep small mechanical operations in Main.
720
+
721
+ | Previous agent | Pi Subagent role |
722
+ | --- | --- |
723
+ | researcher | scout |
724
+ | worker | implementer |
725
+ | reviewer | reviewer |
726
+ | planner | planner |
727
+ | oracle | oracle |
728
+
729
+ An explicit `modelClass` selects the profile for one launch. Otherwise the Role's frontmatter and its native task assignment apply. A built-in Role inherits its previous Billion Context profile assignment when no native assignment exists. For continued work, use the returned worker reference in `continueFrom`. A workflow ID identifies a request for cancellation. A private session path provides evidence.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: oracle
3
+ description: Advises on a bounded engineering decision
4
+ tools: [read, grep, find, ls, git_read]
5
+ extensions: []
6
+ skills: []
7
+ mcps: []
8
+ ---
9
+
10
+ Evaluate the supplied question and options independently. Check relevant implementation evidence. Recommend one option, explain the tradeoff, and name evidence that would change your judgment. Work read-only. Stop when you can answer the question.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: planner
3
+ description: Plans one bounded change and its verification
4
+ tools: [read, grep, find, ls, git_read]
5
+ extensions: []
6
+ skills: []
7
+ mcps: []
8
+ ---
9
+
10
+ Trace the relevant flow and constraints. Return the smallest ordered implementation plan, affected files, and checks that establish completion. Cite the evidence behind each decision. Identify any decision that requires the owner. Work read-only. Stop when you can answer the question.
@@ -33,12 +33,32 @@ const exactTab = (a: any, b: any) => ["taskId", "entryId", "name", "tabId", "pan
33
33
  && ["taskId", "entryId", "name", "tabId", "paneId", "sessionFile", "leasePath", "turn", "cwd", "workspaceId"].every((key) => a[key] === b[key]);
34
34
 
35
35
  const resourceEntries = (record: Record, entries: readonly SessionEntry[]) => entries.filter((entry) => entry.type === "custom"
36
- && ["subagent-direct-tab", "subagent-direct-allocation"].includes(entry.customType) && (entry.data as any)?.taskId === record.taskId);
36
+ && ["subagent-direct-tab", "subagent-direct-allocation", "subagent-direct-native"].includes(entry.customType) && (entry.data as any)?.taskId === record.taskId);
37
37
  const hasProof = (record: Record, entries: readonly SessionEntry[]) => {
38
38
  const resources = record.resources as any[] | undefined;
39
39
  if (!resources) return false;
40
40
  if (record.proof === "not-dispatched") return !resources.length && !resourceEntries(record, entries).length;
41
41
  if (record.proof !== "stopped" || !resources.length) return false;
42
+ if (resources.every((resource) => resource?.kind === "native-intent")) {
43
+ const keys = new Set<string>();
44
+ const saved = resourceEntries(record, entries);
45
+ if (saved.length !== resources.length) return false;
46
+ return resources.every((resource) => {
47
+ if (!["entryId", "sessionFile", "leasePath", "turn", "cwd", "role"].every((key) => text(resource[key]))
48
+ || !isProcessLeaseIdentity(resource.leaseIdentity)
49
+ || !["sessionFile", "leasePath", "cwd"].every((key) => isAbsolute(resource[key]) && normalize(resource[key]) === resource[key])
50
+ || resource.sessionFile === resource.leasePath || dirname(resource.sessionFile) !== dirname(resource.leasePath)) return false;
51
+ const key = JSON.stringify([resource.entryId, resource.sessionFile, resource.turn]);
52
+ if (keys.has(key)) return false;
53
+ keys.add(key);
54
+ return saved.some((entry) => {
55
+ if (entry.type !== "custom" || entry.customType !== "subagent-direct-native") return false;
56
+ const details = entry.data as typeof resource;
57
+ return ["entryId", "sessionFile", "leasePath", "turn", "cwd", "role", "leaseIdentity"]
58
+ .every((field) => isDeepStrictEqual(resource[field], details?.[field]));
59
+ });
60
+ });
61
+ }
42
62
  const fields = ["entryId", "name", "sessionFile", "leasePath", "turn", "workspaceId", "cwd"];
43
63
  const tabFields = [...fields, "taskId", "tabId", "paneId"];
44
64
  const valid = (value: any, keys = fields) => value && typeof value === "object" && !Array.isArray(value)
@@ -74,7 +94,7 @@ const identity = (record: Record) => `${record.sessionId}/${record.taskId}/${rec
74
94
  const evidence = (record: Record, entries: readonly SessionEntry[]) => {
75
95
  const sources = (record.resources ?? []).flatMap((resource: any) => resource?.kind === "continuation-sources" && Array.isArray(resource.sources) ? resource.sources : []);
76
96
  return JSON.stringify({ admission: record, records: entries.filter((entry) => entry.type === "custom"
77
- && ["subagent-direct-tab", "subagent-direct-allocation"].includes(entry.customType)
97
+ && ["subagent-direct-tab", "subagent-direct-allocation", "subagent-direct-native"].includes(entry.customType)
78
98
  && ((entry.data as any)?.taskId === record.taskId || sources.some((source) => text(source?.taskId) && source.taskId === (entry.data as any)?.taskId && source.entryId === (entry.data as any)?.entryId)))
79
99
  // Native forks can change parent links and move labels; neither changes worker evidence.
80
100
  .map(({ id, customType, data }: any) => ({ id, customType, data })) });
@@ -112,7 +132,7 @@ function replay(entries: readonly SessionEntry[]): Map<string, Record> {
112
132
  records.set(key, record);
113
133
  }
114
134
  for (const [index, entry] of entries.entries()) {
115
- if (entry.type !== "custom" || !["subagent-direct-tab", "subagent-direct-allocation"].includes(entry.customType)) continue;
135
+ if (entry.type !== "custom" || !["subagent-direct-tab", "subagent-direct-allocation", "subagent-direct-native"].includes(entry.customType)) continue;
116
136
  const tab = entry.data as any;
117
137
  if (!tab || !text(tab.taskId)) throw new Error("Malformed legacy direct worker record.");
118
138
  if (tasks.has(tab.taskId) || tab.access === "read") continue;
@@ -247,6 +267,10 @@ export function registerDirectAdmission(pi: ExtensionAPI, canWrite: (input: unkn
247
267
  return Object.assign(() => {
248
268
  if (records.get(key)?.state === "released") return;
249
269
  if (ctx.sessionManager.getSessionId() !== record.sessionId) throw new Error("Direct release requires its original Pi session; admission retained.");
270
+ requireReady();
271
+ if (loadedSession !== record.sessionId || !isDeepStrictEqual(replay(ctx.sessionManager.getEntries()).get(key), record)) {
272
+ throw new Error("Direct reservation changed before local evidence retry or release; protection retained.");
273
+ }
250
274
  // Only the local finalizer calls this after all effects are stopped or proved absent.
251
275
  if (pendingTabs.size) {
252
276
  requireReady();
@@ -0,0 +1,77 @@
1
+ import { randomBytes } from "node:crypto";
2
+ import { mkdtemp, readFile, stat, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { dirname, join } from "node:path";
5
+ import type { PreparedRoleLaunch } from "@henryqw/pi-subagent";
6
+ import { exactDirectAnswer, directTaskReader } from "../dist/direct-herdr.js";
7
+ import { materializeTransientLaunch } from "../dist/launch-runtime.js";
8
+ import { EphemeralSubagentError, utf8Prefix, type EphemeralSubagentExecutor } from "../dist/ephemeral.js";
9
+ import { PI_SUBAGENT_PROCESS_LEASE, processLeaseIdentity, type ProcessLeaseIdentity } from "../dist/process-lease.js";
10
+
11
+ export type NativeSession = { sessionFile: string; leasePath: string; leaseIdentity: ProcessLeaseIdentity; turn: string; cwd: string; role: string };
12
+
13
+ /** Run a direct task with the active Pi executor and retain its exact native session. */
14
+ export async function runNativeDirect(input: {
15
+ executor: EphemeralSubagentExecutor;
16
+ signal: AbortSignal;
17
+ cwd: string;
18
+ role: string;
19
+ task: string;
20
+ answerBytes: number;
21
+ write: boolean;
22
+ requireSuccess: boolean;
23
+ onProcessEnd: (reason: "not-started" | "exited") => void;
24
+ prepare: () => Promise<PreparedRoleLaunch>;
25
+ source?: NativeSession;
26
+ onSession: (session: NativeSession) => void;
27
+ onUsage: (usage: { totalTokens: number; cost: { total: number } }) => void;
28
+ }): Promise<{ text: string; inline: string; answerFile?: string }> {
29
+ let transient: Awaited<ReturnType<typeof materializeTransientLaunch>> | undefined;
30
+ let session!: NativeSession;
31
+ let prompt = "";
32
+ try {
33
+ const result = await input.executor.run({ signal: input.signal, onProcessEnd: input.onProcessEnd, prepare: async () => {
34
+ const prepared = await input.prepare();
35
+ input.signal.throwIfAborted();
36
+ const directory = input.source ? dirname(input.source.sessionFile) : await mkdtemp(join(tmpdir(), "pi-subagent-native-"));
37
+ const turn = randomBytes(16).toString("hex");
38
+ const leasePath = input.source?.leasePath ?? join(directory, "process.lease");
39
+ if (!input.source) await writeFile(leasePath, "", { flag: "wx", mode: 0o600 });
40
+ const leaseIdentity = await processLeaseIdentity(leasePath, input.source?.leaseIdentity);
41
+ session = { sessionFile: input.source?.sessionFile ?? join(directory, "session.jsonl"), leasePath, leaseIdentity, turn, cwd: input.cwd, role: input.role };
42
+ let task = input.task;
43
+ const reader = directTaskReader(task, prepared.tools);
44
+ if (reader) {
45
+ const taskFile = join(directory, `task-${turn}.md`);
46
+ await writeFile(taskFile, task, { flag: "wx", mode: 0o600 });
47
+ task = `Use ${reader} to read the complete task packet at ${JSON.stringify(taskFile)} before acting. If you cannot read it in full, stop and report blocked work.`;
48
+ }
49
+ const access = input.write
50
+ ? 'Declared access: write. Preserve unrelated work. Do not create or manage worktrees, change branches, push, or perform external mutations without explicit authorization.'
51
+ : "Declared access: read. Do not change files, Git state, or external resources; if the task needs changes, stop and report that instead. Do not create or manage worktrees, change branches, push, or perform external mutations.";
52
+ const completion = input.requireSuccess ? ' Return exactly one JSON object: {"outcome":"succeeded","answer":"summary"}. Use outcome "failed" or "blocked" when the complete task or requested checks did not succeed.' : "";
53
+ prompt = `Task: ${task}\n\n${access}${completion}\n\nDirect shared-checkout boundary: use only your Role's resources for the explicitly authorized task.\n\nTurn identity: ${turn}`;
54
+ transient = await materializeTransientLaunch({ launch: prepared, prompt: prepared.systemPrompt, promptArgIndex: prepared.promptArgIndex }, input.signal);
55
+ const args = transient.launch.args.filter((arg) => arg !== "--no-session");
56
+ if (args.length !== transient.launch.args.length - 1) throw new Error("Role launch must contain exactly one --no-session option.");
57
+ input.signal.throwIfAborted();
58
+ input.onSession(session);
59
+ return { launch: { args: [...args, "--session", session.sessionFile], env: { ...prepared.env, [PI_SUBAGENT_PROCESS_LEASE]: leasePath } }, task: prompt.slice(6), cwd: input.cwd };
60
+ } });
61
+ if (result.usage) input.onUsage(result.usage);
62
+ if (result.outcome !== "success") throw new Error(result.errorMessage || result.stderr || `Native Pi exited with ${result.exitCode} (${result.stopReason ?? "unknown"}).`);
63
+ const info = await stat(session.sessionFile);
64
+ if (info.size > 16 * 1024 * 1024) throw new Error(`Native Pi session exceeds 16 MiB; inspect ${session.sessionFile}.`);
65
+ const text = exactDirectAnswer(await readFile(session.sessionFile, "utf8"), prompt, input.requireSuccess);
66
+ const bytes = Buffer.byteLength(text);
67
+ if (bytes <= input.answerBytes) return { text, inline: text };
68
+ const answerFile = join(dirname(session.sessionFile), `answer-${session.turn}.md`);
69
+ await writeFile(answerFile, text, { flag: "wx", mode: 0o600 });
70
+ return { text, inline: `${utf8Prefix(text, input.answerBytes)}\n\n[Answer truncated to ${input.answerBytes} of ${bytes} bytes; full answer saved]`, answerFile };
71
+ } catch (error) {
72
+ if (error instanceof EphemeralSubagentError && error.usage) input.onUsage(error.usage);
73
+ throw error;
74
+ } finally {
75
+ if (transient) await transient.cleanup();
76
+ }
77
+ }
@@ -111,7 +111,7 @@ function compactWidgetField(value: string): string {
111
111
  }
112
112
 
113
113
  function workspaceBadge(role: string, modelClass: ModelClass): string {
114
- const modelCode = { fast: "1", balanced: "2", frontier: "3", fav: "*" }[modelClass];
114
+ const modelCode = { fast: "1", balanced: "2", frontier: "3", ultra: "4", fav: "*" }[modelClass];
115
115
  return `[${Array.from(role)[0]!.toUpperCase()}${modelCode}]`;
116
116
  }
117
117
 
@@ -1 +1 @@
1
- export const MODEL_CLASS_GUIDANCE = "If the selected Role declares a modelClass default, omit modelClass unless an explicit override is needed. Otherwise, prioritize modelClass fast for straightforward work and balanced for complex work. Reserve frontier for exceptionally complex or tricky work.";
1
+ export const MODEL_CLASS_GUIDANCE = "Omit modelClass to use the configured Role route. Set it only for an intentional profile override.";
@@ -157,7 +157,7 @@ function sourceFor(entry: WorkflowTransportEntry): string | undefined {
157
157
 
158
158
  function evidenceFor(entry: WorkflowTransportEntry, position: number, total: number): Evidence | undefined {
159
159
  const source = sourceFor(entry);
160
- if (!source) return;
160
+ if (!source || source === displaySummary(source)) return;
161
161
  const [preview, remainder] = splitEvidence(source);
162
162
  return {
163
163
  heading: `- [${position}/${total}] ${entry.name} · ${entry.role} · ${entry.status === "rejected" ? "failure" : "result"}:`,