Consolidate duplicated persistence primitives, manifest validation, and multi-pass restore checks
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the named persistence, workspace, authority, promotion, and trajectory review files, then trace the existing shared helpers and validation call paths. The scope spans 12 files and several overlapping restore and validation flows, so map their contracts before changing them. Done means the listed primitives are consolidated without changing schemas, APIs, or error contracts, all specified test suites pass, and air format --check . passes.
Written by the indexing model from the issue text.
Description
Problem
Persistence, promotion, authority, and trajectory-review layers (~21,800 lines across 12 files) carry heavy duplicated boilerplate: R/promotion-persistence.R re-implements primitives from R/product-persistence.R, STORM and Co-STORM manifest validators duplicate ~150 lines of unreachable post-validation checks, Co-STORM bundle resume parses and restores the workspace twice, and digest/nullable/schema-field/Deputy-status helpers are copy-pasted across files.
Scope
- Unify
R/promotion-persistence.RontoR/product-persistence.R- Delegate
tempest_promotion_file_checksum(),tempest_promotion_write_json()/_read_json(),tempest_promotion_symlink(),tempest_promotion_install(), and regular-file assertions to shared helpers inR/product-persistence.R.
- Delegate
- Consolidate shared bundle writers and manifest inventory validation in
R/product-persistence.R- Extract shared
tempest_persistence_bundle_write_json()/_write_text()replacing identical pairs inR/storm-persistence.R:52–86andR/costorm-persistence.R:1457–1494. - Extract shared bundle inventory + checksum validation helper, eliminating ~150 lines of unreachable checks already enforced by
tempest_persistence_require_regular_bundle_files()andtempest_persistence_manifest_checksums()intempest_storm_bundle_validate_manifest()(R/storm-persistence.R:513–728) andtempest_session_bundle_validate_manifest()(R/costorm-persistence.R:1972–2246).
- Extract shared
- Eliminate redundant multi-pass validation and workspace restore
- Share a single parsed-snapshot validation path between
tempest_costorm_bundle_validate_product()(R/costorm-persistence.R:2249–2416) andtempest_session_restore_internal()(L1109–1449) to eliminate ~150 lines of duplicated validation and doubleResearchWorkspacerestoration duringtempest_session_resume(). - Remove redundant inner schema/record checks in
R/research-workspace-persistence.R(tempest_research_workspace_restore_schemavsrequire_current_schema, redundantelsebranch inexact_records, redundant pre-check invalidate_claim_record) and factor the 6 repeated collection-restore loops intempest_research_workspace_restore()(L751–1150) into a helper. - Deduplicate pre-authority validation passes in
R/storm-persistence.Rwheretempest_product_authority_validate()already enforces the same invariants (preserving exact error classes and messages).
- Share a single parsed-snapshot validation path between
- Consolidate shared digest, nullable, schema-field, and Deputy-lineage helpers
- Unify
tempest_promotion_digest()(R/promotion-types.R:24–33) andtempest_trajectory_digest()(R/trajectory-review.R:202–204) onto a sharedR/product-hash.Rhelper. - Unify verbatim identical
tempest_promotion_nullable()(R/promotion-types.R:35–43) andtempest_trajectory_nullable()(R/trajectory-review.R:206–214) inR/product-validation.R. - Reuse
tempest_resource_record_fields(),tempest_evidence_span_record_fields(), and a sharedtempest_claim_support_record_fields()inR/promotion-types.R:141–188andR/research-workspace-persistence.R:333–341. - Share the 12-element Deputy terminal-status vector and delegation parent-matching helper between
R/product-authority.RandR/trajectory-review.R.
- Unify
Acceptance Criteria
- Persistence, promotion, workspace, and trajectory-review layers share the consolidated primitives above without changing on-disk schemas, public APIs, or error classes/contracts.
- All persistence, promotion, authority, and trajectory-review test suites pass with zero regressions.
-
air format --check .passes.
- Dominant language
- R
- Stars
- 1
- Forks
- 0
- Avg merge
- 19h 6m
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JamesHWade/tempest
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JamesHWade/tempest#211 ·
Maintainers usually reply within 1 day
-
Deduplicate Shiny and researcher-app memory/UI/sanitization code and tighten inst/shiny/ boundariesOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
JamesHWade/tempest#210 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JamesHWade/tempest#209 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
JamesHWade/tempest#208 · 1 comment ·
Maintainers usually reply within 1 day
-
Simplify Tempest external API surfaceMay be free again @JamesHWade claimed this 69 days ago, and no pull request is open. Openmigrated-from-kata
JamesHWade/tempest#83 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in JamesHWade/tempest
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug dependencies R
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JamesHWade/graft#142 ·
Maintainers usually reply within 1 day