Skip to content

Single-item collection collapse + accurate capability report (WS-3)#73

Merged
keyxmakerx merged 1 commit into
mainfrom
claude/chronicle-sheet-sync-j2m9s4
Jun 28, 2026
Merged

Single-item collection collapse + accurate capability report (WS-3)#73
keyxmakerx merged 1 commit into
mainfrom
claude/chronicle-sheet-sync-j2m9s4

Conversation

@keyxmakerx

Copy link
Copy Markdown
Owner

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.json hero preset consumes foundry_item_single (class/subclass/ancestry/kit) and foundry_item_fields projections (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 wrong foundry_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 test passes locally (adapter + inspector unit tests)
  • node tools/check-package-descriptor.mjs (descriptor unchanged — n/a)
  • Manual verification in Foundry: load a draw-steel world; open Sync Dashboard ▸ Diagnostics ▸ Copy Capability Report on a hero; confirm class/level/heroic-resource rows
  • If UI-touching: n/a (diagnostic output only)
  • CI passes

Tenet self-check

  • T-B1 security: read-only actor field extraction; no token/URL handling changed
  • T-B2 plugin isolation: changes stay within this module's adapter + inspector
  • T-B3 production UI: capability report is text output; no new UI states needed
  • T-B4 dual-audience docs: inspector statuses documented for both human + AI use

Stop-and-flag

Flag any tenet violation by number during review.

🤖 Generated with Claude Code


Generated by Claude Code

…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
@keyxmakerx keyxmakerx merged commit 96f0821 into main Jun 28, 2026
1 check passed
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