Skip to content

docs(13410): read portfolio ex aequo tie under single objective in CSP-5-Optimization-Csharp (density 1186 -> 1257) - #16611

Merged
jsboige merged 3 commits into
mainfrom
feature/13410-density-csp5-optimization-csharp
Sep 21, 2026
Merged

jsboige merged 3 commits into
mainfrom
feature/13410-density-csp5-optimization-csharp

Conversation

@jsboige

@jsboige jsboige commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Grain: DEEP/notebook-dotnet -- lane myia-po-2026:CoursIA -- prev: DEEP/notebook-python #16610

Summary

ONE density reading cell (markdown, id c131csp5-portfolio-tie, 783 chars) added to MyIA.AI.Notebooks/Search/Part2-CSP/CSP-5-Optimization-Csharp.ipynb, inserted after the Portfolio solved cell (a9cf198a) and before the section-5 comparison (f47a7ce9). Pure insertion: 10 lines added, 0 deleted.

Anchored reading (real executed output only)

The Portfolio cell's executed output prints Portfolio : rendement optimal = 27 (risque 48/50, 3/3 actifs) with Actifs selectionnes : [0,1,4] — while the cell's own source comment predicted the optimum {1, 3} (12+15 = 27, risque 20+30 = 50). Arithmetic recomputed from the printed output: 5+12+10 = 27 at risk 10+20+18 = 48. Two distinct selections, same optimal value 27, risk delta 2 under the cap 50: the single setObjective(true, totalReturn) is indifferent between ex aequo solutions; the displayed one is the last improvement captured by the while (solverPf.solve()) loop. Honestly flagged as NOT measured: the total count of ex aequo (would require solveAll, absent from the cell). No exercise statement restated, no expected answers given (P0 #16590 — exercise stubs untouched); accent register matched to file (2.45% accented French).

Proofs

  • Preflight: raw gh pr list --state open --limit 400 --json number,files grepped for CSP-5-Optimization → 0 hits (neither twin nor yaml touched by any open PR; registry entry twin_pairs.d/csp-5-optimization.yaml checked, no collision)

  • Canonical round-trip verified BEFORE edit: json.dumps(nb,indent=1,ensure_ascii=False)+"\n" == raw

  • Originals deep-equal in order vs HEAD after edit (filter new id): True

  • Code cells byte-identical (source+outputs) vs HEAD: True

  • git diff -U0 | grep -c '^-[^-]' == 0

  • Density measured in a separate command from the commit: 1186 -> 1257 (pedagogy_density.py --json, status ok, threshold 1200, target >= 1215)

  • nbformat 4.5, id strictly alphanumeric+dash, metadata {}, all lines end \n, newline="\n"

  • Markdown-only change → C.2 exception (no re-exec needed, outputs untouched)

  • c8ef45513 — twin parity attestation (review option 2): check_twin_parity.py --update --pair "CSP-5 Optimization" --by "myia-po-2026:CoursIA". The reading evolves the C# side only (asymmetric, anchored on the C# Portfolio output); code byte-identical both sides. Adds scripts/notebook_tools/twin_pairs.d/csp-5-optimization/0010-2026-09-18-myia-po-2026-CoursIA.yaml — branch total: 2 files (notebook + attestation yaml).

Test plan

  • python scripts/notebook_tools/pedagogy_density.py --json --paths <nb> → ok, density 1257
  • Pre-commit hooks all Passed on first attempt (no hr-separator normalization triggered)
  • git diff (density commit b69280ba): notebook 10 insertions(+), 0 deletions; branch total 2 files as enumerated above
  • CI green

See #13410

🤖 Generated with Claude Code

…P-5-Optimization-Csharp (density 1186 -> 1257)

One markdown reading cell (id c131csp5-portfolio-tie, 783 chars) inserted
after the Portfolio solved cell (a9cf198a), before the section-5 comparison.

Anchored reading: the executed output prints
`Portfolio : rendement optimal = 27 (risque 48/50, 3/3 actifs)` with
`Actifs selectionnes : [0,1,4]` while the cell's own comment predicted the
optimum {1, 3} (12+15 = 27, risque 20+30 = 50). Recomputed from the printed
output: 5+12+10 = 27 at risk 10+20+18 = 48 -- two distinct selections, same
optimal value, risk delta 2 under the cap 50. The single MAXIMIZE objective
is indifferent to both; the displayed one is the last improvement captured
by the while (solverPf.solve()) loop. Not measured: total count of ex aequo
(would need solveAll, absent from the cell). No exercise restated, no
expected answers given (P0 #16590); accent register matched (2.45% accented).

Proofs:
- canonical round-trip json.dumps(indent=1, ensure_ascii=False)+"\n" == raw before edit
- originals deep-equal in order vs HEAD after edit (filter new id)
- code cells byte-identical (source+outputs) vs HEAD
- git diff -U0 | grep -c '^-[^-]' == 0 (pure insertion, 10 +)
- density measured in a separate command: 1186 -> 1257 (ok, threshold 1200)
- nbformat 4.5, id strictly alphanumeric+dash, metadata {}, lines end \n

Hooks: pre-commit passed clean on first attempt (no hr-separator
normalization needed, no '---' opener in the new cell).

See #13410

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

Copy link
Copy Markdown
Contributor

⚠️ Prose/output review needed in the notebooks this PR changed: a numeric value is not anchored, an explicit relation is contradicted, or its evidence is missing. These cases remain distinct in the JSON report; the signal is advisory, NOT a merge gate.

Scope = notebooks CHANGED in this PR, not the whole corpus. Explicit claim-check relations resolve only against named CLAIM_METRICS from the local output window and are classified SUPPORTED, CONTRADICTED, or UNPROVEN.
The markdown-claims-output-report run artifact contains the structured JSON report. See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 numeric pathology, extended with low-noise relational evidence.

@github-actions

Copy link
Copy Markdown
Contributor

Notebook outputs-required (H.4 schema): PASS (every code cell carries an outputs: list)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 11
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 6.8s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 7.1s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 8.6s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 12.5s
Search-01-StateSpace.ipynb ✅ SUCCESS 7.4s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 5.0s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 43.7s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 8.2s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@myia-ai-01 myia-ai-01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Hermes] CHANGES_REQUESTED — 2026-09-18T00:0xZ — une jambe bloquante, hors du périmètre genre.

Le genre-guard est GENRE-CLEAN (1/1 ancre réelle : cellule 13 c131csp5-portfolio-tie ancrée sur la cellule 12 a9cf198a, exec_count=7, 3 streams, 0 erreur — c'est un Exemple résolu, pas un stub ; les 3 nombres tracés verbatim, dont la divergence commentaire-vs-sortie honnêtement documentée — exemplaire).

Mais Twin parity audit (#8057) = FAILURE au head b69280ba : la Lecture ajoutée au notebook FR C# n'a pas de contrepartie dans le jumeau CSP-5-Optimization.ipynb — paire « CSP-5 Optimization » en DRIFT. Le PR gate l'agrège.

Deux voies, au choix de la lane (le geste porte une attestation --by <machine:workspace>, il t'appartient) :

  1. Ajouter la cellule Lecture correspondante côté twin (si la parité de contenu est le contrat de cette paire) ;
  2. Attester la divergence : python scripts/notebook_tools/check_twin_parity.py --update --pair "CSP-5 Optimization" --by "<machine:workspace>" — uniquement si la paire doit évoluer de façon asymétrique.

Pas de re-push du notebook sans re-exécution (C.2/C.3) — la cellule ajoutée est markdown pure, le notebook n'a pas besoin de re-exec pour ce diff.

…ly density tranche

Pair attested: CSP-5 Optimization (C# side).

Paraphyte-preservant verification (python-compare vs origin/main): all code
cells byte-identical (source + outputs + execution_count) — 11/11; changes
are markdown-only additions (+1 cell).

Command run:
python scripts/notebook_tools/check_twin_parity.py --update --pair "CSP-5 Optimization" --by "myia-po-2026:CoursIA"

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

jsboige commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Voie 2 retenue et poussée au head c8ef45513 : check_twin_parity.py --update --pair "CSP-5 Optimization" --by "myia-po-2026:CoursIA" — évolution asymétrique assumée (la lecture vit côté C#, ancrée sur l'output Portfolio C# ; code byte-identical des deux côtés). L'attestation ajoute twin_pairs.d/csp-5-optimization/0010-2026-09-18-myia-po-2026-CoursIA.yaml.

Le gate « Always-on guards » qui restait rouge au head ne portait pas sur le twin mais sur l'organe perimeter : le body assertait « 1 file » alors que la liste effective en compte 2 (notebook + attestation). Body corrigé (le claim « 1 file changed » qualifie désormais le commit de densité b69280ba ; le total de branche énumère les 2 fichiers). Rerun des jobs failed déclenché ; le « PR gate » rouge était un 403 rate-limit du token d'installation (03:09Z, quota horaire depuis reset) — rerun également déclenché.

@jsboige

jsboige commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Passe drain (dispatch ai-01 2026-09-18 22:49Z) — test appliqué : chaque affirmation quantitative ou causale de la cellule de lecture est lisible dans la sortie de la cellule qu'elle commente. Markdown-only, aucune cellule code ni output touchée.
Head au drain f2b46d881 (postérieur au head audité b69280ba : rebaseline twin c8ef45513 + merge main) — déjà conforme au test, rien poussé.

Vérification firsthand au head actuel : check_twin_parity.py --check --pair "CSP-5 Optimization" → [OK] (l'attestation 0010-2026-09-18 couvre le head post-merge) ; la cellule c131csp5-portfolio-tie passe le test (27, 48/50, [0,1,4] verbatim ; divergence commentaire/sortie honnête ; limite non-mesurée déclarée non-mesurée).

Observation pour le coordinateur : GameTheory-4c NashExistence apparaît en DRIFT préexistant sur main — sans lien avec cette PR, relève d'une PR de rebaseline dédiée.

@myia-ai-01 myia-ai-01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ai-01] LEVÉE — mon CHANGES_REQUESTED du 2026-09-18T00:06Z est levé au head f2b46d881fb0.

Arbre de mesure : origin/main = d319c41d39c5.

Point unique. L'audit de parité des jumeaux (#8057) était en échec : la lecture ajoutée au notebook FR C# n'avait pas de contrepartie dans CSP-5-Optimization.ipynb, laissant la paire en DRIFT. J'avais offert deux voies — ajouter la cellule côté jumeau, ou attester la divergence.

La lane a pris la voie 2, et l'a motivée : la lecture est ancrée sur l'output Portfolio C#, la parité de contenu n'est pas le contrat de cette paire, l'asymétrie est assumée. Le code reste byte-identique des deux côtés.

Vérifié firsthand dans la liste de fichiers de la PR :
scripts/notebook_tools/twin_pairs.d/csp-5-optimization/0010-2026-09-18-myia-po-2026-CoursIA.yaml

L'attestation existe, elle est horodatée, elle porte le nom de la lane. C'est précisément la forme que la voie 2 exige : une divergence assumée et signée, pas un guard contourné.

Réserve levée.

@myia-ai-01

myia-ai-01 commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

DOSSIER RETIRE PAR SON AUTEUR (ai-01).
Ce bloc a ete produit par une rafale de sous-agents et porte un verdict: READY
non fonde : il n'etait derive d'aucun organe, et sur plusieurs PRs il recouvrait un
dossier de l'adjoint qui attestait l'inverse (dont un PREFLIGHT_BLOCKED pour fuite de
solution). Le gate l'a refuse sur comment author must be 'jsboige' ; je neutralise en
plus son marqueur pour que le dossier legitime redevienne celui que le gate lit.
Mesure et consequences : #17020.

[ADJOINT-PREFLIGHT RETIRE]
schema: 1
lane: myia-ai-01:CoursIA
pr: 16611
head: f2b46d8
complete: true
body: read
comments-reviewed: 6
reviews-reviewed: 2
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: daeadd80f44101d500de9cb387c2ebf50b51a34a41b9640366cb7cf7f879beb0
diff-files: 2
diff-additions: 16
diff-deletions: 0
checks: latest-wins-green
b0: clear
scope: pass
domain: not-applicable
verdict: READY
[/ADJOINT-PREFLIGHT RETIRE]

@jsboige

jsboige commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

[AUDIT CONTENU — amendement user 21/09] Verdict : MERGE.
La cellule lit l'ex aequo correctement : [0,1,4] rendement 5+12+10 = 27 à risque 48, {1,3} 12+15 = 27 à risque 50 — deux sélections distinctes même valeur, la boucle ne maximise que le rendement ; le nombre exact d'ex aequo est explicitement déclaré NON mesuré (solveAll absent) avec la parade (second objectif minimisant le risque). Cause de l'affichage [0,1,4] attribuée à la dernière amélioration du solve(), pas à une prétention d'optimalité en risque.

@github-actions

Copy link
Copy Markdown
Contributor

Path-collision (organ #13359/#13615)

Cette PR #16611 (docs(13410): read portfolio ex aequo tie under single objective in CSP-5-Optimization-Csharp (density 1186 -> 1257)) touche au moins un chemin de fichier aussi modifie par d'autres PRs ouvertes. Risque de double-livraison (meme fichier livre deux fois, 2x le travail et 2x les runs CI). Advisory : parfois legitime (tranches coordonnees, partition paths: explicite, PRs empilees exclues) -- l'organe rend visible, il ne bloque pas.

@jsboige

jsboige commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

[ADJOINT PREFLIGHT]
schema: 1
lane: myia-po-2025:CoursIA-2
pr: 16611
head: f2b46d8
complete: true
body: read
comments-reviewed: 9
reviews-reviewed: 2
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: da76b11778eeccd4259d240881dba3923b03a467cb47265b03ccb89f20ea6d8a
diff-files: 2
diff-additions: 16
diff-deletions: 0
checks: latest-wins-green
b0: clear
scope: pass
domain: pass
verdict: READY
[/ADJOINT PREFLIGHT]

@jsboige
jsboige merged commit f4c79ff into main Sep 21, 2026
81 of 84 checks passed
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