Found reviewing #366.
scripts/audit_causal_graphs.py now parses every data/traits/**/*.yaml three times per run:
| pass |
added by |
audit() |
original |
connectivity_rows() |
#363 |
node_type_index() |
#366 |
Measured on this corpus (477 records, 353 graphs):
main (2 walks) real 7.92
#366 (3 walks) real 12.36 +56%
grep -c 'rglob("\*.yaml")' scripts/audit_causal_graphs.py → 3.
It compounds: just qc runs audit-graphs directly and again inside audit-derived-reports to diff against git, so qc pays roughly +9s. Each pass re-reads and re-parses the same YAML for a different projection.
Fix: load the corpus once into [(rel_path, doc)] and pass it to all three, which also removes the risk of the three walks disagreeing about which files they saw (they each re-implement the rglob + safe_load + isinstance(doc, dict) guard). #363 already extracted _topology() for exactly this "the ratchet and the measurement must not drift" reason; this is the same argument one level up.
Not urgent — 12s is tolerable and nothing is wrong, just wasteful.
Found reviewing #366.
scripts/audit_causal_graphs.pynow parses everydata/traits/**/*.yamlthree times per run:audit()connectivity_rows()node_type_index()Measured on this corpus (477 records, 353 graphs):
grep -c 'rglob("\*.yaml")' scripts/audit_causal_graphs.py→ 3.It compounds:
just qcrunsaudit-graphsdirectly and again insideaudit-derived-reportsto diff against git, so qc pays roughly +9s. Each pass re-reads and re-parses the same YAML for a different projection.Fix: load the corpus once into
[(rel_path, doc)]and pass it to all three, which also removes the risk of the three walks disagreeing about which files they saw (they each re-implement therglob+safe_load+isinstance(doc, dict)guard). #363 already extracted_topology()for exactly this "the ratchet and the measurement must not drift" reason; this is the same argument one level up.Not urgent — 12s is tolerable and nothing is wrong, just wasteful.