Deduplicate core research engine helpers across STORM, Co-STORM, Graft, OTel, and Tools
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
Research direction
Start by reading the named helpers in R/costorm.R, R/research-review.R, and R/enriched-execution.R to understand the proposed shared promise awaiter. Then map the other listed duplication groups and their tests before attempting the broader consolidation. Done means all listed helpers and tiny files are consolidated without behavior or public API changes, OTel and progress events share their vocabulary source, and the affected suites plus air format --check . pass.
Written by the indexing model from the issue text.
Description
Problem
Core research engine modules contain significant cross-file and intra-file duplication across STORM, Co-STORM, sync/async stage execution, Graft memory/artifacts, OTel/progress events, and small single-function files.
Scope
- Unify synchronous promise awaiters
- Replace
tempest_costorm_await()(R/costorm.R:123–157),tempest_research_review_await()(R/research-review.R:1380–1426), andtempest_enriched_await_promise()(R/enriched-execution.R:28–69) with one sharedtempest_await_promise()helper.
- Replace
- Deduplicate STORM, Co-STORM, and sync/async execution flows
- Extract the verbatim 40-line research loop body duplicated in
R/storm.R:1143–1183andL1211–1251. - Share stage preparation between sync and async fact extraction (
R/storm-research.R:514–676), expert generation (R/storm-perspectives.R:88–191), and stage fallback/attempt preflight (R/stage-record.R:4437–4927, including 56 verbatim lines). - Share Deputy trace base validation between
tempest_storm_deputy_trace()(R/storm-research.R:23–57) andtempest_costorm_deputy_trace()(R/costorm.R:235–302). - Share pending-run lookup/identity/removal between
tempest_session_settle_agent_completion()andtempest_session_settle_agent_terminal()(R/costorm.R:2230–2361), and extract the repeated quiescence guard inR/costorm-report.R:470–499.
- Extract the verbatim 40-line research loop body duplicated in
- Deduplicate Graft, knowledge-artifact, review, retriever, and contract helpers
R/graft-memory.R:428–568: share review input validation and expected-head resolution betweentempest_graft_accept_selection()andtempest_graft_withdraw_stream()(also resolving thecurrent_headvsexpectedreturn inconsistency at L487 vs L557).R/graft-artifacts.R:315–357: extract repeatedgraft_recall()accepted-decision check intempest_reuse_artifact_research().R/knowledge-artifacts.R: extract repeated exact-ID check (L48–59vsL84–95) and 1 MiB byte-limit check (L229–243vsL285–296).R/research-review.R:221–268vsR/research-review-types.R:138–184: unify dossier evidence-quote validation.R/retriever.R:342–517: share URL validation and PDF detection betweentempest_fetch_url_markdown()andtempest_fetch_url_text().R/research-manifest.R:13–24: derivetempest_opaque_identifier_stagesfromtempest_program_set_stages().R/stage-record.R:4100–4115: reusetempest_dsprrr_contract_condition()fromR/dsprrr.R.
- Reconcile diverging OTel & progress-event vocabularies
- Unify stage/step name sources between
R/otel.R:40–78andR/progress-events.R:584–632so OTel and progress events cannot silently drift (e.g.,"persist"and"expert_question"currently missing fromotel.R).
- Unify stage/step name sources between
- Consolidate tiny fragmented
R/files and misplaced helpers- Fold single-function / tiny files into their natural owners (updating
DESCRIPTIONCollateas needed):R/suggestions.R(21L),R/prompts.R(22L),R/storm-polish.R(26L),R/citations.R(44L),R/storm-evidence.R(49L),R/execution-events.R(101L),R/research-tools.R(125L). - Move misplaced
tempest_generate_single_expert()fromR/tools.R:1045–1099toR/storm-perspectives.R.
- Fold single-function / tiny files into their natural owners (updating
Acceptance Criteria
- Listed duplications and tiny fragmented files are consolidated with no behavioral or public-API changes.
- OTel and progress-event stage/step vocabularies derive from a single source of truth.
- Full affected test suites and
air format --check .pass.
- 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
-
Consolidate duplicated persistence primitives, manifest validation, and multi-pass restore checksOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
JamesHWade/tempest#207 · 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