fix(mcp): typed Zone schema for entries_map_open (fix empty diary-map zones)#1234
Merged
Conversation
… app MoltNet-Diary: 97d46339-a48e-4cea-bfca-9ea76187549a Task-Group: typed-zone-schema Task-Completes: true Fixes the empty-zones report (issue #1231): opaque zones:Array(Unknown) let the agent send anchorEntries/summary while the app read entryIds/why, so every zone rendered blank. Adds EntryMapZoneSchema (entry_ids required) + tolerant parser aliases + regression tests from the real agent payload.
Contributor
✅ CLI go.mod matches internal Go module releases
|
Contributor
🚨 Dependency Audit — Vulnerabilities foundFull report |
Contributor
|
…ze provenance MoltNet-Diary: 5fd767b4-13b5-490b-94ee-387443be5e81 Task-Group: typed-zone-schema
…nt the flow MoltNet-Diary: df49702a-c87b-4ad2-80c8-2132c88d36d3 Task-Group: typed-zone-schema Task-Completes: true
getlarge
approved these changes
May 25, 2026
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.
Summary
Fixes the empty-zones bug from #1231 (comment): the diary map rendered zone labels but every zone showed 0 entries.
Root cause (confirmed from the agent's real
entries_map_openinput):map.zoneswas typedType.Array(Type.Unknown())— opaque. With no field-name contract, the agent sentanchorEntries/summarywhile the app readentryIds/why, so the real entry UUIDs were silently dropped.What's here
Typed
EntryMapZoneSchemareplaces the opaque array —id,label,why?,entry_ids(required, real entry UUIDs), optionalterritory/tags/size/provenance, each documented so the model knows exactly what to send.provenance.searchesis schematized too (EntryMapZoneSearchSchema), not opaque. The tool description spells out the workflow and theentry_idsrequirement.Strict canonical parser (no alias-guessing). The schema is the contract, so
parseZone/parseSearchread only the canonical fields — the alias chains (entryIds ?? anchorEntries ?? …) are gone; accepting many names would defeat the schema. Non-canonical fields are ignored (and rejected upstream by validation). The one retaineddiaryId/diary_idread is two genuinely-distinct wire shapes (flattened tool OUTPUT vs nested INPUT), commented as such.Self-documenting e2e round-trip — the test that would have caught this. The focus-zone test now asserts the mosaic renders the exact seeded entry content ("showing 2 of 2"; the two
scope:infraentries present, the out-of-zone entry absent), provingentry_idssurvive validation → parser →entries_listbridge → render. Previously the fixture hand-wrote a field name only the parser knew (self-confirming); it now uses canonicalentry_idsvalidated by the real server. Heavily commented so the spec narrates the agent→tool→app→pack flow.Docs —
docs/understand/knowledge-factory.mddescribes the diary map as one way to explore and curate (alongsideentries_search, the explore skill, the console), framed as a human-first driver of the existing agent-curated Condense step that ends in a draftcustompack.Not in scope
The "Could not resolve the saved pack id" error in the same report is the already-merged #1233 fix (
packs_provenance); that session ran a pre-#1233 deploy — it needs the deployment bumped, verified working here.Verification
typecheck/lint/format:checkclean.Fixes the empty-zones part of #1231; relates to #1194.
🤖 Generated with Claude Code