Skip to content

Commit fd99574

Browse files
authored
feat: rowan HIR extraction (Phase 2) + MCP 9 tools + pre-commit hook (#119)
* feat(mcp): expand to 9 tools — get, coverage, schema, embed, snapshot, 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. * feat(yaml): HIR extraction from rowan CST (Phase 2) 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. * feat: HIR extraction (Phase 2), MCP 9 tools, pre-commit hook, clippy fix 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.
1 parent 2b7acd4 commit fd99574

7 files changed

Lines changed: 1425 additions & 1 deletion

File tree

.claude/settings.local.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@
3535
"Bash(grep -rn 'Diagnostic {$\\\\|Diagnostic{' /Users/r/git/pulseengine/rivet/rivet-core/src/validate.rs)",
3636
"Bash(sed:*)",
3737
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); types=[t['name'] for t in d['artifact_types']]; print\\(f'{len\\(types\\)} types'\\); [print\\(f' {t}'\\) for t in types if t.startswith\\('ai-'\\) or t.startswith\\('risk'\\) or t.startswith\\('data'\\)]\")",
38-
"Bash(git -C /Users/r/git/pulseengine/rivet/.claude/worktrees/agent-a5e68f53 diff HEAD -- rivet-cli/src/main.rs)"
38+
"Bash(git -C /Users/r/git/pulseengine/rivet/.claude/worktrees/agent-a5e68f53 diff HEAD -- rivet-cli/src/main.rs)",
39+
"Bash(grep -n:*)",
40+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); ids=[a['id'] for a in d['artifacts']]; ids.sort\\(\\); print\\(f'Last FEAT: {ids[-1]}, count: {len\\(ids\\)}'\\)\")",
41+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); feats=[a['id'] for a in d['artifacts'] if a['id'].startswith\\('FEAT-'\\)]; feats.sort\\(\\); print\\(feats[-5:]\\)\")",
42+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); reqs=[a['id'] for a in d['artifacts'] if a['id'].startswith\\('REQ-'\\)]; reqs.sort\\(\\); print\\(reqs[-5:]\\)\")",
43+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); dds=[a['id'] for a in d['artifacts'] if a['id'].startswith\\('DD-'\\)]; dds.sort\\(\\); print\\(dds[-5:]\\)\")",
44+
"Bash(python3 -c ':*)",
45+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); print\\('Links:', d.get\\('links', []\\)\\)\")",
46+
"Bash(ls:*)",
47+
"Bash(grep:*)",
48+
"Bash(python3:*)",
49+
"Bash(cp:*)",
50+
"Bash(chmod +x /Users/r/git/pulseengine/rivet/scripts/pre-commit)",
51+
"Bash(cp /Users/r/git/pulseengine/rivet/scripts/pre-commit /Users/r/git/pulseengine/rivet/.git/hooks/pre-commit)"
3952
]
4053
}
4154
}

CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CLAUDE.md
2+
3+
See [AGENTS.md](AGENTS.md) for project instructions.
4+
5+
Additional Claude Code settings:
6+
- Use `rivet validate` to verify changes to artifact YAML files
7+
- Use `rivet list --format json` for machine-readable artifact queries
8+
- Commit messages require artifact trailers (Implements/Fixes/Verifies/Satisfies/Refs)

0 commit comments

Comments
 (0)