Skip to content

feat(deflation): add pd_deflate_pipeline() batch orchestrator - #32

Open
randrescastaneda wants to merge 5 commits into
PRODfrom
stream-a-pipeline-cleanup
Open

feat(deflation): add pd_deflate_pipeline() batch orchestrator#32
randrescastaneda wants to merge 5 commits into
PRODfrom
stream-a-pipeline-cleanup

Conversation

@randrescastaneda

Copy link
Copy Markdown
Member

What this PR does

Create pd_deflate_pipeline(), a batch orchestrator that iterates over a master inventory of cleaned surveys, deflates each via pd_deflation() (simple Mode B), correctly detects and skips failures (including NA returns), saves results to a new "pip_deflated" stamp alias, updates the master inventory with deflation columns, and logs a structured summary. The function operates as an independent pipeline stage — not called by pd_process_data().

Requirements addressed

ID Requirement Source
R1 Iterate over an inventory of cleaned surveys and apply pd_deflation() to each brainstorm
R2 Save deflated outputs to a dedicated "pip_deflated" stamp alias brainstorm
R3 Log a structured summary entry to pipdata_log with pinned keys n_total, n_success, n_failed, surveys_success, surveys_failed brainstorm + review P2.4
R4 Per-survey tryCatch with skip-and-log; detect NA returns from pd_deflation() as failures brainstorm + review P1.2
R5 Support both internal inventory loading (inv = NULL) and caller-supplied inventory, normalizing a missing deflated column brainstorm + review P2.3
R6 Use simple Mode B (pip_id only, no version hint) to delegate loading to pd_deflation() review P1.4
R7 First version: deflate everything not yet deflated (no incremental aux-hash gating) brainstorm
R8 Standalone pipeline stage — invoked independently by script brainstorm
R9 Add and initialize deflation columns (deflated, content_hash_deflated, aux_*_hash_at_deflation) in the master inventory brainstorm + review P1.3/P3.2
R10 Source aux hash snapshots via get_aux_hashes(c("cpi", "ppp", "pop")) review P2.2
R11 Check save_pip_data() return value so save failures are not counted as success review P2.1

- Orchestrates pd_deflation() over the master inventory (simple Mode B), skips NA/erroring surveys, saves each to the dedicated pip_deflated stamp alias, and writes the updated master.

- Adds a five-column deflation schema (deflated, content_hash_deflated, aux_cpi/ppp/pop_hash_at_deflation) initialised to NA by build_pip_inventory() for fresh and legacy rows.

- Logs a deflate_summary_inf entry via log_add() with explicit args; classifies piperr conditions by their specific class with unknown_error fallback.

- Registers the pip_deflated alias in pipdata_dlw_process() and Pipdata_script.R.
- Regenerates man pages for pd_deflate_pipeline() and build_deflation_summary(), and updates pd_deflation()/log_report() docs.

- Vignette gains a pd_deflate_pipeline() section and updates the log_report() scope to include deflation entries.
- Adds 60 tests for deflate_one() and pd_deflate_pipeline() (happy path, NA guard, save failure, piperr/generic errors, force, early returns, catalog dedup).

- Adds deflation-column schema tests to test-build_pip_inventory.R and build_deflation_summary() tests to test-log_report.R.
- Adds the 2026-08-17 plan (Steps 1-6, evidence V1-V7), brainstorm, and execution record for the deflate-pipeline-wrapper feature.
- Roadmap feature deflate-pipeline-wrapper set to done with plan link.

- Active-state current.json repointed to the 2026-08-17 plan/execution report.
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