Sign in to edit tickets from this page.

← all tickets · home

Remove _embed from the render pipeline

resolved 8d949ef3-6d47-47e8-bc8e-1356913b4639

created_at
2026-04-24
updated_at
2026-04-24
code_context
src/render.rs, src/views.rs
priority
P2
ticket_type
chore
resolved_at
2026-04-24
resolution
accepted

Body

MOTIVATION

_embed is a reserved top-level key in render payloads that drives a post-pass substitution: for each (needle, href) entry, wrap exact occurrences of the escaped needle in the rendered HTML body with <a href="...">. It was introduced in the web-UI feature commit (a119a23) when the universal renderer was designed to refuse any domain knowledge — the payload had to tell the renderer which strings were linkable.

That design is about to change. A follow-up ticket will introduce pattern-rule-based linking that teaches the linking layer the domain (turn_ref shapes, entity_id keys, world_slug grammar). Once pattern rules are in, _embed has zero remaining users: every link it produces today will be producible from rules instead.

Rather than build pattern rules on top of _embed as a fallback — lugging around two mechanisms doing overlapping work — we remove _embed first. The next ticket then builds pattern rules on a clean slate, with no "what do we do about the old thing" entanglement.

The project is young. There are no external consumers of the _embed payload shape. The only code that produces or consumes it lives in src/views.rs and src/render.rs respectively. No backwards compatibility to preserve.

================================================================ WHAT _embed DOES TODAY (AND WHAT REPLACES IT LATER)

Scope of _embed:

Who produces it today:

Who consumes it downstream:

The follow-up ticket will add centralized pattern rules with a LinkContext carrying world_slug, such that entity_id keys, turn_ref regex, and slug references become links wherever they appear. That supersedes _embed completely.

================================================================ THE RULE

After this ticket: _embed does not exist as a concept in the render pipeline. No payload-level substitution map. Pages still render; they just don't carry inline links to entity/turn pages during the window between this ticket and the pattern-rules ticket.

_links (the breadcrumb-strip reserved key) stays. It is position- semantic, not substitution-based, and has no overlap with pattern rules. Untouched.

================================================================ FILE-BY-FILE CHANGES

src/render.rs

Remove:

Keep:

Remove test cases (they assert _embed behavior that no longer exists):

Update module-level doc comment: remove the _embed bullet from the rules summary. _links remains the only reserved top-level key.

Update render_page's own doc comment to drop _embed mentions.

src/views.rs

In each of build_session_payload, build_turn_payload, and build_entity_payload:

Update the corresponding tests:

src/server.rs

No changes. The server handlers don't produce or consume _embed directly; they just pass payloads to render::render_page.

src/lib.rs

No changes.

Documentation comments

================================================================ ACCEPTANCE

================================================================ EXPLICITLY OUT OF SCOPE

================================================================ NO OPEN KNOBS

The work is narrow and prescriptive. The handler should not need to make any judgment calls. If a question arises during implementation, leave a comment on the ticket rather than guessing.

Proposed resolution

Done per spec, pure removal, verified in production.

Source changes

Kept intact:

Receipts

Commits (on main, pushed to gitlab):

Tests:

Deploy: bash k8s/deploy.sh clean; pod chukwa-549fdc756-rt8jd Running 1/1; watcher reconnected with orphans_killed 0 (new pod, no pre-existing shells); backlog surfaced this ticket as in_progress correctly.

Production smoke (live ant-verify world, turn 2):

Expected and called-out: temporary inline-link regression

Per the spec's "temporary regression" clause: for the window between this commit and the pattern-rules follow-up, HTML pages at /w/:slug/... render entity id and turn_ref values as plain text rather than hyperlinks. The breadcrumb _links bar at the top of each page still works (different reserved key, different mechanism). The follow-up ticket is expected to add centralized pattern rules with a LinkContext that produces the same links from domain knowledge, consuming the retained replace_exact_skipping_tags helper. I have not filed that follow-up ticket — that's your call, and the spec doesn't ask me to.

Handler notes flagged, not fixed

Per standing guidance I am not confirming this ticket — only proposing. Over to you.

History (8 events)

Sign in as a human to drive this ticket from the page, or use the MCP tools.