You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve verified artifacts before Smithers worktree cleanup - #125
atomically publish the exact verifier-approved artifact bytes into canonical storage before a Smithers task can complete
include declared generated-test companions in the same validated publication set
fall back to an exclusive, durable descriptor write when a mounted filesystem rejects hard links
emit a typed, non-resumable Modal terminal diagnostic when an already-terminal checkpoint cannot advance
provision new Modal benchmark storage as version-2 volumes and verify the resolved version and identity before attachment
reap successful Smithers task worktrees after their verified artifacts have been durably published
add real lifecycle, recovery, volume-version, and no-hard-link regression coverage
Root cause
The generated workflow validated task-owned mirror files, but canonical publication happened later in an out-of-process synchronizer. Smithers could therefore reap a successful worktree containing only ignored artifacts before the synchronizer copied them. The resulting terminal artifact-contract failure was then classified as resume-required even though the durable run had no resumable transition.
The first publication fix used a hard link to provide an atomic no-replace boundary. Some durable mounted filesystems reject hard links with EPERM, which made verification fail even though ordinary exclusive file creation was supported. The fallback retains no-replace behavior with O_EXCL, writes through the opened descriptor, fsyncs, validates exact bytes and file identity, and removes a partially written destination on a handled error.
Large benchmark workflows can also exhaust the fixed inode ceiling of Modal version-1 volumes while many Smithers worktrees are active. The Modal JavaScript SDK does not yet expose a public filesystem-version selector for named volumes, so launch now performs a narrow control-plane version-2 creation preflight, verifies the returned version, and checks that the public lookup resolves the same volume. Successful worktrees are then reaped because canonical artifact publication no longer depends on retaining them.
Validation
Artifacts: 49 tests passed
Runtime: full package test suite passed, including the real Smithers worktree cleanup lifecycle (one unrelated optional smoke skipped)
Modal: 172 tests passed
Modal and runtime typechecks/builds passed
Real Modal mounted-volume probe reproduced hard-link rejection and passed exact-byte, idempotency, conflict, cleanup, and file-mode checks
Live Modal version-2 named-volume create, metadata verification, lookup, and deletion probe passed
ESLint, Prettier, and git diff --check passed
GitHub release and benchmark gates are running on the updated commit
This PR fixes a race condition where a successful Smithers worktree could be reaped before its verified artifacts were durably persisted to canonical storage, causing artifact-contract failures that were incorrectly classified as resumable. It also adds a fallback publication path for filesystems that reject hard links, upgrades Modal benchmark volumes to filesystem version 2 to avoid inode exhaustion, introduces Kimi subscription-auth lifecycle management, and emits a typed non-resumable diagnostic when an already-terminal checkpoint cannot advance.
Artifact publication fix: publishFileDurableExclusive in packages/artifacts/src/safe-paths.ts atomically seals verified bytes (primary artifact + generated-test companions) into the canonical artifact directory before verifyArtifacts returns, using hard-link where available and an O_EXCL descriptor write + fsync fallback for Modal's mounted volumes.
Volume v2 preflight: getOrCreateModalV2Volume in packages/modal/src/volume.ts calls the undocumented control-plane volumeGetOrCreate endpoint with an explicit filesystem-version-2 request, verifies the returned version and volume identity, then falls back to the public fromName lookup for attachment.
Terminal diagnostic: NonResumableTerminalRunError replaces a generic Error in repairModalEvalRunRecord, is caught in the worker's diagnosticCodeForError hook, and maps to the "terminal-run-non-resumable" permanent-failure code so the overseer does not schedule another Modal generation.
Confidence Score: 5/5
Safe to merge; the core artifact-publication race fix is well-tested with a real Smithers lifecycle integration test, and the Modal volume v2 path includes runtime identity verification.
The new publishFileDurableExclusive function handles all expected failure modes (EPERM from hard links, EEXIST from concurrent publishers, EIO-style close failures) with correct fd lifecycle management. The two findings are style-level concerns: a string-match heuristic and an incomplete status-spelling list, neither of which affects correctness on the current version.
Files Needing Attention:smithersSnapshotHasMissingRunHistory in packages/runtime/src/smithers.ts and isTerminalRunStatus in packages/modal/src/resume.ts are worth a second look at the next Smithers version bump.
Important Files Changed
Filename
Overview
packages/artifacts/src/safe-paths.ts
Adds publishFileDurableExclusive — an atomic no-replace publication function using hard-link + O_EXCL fallback with fsync and identity verification.
packages/modal/src/volume.ts
New file creating Modal v2 volumes via the undocumented control-plane API with post-creation version and identity verification.
packages/runtime/src/smithers.ts
Adds --force/--retry-failed passthrough and recovery helpers; the missing-run-history string-match heuristic is the only notable fragility.
packages/modal/src/resume.ts
Introduces NonResumableTerminalRunError and modalDurableRunNeedsResume; isTerminalRunStatus missing "cancelled" spelling is a minor inconsistency.
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/@moonshot-ai/kimi-code@0.29.1. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Warn
Obfuscated code: npm drizzle-orm is 90.0% likely obfuscated
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/drizzle-orm@0.45.2. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Warn
Obfuscated code: npm effect is 90.0% likely obfuscated
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/effect@3.21.4. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Warn
Obfuscated code: npm json-schema is 90.0% likely obfuscated
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/json-schema@0.4.0. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Warn
Obfuscated code: npm rimraf is 90.0% likely obfuscated
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/rimraf@5.0.10. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Warn
Obfuscated code: npm robust-predicates is 90.0% likely obfuscated
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/robust-predicates@3.0.3. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
Superseded by #140, which incorporates this PR’s complete artifact-preservation change set together with the pinned-source hardening tracked in #139. Closing this PR so review can continue in one place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The generated workflow validated task-owned mirror files, but canonical publication happened later in an out-of-process synchronizer. Smithers could therefore reap a successful worktree containing only ignored artifacts before the synchronizer copied them. The resulting terminal artifact-contract failure was then classified as resume-required even though the durable run had no resumable transition.
The first publication fix used a hard link to provide an atomic no-replace boundary. Some durable mounted filesystems reject hard links with
EPERM, which made verification fail even though ordinary exclusive file creation was supported. The fallback retains no-replace behavior withO_EXCL, writes through the opened descriptor, fsyncs, validates exact bytes and file identity, and removes a partially written destination on a handled error.Large benchmark workflows can also exhaust the fixed inode ceiling of Modal version-1 volumes while many Smithers worktrees are active. The Modal JavaScript SDK does not yet expose a public filesystem-version selector for named volumes, so launch now performs a narrow control-plane version-2 creation preflight, verifies the returned version, and checks that the public lookup resolves the same volume. Successful worktrees are then reaped because canonical artifact publication no longer depends on retaining them.
Validation
git diff --checkpassedFixes #122
Greptile Summary
This PR fixes a race condition where a successful Smithers worktree could be reaped before its verified artifacts were durably persisted to canonical storage, causing artifact-contract failures that were incorrectly classified as resumable. It also adds a fallback publication path for filesystems that reject hard links, upgrades Modal benchmark volumes to filesystem version 2 to avoid inode exhaustion, introduces Kimi subscription-auth lifecycle management, and emits a typed non-resumable diagnostic when an already-terminal checkpoint cannot advance.
publishFileDurableExclusiveinpackages/artifacts/src/safe-paths.tsatomically seals verified bytes (primary artifact + generated-test companions) into the canonical artifact directory beforeverifyArtifactsreturns, using hard-link where available and anO_EXCLdescriptor write + fsync fallback for Modal's mounted volumes.getOrCreateModalV2Volumeinpackages/modal/src/volume.tscalls the undocumented control-planevolumeGetOrCreateendpoint with an explicit filesystem-version-2 request, verifies the returned version and volume identity, then falls back to the publicfromNamelookup for attachment.NonResumableTerminalRunErrorreplaces a genericErrorinrepairModalEvalRunRecord, is caught in the worker'sdiagnosticCodeForErrorhook, and maps to the"terminal-run-non-resumable"permanent-failure code so the overseer does not schedule another Modal generation.Confidence Score: 5/5
Safe to merge; the core artifact-publication race fix is well-tested with a real Smithers lifecycle integration test, and the Modal volume v2 path includes runtime identity verification.
The new
publishFileDurableExclusivefunction handles all expected failure modes (EPERM from hard links, EEXIST from concurrent publishers, EIO-style close failures) with correct fd lifecycle management. The two findings are style-level concerns: a string-match heuristic and an incomplete status-spelling list, neither of which affects correctness on the current version.Files Needing Attention:
smithersSnapshotHasMissingRunHistoryinpackages/runtime/src/smithers.tsandisTerminalRunStatusinpackages/modal/src/resume.tsare worth a second look at the next Smithers version bump.Important Files Changed
publishFileDurableExclusive— an atomic no-replace publication function using hard-link + O_EXCL fallback with fsync and identity verification.--force/--retry-failedpassthrough and recovery helpers; the missing-run-history string-match heuristic is the only notable fragility.NonResumableTerminalRunErrorandmodalDurableRunNeedsResume;isTerminalRunStatusmissing "cancelled" spelling is a minor inconsistency.modalDurableRunNeedsResumeand mapsNonResumableTerminalRunErrorto typed diagnostic.Reviews (8): Last reviewed commit: "Type Modal topology loop test" | Re-trigger Greptile