Skip to content

feat: shift watcher 60 s tick, early close, decision-taken refused at PR-open (M3.7c) #690

Closed

Description

@Jammy2211

Overview

M3.7c of the autonomous-orchestrators epic (phase 10, "M3.7 Shift speed"). Ruling S7 (human, 2026-11-19) plus watcher latency: a 60 s tick and a trigger when a worker or close-out finishes; the shift closes early when nothing is live or startable; a decision-taken PR is refused at PR-open with no close-out session and keeps its place as an "earlier" PR in the M3.6j merge order; the digest reports merges blocked behind a /prm-bound PR.

Prompt: PyAutoMind/active/shift_speed_watcher_latency_and_refusals.md

Plan

  • Timer to 60 s; a new pyauto-orchestrator.path unit watching a fixed kick file (%S/pyauto/orchestrator.kick) that workers and close-outs write after their .done / .closeout (human decision 1).
  • S7: labels read in the watcher's existing gh pr view when a shift PR is first seen; decision-taken refuses for /prm with no session, no slot, no CI read; the PR still blocks later PRs on its library until MERGED or CLOSED (ruling c).
  • Early close: no worker, close-out or update live, no PR in CI grace or updated state, no startable pick → finish_shift on that tick. A paused shift never closes early (decision 2); a task parked on a question does not hold the shift open (decision 3).
  • Digest: one line per library naming merges that waited behind a /prm-bound PR.
  • AUTONOMY.md S7, network-surface sentences (labels field; kick file is local), batch AGENTS.md "The watcher" with deploy steps.
  • Tier + merge mode: effective level: supervised; merge mode: human /prm
Detailed implementation plan

Affected repo: PyAutoBrain (branch feature/shift-speed-watcher-latency).

  1. bin/systemd/pyauto-orchestrator.timer (60 s), new bin/systemd/pyauto-orchestrator.path (PathChanged=%S/pyauto/orchestrator.kick, MakeDirectory=yes, Unit=pyauto-orchestrator.service).
  2. _orchestrator.py: worker_env sets PYAUTO_SHIFT_KICK; gh_pr_state adds labels; _start_closeouts refuses decision-taken after the tier check; early-close predicate in _tick calling finish_shift with the close time; merges counted to the close time.
  3. worker_template.md, closeout_template.md, closeout_update_template.md: write the kick file after the marker.
  4. _digest.py: per-library blocked-behind-/prm lines.
  5. Docs: AUTONOMY.md, batch AGENTS.md.

Tests first: unit files; decision-taken refused with no spawn/slot; later PR waits behind it; digest lines; early close and its counter-cases (live worker, running close-out, startable pick, paused shift); tick lock overlap.

Deploy (human, no shift live): copy the three units to ~/.config/systemd/user/, daemon-reload, restart the timer, enable --now the path unit.

Original prompt

See PyAutoMind/active/shift_speed_watcher_latency_and_refusals.md (ruling S7; Witness items 1–6).

Activity

  1. Jammy2211 commented on Nov 19, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    PR #691 merged to main (1f51de1, 2026-11-19, human /prm). Ruling S7 and the watcher latency work: 60 s tick, a kick-file path unit, early shift close when nothing is live or startable, decision-taken refused at PR-open with no session, and digest lines for merges that waited behind a /prm-bound PR.

    Deploy when no shift is live: pull the canonical Brain checkout, copy the three units to ~/.config/systemd/user/, systemctl --user daemon-reload, restart the timer, enable --now the path unit.

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