Single-item collection collapse + accurate capability report (WS-3)#73
Merged
Conversation
…y report (WS-3) Adapter: - extractCollectionField honors foundry_item_single → returns the first matching item's name (or first projected value) as a plain string, for "exactly one X item" fields like a hero's class/ancestry/kit/subclass. Capability Inspector: - Stop mislabeling collection-mapped fields (abilities_json, class, …) as "declared-unmapped" — they're mapped via a collection, so classify them collection-mapped and count them separately (Status panel + Copy Report). - Surface one sample item schema PER item type in the collections section (was: only the first item overall). The Copy Report now lists the projectable fields for ability/feature/class/ancestry/kit/… — exactly what's needed to finish the remaining item-field mappings (feature split, immunities/weaknesses). Tests: 568 node tests green (+3). New coverage for single-item extraction (name, projection, empty), collection-mapped classification, and per-type sample schemas in the report. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cites: WS-3 (single-item collection collapse); Draw Steel sheet sync-expansion arc
Security implication: none — read-side field extraction + a diagnostic report; no new trust boundary
Consumer-verified: Chronicle Draw Steel
manifest.jsonhero preset consumesfoundry_item_single(class/subclass/ancestry/kit) andfoundry_item_fieldsprojections (abilities)Foundry compatibility: read-only actor traversal via the generic adapter; not version-specific (no v12/13/14-gated API)
Mockup: n/a
What this changes
The generic adapter can now collapse a single-item collection (a hero's class/ancestry/kit) to one value instead of emitting a one-element JSON array, and project nested item sub-fields via
foundry_item_fields. The capability inspector reports per-field sync health accurately (synced/mapped-missing/declared-unmapped/available-unmapped) so wrongfoundry_paths are diagnosable Foundry-side.Why
The Draw Steel hero sheet needs identity items (class/ancestry/kit) as plain names and ability items with their mechanics — both expressed purely through manifest annotations, no per-system adapter code. The capability report is the Foundry-side tool that confirms the correct path when a field syncs empty (the Chronicle workspace can only see the null result, not the path).
Test plan
npm testpasses locally (adapter + inspector unit tests)node tools/check-package-descriptor.mjs(descriptor unchanged — n/a)Tenet self-check
Stop-and-flag
Flag any tenet violation by number during review.
🤖 Generated with Claude Code
Generated by Claude Code