Skip to content

test(novelty): pin a colon-ended cited span last in the document - #1098

Merged
antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:test/novelty-lead-in-last-span
Nov 22, 2026
Merged

antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:test/novelty-lead-in-last-span

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the review of #1072, where no test put a colon-ended cited span last in the document (review). The author agreed the code is right (after < len(spans) in context_for) and the missing test was left open.
On main, changing that guard to after <= len(spans) leaves all 18 tests of tests/test_novelty_verify_context.py green, although context_for on segment("# T\n\nLead:\n") with Lead: cited then raises IndexError. Every existing colon test has a span after the cited one.

Changes

  • dokimi/tests/test_novelty_verify_context.py: test_a_colon_ended_cited_span_last_in_the_document_gets_no_following_span cites Lead: in segment("# T\n\nLead:\n") and asserts the context is exactly Heading: T, with no Following: line and no error (the context_for docstring adds the very next span as Following: only when there is one).
  • No production code change and no changelog fragment: the PR touches dokimi/tests/ only.

Risk

None: a test is added and the output of dokimi is unchanged.

Testing

On a Linux review host, at 10687f37 (on main 06341ca):

  • make ci-local: 38 passed, 0 failed, 14 skipped (docker-only smoke, the Python matrix legs, conda-forge, atheris fuzz, semgrep, deploy/report jobs whose condition is false on a PR). 25980 tests passed, 19 skipped; the diff has no measurable changed lines for coverage.
  • The new test passes on the branch; the file's 19 tests pass, as do the docs-refs, growth, test-quality and import-architecture guard tests.
  • Mutant: with after < len(spans) changed to after <= len(spans) in context_for, the new test fails with IndexError: list index out of range and the other 18 pass.
  • Not run: the other Python versions (3.11, 3.12, 3.14), and the Docker-only and semgrep steps.

Revert

A plain revert removes the test. Nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…Following line

Settles the open point on intel#1072 (discussion_r4655519764): no test put a colon-ended cited span last in the document, so changing `after < len(spans)` to `after <= len(spans)` in `context_for` left all tests green.

The new test cites `# T\n\nLead:\n` with `Lead:` and asserts the context is exactly `Heading: T`; with the looser guard `context_for` raises IndexError and the test fails. No production code changes.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy
antonwolfy requested a review from a team as a code owner November 22, 2026 13:06
@antonwolfy antonwolfy self-assigned this Nov 22, 2026
@exai-bot

exai-bot commented Nov 22, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

CI at 10687f3: 19 passing, 2 skipped.

Review details
  • Commit reviewed: 10687f3 against merge base 06341ca
  • Coverage: 1 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 48k tokens (34k from cache), 7s
  • Tool calls: 3 (2 file_read, 1 code_search)
  • dokimi/tests/test_novelty_verify_context.py: 1 file

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (06341ca) to head (10687f3).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1098      +/-   ##
==========================================
- Coverage   96.08%   96.07%   -0.02%     
==========================================
  Files         461      461              
  Lines       60836    60836              
  Branches    10517    10517              
==========================================
- Hits        58457    58448       -9     
- Misses       1473     1478       +5     
- Partials      906      910       +4     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving 10687f3.
Checked: changed tests: 19 passed, pass on main too; full suite with main merged in: 26393 passed, its only failures are main's too; merges onto main; 1 mutation tried.

@antonwolfy
antonwolfy merged commit dd6eb11 into intel:main Nov 22, 2026
21 checks passed
@antonwolfy
antonwolfy deleted the test/novelty-lead-in-last-span branch November 22, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants