Skip to content

Commit 8daa62a

Browse files
V48 (specification-implementation): Use Host not Harness for Host-domain APIs
Reserve "harness" for other agentic meanings. Rename Host-domain types, plans, routes, env keys, artifact paths, and UI client identifiers from Harness to Host (PipelineHost*, runHostPlan, /api/pipeline-host, .bitcode/pipeline-host, deposit-in-box host path). Historical V2x–V47 specs left unchanged.
1 parent 7b70ce2 commit 8daa62a

110 files changed

Lines changed: 1169 additions & 1151 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ BITCODE_EXECUTION_DEBUG=false
1212
BITCODE_LLM_MODEL=<default Bitcode LLM model>
1313
BITCODE_LLM_PROVIDER=<default Bitcode LLM provider>
1414
BITCODE_ASSET_PACK_REAL_INFERENCE=false
15-
BITCODE_ENABLE_PIPELINE_HARNESS_API=false
16-
BITCODE_PIPELINE_HARNESS_MAX_RUNTIME_MS=600000
15+
BITCODE_ENABLE_PIPELINE_HOST_API=false
16+
BITCODE_PIPELINE_HOST_MAX_RUNTIME_MS=600000
1717
BITCODE_LOG_FULL_PROMPTS=false
1818
BITCODE_LOG_FULL_PROMPTS_CORRELATION_IDS=
1919
BITCODE_LOG_FULL_TRACES=false

BITCODE_SPEC_V48.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Settled demand search may scan `executions` for admitted/settled AssetPack rows
398398

399399
| Method | Path | Law |
400400
|---|---|---|
401-
| POST | `/api/deposit/synthesize-options` | Auth required. Validate body (`repositoryFullName`, branch, commit, obfuscations, forcedInclusions, forcedExclusions, demand signals). Create `executions` row `running`. Register `waitUntil` continuation. Return `{ runId, status: 'dispatched' }` immediately. `maxDuration` high enough for deposit (800s class). Background: provision host → run SDIVF or sandbox harness → validate candidates → build real option synthesis → ground neediness from settled packs → persist `output` **before** completion event. Fail-closed messages on zero options / cancel / timeout. |
401+
| POST | `/api/deposit/synthesize-options` | Auth required. Validate body (`repositoryFullName`, branch, commit, obfuscations, forcedInclusions, forcedExclusions, demand signals). Create `executions` row `running`. Register `waitUntil` continuation. Return `{ runId, status: 'dispatched' }` immediately. `maxDuration` high enough for deposit (800s class). Background: provision host → run SDIVF or sandbox host → validate candidates → build real option synthesis → ground neediness from settled packs → persist `output` **before** completion event. Fail-closed messages on zero options / cancel / timeout. |
402402
| GET | `/api/deposit/demand-estimate` | Auth required. Query settled Depository packs; return `{ ok, estimate, signals }`. `estimatable:false` when corpus thin. |
403403
| GET | `/api/executions/history` | List owner runs (deposit lens filters). |
404404
| GET | `/api/executions/history/[runId]` | Full row + optional event page; support `?tail=N` for last N events. |
@@ -412,7 +412,7 @@ Dispatch must use Vercel `waitUntil` (QA F31) — bare `void` after response is
412412
| HostKind | Implementation | Law |
413413
|---|---|---|
414414
| `local` | `packages/pipeline-hosts` LocalHost + `uapi/lib/deposit-source-provisioning` | Default when `BITCODE_PIPELINE_HOST` unset. Real `git clone` of full tree; Node fs workspace; inventory `paths` + `sources` + `samples`. |
415-
| `sandbox` | `VercelSandboxPipelineHost` + asset-pack harness | When `BITCODE_PIPELINE_HOST=sandbox`. Auth: OIDC or `VERCEL_TOKEN`+team+project — fail closed if missing. Deposit boxes **`persistent: false`**. Create → run harness in-box → stop/delete. Persist `context.sandboxId` while running for cancel. Events: `sandbox-create-started`, `sandbox-created`, `command-started`, `sandbox-stopped`, `sandbox-cancelled`. |
415+
| `sandbox` | `VercelSandboxPipelineHost` + asset-pack host | When `BITCODE_PIPELINE_HOST=sandbox`. Auth: OIDC or `VERCEL_TOKEN`+team+project — fail closed if missing. Deposit boxes **`persistent: false`**. Create → run host in-box → stop/delete. Persist `context.sandboxId` while running for cancel. Events: `sandbox-create-started`, `sandbox-created`, `command-started`, `sandbox-stopped`, `sandbox-cancelled`. |
416416

417417
Inventory scope after provision: `applyInventoryScope({ inclusions: forcedInclusions, exclusions: forcedExclusions })`. Prompt path uses `projectInventoryForPrompt` (paths+samples only — never full `sources` in prompts).
418418

@@ -561,7 +561,7 @@ Rebuild order in `buildDepositRouteSession` / `DepositPageClient`:
561561
| Real option projection | `deposit-option-real-synthesis.ts` |
562562
| Policy / admission / earnings | `deposit-asset-pack-option-policy.ts`, `deposit-asset-pack-option-admission.ts`, `depositor-earning-supply-intelligence.ts` |
563563
| Settled demand | `depository-settled-demand-estimate.ts`, `uapi/lib/depository-settled-demand.ts` |
564-
| Hosts | `packages/pipeline-hosts/src/{local-host,vercel-sandbox-host,asset-pack-harness,host}.ts` |
564+
| Hosts | `packages/pipeline-hosts/src/{local-host,vercel-sandbox-host,asset-pack-host,host}.ts` |
565565
| Provisioning | `uapi/lib/deposit-source-provisioning.ts` |
566566
| Synthesize route | `uapi/app/api/deposit/synthesize-options/route.ts` |
567567
| Demand route | `uapi/app/api/deposit/demand-estimate/route.ts` |
@@ -595,7 +595,7 @@ The `/deposits` commercial surface is modular by SRP, not a single god client:
595595
Package modularization (deposit domain): depository-search, deposit option
596596
policy/admission/options/earnings/demand, depository-supply-index, and
597597
asset-packs-synthesis are split into types/helpers/builders with stable public
598-
entry paths under `@bitcode/pipeline-asset-pack/*`. Harness plan builder is
598+
entry paths under `@bitcode/pipeline-asset-pack/*`. Host plan builder is
599599
split from in-box runner templates. Agents co-locate schema/prompts/checks.
600600

601601

@@ -1173,7 +1173,7 @@ scenarios (IP seller deposits an AssetPack on `/deposits`; IP buyer reviews
11731173
fit measurements, quote basis, settlement finality, BTD rights, and
11741174
repository delivery on `/reads`; `/packs` reads back settlement, rights,
11751175
compensation, delivery, and the fail-closed repair surface), the
1176-
deterministic mock-mode harness bindings (stateful execution-history
1176+
deterministic mock-mode host bindings (stateful execution-history
11771177
journaling, VCS/auxillary mocks, browser error trap), the verification ids
11781178
covering source-connection-before-synthesis through
11791179
fail-closed-repair-surface, forbidden payload classes, source-root digests,

BITCODE_SPEC_V48_NOTES.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,19 @@ Accepted V48 architecture law (decided 2026-06-25):
213213
`runtime-inference-policy` (the profile/`shouldUsePtrr` functions),
214214
`bounded-structured-inference`, and the read-lens agents' deterministic
215215
branches; every agent resolves to its `factoryAgent*` formal executor.
216-
- **SynthesizeAssetPacks executes via the pipeline HARNESS, decoupled from the
216+
- **SynthesizeAssetPacks executes via the pipeline HOST, decoupled from the
217217
dispatching request** (Garrett, 2026-06-26). Because the pipeline always runs
218218
the full hierarchy (many LLM calls), it must not be bound to a single HTTP
219219
request's `maxDuration`. The route VALIDATES + DISPATCHES a run and returns the
220-
`runId` immediately; the harness runs the full pipeline to completion while
220+
`runId` immediately; the host runs the full pipeline to completion while
221221
source-safe telemetry streams to `execution_events`; the client detects the
222222
completion event (already streamed) and reads the persisted synthesis from the
223-
execution row `output`. Two execution hosts behind one harness interface:
223+
execution row `output`. Two execution hosts behind one host interface:
224224
**local in-process** (dev — the persistent Node server runs the dispatched
225225
pipeline as a background task) and the **Vercel Sandbox** (prod — durable
226226
isolated execution via the existing `pipeline-hosts` host). The `/deposit`
227227
synthesize-options surface stops awaiting the pipeline inline; the LLM-call
228-
timeout (QA F25) remains a per-call safety bound within the harness run.
228+
timeout (QA F25) remains a per-call safety bound within the host run.
229229
- Per-phase jobs (Garrett, 2026-06-25): **Setup** clones the repository and
230230
runs a danger-wall (safety/risk admission); **Discovery** explores the
231231
source; **Implementation** synthesizes the AssetPacks; **Validation**
@@ -422,7 +422,7 @@ Implementation status vs this model (Gate-3 build-down): the deposit pipeline no
422422
runs the canonical agents (mode propagated to the phases — F20), the measured
423423
PATCH descriptor (F-series), Obfuscations + Setup input-comprehension, neediness
424424
v0 (F24); inference is non-configurable (profiles removed — F26-A), the synthesis
425-
runs decoupled via the harness (F26-B), and the PTRR envelope is unwrapped so real
425+
runs decoupled via the host (F26-B), and the PTRR envelope is unwrapped so real
426426
output flows (F26-A/F27). The remaining Gate-3 measurement obligation is the formal
427427
**absolutes** measurement category (see the roadmap below) — the catalog grounded
428428
in `protocol-demonstration/`; the current source-coverage / demand-alignment /
@@ -481,7 +481,7 @@ thinking generations (reason and judge[-reasoning]) that precede the typed outpu
481481
(`{ phase1: { agent1: { step1: ... } ... } ... }`) — never the values.
482482
- OUTPUT: the selected KEYS. PCC's inference is a Thinkings generation against the
483483
key-selection schema — NOT the step's output schema (PCC never attempts the task).
484-
- READ-IN: the harness then reads the VALUES of exactly the selected keys from the
484+
- READ-IN: the host then reads the VALUES of exactly the selected keys from the
485485
execution state and provides them as the task context to the subsequent
486486
generations (CS, SC).
487487
2. **ChunkThenSum (CS — the input failsafe; trigger = the composed request exceeds the
@@ -582,7 +582,7 @@ become MASTER-DETAIL:
582582
routes they open; action verbs elsewhere (terminal actions, footer flow
583583
steps, docs prose) stay singular.
584584
- **Known read-gate gap:** read-lens pipeline runs dispatched through the
585-
sandbox harness do not yet persist their own lens-stamped executions rows
585+
sandbox host do not yet persist their own lens-stamped executions rows
586586
(structured mode); the /reads table lists what exists and the telemetry
587587
detail attaches to any asset-pack pipeline row, labeled by the RUN's lens.
588588
Read dispatch persistence lands with the read gate.
@@ -966,7 +966,7 @@ Validation) speaks only to the primitive, so its behavior is identical on every
966966
```
967967
@bitcode/host-generics # BitcodePipelineHost, SandboxHost
968968
→ @bitcode/generic-hosts-local # LocalHost (was InlineHost)
969-
→ @bitcode/generic-hosts-vercel-sandbox # VercelSandboxHost + harness surface
969+
→ @bitcode/generic-hosts-vercel-sandbox # VercelSandboxHost + host surface
970970
```
971971

972972
**HostKinds — two implementations of the primitive:**
@@ -987,7 +987,7 @@ deprecated alias of `local`); a SandboxHost's provider comes from
987987
`resolveDepositPipelineHost()` constructs LocalHost for hostKind `local`. The
988988
operator chooses which host runs the pipeline.
989989

990-
**Source provisioning + measurement:** the harness run provisions the full checkout on
990+
**Source provisioning + measurement:** the host run provisions the full checkout on
991991
the configured host at run start (consistent with a box being created WITH its git
992992
source — provisioning precedes the pipeline phases); the Setup clone agent then
993993
confirms source-present. The inventory is built FROM the checkout:
@@ -1051,12 +1051,12 @@ is named in spec for closure):
10511051
### Gate-3 #25 — SandboxHost in-box deposit dispatch (Garrett, 2026-06-27; cancel+auth hardened 2026-07-08)
10521052

10531053
SandboxHost deposit runs the synthesis pipeline INSIDE the box (the asset-pack
1054-
harness already runs `assetPackPipeline` in-box for read-fit via a runner that imports
1054+
host already runs `assetPackPipeline` in-box for read-fit via a runner that imports
10551055
the live packages and executes the full SDIVF). Deposit reuses that mechanism:
10561056

1057-
- **Harness deposit mode.** `buildAssetPackSandboxHarness` accepts `synthesizeMode`
1057+
- **Host deposit mode.** `buildAssetPackSandboxHostPlan` accepts `synthesizeMode`
10581058
(`'deposit' | 'read'`) + the deposit STEERING (obfuscations, protected-IP exclusions,
1059-
demand context); these flow into `PipelineHarnessManifest` and the in-box runner
1059+
demand context); these flow into `PipelineHostManifest` and the in-box runner
10601060
INPUT (`synthesizeMode`, steering). The in-box pipeline resolves deposit mode
10611061
(`resolveSynthesizeAssetPacksMode` reads `input.synthesizeMode`) and runs the deposit
10621062
SDIVF, reading the box's LOCAL checkout (the box was created WITH the git source, so
@@ -1069,17 +1069,17 @@ the live packages and executes the full SDIVF). Deposit reuses that mechanism:
10691069
pull`; automatic on Vercel); fallback `VERCEL_TOKEN` + `VERCEL_TEAM_ID` +
10701070
`VERCEL_PROJECT_ID`. `assertVercelSandboxAuthAvailable` fails closed before create.
10711071
- **Route dispatch.** When `BITCODE_PIPELINE_HOST=sandbox`, the deposit route
1072-
dispatches via `runDepositInBoxHarness``VercelSandboxPipelineHost.runHarness`
1072+
dispatches via `runDepositInBoxHost``VercelSandboxPipelineHost.runHostPlan`
10731073
instead of LocalHost provision + in-process SDIVF; it reads `evidence.depositOptions`,
10741074
runs the SAME pure projection (`validateDepositSynthesisOptions` +
10751075
`buildRealDepositAssetPackOptionSynthesis`) and persists the deposit option
10761076
synthesis. `resolveDepositPipelineHost` is **inline-only** (throws if hostKind is
1077-
sandbox — callers must use the harness path). On `sandbox-created`, the route
1077+
sandbox — callers must use the host path). On `sandbox-created`, the route
10781078
persists `context.sandboxId` on the running execution row for cancel.
10791079
- **Cooperative cancel.** See Gate-3 #26.
10801080
- **Parity of result.** LocalHost and SandboxHost produce the SAME deposit option
10811081
synthesis; only WHERE the pipeline runs differs. Real-sandbox execution is verified
1082-
against deployed sandbox infra; harness plan-building + route dispatch + projection
1082+
against deployed sandbox infra; host plan-building + route dispatch + projection
10831083
are unit-tested with a mocked host.
10841084

10851085
### Gate-3 #26 — Cooperative run cancel (Garrett, 2026-07-08)
@@ -1102,7 +1102,7 @@ Deposit (and any agentic) runs are cancelable without killing mid-token LLM stre
11021102
validate). Sandbox detached command polls call `shouldAbort` each interval and
11031103
return exit code 130 / outcome `'cancelled'`, then `sandbox.stop()`.
11041104
5. **Sandbox stop.** If `context.sandboxId` is present, cancel best-effort stops the
1105-
box via `Sandbox.get` + `stop` (in addition to harness `finally` stop).
1105+
box via `Sandbox.get` + `stop` (in addition to host `finally` stop).
11061106
6. **UI.** While a synthesis is running, Telemetry shows **Cancel run**; on success
11071107
the detail shows a Cancelled badge and analytics fires
11081108
`deposit_synthesis_cancelled` (duration only — no identifiers).
@@ -1157,15 +1157,15 @@ Parity: ✅ specified + implemented + tested · 🟦 specified + implemented as
11571157
| 22 | HostKind selection (configured, not env) | `selectDepositHostKind` / `resolveDepositPipelineHost` | depositSourceProvisioning.test ||
11581158
| 23 | full inventory (sources+samples) + fail-closed exclusions | `provisionDepositSourceInventory` / `applyExclusionsToInventory` | depositSourceProvisioning.test, asset-packs-synthesis.test ||
11591159
| 24 | deposit provisions full checkout via Host | deposit route + `LocalHost` path | depositSynthesizeOptionsRoute.test ||
1160-
| 25 | SandboxHost IN-BOX deposit dispatch (run the pipeline in the box) | harness deposit mode (`synthesizeMode` + steering → in-box runner; `depositOptions` in evidence) + `runDepositInBoxHarness` + route hostKind branch; ephemeral `persistent:false`; OIDC/token auth fail-closed | asset-pack-harness.test, depositSourceProvisioning.test, depositSynthesizeOptionsRoute.test, vercel-sandbox-host.test |* |
1160+
| 25 | SandboxHost IN-BOX deposit dispatch (run the pipeline in the box) | host deposit mode (`synthesizeMode` + steering → in-box runner; `depositOptions` in evidence) + `runDepositInBoxHost` + route hostKind branch; ephemeral `persistent:false`; OIDC/token auth fail-closed | asset-pack-host.test, depositSourceProvisioning.test, depositSynthesizeOptionsRoute.test, vercel-sandbox-host.test |* |
11611161
| 26 | Cooperative run cancel | `POST /api/executions/[runId]/cancel` + `execution-cancel.ts` + deposit route polls + sandbox `shouldAbort` + UI Cancel run + `deposit_synthesis_cancelled` analytics | executionCancelRoute.test, vercel-sandbox-host.test (abort), depositPageClient (cancel control) ||
11621162
| 27 | Run configuration locked above telemetry in run detail | `DepositPageClient` config above telemetry; `disabled` when `synthesisRunId` set | depositPageClient.test ||
11631163
| 28 | Formal absolutes fail-closed (no placeholder catalog fallback) | `validateDepositSynthesisOptions` requires `absolutes[]` | agent-measure-absolutes.test, asset-packs-synthesis.test ||
11641164
| 29 | Map-tree LLM token rollup | `sumLlmTokensFromExecutionTree` | asset-packs-synthesis-pipeline.test ||
11651165
| 30 | Full deposit SDIVF integration under test (boundary LLM mock) | `BITCODE_ENABLE_ASSET_PACK_SDIVF_RUNTIME_IN_TEST` + deposit-sdivf-pipeline-integration.test | deposit-sdivf-pipeline-integration.test ||
11661166
| 31 | Deposit implementation agent key (telemetry clarity) | `implementation:deposit-asset-pack-synthesis` | synthesize-asset-packs-phase-rosters.test ||
11671167

1168-
* = wired + unit-tested with a mocked host (harness plan-building, the dispatch, the
1168+
* = wired + unit-tested with a mocked host (host plan-building, the dispatch, the
11691169
option projection); real in-sandbox execution is verified against deployed sandbox infra.
11701170

11711171
**Gate-3 product defaults (closing wave):**
@@ -1304,15 +1304,15 @@ enforcement, tests, and clear naming targets (7 experiences + base layers).
13041304
`buildTerminalHref` until Phase 5 redirect/eradication. Deposits/reads
13051305
product pages no longer import Terminal modules except via residual
13061306
transitive deps inside relocated panels (workspace explainers, pipeline
1307-
harness client, protocol projection).
1307+
host client, protocol projection).
13081308

13091309
### Phase 5 landing (Terminal eradication)
13101310

13111311
- `/terminal` page redirects to `/packs` (query-preserving); next.config also
13121312
redirects `/terminal` and `/executions``/packs`.
13131313
- Auxillary overlay root, nav, login default, conversations, orbitals links,
13141314
OAuth mock, and handoff hrefs target `/packs`.
1315-
- Residual shared modules relocated: workspace-explainers, pipeline-harness-client,
1315+
- Residual shared modules relocated: workspace-explainers, pipeline-host-client,
13161316
transaction-route-readiness, demonstration-witness-runtime.
13171317
- `TERMINAL_ROUTE` / `buildTerminalHref` alias Packs in product-routes.
13181318
- Cockpit modules may remain as shims/dead residual under `app/terminal/` until
@@ -1446,7 +1446,7 @@ Canonical filesystem and co-location rules live in
14461446
- deposit agents → schema / prompts / checks co-located under agents/
14471447

14481448
**packages/pipeline-hosts**
1449-
- `asset-pack-harness` → constants + runners templates + plan builder
1449+
- `asset-pack-host` → constants + runners templates + plan builder
14501450

14511451
**uapi deposits**
14521452
- Option card, source field grid, aside panels, obfuscations controls
@@ -1611,13 +1611,28 @@ not provider packages.
16111611
```
16121612
@bitcode/host-generics # primitives (BitcodePipelineHost, SandboxHost)
16131613
→ @bitcode/generic-hosts-local # LocalHost (renamed from InlineHost)
1614-
→ @bitcode/generic-hosts-vercel-sandbox # VercelSandboxHost + PipelineHost harness
1615-
→ @bitcode/pipeline-hosts # AssetPack harness barrel + BC re-exports
1614+
→ @bitcode/generic-hosts-vercel-sandbox # VercelSandboxHost + PipelineHost host
1615+
→ @bitcode/pipeline-hosts # AssetPack host barrel + BC re-exports
16161616
```
16171617

16181618
HostKind `local` replaces `inline` (BITCODE_PIPELINE_HOST; `inline` accepted as alias).
16191619
Spec G3-4 tables updated to LocalHost / hostKind `local`.
16201620

1621+
## Host vocabulary: no "Harness" for Host (Garrett, 2026-07-13)
1622+
1623+
Product/runtime Host-domain identifiers no longer use the word **Harness**
1624+
(that term is reserved for other agentic meanings). Active renames include:
1625+
1626+
- `PipelineHarness*``PipelineHost*` (plan, manifest, mode, events, results)
1627+
- `runHarness``runHostPlan`
1628+
- `buildAssetPackSandboxHarness``buildAssetPackSandboxHostPlan`
1629+
- `runDepositInBoxHarness``runDepositInBoxHost`
1630+
- API route `/api/pipeline-harness``/api/pipeline-host`
1631+
- Paths `.bitcode/pipeline-harness``.bitcode/pipeline-host`
1632+
- Env: `BITCODE_*_HARNESS_*``BITCODE_*_HOST_*` / `BITCODE_PIPELINE_HOST_*` for run settings
1633+
1634+
Historical V2x–V47 specs retain prior wording.
1635+
16211636
## PTRR base Agent extraction (Garrett, 2026-07-13)
16221637

16231638
```

0 commit comments

Comments
 (0)