From 614fd8bc93cfc842a34bb08c5c3a733353c93b55 Mon Sep 17 00:00:00 2001 From: Brummel Date: Tue, 12 May 2026 13:28:48 +0200 Subject: [PATCH] =?UTF-8?q?iter=20ms.1:=20pipeline.rs=20format!("check:=20?= =?UTF-8?q?{e}")=20=E2=86=92=20{e:#}=20preserves=20anyhow=20Caused-by=20ch?= =?UTF-8?q?ain=20in=20JSON-cohort=20feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inline pinning test in pipeline.rs constructs the same chain shape module_name_from_json produces on serde-parse failure (leaf wrapped with "parsing JSON in " context) and asserts both layers survive the formatter. RED→GREEN against the property, not against production line bytes — for a two-character fix, extracting a helper just for testability would be over-engineering. The strip_locations regex collapses \nCaused by: chains; the {:#} alternate Display joins with ': ' on one line, so the collapser is a no-op on the fixed output. AILX cohort unaffected — only the harness-side anyhow path (module rename pre-check) was dropping cause information. Harness suite: 14/14 green (was 13/13 + 1 new pin). --- .../2026-05-12-iter-ms.1.json | 12 ++++++ docs/journals/2026-05-12-iter-ms.1.md | 42 +++++++++++++++++++ docs/journals/INDEX.md | 1 + .../harness/src/pipeline.rs | 29 ++++++++++++- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 bench/orchestrator-stats/2026-05-12-iter-ms.1.json create mode 100644 docs/journals/2026-05-12-iter-ms.1.md diff --git a/bench/orchestrator-stats/2026-05-12-iter-ms.1.json b/bench/orchestrator-stats/2026-05-12-iter-ms.1.json new file mode 100644 index 0000000..7cc1bb0 --- /dev/null +++ b/bench/orchestrator-stats/2026-05-12-iter-ms.1.json @@ -0,0 +1,12 @@ +{ + "iter_id": "ms.1", + "date": "2026-05-12", + "mode": "standard", + "outcome": "DONE", + "tasks_total": 3, + "tasks_completed": 3, + "reloops_per_task": { "1": 0, "2": 0, "3": 0 }, + "review_loops_spec": 0, + "review_loops_quality": 0, + "blocked_reason": null +} diff --git a/docs/journals/2026-05-12-iter-ms.1.md b/docs/journals/2026-05-12-iter-ms.1.md new file mode 100644 index 0000000..dc1c7f7 --- /dev/null +++ b/docs/journals/2026-05-12-iter-ms.1.md @@ -0,0 +1,42 @@ +# iter ms.1 — Pipeline anyhow-chain preservation + +**Date:** 2026-05-12 +**Started from:** 8689f7a2386e0d7993609c374d91984bc28d215c +**Status:** DONE +**Tasks completed:** 3 of 3 + +## Summary + +Two-character fix at `pipeline.rs:118`: `format!("check: {e}")` → +`format!("check: {e:#}")`. Alternate-Display on `anyhow::Error` joins +the full cause chain with `: ` on one line, restoring the +`serde_json` parse-error leaf that plain Display dropped. Survives +`strip_locations` (regex only collapses `\nCaused by:` blocks). + +The bug surfaced during ms.2 planning recon: JSON-cohort feedback in +the cma.3 baseline showed uninformative top-line `"parsing JSON in +/tmp/..."` while AILX cohort saw the full `ail parse` diagnostic, an +asymmetry that flattered AILX. ms.1 lands the fix before ms.2's live +IONOS re-runs so the comparative dataset is internally consistent. + +A pinning unit test (`check_format_preserves_anyhow_chain`) asserts +both layers survive `{:#}`. Per the plan's Reviewer note, no helper +extracted for direct RED-first — two-character fix doesn't justify +the refactor. + +Test count: 14 (was 13). `cargo check` clean. + +## Concerns + +- Harness integration tests (`budget_abort`, `mock_full_run`, + `verify_references`) need `AIL_BIN` set or `ail` on PATH. The + 14-green count assumes `AIL_BIN=target/release/ail`. Pre-existing + cma.2 harness behaviour. + +## Files touched + +- `experiments/2026-05-12-cross-model-authoring/harness/src/pipeline.rs` + +## Stats + +bench/orchestrator-stats/2026-05-12-iter-ms.1.json diff --git a/docs/journals/INDEX.md b/docs/journals/INDEX.md index 8205d12..9ccb542 100644 --- a/docs/journals/INDEX.md +++ b/docs/journals/INDEX.md @@ -25,3 +25,4 @@ - 2026-05-12 — iter cma.2: harness binary + 4 tasks + reference solutions + 4 integration tests (six modules, real-pipeline preflight via verify_references, 13/13 tests green; pipeline.rs renames program file to module-name for ail check) → 2026-05-12-iter-cma.2.md - 2026-05-12 — iter cma.3: live Qwen3-Coder-Next run + DESIGN.md §Decision-6 empirical addendum + roadmap close (AILX 2/4 green vs JSON 1/4; ~98k vs ~207k tokens; single-subject scope explicit, multi-subject expansion queued as P3) → 2026-05-12-iter-cma.3.md - 2026-05-12 — audit-cma: milestone close (Cross-model authoring-form test) — architect drift fixed in 2 record-keeping items (INDEX backfill for brainstorm Step 7.5, README test-count correction); bench all-green (5 unexplained improvements on latency.explicit_at_rc not coupled to milestone, baseline left pristine) → 2026-05-12-audit-cma.md +- 2026-05-12 — iter ms.1: pipeline anyhow-chain preservation — `{e}` → `{e:#}` at `pipeline.rs:118` restores `serde_json` parse-error leaf in JSON-cohort feedback; pinning unit test added (14/14 green) → 2026-05-12-iter-ms.1.md diff --git a/experiments/2026-05-12-cross-model-authoring/harness/src/pipeline.rs b/experiments/2026-05-12-cross-model-authoring/harness/src/pipeline.rs index 693adb0..24317d8 100644 --- a/experiments/2026-05-12-cross-model-authoring/harness/src/pipeline.rs +++ b/experiments/2026-05-12-cross-model-authoring/harness/src/pipeline.rs @@ -115,7 +115,7 @@ pub fn run_pipeline( } Err(e) => { return Ok(PipelineCapture { - error: Some(format!("check: {e}")), + error: Some(format!("check: {e:#}")), stdout: String::new(), stderr: e.to_string(), }); @@ -217,3 +217,30 @@ fn run_with_timeout(bin: &Path, timeout: Duration) -> Result { std::thread::sleep(Duration::from_millis(25)); } } + +#[cfg(test)] +mod tests { + use anyhow::{anyhow, Context, Error}; + + /// Constructs the same chain shape `module_name_from_json` + /// produces on a serde-parse failure: a leaf error wrapped + /// with a "parsing JSON in " context. Asserts that the + /// format string used at pipeline.rs error-emission preserves + /// both layers. + #[test] + fn check_format_preserves_anyhow_chain() { + let leaf: Error = anyhow!("expected value at line 1 column 1"); + let chained = Err::<(), _>(leaf) + .context("parsing JSON in /tmp/x.ail.json") + .unwrap_err(); + let formatted = format!("check: {chained:#}"); + assert!( + formatted.contains("parsing JSON in /tmp/x.ail.json"), + "top-level context missing; got: {formatted}", + ); + assert!( + formatted.contains("expected value at line 1 column 1"), + "leaf cause missing; got: {formatted}", + ); + } +}