Skip to content

fix: batch claim gate counts Target: as a repo when Repos: is declared #675

Closed

Description

@Jammy2211

Overview

declared_repos() in agents/conductors/batch/_batch.py always unions a prompt's Target: into its repo set, even when the prompt declares an explicit Repos: header. Target: is often only an epic label, so the batch claim gate (_held_for) reports false "claimed" conflicts: on 2026-11-18 readiness ruling Q8 blocked results_library_p5c_dr1_census (Repos: PyAutoCortex, Target: autofit) on a PyAutoFit claim held by ep-projected-model-shared-prior. It was worked around with a coordination line; this fixes the cause.

Plan

  • When a prompt's Repos: names known repos, declared_repos() returns those alone.
  • When Repos: is absent or names no known repo, keep the fallback: Target:, then the survey repos.
  • That fixes every claim-gate caller (readiness pass, origin check, named-task check), since they all read declared_repos.
  • Leave _premise.declared_repos as it is: it chooses where to look for premise evidence, where an extra repo is harmless.
  • Add regression tests; run the batch/readiness suites, then the full suite.
  • Tier + merge mode: effective level: supervised; merge mode: auto-merge on green (declared Consequence: notify).
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)

Branch Survey

Repository Current Branch Dirty?
./PyAutoBrain main clean

Suggested branch: feature/batch-claim-gate-declared-repos

Implementation Steps

  1. agents/conductors/batch/_batch.py:119 declared_repos(p): collect known repos from the Repos: block; return them sorted if any; otherwise add Target: if it is a known repo and return that, else p["repos"]. Update the docstring (Target is often an epic label).
  2. Regression tests (tests/test_batch_ready.py or new tests/test_batch_declared_repos.py): (a) Target: autofit + Repos: PyAutoCortex only → PyAutoCortex alone; (b) orch._held_for against an active.md claiming PyAutoFit → None for that prompt; (c) no Repos: → still its Target; (d) Repos: naming only unknown names → falls back to Target.
  3. pytest tests/test_batch_*.py tests/test_questions_inbox.py tests/test_m31_live_shift_findings.py tests/test_premise_check.py, then the full suite. An existing test that relied on the union is changed only if its premise was wrong; otherwise stop and report.
  4. Ship via /ship_library, auto-merge on green.

Key Files

  • agents/conductors/batch/_batch.py — declared_repos
  • agents/conductors/batch/_ready.py:340, agents/conductors/batch/_orchestrator.py:1604,1628 — callers (unchanged)
  • agents/conductors/batch/_premise.py:98 — separate helper, left unchanged

Original Prompt

Click to expand starting prompt

Batch claim gate counts a prompt's Target: as a repo even when Repos: is declared

Type: bug
Target: PyAutoBrain
Repos:

  • PyAutoBrain
    Difficulty: medium
    Autonomy: safe
    Priority: high
    Status: formalised
    Consequence: notify
    Witness: a new test in PyAutoBrain tests/ passes where declared_repos on a prompt with Target: autofit and a Repos: block naming only PyAutoCortex returns ["PyAutoCortex"] and _held_for against an active.md claiming PyAutoFit returns None; a prompt with no Repos: still returns its Target; the full batch test suite passes
    Review-minutes: 0
    Unattended: ready
    Lane: any

Bug

declared_repos() (agents/conductors/batch/_batch.py:119) builds a prompt's repo
set from its Repos: header and its Target:, always unioned. Target: is
often only an epic grouping, not a repo the task edits. Example:
draft/feature/autofit/results_library_p5c_dr1_census.md has Target: autofit
but Repos: lists only PyAutoCortex (the census is read-only on RAL against the
released stack and writes one Cortex ledger line).

The claim gate (_held_for, called from _ready.py:340 and
_orchestrator.py:1604 / :1628) therefore treated the census as a PyAutoFit
task. The readiness pass ready-2026-11-18 filed ruling Q8: "results_library_p5c_dr1_census
cannot start: repo PyAutoFit is claimed by ep-projected-model-shared-prior".
The human resolved it on 2026-11-18 by adding a coordination line to that claim
in active.md. That is a workaround; the false conflict recurs for any task
whose Target is an epic label.

Fix

  • When a prompt declares a Repos: header with at least one known repo, use it
    alone. Fall back to Target:, then the survey repos, only when Repos: is
    absent (or names no known repo).
  • Check the other callers of declared_repos (batch grading, lanes, premise,
    _orchestrator.py:1604) still behave; _premise.declared_repos is a separate
    helper, confirm whether it has the same union.
  • Regression test: a prompt with Target: autofit and Repos: PyAutoCortex
    is not held by a PyAutoFit claim; a prompt with no Repos: still falls back to
    its Target.
  • Optional, once fixed: the Q8 coordination line on
    ep-projected-model-shared-prior in active.md becomes redundant; leave it
    (it is harmless and the claim clears when that task ships).

Activity

  1. Jammy2211 commented on Nov 18, 2026

    @Jammy2211
    ContributorAuthor

    Shipped in #676 (merged). declared_repos() now uses a declared Repos: block alone; Target:, then survey repos, are fallbacks only. Regression tests in tests/test_batch_declared_repos.py (5 passing, full suite 2370 passed). CI's tenant-firewall lint flagged an instance repo name in the first test draft; tests now use organ names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions