Skip to content

perf(roadmap): parse only the bodies that hold a job record - #4455

Merged
dan-petty merged 2 commits into
mainfrom
perf/4445-parse-record-bodies
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
perf/4445-parse-record-bodies

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Each devops roadmap intake run lists all 4,431 issues and pull requests, and split_record parsed each body with markdown-it to find the job record block. In #4404, this parse took 68 s to 140 s of a 5 to 6.5 minute intake call.

  • split_record does not parse a body that does not hold the opening text of the record block. _RECORD_BLOCK starts with that text, so such a body has no record. Only 1,084 of the 4,431 bodies hold it.
  • The parser of the store turns off the core rule inline. _record_block_span reads only the top-level tokens, which the block parser makes.

The result of split_record does not change for any body. On the 4,431 bodies, its CPU time goes from 18 s to 23 s down to 5 s to 6.4 s, with the same JSON byte for byte.

Closes #4445

Change: openspec/changes/archive/2026-11-11-4445-parse-only-the-bodies-that-hold/

split_record does not parse a body that does not hold the opening text of the record block, and the Markdown parser of the store parses only the blocks. On the 4,431 bodies of the issue listing, the CPU time of split_record goes from 18 s to 23 s down to 5 s to 6.4 s, and the results are the same.
@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Verification

  • uv run devops ci test tests/roadmap/stores/ tests/roadmap/intake/ tests/roadmap/refine/test_roadmap_refine_sanitize.py: 503 passed, before the rebase onto 6cf78e73.
  • uv run devops openspec check: passed.
  • Same result on the real listing: I read the 4,431 bodies of the listing once through GitHubRoadmapStore("dan-petty/devops-cli").issues() and ran split_record over all of them in a checkout of the base and in this branch. Base: 18.1 s of CPU time. This branch: 5.0 s. Both give 1,082 records, and the JSON of the 4,431 results is the same byte for byte (SHA-256 b36ea2db36b5d636…). Two earlier runs gave 21.7 s and 23.0 s against 6.4 s and 6.1 s.

This change keeps the behavior, so it adds no test (docs/TESTING.md), and the title is perf, so the Fail-to-Pass Check does not run. The contract tests of the record block (#2538) hold the cases that the block-only parse must keep.

The timing table of the whole intake call is in #4404.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 02:58
@dan-petty
dan-petty merged commit c653bde into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the perf/4445-parse-record-bodies branch November 11, 2026 02:59
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings after the merge. This PR was merged before the fix, so I did not push to it.

Severity Finding Verdict Action
major src/devops_cli/roadmap/stores/store.py:691: the PR gives no test for 3 of the 6 acceptance criteria of #4445 (no parse for a body with no marker, the inline rule is off, 10 parses for 100 mixed bodies). No test fails if a later change removes the early return or turns the inline rule on again. Confirmed Filed #4470.

Evidence:

  • git show --stat c653bde8 lists only store.py and the OpenSpec folder. git grep -n "_BODY_MARKDOWN\|_RECORD_OPENER\|disable(" origin/main -- tests finds nothing.
  • The archived tasks.md uses kind: other and does not say why the three test scenarios are not delivered.
  • The scenario text of criterion 2 in perf(roadmap): parse only the bodies that hold a job record #4445 is wrong. With markdown-it-py 4.2.0, MarkdownIt("commonmark").disable("inline").parse("Plain text.") gives paragraph_open (children None), inline (children []) and paragraph_close. With the rule on, the inline token holds one text child. test(roadmap): count the record parses of split_record #4470 asks for a test on the inline token, and for the correct scenario text.
  • _record_block_span reads the module global _BODY_MARKDOWN, so a monkeypatch wrapper can count the parse calls. Each new test must fail on 7c59565, the parent of the merge commit.

dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.111.0](v0.110.0...v0.111.0)
(2026-11-11)


### Features

* **roadmap:** a decision-point registry with a resolver chain
([#4453](#4453))
([b73e97a](b73e97a))
* **roadmap:** eval verify stores each case and resumes
([#4451](#4451))
([7c59565](7c59565))
* **roadmap:** extend a step budget when the run makes progress
([#4464](#4464))
([c8ed108](c8ed108))


### Bug Fixes

* **ai:** a failed model transport names its phase and its error
([#4460](#4460))
([54743c4](54743c4))
* **ai:** price the DeepSeek group and its cached input
([#4454](#4454))
([3b1f6bd](3b1f6bd))
* **roadmap:** stage and refine send no answer count or row
([#4484](#4484))
([d9c8ee8](d9c8ee8))
* **roadmap:** tool docstrings garble the answer format
([#4486](#4486))
([2f6114f](2f6114f))


### Performance Improvements

* **roadmap:** parse only the bodies that hold a job record
([#4455](#4455))
([c653bde](c653bde))
* **tests:** evaluate hour-scale promtool tests every hour
([#4462](#4462))
([0ac2f76](0ac2f76))

---
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/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(roadmap): parse only the bodies that hold a job record

1 participant