Repository navigation
Conversation
added 2 commits
June 28, 2026 00:33
…rded cwd Parameterize the sandbox-cwd neutral-diff by each capture OWN recorded cwd instead of a hard-coded /app token (hosted) plus fragile system-prompt scraping (standalone). Closes the PR #26 asymmetry where the hosted /app collapsed to <CWD> but the standalone temp-dir was left verbatim, falsely diverging two equivalent runs inside the already-accepted sandbox-cwd neutral-diff category. - parity.py: _CAPTURE_CWD_KEY meta annotation drives _rule_sandbox_cwd; load_capture stamps each record cwd field; normalize_request(cwd=...) pops it before equality so it never participates in comparison. _sub_cwd still collapses ONLY the boundary-anchored cwd PREFIX, so a genuinely different write directory (src/ vs tests/) still FAILs and an unrelated longer path is not corrupted. - acp_capture.mjs / mock_upstream.mjs: record each capture own cwd (MOCK_CWD) on every logged line; hard-coded /app fallback kept for pre-cwd captures. - test_parity.py: +4 guard tests (symmetry + over-collapse, unit and e2e); 22 pass.
…e re-drive Add the first recorded standalone vanilla capture and a per-package OFFLINE guard. - tests/fixtures/vanilla.jsonl: the standalone (outside) capture of the shipped server.mjs on the write-hello.txt parity task, carrying its OWN recorded cwd so the symmetric sandbox-cwd collapse can anchor on it. - tests/test_wire_parity.py: re-drives the shipped server.mjs through one prompt against the deterministic capturing mock upstream (NO live model) and asserts byte-identical-modulo-allowlist wire parity with the fixture via assert_wire_parity + the symmetric-cwd normalizer. A fresh temp cwd each run is collapsed to <CWD> on both sides. Skips cleanly when node deps are absent (CI runs no npm ci); the fixture self-consistency test always runs. Proven load-bearing: perturbing server.mjs system prompt makes the re-driven request messages diverge from the fixture and the test FAILs (req#0/req#1 differing [messages]).
This was referenced Jun 28, 2026
Yiminnn
added a commit
that referenced
this pull request
Jun 28, 2026
…dk/ path (#28) * fix(parity): symmetric sandbox-cwd collapse via each capture own recorded cwd Parameterize the sandbox-cwd neutral-diff by each capture OWN recorded cwd instead of a hard-coded /app token (hosted) plus fragile system-prompt scraping (standalone). Closes the PR #26 asymmetry where the hosted /app collapsed to <CWD> but the standalone temp-dir was left verbatim, falsely diverging two equivalent runs inside the already-accepted sandbox-cwd neutral-diff category. - parity.py: _CAPTURE_CWD_KEY meta annotation drives _rule_sandbox_cwd; load_capture stamps each record cwd field; normalize_request(cwd=...) pops it before equality so it never participates in comparison. _sub_cwd still collapses ONLY the boundary-anchored cwd PREFIX, so a genuinely different write directory (src/ vs tests/) still FAILs and an unrelated longer path is not corrupted. - acp_capture.mjs / mock_upstream.mjs: record each capture own cwd (MOCK_CWD) on every logged line; hard-coded /app fallback kept for pre-cwd captures. - test_parity.py: +4 guard tests (symmetry + over-collapse, unit and e2e); 22 pass. * test(ai-sdk/acp): first recorded vanilla wire-parity fixture + offline re-drive Add the first recorded standalone vanilla capture and a per-package OFFLINE guard. - tests/fixtures/vanilla.jsonl: the standalone (outside) capture of the shipped server.mjs on the write-hello.txt parity task, carrying its OWN recorded cwd so the symmetric sandbox-cwd collapse can anchor on it. - tests/test_wire_parity.py: re-drives the shipped server.mjs through one prompt against the deterministic capturing mock upstream (NO live model) and asserts byte-identical-modulo-allowlist wire parity with the fixture via assert_wire_parity + the symmetric-cwd normalizer. A fresh temp cwd each run is collapsed to <CWD> on both sides. Skips cleanly when node deps are absent (CI runs no npm ci); the fixture self-consistency test always runs. Proven load-bearing: perturbing server.mjs system prompt makes the re-driven request messages diverge from the fixture and the test FAILs (req#0/req#1 differing [messages]). * test(ai-sdk): one uniform offline wire-parity test for the whole ai-sdk/ path Generalize the package-local acp wire-parity test (#27) into a single mechanism that applies identically to every ai-sdk/<agent>/ package -- "one path fix, uniform for all agents in this path". Upstream agent code is untouched; each agent contributes only fixture DATA. - skills/adaptation-parity/scripts/path_wire_parity.py: the logic, ONCE. Re-drives a package's shipped src/*/server.mjs through the deterministic mock upstream and asserts byte-identical-modulo-NEUTRAL_DIFFS wire parity vs the committed vanilla fixture, plus data-driven outcome parity vs tests/fixtures/summary.json. - ai-sdk/<agent>/tests/test_wire_parity.py: a byte-identical shim (same md5 in all 4 packages) -- no per-agent test code. - ai-sdk/package.json + lockfile: ONE shared node manifest; ESM resolves up the dir chain, so a single npm ci at ai-sdk/ provides deps for every harness server.mjs. - test-ai-sdk.yaml: add the npm ci step so the re-drive actually RUNS in CI (today it silently skips -- no committed package.json, only a local node_modules symlink). acp runs green (byte-identical re-drive; load-bearing: perturbing its system prompt fails the test). Sandbox/cloud-coupled harnesses skip with a documented reason until captured in a representative env: - harness-pi: just-bash bridges into a benchflow task cwd; a bare temp cwd has none. - harness-codex / harness-claude-code: @ai-sdk/sandbox-vercel needs Vercel cloud infra. harness-mimo keeps its own proxy-capture suite -- the right mechanism for it. --------- Co-authored-by: symphony-bot <symphony@benchflow.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the first passing recorded vanilla wire-parity fixture for
ai-sdk/acpand closes the sandbox-cwd capture asymmetry characterized in #26 by making the
collapse symmetric. After this change the standalone (vanilla) and
BenchFlow-hosted captures of the same task are byte-identical modulo the
reviewable
NEUTRAL_DIFFSallowlist — no new exception, no behavioraldivergence.
Supersedes #26. #26 recorded two static captures (
vanilla-inside.jsonl+vanilla-outside.jsonl) and a test that only diffed them, leaving the cwdasymmetry as a documented gap (the hosted
/appcollapsed to<CWD>but thestandalone temp-dir was left verbatim, so two equivalent runs falsely diverged).
This PR fixes the root cause and replaces the static diff with a live offline
re-drive guard.
What changed
1. Symmetric sandbox-cwd collapse (
skills/adaptation-parity/scripts/)parity.py: thesandbox-cwdneutral-diff is now parameterized by eachcaptures own recorded cwd (
_CAPTURE_CWD_KEYmeta annotation) instead of ahard-coded
/apptoken for one side and fragile system-prompt scraping for theother.
load_capturestamps each recordscwdfield;normalize_request(cwd=...)pops it before equality so it never participates in comparison.
_sub_cwdstillcollapses only the boundary-anchored cwd PREFIX, so a genuinely different
write directory (
src/vstests/) still FAILs and an unrelated longer pathis never corrupted (
/appdoes not turn/applicationinto<CWD>lication).acp_capture.mjs/mock_upstream.mjs: record each captures own cwd(
MOCK_CWD) on every logged line. The hard-coded/appfallback is retainedfor captures that predate cwd recording.
test_parity.py: +4 guard tests (symmetry + over-collapse, unit and e2e).2. First vanilla fixture + offline guard (
ai-sdk/acp/tests/)tests/fixtures/vanilla.jsonl: the standalone vanilla capture of the shippedserver.mjson the write-hello.txtparity task, carrying its own recorded cwd.tests/test_wire_parity.py: an OFFLINE pytest that re-drives the shippedserver.mjsthrough one prompt against the deterministic capturing mock upstream(no live model) and asserts byte-identical-modulo-allowlist wire parity with
the fixture via
assert_wire_parity+ the symmetric-cwd normalizer. Each re-driveruns in a fresh temp cwd that collapses to
<CWD>on both sides. It skips cleanlywhen the node deps are absent (CI runs no
npm ci); the fixture self-consistencytest always runs.
Test plan / evidence (run on the provisioned host)
pytest test_wire_parity.py-> 2 passed (offline re-drive + fixtureself-consistency).
server.mjssystem prompt makes there-driven request
messagesdiverge from the fixture and the test FAILs(
req#0/req#1: differing fields [messages], exit 1); restored via git.FAILs — only the boundary-anchored cwd prefix is collapsed, not a path wildcard
(
test_recorded_cwd_does_not_overcollapse_different_write_dir,test_write_directory_divergence_fails,test_app_substring_not_overcollapsed,test_cwd_replace_is_path_boundary_anchored).PYTHONPATH=. pytest test_parity.py-> 22 passed (the tooling unit testsincl. the 4 new symmetric-cwd + over-collapse tests).
node --checkclean onacp_capture.mjs,mock_upstream.mjs,server.mjs;ruff check src testsclean for the package.CI
test-ai-sdk.yamlrunspytest -q+ruff check src testsonai-sdk/**PRs anddoes not
npm ci, so the re-drive test SKIPs there while the fixture test runs;test-parity.yamlrunstest_parity.py(22 passed). No behavioral runtime code(
server.mjs) is changed — only the 4 parity-tooling scripts + the new fixtureand test.