Skip to content

feat(force_surveys): add surgical survey re-processing parameter - #31

Open
randrescastaneda wants to merge 4 commits into
PRODfrom
stream-c-orchestration-foundation
Open

feat(force_surveys): add surgical survey re-processing parameter#31
randrescastaneda wants to merge 4 commits into
PRODfrom
stream-c-orchestration-foundation

Conversation

@randrescastaneda

Copy link
Copy Markdown
Member

What this PR does

Adds a force_surveys parameter (character vector of survey_id and/or pip_id) to pd_process_data() and valid_dlw_load() that re-processes the named surveys alongside the normal invalidation candidates, without the destructive global side effects of force = TRUE (which switches stamp versioning to "timestamp" for the entire run and bypasses all invalidation logic).

The forced surveys are resolved lookup-first (survey_id membership, then pip_id reverse-map via the already-loaded master inventory), unioned into the candidate set (deduplicated via unique()), and logged with force_surveys_inf / force_surveys_unknown_inf entries. Unknown and out-of-filter identifiers are warned about and skipped. Stamp versioning stays on its default "content" for the entire run.

Requirements addressed

Requirement Detail
R1 force_surveys re-processes named surveys PLUS normal invalidation candidates (additive, not replacement)
R2 Forced surveys bypass inv_to_process() only; aux-change detection runs normally; overlaps dedup by unique()
R3 Stamp versioning stays on default "content"; force_surveys never calls stamp::st_opts()
R4 force = TRUE + non-NULL force_surveys -> cli_abort(class = "piperr") in both entry points
R5 Accepts both survey_id and pip_id, auto-detected lookup-first
R6 Unmatched identifiers warned, logged, and skipped (no abort)
R7 Nothing-to-clean abort accounts for the forced set (forced-only run proceeds)
R8 force_surveys_inf / force_surveys_unknown_inf log entries emitted
R9 Forced survey outside the module filter excluded by the inv_svy_full intersection
R10 force = TRUE behavior unchanged (regression-tested)

Commit summary

  • feat(force_surveys): add surgical survey re-processing parameter — code + regenerated man/ docs
  • test(force_surveys): cover surgical re-processing behaviors — test-valid_dlw_load.R + test-pd_process_data.R
  • docs: add force_surveys plan, solution, and roadmap status — plan, brainstorm, work-report, verify review, data-quality solution, rebuilt brain, roadmap status

Validation

  • Targeted tests: test-valid_dlw_load.R (102 pass), test-pd_process_data.R (9 pass)
  • Full suite: 563 pass, 0 fail, 2 pre-existing skips
  • devtools::document() regenerated man/ without error

- Add force_surveys param (survey_id and/or pip_id) to pd_process_data() and valid_dlw_load()

- Add mutual-exclusivity guards (force + force_surveys -> piperr) in both entry points

- Add resolve_force_surveys() internal helper with dedup'd pip_id reverse-map and uniqueness assertion

- Union forced surveys into the candidate set; nothing-to-clean abort accounts for forced_inv

- Add force_surveys_inf / force_surveys_unknown_inf logging

- Regenerate man/ docs via devtools::document()
- Add 12+ tests for valid_dlw_load force_surveys: retention, union dedup, pip_id reverse-map, unknown warn/skip, forced-only, aux dedup, duplicate dedup, type abort, missing pip_id column, master-unavailable, load-once, no-.joyn/no-dup, direct-call guard

- Add make_master_hash_pip() test helper

- Add pd_process_data tests: mutual-exclusivity abort, st_opts never called via force_surveys, force=TRUE timestamp regression, positional verbose compat

- Add P2.1 ambiguity and R9 out-of-filter and lookup-first precedence tests
- Add plan and brainstorm for force_surveys surgical re-processing

- Add execution report and verify review records

- Add data-quality solution: pip_id reverse-map dedup + uniqueness guard

- Rebuild knowledge brain (BRAIN.md, brain-index.json) after compounding

- Mark targeted-force-surveys roadmap feature done (via @cg-roadmap)
…essage

- Build the pip_id reverse-map only for identifiers that fail survey_id lookup, so survey_id-only force calls skip the full-master scan and are not blocked by unrelated ambiguous pip_ids

- Restrict ambiguity abort to requested pip_ids

- Extract shared .force_exclusive_msg constant used by both guard sites

- Add regression test: survey_id-only force ignores unrelated ambiguous pip_id
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