Skip to content

fix(web): the logical note says what the lens was given, not just that it is empty - #140

Merged
lex00 merged 1 commit into
mainfrom
fix/logical-partial-projection-note
Aug 5, 2026
Merged

fix(web): the logical note says what the lens was given, not just that it is empty#140
lex00 merged 1 commit into
mainfrom
fix/logical-partial-projection-note

Conversation

@lex00

@lex00 lex00 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Ports the one thing #133 had that #139 — the version I merged — did not.

Recording the sequence plainly: #133 was open two days before I implemented #131. I didn't check for an existing PR, merged mine as #139, and put #133 into conflict. This recovers the part of it that was better rather than discarding it.

What was missing

#139 noted logical only when it projected zero nodes. The quiet failure is the partial one: a lens that keeps 1 of 11 renders a plausible-looking diagram of almost nothing, which reads as "this is your estate" rather than "no data". Empty at least reads as absence.

logicalKept is #133's logicalDegraded under a different name, with its threshold and both messages intact:

if (after > 0 && after * 3 >= before) return undefined;

Its reasoning is kept verbatim because it's the right reasoning — a note on every logical view would be noise, and noise is how a real signal stops being read. The * 3 cut-off is a judgement call and, as #133 put it, better argued with than inherited.

Wiring

Both logical call sites now count before projecting. notesFor takes the input count as optional and prefers it when present, so any caller that can't count keeps the empty-only check.

Verified

Live pure-k8s estate, source graph and live overlay:

logical projected nothing from 11 resources — it is a cloud-topology lens,
and this estate declares none of the kinds it nests (behold#74)

versus #139's flatter "logical is an AWS projection — no AWS resources in this estate". The count is what tells you the lens looked at something and rejected it.

462 tests (7 new), tsc and build clean.

After this

#133 has nothing left that isn't on main, so it should close as superseded — I'll do that once this lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_012n8PKN49z8c6jZVA9QYwvk

…t it is empty

Ported from #133, which had this and #139 -- the version I merged -- did not.
Recording that plainly: #133 was open first and I implemented #131 without
checking, so the better reading of this one case shipped second.

#139 noted logical only when it projected zero nodes. The quiet failure is the
partial one: a lens that keeps 1 of 11 renders a plausible-looking diagram of
almost nothing, which reads as "this is your estate" rather than "no data".
Empty at least reads as absence.

`logicalKept` is #133's function under a different name, threshold and message
intact. Its reasoning is kept verbatim because it is the right reasoning: a
note on every logical view would be noise, and noise is how a real signal stops
being read. The `* 3` cut-off is a judgement call and is better argued with
than inherited.

Both call sites now count before projecting, so the note can say what was
dropped. Callers that cannot count keep the empty-only check -- notesFor takes
the input count as optional and prefers it when present.

Verified against a live pure-k8s estate:

  logical projected nothing from 11 resources -- it is a cloud-topology lens,
  and this estate declares none of the kinds it nests (behold#74)

against #139's flatter "logical is an AWS projection -- no AWS resources in
this estate". The count is the part that tells you it looked at something.

462 tests (7 new), tsc and build clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012n8PKN49z8c6jZVA9QYwvk
@lex00
lex00 merged commit 172f343 into main Aug 5, 2026
1 check passed
@lex00
lex00 deleted the fix/logical-partial-projection-note branch August 5, 2026 04:26
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.

1 participant