Skip to content

création du doscier projet - #5

Merged
jsboige merged 4 commits into
jsboige:mainfrom
Cleooooooooooooooo:main
Feb 10, 2025
Merged

jsboige merged 4 commits into
jsboige:mainfrom
Cleooooooooooooooo:main

Conversation

@Cleooooooooooooooo

Copy link
Copy Markdown
Contributor

No description provided.

@jsboige
jsboige merged commit 5746f23 into jsboige:main Feb 10, 2025
jsboige added a commit that referenced this pull request Feb 25, 2026
Added challenges to additional notebooks:
- Challenge #5 (1.5 pts): Mini RAG system - 5_RAG_Modern.ipynb
- Challenge #6 (1 pt): Thematic music composition - 02-3-MusicGen-Generation.ipynb
- Challenge #7 (1.5 pts): Automated video slideshow - 01-1-Video-Operations-Basics.ipynb

Total challenges available: 7
Total points possible: 9 pts (on 20 scale)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Mar 20, 2026
Search-6 (Adversarial Search): add Negamax and Tournament exercises (#5, #6)
Search-7 (MCTS): add Nim game and Convergence analysis exercises (#6, #7)

All exercises follow the TODO + hints + empty skeleton pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
clusterManager-Myia pushed a commit that referenced this pull request May 4, 2026
* fix(hermes): train_dqn_rl path typo + snapshot gitignore + dead code removal

- Fix `parent_parent_parent` typo in train_dqn_rl.py:33 → `.parent.parent.parent`
  (Path has no .parent_parent_parent attribute, would crash at import)
- Add projects_snapshot.json to .gitignore + untrack (6833 lines of raw MCP data,
  regenerable via audit_projects.py)
- Remove dead classify_error() in diagnose_broken.py (unused, inline version in
  diagnose_notebook() is the actual classifier)

Addresses Hermes audit items #1 (CRITICAL), #5 (ANGLE MORT), #8 (ANGLE MORT).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(quantconnect): audit_projects O(n^2) fix + error handling

- Build name_index once in generate_report() and pass to classify_project()
  instead of rebuilding on every call (O(n^2) → O(n))
- Add FileNotFoundError/JSONDecodeError handling in load_projects() and
  load_catalog() with user-friendly error messages
- Eliminate redundant second classify_project() call in main() summary by
  reusing the name_index pattern

Addresses Hermes audit items #9, #10, #11.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(lint): notebook_lint 3 bug fixes + 29 tests (29/29 pass)

- _is_in_docstring: was_in_doc tracking for correct (state, is_inside)
- 1/0 regex: (?<!\d) lookbehind + inline comment stripping before matching
- lint_notebook: FileNotFoundError handling for missing files
- test_notebook_lint.py: 29 tests across 6 classes with realistic helpers

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(scripts): add JSON parse error handling to 3 catalog-reading scripts

catalog_coverage.py, batch_reexecute.py, diagnose_broken.py now wrap
json.loads() with try/except for JSONDecodeError/UnicodeDecodeError.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(qc): FeatureEngineer parquet cache hash via sidecar .hash file

pd.read_parquet() does not reliably preserve DataFrame.attrs, causing
cache invalidation to fail (data_hash always None). Fix: store hash in
a separate .hash file alongside the parquet, restore in load_cache().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
simonnaulet pushed a commit to simonnaulet/CoursIA that referenced this pull request May 18, 2026
…26 (jsboige#833)

Background: po-2026 dashboard post 2026-05-08T21:22:58Z documented 5 issues
on the multi-agent prover after the Cycle 12 baseline run on
median_voter_theorem (Voting.lean L251). This PR addresses jsboige#1 / jsboige#2 / jsboige#3 —
the three blockers that made the prover unsafe and unusable on external
LLM providers.

CRITICAL jsboige#1 — `lean_server` import was path-dependent (verifier.py)
  Before: `from lean_server import LeanVerifier` only resolved when the
  caller's cwd was `agent_tests/`. From any other context (tests,
  notebooks, sub-process) it raised `ModuleNotFoundError` and either
  crashed the prover or — worse — was caught silently and made compile()
  return success=True regardless of build state.
  Fix: spec-based import via `importlib.util.spec_from_file_location`
  using `Path(__file__).parent.parent / "lean_server.py"`. Idempotent
  via a module-level cache. The verifier now works regardless of cwd.

HIGH jsboige#3 — sorry guard was bypassable (tools.py)
  Before: the guard only counted occurrences of the literal token
  "sorry". An LLM could "improve" sorry_count by inserting `exact _`,
  `exact ?_`, `admit`, bare `_`, etc. — all non-compiling placeholders
  that look like progress.
  Fix:
   - new `_check_stub_guard()` rejects 6 known placeholder patterns
     before writing
   - new `_build_check_or_revert()` runs `lake build` after each write
     and reverts the file on failure
   - both `file_replace_sorry` and `file_replace_lines` gain a
     `build_check=True` default; callers can opt out for speed but the
     prover loop now never operates on a broken file

HIGH jsboige#2 — multi-agent workflow could hang forever (workflow.py + provers.py)
  Before: `AgentExecutor.handle()` did `await self._agent.run(...)` with
  no timeout. A stalled provider (zai/openrouter occasionally do)
  blocked the entire graph. There was also no iteration cap on the
  cyclic critic→tactic→verify subgraph.
  Fix:
   - per-agent timeout (default 90s) via `asyncio.wait_for`
   - `ProofMessage.iteration` increments on every traversal; when it
     exceeds `max_iterations` the executor yields output instead of
     looping
   - `MultiAgentSorryProver.prove_sorry()` wraps `workflow.run()` in a
     wall-clock `asyncio.wait_for` (default `max_iterations * 120s`)

Tests
  New `agent_tests/tests/test_prover_guards.py` (20 tests, all passing):
   - lean_server class loads via spec import (CRITICAL jsboige#1)
   - get_verifier instantiates with explicit project_dir
   - 6 stub patterns rejected by `_check_stub_guard`
   - 7 real tactics accepted by `_check_stub_guard`
   - comments containing `exact _` ignored
   - `file_replace_sorry` blocks `exact _` without writing
   - `file_replace_sorry` writes a real tactic
   - `ProofMessage` carries iteration cap + bounded default timeout
   - `MultiAgentSorryProver.prove_sorry` exposes workflow_timeout_s

Install
  New `agent_tests/requirements.txt` documents the prover deps:
  `agent-framework-openai>=1.3.0`, `openai>=2.0.0`, `python-dotenv`,
  `pytest`, `pytest-asyncio`. Verified by installing into
  `coursia-ml-training` env and running the 20 tests.

Out of scope (po-2026 issues jsboige#4 / jsboige#5)
  jsboige#4 (goal extraction cascading errors on Voting.lean) and jsboige#5 (LLM
  selection) are separate concerns — jsboige#4 needs Voting.lean fixes upstream,
  jsboige#5 is a config call left to the operator. Both are tracked under jsboige#833.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
* feat(prover): add LeanExplore semantic search integration (#1401)

Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(prover): consolidate 2 LeanExplore init-clients into shared module function

- Extract _get_leanexplore_client() as lazy module-level singleton
- Replace broken self._init_leanexplore() call in SearchTools.search_leanexplore()
- Replace inline init code in CoordinatorTools.search_mathlib_lemmas()
- Verified: both tools import and run without LEANEXPLORE_API_KEY set

Addresses ai-01 review feedback on PR #1443.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
* feat(prover): add LeanExplore semantic search integration (#1401)

Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(prover): consolidate 2 LeanExplore init-clients into shared module function

- Extract _get_leanexplore_client() as lazy module-level singleton
- Replace broken self._init_leanexplore() call in SearchTools.search_leanexplore()
- Replace inline init code in CoordinatorTools.search_mathlib_lemmas()
- Verified: both tools import and run without LEANEXPLORE_API_KEY set

Addresses ai-01 review feedback on PR #1443.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(prover): P1/P2/P3 harness co-evolution deltas (Epic #1453)

P1: No-progress compile detector in VerifyExecutor. Tracks consecutive
iterations with neither proof found nor sorry reduction. >=3 triggers
Director escalation (if available) or yield. Forensic showed 13+ wasted
iterations on targets where TacticAgent probed goals without editing.

P2: Harden success verifier in lean_utils.py. Errors outside the ±5
line nearby_range were silently ignored, causing false successes. Now
collects distant_errors and requires absence of ALL errors in the temp
file. New error_type "distant_errors" reports the issue.

P3: Persistent blocklist for absent identifiers. DirectorAgent's absent
identifier list now accumulates across calls instead of being replaced.
TacticAgent always sees the full blocklist from all Director sessions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(prover): calibration batch 1 — Nash 2x2 targets (Epic #1452)

Add calibration_lean project with 3 self-contained Lean theorems for
Prisoner's Dilemma game theory, designed to exercise specific prover
harness paths (P1/P2/P3) from Epic #1453.

Targets:
- Target C (P3): strictly_domin_defect_pd — strict dominance of defection
- Target D (P2): pd_defect_is_pure_ne — (D,D) is pure Nash equilibrium
- Target E (P1+P2): pd_cooperate_not_ne — (C,C) is NOT a Nash equilibrium

All definitions (Game2x2, strictlyDominates1, isPureNashEquilibrium,
prisonersDilemma) are self-contained — no external imports beyond Mathlib.

Prover config: DEMOS 35/36/37 with file-based sorry_replacement targeting
lines 65/72/80 of Calibration/Nash.lean.

grep -c sorry Calibration/Nash.lean: 3
lake build Calibration.Nash: SUCCESS (3324 jobs, 0 errors)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request May 23, 2026
…to-fix + F1/F2 key fixes (#1463)

* feat(prover): add LeanExplore semantic search integration (#1401)

Integrate lean-explore API as source 1.5 in the lemma search pipeline
(after ProofKnowledgeBase, before LSP exact?/apply?). Uses hybrid
BM25+embedding+PageRank ranking over Mathlib/Batteries/Std.

- SearchTools.search_leanexplore(): lazy-initialized ApiClient, JSON results
- Wired into search_mathlib_lemmas() for both SearchTools and CoordinatorTools
- search_leanexplore exposed as standalone tool on SearchAgent
- Instructions updated (tool #5 in search order)
- Graceful fallback: returns [] when LEANEXPLORE_API_KEY not set
- Zero regression risk: all existing paths (KB, LSP, dict) untouched

BLOCKED: requires LEANEXPLORE_API_KEY in .env (from leanexplore.com/api-keys)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(prover): P4 FINAL VERIFY false-negative + P5 sorry-line drift (Epic #1453)

P4 (CRITICAL): FINAL VERIFY was reverting files that COMPILE (0 errors)
solely because sorry_count >= original. Strategic decomposition (1 sorry
→ 2 sub-sorries that all compile) was being thrown away. Forensic:
Director L147 run reverted a valid 4→5 sorry file losing decomposition
progress.

Fix: remove "restore original if sorry >= original" logic from both
MultiAgentSorryProver (provers.py L416-431) and AutonomousProver
(L1073-1077). Final gate is now "0 compile errors" only — NEVER revert
a file that builds. Success also covers structural progress (sorry
increase from valid decomposition) as long as the file builds.

P5: verify_sorry_replacement and file_replace_sorry now search nearby
lines for the actual sorry when the target line no longer contains one.
Line numbers drift as the file is edited during a session.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(prover): autonomous mode crash on multi-only kwargs (#1463)

run_prover_bg.py passed use_diagnosis_agent and concurrent_search_count
to both MultiAgentSorryProver and AutonomousProver, but only the former
accepts them. The latter crashed instantly in autonomous mode.

Conditional dispatch: multi-mode gets the extra kwargs, autonomous mode
gets a plain synchronous call (no asyncio.run needed either).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(prover): F1+F2 — use level_1_build key for P4 build-only gating

F1 (MultiAgentSorryProver): final_verify reads "level_1" but compile()
returns "level_1_build". final_build_ok was always False in multi-mode.

F2 (AutonomousProver): revert gate used "success" (which includes
level_2 sorry_delta >= 0 check). Sorry increase from strategic
decomposition triggered revert despite P4 intent. Now gates purely on
level_1_build (compile pass/fail).

Also fixed exception fallback dict to use correct key name.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <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.

2 participants