Repository navigation
Conversation
This was referenced Oct 28, 2026
This was referenced Oct 28, 2026
yohamta0
force-pushed
the
stack/02-g2
branch
2 times, most recently
from
October 30, 2026 06:44
7ad917d to
1a3559c
Compare
* Spec 083 and the samples store for continuous runs * Satisfy linters in the samples store * Fix samples store issues found in review * Keep backfilled tiers and sample order complete * Keep sample stores apart and streak memory flat * Keep sample counts and order right after a crash
A run ID names one run across the history and ephemeral stores, a hidden ephemeral attempt reports no status data instead of falling through, a not-started ephemeral run is not removed, the recent status limit is the same with ephemeral runs, and a queued status records an ephemeral attempt.
A running attempt keeps appending to the compacted file, so its directory entry is synced. A writer that could not reopen after a compaction opens again on the next write instead of losing the rest of the run.
Timestamps now carry milliseconds, so a status written before that names the same finish time in another form. Compare the instants, so that such a waiting run is not rejected as a changed manual action.
An artifact sweep read run liveness from the history store only, so the artifacts of an ephemeral run, which share the artifact root, looked orphaned and were removed. The repository now passes its ephemeral store to the sweep, which keeps the runs of both trees. A compaction replaces the status file by rename, so another attempt that held the old file open, such as a compare-and-swap beside the runner, appended to a file no reader sees. A write now reopens the path when it names another file than the open one. An older worker formats a stored time without its milliseconds, so the waiting report of a resumed run differed from the stored approval time and the coordinator rejected it. A time without a fraction now matches any time in the same second.
The option is documented to apply only to a new root run, but a retry or a child run that carried it went to the ephemeral store even when its root lived in the history, splitting the attempt from its root. Such attempts now follow their root like any other.
The ephemeral cleanup lists ended runs and removes each one later. A retry that starts in between creates an attempt that the removal did not see: before the runner opens it, it has no status file, so the latest attempt is still the ended one, and a dispatched attempt is NotStarted, which is not active. The removal then deleted the run with the new attempt, its logs and its work directory. The cleanup now names the attempt it judged, and the store refuses the removal under its lock when a newer attempt exists.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All PRs of the stack
Summary
This PR adds fields to the persisted run state:
Continuouson a node, andEphemeral,SkipHandlersandReusedInputson a run. It adds an ephemeral store to the DAG-run repository. It changes run timestamps to millisecond precision and bounds the size of an open status file.Why
Selected-step runs and continuous runs need to be recorded in the run state before the runtime and the API can use them. PR 1 gives the samples store. PR 3 uses these fields in the runner, and PR 4 sets them from the API and the CLI.
Changes
internal/ir)run_status.go:DAGRunStatus.Ephemeral,SkipHandlers,ReusedInputs; typesReusedInputandReusedInputVia(runorcache).run_node.go:Continuouson the node state.run_status_builder.go: optionsWithEphemeral,WithSkipHandlers,WithReusedInputs(copies the slice).internal/cmn/stringutil)FormatTimewritesTimestampLayoutwith three fractional digits. NewFormatTimeSecondskeeps second precision.ParseTimereads old and new values. Old status files load with no migration.internal/persis)dagrun_repository_ephemeral.go:createStore,storeHolding,EphemeralRunTTL,ErrEphemeralUnsupported. A retry or child run follows its root run.DAGRunCreateAttemptOptions.Ephemeral,DAGRunRepositoryOptions.EphemeralStore. Ephemeral runs emit no events and do not appear in listings (runstate.go,dagrun_repository_events.go).NewFileDAGRunRepositoryWithEphemeralinpersis/file.persis/file/dagrun/attempt.go)compactIfLargeLockedreplaces an open status file larger than 1 MiB with the last record. It needs at least two appends between compactions.Attempt.Dir()andAttemptDir()give the attempt directory, used for the samples store in PR 3.queue_abort.goandartifact/store.gouse the new format function.testutil/dagrun_repository.gogets a helper.How to review
internal/ir/run_status.goand the builder options.internal/cmn/stringutil/stringutil.go(format and parse).dagrun_repository_ephemeral.go, then the changes indagrun_repository.go.compactStatusLockedinattempt.go.Pay most attention to these places:
Tests
internal/ir/run_status_test.go,run_status_builder_reused_test.go: millisecond times, old files,ReusedInputsround trip.internal/cmn/stringutil/stringutil_test.go: format, fixed width, parse.internal/persis/dagrun_repository_ephemeral_test.go: hidden from listings, retries follow the root, cleanup.internal/persis/file/dagrun/attempt_compaction_test.go: compaction of an open file.Screenshots
No visible UI change in this PR.
Run chips that show reused outputs appear in a later UI PR of the stack.