Repository navigation
test(prover): make #5891 path-resolution tests portable; pin #6058 staleness - #6249
Merged
Merged
Conversation
The two #5891 regression tests (test_path_constants_resolve_to_active_workspace, test_candidates_list_prefers_workspace_relative_entry) hardcoded the literal "CoursIA-2" as the *expected* resolved tree. But the contract landed by #5889 is layout-agnostic: _workspace_root() walks Path(__file__).parents for the MyIA.AI.Notebooks ancestor, so the harness resolves into whichever checkout it ships in (CoursIA OR CoursIA-2). The tests passed only when run from a CoursIA-2 physical checkout and failed from the canonical CoursIA tree (and from any CI fresh clone). Rewrite both tests to assert the contract via _WORKSPACE_ROOT (p.resolve().is_relative_to(_WORKSPACE_ROOT)), using path-component comparison to avoid the C:\dev\CoursIA / CoursIA-2 string-prefix pitfall. Equal regression-catching power (a CoursIA-2 invocation resolving to the CoursIA sibling still fails the check), now portable. Making the existence assertion actually run surfaced a second, real regression: VOTING_FILE and GALESHAPLEY_FILE were moved into game_theory_lean by the #4365 anti-proliferation absorption (#5913 StableMarriage, #6058 SocialChoice, both 2026-07-10/11), but prover/config.py still derives them from the now-gutted social_choice_lean / stable_marriage_lean dirs — the prover cannot target those demos post-absorption. Rather than weaken the existence check or conflate it with the #5891 contract, pin the stale state (not p.exists()) with an inline cross-ref so the follow-up config.py fix flips it red and forces the test to drop the STALE_POST_ABSORPTION entry. The fix to config.py is deferred to a follow-up because it touches the prover's lake build-dir semantics (ai-01's BG-iter planning turf) and the demo line numbers/sorry targets also need rehabilitation. Verified: 145/145 pass from the CoursIA tree (was 143/145, 2 layout failures). No code change, no Lean build impact. Co-Authored-By: Claude <noreply@anthropic.com>
jsboige
commented
Jul 12, 2026
jsboige
left a comment
Owner
Author
There was a problem hiding this comment.
[Hermes] ✅ Test portability fix solide. Switch des assertions hardcodées "CoursIA-2" → contract-based via _WORKSPACE_ROOT.is_relative_to() — évite bien le string-prefix pitfall (C:\\dev\\CoursIA est prefix de C:\\dev\\CoursIA-2). Pattern STALE_POST_ABSORPTION (fail-when-fixed) élégant pour pin #6058. Security: 0 token/secret. Self-review cap → COMMENT.
myia-ai-01
approved these changes
Jul 12, 2026
myia-ai-01
left a comment
Collaborator
There was a problem hiding this comment.
ai-01 coordinator approve: worker-reviewed MERGEABLE, gates verified (H.4 exec-trailer / catalog byte-identity / CI-green build / scope=title). Batch drain of accumulated backlog.
jsboige
added a commit
that referenced
this pull request
Jul 12, 2026
…6252) SearchAgent._search_via_lsp ran `exact?` then `apply?` SEQUENTIALLY, each a `lake env lean --stdin` subprocess. Per-call cost is dominated by Mathlib import elaboration (~98 s on a heavy module), so the sequential loop is ~196 s wall-clock — both calls routinely overrun the 120 s per-call timeout on complex P4/P5 goals and return empty. The SearchAgent then falls back to the LLM with zero Mathlib hints, which is the root cause of the empty-LSP traces on the P4 mono-verrou (p4_succ_membership) blocking the Hashlife N3/W3 track. Run both tactics concurrently via ThreadPoolExecutor. Wall-clock collapses to ~max(single call), so at least one tactic tends to land before the timeout. The change is additive and local to _search_via_lsp: - verifier.search_lean contract is UNCHANGED (one tactic per call, same parsing, same per-call attribution) — no verifier/test-protocol churn on ai-01's turf. - suggestions are returned in fixed order (exact? first, apply? second) regardless of completion order, so downstream consumers see no behavioral diff beyond faster + more results. - one tactic failing no longer poisons the other (the old loop short-circuited on exception via the outer try; now each future's exception is logged and the surviving tactic's results are kept). Tests (test_prover_guards.py): - test_search_via_lsp_runs_both_tactics_and_preserves_order - test_search_via_lsp_resilient_to_one_tactic_failing - test_search_via_lsp_empty_when_verifier_unavailable Stacked on #6249 (both touch test_prover_guards.py). Verified locally: 3/3 new tests pass; full suite green on the stacked base (148/148). Co-authored-by: Claude <noreply@anthropic.com>
jsboige
added a commit
that referenced
this pull request
Jul 12, 2026
…theory_lean (#6274) prover/config.py still derived VOTING_FILE, GALESHAPLEY_FILE (and siblings GSSTATE_FILE, LEMMAS_FILE, LATTICE_FILE, SMOKE_TEST_FILE) from the social_choice_lean / stable_marriage_lean dirs. Both lakes were gutted by the #4365 anti-proliferation absorption: - StableMarriage absorbed into game_theory_lean via #5904-#5913 (2026-07-10) - SocialChoice (Arrow+Sen+Voting) absorbed into game_theory_lean via #6058 (2026-07-11) The legacy dirs survive as md-only (FORMAL_STATUS/README/NOTICE) — their SocialChoice/*.lean and StableMarriage/*.lean are gone. Because the dir itself still exists, SOCIAL_CHOICE_DIR.exists() returns True and resolves to the legacy dir, but VOTING_FILE = legacy/SocialChoice/Voting.lean points at a non-existent path. 11 demo references in config.py are dead. Fix: prepend _workspace_relative('GameTheory/game_theory_lean') to both _SOCIAL_CHOICE_CANDIDATES and _STABLE_MARRIAGE_CANDIDATES, so the canonical post-absorption home wins. Verified firsthand: all 6 FILE constants now resolve to existing paths under game_theory_lean/ (both DIRs resolve to game_theory_lean, SocialChoice/Voting.lean + StableMarriage/{GSState, GaleShapley,Lemmas,Lattice}.lean all exist). Not ai-01 turf (despite the issue framing): G.1 verified the DIRs are consumed ONLY in config.py itself to derive FILE paths — no lake build uses them as cwd. lake build cwd is resolved via resolve_lake_module() from the FILE path, which will correctly find the game_theory_lean lake root. The legacy dirs remain in the candidate lists as fallbacks. This is step 2 of the workflow pinned by #6249 (test_prover_guards STALE_POST_ABSORPTION = {VOTING_FILE, GALESHAPLEY_FILE}): once this lands the pin's follow-up can drop the set to re-assert full existence. Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige
added a commit
that referenced
this pull request
Jul 12, 2026
…d by concurrent-merge race, #6252) (#6297) SearchAgent._search_via_lsp ran `exact?` then `apply?` SEQUENTIALLY, each a `lake env lean --stdin` subprocess. Per-call cost is dominated by Mathlib import elaboration (~98 s on a heavy module), so the sequential loop is ~196 s wall-clock — both calls routinely overrun the 120 s per-call timeout on complex P4/P5 goals and return empty. The SearchAgent then falls back to the LLM with zero Mathlib hints, which is the root cause of the empty-LSP traces on the P4 mono-verrou (p4_succ_membership) blocking the Hashlife N3/W3 track. Run both tactics concurrently via ThreadPoolExecutor. Wall-clock collapses to ~max(single call), so at least one tactic tends to land before the timeout. The change is additive and local to _search_via_lsp: - verifier.search_lean contract is UNCHANGED (one tactic per call, same parsing, same per-call attribution) — no verifier/test-protocol churn on ai-01's turf. - suggestions are returned in fixed order (exact? first, apply? second) regardless of completion order, so downstream consumers see no behavioral diff beyond faster + more results. - one tactic failing no longer poisons the other (the old loop short-circuited on exception via the outer try; now each future's exception is logged and the surviving tactic's results are kept). Tests (test_prover_guards.py): - test_search_via_lsp_runs_both_tactics_and_preserves_order - test_search_via_lsp_resilient_to_one_tactic_failing - test_search_via_lsp_empty_when_verifier_unavailable Stacked on #6249 (both touch test_prover_guards.py). Verified locally: 3/3 new tests pass; full suite green on the stacked base (148/148). Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the two
#5891path-resolution regression tests intest_prover_guards.pyportable (they hardcoded the literal"CoursIA-2"and only passed from a CoursIA-2 physical checkout) and pins a second, real config.py regression the portability fix surfaced.Why
#5889(2026-07-10T11:20Z) added_workspace_root()— an ancestor walk overPath(__file__).parentsthat finds theMyIA.AI.Notebooks/hostingconfig.py. The contract is layout-agnostic: the harness resolves into whichever checkout it ships in (CoursIA OR CoursIA-2), never a sibling. But the two regression tests asserted the value"CoursIA-2"rather than the contract, so they:C:\dev\CoursIA-2\physical checkout,C:\dev\CoursIA\tree (and any CI fresh clone).This is exactly the kind of layout-coupling the harness rule (lean-merge-discipline) and G.1 want caught.
Changes
1. Portable contract assertions (both tests)
WRONG_TREE = re.compile(r"C:\\dev\\CoursIA\\")+REAL_TREE = re.compile(r"C:\\dev\\CoursIA-2\\")p.resolve().is_relative_to(_WORKSPACE_ROOT)assert "CoursIA-2" in firstfirst.resolve().is_relative_to(_WORKSPACE_ROOT)is_relative_todoes path-component comparison, avoiding the string-prefix pitfall (C:\dev\CoursIAis a string prefix ofC:\dev\CoursIA-2). Equal regression-catching power: a CoursIA-2 invocation that leaks to the CoursIA sibling still fails the check.2. Pin the #6058/#5913 absorption staleness (not weakness)
Making
assert p.exists()actually run surfaced thatVOTING_FILEandGALESHAPLEY_FILEresolve to non-existent paths — the files were moved intogame_theory_leanby the #4365 absorption (#5913 StableMarriage, #6058 SocialChoice), butprover/config.pywas never updated. Rather than weaken the existence check or conflate it with the #5891 contract, the test now pins the stale state:The config.py fix is deferred to #6248 — it touches the prover's lake build-dir semantics (ai-01's BG-iter planning turf) and the demo line numbers/sorry targets also need rehabilitation (e.g.
median_voter_theorem_strictwas already proved 2026-05-13).Verification (firsthand, G.1)
python -m pytest test_prover_guards.pyfrom the canonical CoursIA tree: 145/145 pass (was 143/145 with 2 layout failures).prover.configimport confirms 8 OK / 2 MISS (VOTING_FILE,GALESHAPLEY_FILE).findconfirmsVoting.lean/GaleShapley.leannow live only undergame_theory_lean/.gh pr view 5889/5913/6058confirms fix(prover): resolve DEMO paths via MyIA.AI.Notebooks ancestor walk #5889 landed first, absorptions after — the tests were green at fix(prover): resolve DEMO paths via MyIA.AI.Notebooks ancestor walk #5889 merge, broken 28h later by feat(lean,#4365): absorb SocialChoice (Arrow+Sen+Voting FR+EN) into game_theory_lean — anti-proliferation GT 6->2 #6058.No code change, no Lean build impact. Test-only.
See #1453 (prover harness). Follow-up: #6248.