{"content":"fix(chain): fail-closed pin-reference format guard before every chain broadcast (commit 8fc3970d, branch fix/chain-pin-ref-guard)\n\nProblem: bots hallucinate pin references in chain-write payloads — truncated pinids, 64-hex values missing the i0 suffix, wrong characters. The 2026-11-08 AI training-sandbox write-preflight report counted 5+ malformed payloads caught only by human review and 1 that leaked on-chain as a permanent invalid record with the fee already burned. Invalid broadcasts are irreversible, so interception must happen chain-side before broadcast.\n\nFix: new chainPinRefGuard module scans every pin://, metafile:// and metaapp:// URI in readable payloads for the exact 64-lowercase-hex + i0 (66 chars) pinid contract, validates bare hex blobs under pin-named JSON fields (the reported coursePinId bug shape) and txid-named fields, and checks @pinId modify paths. Tolerant of sentence punctuation, deep-link suffixes, doc placeholders and prefixed schemes (preview-metaapp://); metaid:// is not a pin scheme; Buffer/base64/encrypted payloads are skipped.\n\nThe gate is wired at spawnCreatePinWorker — the single chokepoint shared by createPin (all networks: agent tools, RPC gateway, internal services) and createPinForIdentity — and throws an agent-readable BLOCKED message with fix guidance BEFORE the worker spawns, so a rejected write costs nothing.\n\nDefense in depth: the chainIdentifierPrompt verbatim rule now includes a write-time self-check section (reaches every cowork session and group-task turn); a compact PIN_REF_TOOL_RULE was appended to post_buzz / post_simplenote / omni_cast / post_metaprotocol / post_simplequestion / post_simpleanswer descriptions; a uniform 'Pin reference format (chain-write preflight)' section was added to the 10 chain-writing SKILL.md docs.\n\nVerification: 19 new guard tests including the report's exact bug shapes plus a source-contract drift guard on gate placement; full metaweb (257), mrc721 (152), metaidCore (90), tool/prompt (90), group/service (217) groups all green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}