pi-background-tasks 2.5.0 → 2.6.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/BACKGROUND-TASKS-INSTRUCTIONS.md +1 -1
- package/README.md +70 -25
- package/TESTING.md +42 -2
- package/TEST_PLAN.md +7 -4
- package/dist/extensions/anthropic-attribution-child.js +4 -0
- package/dist/extensions/anthropic-attribution-child.js.map +1 -0
- package/dist/extensions/anthropic-attribution.js +107 -0
- package/dist/extensions/anthropic-attribution.js.map +1 -0
- package/dist/extensions/background-tasks.js +2 -0
- package/dist/extensions/background-tasks.js.map +1 -0
- package/dist/extensions/delegate-child.js +2 -0
- package/dist/extensions/delegate-child.js.map +1 -0
- package/dist/extensions/fusion-child.js +2 -0
- package/dist/extensions/fusion-child.js.map +1 -0
- package/dist/package.json +5 -0
- package/dist/src/core/anthropic-attribution-path.js +24 -0
- package/dist/src/core/anthropic-attribution-path.js.map +1 -0
- package/dist/src/core/anthropic-attribution.js +2247 -0
- package/dist/src/core/anthropic-attribution.js.map +1 -0
- package/dist/src/core/attested-pi-contract.js +5 -0
- package/dist/src/core/attested-pi-contract.js.map +1 -0
- package/dist/src/core/attested-pi-run.js +749 -0
- package/dist/src/core/attested-pi-run.js.map +1 -0
- package/dist/src/core/canonical-json.js +19 -0
- package/dist/src/core/canonical-json.js.map +1 -0
- package/dist/src/core/common.js +787 -0
- package/dist/src/core/common.js.map +1 -0
- package/dist/src/core/config.js +78 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/context/parent-snapshot.js +75 -0
- package/dist/src/core/context/parent-snapshot.js.map +1 -0
- package/dist/src/core/context/token-budget.js +631 -0
- package/dist/src/core/context/token-budget.js.map +1 -0
- package/dist/src/core/context/visible-conversation-v2.js +390 -0
- package/dist/src/core/context/visible-conversation-v2.js.map +1 -0
- package/dist/src/core/delegate/artifacts.js +357 -0
- package/dist/src/core/delegate/artifacts.js.map +1 -0
- package/dist/src/core/delegate/budget.js +266 -0
- package/dist/src/core/delegate/budget.js.map +1 -0
- package/dist/src/core/delegate/facade-contract.js +7 -0
- package/dist/src/core/delegate/facade-contract.js.map +1 -0
- package/dist/src/core/delegate/hook-contract-evidence.json +18 -0
- package/dist/src/core/delegate/hook-contract.js +124 -0
- package/dist/src/core/delegate/hook-contract.js.map +1 -0
- package/dist/src/core/delegate/launch.js +366 -0
- package/dist/src/core/delegate/launch.js.map +1 -0
- package/dist/src/core/delegate/result-package.js +293 -0
- package/dist/src/core/delegate/result-package.js.map +1 -0
- package/dist/src/core/delegate/runner.js +398 -0
- package/dist/src/core/delegate/runner.js.map +1 -0
- package/dist/src/core/delegate/seed.js +334 -0
- package/dist/src/core/delegate/seed.js.map +1 -0
- package/dist/src/core/delegate/types.js +103 -0
- package/dist/src/core/delegate/types.js.map +1 -0
- package/dist/src/core/durable-fs.js +372 -0
- package/dist/src/core/durable-fs.js.map +1 -0
- package/dist/src/core/extension-api.js +382 -0
- package/dist/src/core/extension-api.js.map +1 -0
- package/dist/src/core/fusion/artifacts.js +654 -0
- package/dist/src/core/fusion/artifacts.js.map +1 -0
- package/dist/src/core/fusion/budget.js +949 -0
- package/dist/src/core/fusion/budget.js.map +1 -0
- package/dist/src/core/fusion/child-protocol.js +176 -0
- package/dist/src/core/fusion/child-protocol.js.map +1 -0
- package/dist/src/core/fusion/claude-cache.js +156 -0
- package/dist/src/core/fusion/claude-cache.js.map +1 -0
- package/dist/src/core/fusion/clean-context.js +64 -0
- package/dist/src/core/fusion/clean-context.js.map +1 -0
- package/dist/src/core/fusion/config.js +349 -0
- package/dist/src/core/fusion/config.js.map +1 -0
- package/dist/src/core/fusion/context.js +184 -0
- package/dist/src/core/fusion/context.js.map +1 -0
- package/dist/src/core/fusion/evaluation.js +696 -0
- package/dist/src/core/fusion/evaluation.js.map +1 -0
- package/dist/src/core/fusion/facade-contract.js +3 -0
- package/dist/src/core/fusion/facade-contract.js.map +1 -0
- package/dist/src/core/fusion/orchestrator.js +867 -0
- package/dist/src/core/fusion/orchestrator.js.map +1 -0
- package/dist/src/core/fusion/output-contract.js +27 -0
- package/dist/src/core/fusion/output-contract.js.map +1 -0
- package/dist/src/core/fusion/pi-child.js +1741 -0
- package/dist/src/core/fusion/pi-child.js.map +1 -0
- package/dist/src/core/fusion/prompts.js +260 -0
- package/dist/src/core/fusion/prompts.js.map +1 -0
- package/dist/src/core/fusion/result-package.js +857 -0
- package/dist/src/core/fusion/result-package.js.map +1 -0
- package/dist/src/core/fusion/source-policy.js +259 -0
- package/dist/src/core/fusion/source-policy.js.map +1 -0
- package/dist/src/core/fusion/types.js +207 -0
- package/dist/src/core/fusion/types.js.map +1 -0
- package/dist/src/core/fusion/web-fetch.js +777 -0
- package/dist/src/core/fusion/web-fetch.js.map +1 -0
- package/dist/src/core/fusion/workflows.js +126 -0
- package/dist/src/core/fusion/workflows.js.map +1 -0
- package/dist/src/core/lazy-module.js +181 -0
- package/dist/src/core/lazy-module.js.map +1 -0
- package/dist/src/core/pi-launch.js +431 -0
- package/dist/src/core/pi-launch.js.map +1 -0
- package/dist/src/core/registry.js +3331 -0
- package/dist/src/core/registry.js.map +1 -0
- package/dist/src/core/reload-shell-owner.js +1396 -0
- package/dist/src/core/reload-shell-owner.js.map +1 -0
- package/dist/src/core/shell-policy.js +80 -0
- package/dist/src/core/shell-policy.js.map +1 -0
- package/dist/src/core/task-durable.js +51 -0
- package/dist/src/core/task-durable.js.map +1 -0
- package/dist/src/core/update-check.js +92 -0
- package/dist/src/core/update-check.js.map +1 -0
- package/dist/src/core/windows-taskkill.js +185 -0
- package/dist/src/core/windows-taskkill.js.map +1 -0
- package/dist/src/delegate-child-extension.js +776 -0
- package/dist/src/delegate-child-extension.js.map +1 -0
- package/dist/src/delegate-extension.js +746 -0
- package/dist/src/delegate-extension.js.map +1 -0
- package/dist/src/extension.js +953 -0
- package/dist/src/extension.js.map +1 -0
- package/dist/src/fusion-child-extension.js +760 -0
- package/dist/src/fusion-child-extension.js.map +1 -0
- package/dist/src/fusion-extension.js +1030 -0
- package/dist/src/fusion-extension.js.map +1 -0
- package/dist/src/ui/background-tasks-manager.js +689 -0
- package/dist/src/ui/background-tasks-manager.js.map +1 -0
- package/dist/src/ui/fusion-model-selector.js +277 -0
- package/dist/src/ui/fusion-model-selector.js.map +1 -0
- package/docs/INDEX.md +35 -33
- package/docs/api/eventbus-v1.md +21 -5
- package/docs/choose-a-workflow.md +2 -0
- package/docs/commands/bg-clear.md +3 -3
- package/docs/commands/bg-update.md +3 -3
- package/docs/commands/bg.md +18 -6
- package/docs/commands/claude-cache.md +4 -4
- package/docs/commands/fusion-models.md +49 -4
- package/docs/commands/fusion.md +3 -3
- package/docs/commands/jobs.md +3 -3
- package/docs/commands/kill.md +3 -3
- package/docs/commands/logs.md +3 -3
- package/docs/commands/task-manager.md +5 -5
- package/docs/concepts/completion-delivery.md +6 -2
- package/docs/getting-started.md +7 -1
- package/docs/manifest.json +228 -42
- package/docs/operations/configuration.md +58 -5
- package/docs/operations/releasing.md +4 -2
- package/docs/operations/testing.md +22 -0
- package/docs/operations/troubleshooting.md +6 -2
- package/docs/read-before-edit.md +44 -31
- package/docs/reference/runtime-contracts.md +87 -51
- package/docs/reference/shortcuts-and-dock.md +28 -14
- package/docs/subsystems/anthropic-attribution.md +23 -11
- package/docs/subsystems/attested-pi-runs.md +12 -7
- package/docs/subsystems/background-task-runtime.md +53 -11
- package/docs/subsystems/child-launch-durability-and-safety.md +28 -9
- package/docs/subsystems/delegation.md +16 -3
- package/docs/subsystems/docs-freshness-gate.md +14 -7
- package/docs/subsystems/fusion.md +36 -11
- package/docs/subsystems/host-ui-and-telemetry.md +22 -9
- package/docs/tools/bg_delegate.md +3 -1
- package/docs/tools/bg_kill.md +3 -1
- package/docs/tools/bg_logs.md +3 -1
- package/docs/tools/bg_result.md +5 -3
- package/docs/tools/bg_run.md +31 -5
- package/docs/tools/bg_run_pi_attested.md +3 -1
- package/docs/tools/bg_status.md +3 -1
- package/docs/tools/fusion_investigate.md +3 -1
- package/docs/tools/fusion_reason.md +3 -1
- package/docs/tools/fusion_research.md +3 -1
- package/docs/tools/fusion_validate.md +3 -1
- package/extensions/anthropic-attribution-child.ts +3 -0
- package/extensions/anthropic-attribution.ts +166 -1
- package/package.json +12 -10
- package/src/core/anthropic-attribution-path.ts +5 -4
- package/src/core/anthropic-attribution.ts +293 -113
- package/src/core/attested-pi-contract.ts +4 -0
- package/src/core/attested-pi-run.ts +468 -81
- package/src/core/canonical-json.ts +21 -0
- package/src/core/common.ts +450 -40
- package/src/core/config.ts +121 -0
- package/src/core/context/visible-conversation-v2.ts +3 -6
- package/src/core/delegate/artifacts.ts +13 -9
- package/src/core/delegate/budget.ts +13 -6
- package/src/core/delegate/facade-contract.ts +6 -0
- package/src/core/delegate/result-package.ts +32 -14
- package/src/core/delegate/runner.ts +129 -58
- package/src/core/delegate/seed.ts +5 -7
- package/src/core/durable-fs.ts +178 -30
- package/src/core/extension-api.ts +36 -8
- package/src/core/fusion/artifacts.ts +17 -16
- package/src/core/fusion/clean-context.ts +8 -5
- package/src/core/fusion/config.ts +2 -1
- package/src/core/fusion/context.ts +2 -6
- package/src/core/fusion/facade-contract.ts +2 -0
- package/src/core/fusion/orchestrator.ts +3 -3
- package/src/core/fusion/prompts.ts +1 -1
- package/src/core/fusion/result-package.ts +259 -72
- package/src/core/fusion/source-policy.ts +43 -17
- package/src/core/lazy-module.ts +215 -0
- package/src/core/pi-launch.ts +390 -65
- package/src/core/registry.ts +2010 -381
- package/src/core/reload-shell-owner.ts +1662 -0
- package/src/core/shell-policy.ts +134 -0
- package/src/core/task-durable.ts +67 -0
- package/src/delegate-extension.ts +404 -144
- package/src/extension.ts +387 -114
- package/src/fusion-extension.ts +202 -96
|
@@ -11,6 +11,45 @@ covers_sources: []
|
|
|
11
11
|
|
|
12
12
|
This page lists operator-facing configuration found in source. It intentionally does not invent undocumented environment variables.
|
|
13
13
|
|
|
14
|
+
## Capability and dock selection
|
|
15
|
+
|
|
16
|
+
Configuration is read before any package registration on each extension activation and is re-read by a real Pi `/reload`. Invalid input throws a bounded `pi_bg_config_invalid` error; it never partially activates a requested subset or falls back to defaults.
|
|
17
|
+
|
|
18
|
+
| Variable | Default | Accepted values and effect |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `PI_BG_FEATURES` | `process,delegate,fusion,attested,attribution` | A comma-separated set of exact lowercase, unique tokens from `process`, `delegate`, `fusion`, `attested`, `attribution`. Whitespace, blanks, duplicates, unknown values, and omission of mandatory `process` are errors. |
|
|
21
|
+
| `PI_BG_DOCK_SHORTCUT` | `shift+down` | Exactly `shift+down`, `ctrl+alt+b`, or `off`. Only the selected literal key is registered; `off` registers no dock shortcut. |
|
|
22
|
+
|
|
23
|
+
Capabilities are independent except for the derived result surface:
|
|
24
|
+
|
|
25
|
+
- `process` is mandatory and owns ordinary process commands/tools, the task UI/renderer, footer, and EventBus service.
|
|
26
|
+
- `delegate` registers `bg_delegate`.
|
|
27
|
+
- `fusion` registers `/fusion`, `/fusion-models`, the four `fusion_*` tools, and its result renderer.
|
|
28
|
+
- `attested` registers `bg_run_pi_attested`.
|
|
29
|
+
- `attribution` registers ambient parent-session Anthropic provider/hooks and `/claude-cache`.
|
|
30
|
+
- `bg_result` is not a feature token. It is registered exactly once when `delegate` or `fusion` is enabled, and is absent when neither producer is enabled.
|
|
31
|
+
|
|
32
|
+
Disabled package tools, commands, renderers, and shortcuts are absent from registration and discovery. Pi's registry rebuild drops stale active names that have no current definition; the package does not deactivate an unrelated extension tool merely because its name matches a disabled capability. `/tasks` and `/bg-tasks` are always available. With the dock shortcut off, the footer advertises `/tasks`; the alternate footer hint is `CtrlAltB`. `Ctrl+Alt+C` remains the terminal-dependent `/bg-clear` fallback in every configuration.
|
|
33
|
+
|
|
34
|
+
Ambient attribution selection does not weaken package-owned isolated Anthropic children. Delegate, Fusion, and attested child argv always loads `extensions/anthropic-attribution-child.ts` before the child guard/governor, regardless of the parent `attribution` token.
|
|
35
|
+
|
|
36
|
+
These flags select functionality only. They do not claim to reduce cold-start import cost; deferred loading and performance measurement are separate work.
|
|
37
|
+
|
|
38
|
+
## Initialized-host SDK contract
|
|
39
|
+
|
|
40
|
+
Normal Pi TUI, RPC, print, and JSON modes provide lifecycle bindings that initialize post-bind package resources and cause `session_start` to run after reload. An SDK host must call `bindExtensions()` with at least one binding Pi counts (UI context, command-context actions, shutdown handling, or `onError`). With only `{}` or `{ mode: "print" }`, the first explicit bind initializes resources, but `reload()` does not emit the rebuilt runner's `session_start`; the host must explicitly bind again after every `reload()`.
|
|
41
|
+
|
|
42
|
+
Bare `createAgentSession()` without `bindExtensions()` leaves ambient attribution, `/claude-cache`, its lifecycle hooks/owner claim, and session-start context services uninitialized. This remains a host API blocker pending a guaranteed post-bind/reload callback or owner-token provider registration; the package does not use a private fallback. It also means an opted shell cannot be claimed after an empty/mode-only SDK reload unless the embedder explicitly binds again. Direct `AgentSession.dispose()` invalidates without `session_shutdown`; extension-bearing SDK hosts must use `AgentSessionRuntime.dispose()` or another awaited host shutdown path. The generated availability tables describe this initialized-host contract and are not a pre-bind availability guarantee.
|
|
43
|
+
|
|
44
|
+
## Opt-in reload survival
|
|
45
|
+
|
|
46
|
+
Reload survival is a per-launch field/flag, not a global environment setting:
|
|
47
|
+
|
|
48
|
+
- `bg_run({ isAgent:false, surviveReload:true, ... })`
|
|
49
|
+
- `/bg --survive-reload ...`
|
|
50
|
+
|
|
51
|
+
Omitted/false keeps default kill-on-reload behavior. Survival is supported only for ordinary shell tasks across a real same-process Pi reload with the exact session id and canonical cwd. Agent, managed, delegate, Fusion, attested, EventBus-v1, new/resume/fork/clone/quit, crash, and process-restart paths do not opt in. The live execution retains its launch-time shell policy, timeout deadline, output cap, and cumulative bytes even if environment/config changes before reload; a dock rerun is new work and uses current configuration.
|
|
52
|
+
|
|
14
53
|
## Update check
|
|
15
54
|
|
|
16
55
|
At `session_start`, the extension performs a one-shot, time-boxed npm latest-version lookup. Failures are offline-safe: the footer simply shows no update segment.
|
|
@@ -27,7 +66,18 @@ At `session_start`, the extension performs a one-shot, time-boxed npm latest-ver
|
|
|
27
66
|
|
|
28
67
|
### POSIX
|
|
29
68
|
|
|
30
|
-
|
|
69
|
+
The policy is resolved once per extension activation. Changing these variables takes effect on the next Pi start or `/reload`, not midway through an activation.
|
|
70
|
+
|
|
71
|
+
| Variable | Effect |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `PI_BG_POSIX_SHELL=inherit` | Default. Preserve the existing behavior: use non-empty `SHELL`, otherwise `/bin/sh`, with `-c`. |
|
|
74
|
+
| `PI_BG_POSIX_SHELL=bash` | Select Bash explicitly. Check executable `/bin/bash` first, then `bash` in `PATH` order; fail if unavailable. |
|
|
75
|
+
| `PI_BG_POSIX_SHELL=sh` | Select sh explicitly. Check executable `/bin/sh` first, then `sh` in `PATH` order; fail if unavailable. |
|
|
76
|
+
| `PI_BG_POSIX_SHELL_PATH=<absolute-file>` | Optional only with `bash` or `sh`. The target must be a regular executable file. Invalid, empty, relative, or unavailable paths fail without search fallback. |
|
|
77
|
+
|
|
78
|
+
Executable paths are structured spawn arguments, not interpolated command text. Bash and sh receive `-c`, never `-lc`; selecting them does not implicitly load login-shell startup files. For explicit search, `/bin` wins over `PATH`; relative `PATH` directories are resolved at activation so task cwd changes cannot retarget the selected executable.
|
|
79
|
+
|
|
80
|
+
In `inherit` mode, known Bourne-family names are reported as POSIX-compatible, `bash` is reported as Bash, and Nu/fish/csh/unknown names are reported as `user-non-posix`. The inherited executable itself is intentionally not validated or replaced, preserving compatibility. Before each agent run, guidance reports the exact resolved executable/dialect/args. A non-POSIX inherited shell receives explicit `PI_BG_POSIX_SHELL=bash` remediation.
|
|
31
81
|
|
|
32
82
|
### Windows
|
|
33
83
|
|
|
@@ -39,7 +89,7 @@ Windows defaults to `cmd.exe`/`ComSpec`. The generic `SHELL` variable is ignored
|
|
|
39
89
|
| `PI_BG_SHELL=bash` | Use POSIX-style `bash -c` on Windows. |
|
|
40
90
|
| `PI_BG_SHELL_PATH=<absolute .exe/.com>` | Explicit shell path; requires `PI_BG_SHELL`. |
|
|
41
91
|
|
|
42
|
-
Invalid Windows shell settings fail loudly instead of falling back. `bash` is invoked with `-c`, not `-lc`.
|
|
92
|
+
Invalid Windows shell settings fail loudly instead of falling back. `bash` is invoked with `-c`, not `-lc`. `PI_BG_POSIX_SHELL` and `PI_BG_POSIX_SHELL_PATH` are ignored on Windows, even when present, so they cannot change existing cmd/Bash/ComSpec selection or structured argv behavior.
|
|
43
93
|
|
|
44
94
|
## Output and log caps
|
|
45
95
|
|
|
@@ -57,14 +107,17 @@ Bounded logs are for context safety; they point to the full local output file wh
|
|
|
57
107
|
|---|---|
|
|
58
108
|
| `PI_BG_DISABLE_PI_TELEMETRY=1` | Do not wrap shell commands that appear to launch `pi -p ...` or `pi --mode json ...` when `isAgent:true`. Raw stdout is preserved. |
|
|
59
109
|
|
|
60
|
-
Telemetry wrapping is best-effort and task-owned. Missing telemetry is reported as unavailable, never as zero. Under Windows `cmd
|
|
110
|
+
Telemetry wrapping is best-effort and task-owned. Missing telemetry is reported as unavailable, never as zero. Wrapping requires a resolved shell with compatible POSIX function syntax. Under Windows `cmd` or an inherited Nu/fish/csh/unknown shell, safe interception is unavailable, the command is left unchanged, and task metadata records the reason.
|
|
61
111
|
|
|
62
112
|
## Global Anthropic attribution and caching
|
|
63
113
|
|
|
64
|
-
Normal package installation loads the
|
|
114
|
+
Normal package installation loads the feature-aware ambient Anthropic entrypoint before the background-task entrypoint. With the default `attribution` capability it installs the package-owned attribution/sanitization provider after Pi binds the session provider runtime; without that capability it registers no parent provider, hooks, or `/claude-cache` command. Installation must succeed immediately before ownership is published. Shutdown restores the captured public host registration only if the package's exact installation token is still current, so preexisting and later dynamic host providers are preserved without name-wide deletion. Non-Anthropic routes are not rewritten; a non-target provider using `anthropic-messages` passes its host-owned model, legacy or normalized transcript context, endpoint, authentication, and options directly to the matching host SDK adapter. The adapter's stream/events/results are returned without reconstruction, preserving callbacks, live partial identity, optional fields, tool metadata, usage, and terminal error semantics. Anthropic sessions require Pi's subscription OAuth route and refuse metered Anthropic credentials.
|
|
115
|
+
|
|
116
|
+
The account loader reads `userID` plus `oauthAccount.accountUuid` without writing the selected file. Precedence is an explicit absolute argument to the exported loader (programmatic/test use), then `PI_ANTHROPIC_ACCOUNT_CONFIG_PATH`, then `~/.claude.json`. The operator variable must name a non-empty absolute file path; relative/empty paths, unreadable or invalid JSON, and missing/blank required fields fail loudly. No alternate Claude directory variable is inferred. Package-owned Fusion, delegate, and attested children inherit this variable through their normal environment copies; account contents are neither copied to environment variables nor logged.
|
|
65
117
|
|
|
66
118
|
| Variable/command | Effect |
|
|
67
119
|
|---|---|
|
|
120
|
+
| `PI_ANTHROPIC_ACCOUNT_CONFIG_PATH=<absolute-file>` | Read Anthropic attribution account fields from this file instead of `~/.claude.json`. |
|
|
68
121
|
| `PI_CACHE_RETENTION=long` | Default to one-hour Anthropic cache breakpoints where the model supports them. This is the package default when unset. |
|
|
69
122
|
| `PI_CACHE_RETENTION=short` | Default to ordinary ephemeral cache breakpoints without a one-hour TTL. |
|
|
70
123
|
| `PI_CACHE_RETENTION=none` | Do not add default cache breakpoints. Explicit call-level policy remains authoritative. |
|
|
@@ -91,7 +144,7 @@ Use `/fusion-models` in TUI mode to configure five slots:
|
|
|
91
144
|
|
|
92
145
|
Missing config means all five slots are `$current`. Config entries are qualified `provider/model` selections or `$current`; malformed config, stale explicit models, unavailable current models, and concurrent selector conflicts fail loudly before child inference.
|
|
93
146
|
|
|
94
|
-
Fusion accepts frontier-model routes only through Pi Anthropic or Codex subscription OAuth where `ModelRegistry.isUsingOAuth` confirms the route. Metered frontier API-key/base-URL paths are rejected before child creation, and relevant metered environment variables are stripped from Fusion children. Anthropic children explicitly load the
|
|
147
|
+
Fusion accepts frontier-model routes only through Pi Anthropic or Codex subscription OAuth where `ModelRegistry.isUsingOAuth` confirms the route. Metered frontier API-key/base-URL paths are rejected before child creation, and relevant metered environment variables are stripped from Fusion children. Anthropic children explicitly load the package-owned always-on child attribution/sanitization entrypoint because Fusion disables ambient extension discovery. This child safety path is independent of the parent ambient `attribution` capability. Missing or malformed attribution data fails loudly before Anthropic transport. Its subscription request policy is 200K, so Fusion clamps Anthropic budget capacity to 200K even when Pi's model catalog advertises a larger context.
|
|
95
148
|
|
|
96
149
|
## Fusion Claude prompt caching
|
|
97
150
|
|
|
@@ -23,6 +23,7 @@ Current observed standalone git tags stop at `v0.6.0`. Do not advertise or certi
|
|
|
23
23
|
Run from the `pi-background-tasks` package root in an isolated environment. These are release-candidate checks, not tag certification:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
+
npm run build:runtime
|
|
26
27
|
npm run typecheck
|
|
27
28
|
npm run test:type-safety
|
|
28
29
|
npm run test:unit
|
|
@@ -51,8 +52,9 @@ Live evidence (`npx tsx scripts/delegate-live-run.ts`) is release-time and perfo
|
|
|
51
52
|
|
|
52
53
|
Use `npm pack --dry-run --json` output as the payload source of truth. Verify at minimum:
|
|
53
54
|
|
|
54
|
-
- `extensions/anthropic-attribution.
|
|
55
|
-
-
|
|
55
|
+
- `dist/extensions/anthropic-attribution.js` and `dist/extensions/background-tasks.js` are the ordered Pi entrypoints;
|
|
56
|
+
- the complete compiled `dist/` runtime closure, source maps, copied hook-contract evidence, and minimal `dist/package.json` are included;
|
|
57
|
+
- authoritative `extensions/` and runtime `src/` sources remain included for public source/API compatibility;
|
|
56
58
|
- `docs/`, `README.md`, `TESTING.md`, `TEST_PLAN.md`, `PUBLISHING.md`, `BACKGROUND-TASKS-INSTRUCTIONS.md`, `THIRD_PARTY_NOTICES.md`, root `logo.png`, and `LICENSE` are included per current `package.json.files`;
|
|
57
59
|
- tests, scripts, node_modules, local `.pi/` artifacts, generated evidence not meant for runtime, and nested tarballs are excluded;
|
|
58
60
|
- TypeBox remains a Pi-provided peer and no private/nested runtime TypeBox copy is bundled;
|
|
@@ -24,12 +24,21 @@ CI=1
|
|
|
24
24
|
|
|
25
25
|
Never point tests at the user's real `~/.pi/agent`.
|
|
26
26
|
|
|
27
|
+
## Trustworthy package-verification controls
|
|
28
|
+
|
|
29
|
+
Package source guards are compiler-driven rather than text-only:
|
|
30
|
+
|
|
31
|
+
- `test:type-safety` parses TypeScript syntax trees to reject explicit `any` types, directly nested/double assertions (including intervening parentheses and type-transparent `satisfies` expressions), and production non-null expressions while ignoring inert words in comments, strings, templates, and regular expressions. TypeScript-recognized `@ts-ignore`, `@ts-expect-error`, and `@ts-nocheck` comments remain forbidden. The double-assertion rule is deliberately syntactic: assertions separated through an identifier are not treated as directly nested, so validated `unknown` boundaries remain legal; this is not a whole-program type-soundness proof.
|
|
32
|
+
- `test:package` separates syntax-wide discovery of self-contained file-URL `pathname` hazards from bounded, flow-sensitive provenance. Static strings and static-head templates are classified by the WHATWG URL parser, including leading C0/space preprocessing and TAB/CR/LF removal; absolute first arguments override bases, while `./` and `../` template heads use the explicit base. The flow layer tracks distinct normal, break, continue, return, and explicit-throw completions, runs `finally` for every incoming completion, and covers direct/computed access plus declaration, assignment, and statically known `for...of` destructuring. Exact static keys distinguish lowercase `import.meta['url']` from uppercase intrinsic `globalThis['URL']`, with compiler symbols retaining lexical shadowing controls. Any explicitly traced may-file branch is rejected. An unknown dynamic first value remains unknown, but when a base is explicit it also retains that base's possible provenance because the value may be relative; known absolute HTTP(S) values still ignore file bases. The guard does not execute calls, infer implicit exceptions or interprocedural/later-closure effects, or model heap mutation and proxies, so it is a conservative source-policy check rather than a complete JavaScript dataflow proof.
|
|
33
|
+
- The packed-consumer test starts with a separate empty-cache negative control. It archives the already-published files of the real installed production dependency closure through npm's bundled portable `tar` API, without entering npm's directory-pack lifecycle, then exposes only those inputs through a loopback fixture registry and seeds a fresh task-owned npm cache. An executable task-owned `prepack`/`prepare`/`postpack` sentinel characterizes npm 10.9.3's unsafe `--ignore-scripts` prepare behavior and npm 11.13.0's denial, while the fixture path executes no hook, preserves script-bearing manifest bytes, and leaves source hashes unchanged. npm receives explicit task-owned user and global config files, runs from task-owned projects with empty project config, hard-sets `GIT_ALLOW_PROTOCOL=file`, and uses absolute archive/pack/install inputs. A configuration-only hostile scoped-registry control proves ambient global/project precedence cannot divert preparation; it sends no hostile request. The registry is stopped before the tarball is installed with `--offline`; the test loads Turndown and its Domino transitive dependency. It never reads the user's npm cache or config, and absent closure inputs fail loudly.
|
|
34
|
+
|
|
27
35
|
## Current package scripts
|
|
28
36
|
|
|
29
37
|
From current `package.json`:
|
|
30
38
|
|
|
31
39
|
| Lane | Script | Meaning |
|
|
32
40
|
|---|---|---|
|
|
41
|
+
| Runtime build | `npm run build:runtime` | Compile authoritative extension/runtime TypeScript into the shipped `dist/` JavaScript closure. |
|
|
33
42
|
| Typecheck | `npm run typecheck` | `tsc --noEmit`. |
|
|
34
43
|
| Type safety package tests | `npm run test:type-safety` | Package/type-safety tests. |
|
|
35
44
|
| Unit | `npm run test:unit` | Pure/unit coverage, including durable fs, budgets, projection, Fusion/delegate core. |
|
|
@@ -52,8 +61,21 @@ From current `package.json`:
|
|
|
52
61
|
| Docs attestation | `npm run docs:attest/record -- <doc_id> --reviewer <identity-after-semantic-review> --verdict PASS --notes <review-notes>` | Computes hashes and records an explicit semantic PASS receipt after review; `npm run docs:attest` is an alias and still needs args. |
|
|
53
62
|
| Docs unit/package gate | `npm run test:docs` | Docs-gate unit/package tests. |
|
|
54
63
|
| Payload check | `npm run payload:check` | Package payload policy check. |
|
|
64
|
+
| Cold-load benchmark | `node scripts/benchmark-cold-load.mjs --root "$PWD" --runtime <source|compiled> --label <label> --output <owned.json> --samples 30 --scratch <owned-dir>` | Fresh-process source or compiled-distribution load and first-use distributions; evidence only, never a CI timing threshold. |
|
|
55
65
|
| Release version check | `npm run release:check-version` | Tag-only version sanity; requires explicit `GITHUB_REF_TYPE=tag`/`GITHUB_REF_NAME=v$VERSION` and never publishes. |
|
|
56
66
|
|
|
67
|
+
### Cold-load measurement discipline
|
|
68
|
+
|
|
69
|
+
The cold-load driver starts a new Node process for every sample and gives each worker isolated project, agent, session, HOME, and temporary roots with offline/telemetry suppression. It records raw samples plus median, p90, median absolute deviation, minimum, and maximum for direct delegate/Fusion facade imports; no-extension, process-only, and default-full real SDK loading; first delegate/Fusion launch and subtype result verification with deterministic fake children; and first model-selector invocation with mocked UI. One warm-up is excluded and at least 30 measured samples are expected for comparative evidence.
|
|
70
|
+
|
|
71
|
+
Here, **cold** means a fresh process and empty JavaScript/Jiti module cache. It does not mean a flushed filesystem cache. Baseline and candidate must use the same driver and worker bytes, Node/Pi/dependency tree, host, features, and root conditions. If worktree limits force sequential baseline-then-candidate collection rather than simultaneous AB/BA, record that host-drift risk; do not fabricate interleaving. There is no machine-specific pass threshold.
|
|
72
|
+
|
|
73
|
+
The benchmark requires an explicit `--runtime source|compiled` choice. Published package entrypoints select the compiled JavaScript distribution, while source mode remains an authoritative development control. Process-only startup no longer statically imports delegate/Fusion facades, dock UI, the attribution transport, or attested execution; enabled registrations still load their lightweight facade before the extension factory resolves. Neither mode supports a native-Windows or vendor compiled-Bun timing claim without separate runs.
|
|
74
|
+
|
|
75
|
+
The package gate separately walks literal deferred imports, verifies every source target, builds its compiled counterpart, and requires the complete `dist/` closure in the tarball. A packed-copy regression then removes one verifier/producer module from an otherwise real tarball: package startup and immediate inventory still work, the first producer invocation fails with the bounded module-specific error, and no delegate artifact is created. This characterizes damaged payload behavior without weakening the real payload-closure check.
|
|
76
|
+
|
|
77
|
+
Lazy lifecycle SDK coverage deliberately blocks Fusion cleanup while asserting the shared synchronous fence has already closed delegate, result, command/UI, and both Fusion lanes. A real `AgentSession.reload()` control lets production delegate preparation finish a complete artifact tree before returning, then proves the unregistered transaction is rolled back with no starter or residual run bytes. A separate claim race proves shutdown cannot consume Fusion usage without a successful retrieval, and a registered-task control proves rollback never deletes registry-owned artifacts.
|
|
78
|
+
|
|
57
79
|
Do not run full/default/root suites for documentation-only edits unless the operator explicitly asks. If the operator restricts verification to focused checks, report that `docs:verify`/attestation were not run.
|
|
58
80
|
|
|
59
81
|
## Evidence that must be preserved
|
|
@@ -17,11 +17,15 @@ Start from the symptom, verify the source-owned doc, then apply the remediation.
|
|
|
17
17
|
| EventBus says service unavailable before `session_start` | Extension API is installed but no session context exists | Start/await Pi session startup; do not fabricate a context. |
|
|
18
18
|
| Terminal event arrives unexpectedly early in a consumer | Consumer is not waiting for the `run` response before correlating task id, or an older implementation lacks the gate | Bind response first; current API gates terminal publication for `run`/`kill`. See `docs/api/eventbus-v1.md`. |
|
|
19
19
|
| `bg_run` starts but logs are bounded/truncated | `bg_logs` is model-visible and capped by design | Read the full output file path from the notice only when operator-approved; do not increase model-visible logs casually. |
|
|
20
|
-
| Output cap terminates a task | `PI_BG_MAX_OUTPUT_BYTES` cap reached | Inspect full command behavior; raise cap only deliberately for
|
|
20
|
+
| Output cap terminates a task | `PI_BG_MAX_OUTPUT_BYTES` cap reached | Inspect full command behavior; raise cap only deliberately for a later launch. A survivor keeps its launch-time cap and cumulative bytes across reload. |
|
|
21
|
+
| `pi_bg_survive_reload_invalid` or `pi_bg_survive_reload_requires_non_agent` | Survival value/command grammar is malformed, or an agent task requested survival | Use a boolean `bg_run.surviveReload`, or one bare leading `/bg --survive-reload`, only with `isAgent:false`. Validation is intentionally before artifacts/spawn. |
|
|
22
|
+
| `pi_bg_reload_owner_unavailable` after SDK reload | New runner received no counted `session_start` (common with `{}` or mode-only binding), or launch occurred before binding | Bind at least one counted SDK service, or explicitly bind again after reload. Normal TUI/RPC/print/JSON modes already do this. |
|
|
23
|
+
| `pi_bg_reload_owner_activation_conflict`, `pi_bg_reload_owner_stale_claim`, or protocol incompatibility | Duplicate package activation, stale lease/claim, identity mismatch, or incompatible owner under the global symbol | Do not adopt task JSON/PIDs or overwrite owner state. Remove the duplicate/incompatible activation and let the fixed old handoff deadline clean up. |
|
|
24
|
+
| `pi_bg_reload_handoff_expired` | No compatible same-process reload activation claimed an opted live execution within 30 seconds | Inspect extension/config load errors. The owner stops the retained tree and records truthful failure; it does not claim crash/restart survival. |
|
|
21
25
|
| `PI_BG_SHELL` or `PI_BG_SHELL_PATH` error on Windows | Windows shell selection is closed and path-validated | Use `PI_BG_SHELL=cmd` or `bash`; if setting `PI_BG_SHELL_PATH`, provide an absolute `.exe`/`.com`. See `docs/subsystems/child-launch-durability-and-safety.md`. |
|
|
22
26
|
| `pi_executable_resolution_failed` | Windows Pi package bin cannot be resolved/validated | Reinstall/repair Pi package; do not fall back to shell PATH shims. |
|
|
23
27
|
| `pi_command_line_too_long` | Rendered Windows command line exceeds 32,767 UTF-16 units | Move large payload to stdin/artifact path; do not truncate argv. |
|
|
24
|
-
| Terminal metadata/output durability failure | Fsync/close/metadata write failed | Treat terminal state as failed; inspect `DurableFileError` operation/path/cause. See `docs/subsystems/child-launch-durability-and-safety.md`. |
|
|
28
|
+
| Terminal metadata/output durability failure | Fsync/close/metadata write failed | Treat terminal state as failed; inspect `DurableFileError` operation/path/cause. Same-process reload does not strengthen ordinary `.output` crash durability. See `docs/subsystems/child-launch-durability-and-safety.md`. |
|
|
25
29
|
| Delegate refuses with `delegate_hook_contract_unsupported` | Current Pi hook behavior does not match committed evidence | Re-run the hook characterization gate during release work and re-review the guard; do not weaken the guard. See `docs/operations/testing.md`. |
|
|
26
30
|
| Delegate refuses with `route_unresolved` or `route_capacity_unknown` | Requested/default route unavailable or lacks usable context window | Pin an available provider/model with declared context window; no substitute route is selected. |
|
|
27
31
|
| Delegate refuses with `seed_budget_exceeded` | Exact child prompt plus system prompt exceeds allowed input under the backed route-family policy or conservative fallback | Use a larger-context subscription route, delegate earlier, or reduce visible parent text. Nothing was clipped. |
|
package/docs/read-before-edit.md
CHANGED
|
@@ -15,19 +15,24 @@ Every production file under `src/**` and `extensions/**` has exactly one primary
|
|
|
15
15
|
|
|
16
16
|
| Source | Primary behavioral owner |
|
|
17
17
|
| --- | --- |
|
|
18
|
+
| `extensions/anthropic-attribution-child.ts` | [subsystems/anthropic-attribution](./subsystems/anthropic-attribution.md) |
|
|
18
19
|
| `extensions/anthropic-attribution.ts` | [subsystems/anthropic-attribution](./subsystems/anthropic-attribution.md) |
|
|
19
20
|
| `extensions/background-tasks.ts` | [subsystems/host-ui-and-telemetry](./subsystems/host-ui-and-telemetry.md) |
|
|
20
21
|
| `extensions/delegate-child.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
21
22
|
| `extensions/fusion-child.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
22
23
|
| `src/core/anthropic-attribution-path.ts` | [subsystems/anthropic-attribution](./subsystems/anthropic-attribution.md) |
|
|
23
24
|
| `src/core/anthropic-attribution.ts` | [subsystems/anthropic-attribution](./subsystems/anthropic-attribution.md) |
|
|
25
|
+
| `src/core/attested-pi-contract.ts` | [subsystems/attested-pi-runs](./subsystems/attested-pi-runs.md) |
|
|
24
26
|
| `src/core/attested-pi-run.ts` | [subsystems/attested-pi-runs](./subsystems/attested-pi-runs.md) |
|
|
27
|
+
| `src/core/canonical-json.ts` | [subsystems/child-launch-durability-and-safety](./subsystems/child-launch-durability-and-safety.md) |
|
|
25
28
|
| `src/core/common.ts` | [subsystems/background-task-runtime](./subsystems/background-task-runtime.md) |
|
|
29
|
+
| `src/core/config.ts` | [subsystems/host-ui-and-telemetry](./subsystems/host-ui-and-telemetry.md) |
|
|
26
30
|
| `src/core/context/parent-snapshot.ts` | [concepts/context-projection-and-budgeting](./concepts/context-projection-and-budgeting.md) |
|
|
27
31
|
| `src/core/context/token-budget.ts` | [concepts/context-projection-and-budgeting](./concepts/context-projection-and-budgeting.md) |
|
|
28
32
|
| `src/core/context/visible-conversation-v2.ts` | [concepts/context-projection-and-budgeting](./concepts/context-projection-and-budgeting.md) |
|
|
29
33
|
| `src/core/delegate/artifacts.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
30
34
|
| `src/core/delegate/budget.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
35
|
+
| `src/core/delegate/facade-contract.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
31
36
|
| `src/core/delegate/hook-contract-evidence.json` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
32
37
|
| `src/core/delegate/hook-contract.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
33
38
|
| `src/core/delegate/launch.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
@@ -45,6 +50,7 @@ Every production file under `src/**` and `extensions/**` has exactly one primary
|
|
|
45
50
|
| `src/core/fusion/config.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
46
51
|
| `src/core/fusion/context.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
47
52
|
| `src/core/fusion/evaluation.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
53
|
+
| `src/core/fusion/facade-contract.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
48
54
|
| `src/core/fusion/orchestrator.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
49
55
|
| `src/core/fusion/output-contract.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
50
56
|
| `src/core/fusion/pi-child.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
@@ -54,8 +60,12 @@ Every production file under `src/**` and `extensions/**` has exactly one primary
|
|
|
54
60
|
| `src/core/fusion/types.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
55
61
|
| `src/core/fusion/web-fetch.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
56
62
|
| `src/core/fusion/workflows.ts` | [subsystems/fusion](./subsystems/fusion.md) |
|
|
63
|
+
| `src/core/lazy-module.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
57
64
|
| `src/core/pi-launch.ts` | [subsystems/child-launch-durability-and-safety](./subsystems/child-launch-durability-and-safety.md) |
|
|
58
65
|
| `src/core/registry.ts` | [subsystems/background-task-runtime](./subsystems/background-task-runtime.md) |
|
|
66
|
+
| `src/core/reload-shell-owner.ts` | [subsystems/background-task-runtime](./subsystems/background-task-runtime.md) |
|
|
67
|
+
| `src/core/shell-policy.ts` | [subsystems/background-task-runtime](./subsystems/background-task-runtime.md) |
|
|
68
|
+
| `src/core/task-durable.ts` | [subsystems/child-launch-durability-and-safety](./subsystems/child-launch-durability-and-safety.md) |
|
|
59
69
|
| `src/core/update-check.ts` | [subsystems/host-ui-and-telemetry](./subsystems/host-ui-and-telemetry.md) |
|
|
60
70
|
| `src/core/windows-taskkill.ts` | [subsystems/background-task-runtime](./subsystems/background-task-runtime.md) |
|
|
61
71
|
| `src/delegate-child-extension.ts` | [subsystems/delegation](./subsystems/delegation.md) |
|
|
@@ -68,34 +78,37 @@ Every production file under `src/**` and `extensions/**` has exactly one primary
|
|
|
68
78
|
|
|
69
79
|
## Public surfaces
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- `
|
|
100
|
-
|
|
101
|
-
|
|
81
|
+
| Surface | Availability | Default |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `command:bg` | `always` | yes |
|
|
84
|
+
| `command:bg-clear` | `always` | yes |
|
|
85
|
+
| `command:bg-tasks` | `always` | yes |
|
|
86
|
+
| `command:bg-update` | `always` | yes |
|
|
87
|
+
| `command:claude-cache` | `feature:attribution` | yes |
|
|
88
|
+
| `command:fusion` | `feature:fusion` | yes |
|
|
89
|
+
| `command:fusion-models` | `feature:fusion` | yes |
|
|
90
|
+
| `command:jobs` | `always` | yes |
|
|
91
|
+
| `command:kill` | `always` | yes |
|
|
92
|
+
| `command:logs` | `always` | yes |
|
|
93
|
+
| `command:tasks` | `always` | yes |
|
|
94
|
+
| `tool:bg_delegate` | `feature:delegate` | yes |
|
|
95
|
+
| `tool:bg_kill` | `always` | yes |
|
|
96
|
+
| `tool:bg_logs` | `always` | yes |
|
|
97
|
+
| `tool:bg_result` | `any(feature:delegate,feature:fusion)` | yes |
|
|
98
|
+
| `tool:bg_run` | `always` | yes |
|
|
99
|
+
| `tool:bg_run_pi_attested` | `feature:attested` | yes |
|
|
100
|
+
| `tool:bg_status` | `always` | yes |
|
|
101
|
+
| `tool:fusion_investigate` | `feature:fusion` | yes |
|
|
102
|
+
| `tool:fusion_reason` | `feature:fusion` | yes |
|
|
103
|
+
| `tool:fusion_research` | `feature:fusion` | yes |
|
|
104
|
+
| `tool:fusion_validate` | `feature:fusion` | yes |
|
|
105
|
+
| `shortcut:ctrl+alt+b` | `dock:ctrl+alt+b` | no |
|
|
106
|
+
| `shortcut:ctrl+alt+c` | `always` | yes |
|
|
107
|
+
| `shortcut:shift+down` | `dock:shift+down` | yes |
|
|
108
|
+
| `renderer:background-task-notification` | `always` | yes |
|
|
109
|
+
| `renderer:fusion-result` | `feature:fusion` | yes |
|
|
110
|
+
| `eventbus:background-task-v1` | `always` | yes |
|
|
111
|
+
| `workflow:investigate` | `feature:fusion` | yes |
|
|
112
|
+
| `workflow:reason` | `feature:fusion` | yes |
|
|
113
|
+
| `workflow:research` | `feature:fusion` | yes |
|
|
114
|
+
| `workflow:validate` | `feature:fusion` | yes |
|
|
@@ -12,13 +12,42 @@ covers_sources: []
|
|
|
12
12
|
This generated registry lists production environment-variable references, runtime paths/artifacts, schema identifiers, and status vocabularies extracted from package source. It intentionally excludes incidental source-code literals such as package metadata import paths.
|
|
13
13
|
|
|
14
14
|
<!-- pi-docs:begin name="runtime-contracts" generator="scripts/docs/generate.mjs" -->
|
|
15
|
+
### Configuration variants
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"default_dock_shortcut": "shift+down",
|
|
21
|
+
"default_features": [
|
|
22
|
+
"process",
|
|
23
|
+
"delegate",
|
|
24
|
+
"fusion",
|
|
25
|
+
"attested",
|
|
26
|
+
"attribution"
|
|
27
|
+
],
|
|
28
|
+
"dock_shortcut_values": [
|
|
29
|
+
"shift+down",
|
|
30
|
+
"ctrl+alt+b",
|
|
31
|
+
"off"
|
|
32
|
+
],
|
|
33
|
+
"feature_values": [
|
|
34
|
+
"process",
|
|
35
|
+
"delegate",
|
|
36
|
+
"fusion",
|
|
37
|
+
"attested",
|
|
38
|
+
"attribution"
|
|
39
|
+
],
|
|
40
|
+
"source": "src/core/config.ts"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
15
44
|
### Environment variable references
|
|
16
45
|
|
|
17
46
|
| Name | Access | Provenance |
|
|
18
47
|
| --- | --- | --- |
|
|
19
|
-
| `ANTHROPIC_API_KEY` | remove | `src/core/attested-pi-run.ts:
|
|
48
|
+
| `ANTHROPIC_API_KEY` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
20
49
|
| `ANTHROPIC_AUTH_TOKEN` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
21
|
-
| `ANTHROPIC_BASE_URL` | remove | `src/core/attested-pi-run.ts:
|
|
50
|
+
| `ANTHROPIC_BASE_URL` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
22
51
|
| `AZURE_OPENAI_AD_TOKEN` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
23
52
|
| `AZURE_OPENAI_API_KEY` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
24
53
|
| `AZURE_OPENAI_API_VERSION` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
@@ -26,43 +55,48 @@ This generated registry lists production environment-variable references, runtim
|
|
|
26
55
|
| `AZURE_OPENAI_DEPLOYMENT_NAME_MAP` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
27
56
|
| `AZURE_OPENAI_ENDPOINT` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
28
57
|
| `AZURE_OPENAI_RESOURCE_NAME` | remove | `src/core/fusion/pi-child.ts:100` |
|
|
29
|
-
| `ComSpec` | read | `src/core/common.ts:
|
|
30
|
-
| `OPENAI_API_KEY` | remove | `src/core/attested-pi-run.ts:
|
|
31
|
-
| `OPENAI_BASE_URL` | remove | `src/core/attested-pi-run.ts:
|
|
32
|
-
| `OPENROUTER_API_KEY` | remove | `src/core/attested-pi-run.ts:
|
|
33
|
-
| `OPENROUTER_BASE_URL` | remove | `src/core/attested-pi-run.ts:
|
|
34
|
-
| `path` | read | `src/core/common.ts:
|
|
35
|
-
| `Path` | read | `src/core/common.ts:
|
|
36
|
-
| `PATH` | read | `src/core/common.ts:
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
58
|
+
| `ComSpec` | read | `src/core/common.ts:1047`<br>`src/core/common.ts:1065` |
|
|
59
|
+
| `OPENAI_API_KEY` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
60
|
+
| `OPENAI_BASE_URL` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
61
|
+
| `OPENROUTER_API_KEY` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
62
|
+
| `OPENROUTER_BASE_URL` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
63
|
+
| `path` | read | `src/core/common.ts:963` |
|
|
64
|
+
| `Path` | read | `src/core/common.ts:963` |
|
|
65
|
+
| `PATH` | read | `src/core/common.ts:1017`<br>`src/core/common.ts:963`<br>`src/core/pi-launch.ts:425` |
|
|
66
|
+
| `PI_ANTHROPIC_ACCOUNT_CONFIG_PATH` | read | `src/core/anthropic-attribution.ts:893` |
|
|
67
|
+
| `PI_API_BASE_URL` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
68
|
+
| `PI_API_KEY` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
69
|
+
| `PI_AUTH_FILE` | remove | `src/core/attested-pi-run.ts:248`<br>`src/core/fusion/pi-child.ts:100` |
|
|
40
70
|
| `PI_BG_DELEGATE_ARTIFACT_DIR` | read, write | `src/core/delegate/launch.ts:353`<br>`src/delegate-child-extension.ts:384` |
|
|
41
71
|
| `PI_BG_DELEGATE_LAUNCH_NONCE` | read, write | `src/core/delegate/launch.ts:357`<br>`src/delegate-child-extension.ts:388` |
|
|
42
72
|
| `PI_BG_DELEGATE_SEED_PATH` | read, write | `src/core/delegate/launch.ts:354`<br>`src/delegate-child-extension.ts:385` |
|
|
43
73
|
| `PI_BG_DELEGATE_SEED_SHA256` | read, write | `src/core/delegate/launch.ts:355`<br>`src/delegate-child-extension.ts:386` |
|
|
44
74
|
| `PI_BG_DELEGATE_TASK_ID` | read, write | `src/core/delegate/launch.ts:356`<br>`src/delegate-child-extension.ts:387` |
|
|
45
|
-
| `PI_BG_DISABLE_PI_TELEMETRY` | read | `src/core/registry.ts:
|
|
46
|
-
| `PI_BG_DISABLE_UPDATE_CHECK` | read | `src/extension.ts:
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
75
|
+
| `PI_BG_DISABLE_PI_TELEMETRY` | read | `src/core/registry.ts:271` |
|
|
76
|
+
| `PI_BG_DISABLE_UPDATE_CHECK` | read | `src/extension.ts:656` |
|
|
77
|
+
| `PI_BG_DOCK_SHORTCUT` | read | `src/core/config.ts:113` |
|
|
78
|
+
| `PI_BG_FEATURES` | read | `src/core/config.ts:112` |
|
|
79
|
+
| `PI_BG_MAX_OUTPUT_BYTES` | read | `src/core/registry.ts:78` |
|
|
80
|
+
| `PI_BG_POSIX_SHELL` | read | `src/core/common.ts:1085` |
|
|
81
|
+
| `PI_BG_POSIX_SHELL_PATH` | read | `src/core/common.ts:1095` |
|
|
82
|
+
| `PI_BG_REGISTRY_URL` | read | `src/extension.ts:665` |
|
|
83
|
+
| `PI_BG_SHELL` | read | `src/core/common.ts:1042` |
|
|
84
|
+
| `PI_BG_SHELL_PATH` | read | `src/core/common.ts:1043` |
|
|
85
|
+
| `PI_CACHE_RETENTION` | read, write | `src/core/anthropic-attribution.ts:658`<br>`src/core/anthropic-attribution.ts:669`<br>`src/core/fusion/claude-cache.ts:57`<br>`src/core/fusion/pi-child.ts:273`<br>`src/core/fusion/pi-child.ts:274` |
|
|
52
86
|
| `PI_FUSION_CANDIDATE_OUTPUT_RECOVERY_PATH` | read, remove, write | `src/core/fusion/pi-child.ts:100`<br>`src/core/fusion/pi-child.ts:1879`<br>`src/fusion-child-extension.ts:599` |
|
|
53
87
|
| `PI_FUSION_RESEARCH_ENABLED` | read, remove, write | `src/core/fusion/pi-child.ts:100`<br>`src/core/fusion/pi-child.ts:1902`<br>`src/fusion-child-extension.ts:608` |
|
|
54
88
|
| `PI_FUSION_SOURCE_POLICY_PATH` | read, remove, write | `src/core/fusion/pi-child.ts:100`<br>`src/core/fusion/pi-child.ts:1903`<br>`src/fusion-child-extension.ts:555` |
|
|
55
89
|
| `PI_FUSION_SOURCE_POLICY_SHA256` | read, remove, write | `src/core/fusion/pi-child.ts:100`<br>`src/core/fusion/pi-child.ts:1904`<br>`src/fusion-child-extension.ts:556` |
|
|
56
90
|
| `PI_FUSION_TOOL_CALL_LOG_PATH` | read, remove, write | `src/core/fusion/pi-child.ts:100`<br>`src/core/fusion/pi-child.ts:1891`<br>`src/fusion-child-extension.ts:598` |
|
|
57
91
|
| `PI_MODEL` | remove | `src/core/delegate/launch.ts:330`<br>`src/core/fusion/pi-child.ts:100` |
|
|
58
|
-
| `PI_OFFLINE` | read | `src/extension.ts:
|
|
92
|
+
| `PI_OFFLINE` | read | `src/extension.ts:657` |
|
|
59
93
|
| `PI_PROVIDER` | remove | `src/core/delegate/launch.ts:330`<br>`src/core/fusion/pi-child.ts:100` |
|
|
60
94
|
| `PI_REASONING_LEVEL` | remove | `src/core/delegate/launch.ts:330`<br>`src/core/fusion/pi-child.ts:100` |
|
|
61
95
|
| `PI_SESSION_FILE` | remove | `src/core/delegate/launch.ts:330`<br>`src/core/fusion/pi-child.ts:100` |
|
|
62
96
|
| `PI_SESSION_ID` | remove | `src/core/delegate/launch.ts:330`<br>`src/core/fusion/pi-child.ts:100` |
|
|
63
97
|
| `PI_SKIP_VERSION_CHECK` | write | `src/core/delegate/launch.ts:352`<br>`src/core/fusion/pi-child.ts:272` |
|
|
64
|
-
| `PIPELINE_ANTHROPIC_ATTRIBUTION_AUDIT_PATH` | read | `src/core/anthropic-attribution.ts:
|
|
65
|
-
| `SHELL` | read | `src/core/common.ts:
|
|
98
|
+
| `PIPELINE_ANTHROPIC_ATTRIBUTION_AUDIT_PATH` | read | `src/core/anthropic-attribution.ts:1170` |
|
|
99
|
+
| `SHELL` | read | `src/core/common.ts:1102` |
|
|
66
100
|
| `SystemRoot` | read | `src/core/windows-taskkill.ts:96` |
|
|
67
101
|
| `WINDIR` | read | `src/core/windows-taskkill.ts:101` |
|
|
68
102
|
|
|
@@ -70,7 +104,7 @@ This generated registry lists production environment-variable references, runtim
|
|
|
70
104
|
|
|
71
105
|
| Kind | Path/artifact | Provenance |
|
|
72
106
|
| --- | --- | --- |
|
|
73
|
-
| config | `fusion-models.json` | `src/core/fusion/config.ts:
|
|
107
|
+
| config | `fusion-models.json` | `src/core/fusion/config.ts:22` |
|
|
74
108
|
| delegate-artifact | `budget-plan.json` | `src/core/delegate/artifacts.ts:44` |
|
|
75
109
|
| delegate-artifact | `child-prompt.txt` | `src/core/delegate/artifacts.ts:48` |
|
|
76
110
|
| delegate-artifact | `context-omission-ledger.json` | `src/core/delegate/artifacts.ts:43` |
|
|
@@ -80,49 +114,49 @@ This generated registry lists production environment-variable references, runtim
|
|
|
80
114
|
| delegate-artifact | `result.json` | `src/core/delegate/result-package.ts:28` |
|
|
81
115
|
| delegate-artifact | `seed.json` | `src/core/delegate/artifacts.ts:42` |
|
|
82
116
|
| delegate-artifact | `spill/<receipt-named-file>` | `src/core/delegate/artifacts.ts:54` |
|
|
83
|
-
| directory | `.pi/delegate/<session-id>-<pid>/<task-id>/` | `src/core/delegate/artifacts.ts:
|
|
84
|
-
| directory | `.pi/fusion/<session-id>-<pid>/<run-id>/` | `src/core/fusion/artifacts.ts:
|
|
85
|
-
| directory | `.pi/tasks/<session-id>-<pid>/` | `src/core/registry.ts:
|
|
117
|
+
| directory | `.pi/delegate/<session-id>-<pid>/<task-id>/` | `src/core/delegate/artifacts.ts:161` |
|
|
118
|
+
| directory | `.pi/fusion/<session-id>-<pid>/<run-id>/` | `src/core/fusion/artifacts.ts:568` |
|
|
119
|
+
| directory | `.pi/tasks/<session-id>-<pid>/` | `src/core/registry.ts:1266` |
|
|
86
120
|
| fusion-artifact | `<attempt-prefix> = candidate-<slot>.attempt-<n> \| evaluation.attempt-<n> \| merge.attempt-<n>` | `src/core/fusion/artifacts.ts:248` |
|
|
87
121
|
| fusion-artifact | `<attempt-prefix>.calibration-violation.json` | `src/core/fusion/artifacts.ts:263` |
|
|
88
|
-
| fusion-artifact | `<attempt-prefix>.events.jsonl` | `src/core/fusion/artifacts.ts:
|
|
89
|
-
| fusion-artifact | `<attempt-prefix>.prompt.txt` | `src/core/fusion/artifacts.ts:
|
|
90
|
-
| fusion-artifact | `<attempt-prefix>.stderr.txt` | `src/core/fusion/artifacts.ts:
|
|
91
|
-
| fusion-artifact | `blind-candidates.json` | `src/core/fusion/artifacts.ts:
|
|
92
|
-
| fusion-artifact | `budget-plan.json` | `src/core/fusion/artifacts.ts:
|
|
122
|
+
| fusion-artifact | `<attempt-prefix>.events.jsonl` | `src/core/fusion/artifacts.ts:805` |
|
|
123
|
+
| fusion-artifact | `<attempt-prefix>.prompt.txt` | `src/core/fusion/artifacts.ts:804` |
|
|
124
|
+
| fusion-artifact | `<attempt-prefix>.stderr.txt` | `src/core/fusion/artifacts.ts:806` |
|
|
125
|
+
| fusion-artifact | `blind-candidates.json` | `src/core/fusion/artifacts.ts:713` |
|
|
126
|
+
| fusion-artifact | `budget-plan.json` | `src/core/fusion/artifacts.ts:709` |
|
|
93
127
|
| fusion-artifact | `candidate-<slot>.attempt-<n>.response.md \| candidate-<slot>.attempt-<n>.response.partial.md` | `src/core/fusion/artifacts.ts:258` |
|
|
94
|
-
| fusion-artifact | `candidate-<slot>.attempt-<n>.tool-calls.jsonl` | `src/core/fusion/artifacts.ts:
|
|
128
|
+
| fusion-artifact | `candidate-<slot>.attempt-<n>.tool-calls.jsonl` | `src/core/fusion/artifacts.ts:628` |
|
|
95
129
|
| fusion-artifact | `candidate-<slot>.attempt-<n>.tool-calls.jsonl.seal.json` | `src/core/fusion/child-protocol.ts:22` |
|
|
96
|
-
| fusion-artifact | `canonical-input.json` | `src/core/fusion/artifacts.ts:
|
|
97
|
-
| fusion-artifact | `context-omission-ledger.json` | `src/core/fusion/artifacts.ts:
|
|
98
|
-
| fusion-artifact | `error.json` | `src/core/fusion/artifacts.ts:
|
|
130
|
+
| fusion-artifact | `canonical-input.json` | `src/core/fusion/artifacts.ts:679` |
|
|
131
|
+
| fusion-artifact | `context-omission-ledger.json` | `src/core/fusion/artifacts.ts:688` |
|
|
132
|
+
| fusion-artifact | `error.json` | `src/core/fusion/artifacts.ts:738` |
|
|
99
133
|
| fusion-artifact | `evaluation.attempt-<n>.response.txt \| evaluation.attempt-<n>.response.partial.txt` | `src/core/fusion/artifacts.ts:258` |
|
|
100
134
|
| fusion-artifact | `evaluation.json` | `src/core/fusion/artifacts.ts:383` |
|
|
101
135
|
| fusion-artifact | `merge.attempt-<n>.response.md \| merge.attempt-<n>.response.partial.md` | `src/core/fusion/artifacts.ts:258` |
|
|
102
136
|
| fusion-artifact | `merged.md` | `src/core/fusion/artifacts.ts:387` |
|
|
103
|
-
| fusion-artifact | `result.json` | `src/core/fusion/artifacts.ts:
|
|
104
|
-
| fusion-artifact | `source-policy.private.json` | `src/core/fusion/artifacts.ts:
|
|
105
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.attestation.json` | `src/core/attested-pi-run.ts:
|
|
106
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.json` | `src/core/registry.ts:
|
|
107
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.output` | `src/core/registry.ts:
|
|
108
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.pi-events.jsonl` | `src/core/attested-pi-run.ts:
|
|
109
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.pi-telemetry-wrapper.cjs` | `src/core/attested-pi-run.ts:
|
|
110
|
-
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.stderr` | `src/core/attested-pi-run.ts:
|
|
137
|
+
| fusion-artifact | `result.json` | `src/core/fusion/artifacts.ts:652` |
|
|
138
|
+
| fusion-artifact | `source-policy.private.json` | `src/core/fusion/artifacts.ts:695` |
|
|
139
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.attestation.json` | `src/core/attested-pi-run.ts:979` |
|
|
140
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.json` | `src/core/registry.ts:1456` |
|
|
141
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.output` | `src/core/registry.ts:1455` |
|
|
142
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.pi-events.jsonl` | `src/core/attested-pi-run.ts:976` |
|
|
143
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.pi-telemetry-wrapper.cjs` | `src/core/attested-pi-run.ts:978` |
|
|
144
|
+
| task-file | `.pi/tasks/<session-id>-<pid>/<task-id>.stderr` | `src/core/attested-pi-run.ts:977` |
|
|
111
145
|
|
|
112
146
|
### Schema identifiers
|
|
113
147
|
|
|
114
148
|
| Schema | Provenance |
|
|
115
149
|
| --- | --- |
|
|
116
|
-
| `phase2.pi_task_attestation.v1` | `src/core/attested-pi-run.ts:
|
|
150
|
+
| `phase2.pi_task_attestation.v1` | `src/core/attested-pi-run.ts:39` |
|
|
117
151
|
| `pi-background-tasks.delegate-budget-plan.v3` | `src/core/delegate/types.ts:21` |
|
|
118
152
|
| `pi-background-tasks.delegate-child-terminal.v1` | `src/delegate-child-extension.ts:584` |
|
|
119
153
|
| `pi-background-tasks.delegate-hook-contract.v1` | `src/core/delegate/hook-contract.ts:15` |
|
|
120
|
-
| `pi-background-tasks.delegate-launch.v1` | `src/delegate-extension.ts:
|
|
154
|
+
| `pi-background-tasks.delegate-launch.v1` | `src/delegate-extension.ts:665` |
|
|
121
155
|
| `pi-background-tasks.delegate-ledger.v1` | `src/core/delegate/types.ts:16` |
|
|
122
156
|
| `pi-background-tasks.delegate-manifest.v2` | `src/core/delegate/types.ts:22` |
|
|
123
|
-
| `pi-background-tasks.delegate-outcome.v1` | `src/core/delegate/runner.ts:
|
|
157
|
+
| `pi-background-tasks.delegate-outcome.v1` | `src/core/delegate/runner.ts:296` |
|
|
124
158
|
| `pi-background-tasks.delegate-receipt.v1` | `src/core/delegate/types.ts:19` |
|
|
125
|
-
| `pi-background-tasks.delegate-result-view.v1` | `src/delegate-extension.ts:
|
|
159
|
+
| `pi-background-tasks.delegate-result-view.v1` | `src/delegate-extension.ts:996` |
|
|
126
160
|
| `pi-background-tasks.delegate-result.v1` | `src/core/delegate/types.ts:18` |
|
|
127
161
|
| `pi-background-tasks.delegate-runtime-budget.v1` | `src/delegate-child-extension.ts:489` |
|
|
128
162
|
| `pi-background-tasks.delegate-seed.v2` | `src/core/delegate/types.ts:15` |
|
|
@@ -143,13 +177,13 @@ This generated registry lists production environment-variable references, runtim
|
|
|
143
177
|
| `pi-background-tasks.fusion-failure-summary.v1` | `src/core/fusion/types.ts:34` |
|
|
144
178
|
| `pi-background-tasks.fusion-input.v4` | `src/core/fusion/types.ts:14` |
|
|
145
179
|
| `pi-background-tasks.fusion-input.v5` | `src/core/fusion/types.ts:15` |
|
|
146
|
-
| `pi-background-tasks.fusion-launch.v1` | `src/fusion-extension.ts:
|
|
180
|
+
| `pi-background-tasks.fusion-launch.v1` | `src/fusion-extension.ts:1233` |
|
|
147
181
|
| `pi-background-tasks.fusion-manifest.v3` | `src/core/fusion/types.ts:23` |
|
|
148
182
|
| `pi-background-tasks.fusion-manifest.v4` | `src/core/fusion/types.ts:24` |
|
|
149
183
|
| `pi-background-tasks.fusion-merge-input.v1` | `src/core/fusion/prompts.ts:336` |
|
|
150
184
|
| `pi-background-tasks.fusion-models.v1` | `src/core/fusion/types.ts:13` |
|
|
151
|
-
| `pi-background-tasks.fusion-progress.v1` | `src/fusion-extension.ts:
|
|
152
|
-
| `pi-background-tasks.fusion-result-view.v1` | `src/delegate-extension.ts:
|
|
185
|
+
| `pi-background-tasks.fusion-progress.v1` | `src/fusion-extension.ts:49` |
|
|
186
|
+
| `pi-background-tasks.fusion-result-view.v1` | `src/delegate-extension.ts:1037` |
|
|
153
187
|
| `pi-background-tasks.fusion-result.v4` | `src/core/fusion/types.ts:19` |
|
|
154
188
|
| `pi-background-tasks.fusion-result.v5` | `src/core/fusion/types.ts:20` |
|
|
155
189
|
| `pi-background-tasks.fusion-runtime-guard.v2` | `src/core/fusion/child-protocol.ts:24` |
|
|
@@ -159,6 +193,8 @@ This generated registry lists production environment-variable references, runtim
|
|
|
159
193
|
| `pi-background-tasks.fusion-validation-candidate-contract-event.v1` | `src/core/fusion/types.ts:31` |
|
|
160
194
|
| `pi-background-tasks.fusion-validation-candidate.v1` | `src/core/fusion/types.ts:18` |
|
|
161
195
|
| `pi-background-tasks.input-token-calibration.v1` | `src/core/context/token-budget.ts:18` |
|
|
196
|
+
| `pi-background-tasks.reload-shell-owner.v1` | `src/core/reload-shell-owner.ts:36` |
|
|
197
|
+
| `pi-background-tasks.reload-shell.v1` | `src/core/reload-shell-owner.ts:996` |
|
|
162
198
|
|
|
163
199
|
### Status vocabularies
|
|
164
200
|
|