Skip to content

feat: rowan HIR extraction (Phase 2) + MCP 9 tools + pre-commit hook#119

Merged
avrabe merged 3 commits intomainfrom
feat/mcp-hir
Apr 2, 2026
Merged

feat: rowan HIR extraction (Phase 2) + MCP 9 tools + pre-commit hook#119
avrabe merged 3 commits intomainfrom
feat/mcp-hir

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

Phase 2: Rowan HIR extraction (yaml_hir.rs, 816 lines)

  • extract_generic_artifacts(source) walks rowan CST → Vec<SpannedArtifact>
  • Precise byte spans for id, block, and every field
  • YAML 1.2 scalar conversion (true/false only, not yes/no)
  • Cross-validated against parse_generic_yaml() — identical output
  • 10 tests

MCP server expanded to 9 tools

  • rivet_get, rivet_coverage, rivet_schema, rivet_embed, rivet_snapshot_capture, rivet_add
  • All with proper JSON Schema inputSchema

Pre-commit hook

  • scripts/pre-commit — cargo fmt + clippy checks

Refs #22, #98.

🤖 Generated with Claude Code

avrabe added 3 commits April 2, 2026 19:03
…, add (#98)

MCP server now exposes 9 tools over stdio:
- rivet_validate, rivet_list, rivet_stats (existing)
- rivet_get — single artifact lookup
- rivet_coverage — traceability coverage with optional rule filter
- rivet_schema — schema introspection (types, links, rules)
- rivet_embed — resolve computed embeds
- rivet_snapshot_capture — capture project snapshot
- rivet_add — create new artifact with auto-ID

All tools have proper JSON Schema inputSchema.
Walks rowan YAML CST to extract Vec<SpannedArtifact> with precise
byte spans for every field. Cross-validated against parse_generic_yaml().

Types: Span, SpannedArtifact, ParseDiagnostic, ParsedYamlFile
Entry: extract_generic_artifacts(source) -> ParsedYamlFile
Scalar conversion follows YAML 1.2 rules (true/false only, not yes/no).

10 tests: cross-validation, span accuracy, links, fields, tags,
empty list, missing id, quoted values, block span, null/tilde.
Phase 2 rowan HIR: extract_generic_artifacts() walks CST to produce
Vec<SpannedArtifact> with byte spans. 10 tests, cross-validated.

MCP server expanded to 9 tools: get, coverage, schema, embed,
snapshot_capture, add (+ original validate, list, stats).

Pre-commit hook script: scripts/pre-commit (cargo fmt + clippy).
Clippy allow for cloned_ref_to_slice_refs in convergence tests.
@avrabe avrabe merged commit fd99574 into main Apr 2, 2026
@avrabe avrabe deleted the feat/mcp-hir branch April 2, 2026 23:20
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: d30b66c Previous: 2b7acd4 Ratio
link_graph_build/10000 34824028 ns/iter (± 2365589) 22818110 ns/iter (± 1283743) 1.53

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