T-128: M2.0 — Baseline gate rerun on master (56b73b7e, contains M1 d52aa20b) before M2 implementation

This commit is contained in:
Studio 2026-11-30 15:11:43 -05:00
parent 904def37e2
commit 136cecf7f3

View file

@ -1,29 +1,53 @@
# Milestone M2 Baseline Verification Report (T-128 / M2.0)
**Verdict:** **GREEN (sandbox gates + full `bun test` triage clean; 0 real failures)** — pending Studio's authoritative unsandboxed `bun run build` and `bun --env-file=/home/boki/.studio/test-env/stock-bot.env test && CARGO_BUILD_JOBS=2 cargo test --workspace --lib --offline` handoff run for the 40 sandbox-boundary failures (38 `.git` worktree metadata + 2 PostgreSQL `stock_bot_safety*` env).
**Verdict:** **GREEN — Baseline verified for M2 start (0 real failures).** All 7 sandbox-runnable gates passed on `master` (`56b73b7e663d293079ab7bac264950dfa7a68b00`), all 40 sandbox `bun test` failures are verified sandbox-boundary errors (38 worktree `.git` metadata + 2 `stock_bot_safety*` PostgreSQL env), and Studio's authoritative unsandboxed runs — **Build `#1027`** (`bun run build`) and **Test `#1028`** (`bun --env-file=/home/boki/.studio/test-env/stock-bot.env test && CARGO_BUILD_JOBS=2 cargo test --workspace --lib --offline`) — passed (exit `0`) on reviewed commit `904def37e2e9cff5dce538c3d1f61ffca3594e9d`.
---
## 1. Repository Provenance
## 1. Repository Provenance & Revision Mapping
### Revisions Checked
| Role | Full SHA | Notes |
| --- | --- | --- |
| Accepted M1 commit | `d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1` | Director-accepted M1 baseline |
| `master` baseline | `56b73b7e663d293079ab7bac264950dfa7a68b00` | Base revision where all sandbox gates and full sandbox `bun test` ran |
| Reviewed report commit (`feat/m2-baseline-gates`) | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | Adds only `design/m2-baseline-report.md` on top of `56b73b7e663d293079ab7bac264950dfa7a68b00`; revision tested by Studio Build `#1027` and Test `#1028` |
### Unsandboxed Ancestry Checks (Confirmed)
| Check | Target Revision | Exit Code | Confirmed By |
| --- | --- | --- | --- |
| `git merge-base --is-ancestor d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1 56b73b7e663d293079ab7bac264950dfa7a68b00` | `master` (`56b73b7e663d293079ab7bac264950dfa7a68b00`) | `0` | Producer (plan worktree) and Reviewer |
| `git merge-base --is-ancestor d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1 904def37e2e9cff5dce538c3d1f61ffca3594e9d` | Reviewed HEAD (`904def37e2e9cff5dce538c3d1f61ffca3594e9d`) | `0` | Reviewer |
### Sandbox `git` Boundary Errors (Preserved Verbatim)
Worktree `.git` file content:
```text
gitdir: /home/boki/repos/stock-bot/.git/worktrees/slot-1
```
Because `/home/boki/repos/stock-bot/.git/worktrees/slot-1` lies outside the agent sandbox boundary, `git` commands inside the sandbox exit `128` as expected:
Because `/home/boki/repos/stock-bot/.git/worktrees/slot-1` lies outside the agent sandbox boundary, `git` commands inside the sandbox exit `128` as expected (no exit `0` was fabricated inside the sandbox):
| Command | Exit Code | Output (verbatim) |
| Command (inside sandbox) | Exit Code | Output (verbatim) |
| --- | --- | --- |
| `git rev-parse HEAD` | `128` | `fatal: gitfile does not point to a valid repository: /home/boki/.studio/worktrees/stock-bot/slot-1/.git` |
| `git merge-base --is-ancestor d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1 HEAD` | `128` | `fatal: gitfile does not point to a valid repository: /home/boki/.studio/worktrees/stock-bot/slot-1/.git` |
- **Unsandboxed provenance (confirmed by producer in the plan worktree):** `master` is at `56b73b7e` and `git merge-base --is-ancestor d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1 master` exited `0` (confirming accepted M1 commit `d52aa20bff3f5c259fb6e2bcfc2d3a78ad5224b1` is an ancestor of `master`).
- No exit `0` was fabricated for sandbox `git` commands; Studio's unsandboxed runner operates with full `.git` access.
### Which Checks Ran on Which Revision
| Verification Run | Revision | Environment | Outcome |
| --- | --- | --- | --- |
| 7 sequential sandbox-runnable gates (§2) | `56b73b7e663d293079ab7bac264950dfa7a68b00` | Agent sandbox | PASS (7/7 exit `0`) |
| Full unfiltered `bun test` triage (§3) | `56b73b7e663d293079ab7bac264950dfa7a68b00` | Agent sandbox | 3,498 pass, 125 skip, 40 fail (all sandbox-only), 0 real failures |
| Studio Build `#1027` (`bun run build`) (§4) | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | Studio unsandboxed | PASS (exit `0`) |
| Studio Test `#1028` (`bun --env-file=... test && cargo test ...`) (§4) | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | Studio unsandboxed | PASS (exit `0`) |
| Targeted 10-file sandbox re-run for individual failure names (§3) | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | Agent sandbox | Confirmed exact same 40 failures across the 10 files |
---
## 2. Sandbox-Runnable Gates (Sequential)
## 2. Sandbox-Runnable Gates (Sequential — Revision `56b73b7e663d293079ab7bac264950dfa7a68b00`)
All seven sandbox-runnable gates exited `0` with zero failures and zero warnings:
@ -39,14 +63,15 @@ All seven sandbox-runnable gates exited `0` with zero failures and zero warnings
---
## 3. Full Unfiltered Sandbox `bun test` Triage
## 3. Full Unfiltered Sandbox `bun test` Triage (Revision `56b73b7e663d293079ab7bac264950dfa7a68b00`)
- **Command:** `bun test` (complete unfiltered stdout/stderr captured and inspected from start to finish)
- **Exit Code:** `1`
- **Totals:** `3,498 pass`, `125 skip`, `40 fail`, `3 errors`, `885,783 expect() calls` across `282 files` (`57.36s`)
- **Real failures:** **`0`** (all `40` failures and `3` `beforeAll` unhandled errors are expected sandbox-boundary failures; zero tests were skipped, mocked, or deleted)
- **Skips note:** The `125 skip` count was reported by Bun from pre-existing conditional skips in the repository (e.g., suites that self-skip when PostgreSQL / service environment variables are absent in the sandbox). This task introduced **zero** test skips, mocks, or deletions.
- **Real failures:** **`0`** (all `40` failures and `3` `beforeAll` unhandled errors are expected sandbox-boundary failures).
### Failure Classification Table (10 files, 40 failures, 3 unhandled `beforeAll` errors)
### Failure Classification Summary (10 files, 40 failures, 3 unhandled `beforeAll` errors)
| Test File | Fails (+ Unhandled Errors) | Exact Error Text | Classification |
| --- | --- | --- | --- |
@ -61,16 +86,84 @@ All seven sandbox-runnable gates exited `0` with zero failures and zero warnings
| `scripts/test/benchmark-research.test.ts` | 1 | Child process exit `1`: `git failed: fatal: gitfile does not point to a valid repository: /home/boki/.studio/worktrees/stock-bot/slot-1/.git` | **(a) Expected sandbox-only** — worktree `.git` metadata outside sandbox |
| `scripts/test/audit-secrets-repo.test.ts` | 3 | Child process exit `1`: `Cannot inspect tracked files for the secret audit` (`git ls-files` blocked by worktree `.git` outside sandbox) | **(a) Expected sandbox-only** — worktree `.git` metadata outside sandbox |
### Authoritative Unsandboxed Gate (Studio Runner)
Per `studio.config.json`:
- **Build:** `bun run build`
- **Test:** `bun --env-file=/home/boki/.studio/test-env/stock-bot.env test && CARGO_BUILD_JOBS=2 cargo test --workspace --lib --offline`
### Individual Failing Test Names (All 40 Accounted For)
Studio executes both commands outside the sandbox immediately after handoff, covering the 38 `.git`-dependent tests, the 2 `stock_bot_safety*` PostgreSQL tests, and the skipped PostgreSQL suites that activate under `/home/boki/.studio/test-env/stock-bot.env`. The Rust half (`CARGO_BUILD_JOBS=2 cargo test --workspace --lib --offline`) already passed inside the sandbox (`732 passed, 0 failed, 4 ignored`).
1. **`test/integration/retained-strategy-worker.test.ts`** (15 fails; `beforeAll` failed on `git rev-parse`):
- `retained canonical strategy worker > sma_crossover exact packaged bytes match the native report and repeat identically`
- `retained canonical strategy worker > mean_reversion exact packaged bytes match the native report and repeat identically`
- `retained canonical strategy worker > a retained version executes its own bytes when the current constructor differs`
- `retained canonical strategy worker > build and retained hashes are checked before module or factory side effects`
- `retained canonical strategy worker > eligible exact single-series data and ownership are required before bundle import`
- `retained canonical strategy worker > factory identity, missing exports, thrown decisions and no-result exits fail closed`
- `retained canonical strategy worker > capture detaches all admitted inputs before the caller can mutate them`
- `retained canonical strategy worker > result parser rejects false identity, policy and statistical claims`
- `retained canonical strategy worker > typed worker rejects a malformed completed envelope: result.artifactHash = "f".repeat(64)`
- `retained canonical strategy worker > typed worker rejects a malformed completed envelope: result.build.workerSha256 = "f".repeat(64)`
- `retained canonical strategy worker > typed worker rejects a malformed completed envelope: result.financial.policy.matching.risk.feeRate = "0"`
- `retained canonical strategy worker > typed worker rejects a malformed completed envelope: result.analytics.metrics.exposureTime = null`
- `retained canonical strategy worker > typed retained results wait for successful child exit`
- `retained canonical strategy worker > alternate and source workers cannot claim the bundled worker identity`
- `retained canonical strategy worker > hard cancellation discards retained execution and the worker can be reused`
2. **`test/integration/chronological-validation-native.test.ts`** (2 fails; `git rev-parse` in strategy packaging):
- `chronological preflight slices on the authoritative native engine > each phase independently starts with initial cash, empty positions and fresh state; warmup cannot trade`
- `chronological preflight slices on the authoritative native engine > changing only the test suffix cannot change training or validation inputs, native economics or decisions`
3. **`test/integration/reproduction-comparison.test.ts`** (4 fails; `beforeAll` failed on `git rev-parse`):
- `economic_hash_parity: two actual replays ignore only admission identities and wall-clock metadata`
- `economic hash retains fees, ordered fills, decision ownership, risk, nulls and statistical facts`
- `economic hash preserves actual market-session identities and execution policy`
- `economic hash rejects mixed result/request/session identities rather than hiding them`
4. **`test/postgres/security-master-run.test.ts`** (1 fail; requires `PIPELINE_TEST_DATABASE_URL` pointing to `stock_bot_safety*`):
- `composeSecurityMasterRun -> persistSecurityMaster PostgreSQL integration > persists FB vs FB-ETF distinct listing_ids, SIVB -> SIVBQ continuity, Pass 4 conflicts (including shared left endpoint), and is idempotent on re-run`
5. **`test/postgres/security-master-export-curate-inputs.test.ts`** (1 fail; requires `PIPELINE_TEST_DATABASE_URL` pointing to `stock_bot_safety*`):
- `exportCurateInputs PostgreSQL integration (isolated stock_bot_safety_*) > exports exact TSV bytes read-only and matches across chunkSize=1 and chunkSize=5000`
6. **`scripts/test/strategy-packaging.test.ts`** (10 fails; `beforeAll` failed on `git rev-parse`):
- `offline reviewed strategy packaging > repeat packaging retains byte-identical self-contained bundles and lock bytes`
- `offline reviewed strategy packaging > source revision, dirty state, compiler and public descriptor identity are truthful`
- `offline reviewed strategy packaging > isolated bundles require no workspace, installed packages, native engine or service runtime`
- `offline reviewed strategy packaging > residual imports and require references reject instead of retaining incomplete bundles`
- `offline reviewed strategy packaging > packaging inspects generated text without importing or executing it`
- `offline reviewed strategy packaging > a bundle missing its declared factory cannot be published as a valid built-in package`
- `offline reviewed strategy packaging > sma_crossover: source and packaged decisions/checkpoints agree through entry, exit and restore`
- `offline reviewed strategy packaging > mean_reversion: source and packaged decisions/checkpoints agree through entry, exit and restore`
- `offline reviewed strategy packaging > packaged factories retain strict parameter validation and canonical aliases`
- `offline reviewed strategy packaging > CLI writes the retained package envelope and rejects unsupported options`
7. **`scripts/test/benchmark-sma.test.ts`** (1 fail; child `git` blocked by worktree `.git`):
- `sma_recorded_decision_parity verifies six shapes and actual financial/diagnostic identities`
8. **`scripts/test/benchmark-replay.test.ts`** (2 fails; child `git` blocked by worktree `.git`):
- `all tiny replay profiles pin financial expectations and distinct strategy identities`
- `canonical self-test measures real sessions and verifies repeated full-result hashes`
9. **`scripts/test/benchmark-research.test.ts`** (1 fail; child `git` blocked by worktree `.git`):
- `existing-path research benchmark > tiny native self-test records honest phases and pinned identities without timing thresholds`
10. **`scripts/test/audit-secrets-repo.test.ts`** (3 fails; `git ls-files` blocked by worktree `.git`):
- `audit:secrets passes on the real repository`
- `real-repository audit ignores inherited GIT_DIR, GIT_WORK_TREE and GIT_INDEX_FILE`
- `audit:secrets passes on the real repository when run from scripts subdirectory`
---
## 4. Read-Only M2 Planning Facts (No Config or Code Changes Made)
## 4. Authoritative Unsandboxed Gate (Studio Runner — Revision `904def37e2e9cff5dce538c3d1f61ffca3594e9d`)
Per `studio.config.json`, Studio executed both authoritative unsandboxed commands against reviewed commit `904def37e2e9cff5dce538c3d1f61ffca3594e9d` (which has identical code and tests to `master` `56b73b7e663d293079ab7bac264950dfa7a68b00`, differing only by adding `design/m2-baseline-report.md`):
| Studio Run | Revision | Exact Command | Exit Code | Result / Counts |
| --- | --- | --- | --- | --- |
| **Build `#1027`** | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | `bun run build` | `0` | **PASS** (reported passed by Studio; per-package counts not exposed in the Studio run summary) |
| **Test `#1028`** | `904def37e2e9cff5dce538c3d1f61ffca3594e9d` | `bun --env-file=/home/boki/.studio/test-env/stock-bot.env test && CARGO_BUILD_JOBS=2 cargo test --workspace --lib --offline` | `0` | **PASS** (reported passed by Studio, exercising all 38 `.git`-dependent tests, the 2 `stock_bot_safety*` PostgreSQL tests, and the Rust workspace lib tests; per-test Bun counts are not exposed in the Studio run summary, while the Rust half verified `732 passed, 0 failed, 4 ignored` on the same tree) |
This closes the authoritative gate for T-128: every failure observed in the sandbox (`40/40`) passed in Studio's unsandboxed test run `#1028`, and `bun run build` passed in Studio build `#1027`. Updating this report triggers a fresh Studio build and test run on the updated doc-only commit.
---
## 5. Read-Only M2 Planning Facts (No Config or Code Changes Made)
1. **`@modelcontextprotocol/sdk` availability and agent network allowlist:**
- `@modelcontextprotocol/sdk` is **not present** in `bun.lock` or any `package.json` (`package.json`, `apps/`, `libs/`, `tools/`).