Skip to content

fix(roadmap): a job record reads back after an open block - #6792

Merged
dan-petty merged 9 commits into
mainfrom
fix/6729-record-after-open-block
Nov 22, 2026
Merged

dan-petty merged 9 commits into
mainfrom
fix/6729-record-after-open-block

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

with_record writes the job record as a comment after the issue body. A body can end in a code fence or an HTML block, such as a comment or <pre>, that it does not close. Then the record becomes part of that block. Then split_record reads an empty record, and each later write adds one more record. In a fence, GitHub shows the record as code. The GitHub store also raises RoadmapRecordMarkLostError after two rewrites.

closed_body closes the open block with close_open_block (#6627) on a line of its own, and with_record writes it before the record block. The close takes the place of one final line break, so the code gets no new empty line. A body with no open block keeps its text. Both lost-edit checks of the GitHub store accept closed_body, so the close is no lost edit, also on a second write from one read. The close changes the body hash one time, and the next write keeps the body.

Closes #6729

Change: openspec/changes/archive/2026-11-22-6729-record-after-open-block/

GitHub shows the record as code only in an open fence. An open comment or <pre> hides it. The docstrings, the workflow page and the change folder now say so, in sentences of at most 25 words.
The hash item of the assert followed from the body item. It now compares the hashes of the first and the second read, so it can fail alone.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 22, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Review of #6729: a job record reads back after an open block

Head: 1c1122457 on fix/6729-record-after-open-block, rebased with no conflict onto origin/main 81136915b. The rebase changed no file of the branch. The review ran at f336deae8, which has the same change.

Recommendation

open-and-ready. No finding above nit stands. Two nits stand, and neither one changes the code.

Round 1 fixed 3 minor findings. Round 2 fixed 4 nits. A recheck confirmed each fix. No refute verdict was given.

Lenses and checks

Round 1: review and fix at edc0c1b12, before the rebase

  • Lenses: fidelity (ok), tests (ok), correctness (concerns), standards (concerns), adversarial (ok).
  • Tests: tests/roadmap/stores/ and test_roadmap_body_hash.py give 431 passed. A full tests/roadmap run gives 1 failure in test_review_facts.py::test_the_facts_of_a_version_window. That test needs lizard from the optional review extra. The change does not touch it.
  • Gates: devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures passes. typecheck passes. ruff and mypy pass on the changed source files. The commit hooks passed on each commit.
  • Revert proof: with store.py and github_store.py from ce86d68d5, the second-write test fails with lost-edit points [({}, 1.0)].
  • Fuzz: about 30k bodies give 0 cases where closed_body(b) differs from the read-back body of with_record(b).
  • Edge bodies: 43 + 11 + 14 scratch bodies read the record back, and a second write keeps the body. They include a quote, a list, CRLF, CR, BOM, script, CDATA, <?, <!X and longer fences.
  • Live check, read-only: 834 open issues. 0 end in an open block. The new and the base with_record give the same text for all 834.
  • GitHub render (POST /markdown, no state change): the written body renders the same as the body alone, except for whitespace.

Round 2: fix and recheck at f336deae8

  • Rebase onto origin/main 8e99f1da6: 7 commits, no conflicts. uv sync --locked passes.
  • Fix tests: pytest -n 4 on the tests of the changed functions and their callers gives 1161 passed in 145 s. A run of all of tests/roadmap plus test_pr.py did not end in 580 s. It was at 33 % with no failure.
  • Gates: the same devops ci --check --only ... set passes (3 min 23 s). ruff check, ruff format --check and mypy pass on the changed files. The commit hooks passed on the 2 new commits.
  • Recheck tests: a separate worktree at f336deae8 gives 1036 passed. The run covers each test that calls with_record: tests/roadmap/stores, test_roadmap_body_hash.py, tests/roadmap/intake, test_roadmap_plan_check.py, tests/commands/test_pr.py and the inbox, dependencies, draft readiness and stop clear tests.
  • Recheck read: each caller of with_record and closed_body, and close_open_block in body_hash.py:139-160. The callers are github_store._edit_issue, intake._placement_target and tests/support/fakes/roadmap_store.py. closed_body is idempotent. The recheck found no new correctness defect.
  • Weigh: the 3 changed test files give 191 passed at f336deae8. A scratch word count of the added lines found the sentences of finding 1.

Fail-to-pass

devops ci fail-to-pass --base origin/main at f336deae8: 21 changed tests fail on base and pass on head. 0 tests give an error. The other 170 tests of the changed files pass on base and head. The fix stage and the recheck each got this result.

The 21 tests are in test_roadmap_store_record_block.py, test_roadmap_store_contract.py and test_roadmap_github_store_record_writes.py. They include test_the_close_of_a_block_that_the_body_leaves_open_is_no_lost_edit. They also include the 8 params of test_a_body_that_leaves_a_block_open_keeps_its_record_and_settles and the 4 params of test_a_second_record_write_keeps_the_body_and_its_hashes.

Standing findings (all nit)

  1. Long sentences in the added text.
    • Where: tests/roadmap/stores/test_roadmap_store_record_block.py:30-32, :55-56, :62-63, :73-75, :83-84. tests/roadmap/stores/test_roadmap_store_contract.py:729-730. In openspec/changes/archive/2026-11-22-6729-record-after-open-block/: design.md:5, :8, :9, :15, :16, proposal.md:5, :9, :37, :39 and tasks.md:7, :9, :16.
    • Problem: these sentences have more than 25 words. ASD-STE100 permits at most 25 words in a description (src/devops_cli/ai/tasks/style_ste100.md:6). The round 2 fix note says that the builder split the long sentences of the branch, but these remain.
    • Evidence: a count by hand gives 30, 36, 36, 36 and 36 words in the test file, and 26 in the contract test. The design.md sentences have 26 to 31 words. The proposal.md sentences have 26 to 38 words. The tasks.md sentences have 29 to 60 words. The docs gate does not count words, so it passes.
    • Fix: split each sentence at its "so", "and" or ";" into sentences of 25 words or fewer. The code does not change.
  2. The rendered-form test has no case for a fence with no final line break.
    • Where: tests/roadmap/stores/test_roadmap_store_record_block.py:81-88, test_the_code_of_an_open_fence_keeps_its_rendered_form.
    • Problem: the test covers only bodies that end in a line break.
    • Evidence: at f336deae8, markdown-it-py renders the open fence as x = 1</code> and the closed fence as x = 1\n</code>. GitHub renders both the same (round 1 POST /markdown). The docstring at :84-85 names the dropped case. test_a_record_after_an_open_block_reads_back[backtick-fence] pins its read-back text.
    • Fix: no change is necessary.

Fixed findings (recheck confirmed)

  • Round 1, minor, github_store.py _edit_issue: the first lost-edit check counted the close as an edit of a person on a second write from one read. Now both checks compare with closed_body, and a test makes two set_marks calls from one read.
  • Round 1, minor, docs/ROADMAP_WORKFLOW.md:104: a 45-word sentence. Now it is three sentences of at most 19 words.
  • Round 1, minor, openspec/specs/roadmap-item-labels/spec.md:293 and the archived delta: a 53-word requirement sentence. Now each sentence has at most 25 words, and the two copies are the same.
  • Round 2, nit, store.py:1029-1030 with_record docstring: it said that GitHub shows the record as code after each open block. Now only a fence shows it as code, and an open comment or <pre> hides it.
  • Round 2, nit, the same false claim in the archived design.md (two places) and proposal.md. Now each one limits "shows as code" to a fence.
  • Round 2, nit, with_record docstring: two sentences of 28 and 26 words. Now the longest sentence has 21 words.
  • Round 2, nit, docs/ROADMAP_WORKFLOW.md:104: the paragraph named only a fence, a comment and <pre>. Now it says "a code fence or an HTML block, such as a comment or <pre>".
  • Round 2, nit, test_roadmap_store_record_block.py:78: the hash item could not fail alone. Now it compares body_hashes(second) with body_hashes(first).

Design decisions

  • Close the open block on write, not on read: the stored body stays the body that GitHub shows. A fix on read would parse each body again (perf(roadmap): parse only the bodies that hold a job record #4445).
  • Use close_open_block from fix(roadmap): find a job block marker only as an HTML block #6627: the issue asks for no second parser.
  • Import close_open_block inside closed_body: body_hash.py imports store.py, and the import invariant (test(cli): whole-tree import-cycle and interface-layer invariants #848) accepts an import in a function.
  • Take one final line break off before the close: the code gets no new empty line, and the GitHub render proves the same form.
  • Share closed_body between with_record and both lost-edit checks: the writer and the checks use one rule. A probe through with_record and a documented single count were rejected.
  • Accept one more job round for a body that ends open: the close changes the hash one time. Zero rounds needs a change in fix(roadmap): every job block reader uses one marker rule #6736 files, and 0 of 834 open bodies end open.
  • ADD the requirement to roadmap-item-labels: that capability holds the record block rule. It now has 23 of at most 80 requirements.
  • Keep the base spec in round 2: the requirement did not change, and the spec does not say "shows as code".
  • The standing nits do not block ready: they change no code, and each gate passes. A nit is a note for the author, not a merge block.

PR body

.data/agent/scratch/pr6729-body.md has 1000 characters by wc -m, which is the limit. It has Closes #6729 and ends with the Change line. body_problems and open_body_problems give []. Each claim matches the code at f336deae8. The claims are the empty record and the extra record on each write, the code view in a fence only, and RoadmapRecordMarkLostError after two rewrites. They are also the close on a line of its own, the body with no open block, both lost-edit checks and the one hash change. This round made no change to the body.

@dan-petty
dan-petty marked this pull request as ready for review November 22, 2026 18:59
@dan-petty
dan-petty merged commit 0895098 into main Nov 22, 2026
29 checks passed
@dan-petty
dan-petty deleted the fix/6729-record-after-open-block branch November 22, 2026 18:59
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.195.1](v0.195.0...v0.195.1)
(2026-11-22)


### Bug Fixes

* **roadmap:** a job record reads back after an open block
([#6792](#6792))
([0895098](0895098))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
dan-petty added a commit that referenced this pull request Nov 22, 2026
The test job of main fails since #6794 merged after #6792. `closed_body`
closed a block that the body leaves open at its end. The readers of
#6736 end such a block at the job blocks at its end. So a record write
closed the open block of a person after the refine block, the block
became a quote, and the next refine round added a second section.

Now `closed_body` first calls `close_blocks_before_markers`, so the
close goes before the job blocks, where the readers end the open block.
Then it closes a block that is still open at the end, as before. A body
with no open block keeps its text. The round test of an open fence and
an open `<pre>` now asserts one write that replaces the section in
place, as its docstring asked once a round reads the record.

Closes #6799

Change:
`openspec/changes/archive/2026-11-22-6799-record-write-keeps-job-blocks/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): a job record reads back after an open block

1 participant