Skip to content

Remove code and declarations nothing reads: Atlas $work keys, lf-toc's lends, aim's destroy - #5720

Merged
max-sixty merged 3 commits into
mainfrom
nightly/dead-work-keys-stale-refs
Nov 9, 2026
Merged

max-sixty merged 3 commits into
mainfrom
nightly/dead-work-keys-stale-refs

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Removes declarations and branches nothing reads, found in the nightly survey. No behavior changes.

  • Atlas $work keys. lf-atlas-task in the command-hub example declared review, stalled and depends, and the work test fixture copied them. work.js reads only state, done, stopped and stoppedAt on a goal, which is also the set module-reading.md, "Work hierarchies", documents. A package author copying the worked example would copy three declarations that do nothing. review and stalled remain among the role's stopped values.
  • lf-toc's lends reading. It existed for the first-paint renderer that Use one browser rendering lifecycle and native document layout #4724 deleted. Every caller now passes true, so the !lends branch could not run. It is gone from toc-view.js, lf-toc.js and two runtime tests, and #reconcile now re-renders with the reading the drawing already holds, not a copy of it.
  • Uncalled or no-op code. createAim's destroy had no caller. The if (quoted(this)) return; at the end of lf-suggestion's setup() did nothing, so its comment moves to #offer(), the guard it describes. lfWatchPlatform.cancelLater had no reader. The go-to destination test kept a Threads ("T") branch that its parametrize no longer reaches.
  • Stale reference. The service schema's runtime description named hosting.payload_provenance, but the function is layer.payload_provenance. The protocol baseline carries the same annotation, which is not part of the comparison.

Verification: pnpm run test:runtime (906 pass) and pnpm run check:browser pass. leaf package check examples/command-hub.page reports no findings. Focused browser tests pass: test_render_work.py, six lf-toc tests in test_contents_and_glosses.py (outline, title groups, live reconcile, empty route, section marks, generated interface), the quoted-widget exhibit, the suggestion margin tests and test_the_reference_enters_named_go_to_destinations.

…r.payload_provenance

The Atlas example's lf-atlas-task role, and the work fixture's lf-test-task
copied from it, declared `review`, `stalled` and `depends`. `work.js` reads
only `state`, `done`, `stopped`, `stoppedAt` (and `running`, `retired`, `on`
for a worker), as module-reading.md "Work hierarchies" documents, so a package
author copying the worked example copied three declarations that do nothing.
`review` and `stalled` stay among the role's `stopped` values.

The service record's `runtime` description named `hosting.payload_provenance`;
the function is `layer.payload_provenance`, which hosting imports. The
protocol baseline carries the same annotation.

`lfWatchPlatform.cancelLater` had no reader in the tree.

No behavior changes.
…o-op return

`drawToc`'s `lends` reading let the deleted first-paint renderer
(`packages/default/initial/lf-toc.js`, removed in #4724) read the outline
without lending ids. Every caller since passes `true`, so the `!lends` branch
was unreachable; `lf-toc` also passed `#reconcile` a second copy of the reading
its constructor already holds. The stale "Delivery and live behavior call this
same template" comment goes with it.

`createAim`'s `destroy` had no caller (leaf.js mounts aim for the page's life).

`lf-suggestion`'s `setup()` ended on `if (quoted(this)) return;`, which did
nothing; `#offer()` is the guard, and its comment moves there.

No behavior changes.
…rametrizes

Its cases are M, P and V, so `suffix == "T"` never matched and the comment
still described Threads sharing the On Me branch. The test exercises the same
three destinations as before.
@max-sixty
max-sixty merged commit 7165c02 into main Nov 9, 2026
6 checks passed
@max-sixty
max-sixty deleted the nightly/dead-work-keys-stale-refs branch November 9, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants