Skip to content

feat(batch): M3.3 slice 1 — readiness pass files gates as inbox rulings #671

Closed

Description

@Jammy2211

Overview

M3.3 slice 1 of the autonomous-orchestrators epic: a readiness pass, pyauto-brain batch ready, that walks queue.md, resolves each entry to its next startable unit, and files every gate it finds as a ruling in the PyAutoMind questions inbox. It runs at the end of every shift, so the next launch is brief --new, read, go, instead of a kick-off chat that finds each epic's next unit and asks rulings one at a time (shift 2026-11-16-pm cost about 26 min before and 85 min after).

Plan

  • PyAutoMind PR (merges first): a new inbox kind ruling with a required gate:, an optional issue:, a duplicate check by task and gate, and the answer wording for a ruling.
  • PyAutoBrain PR: _ready.py and the batch ready command (dry run by default; --queue <slot>, --apply, --fetch); finish_shift runs it and the digest ends "The next shift needs N rulings from you".
  • Rulings never hold or release a parked task; the inbox line leaves them out.
  • Witness: python -m pytest tests/test_batch_ready.py -q.
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)
  • PyAutoMind

Branch Survey

Repository Current Branch Dirty?
./organs/PyAutoBrain main clean
./organs/PyAutoMind main another session's batches/2026-11-16-pm.md (left alone)

Suggested branch: feature/shift-readiness-pass

Decisions (human, 2026-11-18)

  • D1: dry run by default; --queue <slot> puts ops in a slot ledger; --apply writes through questions_edit.py into the session-branch Mind checkout; never a direct push to main.
  • D2: the premise check is offline at shift end (_premise.check(fetch=False, offline=True)); --fetch on request.
  • D3: "no next-phase prompt" = an epic queued with no open Phase: member in draft/ or active/; the ledgers' free-form phase tables are not read.
  • D4: a tier change is not a gate; a judge unit gets a note.
  • Q5: one ruling per gate; looks-shipped and obsolete are checked first and stop the rest.

Implementation Steps

  1. Mind scripts/lifecycle.py: ruling in QUESTION_KINDS; a ruling needs gate: and doesn't need issue:.
  2. Mind scripts/questions_edit.py: entry_errors accepts a ruling with no issue; add_text skips a ruling when one for the same task and gate is still Open or Deferred; answer writes "ruling (, shift X): …".
  3. Mind questions.md: the header documents the kind and the field. Tests.
  4. Brain agents/conductors/batch/_ready.py: resolve the queue entries.
    • An epic ledger (Epic:, no Phase:) resolves to all open members at its lowest phase number (sorted by the leading number, as the planner does), scanning both draft/ and active/.
    • A member in active/ is in flight.
    • An epic with no open member gets the gate no-next-phase.
  5. Gates on each unit:
    • claimed: origin_claims / on_origin, read from Mind's local origin/main;
    • obsolete: the offline premise check;
    • unattended, human-required, blocked-by and looks-shipped: from pool_gate;
    • no-lane.
      Skip a ruling already Open or Deferred on Mind origin for the same task and gate.
  6. Mind-version guard: rulings are filed only when Mind origin/main's lifecycle.py lists ruling; otherwise the digest says they were not filed.
  7. _mind_writer.QUESTION_KEYS: add gate; issue is optional for kind: ruling.
  8. _questions.hold_for and answered_since skip rulings; inbox_line leaves them out.
  9. finish_shift runs the pass before _digest.build and records counters["rulings"]; the digest's last line is "The next shift needs N rulings from you" (new rulings plus Open and Deferred ones on origin, de-duplicated).
  10. One line each in skills/questions, skills/batch and AUTONOMY.md.

Key Files

  • agents/conductors/batch/_ready.py (new), _orchestrator.py (finish_shift), _digest.py, _questions.py, _mind_writer.py, _batch.py (the CLI verb)
  • Mind scripts/lifecycle.py, scripts/questions_edit.py, questions.md

Witness

python -m pytest tests/test_batch_ready.py -q: a fixture queue.md with one epic whose next phase has no prompt and one task on a claimed repo queues exactly two question-add ops, and the replayed digest ends "The next shift needs 2 rulings from you". The Brain test that runs Mind's real questions_edit.py skips until the Mind PR merges.

Original Prompt

Click to expand starting prompt

M3.3 Readiness pass and decisions sheet: one sheet before a shift, one after

Type: feature
Target: PyAutoBrain
Repos:

  • PyAutoBrain
  • PyAutoMind
    Difficulty: large
    Autonomy: supervised
    Priority: high
    Status: draft
    Filed: 2026-11-17
    Epic: autonomous-orchestrators
    Phase: 10
    Consequence: judge
    Witness: slice 1: python -m pytest tests/test_batch_ready.py -q passes, including a fixture queue.md with one epic whose next phase has no prompt and one task on a claimed repo, where pyauto-brain batch ready queues exactly two question-add ops and a replayed digest ends "The next shift needs 2 rulings from you"; slice 2: replaying the 2026-11-16-pm record through batch digest --record ends in one numbered decisions block that lists autolens_inference#70, euclid#133 and PyAutoBrain#654 awaiting /prm, the decision-taken flags, the set-aside writes and the late PyAutoGalaxy#720, and a test shows a worker-filed untested risk as an inbox entry in that block
    Lane: any
    Unattended: never

Why

Shift 2026-11-16-pm cost the human more time at its two ends than the 45 review-minutes it
was planned around.

  • Before: none of the three queued epics could run as queued. The kick-off chat asked
    four questions at 17:18Z and a second round at 17:46Z. likelihood-lifecycle 5A needed
    three rulings, hpc-campaign 5d needed a DR1 ruling and a tier change, and results-library
    5c needed a human sbatch. The chat spent 10 minutes and four subagents finding each
    epic's next unit.
  • After: decisions arrived one at a time in the cockpit chat from 19:54Z to 21:19Z: the
    defaults plan (asked 20:00Z, answered 20:24Z), the five risks on euclid#133 (20:39Z), a RAL
    test, a notes update and the last /prm (21:17Z). The euclid#133 worker listed five
    operational risks in the PR but filed no follow-up and asked no question; one needed a
    code change (euclid#135).

Human ruling R4 (2026-11-17): M3.3 is these two sheets.

What

Two slices, each its own PR.

Slice 1: the readiness pass (before).

  1. pyauto-brain batch ready walks queue.md and resolves each entry to its next startable
    unit: the epic's next phase, with its prompt filed.
  2. It runs the premise check and the claim check on each unit, and files every gate it finds
    (a missing prompt, a ruling, a tier change, a human-only step) as a ruling in the
    questions inbox through the one Mind writer.
  3. It runs at the end of every shift (from the digest step) and on request.
  4. The digest ends with "The next shift needs N rulings from you". The human clears them with
    /questions when it suits. Launching is then brief --new, read, go.

Slice 2: the decisions sheet (after).

  1. The digest ends with one numbered decisions block: every PR waiting for /prm, every
    decision-taken flag, every risk a worker listed, every set-aside write and every late
    arrival. The human answers in one message.
  2. A worker that lists a risk it cannot test files it as an inbox entry (worker contract in
    worker_template.md), so it is in the block when the human sits down.

Slice 2 may follow the M3.2 shift; slice 1 is built before it.

Out of scope

  • Answering the rulings: that stays the human's, through /questions.
  • Changing what the planner dispatches (M3.6b) or the carry-over step (M3.6c).
  • The HTML packet.

Activity

  1. Jammy2211 commented on Nov 18, 2026

    @Jammy2211
    ContributorAuthor

    Shipped (slice 1): PyAutoLabs/PyAutoMind#585 (the ruling inbox kind) and #674 (pyauto-brain batch ready), merged 2026-11-18.

    • The readiness pass runs at every shift end and on request.
    • The digest ends "The next shift needs N rulings from you."
    • After the human's L1 ruling, a gate ruled on once (answered or dropped) stays quiet.

    Slice 2 (the decisions sheet) is re-filed as its own draft prompt, draft/feature/pyautobrain/shift_decisions_sheet.md, and gets its own issue when started.

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