Repository navigation
fix(tests/engine): RL demo contract + harden engine exporters #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
111f2eb
4b77e1d
168ca5b
59c9556
b69382e
323c598
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| # CODEOWNERS — Ecosystem WG requires ≥2 core maintainers with formal ownership | ||
| * @Lemniscate-world @P3niel | ||
| # CODEOWNERS — single active maintainer; second maintainer position open (see GOVERNANCE.md) | ||
| * @Lemniscate-world | ||
|
|
||
| # Docs and governance require both maintainers | ||
| /docs/ @Lemniscate-world @P3niel | ||
| *.md @Lemniscate-world @P3niel | ||
| .github/ @Lemniscate-world @P3niel | ||
| # Docs and governance require lead maintainer | ||
| /docs/ @Lemniscate-world | ||
| *.md @Lemniscate-world | ||
| .github/ @Lemniscate-world | ||
|
|
||
| # Core engine — lead maintainer primary | ||
| /neuraldbg/ @Lemniscate-world @P3niel | ||
| /neuraldbg/ @Lemniscate-world |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "syncedAt": "2026-09-01T11:29:19.4774974Z", | ||
| "syncedAt": "2026-10-02T11:06:50.0556132Z", | ||
| "generator": "sync-rules.ps1", | ||
| "agentsSha256": "ffe83a3438541496e477f5fa37de38181f033660effb2fbd1499b41070d80465", | ||
| "ruleCount": 53 | ||
| "agentsSha256": "7faefac0cbac9534585b2b64e86c7d6cae11ab34b6b066c8f27b315aefb48c0b", | ||
| "ruleCount": 59 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,20 +13,26 @@ To read a rule, use your 'view_file' tool on the corresponding file in the maste | |
| - **rule_07_08_09_10_11_12_13_15_16_17**: PLANNING, ROADMAP & CORE BEHAVIOUR RULES - Full Detail | ||
| - **rule_100_session_compliance**: RULE 100: Session Compliance — Vérification Obligatoire en Début de Session | ||
| - **rule_101_file_integrity_guard**: RULE 101: File Integrity Guard — Protection des fichiers privés | ||
| - **rule_101_tensor_and_pytest_safety**: RULE 101: Tensor Operations and Test Suite Warning Governance | ||
| - **rule_102_test_coverage**: RULE 102: ML Project Test Coverage — Mandatory Standards | ||
| - **rule_103_profile_readme_sync**: RULE 103: Profile README Sync — MANDATORY | ||
| - **rule_104_auto_issues_tracking**: RULE 104: Auto-Issues & Tracking — Création Obligatoire d'Issues pour Chaque Action | ||
| - **rule_105_multirepo_governance**: RULE 105: Multi-Repo & Monorepo Governance — MANDATORY | ||
| - **rule_106_plan_roadmap_split**: RULE 106: Private Plan + Public Roadmap Split — MANDATORY | ||
| - **rule_107_upstream_pr_strategy**: RULE 107: Upstream PR Strategy — Credibility Through Merged Contributions | ||
| - **rule_108_design_language**: RULE 108: Design Language — « Quiet Precision » (LifeTrack & dérivés) | ||
| - **rule_108_validation_pipeline**: RULE 108: Validation Pipeline — Progressive Gates (MANDATORY) | ||
| - **rule_109_adaptive_design**: RULE 109: Adaptive Design Systems — identité par produit, socle universel | ||
| - **rule_110_blogging**: RULE 110: Blogging & Contenu Public — le système d'écriture lambda-Section | ||
| - **rule_111_finance_local**: RULE 111: Local Finance Data — données financières 100% locales — MANDATORY | ||
| - **rule_112_standard_tooling**: RULE 112: Standard Tooling — Agent-Reach + Codebase-Memory sur chaque projet — MANDATORY | ||
| - **rule_113_desktop_install**: RULE 113: Desktop Install on Every Test/Update — MANDATORY | ||
| - **rule_113_github_discovery**: RULE 113: GitHub Discovery Protocol — Mesure & Métadonnées | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The added rule lines store mojibake (—, é, è) instead of UTF-8 em dashes and accented letters. These exact sequences are rejected by scripts/check_mojibake.py BROKEN_SEQUENCES, and the unit test asserts "—" is flagged. Write the text as proper UTF-8 (—, é, è) so the new lines comply with the repo's mojibake guard. Prompt for AI agents |
||
| - **rule_114_tensor_and_pytest_safety**: RULE 114: Tensor Operations and Test Suite Warning Governance | ||
| - **rule_115_validation_pipeline**: RULE 115: Validation Pipeline — Progressive Gates (MANDATORY) | ||
| - **rule_116_regression_guards**: RULE 116: Regression Guards — Les Erreurs Corrigées Ne Reviennent Pas | ||
| - **rule_117_desktop_build**: RULE 117: Desktop Build — Rebuild + Réinstall auto après chaque modif — MANDATORY | ||
| - **rule_118_clarte_permanente**: RULE 118: Clarté Permanente — Toujours Comme La Première Fois | ||
| - **rule_119_marketing_technique**: RULE 119: Marketing Technique — Résoudre des Problèmes Réels en Public | ||
| - **rule_120_kuro_marketing**: RULE 120: Marketing via Kuro — Tout Passe par la Pipeline | ||
| - **rule_121_pr_fix_marketing**: RULE 121: PR-Fix Marketing — Reparer en Public avec nos Outils (MANDATORY) | ||
| - **rule_14_validation_and_failure**: RULE 14.5: 5-Risk Failure Mode Table - Full Detail | ||
| - **rule_20_21_22_23_24_25_26_27_29_31_32_33_34_35_37_40**: LINEAR, TEAM & PROJECT MANAGEMENT RULES - Full Detail | ||
| - **rule_28_linear_review**: RULE 28: Linear Automation and DevOps Review - Full Detail | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,27 +9,34 @@ NeuralDBG is maintained by **LambdaSection** as an open-source MIT project. We f | |
| | Name | GitHub | Role | Since | | ||
| |------|--------|------|-------| | ||
| | Jacques-Charles SENOUVO (Kuro) | `@Lemniscate-world` | Lead Maintainer, BDFL | 2025 | | ||
| | P3niel | `@P3niel` | Maintainer — docs, integrations, community | 2025 | | ||
|
|
||
| Core maintainers have merge rights and are listed in `.github/CODEOWNERS`. A second maintainer satisfies the Ecosystem WG requirement of ≥2 core maintainers. | ||
| Currently single active maintainer. Second maintainer position is open — see `Roles` below. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Keep the documented maintainer count consistent.
🤖 Prompt for AI Agents |
||
|
|
||
| Core maintainer has merge rights and is listed in `.github/CODEOWNERS`. | ||
|
|
||
| Historical contributors: see `https://github.com/LambdaSection/NeuralDBG/graphs/contributors` and `CHANGELOG.md`. | ||
|
|
||
| ## Emeritus | ||
|
|
||
| | Name | GitHub | Role | Period | | ||
| |------|--------|------|--------| | ||
| | P3niel | `@P3niel` | Emeritus — docs, integrations, community (past contributions) | 2025 | | ||
|
|
||
| ## Decision Making | ||
|
|
||
| - **Trivial** (docs, typos, CI): single maintainer approval. | ||
| - **Standard** (features, bug fixes): PR + 1 maintainer review, CI green. | ||
| - **Major** (API breaking, license, governance): issue/RFC + approval from all core maintainers. | ||
| - **Standard** (features, bug fixes): PR + maintainer review, CI green. | ||
| - **Major** (API breaking, license, governance): issue/RFC + lead maintainer approval. Second maintainer approval required once the position is filled. | ||
|
|
||
| Lazy consensus: if no objection within 72h after review, the PR may be merged. | ||
|
|
||
| ## Roles | ||
|
|
||
| - **Maintainer**: review/merge PRs, cut releases, triage issues, enforce Code of Conduct. | ||
| - **Contributor**: anyone submitting PRs/issues. Recognized after 5 merged PRs or significant feature. | ||
| - **Emeritus**: former maintainers retaining advisory role. | ||
| - **Emeritus**: former maintainers retaining advisory role with no merge obligations. | ||
|
|
||
| Becoming a maintainer: sustained contributions (≥3 months, ≥10 merged PRs or equivalent) + nomination by existing maintainer + unanimous approval. | ||
| Becoming a maintainer: sustained contributions (≥3 months, ≥10 merged PRs or equivalent) + nomination by existing maintainer + lead approval. Open call: second maintainer actively sought to meet PyTorch Ecosystem ≥2 requirement. | ||
|
|
||
| ## Release Methodology | ||
|
|
||
|
|
@@ -56,4 +63,4 @@ Related repos: | |
|
|
||
| ## Amending Governance | ||
|
|
||
| Changes to this document require PR + approval from all core maintainers. | ||
| Changes to this document require PR + lead maintainer approval (unanimous core approval once a second maintainer is onboarded). | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -127,19 +127,19 @@ Review by @hogepodge 2026-08-20: "too early for inclusion". All governance crite | |||||
| | Criterion | Status | Evidence | | ||||||
| |---|---|---| | ||||||
| | Working CI | ✅ Pass | run 32474998638 green, coverage 76.9% strict, bandit clean, pytorch 2.0→2.6 matrix | | ||||||
| | GOVERNANCE.md | ✅ | 2 maintainers documented | | ||||||
| | GOVERNANCE.md | ✅ | 1 active maintainer + P3niel emeritus, 2nd position open | | ||||||
| | CONTRIBUTING.md | ✅ | workflow + release process | | ||||||
| | CODEOWNERS | ✅ | @Lemniscate-world @P3niel | | ||||||
| | CODEOWNERS | ✅ | @Lemniscate-world (solo, honest) | | ||||||
| | CODE_OF_CONDUCT.md | ✅ | Contributor Covenant v2.1 | | ||||||
| | README release cadence | ✅ | Release Methodology section | | ||||||
| | Documentation (Aquarium) | ✅ | issue body edited — public artifact docs/aquarium.html; private IDE repo out of scope | | ||||||
| | Functional Testing | ✅ | CI green confirms tests pass | | ||||||
| | Ongoing Maintenance | ✅ | 2 maintainers formalized | | ||||||
| | Ongoing Maintenance | ⚠️ | single maintainer, bus-factor risk — 2nd maintainer actively sought | | ||||||
|
|
||||||
| **Remaining community metrics (time-gated, not actionable directly):** | ||||||
| - Stars ≥200 : 24 → plan arXiv Dec 2026 + W&B/Lightning posts Jan 2027 | ||||||
| - Contributors ≥5 in 90d : recruiting via HF Spaces demo | ||||||
| - Core Maintainers commits : P3niel next substantive contribution | ||||||
| - Core Maintainers ≥2 : P3niel emeritus Oct 2026 — 2nd maintainer position open, blocks re-submission | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: This dates P3niel’s emeritus status to October 2026, but Prompt for AI agents
Suggested change
|
||||||
|
|
||||||
| **Re-engagement trigger**: stars ≥100 OR 5 contributors active → comment on #80 requesting re-review. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,7 +115,7 @@ def train_ppo(model, num_steps=20, lr=3e-4, state_dim=8, action_dim=4, | |
|
|
||
| # Merge RL detector events into NeuralDBG events | ||
| if rl_detector is not None: | ||
| for rl_event in rl_detector.dump_events(): | ||
| for i, rl_event in enumerate(rl_detector.dump_events()): | ||
| # Create an event-like object compatible with NeuralDBG's Event protocol | ||
| merged = type('RLEvent', (), { | ||
| 'event_type': rl_event['event_type'], | ||
|
|
@@ -129,12 +129,19 @@ def train_ppo(model, num_steps=20, lr=3e-4, state_dim=8, action_dim=4, | |
| 'to_state': rl_event['event_type'], | ||
| 'to_dict': lambda self, d=rl_event: d, | ||
| })() | ||
| # Unique id per instance (cf SemanticEvent.id) for graph exporters. | ||
| merged.id = f"rl_{rl_event['step']}_{i}_{rl_event['event_type']}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Variance-collapse graphs stay empty train_ppo now assigns id and confidence to merged RL events, but scenario_reward_variance_collapse uses a duplicate merge block that assigns neither attribute. Its normal 20-step run emits a reward-anomaly event, after which Mermaid export raises on event.id and coupling detection can raise on event.confidence, while analyze_results silently replaces those failures with empty output. Agent Prompt
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The unique-id fix is only applied in Prompt for AI agents |
||
| dbg.events.append(merged) | ||
|
|
||
| return dbg, rl_detector | ||
|
|
||
|
|
||
| def analyze_results(dbg, rl_detector=None): | ||
| # Scenarios return (dbg, rl_detector) tuples; accept them directly. | ||
| if isinstance(dbg, tuple): | ||
| dbg, _rl = dbg | ||
| if rl_detector is None: | ||
| rl_detector = _rl | ||
| result = { | ||
| "events": dbg.events, | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,11 +36,15 @@ def detect(self, window: int = 5) -> List[Dict[str, Any]]: | |
|
|
||
| trigger = event1.id | ||
| consequence = event2.id | ||
| # Tolerate foreign event-likes (e.g. merged RLDetector | ||
| # events whose event_type is a plain string). | ||
| t1 = getattr(event1.event_type, "value", event1.event_type) | ||
| t2 = getattr(event2.event_type, "value", event2.event_type) | ||
|
Comment on lines
+41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Normalize event types before applying the coupling bonus. When plain strings match 🤖 Prompt for AI Agents |
||
| candidate = { | ||
| "trigger": trigger, | ||
| "consequence": consequence, | ||
| "trigger_label": f"{event1.event_type.value} in {event1.layer_name}", | ||
| "consequence_label": f"{event2.event_type.value} in {event2.layer_name}", | ||
| "trigger_label": f"{t1} in {event1.layer_name}", | ||
| "consequence_label": f"{t2} in {event2.layer_name}", | ||
| "step_difference": step_diff, | ||
| "confidence": confidence, | ||
| "is_causal_candidate": True, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -635,9 +635,10 @@ def export_mermaid_causal_graph(self) -> str: | |||||
| lines = ["graph TD"] | ||||||
|
|
||||||
| for event in self.dbg.events: | ||||||
| label = ( | ||||||
| f"{event.event_type.value} in {event.layer_name} (Step {event.step})" | ||||||
| ) | ||||||
| # Tolerate foreign event-likes (e.g. merged RLDetector events | ||||||
| # whose event_type is a plain string, not an EventType enum). | ||||||
| etype = getattr(event.event_type, "value", event.event_type) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The new tolerance only covers Prompt for AI agents |
||||||
| label = f"{etype} in {event.layer_name} (Step {event.step})" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: For plain-string event types this tolerates, the value is interpolated unescaped into Prompt for AI agents
Suggested change
|
||||||
| lines.append(f' E_{event.id}["{label}"]') | ||||||
|
|
||||||
| couplings = self.dbg.detect_coupled_failures() | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -78,8 +78,9 @@ filterwarnings = [ | |||||
| "ignore::FutureWarning:torch.nn.modules.module.*", | ||||||
| "ignore::DeprecationWarning:torch.jit.*", | ||||||
| # Expected internal warnings — intentional design decisions | ||||||
| "ignore:NeuralDbg\\: Model is wrapped in DataParallel.*:UserWarning", | ||||||
| "ignore:NeuralDbg\\: Model is already compiled.*:UserWarning", | ||||||
| # NB: no colon allowed inside message regex (pytest splits on unescaped ":") | ||||||
| "ignore:Model is wrapped in DataParallel.*:UserWarning", | ||||||
| "ignore:Model is already compiled.*:UserWarning", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The Prompt for AI agentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Match the warning producer’s prefix. The warning from Suggested fix- "ignore:Model is already compiled.*:UserWarning",
+ "ignore:NeuralDbg.*Model is already compiled.*:UserWarning",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Comment on lines
+81
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| ] | ||||||
|
|
||||||
| [tool.coverage.run] | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Removing the rule_101_tensor_and_pytest_safety index entry leaves rules/rule_101_tensor_and_pytest_safety.md unreferenced. Delete the stale file (and mirror the renamed rule_114_tensor_and_pytest_safety.md in rules/) to keep the index and rules dir in sync.
Prompt for AI agents