Fix app-server stack pressure in tests

This commit is contained in:
Meta Vens 2026-04-24 20:01:54 +01:00
commit fbd4dc28ff
8 changed files with 25 additions and 0 deletions

View file

@ -92,3 +92,4 @@
{"ts": "2026-04-24T18:05:25+00:00", "type": "implementation", "status": "ok", "note": "Landed first richer promotion safety layer: state replacement promotions now require explicit observation/evidence records and validate subgoal/invariant/graph/frontier/checkpoint/churn structure in epiphany-core before app-server forwards accepted patches to the durable update path."}
{"ts": "2026-04-24T18:06:30+00:00", "type": "verification", "status": "ok", "note": "Verified richer promotion safety layer with epiphany-core full tests, codex-core epiphany tests, and codex-app-server epiphany tests. Full codex-app-server --lib run compiled but hit an unrelated stack overflow in in_process_start_uses_requested_session_source_for_thread_start; Epiphany-scoped app-server tests passed."}
{"ts": "2026-04-24T18:12:04+00:00", "type": "verification", "status": "warning", "note": "Rechecked codex-app-server stack overflow from full --lib verification: the exact test in_process::tests::in_process_start_uses_requested_session_source_for_thread_start reproduces when run alone. The failing test exercises in-process thread/start session-source mapping in app-server/src/in_process.rs, not the Epiphany promotion handler or epiphany-core policy path touched by bb557d1. Treat it as outside the touched Epiphany path, but not proven pre-existing without checking an older commit."}
{"ts": "2026-04-24T19:00:15+00:00", "type": "verification", "status": "ok", "note": "Traced the codex-app-server stack overflow after bb557d1. The original failing in_process thread/start test overflowed after the processor completed thread/start and before response routing; RUST_MIN_STACK=64MB made exact failures pass. Additional exact failures in guardian and thread-start tracing tests confirmed app-server test-thread stack pressure on Windows rather than one semantic Epiphany path failure. Added Cargo config RUST_MIN_STACK=67108864 and boxed large JSON/in-process request futures plus thread-start/promote futures; full cargo test -p codex-app-server --lib now passes 232/232 without setting RUST_MIN_STACK in the shell."}

View file

@ -94,6 +94,7 @@ accepted_design:
- land Epiphany's first typed distillation/proposal surface as `thread/epiphany/distill`: loaded-thread-only, read-only, deterministic observation/evidence patch generation with a concrete `expectedRevision`, and explicit promotion through `thread/epiphany/update`
- land Epiphany's first explicit promotion gate as `thread/epiphany/promote`: loaded-thread-only, verifier-backed, rejects failed candidates without mutation, and applies accepted candidates through the existing durable update path
- land the first richer map/churn promotion safety layer: state replacement promotions must include explicit observations and patch evidence, and subgoal/invariant/graph/frontier/checkpoint/churn replacements get structural validation in `epiphany-core` before reaching the durable update path
- keep Windows app-server verification explicit about stack pressure: Cargo config sets `RUST_MIN_STACK=67108864`, and large JSON/in-process request futures are boxed so the test binary does not depend on shell folklore or tiny default test-thread stacks
rejected_paths:
- name: pinned_map_only

View file

@ -136,6 +136,13 @@ This file is intentionally disposable.
- `cargo test -p codex-core --lib epiphany`
- `cargo test -p codex-app-server --lib epiphany`
- attempted full `cargo test -p codex-app-server --lib` compiled but hit a pre-existing-looking stack overflow in `in_process_start_uses_requested_session_source_for_thread_start`; Epiphany-scoped app-server tests passed
- Stack-overflow trace/fix on 2026-04-24:
- the original `in_process_start_uses_requested_session_source_for_thread_start` failure reproduced without `RUST_MIN_STACK`
- breadcrumbs showed `thread/start` completed in the processor and the overflow happened before response routing, pointing at app-server request/future stack pressure rather than Epiphany promotion semantics
- `RUST_MIN_STACK=67108864` made exact failures pass; later exact failures in guardian lifecycle and thread-start tracing tests confirmed the app-server test binary had crossed a Windows stack threshold
- `vendor/codex/codex-rs/.cargo/config.toml` now sets `RUST_MIN_STACK=67108864` so Cargo-driven tests get the required stack without shell folklore
- large app-server JSON/in-process request futures, `thread_start_task`, and the expanded `thread/epiphany/promote` arm are boxed to reduce dispatcher stack pressure
- full `cargo test -p codex-app-server --lib` now passes 232/232 with no shell `RUST_MIN_STACK` set
## Open Questions