Skip to content

feat: Phase 4 doc spans + round-trip equivalence tests#122

Merged
avrabe merged 2 commits intomainfrom
feat/phase4-roundtrip
Apr 3, 2026
Merged

feat: Phase 4 doc spans + round-trip equivalence tests#122
avrabe merged 2 commits intomainfrom
feat/phase4-roundtrip

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 3, 2026

Summary

Phase 4: Document span tracking

  • DocReference gains col, byte_offset, len for precise [[ID]] positioning
  • Section gains heading_line, heading_byte_offset
  • LSP diagnostics now include column info for broken doc refs
  • 6 new tests

Round-trip equivalence tests

  • 4 integration tests proving rowan parser correctness:
    1. Lossless round-trip for every .yaml in the project
    2. No Error nodes in any valid YAML
    3. Generic artifact extraction matches serde output
    4. STPA extraction matches serde output

These tests are the gate for deleting stpa.rs (Phase 6).

Refs #22.

🤖 Generated with Claude Code

avrabe added 2 commits April 2, 2026 20:00
…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).
@avrabe avrabe merged commit 4e2aa4a into main Apr 3, 2026
@avrabe avrabe deleted the feat/phase4-roundtrip branch April 3, 2026 00:04
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ 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.

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.

1 participant