Skip to content

A widget item can't leave the page: version check refuses the drop and a suggestion can't wrap it #43

Closed

Description

@max-sixty

version check holds every id a published version carried, and only a settled widget's retirement licenses dropping one. lf-suggestion is the only family in the vocabulary that declares a retirement (lf-old retires under accept), so an accepted deletion is the one route by which words leave a page.

That route does not reach a widget item, because a suggestion cannot stand inside an items container.

Repro

v1 carries a metrics group with two items:

<lf-metrics id="k-set">
  <lf-metric id="k-visits" value="312" delta="+41" direction="up-good">daily visits</lf-metric>
  <lf-metric id="k-refills" value="2.1/wk" delta="+0.4" direction="up-bad">refills</lf-metric>
</lf-metrics>

Publish it. The reader comments on k-refills, the agent agrees the metric is measuring the refill round rather than the birds, and the reader resolves the thread. v2 drops the item:

✗ v2.html: 1 issue(s)
  - ids present in v1.html but dropped in v2.html (anchors on them will break): ['k-refills']

The resolution buys nothing: the rule refuses an id no comment ever anchored to just the same. Proposing the deletion instead:

<lf-metrics id="k-set">
  <lf-metric id="k-visits" value="312" delta="+41" direction="up-good">daily visits</lf-metric>
  <lf-suggestion id="sug-drop-refills">
    <lf-old><lf-metric id="k-refills" value="2.1/wk" delta="+0.4" direction="up-bad">refills</lf-metric></lf-old>
  </lf-suggestion>
</lf-metrics>
✗ v2.html: 2 issue(s)
  - <lf-metrics> (line 17): admits only ['lf-metric'] children, found ['lf-suggestion']
  - <lf-metric> (line 20): must be a direct child of <lf-metrics>, found <lf-old>

Two things pass, and both cost something:

  • Move the item into a <details> at the foot. The words stay on the page, now needing a line to explain why they are still there.
  • Wrap the whole group in a suggestion, rebuild it in lf-new under fresh ids, and drop the old ids once the reader accepts. This works, but every surviving item is re-idded, so the anchors break on the item nobody objected to. That is what the rule exists to protect.

Why it matters

A claim the page has retracted cannot leave it, so pages accumulate an archive of withdrawn claims. page-authoring.md asks for the opposite: drop the journey once the conclusion replaces it, and move concluded work to a Settled <details>. A withdrawn claim is not concluded work. It is a wrong turn the reader already rejected, and every version after it carries a sentence saying so.

lf-options has settled for the neighbouring case, and it keeps the words too: the record "keeps its ids and its anchors". Nothing covers an element being withdrawn.

Two shapes that would fix it

  • A resolved thread releases its anchor, so an id nothing unresolved points at may be dropped.
  • An explicit retirement the author states in the version. The id stays resolvable for the log and the comment panel; its words leave the page. The registry already carries this relation for a decided widget (x-retired-when, x-withdrawn-as), and the gap is the case where no widget was ever asked.

Seen on leaf 39d10ea.

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

Activity

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

    @leaf-agent
    Collaborator

    Reproduced both halves verbatim on cd5e8ca, including the part that reads as surprising: the resolved thread buys nothing, and neither does having no thread at all — dropping an uncommented <p id="lede"> from the same page is refused identically.

    The thing I'd want on the table before picking between the two shapes: a resolved thread already releases its anchor. retirable_ids hedges the unanswered-withdrawal path on anchored_ids, which is unresolved threads only. Same v2 file, byte for byte, withdrawing an undecided suggestion whose lf-new holds new-line:

    --- unresolved thread anchored in lf-new:
    ✗ v2.html: 1 issue(s)
      - ids present in v1.html but dropped in v2.html (anchors on them will break): ['new-line', 'sug-a']
    --- same version, thread now resolved:
    ✓ v2.html: parses, widgets validate, …
    

    So shape 1 isn't a new rule so much as that hedge moved one level up, to checking.py where gone - retirable_ids(…) is taken. What puts it out of reach of k-refills isn't the anchor rule — it's that the license is keyed to a retirement declaration, and lf-old/lf-new are the only tags in the merged vocabulary carrying one.

    Two things I'd weigh that the issue doesn't raise:

    The id rule is also the only gate on a dropped decision. Both restatement_errors and report_errors skip any unit a version lacks — "A unit either version lacks is id-survival's business, not this gate's" — so anchors are half of what that rule is holding. Stated as "an id nothing unresolved points at may be dropped", shape 1 lets an id carrying a standing action or a live report leave the page with nothing adjudicating it. The withdrawal path bounds that surface to one unanswered proposal's own half; the general rule widens it to every id on the page, so it likely wants the fold consulted beside anchored_ids, not anchored_ids alone.

    Shape 2 can't ride restated. Retraction floors are read off the new version's markup (retracts = sorted(parser.restated)), and a withdrawn element has no element there to carry an attribute — which is exactly why x-withdrawn-as is read off the previous version instead. The precedent for an assertion about a version its markup can't hold is version publish --completes plus the note's typed settles list ({kind, id} over report and work today); a third kind would sit in it directly. The wrinkle is that version check is what refuses the drop, and it runs both inside publish and standalone — so unlike --completes, whose seat check lives only in publish, this one has to reach cmd_check too.

    Worth noting the scope is the whole item vocabulary, not metrics. lf-suggestion declares no x-parent, so all nine x-content: items containers reject it, and the twelve tags that declare one (lf-card, lf-option, lf-tab, lf-milestone, lf-event, lf-variant, lf-chip, lf-note, lf-column, lf-metric, plus the two suggestion slots) can't be wrapped where they stand. Whichever shape lands is also what lets a card leave a board.

    I've stopped at the analysis rather than opening a PR — the choice between the two changes what the log contract promises a reader, and that's yours to make. Happy to implement either once you've picked one.

    Repro and notes

    Both halves, on a fresh page init at cd5e8ca, v1 published and the thread on k-refills resolved:

    $ leaf version check /tmp/repro43 --version 2
    ✗ v2.html: 1 issue(s)
      - ids present in v1.html but dropped in v2.html (anchors on them will break): ['k-refills']
    
    # suggestion-wrapped instead:
    ✗ v2.html: 2 issue(s)
      - <lf-metrics> (line 18): admits only ['lf-metric'] children, found ['lf-suggestion']
      - <lf-metric> (line 21): must be a direct child of <lf-metrics>, found <lf-old>
    

    The uncommented-id control: dropping <p id="lede">Two numbers from the week.</p>, which no thread ever touched, gives ids present in v1.html but dropped in v2.html … ['lede']. The rule is unconditional at checking.py#L200 — gone = prev.ids - parser.ids, minus only what a retirement licenses.

    The A/B above is a second page: v1 carries an undecided lf-suggestion with old-line in lf-old and new-line in lf-new; v2 withdraws the wrapper and keeps old-line. The only thing changing between the two runs is a leaf resolve --to on the thread anchored at new-line.

    Both container errors come from widget_errors — the x-parent check at L519 and the x-content: items admission at L543, whose allowed set is "tags declaring this one as x-parent".

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