Skip to content

study_area_run.sh: --schema= override for side-by-side bundle compares (v0.41.1)#209

Merged
NewGraphEnvironment merged 1 commit into
mainfrom
driver-schema-override
May 28, 2026
Merged

study_area_run.sh: --schema= override for side-by-side bundle compares (v0.41.1)#209
NewGraphEnvironment merged 1 commit into
mainfrom
driver-schema-override

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

  • Adds --schema=<persist-schema> flag to data-raw/study_area_run.sh for side-by-side bundle compares
  • Without the flag, behaviour is unchanged (config's YAML pipeline$schema default)
  • With the flag, the driver exports LNK_SCHEMA; all per-WSG R scripts (wsg_run_one.R, wsg_recompute_one.R, study_area_compare.R) override cfg$pipeline$schema at runtime
  • Propagation works through SSH to cyphers (each remote shell exports LNK_SCHEMA before its WSG loop)
  • Empty --schema= value errors loudly rather than silently falling through to the YAML default (caught in /code-check)

Use case: --config=default --schema=fresh_default keeps a default-config run from clobbering an earlier --config=bcfishpass baseline in fresh. Unblocks the default-vs-bcfp config comparison run.

Related Issues

  • Relates to NewGraphEnvironment/sred#24

Test plan

  • Live smoke test: LNK_SCHEMA=fresh_default Rscript data-raw/wsg_run_one.R ADMS default ran end-to-end in 2.2 min; 11 species habitat tables landed in fresh_default; fresh schema untouched (baseline preserved)
  • Empty --schema= value errors with "FATAL: --schema= requires a non-empty value"
  • /code-check Round 1: 1 MEDIUM (empty-value silent fallthrough) fixed; 3 LOW findings accepted as design tradeoffs (SSH single-quote injection theoretical given schema-name conventions; LNK_SCHEMA env leaks to child processes — intentional propagation contract; future-proof flag for study_area_wsgs.R)

Notes

The override threads via env var rather than a script param so the four R scripts share one contract (read Sys.getenv("LNK_SCHEMA"); if non-empty, mutate cfg$pipeline$schema before any pipeline call). Same pattern in all three R scripts — easy to extend to future scripts.

🤖 Generated with Claude Code

…s (v0.41.1)

Adds --schema=<persist-schema> flag that overrides cfg$pipeline$schema at
runtime via the LNK_SCHEMA env var. Propagates to local Rscript invocations
(via export) and to cypher SSH invocations (each remote shell exports it
before its WSG loop). All four scripts (wsg_run_one, wsg_recompute_one,
study_area_compare, study_area_run) honour LNK_SCHEMA.

Without the flag, behaviour is unchanged (YAML default). With it, e.g.
`--config=default --schema=fresh_default` keeps a default-config run from
clobbering an earlier `--config=bcfishpass` baseline sitting in `fresh`.
Empty --schema= value errors loudly (not silent fallthrough).

Live-validated: ADMS / default config / fresh_default — 2.2 min, 11 species
habitat tables in fresh_default, fresh untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 9239e25 into main May 28, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the driver-schema-override branch May 28, 2026 04:26
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.

1 participant