ci: execute pytest once on the coverage leg (W1-3) - #475
Merged
Conversation
pull Bot
pushed a commit
to asleekgeek/Cortex
that referenced
this pull request
Sep 8, 2026
Thirteen merged PRs (cdeust#475-cdeust#487, cdeust#506) and a full SCI-grounded energy harness under benchmarks/energy/ had no mention anywhere in the README. A reader had no way to know the programme existed, which also meant no way to hold it to its own evidence rule. The section states what the harness measures and, at equal length, what it does not: its own README opens by saying the fixtures do not measure device energy and do not establish an energy improvement, the carbon factors are mandatory operator inputs with no defaults, and the boundary is the sensor's CPU+GPU+ANE estimate excluding memory, storage, screen and power-supply losses. No energy figure is published, and the section says why: no energy results are committed to this repository, because a number measured on one operator's machine, region and duty cycle is not a property of the software. The demand-reduction paragraph is explicitly labelled a design rationale rather than a measurement, since no end-to-end token-savings or CO2 figure has been measured. The one quantitative claim is the already-committed hook boot constant (~0.05s vs ~0.6s registry import, measured 2026-07-28), cited to its call sites in mcp_server/hooks/auto_recall.py. check_doc_claims.py exits 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01StMBvNd7eVJGtpnC2zNsx1
This was referenced Sep 8, 2026
pull Bot
pushed a commit
to asleekgeek/Cortex
that referenced
this pull request
Sep 8, 2026
Root cause of the cdeust#509 -> cdeust#510 incident. The `changes` filter classifies '*.md' out of `code`: code: - '**' - '!{*.md,docs/**/*.md,...}' so a README-only PR sets code=false and every test job is skipped. But part of that suite takes documentation as its INPUT: tests_py/scripts/test_codex_plugin_contract.py reads README.md and asserts on the canonical published identities (the hypermnesia-mcp-viz anchor, the viz/spec migration strings). The guards were therefore switched OFF exactly when their subject changed. cdeust#509 was a README-only diff, every test job skipped, it merged green, and the push to main went red on that test across five jobs (run 34238410970 — 7663 passed, 1 failed). cdeust#510 fixed the symptom; this fixes the reason it could reach main at all. Adds `docs` to test-sqlite's predicate only, not to the 3.10-3.13 matrix: test-sqlite already runs THE FULL SUITE in one ~5-minute job, so it covers the doc-contract tests at the smallest cost that closes the gap. Waking the whole matrix on every prose edit would undo cdeust#475-cdeust#481. scripts/check_ci_gate_results.py mirrors ci.yml's predicates — its own check_policy docstring requires the workflow and the executable policy to stay "in exact agreement". Changing only the workflow would have left two sources of truth disagreeing about when test-sqlite may skip, so _required_jobs gains the same condition and both files carry the same note. Caught by re-reading the diff, not by CI. Its two docs-only tests are updated to the new policy, and the first is turned into a named regression test that asserts skipping test-sqlite on a docs-only PR is NOT justified — the exact hole cdeust#509 fell through. Verified: actionlint 1.7.12 (the pinned version) clean on ci.yml; check_ci_gate_complete.py OK; both gate test files 38 passed, 159 subtests; craftsmanship, ruff check, ruff format, doc-claims all clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01StMBvNd7eVJGtpnC2zNsx1
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.
Symptôme
W1-3 / F14 : la jambe Python 3.12 exécutait toute la suite deux fois,
dont une seconde fois pour produire la couverture. PR empilée sur #471.
Cause racine
Deux étapes pytest distinctes étaient actives quand
run-extended-checksvalait
true.Changement
Une seule invocation pytest construit ses arguments dans un tableau Bash.
La jambe étendue conserve les rapports XML/terminal et le seuil existant de
82 %, sourcé dans le workflow. Les autres jambes gardent leurs arguments.
Le contrôle du contrat MCP, la collecte sans exécution servant au compteur
de tests, le badge et l'upload de couverture restent actifs.
Preuve
Au commit
03e884a3, gates locaux ordonnés verts : Ruff 1 416 fichiers,craftsmanship et Pyright zéro diagnostic ; tests scripts 825 passed,
5 skipped, 280 subtests ; suite complète 7 572 passed, 221 skipped,
280 subtests en 145,65 s. Les skips PostgreSQL locaux sont explicites
(endpoint isolé indisponible localhost:1), aucune base de production utilisée.
Charge initiale 3,32 / 10 cœurs, 66 GiB libres avant/après.
Six sondes Bash contre l'action réelle vérifient une seule invocation,
les arguments avec/sans couverture, les entrées non booléennes et la
propagation d'un échec pytest. Log local :
/private/tmp/cortex-green-w1-3-gates.log.Deux runs après au même SHA
03e884a3sont verts :34037347199 et
34038092818.
La moyenne Python 3.12 passe de 1 100,5 s à 659,5 s : 441 s de moins
(40,07 %), sur ces deux observations avant/après. Ce n'est pas une mesure
d'énergie ; charge/cache du runner ne sont pas contrôlés expérimentalement.
Chaque run après produit
coverage-report(84 673 octets), atteint 85,34 %de couverture et valide le compteur/badge (badges OK, 5 contrôlés).
Les logs montrent une seule invocation pytest avec couverture.
Archives locales :
/private/tmp/cortex-green-w1-3-after{1,2}-jobs.jsonl,cortex-green-w1-3-after1-python312.log,cortex-green-w1-3-after2.log.Conformité
Un seul fichier modifié, aucune baseline ajoutée, aucun import ou mécanisme
mémoire modifié. Le seuil et les contrôles existants sont conservés.
La collecte
--collect-onlyne lance aucun test.Candidats issues
La durée relative Python 3.12 / autres jambes dépend aussi de l'instrumentation
de couverture et des caches ; les deux mesures seront publiées sans attribuer
toute variation au changement.
Runbook
Le propriétaire décide de la fusion. Aucune opération de production.