test: cover deeply nested evidence traversal in the reference plugin#51
Conversation
Adds tests verifying ReferenceValidationPlugin recursively discovers and validates evidence nested 2+ levels below the tree root (Community -> MemberRecord/Interaction -> EvidenceItem), mirroring schemas like CommunityMech. The existing test_schema only exercised 1-level nesting (Statement -> Evidence). Covers both the plugin's process() path and the full linkml.validator.Validator pipeline (the CLI path), plus field detection of implements annotations at depth. These pass against the current plugin (the traversal already works) and are independent of the full-text/PDF work in #48, so they ship separately. Ref: CultureBotAI/CommunityMech#3 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @cmungall's task in 1m 30s —— View job Review: deep nested evidence traversal tests
This is a clean, well-documented, test-only PR that locks in recursive traversal behavior already present on
Suggestions (all non-blocking)1. Duplicated cache-seeding boilerplate. The fixture-copy loop appears 3× — in the def _seed_cache(cache_dir: Path) -> None:
for pattern in ("*.md", "*.txt"):
for f in FIXTURES_DIR.glob(pattern):
(cache_dir / f.name).write_text(f.read_text())2. "Bug reproduction" wording is slightly misleading. Comments call these "the core bug reproduction" / "the actual bug" (lines 105, 113–115), but the PR body states the behavior already works on 3. Coverage gap vs. the PR's "2+ levels" claim. Every test nests exactly 2 levels ( 4. No mixed valid+invalid-in-one-tree case. 5. VerdictSolid, hermetic, well-isolated regression coverage that mirrors the real CommunityMech pattern. None of the above blocks merge — they're polish. Nice work keeping it decoupled from #48.
|
What
Adds a test suite verifying that
ReferenceValidationPluginrecursively discovers and validates evidence nested 2+ levels below the tree root, e.g.:The existing
test_schema.yamlonly exercised 1-level nesting (Statement -> Evidence). This mirrors real-world schemas like CommunityMech (MicrobialCommunity -> TaxonomicComposition -> EvidenceItem).Coverage
process()path: traversal throughmembersandinteractions, multiple members × multiple evidence, valid snippets pass / invalid snippets caught.implementsannotations (reference + excerpt) discovered onEvidenceItemat depth; root class correctly has none.linkml.validator.Validatorpipeline (the same path the CLIvalidate datauses).Why a separate PR
These tests are independent of the full-text/PDF framework in #48 (they don't touch that subsystem) and pass against the current plugin on
main— the recursive traversal already works; this locks in that behavior. Keeping them out of #48 keeps that PR focused.10 tests, all green (pytest + mypy + ruff). New fixtures: a deep-nesting schema and valid/invalid data files.
Ref: CultureBotAI/CommunityMech#3
🤖 Generated with Claude Code