Skip to content

feat(optimize): kind: optimization — factorial/response-surface campaigns - #302

Open
sriumcp wants to merge 496 commits into
AI-native-Systems-Research:mainfrom
sriumcp:nousko
Open

sriumcp wants to merge 496 commits into
AI-native-Systems-Research:mainfrom
sriumcp:nousko

Conversation

@sriumcp

@sriumcp sriumcp commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator

Adds kind: optimization: a campaign kind that finds the best configuration of a system's knobs, or the trade-off front across several objectives, by estimating, not searching. It works on one repo or on a harness that composes several. Each epoch is a pre-registered, content-hashed experimental policy (policy.json) that pure Python interprets with zero model calls. The model is used only for the opt-in plan and build stages, which design and author a mechanism that does not exist yet. A campaign without them makes no LLM calls at all.

Refs #120. Closes #264, #281, #303, #304, #315, #316, #317, #318, #319, #320, #321, #322, #323, #324, #325. Every issue found or filed during the nousko work is resolved here; the per-issue evidence is in §0 below. Specs: docs/superpowers/specs/2026-08-16-compiled-policy-design.md, 2026-10-15-pareto-front-design.md, 2026-10-16-mixed-level-factors-design.md, 2026-10-17-model-adequacy-design.md and 2026-10-17-certification-soundness.md. Start here: docs/optimization-authoring-quickstart.md, then docs/optimization-campaign-guide.md. For an expert reviewer: docs/optimization-expert-audit.md answers eleven expert questions (error control, robustness, misspecification, design, winner's curse, benchmarks, reproducibility, measurement validity, failures, AI-native risks, allocation), each with evidence, the tests that pin it, what the user is told, and the remaining limits.

Reviewer's question this PR answers: is kind: optimization really built to achieve the objectives of an optimization campaign? The answer below goes objective by objective. Each objective is mapped to the mechanism that delivers it and the evidence that it does. Everything cited is on the branch and covered by tests that make no live LLM calls.

0. Issues closed by this PR

Issue Resolution Evidence (tests fail on the pre-fix commit)
#315, #316 SDK ProcessError exit 143 (gateway stream drop) is transient; every other non-zero exit stays permanent. The plan/build calls share the classifier. PR #316 is merged in (784eb0c). TestSDKTransientClassification, test_a_permanent_error_escapes_unretried
#303 (1) The bundle threshold no longer reaches the watchdog (#307, regression test through dispatch()). (2) Each SDK turn runs in its own loop, which reaps its children and their process groups. (3) A per-phase wall-clock ceiling turns a hang into a counted wall_clock retry. TestLiveThresholdRegression303, TestAbortedTurnsReapChildren (pre-fix: hung), test_a_tool_process_the_child_started_is_reaped_with_it, TestPhaseWallClockResolution
#264, #281 Already fixed on main by #307 (de95d91). Added a regression test, plus nous resume --silence-threshold. TestWatchdogIgnoresBundleOverride, test_resume_silence_threshold_overrides_every_phase
#304 Under --agent sdk the reflective report goes through the SDK: final answer only, run in work_dir, at most 10 turns, best-effort. A Claude model on an OpenAI client with no OPENAI_BASE_URL and ANTHROPIC_BASE_URL set fails loudly with the fix. Limit: gate summaries keep LLMDispatcher (they get the loud error). TestReportPhaseRouting304, TestReportPhaseRoutingReviewFixes
#317, #318, #319 Fixed earlier in this PR. listed in the issue comments
#320 WP-D, delivered in full. D1: scoring core plus the opt-in design.confirm.allocate round. D2: nous plan-next. D3: the optional Optuna proposer (nous[bo]). D4: oracles and benchmark arms. D5: audit Q11. test_optimize_allocate*.py, test_optimize_planner.py, test_optimize_bo_proposer.py
#322 A process still exiting after a timeout kill is no longer a "survivor": the check waits a bounded settle period, treats ESRCH from getpgid as gone and ignores zombie-only groups. A genuinely escaped process is still caught and still fails the stage (soundness). The guide documents what nous resume reuses after a halt. test_optimize_survivor_race.py
#323 max_wall_clock_hours is campaign-wide: each run/resume is a ledger entry and the budget counts their sum; progress.json and report.json provenance.wall_clock show it. test_a_resume_continues_the_wall_clock_budget_instead_of_resetting_it (through run_campaign), test_the_wall_clock_budget_continues_across_a_resume
#324 Multi-objective confirm seats the known_valid_baseline every round (CRN-paired) and reports front_vs_baseline: per front point, the gain on each objective with simultaneous intervals and a verdict. A separate claim; front certificates unchanged (0 false with and without; coverage 936/938). test_optimize_mo_baseline.py
#325 The progress ETA states eta_confidence, prices pending rows at their own level of the cost-driving factor (unseen levels at the slowest), and gives eta_upper_bound_seconds (pending x max attempts x run_timeout_sec / slots). test_an_early_eta_is_marked_low_confidence_and_bounded, test_the_eta_prices_pending_rows_at_their_own_level
#321 All 22 items: 20 fixed, one rejected with its reason and replaced (held-factor seat flips → opt-in TOST inertness checks), and partial reuse_screen across choice slices rejected (bias). See the issue comment for item-by-item evidence. per item

1. Objectives → mechanisms → evidence

Objective Mechanism Evidence
Find the optimum, including interactions Resolution-V fractional/full factorial screen, central-composite refine, optional registered foldover (spends budget only if de-aliasing could change the answer). The answer is an argmax over the enumerated candidate space, including choice factors, never a stationary point. 16 single-objective and 8 multi-objective synthetic oracle surfaces with known optima (orchestrator/optimize/synthetic.py), each named for a real past failure: saddle, interaction_only, choice_x_numeric, bowl_out_of_hull, …
Scale to any number of knobs No knob count forces a full factorial. The screen is a regular fraction built from design theory: textbook generators for 5–8 knobs, and above that a constructed design. Resolution III uses the saturated design, which is optimal. Resolution IV uses the even (folded-over) design, also optimal. Resolution V uses columns no four of which multiply to the identity, matching the smallest known regular design up to 30 knobs. Refine's composite uses a resolution-V cube from 5 knobs. The candidate search is exact up to 50,000 candidates; above that it is a seeded search (measured configurations, a uniform sample, multi-start coordinate ascent), recorded as candidate_space in recommendation.json and noted in report.md. The --liveness preview names the design, compares it with the smallest known, and prices a resolution-IV screen. Every constructed design's resolution is re-read off its own matrix (k ≤ 24); run counts are checked to 100 knobs. Screen corners: 16 knobs at res V = 256 (was 65,536), res IV = 32. End to end on a sparse surface: 12 knobs 4.6 s, 16 knobs 8.3 s, 24 knobs 57 s, each at the exact optimum. Before this change, 6 knobs took 74 s and 7 did not finish in 9 minutes. Under the cap, 192 campaigns are byte-identical.
Map the trade-off front when there is no single objective response.objectives (≥ 2, each maximize/minimize, ε per objective). Every objective is fitted on the same design; each fitting stage writes a predicted front. Confirm seats the measured and predicted extremes, the preferred point and spread points, then a registered confirm → confirm gap-fill branch (Bonferroni over rounds) fills the widest resolvable gap. The measured front carries a status per point (confidently_nondominated / possibly_dominated), claimed simultaneously at δ_t (α = δ/(N(N−1)K)). preference (knee / weights / lexicographic) picks one point from the whole measured front; it is certified only if it is confidently nondominated and its scalarised terminal regret is ≤ ε. Hypervolume is exact for K = 2 and K = 3. 8 Pareto oracle surfaces scored against exhaustive enumeration, including pareto_convex_min (a minimised cost), pareto_concave, pareto_choice_split, pareto_noisy (noise ≈ ε) and pareto_three_noisy: 0 confident points off the true front, 0 false certificates, with stated hypervolume floors. A 20-mutation sweep (sign, weights, Bonferroni levels, refill, report) now kills 19; the survivor is an equivalent mutant. Single-objective campaigns: 288 runs byte-identical before and after.
Answer at a boundary, not abandon the epoch When refine's fitted optimum lies past a declared edge, the default policy.out_of_hull: confirm confirms the best configuration inside the ranges. report.json records boundary_optimum (the axes, plus certificate_scope: declared_ranges), and the next-epoch advice gives runnable levels: on the grid, inside the domain, and deferring to measured marginal means when they peak inside the range. It says to pin a knob at its edge when the edge is a hard limit. end_epoch keeps the strict exception. bowl_out_of_hull (peak A=30, declared [2, 16]) now confirms A=16 on every seed, instead of ending with one unreplicated row. Same on the real gopack campaign.
…subject to constraints (SLAs, budgets) response.constraints mark rows infeasible. Constraint metrics are fitted on the same design, and only confidently infeasible candidates (one-sided bound at δ/C) leave the ranking. Infeasible rows still inform the primary fit. Feasibility is judged per configuration, not per row. infeasible_corner_interior / stochastic_constraint_boundary surfaces. On the constrained bowl (16 seeds): aborts 4→0, certified 0→3. A real campaign seated 0 infeasible finalists after the fix vs 2 of 3 before.
Detect a model that does not fit Refine adds off-lattice validation points: an inner ring at ±0.5 and an outer ring at ±0.8, seeded maximin, snapped onto levels_only lattices. They are tested against the model's predictions with a joint predictive F. Each adequacy test is a per-test veto (a Holm family over them is recorded as information). Adequacy is sticky for the epoch, and an UNKNOWN verdict is never promoted to adequate. Screen → refine routes whenever a refinable factor exists, and a screen-only global claim with two or more refinable factors withholds model_class_unchecked. D-, G- and I-efficiency are reported. False certificates on the WP-B oracle (288 campaigns): 0 in every arm. A masked-saddle surface that certified falsely 6–12 times in 40 before the routing fix now certifies falsely 0 times in 40. The outer ring catches corner bumps the inner ring misses (4/4 vs 0/4). The per-test size on a true quadratic is 0.068–0.072.
Handle every kind of knob Multi-level categoricals by the method of replacement (Addelman; Wu & Hamada): pseudo-factor columns with the resolution counted in factors, L−1 contrasts, a Wald F test, exact covariance, least-squares means; the level-space full factorial is used when it is smaller. levels_only numeric knobs run only at their declared levels. Centre points cycle every categorical level, so curvature is tested under each. A level lost to failed runs is refitted around and never recommended. Oracles: a middle-best 3-level categorical found 8/8 (was never run); 4-level × numeric, 5-level with a constraint, and a mixed campaign of all three knob kinds each recommend the true optimum on 8/8 seeds. 7 review rounds; spec 2026-10-16-mixed-level-factors-design.md.
Fit what was actually run, on the right scale The design matrix is coded from the levels that ran, so clamped axial points and choice-factor centre rows are coded where they actually were. scale: log codes geometric knobs (sizes, batches, intervals) in log space; rule 25 warns when levels look geometric. Aliases are collapsed per alias class. Lack of fit is tested against pure error. Curvature detected by the centre points routes the screen to refine even when no main effect survives, and no certificate is issued on a rejected model. False lack-of-fit rejections at α=0.05, before→after: additive 12/12→1/12, choice_x_numeric 6/6→0/6. On geometric_knob, linear coding certified an answer 26% off on 8 of 8 seeds; now it never certifies it, and scale: log finds the exact optimum. Certificates that were wrong (true gap >2%) across all 15 surfaces × 8 seeds: 16 → 0. Cost: about α of correctly modelled campaigns lose a certificate.
Know how good the answer is A certificate claims Pr(certified and the answer is more than ε below the best configuration in scope) ≤ δ_screen + δ_terminal (+ δ_constraint, + δ_feasibility when registered), under the stated assumptions. It is issued only when both halves hold. The model half bounds the candidates not on the shortlist, using the smaller of Bonferroni and Scheffé (fixed before data), the exact (X'X)⁻¹ for every non-orthogonal fit, and interval branch-and-bound over searched spaces. The terminal half takes the worse of a t bound and a robust bound (exact or Monte-Carlo sign-flip under CRN, bootstrap-t otherwise) on fresh finalist replicates. It is α-spent across confirm looks and needs a replicate floor (6 at the defaults); a skewness pretest and a Brown–Forsythe check veto it. Multi-objective fronts get a per-objective Scheffé model half. An opt-in post-selection validation block gives fresh, unbiased estimates. A charged campaign-wide budget binds across epochs. An unknown is never a zero. Noise sweep (1008 campaigns: Gaussian, t(3), skewed, heteroscedastic, outliers): 0 false certificates. Robust terminal family: all 96 measured cells ≤ δ + 2 SE on fresh seeds. Allocate round: 0 false in 101 (one-sided CP95 0.029). Model half after the covariance fix: 0.020–0.039 against δ = 0.05, where it was 0.065–0.109 on fits that lost rows. Documented limit: under strong heteroscedasticity (h ≥ 8) the model half's conditional miss is 0.317, with 0 false certificates end to end. Specs and docs/optimization-expert-audit.md.
Use the confirm budget on configurations that can win A supported-feasible shortlist seat, plus a registered refill branch: when finalists are measured infeasible and fewer than two admissible ones remain, one extra round re-seats candidates whose nearest measured neighbour was admissible. A refill round never certifies (shortlist_refilled), and a certificate needs a measured feasible rival (no_feasible_rival). sla, seeds 1–8: from one feasible finalist to at least two; the answer moves from 1.2 to 0.4 below the constrained optimum, with 0 false certificates. Measured on 5 constraint surfaces: the alternative rule (caveat instead of veto) certified truly inadmissible configurations, so it was rejected and pinned by a test.
Always act A fallback ladder in report.json: certified → terminal_best → model → measured → baseline → none. The rung is recorded as recommendation.basis and never hidden. report.md, gate summaries, and the deployment verdict in meta_findings.json are rendered from report.json with zero tokens, so the three cannot disagree.
Generalize response.held_out metrics are split off the response structurally, never fitted, ranked or certified on, and reported per recommended configuration and finalist. Metamorphic test: shifting the held-out metric by a constant moves its reported mean by exactly that amount and changes no decision.
Measure the system that was pre-registered Hard gates, regardless of auto-approve: correctness relations; locked_parameters through locked_observables (an unenforceable lock is an error unless acknowledged); drift of the policy hash, the mechanism patch and the adapter contract; design fidelity; held-out leakage; build oracles. A failed gate halts the campaign; a pre-epoch stage is never skipped. tests/test_optimize_campaign_halts_on_gates.py drives the real run_campaign against a real subprocess target. 82 registered invariants (docs/optimization-invariants.md).
Trust what an AI build agent wrote Verification and every epoch measurement run in a private clean tree: the pre-build commit's objects plus the recorded mechanism patch only, sharing nothing with the agent's .git. Gate records are HMAC-sealed outside the repo. Every target command runs in its own session and is reaped (setsid descendants included). Authored tests must discriminate the mechanism (a revert mutant and a stub-body mutant). The import probe refuses an interpreter that imports from the agent's repo, with exec-exact resolution. Preconditions are checked before any token is spent. Seven adversarial review rounds; every reported attack (forged records, planted hooks, skip-worktree, planted .pyc, symlink copy-back, env PATH, pytest -s) has a test that fails without the fix. An honest end-to-end build certifies the true optimum. The guide's security claims are pinned by a test that catches 9/9 drifts.
Reproduce and compare report.json records provenance: Nous version, source digest, every input hash, analysis constants, waivers, the served model ID, and an external anchor of the pre-registration, which is create-only and refuses re-anchoring after data. It also records a cross-epoch error budget. The run order is concealed by a recorded salt. nous reanalyze re-derives every fitted artifact from the recorded rows and diffs them. A matched-budget benchmark compares Nous with RS, LHS, a fitted GP-BO and ParEGO. Reanalysis is identical across the full stack: anchor, salt, held-out seeds, allocate, an accepted plan-next and a second epoch. Benchmark (docs/benchmarks/optimization-benchmark.md, final code, metric pre-declared): 0 false certificates in every arm. Against GP-BO: shipped family −0.057 [−0.066, −0.039] (resting on one surface, labelled post hoc); non-quadratic family inconclusive; GP-BO slightly ahead on many-knob. ParEGO beats Nous on multi-objective fronts. The stricter certification costs runs and certificates against the previous run; see the doc.
Spend almost no tokens The epoch is tokenless. plan and build run under a bounded retry budget with a live silence watchdog, and every attempt's cost is logged. Field runs below: 0 calls on the tuning campaigns; one plan plus one build call when a mechanism had to be authored.
Be easy to author right the first time (often by Claude) nous create-campaign --kind optimization (with --adapter-stub), a short quickstart, and validation that reports every problem in one pass, ending in a single next: line. --smoke runs the real contract and understands tests the build will author. --liveness measures the noise floor and prints a design preview: runs per stage, ETA, and ε vs the screen's MDE. tests/test_optimization_authoring.py runs the real CLI against a temp target. The preview's run counts are cross-checked against what a campaign actually runs.

2. Field evidence (real targets, real nous run)

Target Shape Result
BLIS / inference-sim, window scheduler (earlier on this branch) plan + build + 4-factor epoch Certified +2.37% (R_t 24,256 ≤ ε 65,032, CRN-paired 4/4), $27 total, epoch tokenless
3b1b/manim, dirty tracking (earlier) build arms vs reflective optimization $7–13 vs reflective $71; the optimization arm's answer was certified; reflective found a better implementation (motivated the plan stage)
simonw/sqlite-utils, bulk insert (this update) 4 factors, SLA constraint (max write stall ≤10 ms), held-out query rate, 0 tokens First run: ε=0 and a false NaN exception. Final run: certified, batch 4388 / 64 MB cache / WAL / sync off at 207.8k rows/s (baseline about 172k), every replicate within the SLA, 0 warnings
grantjenks/python-diskcache, authored mechanism (this update) plan + build a new access_update_interval setting (sampled LRU/LFU access-metadata writes), then tune, then two narrowing epochs $5.92 total (plan $1.73, build $4.19); each epoch $0. All 5 relation tests pass, and the control baseline is unchanged (Δ3.4% vs a 9% tolerance, CRN-paired). The mechanism works: LRU with N≥4 reaches 1.65–2.4× ops per CPU-second. Every such interval sits on or below the declared hit-rate floor (0.805), so the honest answer under that constraint is N=1. The first run, before today's fixes, exposed the gate bypass (F18) and the plan rejection (F14)
batchsim (synthetic-but-real CLI e2e, this update) 4 factors, SLA, held-out, 0 tokens Answer 1165.2 vs true constrained optimum 1165.7 (regret 0.5 ≪ ε 11.7)
edgecache = cachetools + sortedcontainers + tinydb (3 GitHub repos, one harness) 5 factors, a durability constraint, held-out scan rate, commits locked Feasible-seat fix: answer improved 5575 → 5823 ops/cpu-s; regression run on the final code 5774 (within ε = 173), 0 tokens
gopack = goccy/go-json + klauspost/compress (Go, replace directives; GOGC/GOMAXPROCS as env vars) 5 factors, RSS ≤ 60 MiB, two epochs Epoch 1 exposed the boundary, resume, winner's-curse and cross-epoch defects (F35–F39 below). Epoch 2 followed the report's advice: 125.7 MB/cpu-s, CRN-paired, 0 tokens
Pareto: gopack-front (Go, 2 repos) throughput ↑ vs peak RSS ↓, 4 knobs, 88 runs Front from 146.1 MB/cpu-s at 63.8 MiB to 117.9 at 44.2 MiB. Knee: BATCH=1581, GOGC=1600, PROCS=7 = 134.1 at 46.0 MiB (−8% throughput for −28% memory). With about 40 measured configurations and 4 replicates, no point reached confidently_nondominated under the simultaneous correction; the report says so and says how to resolve it. 0 tokens
Pareto: packstore-front = msgpack + python-zstandard (2 repos) throughput ↑ vs compression ratio ↑, 6 knobs, 114 runs 9-point front from 18.4 MB/cpu-s at ratio 2.99 to 9.6 at 3.79, 2 confidently nondominated. Knee: level 19, window log 26, dfast, single floats = 17.1 at ratio 3.42; hypervolume 0.569. 0 tokens
Pareto: rendersvc-front = pallets/jinja + yaml/pyyaml (2 repos) renders ↑ vs peak RSS ↓, 6 knobs, 98 runs 11-point front from 440 renders/cpu-s at 34.2 MiB to 89 at 28.7 MiB. The bytecode cache and context cache drive it. Knee: 222 renders at 29.2 MiB; hypervolume 0.451. 0 tokens

3. What this update changed

This round: closing every nousko-discovered issue (#264 #281 #303 #304 #315 #316 #317 #318 #319 #320 #321)

Eight packages, each with its own /pr-review-toolkit:review-pr gate, one fix round, and an expert self-audit on questions chosen per stage. A final 11-question audit and a whole-PR review followed. Every review found real defects; each was fixed with a behavioral test that fails on the pre-fix commit:

  • P1, SDK infrastructure. Exit-143 retry, per-turn child and process-group reaping, a phase wall-clock ceiling, nous resume --silence-threshold, and Iteration #3 wrongly routed to OpenAI's endpoint #304 report routing.
  • P2, certification. min(Bonferroni, Scheffé) with branch-and-bound for searched spaces, the multi-objective model half, delta_constraint, opt-in post-selection validation (fresh draws even with pinned seeds), a charged campaign_delta that binds, TOST inertness, and baseline-seat accounting (which fixed a max_runs overspend).
  • P3, noise and data quality. The robust terminal family and replicate floor, the skewness pretest, a Brown–Forsythe M3 check, outlier flags, right-censoring, constraint semantics with delta_feasibility, a CRN probe, and oracle 2(c) as a TOST.
  • P4, adequacy and design. Routing that refines unless a factor is shown inert, plus model_class_unchecked. This closed a measured screen-only false-certificate hole on a masked saddle. Also the outer validation ring, opt-in screen validation, per-test vetoes, G/I efficiency, and rejection of partial reuse across choice slices.
  • P5, provenance. Served model ID, an external create-only anchor (re-anchoring after data refused), run-order concealment, held-out seeds, and echo-only manipulation flags.
  • P6, WP-D. The allocation core, nous plan-next (a true lower-bound utility, a sealed decision, an accept that refuses edits or stale inputs), the Optuna proposer, and the opt-in allocate round (digest-anchored seats).
  • P7, benchmark. Regenerated on the final code: truth and every baseline over the declared lattice plus Nous's own centre configurations, pre-declared metric, anytime curves, CIs, a multi-objective arm and ablations.
  • P8, final audit and review. Fixed per-column SEs on two-level fits that lost rows (the model half had failed at 0.065–0.109), a pinned-seed reuse path, the budget gate under unrecoverable epochs, and plan-next's next-epoch floor. Corrected nine over-claims in the docs.

Earlier round: expert-audit hardening

Each package went through /pr-review-toolkit:review-pr passes and expert self-audits (docs/optimization-expert-audit.md) before merging. Every finding that touched a core claim was fixed with a test that fails without the fix.

  • Any number of knobs. Constructed resolution III/IV/V fractions for any factor count, a resolution-V refine cube, and a seeded candidate search above 50,000 candidates.
  • Mixed-level factors. Multi-level categoricals by the method of replacement, levels_only, centre cycling, lost-level handling, and epoch-scoped reports.
  • Model adequacy (WP-B). Validation points, the predictive F test, sticky adequacy, D-efficiency, and opt-in screen-row reuse with a drift term.
  • Build integrity and reproducibility (WP-C). The private clean tree, sealed records, isolation, test-vacuity mutants, the import probe, provenance, nous reanalyze, and the benchmark.
  • Certification soundness (WP-A). Both halves of the bound, α-spending, the certificate's scope, the baseline gain interval, and the exact covariance for second-order fits.
  • Machine safety for development. The synthetic oracle refuses grids over 10⁶ points (an unbounded grid exhausted 64 GB during development), and the benchmark runner caps its workers.

Latest round: multi-objective fronts, multi-repo field campaigns, Claude-first authoring

Pareto front (spec docs/superpowers/specs/2026-10-15-pareto-front-design.md, with its Decisions section). New modules orchestrator/optimize/pareto.py (pure Python, no numpy, enforced by an import-scan test) and pareto_stage.py. Schema, validator, liveness and design preview work per objective. Three independent reviews (correctness, silent failures, test quality) were run, and every finding was fixed with a regression test. Among them:

  • An unknown ε (a pct of a zero best) had been read as zero. It now stays unknown, resolves nothing, and withholds certification as epsilon_unknown.
  • Front statuses are now simultaneous.
  • A finalist missing a secondary objective is now recorded and treated as unmeasured, not silently dropped.
  • A lone configuration no longer certifies against nothing.
  • Map keys that differ only by case resolve to the declared objective; two spellings of one objective are rejected.
  • The knee is taken over the whole measured front. With only two confident points it had degenerated to a tie-break.
  • report.md shows every objective's mean and interval in the recommendation, finalists and bounds.

Defects found by running real multi-repo campaigns (F25–F39):

  • Shipping and monitoring. The docs were not shipped with the package; nous docs now serves them. Progress could not be looked up from another shell; a work-dir registry fixes that. Validate's next step now says nous resume when the campaign already has a work_dir.
  • Epoch handling. campaign.yaml went stale across epochs; each epoch now writes its own copy. A policy schema failure was not a gate; now it is. A gate halt left the next resume appending duplicate rows; rows are now reused. A stale halt.json read HALTED on a completed campaign; it is now archived to halt_history.jsonl.
  • Adapter contract. Go's int/float output drifted the contract; JSON numbers are now unified.
  • Liveness. It ignored constraint metrics; it now checks them.
  • "Best measured" selection. It was the winner's curse, a single lucky row; it is now the mean over complete rows. It also read previous epochs' rows, which seated a finalist claiming a level it never ran at; it is now scoped to the epoch.
  • Next-epoch advice. It suggested unrunnable levels, such as "concurrency 0.5" and "GOMAXPROCS 22.6".
  • Boundary optima. A boundary optimum used to end the epoch.

Claude-first authoring.

  • Installable plugin. The Claude Code plugin now installs (.claude-plugin/marketplace.json → plugin/nous, and claude plugin validate passes). A new nous-optimize skill covers the full loop: understand the target, write the adapter, scaffold, validate until clean, run in the background, monitor, read the basis, and iterate.
  • Reference docs at the command line. nous docs quickstart|guide|targets|invariants serves the reference docs from any install.
  • Next steps in every report. report.md's What to do next gives runnable levels and pins hard limits. For multi-objective campaigns it says how to fill gaps, resolve points and widen the front.

Any number of knobs. The screen used textbook generators for 5–8 knobs and fell back to the 2^k full factorial everywhere else. The candidate search also enumerated 9^k points, so 7 knobs did not finish. Three changes:

  • Constructed designs. design.generators_for builds a Res III, IV or V fraction for any k, guaranteed by construction and checked off the design matrix.
  • Fractional refine cube. The composite design uses a resolution-V cube from 5 knobs.
  • Searched candidate space. It is exact under a cap, seeded search above it, and recorded honestly when searched.

Validator rule 8 now compares the exact run count with max_runs and names which lower resolutions would fit. The synthetic oracle gained Surface.active, so many-knob truth stays exact without enumerating 9^k points.

Earlier on this branch

Main is merged in (conflicts resolved in campaign.schema.yaml, pyproject.toml, README.md).

Issues

Defects found by running real campaigns. Most of these were invisible to the existing test suite. Each fix has a behavioral regression test.

  • Hard gates were advisory in nous run (the most serious finding). A failed verify recorded one failed iteration and advanced to screen; a rejected plan advanced to a planless build. Fixed with OptimizationGateFailed plus halting on any pre-epoch failure.
  • The mechanism-drift oracle always false-aborted in the default layout: it hashed Nous's own work_dir. Nous-owned paths are now excluded, and older hashes are still accepted.
  • No admissible finalist. When every finalist was inadmissible, confirm set ε to 0 and reported a false "non-numeric metric" exception, and the report recommended a configuration measured infeasible.
  • Constraint-blind shortlist. Confirm re-measured regions already known to be infeasible.
  • Fit coding. The fit used nominal coordinates and mis-coded choice-factor centre points, and dropped infeasible rows from the primary fit.
  • Misleading reports. An infeasible replicate could be relabelled "unmeasured", nulling R_t. A warning claimed the winner was "worse than" its own earlier row (it fired on 8 of 9 oracle campaigns). The report gave R_terminal=0 with an unmeasured finalist.
  • Plan rejected a valid answer. currency: 'ops_per_s' was "too short". A rejected plan is now repaired once with the rejection as feedback, and then stops.
  • Curvature was ignored. A screen whose centre points showed curvature but whose corners showed no main effect skipped refine and certified an uninformed shortlist. It now refines.
  • No log-scale coding. Every geometric knob was coded linearly; scale: log is added.
  • Oracle 2(b) aborted any campaign that tunes existing knobs beside a built mechanism. It now binds only the factors the build authors, and smoke and verify share one rule.
  • Authoring friction: integer levels rendered as 20.0; NOUS_RUN_DIR was created under failed_runs/ or inside the target's tree; the target's git status was polluted by .nous/; the deploy verdict contradicted the report; held-out values were never surfaced; warning noise; messages pointed at nous run --resume, which does not exist.
  • Tests that checked nothing. Contract tests read fields no artifact writes, so they passed vacuously; they are fixed, and stale xfails are retired.

Authoring. Top-level help names both kinds. Scaffold, quickstart, design preview, and the one-pass-then-next: validation flow are added. Stale claims in the schema and docs about model calls that no longer happen are corrected.

4. Honest limits

  • One build call. build is one call, not a build-until-green loop. A sound-but-slow mechanism can be revised only by a new epoch. plan mitigates this by pricing alternatives first.

  • Deterministic targets with CRN. When paired differences have exactly zero variance, the terminal bound is reported as not estimable rather than as an exact certificate. This is deliberate.

  • Wall-clock objectives on a shared machine are noisy (measured CV 0.5%→12% under co-scheduled load). The quickstart advises CPU time for CPU-bound in-process targets; Nous measures and reports the noise and the MDE but cannot remove it.

  • Certification costs power and runs. Every conservatism added by optimization: deferred items from the #302 expert audit (tracking) #321 is a veto: the replicate floor, the skewness pretest (a deliberate ~26% Gaussian withhold, measured necessary for validity), the Brown–Forsythe check, per-test adequacy vetoes, and model_class_unchecked. Measured against the previous benchmark run:

    • more runs per campaign;
    • fewer certificates, with 0 false where the previous run had 26 false in the suite;
    • many-knob campaigns no longer certify (model_bound_above_epsilon).

    See docs/benchmarks/optimization-benchmark.md.

  • The certificate is conditional on the response class and the noise model. The adequacy checks have local power (validation points at ±0.5 and ±0.8). A narrow peak between points, or a misfit below the noise, can still pass. Under strong heteroscedasticity (h ≥ 8) the model half's conditional miss is 0.317, against 0 false certificates end to end. semantics: mean is approximate under skew (about 2× nominal at lognormal σ = 0.5); use chance: or declare support: for an exact bound.

  • Nous is not the best optimizer everywhere. GP-BO leads early on the anytime curve (at 40% of N) and on several non-quadratic and constrained surfaces. ParEGO beats Nous's multi-objective fronts on hypervolume. Nous's strength is a sound, pre-registered certificate and a zero-token epoch, not raw regret.

  • Allocation and the BO proposer are opt-in and modest. The allocate round improves fronts slightly but costs certificates in single-objective campaigns (its extra look is charged whether it fires or not). The Optuna proposer shows no measurable benefit in the benchmark.

  • Build gates assume a same-user agent. The seal key is reachable by same-user code, in-process monkeypatching by in-scope mechanism code is invisible on disk, and under --auto-approve nobody reviews the mechanism. These limits are stated in the guide.

  • guidance.interpretation is not read by any stage; the schema says so.

  • Simultaneous front statuses are conservative. They are claimed at α = δ/(N(N−1)K) over every measured configuration. On gopack-front (about 40 configurations, 4 replicates) no point reached confidently_nondominated, so the hypervolume is reported as undefined. That is honest, and report.md says to add replicates or widen ε. Restricting the family to confirm-measured points would be more powerful and is a candidate follow-up.

  • Above 50,000 candidates the search is not exhaustive. The recommendation, the predicted front and the alias-consequence check are only as strong as the seeded search. On planted optima it matched exhaustive enumeration in at least 97% of 180 random quadratics, and hit the optimum exactly at 12, 16 and 24 knobs. Every such campaign records candidate_space and says so in report.md.

  • Resolution V above 30 knobs. The construction can use one more doubling than the smallest known regular design up to 64 knobs (e.g. 2048 runs for 31, against a known 1024), and two at 100. The preview states the gap.

  • Resuming across this upgrade. Combinations outside the textbook table (e.g. resolution IV at 9 knobs) and composite designs with ≥ 5 factors now compile smaller designs. A campaign resumed mid-epoch across the upgrade builds its next stage with the new design. The pre-registered rule is the same; the run count is smaller.

  • The knee depends on normalisation. Objectives are scaled to [0, 1] by their measured ranges, so a narrow absolute range (rendersvc's RSS, about 5 MiB) counts as much as a wide one. Use preference: {method: weights} when the units matter.

5. How to review

  1. Read docs/optimization-authoring-quickstart.md (5 min). Then run nous create-campaign --kind optimization --to /tmp/c.yaml and nous validate campaign /tmp/c.yaml to see the authoring loop.
  2. Read orchestrator/optimize/policy.py (the compiled state machine), orchestrator/optimize/certificate.py (the bounds), and orchestrator/optimize/pareto.py plus the Pareto spec's Decisions (the front).
  3. Read orchestrator/optimize/stage_runner.py: start at run_stage, then _finish_confirm and _run_report. It is still the module most worth a human read.
  4. Read docs/optimization-invariants.md alongside the oracle tests (tests/test_optimize_harness.py, tests/test_optimize_contract_chain.py).
  5. For the statistics, read docs/optimization-expert-audit.md with the two 2026-10-17 specs.

Full suite: 4694 passed, 11 skipped on Python 3.13 locally and on 3.11 and 3.12 in CI, pytest -ra --strict-markers, with zero live LLM calls (enforced by tests/conftest.py).

🤖 Generated with Claude Code

@sriumcp

sriumcp commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Empirical validation against inference-sim — token claim confirmed, quality claim untested

Ran an A/B of the two campaign kinds against real blis runs to see whether kind: optimization earns its place. Being upfront about what this does and does not establish: it validates the cost mechanism with measured data, and leaves the composition mechanism untested — the target turned out to be one where OFAT cannot lose.

Setup

Target blis on examples/regression_workload_cache_warmup.yaml — a purpose-built routing regression workload with 3 SLO classes and documented known results (routing swings +242% sabotaged → −28% oracle), so the surface was known non-flat before either arm started
Objective total goodput_rps summed across SLO classes
Factors 6 two-level: ROUTE, SCHED, DISPATCH, PREEMPT, MAXRUN, TOKENS
Ground truth all 64 configurations, computed exhaustively in 41 s
Observed range 23.45 → 117.85 goodput (5.0× spread) — a live surface

Both arms called one shared evaluator and nothing else, so any difference comes from search strategy rather than from how configurations were run or scored. Screen design verified balanced, orthogonal, and genuinely resolution IV (zero 2fi aliased on main effects) before any result was trusted.

Token budget — the currency that matters

BLIS runs are ~0.6 s and cost zero tokens. Costs below are measured from 69 real LLM calls across 4 corpus campaigns, not estimated:

Arm LLM calls Cost Best found
reflective, 3 iters 20.4 $31.84 117.85 (100%)
reflective, 4 iters 27.2 $42.45 117.85 (100%)
optimization 6 $9.38 117.85 (100%)

3.4–4.5× cheaper in tokens for the identical answer. Measured reflective rate is 6.8 LLM calls and $10.61 per iteration — higher than the design spec assumed, because design-phase retries dominate (2–20 calls per campaign in the corpus).

The asymmetry is structural rather than tuned: orchestrator/optimize/ contains no dispatcher, no completion_fn, no sdk_runner anywhere, so screen and refine cannot make a model call.

Why quality tied — the honest caveat

Both arms reached the true optimum. Diagnosing why, rather than declaring a tie:

This surface is unimodal under single-factor moves. Greedy steepest-ascent from all 64 starting points reached the global optimum from every one. So sequential search cannot get trapped here, and the factorial design's structural advantage has nothing to exploit.

That is not because the target is trivial. It has three real interactions — MAXRUN×TOKENS −5.84, SCHED×MAXRUN −3.52, SCHED×TOKENS −3.12 — and MAXRUN shows the exact L5 sign-flip property the design spec is built around: −43.82 alone, +81.03 in the best context. Interactions exist; they simply do not create a local trap.

This is consistent with the guide's own framing, which already says the composition barrier is "an artifact of OFAT search, not an inherent property of the underlying system." This target is a system where the artifact does not bite.

One reflective ordering did finish at 90% of optimum (106.17), but tracing it showed a budget artefact of single-pass coordinate descent — MAXRUN came last, and TOKENS had been fixed at a level that was better before MAXRUN moved. A second pass recovered the optimum. Not a landscape trap.

What this means for the PR

The result argues for one doc addition rather than a code change, and it is being made in this PR: the guide explains why factorial beats OFAT but never tells an author how to tell which case they are in. On a unimodal surface the optimization kind still wins on tokens but its headline advantage is dormant, and an author deserves a cheap way to check — the 64-point greedy probe here cost 41 seconds and answered it definitively.

Also worth recording: the experiment exercised the harness end to end and found no defects in it, which is the first independent use of the feature outside its own test suite.

Reproduction

Scripts under /tmp/optexp/ (harness.py, arms.py, plus ground_truth.json and comparison.json). Not committed — they target a specific local inference-sim checkout and a built blis binary, so they would be dead weight in this repo. Happy to add them under examples/ if that is useful.

Caveat on scope

One target, one workload, one objective, 6 factors. It establishes the token claim and demonstrates the machinery works against a real system. It does not establish that optimization finds better optima than reflective in general — that needs a target whose surface genuinely traps greedy, which this one does not. Two candidates: a factor set including deliberately pathological levels (the always-busiest routing policy alone produced a 13× goodput cliff, 7.34 vs 98.66), or a 10–12 factor space where reflective's per-iteration cost compounds while optimization stays flat at ~6 calls.


Update — superseded by measured runs. The cost figures in this comment were computed arithmetically from corpus per-call averages, and both "experiments" here simulated the two search strategies as hand-written Python calling blis directly. Neither invoked nous. That is stated plainly at the end of the next comment, and it is why the headline "token claim confirmed" overstates what this establishes: it validates the search strategy comparison, not the two campaign kinds end to end.

Superseded by real, measured campaigns:

  • Experiment 3 — optimization complete at $0.082, reflective $5.451 and unfinished (66×), from llm_metrics.jsonl rather than estimates.
  • Experiment 4 — both kinds author Go code first: optimization $2.65 complete, reflective $6.49 for ~1.3 iterations.

The measured per-phase split also gives a sharper account than the 3.4–4.5× here: authoring costs roughly the same in both kinds, and what optimization removes is the recurring per-iteration measurement cost ($4.77 vs $0 in experiment 4).

@sriumcp

sriumcp commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Experiment 2 (preemption starvation, discussion #521): mechanism reproduced, but the target cannot discriminate

Second attempt at a target that could test the quality half of the claim, since experiment 1's surface turned out unimodal. Grounded in inference-sim discussion #521, "Preemption starvation under sustained KV overload", whose Question 4 is an explicit invitation: "Is progress-aware eviction worth a hypothesis experiment? Test whether 'evict least progress' beats 'evict youngest' under sustained KV pressure."

Isolation note: experiment 2 ran in its own directory with its own harness, cache, factor set, and workload. Nothing shared with experiment 1 except the read-only blis binary.

The mechanism reproduces, and it is severe

The original reproducer needs an HF-gated model (meta-llama/llama-3.1-8b-instruct, HTTP 401 without a token), so I substituted a locally available qwen/qwen3-14b and kept every other flag identical.

KV budget completed / 300 preemptions waste ratio
7463 blocks 139 3,188 22.9 preemptions per completion
2000 blocks 54 2,357 43.6 preemptions per completion

Not the total starvation (0 completions) the discussion documents for llama-3.1-8b — different KV geometry — but unmistakably the same mechanism, and severe. Partial starvation is actually better for a comparison, since 0 completions everywhere would tie every configuration at zero.

Only one factor is live, and it is not a mitigation

Testing each of #521's five candidate mitigations in isolation against the baseline:

Factor Δ completions
--total-kv-blocks 7463 → 2000 −85
--preemption-policy fcfs → priority 0
--flow-control off → on 0
--usage-limit-threshold 1.0 → 0.8 0
--kv-cpu-blocks 0 → 4000 0

The only knob that moves the outcome is the pressure knob, not a mitigation.

Why preemption-policy is inert here, which is the finding worth recording: the flag selects the "least-urgent SLO tier", but the synthetic CLI workload cannot tag requests with SLO classes — per_class counts remain {critical: 0, standard: 0} even when --slo-ttft and --slo-e2e are supplied explicitly. Only a workload spec can assign slo_class. So in the #521 reproducer as written, --preemption-policy=priority provably degenerates to fcfs, and its Question 4 cannot be tested without a new workload.

--kv-cpu-blocks is genuinely engaged — it did 26x more compute (13.2 s versus 0.5 s) — it simply does not change completions under this pressure.

Why this still cannot discriminate the two kinds

A one-factor space is exactly where one-factor-at-a-time search is provably optimal. Different reason from experiment 1 (which was unimodal despite six live factors), same conclusion: no discriminating power on quality.

Standing state of the two claims

  • Same quality at lower token budget — supported by experiment 1 (identical optimum, 6 LLM calls versus 20–27).
  • Better quality than reflective — still untested. Two targets, two different reasons neither could show it.

Two independent failures to find a greedy trap is itself weak evidence that these surfaces are mostly benign. If that holds up, the honest pitch for kind: optimization is "same answer, several times cheaper, plus a fitted effect table and a pre-registered audit trail" rather than "finds answers OFAT cannot" — which is what the guide now says after the c799701 addition.

Correction to experiment 1's framing

One thing I should state plainly, because it bears on how much weight to give the numbers above and in the previous comment: neither experiment invoked nous itself. Both simulated the two search strategies as hand-written Python calling blis directly, and the token figures were computed arithmetically from corpus per-call averages rather than measured from real campaign spend. That establishes the search-strategy comparison and the structural tokenless property of orchestrator/optimize/, but it is not an end-to-end measurement of the two campaign kinds. A genuine two-campaign run is the next thing to do, and I am doing it.


Update. The closing paragraph's commitment — "a genuine two-campaign run is the next thing to do, and I am doing it" — was carried out twice:

The prediction in this comment held up. The honest pitch is still "same answer, cheaper, plus a fitted effect table and a pre-registered audit trail" rather than "finds answers OFAT cannot" — no target across four experiments has shown optimization finding a better answer than reflective on the same question. In experiment 4 it found the joint optimum while reflective isolated a mechanism, which is a difference in aim rather than in quality.

@sriumcp

sriumcp commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Two REAL nous campaigns, head to head — and eight bugs that only a real run could find

Previous comments compared simulated search strategies (hand-written Python calling blis directly). This one is different: two actual nous campaigns, same target, same objective, same six knobs, differing only in kind. That distinction matters, and the earlier framing correction stands.

Setup

Identical for both arms: blis on examples/regression_workload_cache_warmup.yaml, 4 instances, seed 42, objective goodput_rps, six two-level factors (ROUTE, SCHED, DISPATCH, PREEMPT, MAXRUN, TOKENS). Both declared live_target: true — neither campaign modifies BLIS; all six knobs are existing CLI flags on the prebuilt binary. Verified: BLIS's git tree was untouched and no experiment worktrees were created.

Independent ground truth: all 64 configurations swept exhaustively beforehand. True optimum 117.854.

Result

REFLECTIVE OPTIMIZATION
status stopped mid-iteration-3 complete
LLM calls 6 3
input tokens 11,251 5,639
output tokens 52,743 2,161
cache-read tokens 8,152,208 0
cost (Opus 4.6 rates) $5.451 $0.082
blis runs 10 35
best goodput found 117.779 117.854
% of true optimum 99.94% 100.00%

~66× cheaper, and reflective had not finished.

The cost driver was not what I expected: cache reads are 75% of reflective's bill ($4.08 of $5.45). That is the SDK agent re-reading repo context on every turn. Optimization's cache reads are zero, because screen and confirm make no agent calls at all — the structural tokenless property showing up directly in dollars rather than in a token count.

For an external check, discussion #1388 documents a prior real nous reflective campaign on adjacent BLIS machinery at $5.26 / 43 minutes — close to the $5.45 measured here, which suggests this reflective figure is representative rather than anomalous.

Quality: a tie, and honestly a tie

Reflective found 117.779 via seven hand-picked configurations (C1–C7); optimization confirmed 117.854 with 3 replicates and zero spread. Reflective's 0.06% shortfall is simply that it never tried the exact winning corner, only a near neighbour.

This target cannot demonstrate a quality win, consistent with the earlier finding that its surface is unimodal — greedy steepest-ascent reaches the optimum from all 64 starting points. So the claim this experiment supports is same answer, ~66× cheaper, not "finds better answers".

Credit where due: reflective's findings are richer prose. It identified MAXRUN +43.822 as dominant and flagged one of its own predictions as wrong (h-control-negative: REFUTED — PREDICTION WRONG about mechanism). Optimization gives a fitted effect table instead — MAXRUN +33.502, SCHED +10.735, TOKENS +5.595, with DISPATCH and PREEMPT at exactly 0.000. Different artifacts, both useful.

The part that matters more than the numbers: eight real bugs

kind: optimization could not complete a single campaign when I started. Every defect below was found by running it, not by testing it — and 1,662 tests were green throughout, because they inject fakes at exactly the seams that were broken.

# Defect Consequence Fix
1 test_command had no caller anywhere every campaign aborted at verify with all correctness relations failing e410bbc
2 config_runner required but only tests supplied it the F3 gap listed in the PR body as "not a blocker" was one e410bbc
3 manipulation assumed targets echo their config back 115 configurations ran, every one failed its check 3a51890
4 axial points escaped the declared range MAXRUN = -112, a negative request cap; 16/80 runs rejected ad85208
5 grid: 1 returned floats --max-num-running-reqs=160.0 rejected as a usage error b8d9c3d
6 no DESIGN pre-flight every authoring defect cost a full campaign to discover b8d9c3d
7 refine fabricated a design when nothing was refinable quadratics fitted for categorical factors → singular Hessian b8d9c3d
8 confirm replicated the geometric origin found 117.854, reported 73.476 — with no error anywhere d925d70-series

Bug 8 deserves emphasis: the campaign got the right answer and reported the wrong one, silently. That is precisely the confidently-wrong failure mode this feature exists to prevent, and only a real run surfaced it.

Bug 3 and bug 6 are design defects rather than slips:

  • Every worked example in the guide wrote manipulation predicates against config.* / telemetry.*, silently requiring the target to echo its configuration back. Most targets do not. applied.<FACTOR_ID> now always resolves, with target telemetry still preferred and still winning on collision — applied.* says what was requested, telemetry says what was received, and a silently-ignored flag must still fail.
  • The reflective kind validates its bundle at DESIGN (validate_design, plus a whole CRITIC phase). The optimization path had no equivalent — DESIGN wrote a matrix and EXECUTE_ANALYZE immediately ran it. _preflight_design closes that asymmetry: bugs 4 and 5 would have cost one phase instead of a campaign.

Also added: nous validate campaign

validate_optimization_campaign had zero production callers — the ten cross-field rules I added in this PR ran only in tests. Authoring one campaign took six schema failures with unhelpful messages (60 is not of type 'object', no field path). nous validate campaign FILE now runs both layers with paths and repair guidance (3b34920), and immediately caught a real flaw in my own campaign.

What is still untested

Both campaigns explored existing CLI flags. Neither authored new mechanism code, so the verify stage's actual purpose — validating newly written code via native property tests — has never run for real. A follow-up pair is being built against discussion #1367 (adaptive per-band dispatch ceilings), where the interpolation curve is hardcoded at sim/cluster/gateway_queue.go:431 and no curve/shape flag exists — so both kinds must genuinely extend BLIS first. I expect that to find more bugs, which is the point.


Update (superseded in part). The "what is still untested" question above was answered by experiment 4: both kinds authored --ceiling-curve in Go against discussion #1367, so verify has now gated real newly-written mechanism code. It found four more defects (12 total), the most serious being that build edited the canonical inference-sim checkout rather than its own worktree.

Two counts here are also now stale: eight bugs → twelve, and ten cross-field rules → twelve (rules 11 and 12 cover build-stage ordering and missing native_test files). The F3 wiring gap listed as bug 2 is fixed and campaigns run end to end; the PR description no longer carries the "not a usable command" warning.

@sriumcp

sriumcp commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

Experiment 4 — both kinds must extend BLIS first, then optimize

Every prior comparison here varied only existing CLI flags, so the verify stage's actual purpose — gating newly authored mechanism code — had never run. This one fixes that. Target: inference-sim discussion #1367, whose own open question is "What interpolation curve makes sense? Linear? Exponential? Step function?"

sim/cluster/gateway_queue.go:431 hardcodes one linear formula and ./blis run --help has no flag for the shape, so neither arm can vary its primary factor without writing Go first. Both got an identical, verbatim-shared mechanism spec: add --ceiling-curve (linear/exponential/step), keep linear bit-identical to today, plumb it the way --usage-limit-threshold is plumbed, and write four native Go tests (backward-compat, property-based invariants, metamorphic ordering, loud rejection).

Isolation. Separate git worktrees on separate branches at identical HEADs, separate NOUS_CAMPAIGN_PARENT dirs, separate per-arm blis binaries, and a third throwaway worktree carrying my own independent reference implementation for ground truth. The canonical inference-sim checkout stayed clean for the entire run (verified after).

Ground truth (90-config exhaustive sweep, independent implementation): 182.2159 at linear / THRESH=0.9 / BANDCAP=64 / global-strict. BANDCAP dominates, FAIR is exactly inert (bit-identical pairs), and CURVE is real but small — linear, the existing behaviour, wins. So the correct answer to #1367 is a negative result, which makes this a good test of whether each kind reports one honestly.

Result

REFLECTIVE OPTIMIZATION
status hung mid-iter-2 (infra, #303) complete
LLM calls 5 6
output tokens 52,953 19,704
cache-read tokens 8,129,748 2,443,921
cost $6.49 (~1.3 iterations) $2.65 (whole campaign)
blis runs 38 33
authored the mechanism ✅ ✅
native tests passing 6 (wrote 2 extra, incl. testing/quick) 4
agrees with ground truth 182.2159 ✓ / 181.2500 ✓ 182.2159 ✓ / 181.2500 ✓
best configuration measured 123.1489 (67.6%) 182.2159 (100%)

Both arms authored a correct mechanism. Three independent implementations — reflective's, optimization's, and my reference — agree to four decimals at the optimum and at exponential. That is the strongest evidence available that the mechanism is right, and it means this comparison measures search strategy, not implementation luck.

Both answered #1367 honestly. Optimization's fitted effects put CURVE at −1.73 against BANDCAP −41.17 and THRESH +9.38 — correctly saying non-linear curves are slightly worse. Reflective refuted its own h-main across 3 seeds and confirmed a negative control: all three curves byte-identical at T=1.0 (103.5756559818877), which proves the mechanism is inert when it should be. Optimization produced no equivalent.

On cost: the advantage is real, but its source moved

$2.65 vs $6.49 is 2.5× for a completed campaign against an unfinished one. That is far from experiment 3's 66×, and the per-phase breakdown explains why:

reflective optimization
one-time authoring design $1.62 build $2.44 (92% of its bill)
per measurement iteration execute-analyze $4.77 $0

Both kinds pay a comparable one-time cost to author code — an agent working in a repo is expensive either way. What optimization eliminates is the recurring per-iteration cost: 33 real benchmark runs for zero tokens. The structural claim that survives contact with code-authoring campaigns is therefore narrower than "66× cheaper" and more durable: the authoring cost is unavoidable in both kinds; the per-iteration measurement cost is what this kind removes. The more iterations a question needs, the wider the gap.

I am deliberately not claiming the ~7× that extrapolating reflective to 3 iterations would give. The run that would have tested it died for unrelated reasons.

The 67.6% needs its caveat

Reflective's shortfall is not a failure of search. It pinned THRESH=0.6 and left BANDCAP at default in order to isolate the curve mechanism — correct hypothesis-testing discipline for the question "does curve shape matter?". Optimization asked "what is the best configuration?" and varied all four factors. Different questions, both answered well. Read the 100% as optimization is aimed at the joint optimum, not as reflective searched badly.

One genuine reflective advantage worth recording: its DESIGN phase caught an error in my mechanism spec. I had declared the metamorphic ordering as step <= linear <= exponential; its bundle reasoned mid-sentence "WAIT: actually step < exponential < linear" and was right (T^f <= 1-f(1-T) by concavity; at T=0.6, 3 bands: 0.600 / 0.775 / 0.800). My own earlier benchmark numbers already contradicted my spec and I had misread them as confirming it. build takes the spec as given, so an author's algebra error is a blind spot in the optimization kind — not something a validator rule can fix.

Four more defects this run surfaced, all fixed

# Defect Consequence Fix
9 Build stage edited the canonical checkout, not its worktree two "independent" arms would silently overwrite each other's mechanism; both trees build, both suites pass d304791
10 confirm reported a fitted optimum without comparing it to the best observed reported 112.4997 when the campaign had measured 182.2159 — 38% off, replicate spread 0.0, status CONFIRMED 0e12a43
11 confirm replicated a stationary point the system had already flagged as outside the hull decide_after_refine wrote "ranges were too narrow… escalate before confirming" into findings, then confirm did it anyway 4270bad
12 REPORT extractor could not see optimization-kind results report announced a "storage/persistence gap in the apparatus" and marked every effect low-confidence, while 33 rows sat in runs.jsonl 81dc6fc

Defect 9 is the one worth dwelling on: cwd was set correctly, so the code looked right. Nothing verified where the edits landed. The fix states the absolute working root up front and warns when a git target shows no modifications after a "successful" build — because a prompt instruction is not a guarantee.

Defect 11 is the sharpest: the system diagnosed the problem, recorded the correct diagnosis, and then did the thing it had just warned against, because Trigger is documented as reported-not-acted-on. Verified against that campaign's own confirm_at.json: it now yields None, so the campaign would confirm 182.2159 instead of 112.4997.

Defect 12 is an irony worth noting: _format_results_summary was added by #214 specifically to stop reports dismissing real data as "no data". It was reintroducing that exact failure for a layout it did not know about.

Also in this batch

  • build stage (641d23a) — the optimization kind previously had zero agent calls anywhere in orchestrator/optimize/, so a campaign whose mechanism did not exist yet aborted at verify forever: it demanded tests for code no stage could author. build spends exactly one call, makes no correctness judgement, and hands back to the tokenless machinery. verify stays the gate, so the stage that writes the code never certifies it. Opt-in and absent from the default order, so existing campaigns are unaffected (~3 calls → ~4 only when needed).
  • Validator rules 11 & 12 — reject build anywhere but position 1 (behind screen it is worse than an abort: the screen measured the old mechanism), and warn when declared native_test files are absent with no build stage to author them.
  • Diagnostics preservation (098cb84) — run_test_command discarded all output once it had parsed booleans, and a failed benchmark run kept only the last 200 chars of stderr (the cause is usually at the head). Full output now lands in test_output.log and failed_runs/failed_run_N.log. Verify aborts now separate RAN AND FAILED from NEVER EXECUTED — opposite fixes, and costly to confuse after a build call is already spent. Includes the trap that makes the latter silent: go test -run <pattern> exits 0 when the pattern matches nothing.
  • Guide — metamorphic relations now carry an explicit warning to do the algebra first, with my own wrong-direction case as the worked example. A metamorphic relation pointing the wrong way fails correct code or passes broken code, with the authority of a declared correctness relation.

iteration.py remains 23 insertions / 0 deletions against main. 1692 tests pass.

What is still open

  • Reflective never finished, so there is no completed head-to-head. The hang is #303 — a campaign wrote recommended_turn_silence_threshold_seconds: 10 into its own bundle, that scalar overrode DESIGN's 600s default, every design turn self-aborted, and each retry leaked an asyncio event loop until the runner deadlocked. Infrastructure, not a property of the reflective kind, and not evidence against it.
  • No target yet has shown optimization finding a better answer than reflective on the same question. Here it found the joint optimum while reflective isolated a mechanism — a difference in aim, not in quality.

sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
`kind: optimization` could not extend a target. Every stage in
orchestrator/optimize was pure Python with zero agent calls, so when the
mechanism under study did not exist yet, `verify` ran the target's test
command, found the declared native_test identifiers missing, and aborted
fail-closed — correctly and uselessly, since nothing in the path was able
to author them. The guide already claimed verify "writes mechanism code
with native tests"; no code did that. Reflective never had this problem
(its SDK agent edits the target as a matter of course), so the gap was
specific to this kind, and it mattered: "extend the target, then optimize
the extension" is the common shape of a real optimization request.

`build` is an opt-in stage, absent from the default order, so campaigns
written before it behave identically. It spends exactly ONE agent call to
write the mechanism and its native tests, then returns to the tokenless
machinery. It deliberately does not iterate to green, read measurements,
or judge correctness: `verify` remains the gate, so the stage that writes
the code is never the stage that certifies it. Cost goes from ~3 model
calls to ~4 only for campaigns that need it.

Two validator rules, both of which fire on real authoring mistakes:

- rule 11 rejects `build` anywhere but position 1. Behind `verify` it
  guarantees an abort; behind `screen` it is worse than an abort, because
  the screen measured the OLD mechanism and the effect table then
  describes a system the campaign replaced. Both produce schema-valid
  artifacts, so neither is caught downstream.
- rule 12 warns when declared native_test files are absent from the target
  and no build stage exists to author them — otherwise guaranteed to abort
  at verify, but only after a real run.

Also: the test command no longer runs on a build iteration. It could only
report the already-known fact that the identifiers are missing, and
`go test -run <pattern>` exits 0 with "no tests to run" when the pattern
matches nothing, so a pre-build run looks like a pass at the shell level.

Tests inject at the sdk_runner seam per tests/CLAUDE.md — no live calls.
Two are integration: BUILD authors a file in the target and CONTINUEs,
then VERIFY independently aborts when the tests do not actually report.
iteration.py remains 23 insertions / 0 deletions against main; the
reflective path is untouched.

1673 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…st found

A fitted stationary point is an EXTRAPOLATION. When the surface is
mis-specified — curvature the quadratic cannot express, an optimum outside
the design hull, a categorical factor dragged into the fit — the solved
point can land below a corner the screen already measured. confirm then
replicated that inferior point, found its replicates agreed with each
other, wrote status CONFIRMED, and the campaign reported an inferior
configuration as its optimum.

"The prediction reproduced" and "this is the best configuration found" are
different claims, and only the second is what a reader of the report wants.
_best_observed already existed but was used only to PICK the confirm point
when no fit existed; it never CHECKED a fitted one. confirmation.json now
carries best_observed, confirmed_is_best_observed, and (when they disagree)
regression_vs_best_observed with the absolute and percentage gap, plus a
warning naming the observed corner as the campaign's real answer.

Respects response.primary.direction, so lower-is-better objectives are
judged correctly rather than inverted.

1676 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
Found by running it: a build stage whose cwd was its own git worktree read
and then EDITED the canonical checkout of the same project instead. Four
tracked files in the wrong tree. Two supposedly independent campaign arms
would have overwritten each other's mechanism, and every measurement after
that would describe a system neither arm authored — silently, with no error
anywhere, since both trees build and both test suites pass.

Passing repo_path as `cwd` is not sufficient. When the campaign description
mentions file paths and the agent already knows a checkout of that project,
it resolves the paths against the checkout rather than against cwd. The
prompt now states the absolute working root up front, says the path may be a
worktree with a parallel experiment in a sibling checkout, and requires
every path to be re-derived against that root.

Prompt text alone is not a guarantee, so check_build_touched_repo() reports
when a git target shows no local modifications after a "successful" build --
the signature of having edited somewhere else. Advisory, not fatal: verify
remains the authority on whether the mechanism is present, a legitimate
no-op build should not abort a campaign, and non-git targets are exempt.
The warning also lands in build_warning.txt so it survives in the artifacts.

1680 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…fy aborts

Three diagnostics losses, all of which mattered most exactly when something
had gone wrong:

1. run_test_command returned dict[str, bool] and discarded the output. The
   gate needs the booleans; a human fixing the failure needs the text — the
   failed assertion's expected-vs-actual, a panic and its stack, a compile
   error's file and line, a timeout's partial output naming the test that
   hung. Since a verify abort ends the campaign, that text was the only
   record of why, and re-running by hand may not reproduce a timeout or an
   ordering-dependent failure. Now written verbatim to
   runs/iter-N/test_output.log, including on timeout and exec failure.

2. A failed config run kept only the last 200 chars of stderr, in an
   exception message. The cause is usually at the HEAD of stderr (a usage
   error naming the rejected flag), so the tail dropped the useful part.
   Full stdout/stderr now land in runs/iter-N/failed_runs/failed_run_<i>.log
   with the row index and its levels; the exception points at the file. Same
   for output that parses to no JSON, which is the failure that NaN-poisons
   a fit.

3. The verify abort listed relation IDs without saying whether each test
   FAILED or was NEVER EXECUTED. Those need opposite fixes, and after a
   build stage the agent call is already spent, so a wrong diagnosis costs a
   whole second build. The message now splits them and names the fix for
   each, including the trap that makes "never executed" silent: go test -run
   with a pattern matching nothing exits 0.

Logging is opt-in (log_path / log_dir default to None) and can never be the
reason a campaign fails — every write is guarded and degrades to a warning.

Guide: metamorphic relations now carry an explicit warning to do the algebra
first and include a worked numeric example, with the real case from this
campaign corpus where an author declared step <= linear <= exponential when
the truth is step <= exponential <= linear (the exponential is concave in f).
A metamorphic relation pointing the wrong way fails correct code or passes
broken code, with the authority of a declared correctness relation.

1686 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…ults

_format_results_summary walked only runs/iter-*/results/ — the reflective
layout. `kind: optimization` stores measurements as runs.jsonl (one JSON
object per configuration), so the helper emitted "results/ directory absent"
for every iteration of a campaign that had measured everything it planned.

Observed on a real completed campaign: the report announced a
"storage/persistence gap in the apparatus", repeated it per iteration, and
cited it as a reason every effect was low confidence -- while 33 rows of
per-configuration telemetry sat in runs.jsonl beside it, with the top three
measured values matching an independent ground-truth sweep to four decimals.

That is precisely the search-orientation failure (AI-native-Systems-Research#214) this helper was added
to prevent: a report dismissing real data as no data. It was reintroduced for
a layout the helper did not know about. Now both layouts are enumerated, with
the measured/complete counts and the neighbouring design_matrix / effects /
confirmation / relations artifacts named so the extractor can read them.

Malformed lines are counted rather than allowed to blank the iteration, and
the reflective results/ path is untouched (test asserts it still wins).

1689 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…hull

decide_after_refine already detected this and said exactly the right thing --
"stationary point falls outside the declared design space on BANDCAP, THRESH;
ranges were too narrow to contain the optimum -- escalate before confirming"
-- but Trigger is documented as reported-not-acted-on, so confirm read the
same solve off disk and replicated it anyway. The system diagnosed the
problem, wrote it into findings, and then did the thing it had just warned
against.

Observed on a real completed campaign: goodput was monotone in both refined
factors, so no interior optimum exists at all. The quadratic solve landed at
coded BANDCAP=+1.62 / THRESH=-2.30, well outside the hull, and confirm
replicated it for a mean of 112.4997 -- while the campaign had already
MEASURED 182.2159 at a corner, which an independent ground-truth sweep
confirms is the true optimum. 38% off, with replicate spread 0.0 so it looked
perfectly reproducible.

_read_confirm_at now returns None when any coded coordinate leaves [-1, 1],
which routes confirm to the best OBSERVED configuration -- a weaker claim than
reproducing a fitted optimum, but a true one. The warning names the offending
factors and the fix (widen those ranges, re-run refine). Verified against the
real campaign's own confirm_at.json: it now yields None, so that campaign
would confirm 182.2159 instead of 112.4997.

The boundary is inclusive: +/-1.0 is ON the hull, so a factorial corner
remains a legitimate confirm target.

This pairs with the confirmed_is_best_observed guard from 0e12a43. That guard
reports the discrepancy after the fact; this prevents it happening.

1692 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…ssing

The module docstring carried a TODO saying config_runner/integrity_check
"production wiring ... is not built here", and the config_runner abort told
the reader it was "a follow-up". Both were true when written and false since
e410bbc wired them; four real campaigns have since completed through that
path. A stale "not built" note is worse than no note, because it tells the
next reader to build something that exists.

The docstring now says what is actually true: the seams stay injected because
that is what makes the module testable without subprocesses, and run_stage
resolves both from the campaign when a caller supplies neither. It also
records why the gap mattered — until the wiring existed every real campaign
aborted at verify or screen while 1600+ tests stayed green, because they
inject fakes at exactly the seams that were missing.

The abort message now names the actual cause a reader can act on (no
optimization.run_command, or no repo_path) instead of pointing at a
non-existent follow-up.

1692 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
This kind makes only a handful of model calls -- one `build` (which authors
the mechanism every later stage measures), one interpretation at the end, and
a small gate summary per iteration -- while the tokenless screen/refine/confirm
stages carry the bulk of the work. So the marginal cost of using the strongest
model for all of them is small, and the downside of a weaker model on the build
call is that every downstream measurement describes worse code.

_resolve_model is now kind-aware: `kind: optimization` returns
OPTIMIZATION_MODEL for every phase, reflective keeps its per-phase
defaults.yaml entries untouched (design opus-4-6, execute_analyze/report
sonnet-4-6), and an explicit campaign.models.<phase> still wins so an author
can pin something cheaper.

build.py previously hardcoded "claude-opus-4-6" in two places (the SDK call and
the metrics row). It now resolves through the same precedence as the rest of
Nous, so the metrics row names the model actually used and cost accounting stays
honest. defaults.yaml also gains an explicit `build` entry for the same reason.

Verified claude-opus-5 against the configured proxy: HTTP 200, and the usage
block carries cache_creation_input_tokens / cache_read_input_tokens, so the
existing cost accounting works unchanged. The proxy's /model/info is restricted,
so per-token pricing is not discoverable at runtime -- costs continue to be
computed from published rates.

1696 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
Three build stages aborted without producing a mechanism, and the cause was a
spec defect, not an agent failure.

A campaign's mechanism spec described its baseline leg in terms of the deployed
system's behaviour and quoted an exact figure for it. The figure was correct and
reproducible; the LABEL was not -- one of the behaviours named in the label was
not modelled by the target's evaluator at all, so it could not have contributed
to the number.

The build agent could not distinguish "the author mislabelled this leg" from
"my implementation is wrong", so it did the diligent thing: twenty-plus shell
probes grid-searching variants to close a sub-percentage-point gap that was
unclosable by construction. It never reached the mechanism. That is the single
call the campaign spends on the target, so the whole run produced nothing.

Two fixes, at the two places the failure can start:

- The build prompt gains a BUDGET DISCIPLINE section: reference numbers are a
  one-time sanity check, not a target to fit; a divergence should be recorded in
  the summary and the build continued; behaviour the spec asks for that does not
  exist in the target should be noted as absent rather than hunted for; probe
  scripts are spend that buys no measurement. The summary now explicitly asks
  which reference numbers failed to reproduce, so a mislabelled spec surfaces as
  a reported finding instead of a silent search.

- The authoring guide gains "Reference numbers in a spec: verify them, or leave
  them out", with two rules: name a leg by the code path that produces it rather
  than by what the production system does, and state explicitly what to do on a
  mismatch.

1697 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
A campaign whose build stage did everything asked was aborted by verify. The
log line was the whole story:

    test_command reported 88 test(s); 2 matched a declared native_test

All 88 tests passed. But pytest reports a parametrized test once per case
(`test_no_rebalancing[0.95-1.05]`), and match_declared_tests only did exact
trailing-identifier matching, so a declaration naming the bare function matched
nothing. Four of six declared identifiers were parametrized; those four
reconciled as "declared but not executed" and the fail-closed path killed the
run. Cost: one full build stage, ~$7, for correct and fully tested code the
matcher could not recognise.

The matcher now strips a pytest `[...]` parametrization suffix and a Go
`Test/subtest` path, so a bare declaration aggregates every case. Aggregation is
all(), not last-seen: one failing case fails the relation, which keeps
fail-closed intact rather than letting whichever case was iterated last decide.
A declaration with no matching result is still absent from the output, so a test
that was never written still fails.

This is the same class as the earlier `go test -run` finding: the test runner's
output format, not the test outcome, decided whether a relation could be
verified. Worth noting the guard behaved correctly at every step -- it refused to
fit a surface on an apparatus it could not confirm. The defect was that it could
not confirm an apparatus that was in fact sound.

Tests cover pytest parametrization, Go subtests, mixed pass/fail aggregation,
plain names (no regression), and the still-absent case. Verified against the
real campaign artifacts: 88 reported, 6/6 declared matched, 0 correctness
relations failing.

1702 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
Six campaign runs aborted before producing a measurement. Static validation
passed cleanly before every one of them, because five of the six failures were
BEHAVIOURAL -- they live in the contract between the campaign and the target,
and nothing was executing that contract:

  * a declared native_test the test runner never reports (fail-closed abort at
    verify for tests that exist and pass);
  * a run_command that cannot exec (an inline VAR=value prefix is parsed by
    shlex as the binary name);
  * an objective metric absent from the emitted JSON, so every run parses and
    scores NaN;
  * a manipulation predicate comparing a level (a string) against a value the
    target emits as a bool -- 67 of 67 runs rejected while the target's own CLI
    was entirely correct.

`--smoke` runs the test command and ONE configuration at every factor's first
level, and reports all four. It costs one test run plus one config; each of
those failures otherwise costs a full campaign.

The predicate check builds its scope the way run_stage does -- the target's own
`applied` echo wins over the requested levels. Using the requested levels would
make `applied.X == "{level}"` trivially true and hide the exact mismatch the
check exists to find. Verified by reintroducing the bug: exit 1, with the type
named as the suspect.

Also fixes refine dropping non-designed factors. refine builds a central
composite over refinable (numeric, >2 level) factors only, so a `choice` factor
contributed no level and therefore no `apply` fragment -- its CLI flag vanished
from the command line and a target that correctly requires all of its flags
failed every run on a usage error (observed: 48 of 48 refine and confirm runs).
Non-designed factors are now held at their first declared level, which for a
two-level ablation is the control, and the held value is recorded as
`held_fixed` in design_matrix.json so it is auditable rather than implicit.

Guide and CLAUDE.md document --smoke as the last step before launching.

1709 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sriumcp

sriumcp commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

Six aborted runs on a third target, and the validator passed cleanly before every one

Experiments 3 and 4 ran this kind against a Go target. This round ran it against a Python target with a genuinely expensive evaluator (a one-time ~110 s index build, then sub-second per configuration), authoring a new mechanism plus its native tests. Six runs aborted before producing a measurement, and the interesting part is why they were not caught earlier.

nous validate campaign passed before every launch. It was right to: the campaign was structurally valid each time. Five of the six failures were behavioural — they lived in the contract between the campaign and the target, and nothing was executing that contract.

Failure Category Statically catchable?
API connection refused mid-build infrastructure no
Mislabelled reference leg in the spec authoring no — needs the target
run_command could not exec authoring yes
Declared native_test never matched harness bug no — needs execution
Manipulation predicate type mismatch contract no — needs one run
Non-designed factors dropped at refine harness bug no — structural

Two harness bugs, both found only by running

1. Parametrized tests never matched their declaration (ed68e03). A build stage produced a complete, correct mechanism whose full suite passed. verify killed it anyway, and the log line was the whole story:

test_command reported 88 test(s); 2 matched a declared native_test

pytest reports a parametrized test once per case (test_x[case]); Go reports subtests as TestX/case. match_declared_tests did exact trailing-identifier matching, so a declaration naming the bare function matched nothing. Four of six declared identifiers were parametrized → "declared but not executed" → fail-closed abort. The matcher now strips both suffix forms and aggregates with all(), so one failing case still fails the relation and fail-closed survives.

This is the same shape as the earlier go test -run finding: the test runner's output format, not the test outcome, decided whether a relation could be verified. Worth stating plainly — the guard behaved correctly throughout. It refused to fit a surface on an apparatus it could not confirm. The defect was that it could not confirm an apparatus that was sound.

2. refine dropped non-designed factors (2ea21b0). refine builds a central composite over refinable (numeric, >2 level) factors only. A choice factor outside that design contributed no level, therefore no apply fragment, therefore its CLI flag vanished from the command line entirely. A target that correctly requires all of its flags then failed every run on a usage error — 48 of 48 refine and confirm runs. Non-designed factors are now held at their first declared level (for a two-level ablation, the control), recorded as held_fixed in design_matrix.json so the held value is auditable rather than implicit.

The fix that matters most: nous validate campaign --smoke

Static validation will pass a campaign that cannot execute a single configuration. --smoke runs the test command and one configuration at every factor's first level:

Check Failure it prevents
declared native_test identifiers appear in the runner's output fail-closed abort for tests that exist and pass
run_command execs and emits parseable JSON every run dies on a usage error
objective metric present in the output every run parses and scores NaN, poisoning the fit
manipulation predicates hold at the first level every run rejected while the target is fine

One subtlety worth recording, because I got it wrong on the first attempt: the predicate check must build its scope the way run_stage does, with the target's own applied echo winning over the requested levels. My first version used the requested levels, which makes applied.X == "{level}" trivially true and hides the exact mismatch the check exists to find. Verified by reintroducing the bug — the corrected version exits 1 and names the type as the suspect:

x factor <F>: manipulation predicate fails at its first level
  (applied.<f> = False == '0' -> FAIL). Every run would be rejected.
  Check the observable's TYPE -- a level is a string, and a target that
  emits a bool or int for it can never compare equal.

Cost: one test run plus one configuration. Each of those four failures otherwise costs a whole campaign.

The authoring lesson: an unverifiable claim in a spec is a bug

Three of the six aborts traced to the mechanism spec I wrote, and the most expensive was not a wrong number — it was a wrong label. The spec described a baseline leg in terms of the deployed system's behaviour and quoted an exact figure. The figure was correct and reproducible. But one behaviour named in the label was not modelled by the target's evaluator at all, so it could not have contributed.

The build agent could not distinguish "the author mislabelled this" from "my implementation is wrong", so it did the diligent thing: twenty-plus shell probes grid-searching variants to close a gap that was unclosable by construction. It never reached the mechanism. That is the one call the campaign spends on the target.

Two fixes, at both places the failure can start (3a42e86):

  • The build prompt gained a BUDGET DISCIPLINE section: reference numbers are a one-time sanity check, not a target to fit; record a divergence in the summary and continue; note behaviour the spec asks for that does not exist rather than hunting for it; probe scripts are spend that buys no measurement. The summary now explicitly asks which reference numbers failed to reproduce, so a mislabelled spec returns as a reported finding instead of a silent search.
  • The guide gained "Reference numbers in a spec: verify them, or leave them out", with two rules: name a leg by the code path that produces it, not by what the production system does; and state explicitly what to do on a mismatch.

The next run wrote the mechanism at turn ~40 with zero probe scripts, versus never at turn 89. Turn budget went 200 → 120 so a probing spiral hits a wall and reports rather than consuming the whole allowance.

kind: optimization now runs on claude-opus-5 throughout (7d91866)

Every phase of an optimization campaign resolves to OPTIMIZATION_MODEL, rather than the per-phase defaults.yaml entries the reflective kind uses. The reasoning: this kind makes only a handful of model calls while the tokenless stages carry the bulk of the work, so the marginal cost of the strongest model is small — and a weaker model on the build call means every downstream measurement describes worse code. Reflective's defaults are untouched (test asserts it) and an explicit campaign.models.<phase> still wins.

While wiring this I found build.py had a model hardcoded in two places — the SDK call and the metrics row. So even with --model passed, the metrics row named the wrong model, quietly corrupting cost accounting. Both now use the resolved value.

Where this leaves the kind

The build stage does work, and well: on the successful run it authored a 27 KB mechanism and a 29 KB test file (68 tests, all passing), reproduced every reference value to full precision, and corrected a metamorphic relation I had specified wrongly — proving the invariant under a narrower condition and pinning a counterexample as an assertion. Marking that relation behavioral rather than correctness is what let it report the boundary instead of hard-failing on it.

What this round demonstrates is narrower than the earlier experiments and more useful: the tokenless stages are only as good as the campaign/target contract, and that contract needs executing, not just validating. Six aborts, two harness bugs, one new command. 1709 tests pass; iteration.py remains 23 insertions / 0 deletions against main.

sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
Two defects raised in review, both real, both verified in code and by test.

1. confirm labelled the fitted stationary point `role="center"`, and
   matrix._decode_level treats that role as "ignore the coded coordinates, use
   the midpoint of every declared range". Correct for a genuine replicated
   centre point; catastrophic for the one point confirm exists to replay. A
   stationary point at coded +0.9 of [64, 256] ran level 160 -- the midpoint --
   instead of 246, and the campaign then reported "the predicted optimum
   reproduced" about a configuration the fit never predicted.

   This also re-diagnoses an earlier finding. A real campaign's confirm reported
   a mean 38% below a corner its own screen had already measured. That was
   attributed at the time to the response surface extrapolating badly. The
   actual cause was this: confirm never ran the fitted point at all. The
   best-observed guard added in 0e12a43 caught the symptom; this is the cause.

   Fixed by using role="axial", which routes through decode_coded and so
   interpolates and grid-snaps any coded value -- including 0.0, so the
   no-refine case still yields the origin exactly as before.

2. The recorded run order was not the executed run order. matrix_payload
   generates a seeded permutation, records it as `run_order` in
   design_matrix.json, and expand's docstring tells callers to consult it.
   Nothing did. Every configuration still ran and the fit was unaffected, so
   this is a provenance defect rather than a numerical one -- but run-order
   randomization is what protects a factorial design against drift confounding
   (a warming cache, a throttling machine, a background job), and an artifact
   claiming a guarantee the run did not provide is worse than one that claims
   nothing.

   Fixed by permuting the rows handed to execute_design. This introduces a
   sharper hazard than the bug it fixes: _fitting_responses walks outcomes
   positionally and fit_effects pairs value i with design.points[i], so leaving
   outcomes in execution order would misalign every response with its design row
   and produce silently wrong coefficients. Outcomes are therefore restored to
   design order before anything reads them positionally, while runs.jsonl still
   records the true execution sequence because on_row fires per completion.

Four tests: the fitted point is not the midpoint (verified to fail against the
old role), the no-refine origin case is unchanged, execution follows the
recorded permutation, and each row's response still matches its own levels --
the last one is the guard against the misalignment hazard above.

1713 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sriumcp

sriumcp commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

Two review findings, both real — and one of them re-diagnoses an earlier comment

Both claims raised in review are correct. I verified each in the code and by test rather than by reading, and one of them overturns a diagnosis I gave earlier in this PR.

1. confirm ran the geometric centre, not the fitted optimum

_build_design labelled the fitted stationary point role="center". matrix._decode_level treats that role as "ignore the coded coordinates, use the midpoint of every declared range" — correct for a genuine replicated centre point, catastrophic for the one point confirm exists to replay:

if point.role == "center":
    if f.type == "choice":
        return low
    return decode_coded(f, 0.0)      # <- point.coded discarded entirely

Demonstrated on a two-level numeric factor [64, 256] with a stationary point at coded +0.9:

role=center (what confirm used) -> level 160   # the midpoint
role=axial  (correct decode)    -> level 246

So the campaign replicated a configuration the fit never predicted, and reported "the predicted optimum reproduced" about it.

This re-diagnoses an earlier comment in this PR. There I reported a confirm mean 38% below a corner the screen had already measured, and attributed it to the response surface extrapolating badly outside the design hull. That explanation was wrong. The real cause was this bug — confirm never ran the fitted point at all. The confirmed_is_best_observed guard caught the symptom; this is the cause. The hull check I added on top of that diagnosis is still worth having, but it was treating the wrong disease.

Fixed with role="axial", which routes through decode_coded and so interpolates and grid-snaps any coded value — including 0.0, so the no-refine case still yields the origin exactly as before.

2. The recorded run order was not the executed run order

matrix_payload generates a seeded permutation, records it as run_order in design_matrix.json, and expand's own docstring tells callers to consult it:

Order matches design.points exactly — callers that want a randomized execution order should consult run_order from matrix_payload rather than reordering this list.

Nothing did. runner.py has zero references to run_order, and execute_design takes no order parameter. Every configuration still ran and the fit was unaffected, so this is a provenance defect rather than a numerical one — but run-order randomization is precisely what protects a factorial design against drift confounding (a warming cache, a thermally throttling machine, a background job), and an artifact asserting a guarantee the run did not provide is worse than one that asserts nothing.

Fixing it introduced a sharper hazard than the bug, which is worth recording. _fitting_responses walks outcomes positionally and fit_effects pairs value i with design.points[i]. Handing permuted rows to execute_design and leaving the outcomes in execution order would misalign every response with its design row and produce silently wrong coefficients — a genuine numerical defect in place of a documentation one. So outcomes are restored to design order before anything reads them positionally, while runs.jsonl still records the true execution sequence (on_row fires per completion, not per design index).

That hazard is now pinned by a test that checks each recorded row's response against its own levels, so a future reordering cannot reintroduce it quietly.

Tests

Four, in tests/test_optimize_iteration.py:

  • the fitted point is not the midpoint — verified to fail against the old role="center" and pass after
  • the no-refine origin case is unchanged (coded 0.0 still decodes to the midpoint)
  • execution follows the recorded permutation, and that permutation is not the identity
  • every row's response matches its own levels — the alignment guard

1713 passed, 1 skipped. iteration.py remains 23 insertions / 0 deletions against main.

What I take from this

Both findings are in the same family as the defects this PR has been accumulating: an artifact that is schema-valid and internally consistent while describing something the run did not do. The design matrix claimed a randomization that never happened; confirm claimed to reproduce a predicted optimum it never visited. Neither is visible to a schema check, a unit test with an injected fake, or a passing campaign — only to reading the two halves against each other, which is what this review did.

It also makes me less confident in my earlier extrapolation diagnosis than I was when I wrote it, and I would rather say so than leave a plausible-sounding wrong explanation in the record.

sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
Five tests for `nous validate campaign --smoke`, one per failure it exists to
catch: a manipulation predicate whose type can never match, an objective metric
the target does not emit, a run_command that cannot exec, an unmatched
native_test, and the no-false-positive case on a sound contract.

Two tests for the refine fix: a non-designed `choice` factor still reaches the
target on every row, and the held-fixed value is recorded as `held_fixed` in
design_matrix.json so it is auditable rather than implicit.

Also removes a duplicated `_smoke_campaign` helper. Two definitions of the same
name existed in this file and the second shadowed the first, so edits to the
first had no effect and the surviving fixture defaulted `test_cmd` to `true` --
a command that reports no per-test results at all, which made the
sound-contract test fail for a reason unrelated to what it was testing. Worth
noting the smoke check was right every time: it correctly reported that a
declared native_test never appeared in the output of `true`.

1713 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 16, 2026
…oned the fit

Two latent defects, both verified on the branch before the fix and both now
pinned by tests that fail when the fix is reverted.

D1 -- every tabulated resolution-IV screen aborted at fit. fit_effects added one
column per two-factor interaction, but at resolution IV aliased interactions have
IDENTICAL +/-1 columns, so X^T X was singular and _solve_normal_equations raised
"design matrix is singular". Measured before: k=5,6,7,8 all raised; resolution V
was fine. So `resolution: 4` was documented, permitted by the validator (rule 7
only warns), and guaranteed to abort every campaign that declared it.

Interaction columns are now collapsed into ALIAS CLASSES: one estimable
coefficient per class, with the confounding recorded rather than hidden. A
fractional design cannot separate aliased terms -- no arithmetic can -- but it can
say what each coefficient is confounded with, which is what makes aliasing a
resource question ("resolve it only if it could change the decision") instead of
a crash. All of k=4..8 at resolution IV now fit with every main effect estimable,
and resolution V is unchanged (15 effects, no aliases).

D2 -- a single infeasible row silently NaN-poisoned every coefficient.
_fitting_responses carries NaN for any non-complete row, and the abort guard
deliberately exempts `infeasible`/`rejected` because a constrained design
routinely has inadmissible corners and aborting on one would make constraints
unusable. But those NaNs flowed into fit_effects, where one NaN makes every
coefficient NaN while still returning a schema-valid Fit. Verified:
[0.1875, -0.5625, -0.0625, 0.1875] became [nan, nan, nan, nan] with no error
raised and no warning logged.

The comment above that guard already stated the intended behaviour -- "refit on
the completed rows and report the reduced resolution honestly" -- but nothing
implemented it. run_stage now fits on the complete-row subset, logs which rows
were excluded, and writes fit_exclusions.json so the reduced resolution is
visible rather than implied. Fitting aborts only when fewer than two rows remain.

Existing coverage missed D2 because it asserted the NaN was *carried*, not what
the fit did with it.

Also lands the design spec and implementation plan for the paper's decision layer
(compiled policy, recommend(), residual-regret certificate, terminal
discrimination, foldover, epoch semantics): 16 tasks across 6 phases, oracle-first,
with these two defects folded in as the first work items of Tasks 10 and 7.

1718 passed, 1 skipped. iteration.py remains 23 insertions / 0 deletions.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 17, 2026
Documents what Tasks 1-15 built, for the audience that has to read the
artifacts rather than the code.

`docs/optimization-campaign-guide.md` gains an unnumbered "The compiled
policy" section (placed after §2 so the existing §3-§6 cross-references
stay valid): the `policy` / `known_valid_baseline` / `workload` blocks and
`design.confirm.shortlist_size` field-by-field, the states-and-registered-
branches table, how to read `report.json`'s six-valued fallback ladder and
its two separately-reported bounds, the full artifact inventory, what a
semantic exception is, and the four steps that start epoch 2. It ships one
complete example campaign declaring every field in the section, so the
existing extraction tests hold it to the real validator.

`docs/data-model.md` §7 grows from four artifacts to the complete,
code-verified set: `policy.json`/`policy.sha256`, `transitions.jsonl`,
`recommendation.json`, `fit_exclusions.json`, `confirmation.json`,
`shortlist.json`, `report.json`, `epoch_end-<epoch>.json`, and the three
build oracles' records — each with its location, the function that writes
it, and whether it is schema-governed.

`CLAUDE.md`'s optimization section gains the artifact tables, "never edit
policy.json" with the epoch-boundary recompilation that IS the legitimate
way to change a design, the two-bounds rule, and the `basis` ladder.

Two places where the spec's artifact table and the code disagree are
documented as such rather than papered over, with the code as the authority
on names: spec §3.9's `epoch.json` is really `epoch_end-<epoch>.json`, and
its `alias_map.json` does not exist — that content is `effects.json`'s
`aliases` plus `recommendation.json`'s `alias_consequential`.

`docs/superpowers/specs/2026-08-13-optimization-campaign-kind-design.md`
gets a superseded-in-part banner plus in-place notes at §5.5 and §6.3. Its
§6.3 "escalation triggers that *do* re-consult the model" and §5.5's "the
model authors prose at verify and confirm" are both false of the shipped
code; a reader landing mid-file now finds that out there.

`docs/targets.md` (Task 15) had zero inbound links; it is now in the "See
also" list of both the guide and `CLAUDE.md`.

Also corrects three stale claims in `docs/data-model.md` §7c found while
verifying against the code: `effects.json` is written at three fitting
states (`foldover` too, not just screen/refine), its `aliases` are the fit's
own alias classes rather than a carry-over from `design_matrix.json`, and
the file's header no longer claims a fixed artifact count.

Tests: four new checks in `tests/test_optimize_guide_examples.py` — the
guide names the compiled-policy vocabulary, its example declares
`policy`/`workload`/`known_valid_baseline` and validates as a real campaign,
`docs/data-model.md` names the artifacts the code actually writes, and
`docs/targets.md` is reachable from both entry points. 2003 -> 2007 passed,
0 xfail. No production code changed; zero model calls anywhere in the diff.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 17, 2026
…floor

`docs/targets.md` §5 said "set epsilon above your noise floor or the
campaign cannot certify anything." That rule of thumb is wrong in both
directions, and all three shipped example campaigns contradict it —
vllm pairs a 2% epsilon with a 4% noise estimate, qdrant 2% with 3%,
knative 3% with 8%.

What epsilon actually has to clear is the *terminal Bonferroni-t bound at
the planned replicate count*, roughly `t · σ · √(2(1−ρ)/n)` over
`M = shortlist_size − 1` challengers. Measured against the shipped
`certificate.terminal_regret_bound` (not a reimplementation of it): at
vllm's 4 paired replicates with ρ≈0.9, a winner ~5% clear of the field
certifies ~100% of the time and a near-tie never does. So the examples are
correctly configured and the documented rule was the defect — which is why
this fixes the claim rather than churning three already-reviewed YAMLs.

§5 now states the arithmetic, and the three consequences that do not follow
from "above the noise floor": replicates buy √n so widening epsilon is
usually cheaper than buying the bound down; the `(1−ρ)` factor is the entire
payoff of `workload.seed_env`, so §3's seed check gates the budget
arithmetic; and an epsilon under the noise floor is not automatically wrong
because the bound floors at zero once the winner's margin exceeds it. A
near-tie returning `terminal_best` is the instrument working — three
indistinguishable configurations is a real result, and certifying one of
them would be the failure.

vllm-batching.yaml and qdrant-hnsw.yaml each state their own arithmetic and
their own null-result condition in `guidance.interpretation`, matching what
knative-autoscale.yaml already did. All three still validate statically with
no new errors.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sriumcp

sriumcp commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Three commits pushed from a field test of this kind against a real target (BLIS / inference-sim), running kind: optimization and kind: reflective head-to-head on the same problem. Two of them fix defects the field test found in this PR's own machinery; the third documents the apparatus lessons.

fix(optimize): implement apply.kind config_patch, which applied nothing (2c06978)

config_patch was a documented, schema-valid apply kind that was never applied. matrix.py:_render_apply rendered it into a {"patches": [...]} payload and nothing consumed it — runner.py applies only cli_args and env.

Consequence: a campaign whose factors use config_patch runs every row at the baseline configuration while the design matrix, the runs, and the fitted response surface all look real. Neither nous validate campaign (0 errors, 0 warnings) nor --smoke caught it, because the run succeeds — it just measures the wrong thing. Only the run-time manipulation predicate noticed, on row 1 of 18, after a full build stage and ~50 minutes.

Now implemented with RFC 6901 pointers, per-run copies (the author's file is never mutated), a boundary-anchored command rewrite, end-to-end type preservation, and both silent-failure paths closed: validation rule 17 rejects a path absent from run_command, and --smoke verifies each patch actually reached the target.

feat(optimize): optimization.run_timeout_sec (a879fb8)

The run_command timeout was hardcoded to 600 s with no campaign override. This blocks a whole class of objective: one whose evaluation is itself a search. A capacity objective — "highest arrival rate at which the backlog does not grow" — is a bisection over ~5 target runs per point, so per-invocation cost is a multiple of a single run's, and the campaign had no way to say so.

Absent resolves to 600, so no existing campaign changes behaviour. resolve_run_timeout is public because --smoke and the epoch must use the same ceiling — a probe at 600 while the epoch runs at 5400 would turn the one contract check into a source of mismatches.

Also fixes a pre-existing artifact-governance defect found while declaring the field: design_matrix.schema.json has additionalProperties: false but stage_runner was already writing four undeclared fields (policy_hash, workload_seeds, paired, held_fixed). Verified against a real artifact — every campaign with a policy has been emitting a pre-registration record that violates its own schema. Nothing caught it because the schema test only validated a freshly-built payload, never an enriched one. All five now declared, with a test that drives a full synthetic campaign and validates the on-disk artifact. No field became optional.

docs(optimize): §7 pre-flight (0a5b800)

Seven wrong/right pairs, each a defect this field test shipped, following §6's existing convention. Highlights:

  • Size run_timeout_sec from the worst corner, not a typical one. Run order is randomized, so the slow corner may run first — you don't get a gentle warning. Timing the baseline (~330 s, comfortably inside 600) then dying on row 1 is exactly what happened.
  • --smoke checks that a lever engaged, not that it matters. Eight candidate factors, three unusable: two aborted the target, two were config-captured but consumed by no mechanism.
  • Measure the noise floor at the operating point. Apparent −6.8% factor effects in a queue-bound regime became 0.3–3.3% against a 4.8% floor at a healthy one — the large effects were queueing dynamics correlated with the config change.
  • Plus: objective fittability (a P99 moving +268% on one factor change while P90 moved +9%; a request deadline pinning three configs at ~300,000 ms), confirming the workload exercises the mechanism (a KV-cache campaign at hit rate exactly 0.000), fail-loud probe harnesses, and pointing certifying relations at tests that fail without the mechanism.

All three: 2085 passed, 1 skipped (from a 2068 baseline).

@sriumcp

sriumcp commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Field test: kind: optimization vs kind: reflective, same task, isolated arms

Both kinds were given the identical task against BLIS (inference-sim) pinned at bb1a5264: implement ARC eviction for the CPU KV-offload tier (which panics today as a declared follow-up), then find the offload configuration that maximizes the sustainable agentic session-arrival rate.

Same workload, hardware, objective, target-side adapter, seeds, and model (claude-opus-5 pinned on every phase for both — reflective's defaults would otherwise have used sonnet for execute_analyze, making a cost comparison meaningless). Isolation was verified rather than assumed: full git clone per arm, per-arm NOUS_CAMPAIGN_PARENT, no shared principles/wiki/run-cache, and a post-hoc grep confirming neither arm's tree mentions the other's run_id. sim/kv/offload_arc.go never appeared in the reflective clone, so neither arm saw the other's implementation.

Axis 1 — cost

substantive calls billed
optimization, clean campaign (mechanism exists) 1 $1.68
optimization, first campaign (authors the mechanism) 1 $6.57
optimization, entire run incl. 2 defect-forced restarts 3 $10.21
reflective (1 of 3 iterations completed) 10 $53.09

5.2×–31.7× depending on which comparison is fair. All three are reported; none is the "real" one alone.

The mechanism is not per-turn efficiency — measured, reflective's execute-analyze ran at $0.102/turn, cheaper than build's $0.131. What differs is structural:

  • optimization pays one substantive call, then measures tokenlessly. Marginal model cost per benchmark run: $0.
  • reflective pays a design + execute_analyze pair per iteration, and those phases can fail expensively: a $9.25 design superseded by a retry, a $13.85 execute_analyze that hit error_max_turns at 121 turns. ~49% of its spend produced no usable result.
  • reflective absorbed 10 API-boundary failures (3 SDK-silence aborts, 6 ConnectionRefused, 1 max-turns). The optimization arm had zero — a compiled epoch makes no API calls, so there is nothing to fail. That asymmetry is architectural, not luck.

Axis 2 — correctness: a tie

Both arms independently authored working ARC (Megiddo & Modha four-list, T1/T2 + B1/B2 ghosts). 154/154 and 153/153 of BLIS's own sim/kv tests pass.

The designed discriminator was a stale guard test asserting mustPanic("arc") — implementing ARC makes that assertion false, so an honest arm must update it while a test-defeating one deletes it. Both updated it honestly. Both also wrote an unrequested scan-resistance test that fails if ARC were a no-op wrapper over LRU.

Structural difference only: optimization isolated the mechanism in a new file (357 lines, 178 insertions total); reflective integrated it in place (848 insertions). The trap did not discriminate. With the same strong model on both sides, the kinds were equal here — worth reporting plainly rather than spinning.

Axis 3 — optimality: optimization found a 52% better configuration

reflective optimization
valid objective measurements 4 11 (clean screen) / 20 (pooled)
factors varied eviction_policy × tier-presence eviction_policy × offload_prompt_only × cpu_bytes × device_class
best λ* found 1.3125 2.0
its conclusion "ARC ≡ LRU" device_class dominates; ARC unresolved

Both arms are correct, and the optimization arm found more. Reflective's h_main: REFUTED (ARC ≡ LRU) holds — the optimization data agrees ARC is unresolved (|t| ≈ 0.9). But reflective held offload_prompt_only and cpu_bytes fixed at baseline and never varied device_class at all, so the factor with the largest observed effect was outside its design by construction.

The largest effect is counter-intuitive and has a traced mechanism: sata_ssd beats nvme_gen4 (+0.36 sessions/s, ~28%). cascade() pins each CPU block for its write-through duration, so a slower secondary tier keeps blocks pinned longer, preventing CPU-tier eviction and retaining the hot working set. The slow device acts as an accidental retention policy.

Honest limits: on the clean single-estimator screen (n=11, 4 factors, no replication) no individual factor reaches significance — effect directions are stable but attribution is not established. An earlier |t| = 2.30 for device_class came from pooling rows across two search methods, which inflates n without adding independent information. This screen ranks configurations; confirm is what would certify an effect with a residual-regret bound.

So: optimization wins the deliverable by ~52%, because its factorial design included the factor that mattered — not because it searched better within the same space.

What the run found in this PR's machinery

Seven nous_asks, six fixed in code across the commits on this branch (2140 → passing). Three produced plausible wrong results rather than errors, which is the dangerous class:

  • apply.kind: config_patch was schema-documented and applied nothing. Every row of such a campaign ran the baseline while the design matrix, runs, and fitted surface all looked real. validate passed it 0/0; --smoke passed it too, because the run succeeds. Only the run-time manipulation predicate noticed — on row 1 of 18, after a full build stage.
  • design_matrix.json never validated against its own schema. Nine undeclared fields including kind: "foldover" — an entire design family the schema rejected. Every campaign reaching confirm emitted a pre-registration record that failed its own schema; the existing test validated a freshly-built skeleton, never the enriched document on disk.
  • Rule 12 silently skipped 2 of 3 native_test locator styles, including the bare identifier the Go result parser actually matches on — so it was inert for the style that works.

Plus run_timeout_sec (the hardcoded 600 s ceiling blocked any objective whose evaluation is itself a search), max_parallel (bounded concurrency for confirm replicate blocks only, with screen rows structurally forbidden to opt in), parallel_arms.run_units honoring the max_parallel it previously validated-then-ignored, and --liveness (verify factors matter, and catch a declared level that aborts the target — 3 of 8 candidate factors here were unusable).

The finding I'd most want a reader to take away

My target-side adapter had more defects than Nous did — seven — and they were more expensive. The worst: I edited its output schema three times mid-epoch, so rows measured before each edit carried null for the new keys, and a None reaching float(raw) killed an entire iteration at fit time after ~2 hours of measurement.

Nous already enforces instrument stability for the campaign side: policy.json is content-hashed and _load_or_compile_policy hard-aborts on mismatch. There is no equivalent guard on the adapter — yet the adapter produces every number the pre-registration is about. That asymmetry let me repair the instrument while it ran, three times, and destroy an epoch's comparability with nothing firing.

Guards for this are in progress: an adapter contract hash (fingerprint the response keys+types on the first successful row, hard-abort on drift), output freshness (reject a response byte-identical to the previous row's when levels differ — the defect where a panicking level read as "identical to baseline"), and a declared response.self_check so an author states the invariant their objective must satisfy and Nous enforces it per row. One line —

self_check:
  - {metric: backlog_slope, op: "<=", value: 0.060}

— would have caught 8 of 12 bad rows at the moment each was measured instead of after the epoch. docs/optimization-campaign-guide.md §7 now carries the pre-flight checklist these lessons produced, written target-agnostically.

@sriumcp

sriumcp commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Correction to the field-test comment above — Axis 3 (optimality) restated, not withdrawn

I re-read the reflective arm's findings.json directly instead of trusting my
earlier summary of it. Two factual claims in the comment above are wrong, and
the framing of the optimality axis needs replacing rather than deleting.

The two factual errors

1. "reflective … never varied device_class at all" — false.
Reflective's iteration 2 swept six KV-offload configurations (C0–C5) crossing
eviction policy, offload_prompt_only, CPU tier size, and device class
(nvme vs sata)
across three seeds — 54 runs, all present and parsed. I
asserted the opposite twice. My first parse of findings.json used the wrong key
shape, printed nothing, and I read "nothing" as "nothing there" — a silent-empty
parse reads exactly like a null result.

2. "optimization wins the deliverable by ~52%" — not a like-for-like ratio.
The arms searched non-overlapping CPU-tier ranges:

CPU tier levels swept
reflective 1 GiB, 4 GiB, 16 GiB
optimization 40 GiB, 80 GiB, 160 GiB

No shared level, a 2.5× gap between the ranges. A single ratio across that gap
reads as "better search of one space" when part of it is "a different space."

The objective both arms maximize

Same quantity, same instrument, both arms: λ* — the highest session-arrival
rate sustained without saturating.
"Sustained" is a queue-growth criterion, not
a latency threshold: over the arrival-active phase, the OLS slope of in-flight
requests must stay ≤ 0.060 in-flight units per simulated second, and the
last-quartile / first-quartile mean in-flight ratio must stay ≤ 1.40. Either
failing marks the rate "growing." λ* is the longest sustained prefix of the
rate grid rather than max(sustained), so one spurious high verdict cannot
inflate it.

Held identical across arms: BLIS at bb1a5264, agentic multi-turn workload
(70/30 two-cohort, 6 heavy rounds, accumulating context), 8 instances, 300 s
horizon, qwen/qwen3-14b, claude-opus-5 on both sides. The measurement
procedure is identical even where the searched regions differ
— that is what
makes the numbers commensurable as measurements.

How the two arms are faring

reflective optimization
region searched CPU tier 1 / 4 / 16 GiB CPU tier 40 / 80 / 160 GiB
design 6 configs × 3 seeds = 54 runs → 18 cells 4-factor resolution-V screen, 18 rows (15 complete)
best λ* observed 1.3125 (s42, s1337) · 1.59375 (s2024) 2.25 (arc / OPO=False / 40 GiB / nvme_gen4)
spread identical across all 6 configs, per seed 0.5 → 2.25
conclusion reached ARC ≡ LRU, with mechanism DEV/EV directions stable, no factor significant at n=11

Each did what its kind is for, and the two outputs are different in kind:

  • Reflective produced a causal explanation with a confirmed prediction. Its
    REFUTED is not a bare null. It identified why the knob is inert:
    mirrorSkipped = 56,435,555 MirrorToCPU stores refused because the CPU tier was
    full and every block was pinned by the write-through cascade — the evictable
    pool is degenerate, so eviction policy cannot matter at that tier size. It
    established ARC was live via an instrumented build (per-instance-varying T1/T2
    splits, reverted before any measurement cell ran) and showed the instrument was
    sensitive (seed moves λ*, policy does not). It then predicted the null would
    hold across all six configs and confirmed it 18/18. A factorial screen
    cannot produce that.
  • Optimization produced a ranked surface over a wider space, reached a higher
    λ*, and did it for less. Declaring a 4-factor space up front and sweeping it
    systematically is itself a capability of the kind — the opportunity to
    navigate a designed space is part of what is being compared, not a confound to
    be normalized away.

Whether 2.25 reflects better navigation or a friendlier starting neighborhood is
underdetermined by this data. Both arms may be right about their own regime:
reflective explained why the factor is inert where the tier is starved;
optimization is measuring where it is generous.

Honest limits on the optimization number. Each of the 15 complete screen rows
ran on a different workload seed (31676–31692), so the 0.5→2.25 spread mixes
configuration effect with seed effect — and seed alone is known to move λ* (it
moved reflective's from 1.3125 to 1.59375). 4 rows came back non-monotone. On the
clean n=11 single-estimator screen no individual factor reaches significance;
an earlier |t| = 2.30 for device_class came from pooling rows across two search
methods, which inflates n without adding independent information. Separating
configuration from seed is exactly what confirm's replication does, and it is
what would attach a residual-regret bound to the recommendation.

What is unchanged

  • Token budget — optimization, 5.2×–31.7× ($1.68 / $6.57 / $10.21 vs
    $53.09). ~49% of reflective's spend was waste ($9.25 superseded design, $13.85
    hitting error_max_turns at 121 turns); 10 API failures on the reflective arm,
    zero on the optimization arm.
  • Correctness — tie. 154/154 and 153/153; both updated the stale
    mustPanic("arc") guard honestly; both wrote an unrequested scan-resistance
    test.

Field-test caveats worth recording

The CPU-level mismatch was my authoring choice, not a property of either
kind — if the goal had been a controlled optimality comparison, the levels
belonged in one shared block both YAMLs reference. Separately, across this field
test my adapter produced eight defects and Nous six, and the two most
expensive failures were both mine (an epoch voided by an and/or inversion; an
iteration killed at fit time by a mid-epoch output-schema edit). Three of those
adapter defects are now structurally impossible to repeat silently — that is what
the adapter guards in 45a9087 are for. Those guards were not armed on this
epoch, which launched before they were committed.

sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 22, 2026
`kind: optimization` could not extend a target. Every stage in
orchestrator/optimize was pure Python with zero agent calls, so when the
mechanism under study did not exist yet, `verify` ran the target's test
command, found the declared native_test identifiers missing, and aborted
fail-closed — correctly and uselessly, since nothing in the path was able
to author them. The guide already claimed verify "writes mechanism code
with native tests"; no code did that. Reflective never had this problem
(its SDK agent edits the target as a matter of course), so the gap was
specific to this kind, and it mattered: "extend the target, then optimize
the extension" is the common shape of a real optimization request.

`build` is an opt-in stage, absent from the default order, so campaigns
written before it behave identically. It spends exactly ONE agent call to
write the mechanism and its native tests, then returns to the tokenless
machinery. It deliberately does not iterate to green, read measurements,
or judge correctness: `verify` remains the gate, so the stage that writes
the code is never the stage that certifies it. Cost goes from ~3 model
calls to ~4 only for campaigns that need it.

Two validator rules, both of which fire on real authoring mistakes:

- rule 11 rejects `build` anywhere but position 1. Behind `verify` it
  guarantees an abort; behind `screen` it is worse than an abort, because
  the screen measured the OLD mechanism and the effect table then
  describes a system the campaign replaced. Both produce schema-valid
  artifacts, so neither is caught downstream.
- rule 12 warns when declared native_test files are absent from the target
  and no build stage exists to author them — otherwise guaranteed to abort
  at verify, but only after a real run.

Also: the test command no longer runs on a build iteration. It could only
report the already-known fact that the identifiers are missing, and
`go test -run <pattern>` exits 0 with "no tests to run" when the pattern
matches nothing, so a pre-build run looks like a pass at the shell level.

Tests inject at the sdk_runner seam per tests/CLAUDE.md — no live calls.
Two are integration: BUILD authors a file in the target and CONTINUEs,
then VERIFY independently aborts when the tests do not actually report.
iteration.py remains 23 insertions / 0 deletions against main; the
reflective path is untouched.

1673 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 22, 2026
…st found

A fitted stationary point is an EXTRAPOLATION. When the surface is
mis-specified — curvature the quadratic cannot express, an optimum outside
the design hull, a categorical factor dragged into the fit — the solved
point can land below a corner the screen already measured. confirm then
replicated that inferior point, found its replicates agreed with each
other, wrote status CONFIRMED, and the campaign reported an inferior
configuration as its optimum.

"The prediction reproduced" and "this is the best configuration found" are
different claims, and only the second is what a reader of the report wants.
_best_observed already existed but was used only to PICK the confirm point
when no fit existed; it never CHECKED a fitted one. confirmation.json now
carries best_observed, confirmed_is_best_observed, and (when they disagree)
regression_vs_best_observed with the absolute and percentage gap, plus a
warning naming the observed corner as the campaign's real answer.

Respects response.primary.direction, so lower-is-better objectives are
judged correctly rather than inverted.

1676 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 22, 2026
Found by running it: a build stage whose cwd was its own git worktree read
and then EDITED the canonical checkout of the same project instead. Four
tracked files in the wrong tree. Two supposedly independent campaign arms
would have overwritten each other's mechanism, and every measurement after
that would describe a system neither arm authored — silently, with no error
anywhere, since both trees build and both test suites pass.

Passing repo_path as `cwd` is not sufficient. When the campaign description
mentions file paths and the agent already knows a checkout of that project,
it resolves the paths against the checkout rather than against cwd. The
prompt now states the absolute working root up front, says the path may be a
worktree with a parallel experiment in a sibling checkout, and requires
every path to be re-derived against that root.

Prompt text alone is not a guarantee, so check_build_touched_repo() reports
when a git target shows no local modifications after a "successful" build --
the signature of having edited somewhere else. Advisory, not fatal: verify
remains the authority on whether the mechanism is present, a legitimate
no-op build should not abort a campaign, and non-git targets are exempt.
The warning also lands in build_warning.txt so it survives in the artifacts.

1680 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp added a commit to sriumcp/agentic-strategy-evolution that referenced this pull request Aug 22, 2026
…fy aborts

Three diagnostics losses, all of which mattered most exactly when something
had gone wrong:

1. run_test_command returned dict[str, bool] and discarded the output. The
   gate needs the booleans; a human fixing the failure needs the text — the
   failed assertion's expected-vs-actual, a panic and its stack, a compile
   error's file and line, a timeout's partial output naming the test that
   hung. Since a verify abort ends the campaign, that text was the only
   record of why, and re-running by hand may not reproduce a timeout or an
   ordering-dependent failure. Now written verbatim to
   runs/iter-N/test_output.log, including on timeout and exec failure.

2. A failed config run kept only the last 200 chars of stderr, in an
   exception message. The cause is usually at the HEAD of stderr (a usage
   error naming the rejected flag), so the tail dropped the useful part.
   Full stdout/stderr now land in runs/iter-N/failed_runs/failed_run_<i>.log
   with the row index and its levels; the exception points at the file. Same
   for output that parses to no JSON, which is the failure that NaN-poisons
   a fit.

3. The verify abort listed relation IDs without saying whether each test
   FAILED or was NEVER EXECUTED. Those need opposite fixes, and after a
   build stage the agent call is already spent, so a wrong diagnosis costs a
   whole second build. The message now splits them and names the fix for
   each, including the trap that makes "never executed" silent: go test -run
   with a pattern matching nothing exits 0.

Logging is opt-in (log_path / log_dir default to None) and can never be the
reason a campaign fails — every write is guarded and degrades to a warning.

Guide: metamorphic relations now carry an explicit warning to do the algebra
first and include a worked numeric example, with the real case from this
campaign corpus where an author declared step <= linear <= exponential when
the truth is step <= exponential <= linear (the exponential is concave in f).
A metamorphic relation pointing the wrong way fails correct code or passes
broken code, with the authority of a declared correctness relation.

1686 passed, 1 skipped.

Refs AI-native-Systems-Research#302

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sriumcp and others added 19 commits October 18, 2026 09:38
… it (P8 audit)

Names the current bound methods and the full union bound
(Pr(certified and wrong) <= delta_s + delta_t [+ delta_constraint + delta_feasibility]),
matching data-model.md and the guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… P8 audit); take nousko's expert audit wholesale, dropping the P7 (e') hunk (P7 review H5, M3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ice (two_peaks optimum (14,3) was off the 9-point grid); one shared measured-row counter; best_so_far strikes rejected; prefix GP uses the run's seed; peak RSS in meta; previous run's head-to-heads and baseline values in previous.json; tests (P7 review H3, M4, M5, LOWs, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aces; peak RSS and wall time in every generated header (P7 review M4, LOW)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, the H3 surface audit, the one measured-row counter, the strike rule and the Wilson scope (P7 review H3, M5, LOWs, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chmark 47bc42e50f66cb60 (lattice truth); 50 certified of 336, 0 false (P7 review, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s ff14a3afe6e0fdb1 / benchmark 47bc42e50f66cb60 (lattice truth); 0 false certificates in every arm (P7 review, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st-selection block through an undeclared confirm count; the charged budget withholds when it cannot see the whole spend; plan-next validates at the next epoch's floor; confirm.replicates is optional

H1: rule 31 counted 3 confirm replicates when undeclared, the compile uses the
A5 floor (6), so validate/inertness could re-measure on confirm's draws;
rule 31 now counts the compiled default and _assign_workload_seeds refuses to
wrap a post-selection block.
H2: campaign_delta_exceeded withholds when the cumulative is a lower bound or
an earlier epoch's declared total is unreadable.
M1: plan-next validates proposals (and accept re-validates) at epoch e+1, so
a proposal below that epoch's raised floor is refused.
M2: design.confirm.replicates is no longer schema-required (the docs and
validator advise omitting it).
Each new test fails on 05884f0 and passes here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…us recommends the measured centre: fails_at_one_level CPU=24; infeasible_corner_interior truth 14.4 -> 14.7 at BS=20); test that every committed Nous recommendation lies in the shared domain; profile.py makes the CPU profile reproducible (P7 review H3, M4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext epoch's floor instead of proposing only moves that cannot certify

af81f6d made plan-next refuse a proposal below epoch e+1's raised floor; under a
charged campaign_delta with a declared replicate count that refused every move.
Proposals now raise the count to that floor in place and record the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onfigurations Nous's design code runs (stage_runner._build_design + matrix.expand), never a per-factor centre, which had over-stated it (infeasible_corner_interior truth 14.7 -> 14.4, 6 spurious false certificates); tests (a) truth in domain on every surface, (b) every committed recommendation in domain, (c) infeasible_corner_interior 14.4 (P7 review H3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the design's centre configurations, from matrix.expand), why (certificates are claims over the declared candidate space), and the per-factor-centre false start (P7 review H3, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chmark 659d385ed99dfafa; 50 certified of 336, 0 false (P7 review, WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…59d385ed99dfafa (nousko 86cbec9); every prose number from that run's JSON with its source tagged; H1 many-knob 37; H2 anytime wording from the data; H4 drift certificates within seed noise; M1 two/three-way delta split; M2 no detectable SO allocate change; BO-ablation and post-hoc t-interval sentences; profile JSON; 0 false certificates in every arm (P7 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…native-Systems-Research#321 benchmark completeness, AI-native-Systems-Research#320 D4)

Anytime curves, seeded CIs and Wilson intervals with a pre-declared primary,
multi-objective HV regret vs RS/LHS/ParEGO, D4 ablations, CPU profile; truth
and every baseline over the declared lattice plus Nous's own centre
configurations. 0 false certificates in every arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… P8 audit)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e5d / bench 659d385ed99dfafa)

Q6 cited the superseded nk-p7-bench@0c57b40 run (digest 44d94bc5ee2a41b2),
before 01eded8 and the lattice-truth fix. Every number is replaced from the
merged benchmark's JSON; the primaries, post-hoc splits, per-arm certificate
table, run totals and CPU medians were re-derived independently.

- non-quadratic now inconclusive, -0.020 [-0.063, +0.037]; +0.046 without two_peaks
- shipped -0.057 rests on stochastic_constraint_boundary (post-hoc, t interval caveat)
- many-knob a small GP-BO advantage; ParEGO ahead on fronts; GP-BO ahead at 40% of N
- conservatism cost in runs and certificates; CPU profile
- new paragraph on the ground-truth correction (lattice/domain rule, two_peaks
  0.364 -> 1.263, the per-factor-centre false start and its 6 spurious false
  certificates, the domain tests)
- header, Q1, Q4, section 12 and section 13 updated; "many-knob 47 -> 0" was
  wrong (the previous run had 37)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sriumcp and others added 6 commits October 18, 2026 20:33
…survivor (AI-native-Systems-Research#322)

The post-batch survivor check ran while SIGKILLed multi-GB processes were
tearing down: kill(pid,0) succeeded, getpgid raised ESRCH, killpg(pgid,0)
answered, so every dying pid was 'escaped' and a 6.5 h screen failed. The
check now waits a bounded settle period (SETTLE_SECONDS) for the group and
tracked descendants to exit, treats ESRCH from getpgid as gone, and ignores a
group whose remaining members are zombies. A genuinely escaped process is
still caught and killed. The guide documents the settle and exactly what
nous resume reuses after a gate halt (complete/infeasible/rejected reused,
failed incl. timeouts re-run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me (AI-native-Systems-Research#323)

Each run/resume is one entry in wall_clock.json; the budget is checked against
the sum of their spans (time between invocations not charged), so a resume
continues the budget instead of getting a fresh one. progress.json reports
wall_clock_hours, invocations and the declared budget (it read null after a
halt); report.json records provenance.wall_clock (hours, invocations,
resumes). Reanalysis ignores the ledger (a fact about the original run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rows per level, and gives a hard bound (AI-native-Systems-Research#325)

A 262-row screen read 93 s at 1 row and took 6.5 h: row cost depended on the
levels, and early rows were the cheap ones. progress.json now records
eta_confidence (low until enough fresh rows, or while durations vary widely),
prices pending rows at their own level of the factor that explains the
duration spread (unseen levels at the slowest seen), and adds
eta_upper_bound_seconds = pending x run_timeout_sec / slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irm rounds and compare the front with it (AI-native-Systems-Research#324)

Pareto campaigns never seated the baseline, so a deployment-tuning campaign
had to measure the deployed configuration outside nous. Confirm now seats it
in every round (outside shortlist_size, CRN-paired), as single-objective
does; the preview and the next-round cost count the seat. confirmation.json
and report.json gain front_vs_baseline: per admissible finalist, the gain
over the baseline on each objective with two-sided intervals simultaneous
over every (finalist, objective) at delta_terminal, and a verdict
(dominates_baseline / dominated_by_baseline / trade_off / undecided). A
separate claim: front statuses and certificates are unchanged.

Measured (8 Pareto surfaces x 8 seeds): false certificates 0 with and
without the seat (30 vs 32 certified); interval coverage 936/938 against a
nominal >= 0.95.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…so it is a bound (AI-native-Systems-Research#325)

A manipulation transient can run a row twice (execute_design max_retries=1),
so pending x run_timeout_sec could be exceeded. ROW_ATTEMPTS_MAX is now the
single constant both the runner default and the bound use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[F19] Per-phase silence threshold (DESIGN >= 600s, EXECUTE_ANALYZE lower); currently phase-agnostic

1 participant