Skip to content

Restructuring a page is blocked by dropped ids that no comment anchors #67

Closed

Description

@max-sixty

version check refuses a version that drops an id the previous one carried, unless a settled widget decision retires it. The error reads:

ids present in <prev> but dropped in <name> (anchors on them will break): [...]

It says that of every dropped id, and on a page of any size no thread anchors most of them.

What it costs

Rewriting three paragraphs into two leaves an id with no home, and the check will not say which ids are load-bearing. The safe move is to keep all of them, so the edit bends around that.

Twice on one page I renamed a replacement element to absorb a retired id. Once I added a table the page did not need, purely to carry an id whose paragraph I had merged away. The constraint made the page worse.

The machinery is already there

anchored_ids in events.py returns exactly "element ids an unresolved thread still points at", and retirable_ids already calls it. But only on one branch, to stop an unanswered widget being withdrawn out from under a live thread:

if not answered and (whole & anchored or not retires <= dropped):
    continue

So the set is computed and the semantics are already settled. The general drop rule just never asks it.

What I would expect

An id no unresolved thread anchors is droppable. The rest belong in the advisory tier version check already prints with a · prefix, alongside record_lag and unpointable_blocks: worth knowing, not a refusal.

Seen on leaf 5db3e8f.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    enhancement
    on Aug 27, 2026
  2. leaf-agent commented on Aug 27, 2026

    @leaf-agent
    Collaborator

    The mechanism works as you describe — I ran it. Swapping the license at checking.py:219 for gone - anchored_ids(events, enclosing_of(was)) lets an uncommented lf-diagram leave the page, and still refuses it the moment an unresolved thread anchors there. Nothing else in the static half objects.

    What anchored_ids alone under-covers: the id rule is also the only gate on a dropped decision. Both restatement_errors and report_errors skip any unit either version lacks, both carrying the same line — "A unit either version lacks is id-survival's business, not this gate's". So with the relaxation in, v1's lf-draft id="d1" carrying a standing edit can be deleted outright by v2 and the check passes, printing ids and decisions carried over while that edit is still in the log pointing at nothing. Same page, today: ids present in v1.html but dropped in v2.html … ['d1']. That is the reader decision CLAUDE.md's default is deliberately protecting, and it leaves silently — invisible to both sides, which is the property the restatement gate exists to deny.

    So the droppable set reads better as what nothing live points at: anchored_ids ∪ the units the standing action fold rests on ∪ the units standing reports rest on. That costs nothing at the call site — previous_projection is already built five lines above, and decisions(...) already reads it. A retracted or restated-away action is already absent from that fold, so the id it held becomes droppable on the version after the retraction, which is the behaviour you'd want anyway. Work claims need nothing: widget_work_without_seats already refuses a version that removes an active claim's seat, independent of this rule — the precedent for a per-consumer gate rather than a blanket id one.

    Two smaller things:

    • The advisory tier only prints on the ✓ path. checking.py:274 returns before the · lines. Demoting dropped ids there means the advice vanishes on any version that has some other error — which is exactly the restructuring version most likely to have one, so the lines want to move above that gate or print in both branches.
    • A widget item can't leave the page: version check refuses the drop and a suggestion can't wrap it #43 wants the same call site. Its "shape 1" is this rule, reached from the other direction (a widget item can't leave an x-content: items container because no retirement licenses it). Landing them as one change avoids the same predicate being written twice.

    Happy to implement the three-way union above — say the word, or say if a standing report's target should be advice rather than a refusal, since that's the one member of the set I'd guess at.

    Demonstration and notes

    Four cases on 6e655de, run against tests/interact_support.py's page_dir fixture with leaf.checking.retirable_ids monkeypatched to lambda holders, events, dropped, outcomes, spk: dropped - anchored_ids(events, enclosing_of(spk)) — the issue's rule exactly, licensing every unanchored dropped id.

    CURRENT (v2 drops <lf-diagram id="flow">, no thread anywhere):
    ✗ v2.html: 1 issue(s)
      - ids present in v1.html but dropped in v2.html (anchors on them will break): ['flow']
    
    RELAXED (same v2):
    ✓ v2.html: parses, widgets validate, one module script + theme link, ids and decisions carried over, nothing overflows the 720px column
    
    RELAXED, unresolved thread anchored at flow:
    ✗ v2.html: 1 issue(s)
      - ids present in v1.html but dropped in v2.html (anchors on them will break): ['flow']
    
    DECISION (v1 has <lf-draft id="d1">, user edit standing on it; v2 deletes d1) — today:
    ✗ v2.html: 1 issue(s)
      - ids present in v1.html but dropped in v2.html (anchors on them will break): ['d1']
    
    DECISION — relaxed:
    ✓ v2.html: parses, widgets validate, one module script + theme link, ids and decisions carried over, nothing overflows the 720px column
    STANDING ACTIONS ON d1 STILL IN LOG: [{'kind': 'action', 'author': 'user', 'version': 1, 'widget': 'd1', 'action': 'edit', 'detail': {'text': 'Cut the flag; backfill first.'}, …}]
    

    The decision fixture is interact_support._decided, which is what test_a_version_may_not_quietly_rewrite_what_the_user_decided drives — that test proves the rewrite path is gated; the delete path is gated only by the id rule, which is why relaxing it there is silent.

    Scratch file only; nothing committed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions