Parent epic: #129
User story
As a repo maintainer, I want data-raw/build_uds_crosswalk.R to resolve its sourced helper file relative to the script's own location rather than the caller's working directory, so that the build script doesn't silently fail when invoked from outside the repository root.
Problem
data-raw/build_uds_crosswalk.R now does source("data-raw/helpers.R") (added in #143/PR #144 to make bind_rows_base() offline-testable). This path is resolved relative to getwd(), not the script's own location — running the script from any directory other than the repo root fails before the build begins.
This isn't a brand-new constraint: OUT_PATH <- file.path("inst", "extdata", "uds_crosswalk.rds") already assumed cwd == repo root before this change. But the new source() call adds a second, earlier failure point tied to the same assumption, and unlike the save path (which fails gracefully at the end with a clear "file not found" style error), a failed source() fails immediately with a less obvious "cannot open file" error before any download work starts.
Flagged by the institutional code-review gate (rubber-duck pass) on PR #144.
Acceptance criteria
Codebase Context
Parent epic: #129
User story
As a repo maintainer, I want
data-raw/build_uds_crosswalk.Rto resolve its sourced helper file relative to the script's own location rather than the caller's working directory, so that the build script doesn't silently fail when invoked from outside the repository root.Problem
data-raw/build_uds_crosswalk.Rnow doessource("data-raw/helpers.R")(added in #143/PR #144 to makebind_rows_base()offline-testable). This path is resolved relative togetwd(), not the script's own location — running the script from any directory other than the repo root fails before the build begins.This isn't a brand-new constraint:
OUT_PATH <- file.path("inst", "extdata", "uds_crosswalk.rds")already assumedcwd == repo rootbefore this change. But the newsource()call adds a second, earlier failure point tied to the same assumption, and unlike the save path (which fails gracefully at the end with a clear "file not found" style error), a failedsource()fails immediately with a less obvious "cannot open file" error before any download work starts.Flagged by the institutional code-review gate (rubber-duck pass) on PR #144.
Acceptance criteria
data-raw/build_uds_crosswalk.Rresolvesdata-raw/helpers.R(and any future sourced helper) relative to its own script location, or the script fails fast with a clear, actionable error message naming the repo-root requirement.here) unless that dependency is already justified elsewhere.Codebase Context
data-raw/build_uds_crosswalk.R:25— the newsource("data-raw/helpers.R")call.data-raw/helpers.R— the new sourced file (added in [Code review] data-raw/build_uds_crosswalk.R: add automated test coverage for bind_rows_base() #143/PR test: add offline coverage for bind_rows_base() (#143) #144).data-raw/build_uds_crosswalk.R'sOUT_PATH <- file.path("inst", "extdata", "uds_crosswalk.rds")(also relative to cwd).code_review/SKILL.md) rubber-duck pass (round 1) on PR test: add offline coverage for bind_rows_base() (#143) #144, per ADR-0004 auto-file protocol.