Sync Capability Inspector, generic collection pulls, Diagnostic Bundle, central logger#71
Merged
Merged
Conversation
… what DOES) Wave 1 / WS-4 core. Pure, testable engine that diffs a live actor's full data tree against the system's declared character-field manifest: - captureActorSnapshot(actor): defensive — walks actor.system (via toObject), summarizes actor.items/effects collections + flags; never throws on a bad actor. - buildCapabilityReport(snapshot, fieldDefs): pure — classifies each field as synced / mapped-missing / declared-unmapped / available-unmapped, and flags items/effects collections as available-but-not-yet-pullable (the WS-3 gap). - renderCapabilityMarkdown/Json: copy-to-clipboard payloads (human + AI friendly). Reuses the schema-walker + two-layer (collect/render) pattern from the calendar diagnostics. 5 node:test cases, all green. UI wiring (dashboard panel + copy buttons) lands next; this is the reusable core + the relay payload shape. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
…oard Status tab Wires the WS-4 engine into the dashboard: samples a representative hero actor, fetches its system character-fields, and renders a 'Sync Capability' panel showing what CAN pull vs what DOES — synced / declared-unmapped / mapped-missing / available-unmapped counts, an actionable gap list (incl. items/effects collections flagged as the not-yet-pullable WS-3 work), and Copy Report (markdown) / Copy JSON buttons. Mirrors the existing copy-debug action + clipboard pattern; all template output auto-escaped. Pure engine fully unit-tested (540/540 suite green incl. dashboard XSS + template roots). UI render needs a live Foundry smoke-test (ApplicationV2 UI is not headlessly testable — same caveat as the dialog migration). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
…y from actor.items[]) WS-3. The dot-path adapter could only read scalar actor.system fields, so embedded documents (abilities, inventory, features in actor.items[]) never synced. Adds a manifest-driven, system-agnostic collection mapping: a field with foundry_collection (+ optional foundry_item_type filter + foundry_item_fields projection) extracts and serializes the collection to JSON. Read-only today (excluded from the write path); write-back is a future tier (foundry_writable preserved for scalars). Refactored the extraction into pure exported helpers (getNestedValue, extractCollectionField, buildChronicleFields) — 6 node:test cases, full suite 546/546. DS-specific path mappings come next from the Capability Inspector's live output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
…for troubleshooting) Wave 1 debug cockpit. A pure builder assembles versions + connection/health + per-resource sync status + field mapping + Sync Capability summary + recent activity/error logs into one copy-paste Markdown report — the manual precursor to the admin AI assist and the thing this project needed instead of multi-screenshot hunting. Wired a 'Copy Diagnostic Bundle' button on the Status tab (mirrors copy-debug; gathers from the same accessors the status tab uses). Pure builder fully unit-tested (4 cases, tolerant of partial/garbage input); full suite green. UI render needs a live Foundry smoke-test (ApplicationV2 not headlessly testable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
…ndle Wave 1 debug cockpit. Adds scripts/logger.mjs: leveled logging (error<warn<info<debug <trace, plus silent) gating console noise, with an always-on ring buffer (cap 500) so recent messages export even when the console wasn't open. The Diagnostic Bundle now includes the captured buffer; the dashboard's new capability/bundle handlers route through log.* as the first adopters. Level CONTROL (UI/setting) is intentionally deferred until enough call sites adopt the logger — shipping a no-op control would be the kind of fake feature we're avoiding. 6 logger tests + bundle log-buffer test; full suite 557/557. 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.
Wave-1 "Foundry Sync Hub" debug cockpit + the data-pull engine (see the Cordinator master plan + deploy runbook).
98ac0f6Sync Capability Inspector engine — pure, tested:captureActorSnapshot(walksactor.system+items/effects+ flags) +buildCapabilityReport(diffs against the system's declared field manifest → synced / mapped-missing / declared-unmapped / available-unmapped, flags collections) + markdown/JSON renderers.5fb4a7ccapability panel on the dashboard Status tab — "Sync Capability" summary + gap list + Copy Report/JSON (mirrorscopy-debug; auto-escaped).84936d2generic collection extraction — the adapter now pulls embedded collections (actor.items[]→ abilities/inventory/features) via manifest annotations (foundry_collection+foundry_item_type+foundry_item_fields), serialized to JSON. Read-only (excluded from write path). Pure helpers + tests.5b3de3aone-click Diagnostic Bundle — a copy-paste troubleshooting report (versions + health + sync status + field mapping + capability + recent logs). Pure builder + tests; "Copy Diagnostic Bundle" button on the Status tab.6c9a491central leveled logger —scripts/logger.mjs(levels + ring buffer), captured into the Diagnostic Bundle; dashboard handlers are first adopters. Level-control UI deferred until adoption is broad (no no-op control).Full suite 557/557 green. The three dashboard UI surfaces need a live Foundry smoke-test (ApplicationV2 UI is not headlessly testable — same caveat as the dialog migration); steps are in the runbook.
Next (needs live input): paste the Status tab → Sync Capability → Copy Report output to finish the Draw Steel pull mappings (backstory/abilities/inventory paths) — no guessing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LaDDiXB5GTVurEzJwYYopf
Generated by Claude Code