Skip to content

test: schema + graph + prompts fixture gaps (L5A)#75

Open
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
test/L5A-infra-fixture-gaps
Open

test: schema + graph + prompts fixture gaps (L5A)#75
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
test/L5A-infra-fixture-gaps

Conversation

@Fieldnote-Echo
Copy link
Member

Summary

  • F-SCH-002: Parametrized required-field rejection tests for GrippyReview (8 fields + 1 nested)
  • KRC-01 graph-store: Unicode data round-trip, special chars in edge properties, empty type edge case
  • KRC-01 graph-context: Unindexed file handling, nonexistent author, shared dependent counting
  • F-PR-001: Adversarial prompt content tests — injection attempt loaded literally, unicode preserved, template syntax not interpreted

Audit Context

  • Findings: F-SCH-002, KRC-01 (graph-store), KRC-01 (graph-context), F-PR-001 (all LOW)
  • Lane: L5A (Infra Fixture Gaps) — Priority 5a in remediation plan

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 passed
  • uv run pytest tests/ -v — full suite passes
  • Pre-commit hooks pass

🤖 Generated with Claude Code

…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>
Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

with pytest.raises(ValidationError):
f.file = "other.py" # type: ignore[misc]


Copy link
Contributor

Choose a reason for hiding this comment

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

🔵 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

Copy link
Contributor

Choose a reason for hiding this comment

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

🔵 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"


Copy link
Contributor

Choose a reason for hiding this comment

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

🔵 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


Copy link
Contributor

Choose a reason for hiding this comment

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

🔵 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. 📝

@github-actions
Copy link
Contributor

✅ Grippy Review — PASS

Score: 92/100 | Findings: 4

Delta: 4 new


Commit: f58430d

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

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.

2 participants