feat: Phase 4 doc spans + round-trip equivalence tests#122
Merged
Conversation
…ase 4) DocReference gains col, byte_offset, len fields for precise positioning. Section gains heading_line and heading_byte_offset. validate_documents() now provides column info in diagnostics. 6 new tests: byte offset roundtrip, column not at start, multiple refs on one line, multiline offsets, section heading spans.
4 integration tests proving the rowan parser is a correct replacement: 1. rowan_roundtrips_all_yaml_files — every .yaml in the project parses losslessly (parse(source).text() == source) 2. no_error_nodes_in_project_yaml — no Error nodes in any file 3. schema_driven_matches_serde_for_generic_artifacts — identical artifact extraction vs parse_generic_yaml() 4. schema_driven_matches_serde_for_stpa_files — identical extraction vs import_stpa_file() for STPA format These tests are the gate for deleting stpa.rs (Phase 6).
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 9a12dd9 | Previous: bd0d729 | Ratio |
|---|---|---|---|
store_lookup/100 |
2195 ns/iter (± 8) |
1682 ns/iter (± 10) |
1.30 |
store_lookup/1000 |
26434 ns/iter (± 198) |
19412 ns/iter (± 37) |
1.36 |
traceability_matrix/1000 |
58083 ns/iter (± 440) |
40491 ns/iter (± 72) |
1.43 |
query/1000 |
7380 ns/iter (± 85) |
5604 ns/iter (± 27) |
1.32 |
This comment was automatically generated by workflow using github-action-benchmark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4: Document span tracking
DocReferencegainscol,byte_offset,lenfor precise [[ID]] positioningSectiongainsheading_line,heading_byte_offsetRound-trip equivalence tests
These tests are the gate for deleting stpa.rs (Phase 6).
Refs #22.
🤖 Generated with Claude Code