Skip to content

v0.11.0: config provenance + run stamps (#40)#59

Merged
NewGraphEnvironment merged 2 commits intomainfrom
40-config-provenance-stamps
Apr 27, 2026
Merged

v0.11.0: config provenance + run stamps (#40)#59
NewGraphEnvironment merged 2 commits intomainfrom
40-config-provenance-stamps

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

Config-bundle provenance + run stamps. Pipeline outputs that shift between runs on the same DB state can now be traced back to which input changed.

  • inst/extdata/configs/{bcfishpass,default}/config.yaml carry provenance: blocks with sha256 checksums for every tracked file (12 files each). External (bcfishpass) files record source URL + upstream_sha (ea3c5d8, synced 2026-04-13) + path within source repo. Generated rules.yaml records generated_from + generated_by + generator_sha. Hand-authored files record link's git sha at edit time.
  • lnk_config() parses provenance, exposes cfg$provenance. print(cfg) shows count of tracked files.
  • lnk_config_verify(cfg, strict) recomputes sha256 for every provenanced file, returns (file, expected, observed, drift, missing) tibble. Warns on drift; strict = TRUE errors. digest added to Suggests.
  • lnk_stamp(cfg, conn, aoi, db_snapshot) returns an lnk_stamp S3 list capturing provenance + software versions + git SHAs (3-tier fallback) + DB snapshot row counts + AOI + start_time. lnk_stamp_finish(stamp, result, end_time) finalizes; format(stamp, "markdown") renders for report appendix or run-log dump.
  • data-raw/compare_bcfishpass_wsg.R emits stamp markdown at the head of every WSG run, captured into data-raw/logs/*.txt via the standard stderr redirect.

Numbers

  • Tests: 360 → 453 (121 new test_thats)
  • Provenance: 12 files tracked per bundle, drift = 0 in shipped state
  • DB snapshot: bcfishobs.observations + fwa_stream_networks_sp row counts (2 cheap queries)

Files

  • R/lnk_config.R — extended (provenance parsing)
  • R/lnk_config_verify.R — new
  • R/lnk_stamp.R — new (lnk_stamp, lnk_stamp_finish, format.lnk_stamp, print.lnk_stamp)
  • inst/extdata/configs/bcfishpass/config.yamlprovenance: block
  • inst/extdata/configs/default/config.yamlprovenance: block
  • data-raw/compare_bcfishpass_wsg.R — stamp emission
  • tests/testthat/test-lnk_config.R — extended
  • tests/testthat/test-lnk_config_verify.R — new
  • tests/testthat/test-lnk_stamp.R — new
  • DESCRIPTIONdigest to Suggests; 0.10.0 → 0.11.0
  • NEWS.md — 0.11.0 entry

Test plan

  • devtools::test(): 453 PASS, 0 FAIL
  • lnk_config_verify() runs clean on both bundles
  • Drift detection verified via temp config + file mutation
  • lnk_stamp() runs without DB; with DB; renders markdown
  • /code-check round 1: 1 fragile finding fixed (.lnk_read_git_head empty-file edge)

Cross-refs

Closes #40. Supersedes the narrow report-appendix scope of #24 (markdown rendering of the run stamp covers that consumer).

🤖 Generated with Claude Code

NewGraphEnvironment and others added 2 commits April 26, 2026 11:27
Two layers in one PR:
1. provenance: block in config.yaml + cfg$provenance + lnk_config_verify()
2. lnk_stamp() with full runtime scope, supersedes #24

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the drift attribution loop. Pipeline outputs that shift between
runs on the same DB state can now be traced back to which input
changed. Supersedes the narrower scope of #24.

- inst/extdata/configs/{bcfishpass,default}/config.yaml: provenance:
  blocks with sha256 checksums for every tracked file. External files
  record source URL + upstream_sha + path within source repo.
  Generated files record generated_from + generated_by + generator_sha.
- lnk_config() parses provenance, exposes cfg$provenance (named list).
- lnk_config_verify(cfg, strict) recomputes sha256, returns drift
  tibble. Warns on drift; strict = TRUE errors.
- lnk_stamp(cfg, conn, aoi, db_snapshot) + lnk_stamp_finish() +
  format.lnk_stamp(type) + print.lnk_stamp(). Captures provenance with
  current observed checksums, software versions and git SHAs (3-tier
  fallback: env var, .git/HEAD walk, NA), DB snapshot row counts when
  conn is provided.
- data-raw/compare_bcfishpass_wsg.R emits stamp markdown at head of
  every WSG run; captured to log via standard stderr redirect.
- 121 new tests; 453 total pass.
- digest added to Suggests. Version bump 0.10.0 -> 0.11.0.

Closes #40
Relates to #24

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 9354f99 into main Apr 27, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 40-config-provenance-stamps branch April 27, 2026 02:31
NewGraphEnvironment added a commit that referenced this pull request Apr 27, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Config CSV provenance + pipeline run stamps (close the drift loop)

1 participant