fix(amicode): superseded receipts render their captured diff, not the live view - #74
Merged
Merged
Conversation
…view
Spec-20260727-164748 §9.4 / plan task S1.
Kind membership in INLINE_KINDS was necessary AND sufficient for a receipt
to render the full entity view inline, and that view reads the LIVE problem
view rather than a snapshot at the receipt's own seq. Two defects followed:
1. N updates to one entity painted N identical copies of the present, so
the transcript looked like a history and carried none. This is the
repeating-formulation-card complaint.
2. The transcript fetches the globally-active problem with no ?slug=, and
~/.amico/problems/active is a single global file — so switching problems
mid-chat retroactively rewrote every earlier receipt to the new problem.
Adds receipt-currency.ts: a pure predicate for "is this receipt the current
state of the active problem", kept out of card.tsx so it is testable without
rendering. Only the current receipt renders live; the rest fall through to the
existing Chip, which already renders from the captured AMICODE_DIFF sentinel.
Deliberately permissive where currency is ambiguous — a kind with no events
yet stays live — preserving the original gate note's warning that a
record+update lands as two events but one receipt and the view can lag.
packages/ui: 336 pass (325 baseline + 11 new), tsgo --noEmit clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jack-champagne
force-pushed
the
fix/amicode-receipt-currency
branch
from
July 28, 2026 22:52
78ee045 to
7639a8f
Compare
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.
Fixes the repeating-formulation-card behaviour, and a worse bug hiding behind it.
The defect
INLINE_KINDSmembership was necessary and sufficient for a receipt to render the full entity view inline — and that view readsamicodeProblemView(), the live problem view, rather than a snapshot at the receipt's ownseq. Two consequences:message-timeline.tsxfetches the problem with no?slug=, and~/.amico/problems/activeis a single global file — so scrolling back to a GHZ formulation after switching to a transmon problem showed the transmon one.(2) matters more than (1) and is invisible until you hit it. It also breaks any future history-bearing card.
The fix
New pure module
receipt-currency.ts: is this receipt the current state of the active problem? Only the current one renders live; everything else falls through to the existingChip, which already renders from the capturedAMICODE_DIFFsentinel. Kept out ofcard.tsxso it is testable without rendering anything.Deliberately permissive where currency is ambiguous — a kind with no events yet stays live. The original gate note in
card.tsxwarns that "a record+update lands as two events but one receipt, and the view can lag a beat, so tighter gates hid the view entirely," and that warning still holds.Verification
packages/ui336 pass (325 baseline + 11 new),tsgo --noEmitclean. Rebased ontolocal/amicodeafter #65–#72; zero overlap with those files.Why this is separate from the warrant work
It is an independent defect fix with no dependency on the deliberation-layer feature branch, and with a hackathon coming it should be mergeable on its own. The feature work that builds on it is #feat/amicode-approval-surfaces.
Design context:
spec-20260727-164748-amicode-deliberation-layer-capability-warrants§9.4.🤖 Generated with Claude Code