Skip to content

fix(roadmap): every job block reader uses one marker rule - #6794

Merged
dan-petty merged 8 commits into
mainfrom
fix/6736-one-marker-rule
Nov 22, 2026
Merged

dan-petty merged 8 commits into
mainfrom
fix/6736-one-marker-rule

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A person can open a code fence or a <pre> block above a job block and not close it. CommonMark then reads the old block as code, and the refine and alternatives writes added a second one. _ends_section also had its own marker test, so a comment left open above an alternatives block let body_dependencies read its Lacks list as blockers.

Now body_hash.py holds the one rule, and _ends_section uses its token test block_marker_of. An open block stops at the job blocks at its end, one for each job at most. An open block in a job block stops at its end marker. Each other marker stays text. extract_section_and_outside and _with_block close the open block there first, so the alternatives write replaces its old block in place. Refine finds its section there, but it writes only when it reads the record, which the open block also hides (#6785). body_dependencies parses the same closed body.

Closes #6736

Change: openspec/changes/archive/2026-11-22-6736-one-marker-rule/

One job can end two open blocks: its start marker ends a fence above
its block, and its end marker ends a block in its block. A body with
three open blocks must give four markers and both blocks.

A marker on the last line of a declaration that a person leaves open
must bound the block, as a marker on the last line of a comment does.
A body has at most one part more than there are job block markers,
not jobs. So a reader finds each marker of a body with three open
blocks, and the readers agree.

block_marker_of reads the end text of each kind of HTML block from
the table of close_open_block. So a marker that ends a declaration
such as <!DOCTYPE bounds a block, as a marker that ends a comment
does. No open issue holds such a declaration.

The specs state the declaration rule, and each requirement sentence
of the change has at most 25 words.
@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 #6736: every job block reader uses one marker rule

Head: a246a4f (branch fix/6736-one-marker-rule). Base: origin/main 8113691. Advisory note.

Recommendation

open-and-ready. No finding above a nit stands. The second round fixed the minor finding and the three nits of the first round. A recheck confirmed each fix. Two nits stand, and they do not block.

The branch is on the newest origin/main. git merge-base --is-ancestor origin/main HEAD exits 0 after git fetch origin.

Lenses and checks

First round (review of 6010b3a1a)

  • Lenses: fidelity, tests, correctness, standards and adversarial. Each lens gave "concerns". Then a refute pass, a fix stage and a recheck ran.
  • Fail-to-pass: 19 changed tests failed on base and passed at that head. The first head 4bb03ab41 had 11.
  • Tests: 798 passed in body_hash, alternatives and refine/. 4312 passed and 1 skipped in the affected roadmap modules.
  • Mutation: when refine.py:3726 always appends, 5 of 9 refine block marker tests fail.
  • Live check: 836 open issues, raw and with the record split off. The reads at head are byte-identical to base.
  • Time: 0.22 s at most on a body of 65536 characters. The first head took 10.76 s.

Second round (fix and recheck at a246a4f)

  • Fix: tests first in dca8713, then the fix in a246a4f. Two rebases with no conflicts, last onto 8113691. The pre-commit hooks pass.
  • Fail-to-pass: devops ci fail-to-pass --base origin/main exits 0. 23 changed tests fail on base and pass at head. All 261 selected tests pass at head, and 238 pass on base.
  • Old code: with the body_hash.py of 6010b3a1a, the 4 new tests fail. They pass at head.
  • Tests at head: 835 passed in body_hash, refine/, alternatives and trust. tests/roadmap in full gives 9340 passed and 1 skipped. One test failed because the optional extra lizard is not installed. With lizard 1.26.1 it passes.
  • Five parts: a body with 4 open blocks gives 5 parts, 4 spans and both bounds at head. The old code gives 3 parts, 2 spans and no alternatives bounds.
  • Fuzz: 30000 random bodies. The capped _parts and a loop capped at 40 parts give the same result for each body. The most parts seen is 4.
  • Static checks: ruff, ruff format and mypy pass on the changed files. The 13 mypy errors are in unchanged tests/support files. devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures passes.
  • Specs: vale gives 0 STE.SentenceLength in the 3 delta specs (before: 15). Each of the 5 delta requirements is the same as its copy in openspec/specs.
  • Declaration census: no body of 836 and 834 live bodies has a line that starts with <! and a letter. So no recorded hash changes.
  • Callers: no caller of block_marker_of, extract_section_and_outside or body_hashes depends on the old cap or the comment-only test.
  • This weigh: 261 passed in body_hash, refine block markers, refine dependencies and alternatives. Probes for HTML blocks of kind 6 and kind 7 ran at head and on base.
  • PR body: changed by this weigh. It said that an open block stops at whole job blocks. Now it also says that an open block in a job block stops at its end marker. It has 994 characters by wc -m, "Closes fix(roadmap): every job block reader uses one marker rule #6736", and the Change line last.

Standing findings

Nit: a quoted whole pair at the end of an open fence reads as the job block

  • Where: src/devops_cli/roadmap/body_hash.py _are_job_blocks. design.md records this limit.
  • Problem: a person quotes a whole job block at the end of a fence that is open to the end of the body. The body cannot tell this quote from a real block.
  • Evidence: refine waits for a person and writes nothing, so no text is lost. The census found no such body.
  • Fix: none in this change. The limit is declined and recorded.

Nit (pre-existing): an HTML block of kind 6 or 7 directly above a marker hides the marker

  • Where: src/devops_cli/roadmap/body_hash.py:90 block_marker_of.
  • Problem: CommonMark ends an HTML block of kind 6 (for example <details>, </details> or <div>) only at a blank line. Kind 7 is the same. A person can write such a line directly above a job block marker, with no blank line. Then the marker is in that block, and block_marker_of gives None.
  • Evidence: .data/agent/scratch/w6736-r2/kind6.py at head: Text.\n\n<details>\nLogs\n</details>\n and a refine block give bounds None, 0 spans and no section from extract_section_and_outside. With a blank line, both markers are found. kind6_base.py gives None on the body_hash.py of origin/main too. census.py finds 0 of 834 and 836 live bodies with a marker line directly under a line that starts with < (not <!--).
  • Fix: not in this change. File an issue. The fix needs its own design, because the job block lines after the marker can also be in that HTML block.

Fixed findings (a recheck confirms each)

Second round:

  • Minor, the _parts cap was too low: the loop is now while len(parts) <= len(JOB_BLOCK_MARKERS), and two tests assert the four markers and both blocks.
  • Nit, the block_marker_of docstring said that token is an HTML block: it now says "When token is an HTML block ... For each other token, None."
  • Nit, vale STE.SentenceLength in the spec deltas: each long sentence is split. One STE.Contractions stays on a MODIFIED heading that must match its base heading.
  • Nit (pre-existing), an open <!DOCTYPE did not end at a marker: block_marker_of now reads the end text of each HTML block kind through _end_text.

First round:

  • Quoted pair in an open fence above the real block became the block: the open block now ends only at whole job blocks at its end.
  • Refine half of AC 1 had no write test: a new refine write test calls the model once and asserts the exact body.
  • Lone quoted marker or quoted pair with no job block after it became a live bound: it now stays text of the person.
  • PR body said that refine replaces in place: the body now limits this to the alternatives write.
  • Open-block refine test hid the stall: it now asserts is_unchanged False, 0 model calls and an unchanged body.
  • D8 stop had no test: the stop is removed, and the param start-only-in-an-open-fence asserts the write and the exact body.
  • The stall in EDIT was not visible: the test and design.md show it.
  • CONST_ROADMAP_REFINE_RULES_SINCE did not move with no reason: design.md records the decision.
  • Quadratic parse: fixed in the first round. The part cap is correct since the second round.

Dropped findings

  • Correctness, major, quoted pair in an unclosed fence: refuted. Issue fix(roadmap): every job block reader uses one marker rule #6736 case 1 asks for this read, and design.md decides it.
  • Correctness, major, refine regression from the same cause: refuted. check_person_edits stops the write, and the probes of the reviewer keep the person line.

Design decisions

  • An open block ends at the whole job blocks at its end. Reason: jobs write their blocks at the end of the body, and a quote of a person stays text.
  • Any job block marker ends an open block, not only the markers of the reader. Reason: every reader must see the same blocks.
  • The parser decides whether a block is open. Reason: AGENTS.md rule 3, no hand-written CommonMark rules.
  • extract_section_and_outside cuts the closed body. Reason: one cut for every caller, so the refine write and repair need no change.
  • block_marker_of is the one token test. Reason: the own test of _ends_section caused case 2.
  • body_dependencies parses the closed body. Reason: it must find the section where the other readers find it.
  • The body parser runs with inline off. Reason: the rule reads block tokens only, and this pays for the probe parses.
  • A lone marker in an open block is a quote, and the alternatives check writes. Reason: it replaces the first D8 stop.
  • The refine round test asserts the stall, not a write. Reason: the open block hides the record, which is fix(roadmap): a job record reads back after an open block #6729 scope.
  • CONST_ROADMAP_REFINE_RULES_SINCE does not move. Reason: the live checks found no item whose reads or next step change.
  • The quoted whole pair at the end of an open fence stays a limit. Reason: the body cannot tell it from a real block.
  • A body has at most one part more than there are job block markers. Reason: one job can end two open blocks, and each marker starts one part at most.
  • A marker that ends an open declaration bounds a block. Reason: one table now holds the end of each HTML block kind, and no live body changes.
  • The kind 6 and kind 7 limit stays out of this change (this weigh). Reason: base gives the same result, no live body has it, and the fix needs its own design.

Merge order and follow-ups

@dan-petty
dan-petty marked this pull request as ready for review November 22, 2026 21:03
@dan-petty
dan-petty merged commit 9dfe03e into main Nov 22, 2026
28 checks passed
@dan-petty
dan-petty deleted the fix/6736-one-marker-rule branch November 22, 2026 21:03
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/`
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.195.3](v0.195.2...v0.195.3)
(2026-11-22)


### Bug Fixes

* **roadmap:** a record write keeps job blocks readable
([#6800](#6800))
([b1d4852](b1d4852))
* **roadmap:** every job block reader uses one marker rule
([#6794](#6794))
([9dfe03e](9dfe03e)),
closes [#6736](#6736)

---
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>
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): every job block reader uses one marker rule

1 participant