Skip to content

feat(v0.3.0): LSP salsa, verify assertions, AADL v2.3, diff, SARIF#73

Merged
avrabe merged 10 commits intomainfrom
feat/v030-wave2
Mar 21, 2026
Merged

feat(v0.3.0): LSP salsa, verify assertions, AADL v2.3, diff, SARIF#73
avrabe merged 10 commits intomainfrom
feat/v030-wave2

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 21, 2026

Summary

  • LSP salsa refactor: Replace manual HashMap caching with RootDatabase + SourceFile salsa inputs — unchanged files are never re-parsed, all 10 handlers route through memoized parse_file queries
  • Property assertion engine: New spar verify assertion language with rowan CST (lexer, parser, GreenNode), thread-local parse cache — components.where(category == 'thread').all(has('Timing_Properties::Period')) etc.
  • AADL v2.3 parser: Abstract features with classifier, annex file references, interface feature group types — 11 new parser tests, all 211 existing pass
  • spar diff: Git-aware structural + analysis comparison (--base/--head/--old/--new), regression detection, text/json/sarif output
  • SARIF output: spar analyze --format sarif for GitHub Code Scanning integration — SARIF v2.1.0 conformant

Test plan

  • 1,429 tests pass across workspace (85 new), 0 failures
  • LSP: 33 spar-cli tests pass including all LSP handler tests
  • Assertions: 93 tests (38 assertion engine + 55 verify integration)
  • Parser: 222 syntax tests (11 new v2.3 + 211 existing v2.2 — no regressions)
  • Diff: 7 unit tests for structural comparison and analysis impact
  • SARIF: 6 unit tests for schema conformance and severity mapping
  • Manual: VS Code extension with salsa-backed LSP

🤖 Generated with Claude Code

avrabe and others added 8 commits March 21, 2026 06:42
Add a mini expression language that queries the AADL instance model
directly, complementing the existing requirement checks (which filter
analysis diagnostics). Assertions are declared as [[assertion]] sections
in the TOML file alongside [[requirement]] entries.

Expression language supports:
- components/analysis('name') sources
- .where(), .all(), .any(), .none(), .count(), .features, .diagnostics
- category/kind/direction/severity equality, has('prop'), connected
- Boolean combinators: and, or, not, parenthesized grouping
- message.contains('text') for diagnostic filtering

76 tests pass (38 new assertion + 38 existing).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ching

Replace the LSP server's hand-rolled HashMap<String, String> document
store and HashMap<String, Arc<ItemTree>> cache with salsa's RootDatabase
and SourceFile inputs. File text changes now flow through
file.set_text(&mut db).to(new_text), and all parsing goes through the
memoized parse_file(&db, file) query. This means unchanged files are
never re-parsed, and downstream GlobalScope rebuilds benefit from salsa's
automatic invalidation tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part 1 — AADL v2.3 parser extensions:
- Abstract features with classifier constraint: `feature f: classifier(Pkg::Type);`
- Annex file references: `annex Name {** file("path") **};`
- `interface` contextual keyword for feature group types
- New SyntaxKind variants: INTERFACE_KW, FILE_KW, FILE_REFERENCE
- 11 new parser tests for v2.3 constructs + v2.2 regression test

Part 2 — Git-aware diff (`spar diff`):
- Compare models from git refs (--base/--head) or directories (--old/--new)
- Structural comparison: added/removed/modified components, connections
- Analysis impact: diagnostic counts per analysis, base vs head
- Regression detection: new errors/warnings not present in base
- Output formats: text (default), json, sarif

Part 3 — SARIF output (`--format sarif`):
- SARIF v2.1.0 compliant JSON for GitHub Code Scanning integration
- Available on both `spar analyze` and `spar diff` commands
- Maps analysis name to ruleId, severity to level, path to logical location
- Rule deduplication, artifact tracking, physical+logical locations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ache

Convert the assertion expression engine from a char-based parser with
enum Expr/BoolExpr/Method AST to a proper rowan-based infrastructure:

- syntax.rs: ExprSyntaxKind enum, ExprLanguage impl, SyntaxNode type alias
- lexer.rs: tokenizer producing (ExprSyntaxKind, String) pairs
- parser.rs: recursive descent building rowan::GreenNode via GreenNodeBuilder
- eval.rs: evaluator walking SyntaxNode/SyntaxToken instead of enum variants
- mod.rs: public API, TOML schema, thread-local parse cache (stopgap for salsa)

All 93 tests pass (38+ original assertion tests + lexer/parser unit tests).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	crates/spar-cli/src/main.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
avrabe and others added 2 commits March 21, 2026 07:36
…e_acronyms)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 137b29f into main Mar 21, 2026
9 of 10 checks passed
@avrabe avrabe deleted the feat/v030-wave2 branch March 21, 2026 15:14
avrabe added a commit that referenced this pull request Mar 21, 2026
Version: 0.2.4 → 0.3.0

Implemented requirements:
- REQ-RTA-001, REQ-BUS-001, REQ-MEMBUD-001, REQ-WEIGHTPOWER-001 (PR #70)
- REQ-PARSER-001, REQ-VERIFY-001, REQ-DIFF-001, REQ-DIFF-002 (PR #73)
- REQ-SOLVER-001, REQ-SOLVER-002, REQ-SOLVER-003, REQ-SOLVER-007 (PR #74)

Implemented architecture decisions:
- ARCH-ANALYSIS-001, ARCH-DIFF-001, ARCH-VERIFY-001 (PR #73)
- ARCH-SOLVER-002, ARCH-SOLVER-003, ARCH-SOLVER-004, ARCH-SOLVER-005 (PR #74)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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