Skip to content

[P0][Stability] job開始前にsource/target referenceとcontigを明示検証し raw KeyError/StopIteration を出さない - #53

Merged
light-suzuki merged 1 commit into
mainfrom
issue/48-job-input-preflight
Aug 9, 2026
Merged

[P0][Stability] job開始前にsource/target referenceとcontigを明示検証し raw KeyError/StopIteration を出さない#53
light-suzuki merged 1 commit into
mainfrom
issue/48-job-input-preflight

Conversation

@light-suzuki

Copy link
Copy Markdown
Owner

Fixes #48

実施内容


  • un_job()\ 冒頭に \preflight()\ を追加し、解析開始前に以下を一括検証(失敗時は \ValueError\ で具体的メッセージを返す)
    • source/target reference が存在する(未知名は利用可能リスト付きで明示)
    • source/target のFASTA、source のGFF が存在する(欠落時はreference名+ファイル種別を明示)
    • ambiguous(FASTA/GFF複数候補)も拒否(#47の状態を再利用)
    • source contig がFASTAに存在する
    • start/end/peak がcontig範囲内(contig名・reference名付き)
    • target_contig 指定時は target FASTA に存在する
  • 検証は全てBLAST/minimap2起動前に実行され、失敗時はツールを一切起動しない
  • 既存の \libraries[payload[...]]\ /
    ext(...)\ を preflight の返却値に置換

テスト

  • 未知reference / 未知contig / 区間超過 / GFF欠落 / target_contig未知 の各ケースで raw KeyError/StopIteration を出さず ValueError になることを検証(7テスト追加)
  • 全46テスト成功、
    uff check\ パス

Copilot AI lite review requested due to automatic review settings August 9, 2026 00:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: acab6a5af5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +45 to +46
if status == "ambiguous":
raise ValueError(f"{side} reference '{reference['name']}' has multiple {kind.upper()} files ({', '.join(candidates)}); keep exactly one {kind.upper()} file per reference folder.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Detect ambiguous files before checking their status

When a folder contains multiple FASTA or GFF files, this branch is unreachable: detect_genomes() selects the first matching file with next(...), always reports its status as "ready", and never populates *_candidates. Consequently preflight accepts the reference and the job can silently analyze an arbitrary assembly or annotation instead of rejecting the ambiguity. Enumerate candidates and set the ambiguous status in genome discovery, or detect the duplicates here.

AGENTS.md reference: AGENTS.md:L11-L12

Useful? React with 👍 / 👎.

# Conflicts:
#	backend/qtlift/pipeline.py
#	tests/test_pipeline.py
@light-suzuki
light-suzuki force-pushed the issue/48-job-input-preflight branch from acab6a5 to aa5fe89 Compare August 9, 2026 02:17
@light-suzuki
light-suzuki merged commit 7ce3f7d into main Aug 9, 2026
8 checks passed
@light-suzuki
light-suzuki deleted the issue/48-job-input-preflight branch August 9, 2026 02:17
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.

[P0][Stability] job開始前にsource/target referenceとcontigを明示検証し raw KeyError/StopIteration を出さない

2 participants