Skip to content

feat(context): name the tests a call edge reaches, as a ready run_task filter - #647

Merged
atlas-from-plumb merged 7 commits into
mainfrom
atlas/context-named-tests
Oct 12, 2026
Merged

atlas-from-plumb merged 7 commits into
mainfrom
atlas/context-named-tests

Conversation

@atlas-from-plumb

Copy link
Copy Markdown
Collaborator

What

context_for_task's affected-tests estimate named only packages, e.g. ./internal/tools/... — 1808 test(s). In a directed-use study every agent then wrote its own -run filter or ran the whole package. Test runs were the slowest step of their loop, about 20 per six runs.

Since #640/#646 resolve same-package calls, a test that calls a seed is reached by a real call edge. That tells it apart from a test that only sits in the package. Under a package row, one line now names up to 8 of those tests, as a ready run_task call:

  ./internal/tools/... — 1808 test(s); holds a seed
    run first: run_task(slot:"test", target:"./internal/tools/...", run:"^TestMoveSymbol_(AllowsMoveBetweenSameGOOSFiles|…|RefusesCommentVsFilenameAsymmetry)$") — 8 of 16 test(s) that call a seed or a declaration next to one, directly or through callers (index call edges); 8 more are not named
  • What is named: only Test/Example/Fuzz functions that go test -run selects, and only tests reached by an edge. Co-located tests are counted, never named.
  • Order: tests that run a seed come first, then tests reached only through a callee or sibling of it (marked Aside). Within each group, fewest hops first, then name.
    • Neighbours walk one hop out, callers of a seed first, so the order does not depend on the pack's ranking.
  • The filter: it writes the common prefix once and is cut to what validateRunFilter accepts. The rest is counted.
  • Stale index: names none. The package rows stay.
  • Pack budget: the line is classAffected at prioAffected, so it never displaces a body or a top related entry.
  • Unchanged: the rows themselves, and topology_affected's own rendering (fields only).

Measured

On the #571 task (base 8ac6b43, seed buildMovePlans, intent change, 32k):

  • The line names 8 of 16 tests, all TestMoveSymbol_*. That is exactly what the study's agent picked by hand (-run 'MoveSymbol').
  • The first cut named tests of a callee first (TestApplyTextEdits_*). That led to the Aside ranking.
  • The pack grows from 27,162 to 27,623 bytes, and a diff of the two packs shows only the added line.

Tests

  • C07 (the oracle case pinning "one row per package"): the rows are unchanged, plus the exact run-first line.
  • Edge-only naming: C01's cart tests reach the seed only through a name match, so none are named. C02's pricing test is reached by an edge and is named.
  • No Go target: the line gives the names only.
  • Unit rules: runnable names, dedupe, caps, stale, order; the filter fit against validateRunFilter; runFilterFor checked with Go's regexp in both directions, including a rune-split prefix; betterPath; inwardHops; the neighbours' walk order.
  • End to end: a 6-test fixture over a real index, whose names make each wiring decision reorder the line when it is wrong.

Review and verification

  • Review: an independent peer review (warm-cobra) returned CONTINUE, with no blocking findings. Its three spot mutants were all killed. Its NIT ("through one caller") is folded in.
  • Mutation (plumb mutation_test): every valid mutant is killed except one, the stale-index argument at the call site. No fixture drives a live store to "stopped"; the stale rule itself is unit-pinned. Survivors on earlier passes led to the end-to-end fixture and the walk-order test.
  • GOWORK=off make verify-full: green except internal/quality/golangcilint. That package collided with another session's golangci-lint ("parallel golangci-lint is running"), and it passes alone on a re-run. A clean re-run of verify-full is noted in the comments.

Part of PLAN-543 (directed use on real bugs), following the arm D finding that the pack was paid for twice.

🤖 Generated with Claude Code

atlas-from-plumb and others added 7 commits October 12, 2026 21:58
…k filter

The affected-tests estimate named packages only (e.g. "./internal/tools/...
1808 test(s)"), so every agent in the PLAN-543 arm D study hand-built its own
-run filter or ran the whole package. Since #640/#646 resolve same-package
calls, a test that calls a seed is reached by a real call edge, which tells
it apart from a test that merely sits in the package.

Under a package row, one line now names up to 8 of those edge-reached tests
(Test/Example/Fuzz only), closest first by hop count then name, with the
rest counted. With a Go package target it is a run_task call whose filter
passes validateRunFilter. Co-located tests are never named; a stale index
names none. The rows themselves are unchanged, and nothing claims a run.

topology_affected's gather records each test's fewest hops from a root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
…per filter

Measured on the #571 task (seed buildMovePlans, base 8ac6b43), the first
cut named TestApplyTextEdits_* and TestOffsetForPosition ahead of the
TestMoveSymbol_* tests the arm D agent actually ran: tests of a CALLEE of
the seed scored 1 hop from that neighbour, though they never run the seed.

- Neighbours are walked one hop out (collectAffectedNear), and a neighbour
  that is not a caller of a seed marks its tests Aside; Aside tests rank
  after every test that runs a seed. A test reached twice keeps the better
  path (betterPath, with inwardHops in topology_affected_paths.go).
- runFilterFor writes the names' common prefix once
  (^TestMoveSymbol_(Refusals|...)$), so 8 names fit run_task's limit
  where 5 did.

#571 now: 8 of 16, all TestMoveSymbol_*; the pack grows by one line
(27,162 -> 27,623 bytes) and nothing else in it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
Mutation left the gather's wiring unasserted (the one-hop offset for a
neighbour, the aside mark, which neighbours count as callers, the second
path to a test). A five-test fixture around one seed fixes the order each
of them decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
… order

The walk order of the seeds' neighbours came from the pack's ranking, so
whether a test was first recorded through a callee (aside) or through a
caller of the seed depended on that ranking. Neighbours now walk callers
first, then by name: a path that runs the change is always recorded
first, and betterPath only compares paths of the same kind.

The fixture is rebuilt so that each wiring decision (the one-hop start, the
aside mark, the caller test, the shorter second path) reorders the line
when it is wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger
Review NIT (warm-cobra): a test reached through a caller of the seed can be
two or more callers away, so the line says "through callers".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: scarlet-badger

@golimpio golimpio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved under the owner's standing delegation. Bar met on head 2bcfa1d: independent peer review (warm-cobra) CONTINUE with no BLOCKING and its spot mutants killed; plumb mutation_test with every valid mutant killed (one disclosed residual); GOWORK=off make verify-full exit 0 read from its exit file, not dirty; CI 9/9 SUCCESS.

@atlas-from-plumb
atlas-from-plumb merged commit 4fca041 into main Oct 12, 2026
9 checks passed
atlas-from-plumb added a commit that referenced this pull request Oct 14, 2026
)

* docs(site): name context_for_task in the Map card, as experimental

The site counted context_for_task in "Sixty structured tools" and in Map ×9
but never named it. The Map card now lists it and says, in one sentence
backed by the 0.24.1 CHANGELOG entries, what the pack carries: the seeds'
code, callers and related declarations, the tests that reach them (#647),
whether a Go caller list is complete (#648/#651), and a note while the
index is still on its first pass (#668).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: forest-ridge

* docs(site): keep "in milliseconds" off context_for_task; state its 2 s deadline

Review of #669: the new sentence followed "in milliseconds" and could read as
covered by it, but the pack's graph walk runs under a 2 s deadline
(docs/tools.md § context_for_task). Name it as a separate call, and say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plumb-Session: forest-ridge

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@golimpio
golimpio deleted the atlas/context-named-tests branch October 15, 2026 00:07
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