Repository navigation
Description
Problem Description
devops roadmap eval verify names its report file when the run starts. The name comes from a time stamp with a resolution of one second. Two processes that start in the same second get the same file name. Each atomic write (os.replace) replaces the cases of the other process, so the results of one process are lost and no warning shows.
PR #4451 (issue #4344) moved the time stamp from the end of the run to the start of the run. Before that change, the stamp came after the last case of a run of about 2 hours, so two processes almost never got the same name. The same PR tells the operator to split the case set between parallel processes, which is the workflow where the collision occurs.
Source on main (src/devops_cli/commands/roadmap_eval_verify.py, line 118):
target = resume or resolve_store_path(f"{_STORE}/{datetime.now(UTC):%Y%m%dT%H%M%SZ}.json")Nothing makes the name unique: there is no exclusive create, no PID and no suffix.
docs/ROADMAP_WORKFLOW.md, line 374: "To split the set between processes, give each process its own --case options, and resume each process from its own file."
Reproduction Steps
- Start five
devops roadmap eval verifyprocesses at the same time, each with its own--caseoptions. - Read the path that each process prints in its "storing" line.
- The review of PR feat(roadmap): eval verify stores each case and resumes #4451 got these stamps: 033213Z, 033213Z, 033216Z, 033217Z, 033217Z. Two pairs share one file name.
- Read each shared file. It holds only the cases of the process that wrote last.
Expected vs Actual Behavior
Expected: each run that starts with no --resume creates its own report file, also when two runs start in the same second. --resume <report> of each process finds only the cases of that process.
Actual: two runs that start in the same second write the same file. The cases of one run are lost, and its --resume cannot use "its own file".
Proposed fix
Create the report file with a unique name when the run starts, then let later writes replace that file. Use the standard library: tempfile.mkstemp(prefix=f"{stamp}-", suffix=".json", dir=<store folder>), or open(path, "x") with a counter suffix after FileExistsError. src/devops_cli/ai/run_store.py line 208 already adds secrets.token_hex(3) to its stamp for the same reason. Add a test that freezes the clock, runs the command two times, and expects two report files.
The other eval commands (roadmap_eval_stage.py, roadmap_eval_screen.py, roadmap_eval_completeness.py) take the stamp at the end of the run, so a collision there is improbable. A shared helper for a unique store path can serve all four commands.
Environment Diagnostics
main at 54743c4. No host data is necessary.
Logs, Traces, or Terminal Output
Found by the review of PR #4451 after the merge.
Source: #4451
Proposed design
Problem statement
Two devops roadmap eval verify runs that start in the same second write the same report file. Each atomic write replaces the cases of the other run. The lost cases make --resume unusable for the parallel workflow that the workflow document recommends.
Acceptance criteria
Requirement: Unique report file for each run
The verify command SHALL create a different report file for each run that starts without --resume, also when two runs start in the same second.
Scenario: Two runs start in one second
- WHEN Two
devops roadmap eval verifyruns start with no--resume, and the clock is frozen to one second. - THEN Each run prints a different
.jsonreport path, and both files exist in the verify store folder.
Requirement: One report path for the whole run
The verify command SHALL use the unique report path that it creates at the start for every later write of the run.
Scenario: A case ends and the report is written
- WHEN A run without
--resumeends a case and writes the report. - THEN The write goes to the same report file that the run printed at its start.
Requirement: Resume keeps the named report
The verify command SHALL write only the report file that --resume names and SHALL create no new report file for that run.
Scenario: A run resumes a report
- WHEN A
devops roadmap eval verifyrun starts with--resume <report>. - THEN The command updates
<report>in place and creates no other report file.
Requirement: Store folder exists before the unique create
The verify command SHALL create the verify store folder before it creates the unique report file.
Scenario: The store folder is absent
- WHEN The verify store folder does not exist, and a run starts without
--resume. - THEN The command creates the folder and then creates the unique report file in it.
Requirement: Frozen-clock test for two report paths
The change SHALL include an offline test that freezes the clock and asks the report-path helper for two paths.
Scenario: The report-path helper runs two times in one second
- WHEN The test freezes the clock to one second and calls the report-path helper two times.
- THEN The helper returns two different paths, and both files exist in the store folder.
Existing Tool Considered
No alternatives check has run. The Python standard library module tempfile, with tempfile.mkstemp, covers exclusive file creation, and the project already uses it for the same reason in src/devops_cli/roadmap/implement/implement_eval_run.py:452 (write_report, which creates the folder at line 455 and then calls tempfile.mkstemp(prefix=f\"implement-{stamp}-\", suffix=\".json\", dir=directory) at line 457) and in src/devops_cli/docker/cosign.py:49. It lacks JSON encoding and atomic replacement, so the command closes the descriptor and writes the report with the existing atomic writer. The change builds no custom unique-name generator.
Key questions
- Why do two parallel verify runs share one report file?: The target path uses
datetime.now(UTC)with seconds only when--resumeis absent. Two runs that start in one second get the same path, and each atomic write replaces the file. [sources: src/devops_cli/commands/roadmap_eval_verify.py:118, src/devops_cli/commands/roadmap_eval_verify.py:128, docs/ROADMAP_WORKFLOW.md:374] - Which standard-library call makes the report path unique?: Use
tempfile.mkstemp(prefix=f"{stamp}-", suffix=".json", dir=store_folder), as the implement eval already does, and close the file descriptor before the first report write. (best practice) [sources: src/devops_cli/roadmap/implement/implement_eval_run.py:452, src/devops_cli/roadmap/implement/implement_eval_run.py:457, src/devops_cli/docker/cosign.py:49, src/devops_cli/commands/roadmap_eval_verify.py:118]- Chosen:
tempfile.mkstemp. It creates the file exclusively in one call and needs no retry loop; the project already uses it this way inimplement_eval_run.write_report. - Rejected:
open(path, "x")with a counter. It needs a retry loop and more code for the same result. - Rejected:
secrets.token_hex(3)suffix. It adds a random part but does not create the file exclusively.
- Chosen:
- Should the unique report path helper serve all four eval commands now?: Add one helper for the unique report path and use it in
roadmap_eval_verify.pynow. Leave the other three eval commands unchanged because their stamps come at the end of the run and no parallel workflow uses them. (best practice) [sources: src/devops_cli/commands/roadmap_eval_verify.py:118, src/devops_cli/roadmap/implement/implement_eval_run.py:452, docs/ROADMAP_WORKFLOW.md:374]- Chosen: Shared helper, verify only. It fixes the reported collision with a small change and gives one place for later use, in the same shape as
implement_eval_run.write_report. - Rejected: Change all four commands. It adds unproven changes to commands whose stamps come after a long run.
- Rejected: Inline code in verify. It duplicates the logic when another command needs the helper.
- Chosen: Shared helper, verify only. It fixes the reported collision with a small change and gives one place for later use, in the same shape as
- How should the test freeze the clock?: Add a report-path helper that takes an optional time, and test it two times with one fixed time. The test asserts two different paths and two files. (best practice) [sources: src/devops_cli/commands/roadmap_eval_verify.py:118, src/devops_cli/roadmap/implement/implement_eval_run.py:452]
- Chosen: Helper with an optional time. It tests the collision without a model call and stays offline.
- Rejected: Patch
datetimein the command. It needs a full command run and mocks more code. - Rejected: No test of the clock. It does not prove the same-second case.
- Does
mkstempneed the store folder to exist?: Yes. The helper SHALL create the store folder withPath.mkdir(parents=True, exist_ok=True)beforemkstemp, becausemkstempcreates the file but not a missing directory. The project's ownwrite_reportdoes exactly this: it makes the directory at line 455 and callsmkstempwithdir=directoryat line 457. [sources: src/devops_cli/roadmap/implement/implement_eval_run.py:455, src/devops_cli/roadmap/implement/implement_eval_run.py:457, src/devops_cli/output/file_writer.py:182]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.Silent data loss in a documented parallel workflow pattern makes this high priority.Operators who follow the documented split-workflow lose results with no warning.The fix is a small change to file creation using mkstemp or open with x mode, and a single test.Issue 4344 added incremental storage and resume for eval verify; this candidate fixes a data-loss defect that 4344 introduced by moving the timestamp to run start.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 2f6114f (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Staged: branch
fix/4488-parallel-eval-verify-runs-share-one, draft pull request #4534. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these open findings. The stage keeps this pull request a draft with the label
plan/needs-fixuntil a later round clears them:spec_delta_wrongat specs: The plan adds a requirement, "A resumed run keeps the report it names", whose whole behavior the base spec already holds in "The verify command resumes a stored report": that requirement says the run writes the merged score to the same file, and its first scenario already ends with "no new report file is written". The delta adds a duplicate instead of leaving that requirement alone or modifying it. Evidence: "devops roadmap eval verify --resume <report>SHALL write only the report that--resumenames, and SHALL create no new report file for that run."spec_delta_wrongat specs: The added requirement "The verify command creates its own report file" repeats, in its second clause, what the existing requirement "The verify command stores each case when it ends" already requires: the report goes to the file named at the start and again when each case ends. Only the unique name is new, so the delta should modify that requirement rather than add a second one that overlaps it. Evidence: "SHALL write every later report of that run to the file that it created."The runs of the planner and the review made 60 model request(s), and used 3658750 input tokens and 59164 output tokens. The tool calls, in order:
list_files({"directory":"tests/roadmap/stage"})read_file({"path":"src/devops_cli/commands/roadmap_eval_verify.py","start_line":100,"end_line":150})read_file({"path":"src/devops_cli/roadmap/implement/implement_eval_run.py","start_line":435,"end_line":475})search_code({"text":"def resolve_store_path"})read_file({"path":"src/devops_cli/core/repo.py","start_line":440,"end_line":500})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_verify_eval.py","start_line":1,"end_line":80})search_code({"text":"verify_eval_storing"})search_code({"text":"roadmap_eval_verify"})search_code({"text":"verify_cmd"})search_code({"text":"resumed_outcomes"})read_file({"path":"src/devops_cli/output/file_writer.py","start_line":150,"end_line":220})search_code({"text":"_STORE = "})read_file({"path":"docs/ROADMAP_WORKFLOW.md","start_line":360,"end_line":385})read_file({"path":"src/devops_cli/core/repo.py","start_line":1,"end_line":40})read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_command.py","start_line":1,"end_line":120})search_code({"text":"from devops_cli.core.repo import"})list_files({"directory":"tests/core"})search_code({"text":"resolve_store_path"})read_spec({"capability":"roadmap-stage-eval","requirement":"The verify command stores each case when it ends"})read_spec({"capability":"roadmap-stage-eval","requirement":"The verify command resumes a stored report"})read_issue({"number":4451})read_issue({"number":4344})find_issues({"terms":"roadmap eval verify report"})read_file({"path":"tests/core/test_core_repo.py","start_line":1,"end_line":60})search_code({"text":"DEVOPS_CLI_DATA_DIR"})search_code({"text":"data_dir"})search_code({"text":"DEVOPS_CLI_DATA_DIR\""})search_code({"text":"data_dir_env"})read_file({"end_line":140,"path":"tests/ai/benchmark/test_data_dir_configuration.py","start_line":100})search_code({"text":"monkeypatch.setattr(\"devops_cli.core.clock"})search_code({"text":"freeze_time"})read_spec({"capability":"roadmap-stage-eval","requirement":"Each write leaves a complete report"})list_files({"directory":"tests/invariants"})search_code({"text":"cache_clear"})search_code({"text":"def load_settings"})read_file({"end_line":1835,"path":"src/devops_cli/config/settings.py","start_line":1800})read_file({"end_line":442,"path":"src/devops_cli/core/repo.py","start_line":400})read_file({"path":"tests/invariants/test_roadmap_workflow_doc.py","start_line":1,"end_line":60})search_code({"text":"create_store_file"})search_code({"text":"def _report_target"})search_code({"text":"def resolve_store_path"})list_files({"directory":"tests"})read_file({"path":"src/devops_cli/core/repo.py","start_line":440,"end_line":520})read_spec({"capability":"roadmap-stage-eval"})read_spec({"capability":"roadmap-stage-eval","requirement":"The verify command stores each case when it ends"})read_spec({"capability":"roadmap-stage-eval","requirement":"The verify command resumes a stored report"})search_code({"text":"mkstemp"})list_files({"directory":"tests/commands"})read_file({"path":"src/devops_cli/roadmap/implement/implement_eval_run.py","start_line":430,"end_line":480})list_files({"directory":"tests/invariants"})read_file({"path":"src/devops_cli/output/file_writer.py","start_line":150,"end_line":220})read_file({"path":"src/devops_cli/ai/run_store.py","start_line":195,"end_line":225})search_code({"text":"DEVOPS_CLI_DATA_DIR"})read_file({"path":"src/devops_cli/core/repo.py","start_line":380,"end_line":443})read_file({"path":"docs/ROADMAP_WORKFLOW.md","start_line":360,"end_line":390})read_file({"path":"tests/invariants/test_roadmap_workflow_doc.py","start_line":1,"end_line":80})search_code({"text":"def test_cmd"})list_files({"directory":"src/devops_cli/commands"})search_code({"text":"ci test"})file_symbols({"path":"src/devops_cli/commands/ci.py"})search_code({"text":"resolve_store_path"})read_file({"path":"src/devops_cli/commands/roadmap_eval_verify.py","start_line":100,"end_line":150})search_code({"text":"def load_settings"})search_code({"text":"monkeypatch.setenv(\"DEVOPS_CLI_DATA_DIR\""})read_file({"path":"tests/conftest.py","start_line":680,"end_line":730})read_file({"path":"src/devops_cli/config/settings.py","start_line":1780,"end_line":1850})search_code({"text":"readOnlyRootFilesystem"})search_code({"text":"roadmap_eval/verify"})read_file({"path":"openspec/specs/roadmap-stage-eval/spec.md","start_line":395,"end_line":470})read_file({"end_line":140,"path":"src/devops_cli/commands/roadmap_eval_stage.py","start_line":80})read_file({"end_line":115,"path":"src/devops_cli/commands/roadmap_eval_screen.py","start_line":65})search_code({"text":"roadmap_eval_verify"})search_code({"text":"verify_eval_storing"})search_code({"text":"def test_a_resume"})search_code({"text":"verify_json"})read_file({"end_line":460,"path":"tests/roadmap/stage/test_roadmap_stage_verify_eval.py","start_line":360})list_files({"directory":"tests/docs"})search_code({"text":"roadmap_eval"})search_code({"text":"def .*unique"})search_code({"text":"token_hex"})search_code({"text":"tempfile"})search_code({"text":"mirror"})read_file({"path":"tests/invariants/test_source_tree.py","start_line":1,"end_line":60})search_code({"text":"verify\").glob"})search_code({"text":"stage_eval_stored"})read_file({"end_line":130,"path":"src/devops_cli/output/file_writer.py","start_line":70})read_file({"end_line":150,"path":"src/devops_cli/output/file_writer.py","start_line":130})search_code({"text":"def _validate_target_path"})read_file({"end_line":60,"path":"src/devops_cli/output/file_writer.py","start_line":20})search_code({"text":"%Y%m%dT%H%M%SZ"})search_code({"text":"_STORE"})read_spec({})find_issues({"terms":"roadmap eval verify report"})read_issue({"number":4488})read_file({"path":"openspec/changes/archive/2026-11-11-4344-eval-verify-stores-each-case/specs/roadmap-stage-eval/spec.md","start_line":1,"end_line":40})search_code({"text":"core/repo.py"})read_file({"end_line":200,"path":"tests/invariants/test_roadmap_workflow_doc.py","start_line":80})search_code({"text":"tests/invariants/test_roadmap_workflow_doc.py"})list_files({"directory":"changelog.d"})search_code({"text":"changelog.d"})Tool calls: file_symbols=1 (empty=0), find_issues=2 (empty=0), list_files=9 (empty=0), read_file=33 (empty=0), read_issue=3 (empty=0), read_spec=7 (empty=0), search_code=45 (empty=5)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
docs(openspec): plan #4488 Give each eval verify run its own report file
devops-cli-service commentedon Nov 11, 2026
Released in v0.112.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 14:13 UTC