Skip to content

Commit f582b90

Browse files
wip v28
1 parent dc641f9 commit f582b90

4 files changed

Lines changed: 162 additions & 12 deletions

File tree

BITCODE_SPEC_V28_NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ evidence only if they export the execution tree, phase/agent/generation/tool
191191
telemetry, prompt/context inputs, raw outputs, parsed/cast outputs, and exact
192192
blocked-readiness reasons.
193193

194+
The May 18 source-bound staging-testnet run closes that current harness gate:
195+
Vercel Sandbox executed the deposited ENGI revision without a source overlay,
196+
selected candidate `manual-deposit-qa`, wrote `depositorySearch` and
197+
`fitResult` roots, synthesized a `worthy_fit` AssetPack, shipped it as a
198+
GitHub pull request, and read back synchronized pipeline telemetry plus BTD
199+
range, reader BTC fee, depositor ownership, reader license, Terminal journal,
200+
ledger anchor, and crypto telemetry rows. The accepted branch/lane for this
201+
evidence is staging-testnet Supabase project `tkpyosihuouusyaxtbau`; production
202+
mainnet remains project `rinalyjfecxnmyczrpzo`.
203+
194204
## May 15 Terminal Terminology Closure
195205

196206
V28 now retires user-facing Deposit/Depositing and Read/Reading language in favor of Deposit/Depositing and Read/Reading.

BITCODE_V28_QA.md

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,67 @@ manifest-bound Deposit evidence root fixes:
16401640
`pnpm -C uapi exec tsc --noEmit --pretty false`,
16411641
`pnpm qa:v28:pipeline-readback -- --env-file .env.local --expected-host tkpyosihuouusyaxtbau.supabase.co --readback-source rest --lookback-hours 48`,
16421642
`pnpm qa:v28:pipeline-readback -- --env-file .env.local --expected-host tkpyosihuouusyaxtbau.supabase.co --readback-source db --lookback-hours 48`,
1643-
and `git diff --check`. The readback verifier commands are expected
1644-
blocked until the credential/settlement blockers above are cleared.
1643+
and `git diff --check`. That pass was correctly blocked before the
1644+
staging-testnet credential refresh and fresh no-overlay settlement run below.
1645+
1646+
2026-05-18 source-bound staging-testnet closure evidence:
1647+
1648+
- Staging-testnet Supabase is the accepted branch/lane for this gate:
1649+
`tkpyosihuouusyaxtbau`, Data API
1650+
`https://tkpyosihuouusyaxtbau.supabase.co/rest/v1/`, and DB host
1651+
`db.tkpyosihuouusyaxtbau.supabase.co`. Production-mainnet remains project
1652+
`rinalyjfecxnmyczrpzo`.
1653+
- Vercel Sandbox run `sbx_gsVSO3LCl4JvX3IT9elA2aBofg02` executed the
1654+
no-overlay source revision
1655+
`engineeredsoftware/ENGI@main@dc641f9ffd0f68caece9ed24ede30d7a5d947976`
1656+
and exported local artifacts to
1657+
`.bitcode/pipeline-harness-runs/2026-05-18T15-44-08-076Z-sbx_gsVSO3LCl4JvX3IT9elA2aBofg02/`.
1658+
- The run completed source-bound, with no source overlay, and wrote umbrella
1659+
pipeline row `13bc9a38-0f94-446f-98d7-14474d13467a` plus deliverable
1660+
stream run `c38a98cf-403e-4fc7-9c9e-ba615d4af024`. The pipeline result was
1661+
`worthy_fit`.
1662+
- Depository search selected the proof-bearing candidate `manual-deposit-qa`
1663+
from one searched deposited asset, with query root
1664+
`sha256:cd1b839c183e14e923cbb2832ff7a54207a4b6da3d744fd81e1faec60e7c1728`,
1665+
ranking root
1666+
`sha256:baacafd02e1358936de9a958df77b407f620e0304e49af56bf617b7b8d1cc6bf`,
1667+
final score `0.8837`, and embedding policy `openai
1668+
text-embedding-3-small`, 1536 dimensions, `match_deliverable_vectors`,
1669+
cosine.
1670+
- Bounded inference and stream persistence were visible in both artifacts and
1671+
database readback: the local artifact exported 702 telemetry lines, and
1672+
staging-testnet structured rows showed 695 stream events, 13 phase
1673+
delegations, 42 agent steps, 5 generation rows, and 4 structured tool rows.
1674+
The structured tool rows were `bitcode.depository.search`,
1675+
`vcs_create_branch`, `vcs_create_or_update_file`, and
1676+
`vcs_create_pull_request`; every row had sanitized input and output and no
1677+
tool error.
1678+
- Finish shipped the synthesized AssetPack as GitHub PR #6:
1679+
`https://github.com/engineeredsoftware/ENGI/pull/6`, branch
1680+
`bitcode/asset-pack-c38a98cf-403e-4fc7-9c9e-ba615d4af024`, path
1681+
`.bitcode/asset-packs/c38a98cf-403e-4fc7-9c9e-ba615d4af024.md`.
1682+
- Ledger/database readback settled asset pack
1683+
`asset-pack-c38a98cf-403e-4fc7-9c9e-ba615d4af024`: one BTD range
1684+
`[5, 6)`, one reader BTC fee row with `546` sats, `finality_state='prepared'`
1685+
and `server_custody=false`, one confirmed ledger anchor, one depositor
1686+
ownership event, one reader license, one crypto telemetry event, and four
1687+
Terminal journal rows (`asset_pack_mint`, `btc_fee_payment`,
1688+
`asset_pack_anchor`, `settlement_finalization`).
1689+
- The ownership boundary readback remained explicit: the depositor wallet owns
1690+
the minted BTD range for the deposited source evidence, while the reader
1691+
wallet pays the BTC fee and receives the read license for this Read/Fit
1692+
result. The server does not take custody of the BTC fee.
1693+
- `pnpm qa:v28:pipeline-readback -- --env-file .env.local --expected-host
1694+
tkpyosihuouusyaxtbau.supabase.co --lookback-hours 48` now reports
1695+
`ready_for_v28_result_review`. The only remaining warning is the substituted
1696+
missing generic `phase_executions` table; the current canonical structured
1697+
pipeline hierarchy is populated through
1698+
`deliverable_pipeline_phase_delegations`, agent steps, generations, and tool
1699+
executions.
1700+
- Deterministic validation no longer emits source-overlay warnings for
1701+
source-bound runs. The source-overlay warning is now present only when
1702+
overlay evidence exists in the harness input, manifest, execution context, or
1703+
`BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED=1`.
16451704
16461705
Pass 2C prompt-to-artifact closure audit:
16471706
@@ -1652,13 +1711,13 @@ Pass 2C prompt-to-artifact closure audit:
16521711
| Staging route uses real bounded inference, not deterministic bring-up or full-profile blocking. | Route preflight requires real inference, OpenAI key, `bounded`, and runtime budget `<=600000`; Terminal summarizes full-profile async blocker. | implemented and tested |
16531712
| Local application deployment can enforce the same route strictness without deploying. | `BITCODE_PIPELINE_HARNESS_REQUIRE_REAL_INFERENCE=1` makes local `next dev` require real bounded inference, OpenAI, aligned Supabase admin credentials, REST/DB host alignment, and route budget `<=600000`. `uapi/tests/api/pipelineHarnessRoute.test.ts` proves local strict failure, mixed-host failure, and strict success without live deployment. | implemented and tested |
16541713
| Operators can see sanitized preflight context before waiting on the sandbox. | SSE preflight includes Supabase host, profile, and runtime budget; Terminal stream metadata renders database/profile/budget; route-runner tests assert secret redaction in completion tails. | implemented and tested |
1655-
| A repeatable readback verifier exists for staging operators. | `pnpm qa:v28:pipeline-readback -- --env-file .env.local --expected-host tkpyosihuouusyaxtbau.supabase.co` checks sanitized REST/DB host identity, admin credential posture, REST credential rejection, pipeline telemetry tables, latest deliverable run coherence, generation/tool rows, and ledger settlement rows. `--readback-source db` can read staging rows directly. `pnpm test:qa:v28:pipeline-readback` passes 12 verifier tests. | implemented and tested; current readback is blocked by REST admin credential rejection, failed latest run, missing latest-run tool rows, and missing settlement rows until a clean no-overlay staging-testnet run writes them |
1714+
| A repeatable readback verifier exists for staging operators. | `pnpm qa:v28:pipeline-readback -- --env-file .env.local --expected-host tkpyosihuouusyaxtbau.supabase.co --lookback-hours 48` checks sanitized REST/DB host identity, admin credential posture, pipeline telemetry tables, latest deliverable run coherence, generation/tool rows, and ledger settlement rows. The 2026-05-18 source-bound run now reports `ready_for_v28_result_review`; `pnpm test:qa:v28:pipeline-readback` passes 12 verifier tests. | implemented and verified on staging-testnet |
16561715
| Deposited proof/measurement flags become manifest-bound roots before Fit evaluation. | Harness materializes deterministic proof, measurement, and reconciliation roots; focused harness test asserts root shapes. | implemented and tested |
1657-
| Search/finding produces query root, ranking root, selected candidate ids, and embedding policy. | Local overlay run selected `manual-deposit-qa` and recorded query/ranking roots with OpenAI `text-embedding-3-small`. | locally verified only |
1658-
| Model-backed telemetry records prompt/context input, raw output, usage, and parsed output for each model-backed stage. | Local overlay run exported 698 telemetry lines including `llm.input`, `llm.output`, `llm.usage`, and `llm.parsedOutput`. | locally verified only |
1659-
| Evidence tool requests from PTRR agents execute and persist tool telemetry. | Agent tool lookup now falls back to parent pipeline registries; pipeline tool lookup accepts base Tool instances; AssetPack registers `bitcode.asset-pack.verification` for evidence-only depository verification readback; tool-result events include summarized input plus output/error. Focused registry, telemetry, and AssetPack tool tests pass. | implemented and locally tested; clean staging readback must still show nonzero tool execution rows |
1660-
| Clean deployed no-overlay run writes and rereads pipeline rows from the populated staging-testnet database. | DB readback now shows latest deliverable run `b1b04a2d-0376-4200-b08c-7936076f2566` failed with 1634 deliverable events, 2 phase delegations, 16 agent steps, 72 generations, and 0 tool rows. It did not reach settlement rows. | open V28 blocker |
1661-
| Settlement writes and rereads BTD range, BTC fee, ownership/license, journal, anchor, and crypto telemetry rows. | Overlay evidence correctly remains blocked and ledger rows remain zero; no clean settlement readback has been observed. | open V28 blocker |
1716+
| Search/finding produces query root, ranking root, selected candidate ids, and embedding policy. | Source-bound staging run `13bc9a38-0f94-446f-98d7-14474d13467a` selected `manual-deposit-qa` from one searched deposited asset with query root `sha256:cd1b839c183e14e923cbb2832ff7a54207a4b6da3d744fd81e1faec60e7c1728`, ranking root `sha256:baacafd02e1358936de9a958df77b407f620e0304e49af56bf617b7b8d1cc6bf`, selected candidate ids, proof/readback roots, and OpenAI `text-embedding-3-small` vector policy. | implemented and verified on staging-testnet |
1717+
| Model-backed telemetry records prompt/context input, raw output, usage, and parsed output for each model-backed stage. | The source-bound sandbox artifact exported 702 telemetry lines; database readback showed 695 stream events, 13 phase delegations, 42 agent steps, and 5 generation rows for the latest deliverable run. | implemented and verified on staging-testnet |
1718+
| Evidence tool requests from PTRR agents execute and persist tool telemetry. | Agent tool lookup falls back to parent pipeline registries; stored `tools/*` events now also create structured tool rows. The source-bound run wrote four structured tool executions with sanitized input/output and no errors: depository search, branch creation, file upsert, and PR creation. | implemented and verified on staging-testnet |
1719+
| Clean deployed no-overlay run writes and rereads pipeline rows from the populated staging-testnet database. | Latest source-bound run `c38a98cf-403e-4fc7-9c9e-ba615d4af024` completed without source overlay and wrote/read back umbrella pipeline run `13bc9a38-0f94-446f-98d7-14474d13467a`, deliverable stream rows, phases, agent steps, generation rows, and structured tool rows. | closed for current gate |
1720+
| Settlement writes and rereads BTD range, BTC fee, ownership/license, journal, anchor, and crypto telemetry rows. | AssetPack `asset-pack-c38a98cf-403e-4fc7-9c9e-ba615d4af024` was settled with BTD range `[5, 6)`, 546 sat reader BTC fee prepared without server custody, confirmed ledger anchor, depositor ownership event, reader license, crypto telemetry, and four Terminal journal rows. | closed for current gate |
16621721
| Full-profile inference may run for dozens of minutes without route wait. | Scoped as a subsequent V28 gate requiring sandbox-pushed async completion to a server-side stream/socket handler or durable queue. The push must be run-id correlated, authenticated, idempotent, and durable before sandbox stop. | intentionally out of current gate |
16631722
| Demonstration remains a self-contained minimal Reading witness. | `protocol-demonstration/src/local-fit-finding.js` now models Need synthesis, Need acceptance, Need-Fit ranking, source-safe preview, and deterministic BTC fee quote without importing product pipeline code. `npm --prefix protocol-demonstration run test:v28-mvp-qa` passes 13 tests. | implemented and tested |
16641723
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { AssetPackValidationReadyToFinishAgent } from '../agents/validation-agents';
2+
3+
describe('AssetPackValidationReadyToFinishAgent deterministic fallback', () => {
4+
const originalOverlayFlag = process.env.BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED;
5+
6+
afterEach(() => {
7+
if (originalOverlayFlag === undefined) {
8+
delete process.env.BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED;
9+
} else {
10+
process.env.BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED = originalOverlayFlag;
11+
}
12+
});
13+
14+
it('does not warn about source overlays for source-bound runs', async () => {
15+
delete process.env.BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED;
16+
17+
const result = await AssetPackValidationReadyToFinishAgent({}, {
18+
get: jest.fn(),
19+
store: jest.fn(),
20+
});
21+
22+
expect(result.finalApproval).toBe(true);
23+
expect(result.finalWarnings).not.toContain(
24+
'Source overlay runs are QA-only until the same revision is deployed cleanly.'
25+
);
26+
expect(result.finalWarnings).toContain(
27+
'BTC fee and BTD ledger rows must be read back before settlement trust.'
28+
);
29+
});
30+
31+
it('warns about source overlays only when overlay evidence is present', async () => {
32+
const result = await AssetPackValidationReadyToFinishAgent({}, {
33+
get: jest.fn((namespace: string, key: string) => (
34+
namespace === 'harness' && key === 'sourceOverlay'
35+
? { admissibility: 'qa-only-not-source-revision-evidence' }
36+
: undefined
37+
)),
38+
store: jest.fn(),
39+
});
40+
41+
expect(result.finalWarnings).toContain(
42+
'Source overlay runs are QA-only until the same revision is deployed cleanly.'
43+
);
44+
});
45+
});

packages/pipelines/asset-pack/src/agents/validation-agents.ts

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,39 @@ const AssetPackValidationReadyToFinishAgentCore = factoryAgentWithPTRR<
134134
retry: { maxAttempts: 1 },
135135
});
136136

137+
function getStoredSourceOverlay(execution: any): unknown {
138+
const lookups: Array<[string, string]> = [
139+
['harness', 'sourceOverlay'],
140+
['pipelineHarness', 'sourceOverlay'],
141+
['manifest', 'sourceOverlay'],
142+
];
143+
for (const [namespace, key] of lookups) {
144+
try {
145+
const value = execution?.get?.(namespace, key);
146+
if (value) return value;
147+
} catch {}
148+
}
149+
return undefined;
150+
}
151+
152+
function hasSourceOverlay(input: unknown, execution: any): boolean {
153+
const rawInput = input as {
154+
sourceOverlay?: unknown;
155+
harness?: { sourceOverlay?: unknown };
156+
manifest?: { sourceOverlay?: unknown };
157+
} | null;
158+
return Boolean(
159+
process.env.BITCODE_PIPELINE_SOURCE_OVERLAY_APPLIED === '1' ||
160+
rawInput?.sourceOverlay ||
161+
rawInput?.harness?.sourceOverlay ||
162+
rawInput?.manifest?.sourceOverlay ||
163+
execution?.context?.sourceOverlay ||
164+
execution?.metadata?.sourceOverlay ||
165+
execution?.input?.sourceOverlay ||
166+
getStoredSourceOverlay(execution)
167+
);
168+
}
169+
137170
export async function AssetPackValidationReadyToFinishAgent(
138171
input: z.infer<typeof ReadyToFinishInputSchema>,
139172
execution: any
@@ -148,6 +181,12 @@ export async function AssetPackValidationReadyToFinishAgent(
148181
].filter(Array.isArray) as string[][];
149182
const finalBlockers = issueSets.flat().filter(Boolean);
150183
const finalApproval = finalBlockers.length === 0;
184+
const finalWarnings = [
185+
...(hasSourceOverlay(input, execution)
186+
? ['Source overlay runs are QA-only until the same revision is deployed cleanly.']
187+
: []),
188+
'BTC fee and BTD ledger rows must be read back before settlement trust.'
189+
];
151190
const output = {
152191
finalApproval,
153192
overallConfidence: finalApproval ? 0.88 : 0.55,
@@ -160,10 +199,7 @@ export async function AssetPackValidationReadyToFinishAgent(
160199
performanceAcceptable: true,
161200
},
162201
finalBlockers,
163-
finalWarnings: [
164-
'Source overlay runs are QA-only until the same revision is deployed cleanly.',
165-
'BTC fee and BTD ledger rows must be read back before settlement trust.'
166-
],
202+
finalWarnings,
167203
recommendation: finalApproval ? 'finish' as const : 'review' as const,
168204
summary: finalApproval
169205
? 'Deterministic validation approved AssetPack finish readiness for staging readback.'

0 commit comments

Comments
 (0)