Skip to content

A decision's mention does not link it to a test or a Markdown page - #224

Merged
zlareb1 merged 2 commits into
mainfrom
fix/decision-links-skip-tests
Nov 3, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
fix/decision-links-skip-tests

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

loom decisions extract no longer links a decision to a test file or a documentation page that happens to define one of its code names, so the pre-edit block shows the decision on the code it governs instead of on that test or page.

Why

The extractor resolves each code name a decision states with code.symbol and keeps the one defining file. The code index records definitions in tests (a mocked op's key in a dashboard test) and in prose files (a heading in a docs page) like any other. A decision naming a wire op therefore resolved to a frontend test that mocks the op, and the pre-edit block fired on edits of that test and never on the handler.

Measured on a private corpus of 60 real engineering documents across three components, over three extraction runs on main: 23 of 67 file links the extractor wrote (34%) pointed at a test file or a docs page: 21 at a dashboard test that mocks wire ops by name, 2 at a configuration reference page. The change drops exactly those 23 and adds none.

What changes

When only tests or Markdown pages define a code name (a file in a common test, mock or end-to-end directory, or named *.test.*, *.spec.*, *_test.* or after a test convention such as conftest.py or a Go mock; a heading in a .md, .markdown or .mdc page), the decision links nothing; the dry run says only a test or a page defines it and lists the name as unresolved (only tests or pages) for a human to add the code file, or as a setting when it is snake_case and a page documents it (also when a test fixture shares its name); a snake_case name only tests define is a helper and is not listed. The exact list is governs in server/memory/domain/decision_extract.py.

A name several files define, some of them code, stays unresolved: leaving tests out to pick the remaining code file was tried and measured on the same three runs, and every link it added (8, two names) was wrong, such as a product name resolving to a protocol definition file. So the change only removes links, never makes one; and a mixed name whose class-first pick lands on a test (a test class beside a code constructor) is unresolved too.

The test rule errs toward keeping a link: a test layout it does not list keeps its link to the test, as before. Code laid out like a test reads as one: a library under a test/ directory (a test framework's own code), a module named *_test (self_test.c) or kept under e2e/. Unlike the code index's is_test_unit_path, it does not take a module named test_* or *Test for a test, since source modules are named that way (test_gate.py), and a spec directory is code (a target-spec module, a protocol spec). Only Markdown counts as prose, because it is the only text format whose headings the index records as definitions; CMakeLists.txt and other text files it reads as code keep their links.

Scope and risk

  • Only the extractor's file pick changes. code.symbol, the code linker and memory.for_file are untouched.
  • A decision about a test or a docs page itself still gets that file when the document writes the path out (detect_value_files), as before.
  • Rows already written keep their files until the document is extracted again; a re-run revises the extractor's own rows that are not pinned or attested whose files changed.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none. Re-running loom decisions extract on a document corrects the files of its extracted rows that are not pinned or attested; a pinned or attested row, or one with a recorded outcome, is never re-recorded by a re-run, so its files are corrected by hand.
  • Rollback: rows re-extracted with this change keep the files it chose.

Tests

  • Unit: which paths a decision can govern (tests, a test directory, Go and dotted test names, a Markdown page out; a test_*.py source module, CMakeLists.txt and a header in); a dry run reports a name only a test or a page defines, labels a snake_case one a page defines a setting and one a test defines not, and leaves a name defined in a test and in code unresolved (tests/unit/test_decision_extract.py with the copy, link and contract gates). Full unit and analyzer suite on the head: 25949 passed, 22 skipped, 1 xfailed, 0 failed. make format lint clean; test_public_copy.py and test_doc_links.py pass.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. I checked the extraction logs of the corpus runs for every link the change drops.

🤖 Generated with Claude Code

@zlareb1
zlareb1 force-pushed the fix/decision-links-skip-tests branch 5 times, most recently from f5cce12 to 08dc9b6 Compare November 3, 2026 15:16
@zlareb1 zlareb1 changed the title A decision's mention does not link it to a test or a prose file A decision's mention does not link it to a test or a Markdown page Nov 3, 2026
@zlareb1
zlareb1 force-pushed the fix/decision-links-skip-tests branch 11 times, most recently from bf008d2 to ea0d063 Compare November 3, 2026 16:50
zlareb1 and others added 2 commits November 3, 2026 17:19
When only tests or Markdown pages define a decision's code name (a common
test, mock or end-to-end layout, or a heading), the extractor links
nothing, and the one-file pick never links a test or a page. A mocked op's
key in a dashboard test, or a heading in a docs page, resolved a
decision's code name to that file, so the pre-edit block showed the
decision on edits of the test and never on the code it governs. A name
several files define, some of them code, stays unresolved, so leaving
tests out never makes a link. The dry run says "only a test or a page
defines it" and lists the name as unresolved; a snake_case name a page
documents is reported as a setting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the fix/decision-links-skip-tests branch from 88c31e6 to f286ad4 Compare November 3, 2026 19:01
@zlareb1
zlareb1 merged commit 73a1755 into main Nov 3, 2026
22 checks passed
@zlareb1
zlareb1 deleted the fix/decision-links-skip-tests branch November 3, 2026 19:06
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
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