Repository navigation
Description
Problem Description
The git transcript tests/fixtures/git/review_window.json (scenario review_window of tests/support/git_scenarios.py, #4794) does not match what the code does on origin/main. The contract suite fails on it, and a new recording changes the transcript.
Reproduction Steps
- Check out
origin/mainat 9f0e0c8. - Run
uv run devops ci test tests/core/test_git_contract.py(oruv run pytest tests/core/test_git_contract.py -k review_window). - Run
uv run python -c "import sys; from tests.support.git_recording import main; sys.exit(main(['--check']))".
Expected vs Actual Behavior
Expected: both contract cases of review_window pass, and --check reports that the transcripts match.
Actual: test_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window] and test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window] fail. --check reports committed/review_window.json as different; a new recording with git 2.55.0 gives 8 insertions and 272 deletions (the cat-file blob exchanges go). No commit after #4794 changed src/devops_cli/roadmap/project_review/ or the scenario, so the scenario or its code is probably not deterministic (for example, it reads the current date).
Environment Diagnostics
git 2.55.0, Python 3.14.10, the devcontainer.
Logs, Traces, or Terminal Output
FAILED tests/core/test_git_contract.py::test_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window] - AssertionError: assert {'origin': 'e...9', ...}, ...} == {'origin': 'e...9', ...}
Found while building #4670.
Source: #4670
Alternatives check of 2026-11-14: none.
Tool: none found.
Proposed design
Problem statement
The committed git transcript tests/fixtures/git/review_window.json does not match what the code gives. Two contract cases fail, and the git row of devops ci reports a difference. The period_facts of the result differ, and a new recording with git 2.55.0 drops the cat-file blob exchanges. The fix isolates the scenario from the host and records the transcript again, so that the file matches on every host.
Acceptance criteria
Requirement: Contract replay of review_window
The contract suite SHALL replay the scenario review_window over the process fake and over GitFake and get the recorded result.
Scenario: Both review_window cases pass
- WHEN
uv run pytest tests/core/test_git_contract.py -k review_windowruns on the change. - THEN The cases
test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window]andtest_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window]pass, and the process fake reports no started command that differs from its record.
Requirement: Recording check
The recorder SHALL find no difference between a committed transcript and a new recording.
Scenario: The git row passes
- WHEN
uv run python -c "import sys; from tests.support.git_recording import main; sys.exit(main(['--check']))"runs on the change. - THEN The report holds no line that starts with
+++ git/.
Requirement: Recorded complexity fact
The recorded result MUST hold the fact lizard.complexity with status ok and three files, in version_facts and in period_facts.
Scenario: The complexity fact is present
- WHEN A test loads
tests/fixtures/git/review_window.jsonand reads the two fact lists. - THEN Each list holds
lizard.complexitywithstatusokandn3, and each fact of the two lists hasstatusok.
Requirement: No host git configuration
The environment that the scenario gives the code MUST read no git configuration of the host.
Scenario: The code's git is isolated
- WHEN A test enters
Workspace.environment()and reads the process environment. - THEN The environment holds
GIT_CONFIG_NOSYSTEMat1andGIT_CONFIG_GLOBALatos.devnull.
Requirement: Reproducible recording
Two recordings of one scenario MUST give the same text.
Scenario: The recorder is idempotent
- WHEN The recorder runs twice in a row on one checkout.
- THEN The second recording reports no line that starts with
+++ git/.
Requirement: Review facts replay
The test that replays review_window through review_facts SHALL pass.
Scenario: The version window facts test passes
- WHEN
uv run pytest tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_windowruns on the change. - THEN The test passes.
Existing Tool Considered
The alternatives check of 2026-11-14 found no open, maintained tool (verdict: none). The only candidate, time-machine (https://pypi.org/project/time-machine, MIT), patches Python wall-clock reads only and cannot make a transcript that the real git records deterministic. The repository's own git fake and recording harness (tests/support/git_scenarios.py, tests/support/git_recording.py) already own the need. The change builds no new tool: it isolates the scenario and records the transcript again. Cost: about 20k tokens to record, compare and fix the scenario, and under one hour of elapsed time. No code stays to keep.
Key questions
- Which commands and results of the committed transcript differ from the code?: The process fake starts
git for-each-ref ... refs/tags/v*where the transcript recordsgit cat-file blob .... A new recording with git 2.55.0 gives 8 insertions and 272 deletions, and thecat-file blobexchanges go. Theperiod_factsof the result also differ. [sources: tests/fixtures/git/review_window.json, tests/core/test_git_contract.py, tests/support/git_scenarios.py] - Why does the committed transcript hold
git cat-file blobexchanges?: The factlizard.complexityreads each hotspot path at the base and at the head withgit cat-file blob <commit>:<path>. Itsqueryin the transcript states that command. A recording that drops those exchanges means the complexity fact did not run, so the new transcript must keep that fact with statusok. [sources: tests/fixtures/git/review_window.json, tests/support/git_scenarios.py] - Does the scenario
review_windowread the current date?: No. The scenario passesnow = datetime(2026, 10, 6, tzinfo=UTC)toparse_window, sets the date of each commit, makes each tag a lightweight tag whosecreatordateis the date of its commit, and excludesread_atfrom each fact. The repository that it builds is the same on every run. [sources: tests/support/git_scenarios.py:556] - Which git configuration does the code's git read during a recording?:
Workspace.environment()sets onlyHOME,LC_ALLandDEVOPS_CLI_USER_DATA_ROOT. The git that the code starts therefore reads the system file/etc/gitconfigof the host. The git that builds the repository reads no host configuration, becausesetup_envsetsGIT_CONFIG_NOSYSTEM=1andGIT_CONFIG_GLOBAL=/dev/null. [sources: tests/support/git_scenarios.py] - How does the recording become independent of the host?: Set
GIT_CONFIG_NOSYSTEM=1andGIT_CONFIG_GLOBAL=os.devnullinWorkspace.environment(), assetup_envdoes for the build. Record again each transcript that this isolation changes. (best practice) [sources: tests/support/git_scenarios.py, tests/support/git_recording.py]- Chosen: Isolate the code's git. The recorder must give one file on every host. The git that builds the repository already reads no host configuration, and the code's git must do the same.
- Rejected: Record again on each host. The file would differ between the devcontainer, the runner image and CI, so the
gitrow would fail on one of them. - Rejected: Record inside the container image only. The devcontainer and the runner image still record on their own hosts, so the drift stays.
- Does the change record the transcript again or change the code?: Record the transcript again with the repository's recorder, then check each fact of the result against the fixture. Do not edit the JSON by hand. (best practice) [sources: tests/support/git_recording.py, tests/core/test_git_contract.py, tests/fixtures/git/review_window.json]
- Chosen: Record again, then check each fact. The transcript is stale. The check keeps a defect of the code out of the file.
- Rejected: Record again and accept the output. It would record an error fact, such as a
lizard.complexitythat did not run, as the expected result. - Rejected: Change the code to give the recorded commands. No source shows that the code is wrong, and the recorded order does not match the code.
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.A contract test fails in CI, but the scope is one transcript and one scenario.It restores a passing CI check but adds no user-facing behaviour.The fix is likely a re-recording or a small non-determinism patch in one scenario.Both concern the review_window git scenario, but #4686 delivers the feature while the candidate fixes its recorded transcript.dan-petty commentedon Nov 12, 2026
The local
devops cigate "git transcripts (recorded again with the real git)" failed the same way on a branch fromorigin/mainat 7f09921, with git 2.55.0:tests/fixtures/git/review_window.jsondiffers from the new recording near line 500. That branch does not change the transcript orsrc/devops_cli/roadmap/project_review/.dan-petty commentedon Nov 12, 2026
This still fails on main at f4b1d73 (2026-11-12):
uv run pytest tests/core/test_git_contract.py -k review_windowgives 2 failed (test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window]andtest_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window]). Theperiod_factsof the result differ from the transcript.dan-petty commentedon Nov 12, 2026
Impact evidence (2026-11-12): these tests fail each full-suite verify in the devcontainer and in the runner image, so they block implement groups that verify with the full
uv run devops ci test.uv run pytest -n 0 -q tests/core/test_git_contract.py -k review_windowgives "2 failed, 1 passed". The failed IDs:test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window](startedgit for-each-ref ... refs/tags/v*, recordedgit cat-file blob ...,tests/core/test_git_contract.py:86) andtest_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window](tests/core/test_git_contract.py:124).Thus each full-suite verify in the runner fails until this item is fixed. No builder slot is free now, so this comment only makes the impact visible for its priority.
dan-petty commentedon Nov 13, 2026
Evidence (2026-11-13): the
gitrow ofuv run devops ci --check --only gitalso fails on this transcript. It reports "The committed git transcripts differ from git version 2.55.0" with a diff ofreview_window.json(thecat-file blobcalls). Seen in a worktree at origin/main 9717c9b plus a change that touches no git transcript or git code.dan-petty commentedon Nov 13, 2026
Evidence (2026-11-13): a full
uv run devops ci testin a worktree at origin/main 4ef7c6f plus an infra change (no git code, no git transcript) gives 3 failures on this transcript. The third test also replaysreview_window:tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window(the fixturecheckoutcallsgit_fake.replay("review_window")). The other two are the contract cases that this issue names.devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches turned up no tool or library that fixes a stale/divergent recorded git transcript; the answers were generic pages, and the only relevant candidate, the clock fake time-machine, patches Python wall-clock reads only and cannot make a transcript recorded by the real git binary deterministic. The need is an in-repo fix of the
review_windowscenario and its transcript, which the project's own git fake and recording harness (tests/support/git_scenarios.py,tests/support/git_recording.py) already own.Tool: none found
Lacks:
gitcommand output deterministically across git versions (the transcript recordsgit cat-file blobexchanges that git 2.55.0 no longer produces)tests/roadmap/project_review/test_review_facts.pyreplay ofreview_window, which fails with the same fixtureTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at ca62d6a (see proposed design in issue body).
devops-cli-service commentedon Nov 18, 2026
Released in v0.176.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.176.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 13:25 UTC