Repository navigation
Description
Overview
The Cortex check-in scorer cannot see runs written outside output/ — and
instead of saying so it scores the task against whatever is newest under
output/, manufacturing a confident FAIL from an unrelated run. This violates
the door's own stated contract that "UNOBSERVABLE is not FAIL". On the
2026-09-09 check-in, eight of nine live tasks came back FAILED and none was an
actually failed run: euclid_dr1_prelim's ordered_mge_witness_102005065 and
ordered_mge_control_unordered_102005065 were both scored against a stale
phase-4 vis_pix directory belonging to a different tile while their real
completed results sat in output_ordered_witness/, and three
subhalo_validation tasks were scored against that same wrong directory.
Three defects, all in PyAutoBrain/agents/conductors/cortex/_cortex.py:
where_paths()keeps a bullet only ifp.is_absolute(). Every real task
writes its## Where to lookbullets relative to the project root, so the
resolved list is always empty in practice.where_paths()takes onlybullet.split()[0]as the candidate token. Real
bullets lead with a project-row label —`euclid_dr1_prelim` (project row): `output_ordered_witness/run_0/…`— so the first token is never the
path.run_artifacts()doesbases = list(where) or [r / "output" …]. With
whereempty it silently scores a stale, unrelated run directory, with no
signal to the reader that this is not the task's run.
The test fixture tests/_cortex_board.py writes absolute ## Where to look bullets, which is why the suite never caught any of this.
Plan
- Scan the whole
## Where to lookbullet for path-like tokens (backticked
spans, plus bare words containing/) instead of only its first token, so a
bullet that leads with a project-row label still yields its path. - Resolve a relative bullet against each of the project's roots (the mirror,
thenlocal_path) rather than discarding it for not being absolute. - When a task declares paths and none of them resolve, report no run at all
rather than falling back tooutput/— the run-dependent legs then read
UNOBSERVABLE and the task scores SUSPECT, not FAILED. - When the scorer does fall back (a task that names no path), say so on the run
line in the readout and in the wall leg, so a wall figure read from another
run is never presented as the task's own. - Cover all three with regression tests against the existing
boardfixture.
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoBrain | main (2 behind origin) | clean |
No worktree claim conflict (worktree_check_conflict cortex-scorer-where-paths PyAutoBrain → 0).
Suggested branch: feature/cortex-scorer-where-paths
Implementation Steps
-
New
_path_tokens(bullet)besidewhere_pathsin_cortex.py.
Candidates, in reading order, deduped: every backtick-delimited span (the
way task authors mark a path), then every whitespace token of what is left
that contains/. Drop a candidate containing whitespace,://, or a..
component (no escaping the root); strip trailing.,;:. A project-row label
such as`euclid_dr1_prelim`survives tokenising but is dropped by the
existence check in step 2. -
where_paths(mod, tk, roots)— for each token: absolute → keep if
_under()a root and exists (today's rule, unchanged); relative → try
root / tokenfor every root fromproject_roots(row), keeping each that
exists. Both roots may legitimately hold the same relative path; keep both. -
run_artifacts(roots, where, since, declared)— returns a 3-tuple
(run_dir, zip_path, source)and takesdeclared(did the task name any
path-like token at all):task declares resolves result paths yes bases = where,source="where"paths no (None, None, "unresolved")— no fallbacknothing — bases = output/dirs,source="fallback"run_dir is Nonealready sendsleg_wallandleg_checkpointto
UNOBSERVABLE, so a task with no discoverable run scores SUSPECT rather than
FAILED. Also register a base that is itself a.zip, which today's dir-only
walk misses. -
Say so in the readout.
score_task()carriesrun_sourceand the
unresolved declared tokens;member_block()'s "Where to look yourself"
section marks afallbackrun line as a fallback, and onunresolvednames
the declared paths that do not exist instead of printing another run's dir.
leg_wall()gainsfallback: bool = Falseand says so when the minutes came
fromsearch.summary(a wall figure read from the task's own.outis
unaffected). -
Regression tests in
tests/test_cortex_conductor.py, on the existing
boardfixture and_score()helper, each rewriting one task's## Where to looksection (there.subidiom already used by
test_a_task_that_names_nowhere_still_renders):- a relative bullet carrying a project-row label prefix still finds
<mirror>/output/searches/bright/aaaa1111and the wall leg PASSes (fails
on today's code); - declared paths that do not exist give
run_dir is None, wall and
checkpoint UNOBSERVABLE, health not FAILED, and a member block that names
the missing path rather than another run's dir; - a task naming no path still gets a fallback run, and both the member block
and the wall leg mark it as a fallback.
- a relative bullet carrying a project-row label prefix still finds
Key Files
PyAutoBrain/agents/conductors/cortex/_cortex.py—_path_tokens(new),
where_paths,run_artifacts,leg_wall,score_task,member_block.PyAutoBrain/tests/test_cortex_conductor.py— the three regression tests.PyAutoBrain/tests/_cortex_board.py— read-only here; its absolutewhere
bullets are what hid the bug.
Verification
python -m pytest PyAutoBrain/tests/test_cortex_conductor.py PyAutoBrain/tests/test_batch_kinds.py -q (the board fixture is shared), then a
dry pyauto-brain cortex checkin (no --apply) to confirm the real
euclid_dr1_prelim / subhalo_validation tasks stop scoring against the stale
phase-4 vis_pix directory.
Out of scope (adjacent, known — file separately)
voidinFAILED_RUN_STATEScounting a deliberately cancelled job as failed.find_logs()globbing every historical run stem, soleg_resumereads an old
job's.out.- The pull side (custom output roots are never pulled from) — its own draft,
draft/bug/pyautobrain/custom_output_roots_are_never_pulled_from.md.
Original Prompt
Click to expand starting prompt
Cortex scorer blind to runs outside output/ and fails them against…
Type: bug
Target: PyAutoBrain
Repos:
- PyAutoBrain
Difficulty: medium
Autonomy: safe
Priority: high
Status: formalised
Consequence: notify
Witness: a task whose "## Where to look" bullets name a relative path outside output/ is scored against that path, and a task with no discoverable run scores UNOBSERVABLE rather than FAIL; both covered by regression tests.
Review-minutes: 0
Unattended: ready
Cortex scorer blind to runs outside output/ and fails them against an unrelated run
Type: bug
Target: PyAutoBrain
Witness: a task whose "## Where to look" bullets name a relative path outside output/ is scored against that path, and a task with no discoverable run scores UNOBSERVABLE rather than FAIL; both covered by regression tests.
Science runs increasingly write to a custom PYAUTO_OUTPUT_DIR rather than output/. The Cortex check-in scorer cannot see those runs at all, and instead of saying so it scores the task against whatever is newest under output/ — manufacturing a confident FAIL from an unrelated run. This violates the door's own stated contract that "UNOBSERVABLE is not FAIL".
In PyAutoBrain/agents/conductors/cortex/_cortex.py:
-
where_paths() (~line 1640) resolves a task's "## Where to look" bullets but keeps a bullet only if p.is_absolute(). Every task writes these bullets relative to the project root (e.g. output_ordered_witness/run_0/...), so the resolved list is always empty in practice.
-
where_paths() also takes only bullet.split()[0] as the candidate path token. Real bullets lead with a project-row label, e.g. "
euclid_dr1_prelim(project row):output_ordered_witness/run_0/...", so the first token is not a path and the real path is never examined. -
run_artifacts() (~line 1666) then does
bases = list(where) or [r / "output" ...]and picks the newest .completed marker or zip under output/. Withwhereempty this scores a stale, unrelated run directory with no signal to the reader that the run being scored is not the task's run.
Observed on the 2026-09-09 check-in: euclid_dr1_prelim tasks ordered_mge_witness_102005065 and ordered_mge_control_unordered_102005065 both scored "witness FAIL" against a stale phase-4 vis_pix directory belonging to a different tile, while their real completed results sat in output_ordered_witness/. Three subhalo_validation tasks were scored against that same wrong directory. Eight of nine live tasks came back FAILED; none was an actually failed run.
Wanted:
(a) resolve relative Where-to-look bullets against the project root;
(b) scan the whole bullet for path-like tokens rather than only the first;
(c) when a task declares roots and they yield no run, report UNOBSERVABLE instead of falling back to output/ and scoring whatever is newest. Any fallback that changes which run is being scored must say so in the readout rather than presenting the result as the task's own run.
Activity
Jammy2211 commentedon Sep 9, 2026
Library PR opened: #371
Test evidence: full suite 939 passed / 1 failed in 6:12 (the one failure is a pre-existing worktree/symlink trap, unrelated to this change, and passes in the canonical checkout / CI). Ship-step re-run of the touched file (
tests/test_cortex_conductor.py): 93 passed, 1 failed (same known trap). Three new regression tests added, all fail against the pre-fix module.Heart is RED on five reasons, acknowledged by the human in-session as organism-scope (
PyAutoMind/active.mdheart-ack:line). Stopping at PR-open per policy — merge stays human.Jammy2211 commentedon Sep 9, 2026
Shipped
Merged in #371 (
ec354a7).What shipped — three defects in
agents/conductors/cortex/_cortex.py:where_pathsnow resolves relative## Where to lookbullets against the project's registered roots instead of discarding them.where_pathsscans the whole bullet for path-like tokens rather than onlybullet.split()[0], so label-prefixed bullets are seen.run_artifactsno longer silently falls back to the newest run underoutput/when a task's declared paths do not resolve — that state is UNOBSERVABLE, not a substitution, and any fallback that does still happen is labelled as one in both readouts.CI —
Brain Testsgreen on9f46175:pytest (3.12)andpytest (3.13)both success.Field evidence for the bug this fixes: on the 2026-09-09 check-in, eight of nine live tasks came back
FAILEDand not one was a failed run. Threesubhalo_validationtasks and botheuclid_dr1_prelimordered-MGE tasks were scored against the same stale phase-4vis_pixdirectory belonging to a different tile, while their real completed results sat inoutput_ordered_witness/.Not covered by this fix — the sibling gap is that a custom
PYAUTO_OUTPUT_DIRis never pulled to the laptop in the first place: each science project'shpc/synccarries its own hard-codedPULL_DIRS(three divergent forks:(output output_sed inspect),(output results),(output)), and bothpullandpull-fulliterate it. Filed separately asdraft/bug/pyautobrain/custom_output_roots_are_never_pulled_from.md.