test: schema + graph + prompts fixture gaps (L5A)#75
test: schema + graph + prompts fixture gaps (L5A)#75Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
Conversation
…001) F-SCH-002: parametrized required-field rejection tests for GrippyReview KRC-01 graph-store: unicode data, special chars, empty type edge cases KRC-01 graph-context: unindexed file, nonexistent author, shared dependent F-PR-001: adversarial prompt content (injection, unicode, template syntax) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
project-navi-bot
left a comment
There was a problem hiding this comment.
All required CI checks passed. Auto-approved by navi-bot.
project-navi-bot
left a comment
There was a problem hiding this comment.
All required CI checks passed. Auto-approved by navi-bot.
| with pytest.raises(ValidationError): | ||
| f.file = "other.py" # type: ignore[misc] | ||
|
|
||
|
|
There was a problem hiding this comment.
🔵 LOW: Comprehensive required field validation tests added for GrippyReview schema (F-SCH-002)
Confidence: 100%
Parametrized negative tests for required field presence on the GrippyReview schema ensure omissions raise ValidationError. One test covers top-level required fields, another covers required nested fields. This closes a previously noted governance gap in test coverage for schema contract enforcement.
Suggestion: None required for this PR. Tests are correct and match the schema's intent. For future enhancement, consider explicit coverage for optional vs. required nested fields if the schema grows.
— Governance box checked: this closes a coverage loop on schema validation. Not blocking, but worth calling out.
| checker = SQLiteGraphStore(db_path=db_path) | ||
| nodes = checker.get_recent_nodes(limit=node_count + 10) | ||
| assert len(nodes) == node_count | ||
|
|
There was a problem hiding this comment.
🔵 LOW: Edge case handling for Unicode and special data in graph-store (KRC-01)
Confidence: 100%
Tests now exercise graph-store's ability to handle Unicode in node data, non-ASCII in observations, special characters in edge properties, and empty type edge cases. This ensures robust support for internationalization and resilience to unusual input, reducing defect risk in heterogenous environments.
Suggestion: No changes required. These new tests proactively increase coverage of data encoding edge cases. For defense-in-depth, consider adding fuzz tests for other boundary cases.
— The graph can finally handle strings that aren't pure ASCII. This will prevent a lot of annoying surprises in the logs.
| results.add(text) | ||
| assert len(results) == 1, f"Non-deterministic output: got {len(results)} distinct results" | ||
|
|
||
|
|
There was a problem hiding this comment.
🔵 LOW: Edge case coverage for graph-context queries (KRC-01)
Confidence: 100%
New tests verify safe handling of touched files not in the index, authors with no reviews or nonexistent authors, and correct blast radius calculation for shared dependents. Prevents regressions in context pack building where input may be missing or ambiguous.
Suggestion: No changes required. Tests appropriately verify edge behavior under odd inputs. Optional: add regression tests for legacy data structures if those paths remain relevant.
— Covers cases that are rare in the wild but catastrophic when missed. All handled. ...fine.
| joined = "\n".join(result) | ||
| assert "Rule Findings Context" not in joined | ||
|
|
||
|
|
There was a problem hiding this comment.
🔵 LOW: Prompt loader now tested against adversarial/injection content (F-PR-001)
Confidence: 100%
Tests ensure that the prompt loader treats file content as literal text regardless of embedded template markers or injection attempts. This guards against accidental instruction parsing or template expansion vulnerabilities.
Suggestion: None required for this PR. Good defensive test coverage. If custom template engines are ever introduced, re-examine loader logic for similar risks.
— If someone tries to sneak an instruction between the lines, the loader just shrugs and copies the bytes. Correct behavior. 📝
✅ Grippy Review — PASSScore: 92/100 | Findings: 4 Delta: 4 new Commit: f58430d |
project-navi-bot
left a comment
There was a problem hiding this comment.
All required CI checks passed. Auto-approved by navi-bot.
project-navi-bot
left a comment
There was a problem hiding this comment.
All required CI checks passed. Auto-approved by navi-bot.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
project-navi-bot
left a comment
There was a problem hiding this comment.
All required CI checks passed. Auto-approved by navi-bot.
Summary
GrippyReview(8 fields + 1 nested)Audit Context
Test plan
uv run pytest tests/test_grippy_schema.py tests/test_grippy_graph_store.py tests/test_grippy_graph_context.py tests/test_grippy_prompts.py -v— 189 passeduv run pytest tests/ -v— full suite passes🤖 Generated with Claude Code