Skip to content

Frontier-resolution certificate + near-duplicate option advisory - #117

Merged
cafzal merged 3 commits into
mainfrom
claude/frontier-resolution
Aug 2, 2026
Merged

Frontier-resolution certificate + near-duplicate option advisory#117
cafzal merged 3 commits into
mainfrom
claude/frontier-resolution

Conversation

@cafzal

@cafzal cafzal commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What changed

Two additions, both generalized from patterns surveyed in external optimization tooling and reduced to what Frontier didn't already have.

frontier_resolution block in the explore certify certificate (engine/explorer.py). Where coverage/completeness audit the NSGA and exact runs against each other, this bounds the reported frontier against the true continuous frontier: on a 2-objective LP/QP overlay, the certified points' chords (above, by convexity) and their own ε-floor shadow-price tangents (below, by the envelope theorem) sandwich the tradeoff curve; a dual-free monotonicity floor covers segments without a priced tangent, so a missing dual loosens the bound rather than voiding it. The widest chord-to-envelope gap is a certified resolution — "between the anchors, no feasible plan improves the primary over straight-line interpolation of the certified points by more than X" — the frontier-side sibling of explore audit's whole-region guarantee. Consumes only duals already on the run (no extra solves); present-as-null on shapes that can't carry the claim (3+ objectives, integer overlays, no tension), matching completeness. The widest segment is named with its endpoint solution ids as a targeted-tightening handle.

near_duplicate_options advisory in data_metrics (engine/metrics.py). Pairs of complete-scored options within 2% of each objective's score spread on every objective — the "same bet entered twice" case strict dominance structurally misses (an exact tie dominates nothing). Advisory only: capped at 10 pairs + total (the dominated_options convention); the engine flags, the user merges or confirms. A dominated-by-a-hair twin rides both lists; the skill copy says the twin read ("pick either") is the truthful framing there.

Shared cleanups from review: _floor_dual + _FLOOR_ROLES extraction (the ε-floor role tuple had 6 literal sites), _complete_options shared between the dominance and twin detectors.

Docs: architecture.md (certify tool row, Solver Backends paragraph, data-metrics diagram), README (one clause), solution_interpreter › Reading the Certificate (new block paragraph, fixed a stale block count), data_collection › Score Quality Signals (twin bullet), explore tool docstring.

Review and testing

  • Full suite green: 894 passed / 2 skipped, including resolver-integrity, wire-compactness, and UI suites.
  • New tests: hand-checkable sandwich geometry (parabola with exact duals — gap values verified by hand), monotonicity-floor survival with a missing dual, widest-segment localization, 3-objective / no-duals / no-tension gates, and a real HiGHS end-to-end on an inline 2-objective mean-variance QP (every bundled example is 3+ objectives, where the block correctly returns null). Twin detection: exact ties, near-ties, both-lists case, flat-axis handling, cap+total, incomplete-score exclusion.
  • Four-angle quality review (reuse / simplification / efficiency / altitude) applied; skips noted in the plan doc.
  • User-tested per the frontier-dev method: in-process handler flow, a real MCP stdio-transport drive (both payloads survive the wire; live QP produced a 0.1%-of-span resolution with all 52 segments dual-tightened), and an agent-in-the-loop session on a realistic five-fund allocation task — the agent surfaced the twin pair as its top verification caveat and presented the resolution claim correctly scoped, without inflating it to global optimality. The live installed server was not restarted (the main checkout is on another session's in-flight branch); the wire test spawns the worktree server via the test_mcp_stdio_source.py bootstrap.

The agent test also surfaced pre-existing payload frictions outside this diff (the exact: false flag beside solver_used: "highs"; knee rationale at corner-adjacent inflections; regret id-space mixing; hypervolume scale mismatch across payloads) — filed separately, not addressed here.

cafzal added 3 commits July 31, 2026 14:29
CI failed test_certify_explicit_run_ids with KeyError: 'run_id'. Not a
behavior change — a race.

`solve run` returns the result inline when it finishes inside the wait budget
and a {status:"running", job_id} handle otherwise, so which branch a caller
gets depends on machine speed. TestCertify subscripted ["run_id"] directly, so
it passes on a fast machine and fails on a slower runner. The CI timings put
these exact HiGHS solves right at the boundary — the failing test at 10.01s
and its sibling at 18.62s, against a ~10s inline budget.

Adds TestCertify._run: poll `solve status` when handed a handle, then take the
run id. Applied to all six solves in the class, since any of them can cross the
threshold, not just the one that happened to fail.

Verified by forcing the backgrounded path (wait_seconds=0 on every run) — the
helper resolves where the bare subscript raised. Certify tests 11 passed.

Note for the surface, not fixed here: test_solve_async documents the assumption
that "a tiny solve finishes within the inline budget." A small binary problem's
exact solve sitting at that boundary on ordinary hardware suggests the advertised
scale band is optimistic — the corpus runs showed the same thing at 300 options
(~100s, 8 polls, still reported as "interactive").
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.

1 participant