Skip to content

A word with candidates and no concept renders, not a 500 (#237 step 6's crawl) - #248

Merged
holden merged 2 commits into
mainfrom
claude/237-word-concept
Oct 9, 2026
Merged

holden merged 2 commits into
mainfrom
claude/237-word-concept

Conversation

@holden

@holden holden commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Found by #237 step 6's crawl of the published host: 22 exact-word pages (/words/:id/:slug) that published subject pages link answered 500.

Cause

Lexicon.WordPage gives a word with candidate links but no primary concept a thing whose concept is nil (empty_thing/0, by design: "a word whose every link is a 0.40 candidate has no thing to show and still has possibilities worth naming"). The headword component read @thing.concept.description unguarded and raised BadMapError. The same pages fail on 16554e9, before #244 and #246; the unguarded line dates from 0aaa25e (21 September) and empty_thing/0 from 30a1e8c (7 September), so this predates the release, and the crawl is what reached it. A word whose asserted senses are all below the floor (a disagreement with no candidate) reaches the same nil concept.

Change

  • DevilsDictionaryWeb.Word's quick definition requires a concept: :if={@thing && @thing.concept && @thing.concept.description}.
  • After the audit (S-1): WordPage.thing_provenance/2 asks for a Wikidata record and a concept: title only when the concept has a QID. A concept with no verified Wikidata item made ?provenance=thing, which the page links from its own provenance marks, raise ArgumentError.

Test

test/devils_dictionary_web/live/word_without_concept_test.exs, three tests at the exact-word page and the On page:

  • a word with one candidate and no concept renders 200 without the quick definition and with #may-refer-to, dead and connected; without the guard it fails with the crawl's BadMapError;
  • a word whose two asserted senses are below the floor renders;
  • a concept with no Wikidata item opens ?provenance=thing by request and by patch; without the guard it fails with ArgumentError.

Rebased onto main at 37cce5e. MIX_ENV=test MIX_TEST_PARTITION=_w237 DD_NO_OBAN=1 mix precommit at 3d6f82d: 19 doctests, 2,778 tests, 0 failures, exit 0. Nothing was written to devils_dictionary_v2; the reproduction on it was an in-process GET.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 34eda5ea-84b9-4e3b-a08e-d1db639c87ac

📥 Commits

Reviewing files that changed from the base of the PR and between 37cce5e and 3d6f82d.


📒 Files selected for processing (3)
  • lib/devils_dictionary/lexicon/word_page.ex
  • lib/devils_dictionary_web/components/word.ex
  • test/devils_dictionary_web/live/word_without_concept_test.exs

 __________________________________________________________
< Your TODOs are evolving. Soon they'll achieve sentience. >
 ----------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

holden and others added 2 commits October 9, 2026 21:42
…ut the one-line answer, not a 500 (#237 step 6's crawl)

`WordPage` gives a word with candidate links and no primary concept a thing whose `concept` is nil (`empty_thing/0`); the headword read `@thing.concept.description` unguarded and raised `BadMapError`. The crawl of the published host found 22 exact-word pages, linked from published subject pages, answering 500 for this, and the same pages fail on the code before #237. The quick definition now needs a concept. Tested at the exact word and its On page; the test fails without the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f failing; a disagreement with no concept renders (#237 step 6's crawl, after the audit)

- S-1: `WordPage.thing_provenance/2` built `"concept:" <> concept.qid`, and a concept with no verified Wikidata item has a nil QID, so `?provenance=thing`, which the page links from its own provenance marks, raised `ArgumentError`. It asks for a Wikidata record and a `concept:` title only when there is a QID. Tested at the exact word and the On page, by request and by patch; the test fails without the guard.
- N-2, N-3: a word whose two asserted senses are both below the floor (a disagreement with no concept, no candidate) renders at both addresses; the candidate test checks `#may-refer-to` dead and connected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@holden
holden force-pushed the claude/237-word-concept branch from 817862e to 3d6f82d Compare October 9, 2026 19:47
@holden

holden commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Audit and final-head check of PR #248 at 817862e: grade A−, 0 blocking findings

9 October 2026, 19:40Z. I audited the worktree on claude/237-word-concept at 817862e0144901b5bdd9ad4244e39cd919861318, which is also the GitHub PR head (a draft, base main recorded at 5ffd551, mergeable; CodeRabbit skipped the draft, GitGuardian green). git status was empty and HEAD was 817862e before and after. Every mix command ran with MIX_ENV=test MIX_TEST_PARTITION=_a237w DD_NO_OBAN=1 DD_DATABASE_PORT=5434; I never connected to 5432. The only migrations were the test alias's own, on my partition's test database. I did not read or touch devils_dictionary_v2, any devils_dictionary_237_* database, other worktrees, servers, LaunchAgents or ngrok. The mix precommit and mix phx.server processes running at the time were in the main checkout, not this worktree, and I left them alone. I committed, signed and stashed nothing, and I changed no file in the worktree. My probes were two files, test/a237w_probe_test.exs and test/a237w_noguard_probe_test.exs, copied in only while each ran and deleted after it. The no-guard probe loaded the base's version of DevilsDictionaryWeb.Word into its own test VM with Code.compile_file/1, so nothing on disk or in _build changed.

What I ran: git diff origin/main...HEAD, git show --stat 817862e, git log and git log -S on the guarded line, empty_thing/0 and thing_provenance/2; gh pr view 248 (body, state, checks); a read of word_page.ex (build/2, thing/3, empty_thing/0, put_article/4, provenance/2), Encyclopedia (primary_entity/2, links_for/2, candidates_for/2, view/1, qid/1), every reader of the page's thing in lib/ (components/word.ex, components/thing.ex, live/word_live.ex, head.ex, Discovery.target_for_page/3, Demo, Curation.Opening, Health.Pages); mix precommit; the PR's test alone; probe N (the PR's test against the base's component); probes P1 (states), P2 (the route, query and mode matrix, 750 rows), P3 (the headword component alone), P4 (a crawl of every same-host link on each probe page through the published host) and P5 (the curated-opening layout).

# Item How Result
1 Scope of the PR git diff origin/main...HEAD; git show --stat 817862e; git diff --name-only 5ffd551 origin/main Pass. One commit on 5ffd551 (the merge of #247). It changes two files, +41 and -1: the :if of #quick-definition in components/word.ex:105 gains @thing.concept &&, and test/devils_dictionary_web/live/word_without_concept_test.exs is new with one test. main has since moved to 37cce5e (the merge of #245), which touches three other files; the PR's two files are disjoint from them.
2a The cause Read WordPage.thing/3, empty_thing/0, Encyclopedia.primary_entity/2 and candidates_for/2; P1 Pass. thing(nil, ids, _) returns empty_thing() merged with the candidates whenever candidates_for/1 finds a may_refer_to or a disagreement, and empty_thing/0 has concept: nil. P1 built four such states, each with concept: nil: candidates only (oyster, seal, and love in P5), two sense mappings below the 0.7 floor (bat, a disagreement and no candidate), a noun that names nothing beside a verb that names two things (/on/bear, a disagreement), and a rejected asserted link beside a candidate (crane). The exact noun page of bear has no thing at all, and the exact verb page has a concept.
2b Every other reader of thing grep of thing.concept, @thing, page.thing, :thing and concept across lib/; each site read Pass. Only #quick-definition read a concept field unguarded. Thing.thing_panel/1 renders concept_card only :if={@thing.concept} and reads chain, kinds, article, disagreement and may_refer_to, all present in empty_thing/0. WordLive.discovered/1 reads thing[:concept], page_sources/4 reads thing.article and thing[:wikidata_source] and drops nils, WordPage.thing_provenance/2 has a concept: nil clause, and Health.Pages filters when not is_nil(concept). Head.word/2, Head.on/6 and JsonLd.page_graph/2 read the headword and cards, never the thing. Discovery.target_for_page/3, Demo.decorate/2, Demo.provenance/2 and Curation.Opening.for_page/2 do not read it either.
2c The matrix at 817862e P2: 15 pages (/on/:slug for 8 words, /words/:id/:slug for 9 lexemes) by up to 9 queries (none, ?trail=cat,dog, ?demo=1, ?provenance=thing, thing:1, thing:zz, ?opening=fixture, ?trail=cat&demo=1&provenance=thing, and ?provenance=card:<id> for each card) by 5 modes (internal by configuration; public; the published host wordhoard.test; the published host with a logged-in reviewer; a reviewer off the published host). Each row: a dead GET, a HEAD on the bare page, a connected live/2, and a render_patch to ?provenance=thing Pass for this PR. Every row for a page whose thing has concept: nil (candidates only, a disagreement with no concept, the rejected link with a candidate) answers 200 dead and mounts connected, in all five modes, with every query, and #quick-definition is absent. The concept with no description (cat) renders 200 with no quick definition and a concept card. The normal case (dog) renders the quick definition. The only failing rows, 90 of 750, are all one other state, a concept with no verified QID (quoll); see S-1.
2d The crawl and the other layout P4: every same-host href on each P2 page through the published host, fetched; P3: Word.headword/1 rendered with each page's thing; P5: love! with its one asserted link rejected and a candidate added, at /on/love?opening=fixture and its exact page, internal, public and published host Pass for this PR. P4 fetched 32 to 34 links from each of the 17 pages; the only non-200, non-redirect, non-404 answers are /on/quoll?provenance=thing and /words/:id/quoll?provenance=thing (S-1). P3 renders every state without raising, with the quick definition only for quoll and dog. P5 builds concept: nil with one may_refer_to; all six pages answer 200 dead and mount connected with #opening present and #quick-definition absent, so the floated layout's own Word.headword call is covered too.
3 The test fails without the guard Probe N: the base's components/word.ex (git show 5ffd551:…, which differs from HEAD's only at line 105) compiled into the test VM, then the PR's test file required unchanged Pass. The PR's test fails with ** (BadMapError) expected a map, got: nil at word.ex:105 in Word.headword/1, reached from Word.rail/1. At 817862e the same file passes alone (1 test, 0 failures, seed 546706) and inside precommit.
4 The PR body Each claim against the code, git log, release/crawl-on1.json, precommit-pr-word.out and the probes Pass, with N-1 to N-3. The change and the test path are as described. BadMapError without the guard is reproduced (item 3). The quotation from word_page.ex is exact. The line has been unguarded since 0aaa25e (21 September 2026) and empty_thing/0 dates from 30a1e8c (7 September), so "this predates the release" holds; the parenthesis about 16554e9 is imprecise (N-1). crawl-on1.json records "500": 22 among the link statuses, which matches the count; that all 22 are exact-word pages failing for this cause needs devils_dictionary_v2 and was not verified here. The author's precommit output at this head gives 19 doctests, 2,759 tests, 0 failures, exit 0, as mine does. The statement that nothing was written to v2 is the author's and was not verified.
5 mix precommit MIX_ENV=test MIX_TEST_PARTITION=_a237w DD_NO_OBAN=1 mix precommit at 817862e Pass. 19 doctests, 2,759 tests, 0 failures. Seed 60163, 397.8 s, exit 0. Nothing was printed before ExUnit started, so compile --warnings-as-errors reported no warning, and format and deps.unlock --unused changed nothing (git status empty afterwards). The 150 redefining module …Migrations… lines are runtime warnings from tests that load migrations; their number varies by run (121 in the author's run at this head, 116 on main after #247).

Findings

Blocking

None.

Should-fix

S-1. A word whose primary concept has no verified Wikidata QID answers 500 at ?provenance=thing, and the page links there itself. This is outside the PR's diff and predates it (7500a66, 7 September 2026), but it is the same class of failure the crawl is meant to clear, on the same pages. WordPage.thing_provenance/2 (word_page.ex:1340) builds ["concept:" <> concept.qid], and Encyclopedia.qid/1 returns nil for an entity with no verified wikidata identifier (a local entity, or one whose QID is still a candidate). The concept card's ⓘ (#thing-info) and the quick definition's ⓘ (#quick-definition-info) both link to ?provenance=thing. Failing input: link!(word!(ctx, "quoll", ~w(wordnet)), concept!(nil, "quoll", description: "a marsupial"), confidence: 0.95), then GET /on/quoll?provenance=thing or /words/:id/quoll?provenance=thing. Both raise ArgumentError (construction of binary failed … expected a binary but got: nil) dead, in all five modes, on and off the published host, and ?provenance=thing:1, thing:zz and the combined query do the same. Connected, the bare page mounts, and patching to ?provenance=thing crashes the LiveView. P4's crawl through the published host reaches it from the page's own links. I could not count such words in v2, which this audit may not read. Fix: guard the QID, for example titles = List.wrap(concept.qid && "concept:" <> concept.qid) ++ … and first_record("wikidata", List.wrap(concept.qid)), or a thing_provenance(%{thing: %{concept: %{qid: nil}}} = page, index) clause that cites only the article; and add the quoll case to the new test file. It can go in this PR or in the next one, before step 6's crawl is called clean.

Notes

N-1. "The same pages fail on the code before #237's stack (checked on 16554e9)" is imprecise. 16554e9 is the tip of claude/237-c9-proof. It descends from 09afba4 (#237 PR 1) and from the C1 commits through 335df4d (#243), so it is not code before #237's stack. It is before #244, #246 and #247, the commits that made the published host. The conclusion holds on firmer ground: the unguarded line comes from 0aaa25e (21 September) and empty_thing/0 from 30a1e8c (7 September). Fix: "The line has been unguarded since 0aaa25e (21 September); the same pages fail on 16554e9, before the published host's stack."

N-2. The Cause names one of four ways to reach concept: nil. The body says "a word with candidate links but no primary concept". P1 also reaches it with no candidate at all: two sense mappings below the 0.7 floor (bat, a disagreement), and an On page whose noun names nothing while its verb names two things (/on/bear). The fix covers all of them, and P2 renders each one 200. The test covers only the candidate state. Fix: say "a word with candidates or a disagreement but no primary concept", and optionally add the bat case to the test.

N-3. The test asserts less than the body says. "Renders 200 without the quick definition, dead and connected": the dead half asserts 200 and no #quick-definition; the connected half asserts only that live/2 mounts. P2 shows the connected render also has no quick definition. Neither half asserts that the page shows what it is for, the #may-refer-to list. Fix: in the loop, {:ok, view, _} = live(ctx.conn, path), then refute has_element?(view, "#quick-definition") and assert has_element?(view, "#may-refer-to-Q4").

N-4. The merge result is untested. main moved to 37cce5e after the PR was opened. The files are disjoint and GitHub reports the PR mergeable, so nothing is expected to change; this check ran on 817862e as asked.

Verdict. 817862e is one correct commit on 5ffd551. The one-line guard is the right fix and the only one this state needs: of every site that reads the word page's thing, only #quick-definition read the concept's fields without a nil guard. I built every state that yields concept: nil (candidates only, a disagreement with no concept, a noun naming nothing beside a verb naming two things, a rejected link beside a candidate) and rendered each at /words/:id/:slug and /on/:slug, dead and connected, with trails, the demo, the drawers and the curated opening, in internal and public reading, as a reviewer, and on the published host. None answers 500, and a crawl of their links through the published host finds nothing for this state. The PR's test fails without the guard with BadMapError at the guarded line and passes with it, and precommit passes with 19 doctests, 2,759 tests and 0 failures, as the author's run does. The body is accurate in substance; its 16554e9 parenthesis, its account of the cause and its description of the connected assertion are slightly off (N-1 to N-3). Nothing blocks. S-1 is a second, older 500 on the same pages, reached through their own ⓘ link when the primary concept has no verified QID; it is outside this diff and should be fixed here or in the next PR, before step 6's crawl is called clean. 817862e is fit to merge.

@holden

holden commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

The audit's S-1 and notes N-1 to N-4 are addressed at 3d6f82d

  • S-1. WordPage.thing_provenance/2 asks for a Wikidata record and a concept: title only when the concept has a QID. The audit's failing input (concept!(nil, "quoll", …) at 0.95, then ?provenance=thing) is a test, by request and by patch, at the exact word and the On page. It fails with ArgumentError without the guard.
  • N-1. The body now dates the unguarded line (0aaa25e) and empty_thing/0 (30a1e8c) instead of naming 16554e9 as "before Routing: everything left to close #194 — Stage 5 publication behind a feature flag, then the reviewer tool (after #224) #237".
  • N-2. A word whose two asserted senses are below the floor is a test.
  • N-3. The candidate test checks #may-refer-to dead and connected.
  • N-4. The branch is rebased onto main at 37cce5e, and precommit ran on the result: 19 doctests, 2,778 tests, 0 failures, exit 0.

@holden

holden commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Final-head check of PR #248 at 3d6f82d, after the A− audit of 817862e

9 October 2026, 20:05Z. I checked the worktree on claude/237-word-concept at 3d6f82df909a9617031554eaac2f29f0823d0e30, which is also the GitHub PR head (a draft, base main at 37cce5e, mergeable; CodeRabbit, which skipped the draft, and GitGuardian are green on this head). git status was empty and HEAD was 3d6f82d before and after. Every mix command ran with MIX_ENV=test MIX_TEST_PARTITION=_a237x DD_NO_OBAN=1 DD_DATABASE_PORT=5434; I never connected to 5432. The only migrations were the test alias's own, on my partition's test database. I did not read or touch devils_dictionary_v2, any devils_dictionary_237_* database, other worktrees, servers, LaunchAgents or ngrok. The mix phx.server running at the time was in the main checkout, not this worktree, and I left it alone. I committed, signed and stashed nothing, and I changed no tracked file. My probes were five files under test/ (a237x_noguard_probe_test.exs, a237x_probe_test.exs, a237x_mutant_probe_test.exs, a237x_probe2_test.exs, a237x_probe3_test.exs), each copied in only while it ran and deleted after it; none was present during precommit. The no-guard and mutant probes loaded other versions of DevilsDictionaryWeb.Word and Lexicon.WordPage into their own test VM with Code.compile_file/1, so nothing on disk or in _build changed.

What I ran: git fetch; git range-diff 5ffd551..817862e 37cce5e..3cf7f37; git show 3d6f82d, read whole; git diff 37cce5e 3d6f82d --stat; git log -S on the quick definition's line, empty_thing/0, provenance/2, parse_trail/1, the drawer's link id and its dedup key; the ancestry of 16554e9 against each merge since #241; gh pr view 248 (body, comments, checks) and the check runs of 3d6f82d; a read of WordPage.provenance/2, card_provenance/3, thing_provenance/2, first_record/2, drawer/6, raw_payload/1, concept_links/1 and thing/3, Encyclopedia.view/2, qid/1, link_views/1 and candidates_for/2, Demo.provenance/2, WordLive.handle_params/3 and provenance/2, Provenance.provenance/1, Thing.concept_card/1 and Health.Pages.thing_provenance/1; the PR's test file alone (3 tests, 0 failures); probe N (the PR's tests without their guards), probe M (a mutant), P1 (states), P2 (the matrix, 1,232 rows), P3 (a crawl), P4 (the drawer's content and links to things with no QID), P5 (array-shaped parameters); and mix precommit.

# Item How Result
1 Scope and the rebase git range-diff 5ffd551..817862e 37cce5e..3cf7f37; git show 3d6f82d; git diff 37cce5e 3d6f82d --stat Pass. The range-diff is 1: 817862e = 1: 3cf7f37: the audited commit came through the rebase unchanged. 3cf7f37's parent is 37cce5e, which is origin/main, and 3d6f82d's only parent is 3cf7f37. 3d6f82d changes two files: lib/devils_dictionary/lexicon/word_page.ex (+6 and -2, inside thing_provenance/2 only) and test/devils_dictionary_web/live/word_without_concept_test.exs (+35 and -1: two new tests and two new assertions in the first). Against main the PR touches three files, +81 and -3.
2a S-1: the code Read thing_provenance/2, first_record/2, drawer/6, Encyclopedia.view/2 and both callers of WordPage.provenance/2 (WordLive.provenance/2, Health.Pages.thing_provenance/1) Pass. qids = List.wrap(concept.qid) feeds both the concept: title and the Wikidata lookup, so a nil QID asks for neither, while the Wikipedia title and the panel's article record are still asked for. first_record/2 of [] is nil and is rejected. Encyclopedia.view/2 takes the QID only from a verified identifier, so a candidate QID is nil too. Health.Pages.thing_provenance/1 calls the same function and no longer raises on such a concept either.
2b S-1: the matrix P1 and P2: 12 states by 2 addresses (/words/:id/:slug, /on/:slug) by 4 modes (internal by configuration; public; the published host wordhoard.test; the published host with a logged-in reviewer) by 9 queries (provenance=thing, thing:1, thing:zz, thing:, thing:0:0, provenance=, trail=cat,dog&demo=1&provenance=thing, provenance[]=thing, provenance[a]=thing), plus card:<id> and card:<id>:9 for each card and demo=1&provenance=card:<sample> for both sample cards: 1,232 rows. Each row is a dead GET, a connected live/2 at the URL, and a live/2 at the bare page patched to the URL Pass. The states are the audit's input (no QID and no Wikipedia title, quoll); no QID with a title and a Wikipedia record under it; no QID with a title and no record; a candidate QID only; a verified QID with no record; no QID with an article; no QID and no label; no QID and no description; a QID with both records (the control); candidates only; two senses below the floor; and one sense below the floor. Every thing query on every state with a concept answers 200 dead, mounts connected and patches, with the drawer open, in all four modes. The drawer finds the title's record (1), the article's record (1), the control's two records (2), and none in the other concept states. The states with no concept answer 200 with no drawer. Every card and sample-card drawer opens. The only failing rows, 192, are the two array-shaped queries, on every state including the control and in every mode: an older, separate 500 (N-5).
2c S-1: the drawer with no record P4: the panel's HTML at /on/quoll?provenance=thing; P1 for the other states Pass, with N-4. The title is the concept's label (quoll). There is no source line and no raw block. #provenance-no-records says the thing has no record of its own, and #provenance-links lists its one link: an empty QID span, the label, then wiktionary_qid · 0.95 · needs_review. With no label as well, the title is empty. Two links to things with no QID share a DOM id, and two at the same confidence collapse into one row (N-4).
2d Other provenance and drawer paths grep of provenance= targets and drawer( in word_page.ex; every nil-able read in card_provenance/3, drawer/6, raw_payload/1, concept_links/1, Demo.provenance/2 and Provenance.provenance/1; P2; P3 Pass. drawer/6 has two callers, the card and the thing. The card's reads (card.source.name, groups, entries) are present on both card kinds. raw_payload(nil), stamp(nil), confidence(nil) and the :if on the source line are nil-safe, and link.qid and link.label are only interpolated. The page links ?provenance= from #thing-info, #quick-definition-info and each card's ⓘ, and P2 covers each target. P3 fetched every same-host link (32 to 40 per page) on each state's bare page and ?provenance=thing page, at both addresses, through the published host, internal and public: 144 pages, all 200, and every link answered 200, 301, 302, 404 or 410.
3 The new tests fail without their guards Probe N: the PR's test file, unchanged, against 37cce5e's components/word.ex, its word_page.ex, both, and neither. The patch half of the S-1 test run alone against 37cce5e's word_page.ex. Probe M: 3d6f82d's word_page.ex with one added clause, defp thing_provenance(%{thing: %{concept: %{qid: nil}}}, _index), do: nil Pass, with N-1. Neither: 3 tests, 0 failures. The base word.ex: the candidate test and the disagreement test fail with BadMapError at word.ex:105 in Word.headword/1, reached from Word.rail/1. The base word_page.ex: the S-1 test fails with ArgumentError (construction of binary failed) at word_page.ex:1340 in thing_provenance/2, at its dead request. Both: 3 failures. The patch half alone crashes the LiveView with badarg in thing_provenance/2 at both addresses. Probe M: all three tests pass with a word_page.ex that never opens the drawer for a concept with no QID (N-1).
4a The PR body Each claim against 3d6f82d, git log, the ancestry of 16554e9, release/crawl-on1.json, the probes and precommit-pr248-fixes.out Pass, with N-3. The quotation, the :if, the S-1 paragraph, the three tests and the rebase are as described. 0aaa25e (21 September) introduced the unguarded line and 30a1e8c (7 September) empty_thing/0. 16554e9 holds no commit of #244, #246 or #247 (it carries #242's and #243's work as pre-rebase commits), so "before #244 and #246" holds. crawl-on1.json records "500": 22 among the link statuses. "A word whose asserted senses are all below the floor ... reaches the same nil concept" holds only when they name two or more distinct things (N-3). That the 22 pages fail for this cause and fail on 16554e9, and that nothing was written to v2, need devils_dictionary_v2 and were not verified here. The precommit line matches the author's output (seed 335185, 19 doctests, 2,778 tests, 0 failures, exit 0) and mine (item 5).
4b The fixes comment (6088109214) Each bullet against 3d6f82d and the audit Pass, with N-2 and N-3. S-1 is true as stated. N-1: the body now dates the line and empty_thing/0 and no longer calls 16554e9 code before #237. N-2: the disagreement test exists, and the body's cause was widened only in part (N-3). N-3: the candidate test asserts #may-refer-to dead and connected; its connected half still does not refute #quick-definition (N-2). N-4: the branch is rebased onto 37cce5e, and precommit is as stated.
5 mix precommit MIX_ENV=test MIX_TEST_PARTITION=_a237x DD_NO_OBAN=1 mix precommit at 3d6f82d, with no probe file present Pass. 19 doctests, 2,778 tests, 0 failures. Seed 20595, 348.3 s, exit 0. Nothing was printed before ExUnit started, so compile --warnings-as-errors reported no warning, and format and deps.unlock --unused changed nothing (git status empty afterwards). The 121 redefining module …Migrations… lines are runtime warnings from tests that load migrations; the author's run at this head has the same 121. The count is the 2,775 tests of main after #245 (precommit-main-after-245.out) plus the PR's three.

Findings

Blocking

None.

Should-fix

None. The audit's S-1 is fixed in code and tested at both addresses, by request and by patch, and its test fails without the guard. The audit's notes N-1 to N-4 are addressed, two of them in part (N-2 and N-3 below).

Notes

N-1. The S-1 test does not assert that the drawer opens. Its name and the commit title say a concept with no Wikidata item "opens its provenance drawer". The dead half asserts only a 200, and the patch half only that render_patch/2 returns something. Probe M: with an added defp thing_provenance(%{thing: %{concept: %{qid: nil}}}, _index), do: nil, which leaves the concept's ⓘ opening nothing, all three tests pass and #provenance-panel is absent. Fix: in the loop, html = ctx.conn |> get(path <> "?provenance=thing") |> html_response(200) and assert html =~ ~s(id="provenance-panel"), then assert render_patch(view, path <> "?provenance=thing") =~ ~s(id="provenance-panel").

N-2. Two smaller gaps in the tests. The disagreement test checks its state only if page.thing, so if seal stopped reaching a nil concept, it would pass while testing nothing, and it never mounts connected. The candidate test's connected half asserts #may-refer-to but does not refute #quick-definition, which the body claims for both halves. The moduledoc still describes only a word with candidates. Fix: assert %{concept: nil, may_refer_to: [], disagreement: [_, _]} = page.thing; add {:ok, view, _} = live(ctx.conn, path) and refute has_element?(view, "#quick-definition") to both loops; and widen the moduledoc to the three states.

N-3. The body's cause and the title are looser than the change. "A word whose asserted senses are all below the floor (a disagreement with no candidate) reaches the same nil concept" is true only when the senses name two or more distinct things: in P1, narwhal, with one sense below the floor and no candidate, has no thing at all, and its pages render with no thing panel. The case of a noun that names nothing beside a verb that names two things (the audit's /on/bear) is still unnamed. The title names only the first fix. Fix: "A word has a thing with no concept when its only links are candidates, when its senses name two or more things and none at or above the floor, or when its noun names nothing while another part of speech names two things"; and a title such as "A word with no concept, or a concept with no Wikidata item, renders and opens its drawer, not a 500".

N-4. In the thing drawer, links to things with no QID share a DOM id and can collapse. The code predates the PR (7500a66), but this PR is what makes the drawer open when the primary concept has no QID. Provenance.provenance/1 gives each link row id="provenance-link-#{link.qid}-#{link.method}", and WordPage.concept_links/1 deduplicates on {qid, method, confidence, status}. P4: quokka, linked by wiktionary_qid to two things with no QID at 0.95 and 0.9, renders two rows with the same id provenance-link--wiktionary_qid; the dead render is 200, and live/2 raises Duplicate id found while testing LiveView. wombat, linked to two such things at 0.95, shows one row, and the second thing is missing from the drawer. A concept with neither label nor QID gets an empty title. None of this answers 500. Fix: add object_id: e.object_id to Encyclopedia.link_views/1's select, key both the row id and the dedup on link.qid || link.object_id, and fall back to the headword's lemma for the title.

N-5. Array-shaped query parameters answer 500 on every word and On page. ?provenance[]=thing and ?provenance[a]=thing raise FunctionClauseError in WordPage.provenance/2, which has no clause for a list or a map (since 7500a66), dead and connected, in every mode and for every state, the control included. P5: ?trail[]=cat raises the same way in String.split/3, from WordLive.parse_trail/1 (since aeedc85); ?demo[]=1 and ?opening[]=fixture answer 200. No page links such an address, and the crawl does not reach one. It is outside this PR. Fix: def provenance(_page, _ref), do: nil after the binary clause, and defp parse_trail(param) when not is_binary(param), do: [].

N-6. Carried over. That the 22 pages of crawl-on1.json fail for this cause, that they fail on 16554e9, and that nothing was written to devils_dictionary_v2 are the author's statements and were not verified here, as in the audit.

Verdict. 3d6f82d is the audited commit, unchanged by the rebase onto 37cce5e, and one fix commit on top of it. The fix closes the audit's S-1: thing_provenance/2 asks for a Wikidata record and a concept: title only when the concept has a verified QID. I opened ?provenance=thing (and thing:1, thing:zz, thing:, and the trail and demo combination) for a concept with no QID and no title, no QID with a title and a record, no QID with a title and no record, a candidate QID only, a verified QID with no record, no QID with an article, and no QID with no label or no description. I did it at /words/:id/:slug and /on/:slug, dead, connected and by patch, in internal and public reading, on the published host and as a reviewer there. Every row answers 200 with the drawer open, the drawer finds the records that exist and says so when there are none, and a crawl of every link on those pages finds no 500. No other provenance or drawer path reads a nil field in a way that raises. The three tests fail without their guards with the errors the body names and pass with them, and precommit passes with 19 doctests, 2,778 tests and 0 failures, as the author's run does. Nothing blocks and nothing is should-fix. The notes are test strength (the S-1 test would pass if the drawer stopped opening, N-1; a conditional state assertion, N-2), body wording (N-3), and two older defects outside the diff: links to things with no QID share a DOM id and can collapse in the drawer this PR now opens (N-4), and array-shaped provenance and trail parameters answer 500 on every word page (N-5). 3d6f82d is fit to merge. N-1 to N-3 can go in before or after merge, and N-4 and N-5 belong in a follow-up.

@holden

holden commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Merge basis, 9 October 2026: the final-head check of 3d6f82d found no blocking and no should-fix finding (comment above). Precommit at 3d6f82d, on main at 37cce5e: 19 doctests, 2,778 tests, 0 failures. Its notes go to the closing PR: N-1 and N-2 (the tests assert the drawer opens and the disagreement state), N-3 (wording), and N-5 (array-shaped provenance and trail parameters, a 500 no page links); N-4 (drawer rows for things with no QID sharing an id) is recorded as a known limit. Merging with a merge commit; the branch is kept.

@holden
holden marked this pull request as ready for review October 9, 2026 20:05
@holden
holden merged commit 85e180b into main Oct 9, 2026
2 checks passed
@holden

holden commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Merged as 85e180b. main there: MIX_ENV=test MIX_TEST_PARTITION=_m237 DD_NO_OBAN=1 mix precommit: 19 doctests, 2,778 tests, 0 failures, exit 0. The published host was restarted on it, and #237's final crawl through the tunnel found all 524 links on the 114 published pages answering 200.

holden added a commit that referenced this pull request Oct 9, 2026
…ytes; a list-shaped search is no search (#237 C8, after the audit)

The audit of 86b98d9 (grade B+, no blocking finding):

- S1, S7: the rule keeps the owner's 124 and 5 (a read-back) and reproduces 96 from the evidence; the widened run (571 records: 420 allocated, 109 deferred, 42 not addressed; its manifest would publish 405 and refuse 15) is recorded in the backfill document, which no longer calls it future work.
- S2: the HTTP table was run a second time keeping each request's own headers beside the response's (`on4`, `off2`, `on5`), with the same answers; the record says which run keeps what.
- S3: `/people/%zz` never reaches the server; ngrok's edge answers it. The application's 400 is shown by `/people/a%2Fb`.
- S4: the paced crawl's file lists `/connections/` links a prefix match flagged; the record says so.
- S5: where `ProxyGuard` sits, and that a development build without the published host still shows its debug pages before any plug: keep the tunnel off it (record, README, rollback).
- S6: the restore point is the post-release bundle `2026-10-09-v2-released` (MANIFEST `8247e0c9…1444`, verified), which holds the signing and the receipts; the step-0 bundle would drop them.
- S8: `PageMetadata.first_sentence/1` cuts at the regex's byte offset (`binary_part/3`), so accented letters before the full stop no longer move it. Tested.
- S9: `HomeLive` treats a `q` that is not a string as no search: `/?q[]=x` answered 500. Tested.
- Notes: 49 of the 51 allowed On pages are indexable; the provenance-drawer fix is credited to #248's audit; `--successors ,,` is `:successors_required`; the stage 1 restore sentence; 24 s, not 26; withdrawal has no task and registration is open on the published host (known limits).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
holden added a commit that referenced this pull request Oct 9, 2026
#237 C8, after the final check of 7cd4bd2)

- S-1: from the evidence alone the rule reproduces 96 of the owner's confirmations and all 5 of the owner's deferrals, and never confirms a record the owner deferred.
- S-2: `ProxyGuard`'s moduledoc says a draft-reading server that is not the published host refuses what reaches the plug, and that its development build's debug tooling answers first, so the tunnel is kept off it.
- Notes: the plugs before the guard; where the restore point is and that it has one copy; `--successors` with no ids is `:successors_required` in the task's moduledoc; the stage 1 sentence names the step-0 bundle; the second HTTP run's code (`85e180b`); the launch script's migration check fails open; #248 and #249 in the record's list of pull requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@holden
holden deleted the claude/237-word-concept branch November 7, 2026 12:04
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