3.4 KiB
3.4 KiB
Implementation report for Ticket 00001KV0TJVN5
Files changed:
tests/e2e/src/lib.rs- Added a cached e2e binary provider using
OnceLock. - Preserves
YOI_E2E_BIN=<path>as the explicit override and skips the default cargo build provider in that path. - Default path runs
${CARGO:-cargo} build -p yoi --features e2e-test --bin yoifrom the workspace root, then returns the directtarget/{profile}/yoibinary path for PTY spawning. - Writes
target/e2e-artifacts/binary-provider.jsonand emits diagnostics with provider, build command, binary path, and tested-subprocess env policy. - Expanded command-failure diagnostics to include command args.
- Follow-up: isolated tested
yoisubprocess environments in bothPanelHarness::spawnand fixture setuprun_yoi_capturewithenv_clear()plus explicit allowlists only. - Follow-up: recorded env policy in
run.json,binary-provider.json, and per-fixturefixture-commands.jsonlartifacts. - Follow-up: added a regression assertion that tested-subprocess policies use
env_clear, do not allowPATH, and default-deny provider credentials (OPENAI_API_KEY,ANTHROPIC_API_KEY,GEMINI_API_KEY) and secret-like patterns. - Follow-up: relative
YOI_E2E_BINvalues are resolved against the workspace root and must exist, so tested subprocess launch does not rely onPATHlookup.
- Added a cached e2e binary provider using
tests/e2e/tests/panel.rs- Updated panel tests to use the fallible cached binary provider.
Env isolation policy:
- Cargo build provider remains a build-tool command and is not treated as the tested
yoisubprocess. - Tested
yoifixture setup commands receive only:HOME,XDG_DATA_HOME,XDG_STATE_HOME,XDG_CONFIG_HOME,YOI_POD_RUNTIME_COMMAND. - Tested
yoi panelcommands receive only: fixtureHOME,XDG_DATA_HOME,XDG_STATE_HOME,XDG_CONFIG_HOME,TERM,YOI_TUI_TEST_EVENTS,YOI_POD_RUNTIME_COMMAND, andYOI_TUI_TEST_HOLD_BACKGROUND_TASKwhen used. PATHis intentionally not passed to testedyoisubprocesses; the harness launches the already-resolved binary path directly.- Host provider credentials / token / secret-like environment variables are default-denied. Future provider/LLM E2E should use fixture providers, canned servers, or explicit test env instead of inheriting host credentials.
Validation:
cargo fmt --check— passed.git diff --check— passed.cargo check -p yoi-e2e --all-targets --features e2e— passed.cargo test -p yoi-e2e --features e2e tested_yoi_env_policy_is_env_clear_allowlist -- --nocapture— passed.unset YOI_E2E_BIN && OPENAI_API_KEY=host-secret ANTHROPIC_API_KEY=host-secret GEMINI_API_KEY=host-secret cargo test -p yoi-e2e --features e2e --test panel -- --nocapture— passed; default provider built the currentyoibinary and testedyoisubprocesses used isolated env policy artifacts. Host provider env was present for the harness but is not inherited by testedyoisubprocesses becauseenv_clear()is applied before the allowlist.YOI_E2E_BIN=/home/hare/Projects/yoi/.worktree/e2e-binary-provider/target/debug/yoi OPENAI_API_KEY=host-secret ANTHROPIC_API_KEY=host-secret GEMINI_API_KEY=host-secret cargo test -p yoi-e2e --features e2e --test panel -- --nocapture— passed; override provider path used without invoking the default cargo-build provider, and testedyoisubprocesses still used isolated env policy.
Remaining gaps:
- None known.