Repository navigation
fix: serve the stated-host wildcard where the kernel has no IPv6 - #9
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The fix itself traces clean: the wildcard restatement is the only widening (bind != "::" keeps a derived v6 address refused, and page_access only ever writes :: from --host), socket.socket raises before TCPServer.__init__'s try block so the refused attempt leaks no fd, and an EADDRINUSE from the v4 fallback still carries the right errno up to cmd_serve's port scan, which walks to the next port. Bug-back reproduced here: with the fallback deleted, the new test fails with OSError: [Errno 97].
One finding, on the test. The literal-v6 assertion passes for the wrong reason on any machine that has IPv6 — which is where CLAUDE.md says a change lands: bind() on fd7a:115c:a1e0::1 raises EADDRNOTAVAIL there because the address isn't local (checked on this runner: errno 99), so a bare pytest.raises(OSError) is satisfied whether or not the fake kernel was ever consulted. It still catches the regression it was written against — widening the fallback to every v6 bind returns a server instead of raising — but it doesn't witness the bind != "::" arm the docstring says it does, which is the shape tests/CLAUDE.md opens on. Naming the errno costs one line, matches the match=-carrying idiom the rest of this file uses for refusals, and passes as written (verified).
|
CI note, not a finding against this diff: the |
|
Update on the red, since the branch moved and the failure changed with it. On 67dfb9d the Still nothing this diff can reach: the change is the server's bind family and |
A bare pytest.raises(OSError) is satisfied on a v6-capable machine by EADDRNOTAVAIL from an address local nowhere, so it says nothing about whether the fake kernel's family refusal was ever reached. Asserting EAFNOSUPPORT makes the assertion witness the bind != "::" arm it names: with the monkeypatch removed the test now fails with errno 99.
|
Closing the CI loop the two notes above left open: the branch has since been rebased onto 44d77e4, and on that head (61cdd8f) both Re-reviewed the rewritten head in full. The fix traces the same as before — |
The notification playground previously spent most of a short first viewport on repeated framing, and its configuration stopped at an instruction rather than proving the promised agent workflow. This change compacts the example around one question, gives the attention preset honest content, and makes the selected configuration describe a concrete local artifact and where its revision will appear. The integration test drives the existing request lifecycle end to end: a reader sends a configuration, the host picks it up, the agent writes and captures `deployment-notification.html`, the page exposes that source beneath the original configuration, and an anchored reader comment produces a second artifact revision with a receipt. The test also covers the replaceable configuration seat, source visibility, preserved anchoring, and the updated file contents. The catalog preview is refreshed at `max-sixty/leaf-assets@357127280030c3a81425483f1c44fc152d29c7c6`, and the completed #2, #4, #6, #8, #9, and #17 backlog entries are removed while preserving the deferred evaluation work. Verification: `uv run pytest tests` (944 passed), `uv run pre-commit run --all-files`, rendered light/dark and short-window checks, standalone export, and two context-blind Sol usability passes. > _This was written by Codex on behalf of max-sixty_
The Lit application arc between 2026-09-13 and 2026-09-17 closed #1 and #3 without the list recording it: `semantic-state.js` is 77 lines over one publisher and `application.js` holds no DOM reference, while `version.js` activates through one door returning one result that `state-application.js` adopts atomically. Both leave for git history. The largest remaining duplication was not on the list. `scripts/browser/application.ts` re-derives the Ask inventory, the winner resolution and each thread's `awaits_reader` from a wire that already carries all three, roughly 750 lines that arrived in #746; the two copies of the `when` predicate already disagree on an attribute recorded as `null`, and nothing compares them. That inverts #4, which asked for a corpus proving parity between the two implementations — built first it would police one that should go — so #4 now names the deletion and the corpus follows it. Three items are new. #25 is the Worker's second App Server client, whose reconnect backoff is written four times and has already drifted. #26 is the generated-hint machine that `go-to-sequence.js` and `target-chooser.js` each build. #27 is admission: six of the nine `append_event` callers check no contract, and of the three that do, `cmd_receipt` uses a validator `requests.py` defines itself, so the rules sit in two homes and the gate in three against a stated boundary of validating once at the edge. They take ids above #23 because `notes/workspace-followups.md` numbers its research #1 to #23 and the workspace section here draws from it, so #9 and #10 were already spoken for. The section now says where its ids come from rather than leaving the next writer to rediscover it. The items that stay keep their numbers and gain what the survey measured: how much of `margin-projection.js` is already free of the DOM, what fraction of the render suite drives no input, and the 53 capabilities `page.js` and `leaf.js` both name. #8 stops waiting for a change to prove the need, which has happened. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`notes/workspace-followups.md` has been presenting finished work as the plan since 9 September. It opens with "Start #2, #3 and #4 as one coordinated contract batch; run the review-queue simplification #8 alongside it" — all four of those shipped that week — and carries thirteen briefs, each with a live "Next task" and "Done when", for work `TODO.md` dropped as complete. This removes them and leaves the six `TODO.md` still links: #11, #14, #19, #20, #22 and #23. The trim follows the convention #666 set and the reason `CLAUDE.md` gives for it: a note is never a second specification for shipped behavior. #666 removed #6, #7, #16 and #17 the same way, rewriting the two `Owner / dependencies` lines in surviving briefs that named them; it simply did not reach the rest. Each removal is evidenced by the commit that took the item out of `TODO.md`, not by a reading of the current code: | Brief | Removed from `TODO.md` by | | --- | --- | | #1, #3, #5 | [`0f7f06a6`](0f7f06a) — "Completed workspace items #1, #3, and #5 are removed from `TODO.md`" | | #2, #4, #8, #9 | [`28b5da99`](28b5da9) — "the completed #2, #4, #6, #8, #9, and #17 backlog entries are removed while preserving the deferred evaluation work" | | #13, #15 | [`6df40353`](6df4035) — "closes three bounded workspace follow-ups" | | #10, #12 | [`c9eaa2c6`](c9eaa2c) — the continuation cue and the adaptive Threads placement | | #18, #21 | [`e46c8b93`](e46c8b9) — the monitoring workspace and its package-owned root | Alongside the briefs, three group headings are now empty and go; the `Suggested work packages` table loses the rows whose whole scope landed; and four cross-references that named a removed ID are rewritten — #14's dependency on the Threads-placement experiment, #20's ordering behind #8, and the two sentences in `Reproduction record` and `Browser evidence` that pointed at briefs no longer here. #14 needed more than a rewritten pointer. The experiment it waited on was settled in two steps, and only the first removed an ID: [PR #520](#520) kept the adaptive placement and deferred the modal-focus work to #24, which landed in [PR #536](#536) as inertness, dialog semantics and focus containment for a covering workspace. That is the surface #14 exists to verify, so its `Done when` — "Avoid imposing a modal focus trap on a nonmodal panel" — described the containment #536 shipped as the defect to avoid. It now states the containment the shipped modality requires, and the dependency line names both settlements. The dated evidence sections themselves stay. They are the record of what was read in a browser on 8 September, not a plan, and the note's own header scopes them to that date. No test covers `notes/`, and this changes no behavior, so there is nothing to regress. `pre-commit` passes on the file; the `TODO.md` → note anchors all still resolve, and no surviving text references a removed ID. --------- Co-authored-by: leaf-agent <[email protected]>
…hold (#3442) The TODO's trigger for deleting the early-key hold now needs every example to present in about 250 ms both on this Mac and under `leaf-dev probe --cpu-throttle 4`, where it used to need this Mac alone. This Mac is the fastest machine pages run on, so its reading alone would delete the hold exactly where it still helps: on a laptop a few times slower, keys pressed in the first half-second to two seconds would be lost. The throttled bar is also 250 ms because the bar is how soon a reader presses a key after a page appears, which is the same on any machine. A looser throttled bar near 1 s would add nothing: on 2026-10-19 the throttle multiplied each example's median by 3.7 to 4.3, so a page at 250 ms unthrottled already presents in about 1 s throttled. The entry also says how to take both readings: the median of five `uv run leaf-dev probe EXAMPLE` runs per example, with and without `--cpu-throttle 4`, reading `.startup.presented.at`. On 2026-10-20 one first load of `triage-board` read 385 ms unthrottled and 743 ms throttled, at a load average near 12. Max's decision #9 on the overnight report. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…iews fit their face Round five of the thread previews, from the review of 5eaac69. One hit (#11). A marked image or widget took the hand and opened its thread on a press, but showed no preview to a pointer or a finger: only a passage's hit reached the preview owner. `pointMark` now hands the owner whatever `markHit` found, a passage's piece or a range around the element marked, so the mark a press opens is the mark that previews, in both engines and under a Chromium finger. Passages across a shadow root (#12). One native Range can't hold a passage that runs into a declared shadow stage, since both its ends stand in one tree: the range from the first piece to the last collapsed onto the passage's end inside the stage, and the preview stood there. The preview owner is now told the piece the pointer came onto the thread's marks over, held while it stays on them, so the preview stands by the line first pointed at and stays as the pointer crosses pieces. The shared geometry reads a passage segment by segment (passages.js, `segmentLines` and `segmentsBox`): the resolved passage's box and attachment (resolved-target.js, `passageGeometry`), which the thread card, the comment box and anchoring read, the reading place's top, and page search's match boxes and hit test, where each read one range across the passage before. Crowded previews (#8). The thread lines were cut by a count read from the window's height once, which stayed as the window shrank under a standing preview. The preview now lists every thread's line, and the face, which the owner's round 5 holds to the room it stands in, clips them rather than scrolling (controls.css). A ResizeObserver on the face and the list counts the lines that fit and sets "and N more threads" after them; the rest stand after it out of sight, still laid out, so the face stays held at the room's size in both directions. With the owner's bound stood in for by a constructed sheet, the 32-thread entry's standing preview shows 32 lines at 900 px, 9 and "and 23 more threads" at 250 px, and 32 again back at 900 px, in Chromium and Firefox, and its face never scrolls. Threads rows (#9). A row in Threads previews its thread through `threadPreview`, as the thread's margin entry does: to the keyboard (`g`, Shift+T and the arrows), leaving out the word its state already says, to a resting pointer, and to a Chromium finger, whose release opens the thread. Rebuilds (E). Every presentation rebuilt each thread's ranges, the hit-test index and the `lf-mark` highlight: twenty builds for ten presentations that changed nothing, at 512 threads. A pass now keeps the last pass's marks of each thread whose marks it would make again, compared by the live ranges' bounds or the elements, and builds the index and highlight only when a mark or the order of the threads marked changed: none for those ten. Tests: - test_an_element_s_mark_is_under_the_pointer_only_over_the_element now holds the image's preview to a pointer, in both engines, and to a Chromium finger; - test_a_passage_running_into_a_shadow_tree_previews_by_the_line_pointed_at; - test_a_presentation_that_changes_no_mark_builds_none; - test_a_threads_row_previews_its_thread; - test_a_crowded_preview_counts_its_lines_again_as_its_room_changes, whose constructed sheet stands in for the owner's bound until its round 5 merges. The first two fail on 5eaac69's anchor paint in both engines; the third would count twenty. `preview_parts` reads a list of threads line by line.
…and the browser take a quote's copies alike Freshness at the read boundary (#7). A read returned placement as it stood, and settle returned before the watcher delivered the task's own changes, so the thread walk sorted a thread by a passage a script had since put back (it opened Alpha, below Beta), and a press in the task a script repeated a marked phrase opened its thread. Every read now settles first (`placedAt`, `pendingAt`, the hit test, a presentation), and settle takes the watcher's undelivered records (passages.js, `catchUpWords`). A view reading placement as it draws hears what changed after the script, so a draw changes nothing another has read. The eager settle for rewritten text stays, since no reader draws the page's marks: the browser paints live ranges the DOM moved. The hover frame's settle stays too: it runs before the frame asks whether anything is marked. What a quote's resolution reads, and how each reaches settle (#11): - the page's reading (words, edges, fences, tree order, each word's block): the index compares readings; registry vocabulary and settled slots now notify like any change; - text nodes a change wrote or took out, whose ranges moved and which may have moved into or out of a section at the same reading place: the index counts them changed wherever both readings hold them, which replaces placement's own set of rewritten threads; - the section, found by id: the watcher hears `id` (no change to the reading) and the ids of added and removed elements, and placement places again the threads naming those ids and those standing under an element whose own id changed. Swapping two sections' ids moved the cached placement nowhere; it now follows the id; - messages and the draft: application state, read by a presentation; - a datum's source, identity and revision attributes and draw report: the presentation that follows a widget's draw. The index's changes are versioned (`quotesChanged(since)`), so each reader asks for those since it last asked rather than draining one shared set. One rule for a quote's copies (#8). After a fence parted a copy, the browser looked for the next copy inside it, while the file looked past it, so `AA` in `<p>A<span contenteditable>AAA</span></p>` was the span's first two letters in the browser and its last two in the file. Both now take copies in order within the section, each one past the last, a fenced copy keeping its place and being no candidate, which is what the file and the browser before this branch did. tests/quote_cases.json holds both runtimes to nine cases (fences, overlaps, context, scope, edges, gaps, blocks). Keys that part strings sharing a long start (#9). The second key hashed a quote's first 256 letters, so 1,600 quotes sharing a paragraph's wording and differing at a numeric suffix read every one at each copy. It now hashes the whole quote, grouped by length, so a place costs a hash per distinct length among strings sharing its first 16 letters. `findEach` on 32/512/1,600 such strings: Chromium 1.1/58/543 to 1.1/5.9/14 ms, Firefox 1/17/86 to 2/13/34 ms. The first line across text nodes (#10). `passageStart` returned the first drawn segment's line alone, so a vertical-rl column whose opening `A` stood in a span left the column at y 765-1165 in a 900 px window. The line now runs on through the segments after it until a character stands on a later line, within one tree; a character drawn in no box stands on no later line. Unchanged against 8fa11f8 (Chromium): presentation of 1,600 marked passages 37 to 35 ms; edit 290 ms both; the 1,600-section edit 13.3 to 11.2 ms, move 2.0 to 1.6 ms; a far counter 4.1 to 4.0 ms a frame. Tests, each failing on 8fa11f8 in Chromium and Firefox: - test_the_thread_walk_reads_threads_where_a_script_left_them (#7); - test_a_press_in_the_task_a_script_repeats_a_marked_phrase_opens_nothing (#7), read once, since a later presentation hid the fault from a polling assertion; - test_a_quote_follows_its_section_s_id_to_another_element (#11); - test_travel_to_a_thread_shows_the_first_line_its_passage_draws[vertical-across-nodes] (#10). Runtime: anchor-placement.test.mjs compares placement with a fresh resolution after 2,000 seeded changes (words written, cut, repeated and restored, fences, id swaps and renames, wraps, moves, identical replacements), read in the changing task and after delivery; quote-cases.test.mjs and test_a_quote_resolves_where_the_browser_resolves_it run the shared cases; a `findEach` test bounds the reads of strings sharing a long start. Each runtime test fails on 8fa11f8.
…are found by one automaton; an inline edge is no gap between words The draft (#12). Placement tracked what a posted thread's anchor depends on and nothing of the draft's, so on a page with no threads yet a script that rewrote the paragraph around a sentence the user was commenting on took the draft's mark off the sentence until the next presentation, and `pendingAt()` returned the passage in the old, now disconnected node. The draft's anchor now stands among the threads' under a key no thread bears: its quote in the index, its section among the ids, its text nodes among those a rewrite settles at once. Placement tells those who hear it whether the draft moved, and the anchor paint repaints the draft's mark from `pendingAt()`. Ids in staged trees (#13). The watcher read the ids a change added or removed with a light-tree `querySelectorAll`, so a widget whose shadow stage held a section, replaced by one staged with the same section before it was put in place, left a section-only thread on the disconnected old element. Ids are now read in the light tree and the declared shadow trees an id is looked for in (`shadowRootsIn`, as `elementById` does). One automaton (#14). The index found copies by hashing each quote's first 16 letters and then its whole length, so at each place the first hash matched it tried every length the quotes sharing it came in: 800 quotes of growing length sharing a run of x's took 4.3 s in Chromium and 9.6 s in Firefox, about 8x per doubling. An Aho–Corasick automaton over the quotes' letters (`automatonOf`) now finds every copy of every quote in one pass, in time with the text, the quotes' total length and the copies found; the matcher reads each copy's words against the page and keeps the fence and context rules on top. No maintained dependency fits: the automaton is 70 lines and runs over a window of the page's letters that a dependency's string API doesn't take. The hash keys, their buckets and `keyStarts` go. `findEach`, Chromium then Firefox: - #9's shape, 1,600 quotes alike but for a number: 14.2 to 12.1 ms, 36 to 12 ms; - #14's shape, 400 and 800 quotes: 515 and 4,258 to 2.5 and 8.3 ms; 1,193 and 9,620 to 2 and 8 ms. The 1,600-mark page is unchanged: presentation 38.9 to 38.5 ms, edit 292 to 290 ms, startup presented at 1,281 to 1,238 ms. The 1,600-section page's edit varied 6.5-11.9 ms on de675ba and 6.5-13 ms here over three runs each; its move 1.2-1.8 against 1.4-1.8. Word gaps (#15). The raw reading held an edge between any two text nodes and a quote's gap matched one, so `one two`, rewritten as `<span>one</span><span>two</span>`, which reads `onetwo`, stayed marked in both browsers while the file's reading detaches it. The raw reading now holds a space wherever the reading reads one (a line break, a block's end: `readSegments`' rule), an edge only between inline elements, and a gap must hold whitespace: an edge may stand in a gap or inside a word, never be one. A quote across two blocks no longer runs their words together (`boldtext` over `bold` and `text` blocks), as in the file. Page search takes the same gap. tests/quote_cases.json gains both cases, a line break, and an inline-edge word. Of the gaps the review named, a line break and a block's end are spaces in both readings; `display: contents` and generated content are style, which neither reading reads. On the 25 example pages, 7,055 quotes captured across each pair of adjacent text nodes all resolve to their own words, or are repeated. Tests, each failing on de675ba in Chromium and Firefox: - test_a_draft_s_passage_keeps_its_mark_when_a_script_rewrites_around_it (#12), read once; - test_a_section_staged_again_in_a_new_widget_keeps_its_thread (#13); - test_words_a_script_sets_in_elements_of_their_own_run_together (#15). Runtime, each failing on de675ba: the seeded check now runs pages holding only a draft and stages filled before they are put in place, and checks the draft's placement and section-only threads after every change; two quote cases; and a `findEach` test that counts the automaton's lookups against the text and the strings' total length for both shapes. The raw-reading test now expects a space at a block's end.
…ing On Me under it (#6248) A `<strong>` now titles only an element the registry registers, such as an option or a card, and never makes a part. Before this, a bold line opening a paragraph, list item or cell named that element in the chrome's labels, link previews and On Me's groups, and `runsIntoLine` walked the markup after it to tell a title alone on its line from a run-in label. Both runtimes follow the new rule (`addressableName`, `gesture_words.element_name`, held together by `tests/name_cases.json`). The run-in machinery and its paragraph in `page-authoring.md` ("Markup") are deleted. The thread card's accessible name no longer reads its target's `<strong>`, and `addressableLabel` no longer borrows a descendant's `aria-label`. Worth weighing: examples that open list items with `<strong>Title</strong>…`, such as `ship-review`, now label those items by their words. A question inside `<li><strong>Canary</strong>…</li>` under `<h2>Rollout</h2>` groups in On Me under "Rollout" where it grouped under "Canary" (`leaf-dev probe --base`). Whether option titles stay `<strong>` is a separate open decision; this change leaves them as they were. `leading_title_node` now takes the registry, so the question-frame branch for survey item #9 (`question-section-frame`) needs that argument if it still calls it after this lands. Max ruled that Leaf should not infer meaning from authored markup and that a formatting element never carries data; this is survey item #11 on his design page. A separate Codex review of the commit found no regressions. Tests: `pnpm run test:runtime` (1000 pass), `pnpm run check:browser`, and the model tests for naming and question validation (102 pass). `test_the_shipped_long_thread_keeps_the_margin_and_its_height` fails on card width at main too. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude <[email protected]>
…s own revision Codex's second review of the bound-file source found these, numbered as it numbered them: - #1: a comment was admitted on a value its widget could never draw. `page check` now refuses an input of another contract than `text-document` that binds a bound file's id (`file-contract`, `data.bound_file_conflicts`), and the door refuses a datum comment naming the value a source holds now where that value holds an error or no input of the section reads its contract (`datum-undrawn-source`). A comment naming a value since replaced is admitted as before. - #3: the source missed a permission removal and a same-size rewrite that put the old modification time back, and its run didn't move. The page's news, the source's cache and its run now read one observation of a bound file, `file_bindings.observed`: its stamp and its change time. Adding the change time to `file_stamp` itself re-parsed revisions in two `test_interact_document` tests, since Leaf hard-links a revision's files and a link moves the change time, so it stays out of `file_stamp`. - #9: a clean editor opened before `leaf file bind` stayed at "No file is bound" until Retry. A failure now holds a file's reads only while it holds a draft or a save whose answer was lost. - #10: a comment recorded a digest of the source's value, which a new label moves. A bound file's source revision is now the first 16 digits of the file's own, the one a save names. Its run digests the observation, path and label, and the served state's tail now sends a source's value again when its revision or its run moves, so a new label reaches the tab. A publication rerun with the same value now sends that value again, where it sent only the run; the tail still sends nothing of the sources a write leaves alone. - #11: `leaf data clear` on a bound file's id deleted the publication behind it. It now refuses the id, as `set` does (`page_data._published`). The public site's first-visit state carried every granted file. It now holds the data the page's markup binds, through the export's filter (`markup_data`). `text-document`'s `revision` is an opaque non-empty string.
Problem
server run --host NAMErecords the dual-stack wildcard::as the bind, and the bind's:selectedDualStackHTTPServer, whoseaddress_familyisAF_INET6. On a kernel with IPv6 switched off the socket constructor raisesEAFNOSUPPORTbefore any bind is attempted, so the serve exits with the "that address came from the session that first served this page" message — whose two remedies are deletingaccess.jsonand re-running with--host, which is what the user just did. The recorded::persists, so every later bare serve of that page fails the same way.--hostis the only remedy the skill documents for a derived address the reader cannot reach, and the case that most needs it is a headless box, where the derived address is loopback and no browser is local.Solution
server_at(bind, port, handler)now opens the recorded bind in a family this kernel actually has: it restates the wildcard::as0.0.0.0— the same sentence, every interface, in the family that is left — whenAF_INET6is refused. Only the wildcard is restated; a literal v6 address keeps its refusal, since answering it with every interface would widen the exposure that record chose. The record keeps::either way: what a restart has to reproduce is the URL an open tab is polling, and that states the host and the port, so which family carried it is asked again on the next serve.Testing
test_the_stated_host_wildcard_binds_what_a_kernel_without_ipv6_hasfakes the kernel rather than the product —socket.socketraisesEAFNOSUPPORTforAF_INET6, exactly as the reported one does — then asserts the wildcard comes up on anAF_INETsocket bound to0.0.0.0and answers a real request, and that a literal v6 address still raises. Bug-back: with the fallback deleted the test fails withOSError: [Errno 97] Address family not supported by protocol, the issue's own error.uv run pytest tests/test_interact.pyis green (362 passed, 6 skipped);ruff checkandruff format --checkpass.The two suite tests that need a real IPv6 stack (
test_the_stated_host_wildcard_serves_both_families,test_others_ships_on_a_network_facing_bind_too) are unchanged and still need one — their fixture asks for the dual-stack socket on purpose, and[::1]reachability is what they assert.Closes #8 — automated triage