Skip to content

Refactor/config - #11

Open
dimalvovs wants to merge 7 commits into
mainfrom
refactor/config
Open

dimalvovs wants to merge 7 commits into
mainfrom
refactor/config

Conversation

@dimalvovs

Copy link
Copy Markdown
Contributor

This pull request refactors how system prompts are managed and improves GPU allocation flexibility in the workflow. The main change is moving system prompts out of the Python code and into dedicated Markdown files, making them easier to update and maintain. Additionally, the workflow and configuration now support customizable GPU allocation. Documentation and usage instructions have also been updated for clarity.

Prompt management and refactoring:

  • Moved all system prompts (for analysis, synthesis, and review) out of hardcoded Python strings in interpret.py and into separate Markdown files in the new prompts/ directory. Prompts are now loaded at runtime, making them easier to edit without touching code. (interpret.py, prompts/review_system_prompt.md, prompts/synthesis_system_prompt.md) [1] [2] [3] [4] [5]

  • Updated the logic in interpret.py so that "as_is" mode for text reports uses no default system prompt for analysis, but always uses the synthesis prompt for the summary stage. [1] [2]

Workflow and configuration improvements:

  • Added support for customizable GPU allocation in both main.nf and nextflow.config by introducing a gpus parameter, allowing users to specify the number of GPUs to allocate per job. [1] [2] [3]

Documentation updates:

  • Improved usage instructions in README.md to clarify supported input types, chunking behavior, and prompt customization options. Updated command-line flag names to reflect the new prompt system. [1] [2]

Minor code and text improvements:

  • Generalized prompt-building functions in interpret.py to refer to "report sections" instead of "MultiQC sections," reflecting broader applicability.
  • Added missing import for read_text in interpret.py.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

GPU configuration is inconsistent, text reports receive a mismatched prompt, and several documented command-line options are unsupported or malformed.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Refactors prompts into Markdown files and introduces configurable GPU allocation.

Changes:

  • Loads analysis, synthesis, and review prompts from prompts/.
  • Updates text-report synthesis behavior and tests.
  • Adds GPU configuration and revises usage documentation.
File Description
interpret.py Loads external prompts and updates text-report behavior.
prompts/​system_prompt.md Defines the analysis prompt.
prompts/​synthesis_system_prompt.md Defines the synthesis prompt.
prompts/​review_system_prompt.md Defines the review prompt.
tests/​test_interpret.py Updates synthesis prompt assertions.
main.nf Adds an accelerator request.
nextflow.config Adds configurable Slurm GPU allocation.
README.md Updates input and prompt usage documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment thread interpret.py Outdated
synthesis_prompt = (
TEXT_AS_IS_SYNTHESIS_SYSTEM_PROMPT if as_is else TEXT_SYNTHESIS_SYSTEM_PROMPT
)
base_prompt = "" if as_is else SYSTEM_PROMPT
Comment thread main.nf Outdated
Comment thread README.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Plain-text prompting regresses to schema-specific instructions, run metadata is inaccurate for as-is mode, and several documented commands are unusable.

Review effort: Balanced
Findings: 3 Medium severity · 2 Low severity

Open (5)
Resolved since last review (1)
Previously missed (3)

In code that hasn't changed since last review

Medium severity Assert as-is analysis calls use an empty system prompt

tests/​test_interpret.py:58

This test verifies only the synthesis call, so it would still pass if as_is=True incorrectly sent the default prompt during section analysis. Assert that the first two calls have an empty system prompt to cover the newly advertised behavior.

Low severity Fix the Nextflow example's sample file path

README.md:33

This Nextflow example no longer points to the bundled sample: channel.fromPath resolves against the working directory and the repository's file is data/multiqc_data.json, so copying the command fails before the prompt options are exercised.

This issue also appears on line 34 of the same file.

Low severity Update README to clarify as-is prompt behavior

interpret.py:540

This new synthesis behavior conflicts with README.md:163-164, which still says --as-is omits any system prompt. Please clarify there that only the analysis-stage prompt is omitted and that chunked synthesis still uses the bundled prompt.

This issue also appears on line 817 of the same file.

Comment thread interpret.py
Comment thread README.md
dimalvovs and others added 2 commits September 29, 2026 07:04
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.

2 participants