Repository navigation
Conversation
A Setext heading and four-space indented code were split into sentence spans, so `analyze --estimate-only` counted extra spans. The walkthrough also said `analyze` writes no artifact when the cap stops measurement (it writes `novelty.partial.json`), sent readers to `annotated.html` for sole carriers (they are in `novelty.json`), and asked them to compare a `run_config` that `probe` files do not carry. Fixes intel#974 Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 7 selected item(s). CI at Review limit reached. This PR has had 6 reviews, so it will only be reviewed again when you ask. Review details
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Updates novelty span segmentation to treat Setext headings and indented code blocks as single spans (aligning with CommonMark-like expectations), and corrects the novelty walkthrough to match actual CLI/artifact behavior.
Changes:
- Adjust
segment()/dangling_fence()to recognize Setext headings and indented code blocks consistently (including front matter and list-context rules). - Refine bundle stitching to drop only leading blank lines while preserving indentation that can affect segmentation.
- Update walkthrough text and add tests covering the corrected scenarios and documentation expectations.
| File | Description |
|---|---|
| dokimi/dokimi/novelty/spans.py | Implements Setext + indented-code span handling and aligns dangling_fence() with segment(). |
| dokimi/dokimi/novelty/bundle.py | Preserves first-line indentation while trimming leading blank lines to keep segmentation stable. |
| dokimi/docs/skill-novelty-walkthrough.md | Corrects walkthrough claims about artifacts (novelty.partial.json, views.*, probe run_config). |
| dokimi/tests/test_novelty_spans.py | Adds regression tests for Setext/indented-code span counting, offsets, and bundling interactions. |
| dokimi/tests/test_novelty_journey.py | Adds tests asserting walkthrough statements and probe output structure. |
| dokimi/changelog.d/20261126_150000_novelty-walkthrough-spans.md | Changelog entry describing behavioral + documentation alignment. |
Review effort: Lite
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1325 +/- ##
==========================================
+ Coverage 96.28% 96.29% +0.01%
==========================================
Files 513 515 +2
Lines 68470 68909 +439
Branches 11884 11930 +46
==========================================
+ Hits 65924 66359 +435
- Misses 1566 1570 +4
Partials 980 980
🚀 New features to boost your workflow:
|
dangling_fence now skips a list item's continuation lines as segment does, so a fence opened after one is reported. A Setext heading or indented code may start right after a closed code block. Indented code is found in one pass, and the block-start check no longer reads lines[-1] at the first line. The front-matter and list-continuation cases get tests. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
This is ready for another look: I've pushed 1 commit on Changes:
Threads and comments:
What I checked on the new commit:
What each test shows
|
…pans - An ATX heading indented up to three spaces is a heading, so a bundled file that starts with ` # Setup` keeps its heading path. - A Setext underline may end in a carriage return, so CRLF text is segmented like LF text. - dangling_fence now finds Setext headings the way segment does instead of reading every underline-shaped line as a finished heading, so a bare `---` no longer lets the next file be swallowed into a code span. - An ATX heading needs a space or tab after the #s, not any whitespace, so an empty indented heading reads alike in segment and dangling_fence. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
This is ready for another look: I've pushed 1 commit on Threads:
What I checked on the new commit:
What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: LOCAL (head 95182a0)
- Contract: none
- Responsibility: none
- Dependency: none
- Review depth: skim: local change, check diff + tests
- Coverage gaps: none
The Setext and indented-code span rules, bundle offsets, and walkthrough examples pass the changed test suite. Before landing, please coordinate with already-approved #1045. Both PRs implement Setext headings and indented spans. A trial merge of their current heads conflicts in dokimi/dokimi/novelty/spans.py, dokimi/tests/test_novelty_spans.py, and dokimi/scripts/growth_baseline.json. Choose which span implementation lands first, then rebase the other to retain its distinct changes. A separate combined checkout of #1325, #1371, and #1374 passed 141 targeted tests.
Coverage: 55 passed in 2.41s. Hosted checks on the reviewed head passed or skipped.
…ng_fence _LIST_ITEM ended in \s+, which matched the line ending segment keeps but dangling_fence drops. A lone `-` or `1.` opened a list for one and not the other, so _stitch left a fence open and swallowed the next file. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…xt lookahead Without the structural break in _setext, `Intro line` over a fence with a YAML `---` became a heading that swallowed half the fence; no test failed. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
`> rule` over `---` became a heading, so `trace prefilter` lost the rule and used it as the next claim's heading. CommonMark reads the block and a thematic break. The changelog fragment now names `trace prefilter`. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
Mutation of changed linesAt 0af133d: 61 caught · 8 missed Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put
Not checked:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
…with-2 Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
Main's segment (intel#1045) already makes Setext headings and indented code one span each. On top of it: - dangling_fence returns the fence segment leaves open, so a stitched bundle agrees with segment on indented backticks, list continuations, empty list items and CRLF. - indented code is read before a fence, so four-space backticks after a blank line are code. - indented code or a Setext heading may follow a closed fence or a heading directly; an ATX heading may be indented up to three spaces. - the growth baseline entry for segment is dropped. - a lone `-` under a paragraph line is a level-two Setext underline. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@xaleryb, this is ready for another look: 2 commits on Changes:
PR description updated:
Your comment:
Threads:
What I checked on the new commit:
What each test shows
|
…tel#974) A reference whose front matter has a blank line was scanned alone, so its fence status differed from the stitched document and the appended backticks opened a fence over the next file. Scan the heading and body together, as they are stitched. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
|
This is ready for another look: I've pushed 1 commit on Changes:
Threads:
What I checked on the new commit: the new test fails before the fix and passes after it; the full test suite passes with main merged in (33,966 tests). What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 0af133d)
- Contract: candidate. defaults dokimi/dokimi/novelty/spans.py:321
- Responsibility: none
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
Checked Setext headings, indented code, span offsets, bundle boundaries and the walkthrough against the output files. The bundle now checks the dangling fence in the context of its file heading. The spans and journey suites passed locally (100 tests), and GitHub CI passed.


Summary
Fixes #974 scenarios 1 to 5; scenario 6 was fixed by #1049.
skill novelty analyzecounted a Setext heading and four-space indented code as extra sentence spans, and the walkthrough misdescribed three outputs. #973 was fixed by #1045; this change builds on it.; #1305 edits the same page, in sections this change leaves alone.Changes
dangling_fenceread the text throughsegment. The closing---of front matter is not an underline.analyzeleavesnovelty.partial.json, that sole carriers and dead weight are innovelty.jsonunderviews, and thatprobefiles carry norun_config.dangling_fenceskips indented code the waysegmentdoes, so a stitched bundle cannot read an indented fence line as an opener._stitchdrops leading blank lines of a bundle file but keeps the first line's indentation, and the walkthrough's cap paragraph listsanalyzeamong the steps that save a partial result.segmentanddangling_fence, and front matter needskey: valuelines between the two---.Risk
Span ids and counts change for artifacts that use Setext headings or indented code, so a saved
atoms.jsonmade before this change may not line up with a rerun of the same skill. Plain text,#headings and fenced code segment as before.Testing
New cases in
tests/test_novelty_spans.py(Setext with=and-, front matter, a rule after a blank line, a list item, indented code with a tab and blank lines, a paragraph, a list, the start of the text, offsets) and three tests intests/test_novelty_journey.pythat read the walkthrough. The tests whose name containsnovelty,spanorskillpass, as dotests/test_growth_ratchet.pyandruff checkon the changed files.mypyondokimi/novelty/spans.pyreports no issues. The tests whose names containnovelty,spanorskillstill pass. Tests whose names containbundle,prefilterordocspass too.Open questions
Scenario 3 can be fixed by writing
run_configinto the probe record or by correcting the guide. I corrected the guide, since probe files have never carried it.run_configover Writerun_configinto the probe record: smallest change; the probe record has never carried it. Is that the behaviour you want?Revert
A plain revert restores the old text and span rules; saved records made in between keep the span ids they were written with.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)Review points edit lines of recent commits:
dokimi/dokimi/novelty/spans.py(2bda46b fix(novelty): a longer code fence closes only on a fence as long (#974). Each commit's own tests still pass; none of their assertions changes except those listed above for a scenario of the issue.Review points also changed
dokimi/dokimi/novelty/bundle.py; each change is for a point a test in this pull request reproduces.Checklist evidence
pytestpasses: 2 test file(s) changed; suite: 30793 passed; 1 failing test(s) fail on the base branch too: tests/test_repo_compare_interval.py::test_the_row_p_places_zero_where_large_deltas_round_p_at_zero_apart; 14 of 14 proof(s) fail before the changeruff,mypy, and schema checks pass: passed: ci.yml:static / ruff check, ci.yml:typecheck / mypy, ci.yml:static / schema-check, ci.yml:static / schema_compat vs the PR basedokimi/docs/skill-novelty-walkthrough.mdAGENTS.md: nothing left open; mutation of changed lines ranraise/exit and test names the doc, contract or issue it traces to: every new error path and test names a doc, contract or issue.github/.licenserc.yaml): no new source fileFixes #974.