Skip to content

feat(lookup): lookup_mst — Mibera Shadow Traits per-token enrichment (companion to URL_CONTRACT v1.2.0)#67

Draft
zkSoju wants to merge 3 commits into
mainfrom
feat/lookup-mst-mibera-family-sticker-integration
Draft

feat(lookup): lookup_mst — Mibera Shadow Traits per-token enrichment (companion to URL_CONTRACT v1.2.0)#67
zkSoju wants to merge 3 commits into
mainfrom
feat/lookup-mst-mibera-family-sticker-integration

Conversation

@zkSoju
Copy link
Copy Markdown
Contributor

@zkSoju zkSoju commented May 2, 2026

gm @gumibera 👋 — distribution-side draft for MST sticker substrate integration. Closes the lore-keeper / distribution-operator split: my job is the lookup verb shape + URL composition + MCP tool surface; lore stayed yours (and got it right by reading the construct).

Composes with freeside-storage#6 (URL_CONTRACT v1.2.0). Extends the codex-as-authority pattern from #60.

what this ships

micodex lookup mst 123                  # MST per-token enrichment
micodex lookup mst @mst123              # ref form
micodex lookup shadow 123               # alias — same data, @shadow<N> ref form
micodex lookup shadow @shadow42         # both refs accepted on both verbs

returns:

field shape source
collection contract / chain / standard / name / symbol _codex/data/mst-collection.json
metadata.sovereignUrl metadata.0xhoneyjar.xyz/mibera/mst/{N} LIVE post-Cutover B 2026-05-01
stickers.urls[expr] per-expression sticker URL × 15 expressions composed from URL_CONTRACT v1.2.0 v2 paths
stickers.substrateStatus "pending" until M-1+M-2 land flips to "live" post-substrate (1-line diff)

cross-transport parity preserved: same verb works on CLI · MCP stdio · MCP HTTP. agents calling this get everything they need to render or refer to a token without composing strings themselves.

✅ both open questions answered from the construct itself

Q1 — Shadow vs MST: ALIAS (per _codex/data/shadow-traits.md)

MST = "Mibera Shadow Traits" (on-chain symbol = MST, narrative name = Shadow). Same tokens, same contract 0x048327A187b944ddac61c6e202BfccD20d17c008. URL_CONTRACT v1.2.0 registers BOTH path conventions for transitional consumer compat.

→ Implemented lookupShadow(tokenId) as alias delegating to lookupMst. Returns identical envelope with @shadow<N> ref form (preserves input vocabulary). type stays "mst" (technical truth). Both refs accepted on both verbs.

Q2 — Expression catalog: CANONICAL v2 / 15 expressions (sourced from live + dimensions)

Live canon Mibera manifest at assets.0xhoneyjar.xyz/Mibera/expressions/current.json reports version: "v2", expressionCount: 15, variants: ["transparent", "bg"], defaultVariant: "transparent". Slugs extracted from mibera-dimensions/lib/emoji/expression-presets.ts EXPRESSION_PRESETS constant — 15 entries matching the live count exactly:

neutral · angry · aww · sad · uneasy · yay · smirk · worried ·
shocked · devious · tearful · grumpy · bashful · fierce · bliss

The V06X_EXPRESSIONS hardcode in @freeside-storage/stickers/adapter.ts (7 entries) is OUT OF DATE — used only as synthesizer shim baseline for tokens missing per-token manifests.

mst-collection.json updated: versionv2, expressionsAvailable → canonical 15, variants["transparent", "bg"], defaultVariant unchanged. Substrate notes document the canon mirror.

why MST is structurally different from canon Mibera

per _codex/data/shadow-traits.md: MST is dynamically minted via user-submitted trait strings hashed keccak256 on-chain (3219 known minted as of 2026-05-01). there's no per-token curated record possible — each token is whatever the user submitted. so the codex publishes COLLECTION-level metadata + URL templates; lookupMst(tokenId) composes URLs at call time.

contrast: canon Mibera has 10K curated tokens with per-token JSONL (miberas.jsonl). MST has 1 collection record + a URL composer.

files touched (3 commits on branch)

file what
_codex/data/mst-collection.json v2 catalog · 15 expressions · 2 variants · alias documentation in substrateNotes
src/lookups/mst.ts lookupMst(tokenId) · lookupShadow(tokenId) (alias) · getMstCollection() · resetMstCache()
src/types.ts MstEntry · MstCollection · StickerCatalog (forward-compat for Tarot/Candies/GIF/Fractures sticker substrate) · WorldElementType extends with "mst" + "shadow"
src/validate.ts validate_world_element shared switch arm for mst + shadow (in-range numeric heuristic)
src/server.ts lookup_mst MCP tool + lookup_shadow alias tool (description names alias rationale + 15-expression catalog)
bin/micodex.ts CLI dispatch cases mst + shadow · help text updates · accepts @mst<N> and @shadow<N> refs on both verbs

what's deliberately NOT in this PR

  • skills/query-entity/SKILL.md updates — initial commit added micodex lookup mst to patterns + new MST section. Reverted on push (commit 0fa5053ce) per maintainer-authority signal. SKILL.md teaching content is yours; agents will discover the verbs via micodex lookup --help + MCP tool descriptions without it.
  • substrate bytes — M-1 (S3 bucket policy) + M-2 (sticker generation pipeline) — operator-driven, post-merge

smoke verified

$ micodex lookup mst 123           # → enriched envelope, 15 sticker URLs at v2 paths
$ micodex lookup shadow 42         # → same data, @shadow42 ref
$ micodex lookup mst @shadow99     # → cross-ref accepted, returns @mst99
$ micodex lookup mst 99999         # → exit 1 not_found (out of supply range)
$ pnpm build                       # → tsc clean
$ curl -sS https://assets.0xhoneyjar.xyz/Mibera/expressions/current.json | jq .expressionCount
15                                  # → matches our `expressionsAvailable.length`
$ curl -sI https://assets.0xhoneyjar.xyz/Mibera/MST/expressions/current.json
HTTP/2 403                          # → expected, M-1+M-2 substrate pending

what's NOT in this PR (operator-side, post-merge)

  • M-1 substrate bytes: S3 bucket policy on Mibera/MST/* + Mibera/Shadow/* — admin AWS profile (operator)
  • M-2 sticker generation pipeline (operator decision: source layers · per-trait composition vs canon-mirror)
  • M-3 manifest publish: builder script ready in freeside-storage#6, executes after M-1
  • M-5 verification: post-substrate

substrate going live = flip mst-collection.json stickers.substrateStatus from "pending""live" + remove substrateNotes. one-line diff post-substrate.

related

  • 📐 freeside-storage#6 — URL_CONTRACT v1.2.0 + M-3 manifest builder script
  • 📜 substrate handoff brief at bonfire/grimoires/bonfire/agenda/2026-05-02-mibera-family-sticker-substrate-handoff.md
  • 🪙 #60 — grail metadata authority pattern (the move I extended here)
  • 🏛 #54 — v1.0/v1.1 baseline lineage
  • 🤖 #53 — codex-mcp RFC (downstream consumer)
  • 📚 micodex-as-knowledge-map doctrine — agents navigate via well-named verbs; lookup_mst + lookup_shadow join the verb roster

🤖 Generated with Claude Code

zkSoju and others added 2 commits May 2, 2026 15:52
Composes URL_CONTRACT v1.2.0 (freeside-storage#6) sticker substrate paths
into a CLI/MCP lookup verb. Extends the bucket-1 pattern (`micodex lookup
<noun> <id>`) with a 6th noun: `mst`. Mirrors the lookup_grail / lookup_mibera
shape — agents call one verb, get the enriched envelope, never compose
URLs themselves.

Why MST is structurally different from canon Mibera:
- canon Mibera = 10K curated tokens, per-token JSONL, each with hash-keyed
  image baked at mint phase
- MST = user-minted via trait strings hashed keccak256 on-chain (see
  _codex/data/shadow-traits.md). 3219 known minted as of 2026-05-01. No
  per-token curated record possible — each token is whatever the user
  submitted. The codex publishes COLLECTION-level metadata + URL templates;
  lookupMst(tokenId) composes URLs at call time.

What the lookup returns:
- collection: {contract, chain, standard, name, symbol} — on-chain identity
- metadata.sovereignUrl: metadata.0xhoneyjar.xyz/mibera/mst/{N}
  (LIVE post-Cutover B 2026-05-01)
- stickers.urls[expr]: per-expression sticker URLs composed against
  Mibera/MST/expressions/{version}/{tokenId}/{variant}/{expr}.webp paths
- stickers.substrateStatus: "pending" until M-1 (S3 bucket policy) +
  M-2 (sticker generation pipeline) of mibera-family-sticker-substrate
  cycle land. Until then sticker URLs return 403; manifest URL returns 403.

Files:
- _codex/data/mst-collection.json — collection metadata + sticker config
  (one entry; per-token data composed at lookup time)
- src/lookups/mst.ts — lookupMst(tokenId) + getMstCollection() + reset
- src/types.ts — MstEntry + MstCollection + StickerCatalog (forward-compat
  for Shadow/Tarot/Candies/GIF/Fractures sticker substrate). Extends
  WorldElementType with "mst".
- src/validate.ts — validate_world_element handles "mst" via in-range
  numeric tokenId heuristic (definitive existence requires on-chain
  tokenURI call; this is for codex/MCP-side validation)
- src/server.ts — lookup_mst MCP tool with description naming substrate
  status + sovereign metadata cycle reference
- bin/micodex.ts — CLI dispatch case "mst" + help text + accepts @mstn ref
- skills/query-entity/SKILL.md — teaches agents the new verb + bulk-access
  reference + ref convention (@mst<tokenId>)

Smoke verified:
- micodex lookup mst 123      → enriched envelope with 7 sticker URLs
- micodex lookup mst @mst42   → ref form accepted (mirrors @g876 pattern)
- micodex lookup mst 99999    → exit 1 not_found (out of known supply range)
- pnpm build                  → tsc clean

Companion to URL_CONTRACT v1.2.0 (freeside-storage#6 — schema source).
Extends the codex-as-authority pattern crystallized in #60 (grail metadata):
distribution-layer concerns (file shape, JSON structure, MCP tool surface)
are operator's call; lore-layer concerns stay yours.

OPEN QUESTION (for @gumibera review): is the Shadow + MST distinction in
the substrate handoff (Mibera/Shadow/expressions/* + Mibera/MST/expressions/*)
referring to two distinct collections, or two paths for the same MST tokens?
Per shadow-traits.md, MST = "Mibera Shadow Traits" — narratively "Shadow",
technically "MST". This PR ships MST only; if Shadow is a separate codex
concept I should add lookup_shadow as a sibling, point me at the lore.

OPEN QUESTION (for @gumibera review): expressionsAvailable hardcoded to
the V0.6.x baseline (neutral · smile · angry · surprised · sad · sleepy ·
wink) per the consumer-side adapter shim. If MST has a sub-collection-
specific catalog (different expressions, additional ones, different default
variant), that's the lore call to make — flip _codex/data/mst-collection.json
to match.

Closes the codex-side leg of mibera-family-sticker-substrate-2026-05-02
substrate handoff; M-1 + M-2 + M-3 substrate-side work remains operator-
driven (handoff brief at bonfire/grimoires/bonfire/agenda/2026-05-02-mibera-
family-sticker-substrate-handoff.md).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
per maintainer authority (file edits surfaced as intentional revert):
SKILL.md teaching content is in gumi's lore-keeper domain, not operator's
distribution domain. CLI dispatch + MCP tool surface + types stay; how
agents are taught the new verb is the codex maintainer's call.

the lookup_mst verb still works end-to-end (CLI smoke green) — agents
discovering it via help text or MCP tool description will find it; the
SKILL.md teaching update is left for whoever owns that surface to write.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 2, 2026 11:01pm

Request Review

… v2/15 catalog

Two open questions in PR #67 dug from the construct (lore-keeper sources)
rather than punted to maintainer per operator framing.

Q1 — Shadow vs MST → ALIAS (not distinct).

Per `_codex/data/shadow-traits.md`: MST = "Mibera Shadow Traits" — the
on-chain symbol IS "MST" but the narrative name IS "Shadow". URL_CONTRACT
v1.2.0 registers BOTH path conventions for transitional consumer compat
(`Mibera/Shadow/expressions/*` and `Mibera/MST/expressions/*`). Same
tokens, same contract `0x048327A187b944ddac61c6e202BfccD20d17c008`,
same on-chain mechanics. Operator framing 2026-05-02: "they should be
the same thing unless concerned about a different nuance" — no nuance
surfaced from the codex.

Implementation:
- `lookupShadow(tokenId)` — alias delegating to `lookupMst`. Returns
  identical data with `@shadow<N>` ref form (preserves input vocabulary
  in the response). `type` stays `"mst"` (technical truth).
- CLI accepts `lookup shadow <id>` and `@shadow<N>` ref form on both
  verbs. WorldElementType extends with `"shadow"`. validate handles
  both via shared switch arm.
- MCP `lookup_shadow` tool added with description naming the alias
  relationship + reference to canonical mechanics.

Q2 — Expression catalog → CANON v2/15 (not V0.6.x baseline).

Sourced from TWO authoritative substrates:
1. Live canon Mibera manifest at
   `https://assets.0xhoneyjar.xyz/Mibera/expressions/current.json` reports
   `version: "v2"`, `expressionCount: 15`, `variants: ["transparent", "bg"]`,
   `defaultVariant: "transparent"`.
2. Expression slugs extracted from
   `mibera-dimensions/lib/emoji/expression-presets.ts`'s `EXPRESSION_PRESETS`
   constant — 15 entries that match the live count exactly:
   neutral · angry · aww · sad · uneasy · yay · smirk · worried · shocked ·
   devious · tearful · grumpy · bashful · fierce · bliss.

The `V06X_EXPRESSIONS` hardcode in
`@freeside-storage/stickers/adapter.ts` (7 entries) is an OUT-OF-DATE
baseline used only by the synthesizer shim for tokens missing per-token
manifests. The actual catalog is v2/15.

`mst-collection.json` updated:
- version: "v1" → "v2"
- expressionsAvailable: V0.6.x 7 → canonical 15
- variants: ["transparent"] → ["transparent", "bg"]
- defaultVariant unchanged
- substrateNotes documents the canon mirror + alias rationale
- new shadowAliasManifestUrl field exposes the Shadow path next to MST

Smoke verified:
- micodex lookup mst 123     → 15 expressions, v2 paths, MST manifest
- micodex lookup shadow 42   → same data, @shadow42 ref form
- pnpm build                 → tsc clean
- live canon URL probe       → 200 / matches expressionCount=15
- live MST + Shadow URL probe → 403 (expected, M-1+M-2 substrate pending)

Closes both open questions in PR #67. No blocking on @gumibera anymore;
post-merge work is purely substrate-side (M-1 bucket policy + M-2 gen
pipeline, both operator-driven).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.

1 participant