audit_configs.R: trustworthy pre-trifecta gate (rollup + honest findings)#214
Merged
Conversation
Add section 3b comparing fresh's canonical parameters_fresh.csv column set against each link bundle's copy. Flags columns fresh added that link is missing (link's copy may no longer load through frs_habitat); treats observation_* as expected link-only extensions. Report-only, values ignored. Closes the parameters_fresh half of the fresh/link config drift gap (rules.yaml half tracked in #129). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… exit Route every `!!`-level finding (sections 1-5) through a flag() accumulator, then print a single rollup at the end and quit(status=1) when any fired (guarded by !interactive()). Previously findings printed inline across six sections with no summary and the script always exited 0, so any flag could scroll past unnoticed and the trifecta could not gate on a clean audit. Uniform across all checks — no single check is special-cased louder. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All 30 findings the audit emitted were audit-side defects, not config drift (lnk_config_verify reports 0 byte/shape drift in both bundles). Four fixes: - §1: drop the homegrown shape/byte checksum reimplementation and call the canonical lnk_config_verify() instead. The local recipe diverged from .lnk_shape_fingerprint (list(cols,nrow,types) serialize=TRUE vs header-row hash serialize=FALSE), producing a 24/24 spurious shape-drift wall. - §2: regenerate rules.yaml with edge_types="explicit" to match how the committed copy is actually built (build_rules.R + regen_provenance.R). "categories" produced an all-species phantom diff. - §3: split species-axis mismatches into defects (dim∖pf, yaml∖dim — flagged) vs expected asymmetries (pf∖dim, pf∖wsg, dim∖yaml — printed only). The expected directions are by-design supersets, not drift. - §4: resolve declared paths against bundle_dir and compare full bundle-relative paths instead of basenames. Basename-matching only the overrides/ dir mis-flagged root-level parameters_fresh.csv as missing. Audit now reports "No findings — config layers aligned." and exits 0. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Makes
data-raw/audit_configs.Ra trustworthy pre-trifecta gate. Three commits:f24f301) — compares fresh's canonicalparameters_fresh.csvcolumn set against each link bundle's copy. Flags engine params fresh added that link is missing; treatsobservation_*as expected link-only extensions. Closes theparameters_freshhalf of the fresh↔link config-drift gap (rules.yaml half tracked in Auto-sync parameters_habitat_rules.yaml from link to fresh on rules-build #129).106dffe) — routes every!!-level finding through aflag()accumulator, prints a single end-of-run rollup, andquit(status=1)when any fired (guarded by!interactive()). Previously findings scrolled past inline with no summary and the script always exited 0, so the trifecta could not gate on a clean audit.04f6494) — all 30 findings the audit emitted were audit-side defects, not config drift (lnk_config_verifyreports 0 byte/shape drift in both bundles):lnk_config_verify()instead of a divergent homegrown checksum recipe (was a 24/24 spurious shape-drift wall)edge_types="explicit"to match how the committed copy is builtbundle_dirand compares full relative paths (basename-matching mis-flagged root-levelparameters_fresh.csv)Audit now reports "No findings — config layers aligned." and exits 0.
Related Issues
Test plan
Rscript data-raw/audit_configs.R→ "No findings — config layers aligned.", exit 0/code-checkclean (fresh-eyes subagent ran the script end-to-end)🤖 Generated with Claude Code