Repository navigation
fix(core): preserve unreadable run manifests - #17
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3e0df7296
ℹ️ 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".
| } catch (error) { | ||
| // Only absence permits initialization. Preserve malformed or unreadable | ||
| // evidence instead of replacing it with a new empty manifest. | ||
| if ((error as NodeJS.ErrnoException).code === "ENOENT") return null; |
There was a problem hiding this comment.
Distinguish dangling manifests from missing paths
When an existing manifest.json is a dangling symlink, readFile also fails with ENOENT, so this branch treats it as absent; the subsequent atomic rename replaces the symlink with a new empty manifest. This contradicts the new preservation guarantee for existing unreadable manifests and can destroy the only reference to temporarily unavailable evidence. Confirm that the directory entry itself is absent (for example, with lstat) before permitting initialization.
Useful? React with 👍 / 👎.
RunManifestStore.initRun previously treated every load failure as a missing manifest. Calling it on existing truncated JSON or schema-invalid JSON silently replaced that evidence with a new empty manifest. Only ENOENT now permits initialization; parsing, schema and other read failures propagate, preserving the original bytes. Valid and missing-manifest behavior remains unchanged.
Ten recovery regressions exercise synthetic messy Illumina/TSV files through validation, preview, acceptance, export and replay; stale input/profile/output review hashes; repeated run IDs and existing destinations; an injected partial-write exception; controlled termination during export and manifest staging; and malformed-manifest preservation. The test-only preload injects faults at one exact temporary path and terminates only test-owned child processes. No real private genomic data or external services are used.
Recovery limits: stored evidence integrity and export completeness are separate. A completed run can verify while its export bundle is partial after termination. Existing partial exports are preserved and retries use a fresh run ID/destination. Ordinary export write exceptions roll back that invocation's files while preserving unrelated files. Process termination at selected write checkpoints does not establish power-loss durability, concurrent writer safety or every possible failure interleaving.
Validation:
Compatibility: existing damaged manifests now error instead of being reset. No deterministic output change is expected for valid evidence. No workflow, credentials, permissions, policy, release or deployment changes. This PR is a draft; merge is outside this publication task.