Skip to content

test(roadmap): count the record parses of split_record - #4607

Merged
dan-petty merged 3 commits into
mainfrom
test/4470-count-the-record-parses-of-split
Nov 11, 2026
Merged

dan-petty merged 3 commits into
mainfrom
test/4470-count-the-record-parses-of-split

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Three tests hold the parse cost of split_record that #4445 delivered. The pull request of #4445 added no test for it:

  • A body that does not hold the opening text of the record block gives no parse and (body, {}).
  • 100 bodies, of which 10 hold the opening text, give 10 parses and 10 records.
  • The parse builds no inline tokens: the inline token has empty children.

A profile function counts the calls of MarkdownIt.parse through the public split_record. It patches no devops-cli name, as docs/TESTING.md (Doubles) requires, so the tests do not replace _BODY_MARKDOWN as the issue proposed.

Closes #4470

Change: openspec/changes/archive/2026-11-11-4470-count-the-record-parses-of-split/

Three tests hold the parse cost of split_record (#4445): a body that does
not hold the record opener gives no parse, a batch of 100 bodies of which
10 hold the opener gives 10 parses, and the parse builds no inline tokens.

Refs #4470
@dan-petty dan-petty added type/test Type test: a new or changed test 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

Test results of this branch:

  • uv run devops ci test tests/roadmap/stores/test_roadmap_store_record_parse.py: 3 passed.
  • uv run devops ci --check --only lint,typecheck,test-tree,constructs: all pass.
  • uv run devops ci test tests/invariants/test_source_tree.py tests/invariants/test_change_folders.py tests/roadmap/stores/test_roadmap_store_record_parse.py: 69 passed.

Fail-to-pass on 6cf78e7, the base of #4455. The run was in a scratch worktree at 6cf78e7 with the new test module as its one commit, so the replay holds only these 3 tests. A replay with --base origin/main cannot fail, because the code of #4455 is on main.

$ uv run devops ci fail-to-pass --base 6cf78e73
  failed on base: tests.roadmap.stores.test_roadmap_store_record_parse::test_a_body_without_the_record_opener_is_not_parsed (assert (("Plain text... -->", {}), 1) == (("Plain text... -->", {}), 0))
  failed on base: tests.roadmap.stores.test_roadmap_store_record_parse::test_the_parse_of_a_body_builds_no_inline_tokens (AssertionError: assert (('Plain text...lock', None)]) == (('Plain text...lock', None)]))
  failed on base: tests.roadmap.stores.test_roadmap_store_record_parse::test_a_batch_parses_only_the_bodies_that_hold_the_record_opener (assert (100, 10) == (10, 10))
3 failed on base (3 failed and 0 passed in tests/roadmap/stores/test_roadmap_store_record_parse.py; 0 errored).

On the base, the inline token of the parse of Plain text. has the child Token(type='text', content='Plain text.'). On this branch its children is []. 7c59565, the parent of the merge commit c653bde, holds the same store.py as 6cf78e7.

The criterion 2 scenario of #4445 names a first token paragraph with children None. The archived change of #4445 has no spec delta and does not repeat that scenario, so this pull request changes no archived file. The proposal of this change records the real token shape.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 11:35
@dan-petty
dan-petty merged commit 8d78c06 into main Nov 11, 2026
31 checks passed
@dan-petty
dan-petty deleted the test/4470-count-the-record-parses-of-split branch November 11, 2026 12:02
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/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(roadmap): count the record parses of split_record

1 participant