Repository navigation
Releases
v0.8.0 — project orchestrator automation pattern
Added
- P11 project night orchestrator. New git-backed suite setup now defaults to
one lock-owning project coordinator that runs producer, integration, cleanup,
and reflection lanes inside a single scheduled job. This addresses live-fleet
contention where separate same-project jobs woke up inside each other's
workspace-lock windows and produced blocked/noisy runs. profile_project.py profile --classic-suiteand
lifecycle.py setup --classic-suitekeep the prior separate P1-P10 job shape
available for projects that intentionally want it.
Changed
profile_project.pynow proposes P11 by default for git-backed projects and
records capability-backed lanes inside the orchestrator params.lifecycle.py addcan still add individual classic patterns; explicitP11
adds resolve through the orchestrated proposal path.- Fleet validation, materialization, docs, and lifecycle tests now recognize
P11 as a first-class known template.
v0.7.6 — bug sweep across parsers, scanners, and detection
Patch release: nine correctness/clarity fixes surfaced by a multi-agent audit, plus behavior-preserving internal deduplication. No API changes. 393 self-tests pass (was 382) — the silent-corruption fixes ship with regression tests.
Fixed
- discover_agents: a malformed Codex
automation.tomlnow reports a distinctUNKNOWN (could not parse prompt)state instead of a false "NO protocol block". - approval_digest: excludes reserved non-job dirs (
suites/) — a strayhuman-approval.mdno longer surfaces as a phantom job. - run_ledger: the
ao:countersblock is parsed tolerant of field order/whitespace, so a reordered block no longer silently resetsconsecutive_failures/last_success(which would defeat the escalation stop-rule). - fleet_health:
BLANK-LASTRUNis schema-aware — legacy records judged byraw(fixes a false positive on every legacy record); blankwhenon frontmatter/template now flagged. - profile_project: security-scanner evidence names the covered lockfile (e.g.
cargo-audit on PATH (covers Cargo.lock)). - lifecycle:
adopterrors clearly on a non-existent path-shaped--suiteinstead of reinterpreting a typo as a slug. - agent_materializers: the cursor (cloud-managed) apply note states that
--applyperforms no local write. - fleet_report:
scan_fleethonors--homefor non-~automations roots (latent; no shipped adapter affected). - optimize_codex_automations: same-time collision warning formats job A's own minute (cosmetic).
Changed (internal, no behavior change)
profile_projectreusesFINGERPRINT_FIELDS/compute_fingerprintfromoptimize_codex_automationsinstead of a hand-synced copy, removing a silent-drift risk on the approval fingerprint; minor dedup inlifecycle,fleet_health,agent_materializers.
Full changelog: https://github.com/shanemhamilton/nightshift/blob/v0.7.6/CHANGELOG.md
v0.7.5
Fixed
run_ledger.pynow treats lock/backpressure deferrals as neutral counter
events instead of consecutive product failures.outcome=deferredand known
lock/backpressurefailure_classlabels preserveconsecutive_failures; true
failures still increment and successes still reset. A new--counteroverride
lets a job forcesuccess,failure, orneutralwhen the automatic mapping
is not precise enough.run_ledger.pyno longer corrupts a blanklast_success:counter by parsing
the closing<!-- /ao:counters -->marker as the timestamp, and it repairs
orphan closing markers left by older bad parses.approval_digest.py --writenow refreshesFLEET-REPORT.mdwhen it can map
the Codex home to<home>/.codex, so the written morning digest does not copy
a stale fleet headline.fleet_report.pynow excludes the same neutral lock/backpressure events from
blocked_ratio_7dand theblocked-risingflag, mirroringrun_ledger.py's
counter treatment. Previously a job that deferred often for routine
concurrency reasons (shared workspace, colliding schedules) could still read
as "blocked" or tripblocked-risinginFLEET-REPORT.md, even though the
same event was already correctly neutral for its own escalation counter.
Full Changelog: v0.7.4...v0.7.5
v0.7.4 — trust a durable owner-pid; keep the lease authoritative
Fixes the lock-liveness model after a live-fleet incident. A job lock's recorded pid was run_lock.py's own transient CLI-subprocess pid, dead within milliseconds of acquire — so it read "dead" for every lock and was never a real liveness signal. That made "pid dead ⇒ owner crashed" a false positive, and reclaiming on it could take over a lock a still-running agent holds.
Fixed
run_lock.is_abandonedtreats a trusted, same-host owner pid (via--owner-pid) as ground truth both ways — alive ⇒ never abandoned even past its lease; dead ⇒ abandoned immediately — and otherwise makes the lease authoritative. A dead untrusted pid on an unexpired lease is no longer abandoned, soreclaim/reap/acquirecan never take over a live run's lock. Also fixes a pid-reuse false positive that could keep an expired-lease lock blocked indefinitely.
Added
acquire/reclaimaccept--owner-pid <pid>; the owner recordspid_trusted: trueand a crashed run becomes reclaimable before its lease expires.tokenstill derives from run_lock's own pid (unique per acquisition). Omit → lease governs (backward-compatible). Not wired into the managed block by default: a per-command$$is not durable and would re-arm the bug; activation needs a long-lived owner pid.
Verification
All four suites green on Python 3.11 and 3.12: lifecycle 80, optimizer 48, state 184, digest 44 — 0 failed.
v0.7.3 — workspace-lock reclaim, reap, and health check
Fixes the workspace-lock leak found while auditing the overnight Codex fleet. Crashed/timed-out runs leaked per-workspace directory locks that nothing ever reclaimed; acquire never consulted the lease for workspace locks, so a dead owner's lock blocked every later run on that checkout until (and past) its 2h lease. This deferred several producers/integrators overnight.
Added
run_lock.py reap— removes provably-abandoned (dead pid and expired lease) workspace locks under<locks-root>/.workspace-locks/; never touches a live or unexpired-lease lock. Exit 0 always.run_lock.py reclaim --workspace <ws>— a job-lock takeover also inherits named abandoned workspace locks, under the same dead-pid-and-expired-lease + read-back-confirm invariant.fleet_health.pyWORKSPACE-LOCK-STALE check — scans each agent's.workspace-locks/and reports (and exits nonzero on) abandoned locks; addsworkspace_locks+stale_workspace_locksto the result.
Fixed
run_lock.py acquiretransparently reclaims a contended workspace lock only when its holder is provably abandoned (dead pid and expired lease), with read-back confirmation; a live/unexpired workspace lock still DEFERS. Job-lock semantics unchanged. Job- and workspace-lock reclaim unified behind one read-back-confirmed helper.
Verification
All four selftest suites green on Python 3.11 and 3.12: lifecycle 80, optimizer 48, state 170, digest 44 — 0 failed. Dogfooded live: reap removed the 8 abandoned locks on the fleet, correctly leaving a dead-pid-but-unexpired-lease lock to age out.
v0.7.2 — post-rollout follow-ups
Patch release fixing three defects surfaced on the live fleet after the v0.7.x rollout.
Fixed
run_lock.parse_ownerreads the legacy owner formats still on the fleet. Tolerates bothkey: value(v5) andkey=value(legacy) on read, splitting each line on the first separator only (ISO timestamps stay intact), and normalizes variant field names (run_token→token,started_at→start). Writes remain v5-only. This makesLOCK-EXPIREDdetection accurate for exactly the legacy locks it most needs to catch — previously they read as abandoned/OVERDUE. The reclaim safety invariant is unchanged: a lock is only reclaimed when its recorded PID is dead and its lease has expired, with read-back confirmation.fleet_health.pyandfleet_report.pyno longer count reserved non-job directories as phantom jobs. Both skip dot-prefixed dirs (.archive,.disabled,.workspace-locks,.git) and the reservedsuites/name, and only treat a directory as a job when it contains the adapter's job file (codex →automation.toml, claude →SKILL.md, gemini →prompt.md).lifecycle.py adoptwires a producer'shands_off_toto the target suite's integrator (parity withadd) before validation, so adopting a producer no longer fails fleet rule 3 ("producer missing 'hands_off_to'") without a hand-edit.
Verification
All four selftest suites green on Python 3.11 and 3.12: lifecycle 80, optimizer 48, state 149, digest 44 — 0 failed.
v0.7.1 — skill dir name portability fix
Fixed
discover_agents.pyand the install selftest hardcoded the installed skill
directory name asautomation-optimizer; it is actually the source folder name
(nightshiftwhen the public repo is cloned). Discovery now derivesSKILL_NAME
from the repo root, so a correctly-installed skill is no longer reported as
(not installed)on anightshiftclone, and CI passes.
v0.7.0 — fleet hardening
Fleet-hardening release driven by a deep audit of the live overnight fleet. The managed
protocol advances to v5 and is now backed by deterministic helper scripts instead of
prose the model must re-derive each run, the upgrade path preserves hand-customized blocks,
the human-decision loop closes end to end, and multiple projects are governed as one fleet.
Added
- Deterministic state tooling.
run_lock.py(atomic job + workspace locks with a
fixed owner format and safe reclaim),run_ledger.py(open/close verbs writing
last-run.md+ per-unitruns/entries, a machine-owned<!-- ao:counters -->block in
memory, andESCALATE/exit 3 at the consecutive-failure threshold),state_schema.py
(canonical----frontmatter for run files plus a lenient parser that also reads the legacy
bullet and freeform shapes on the fleet),fingerprint.py(repo/command change detection),
andfleet_health.py(read-only scan for expired locks, overdue/empty/blank/oversized jobs). - Protocol v5. The managed block wires start-of-run locking to
run_lock.py, the
change-detection gate tofingerprint.py, and closeout torun_ledger.py; adds a
Blocked-worktree recovery section (repeatedly-blocked producers work in an isolated
git worktree, never touching the user's checkout), a lease-aware continuation-loop stop
rule, target selection from a per-projectPROJECT-QUEUE.md, and start-of-run readback of
decisions propagated from the daily approval digest. Every released block is preserved in
BLOCK_HISTORY. - Human-decision loop. The approval digest gains stable per-item ids +
- [ ] approve
checkboxes and aresolveverb that applies checked/decided items back to the source queue
(## Resolved) and the job's memory (## Stable decisions), refusing any item whose source
changed since the digest was generated. Queue aging (⚠ AGED), a tightened safe bucket with
an always-needs-judgment deny regex, and--emit-launchd/--emit-crondelivery artifacts. - Fleet governance. Per-project suites under
automations/suites/<slug>.toml; whole-fleet
--fleetvalidation with cross-suite checks (one active merge authority per workspace;
same-workspace same-time collision warning);[suite].night_start_hourfor midnight-spanning
phase order;lifecycle.py adoptto bring hand-written jobs under a manifest without
rewriting their prompt; per-job agent records;fleet_report.py7/30-day rollups. PROJECT-QUEUE.mdscaffolding (objectives + open threads),INSTALL-INFO.jsoninstall
stamps with drift reporting, per-pattern model/reasoning-effort hints (never Haiku), and a
CI workflow running all four selftest suites on Python 3.11 and 3.12.
Changed
- Upgrades are customization-preserving:
status_ofreportscustomized-block(checked
beforeneeds-upgrade) andapplyrefuses to strip a hand-modified block unless
--migrate-customfolds the extracted rules into the task body. Customization detection is
path-insensitive (state-file paths never read as customization).
Fixed
- Block integrity:
malformed-block(missing END / version outside span),duplicate-block,
andnewer-than-helperare detected;applynever prepends a second block. - Gemini jobs are no longer reported as ORPHAN (per-adapter
job_file). - The digest resolves a job's project from the suite manifests, not the first hyphen segment.
cron_to_rrulehandles day-of-month and warns on unsupported cron syntax instead of
silently degrading to daily;security_scannerdetection requires the audit tool on PATH
for non-npm ecosystems.
v0.5.0 — Hardening: atomic lock, scope-gated merges, P9 digest
Hardening pass driven by an overnight fleet audit (lock collisions, schedule drift, near-zero merges to main, scattered approvals).
Changed (managed protocol v3 → v4)
- Atomic lock acquisition. Start-of-run lock goes from check-then-replace (which let two same-minute runs each declare the other "stale" and run in parallel) to acquire-or-defer: fail-if-exists create (
mkdir/O_EXCL/noclobber), run token + PID +lease_until, defer when held, reclaim only a provably-dead+expired lock with a read-back ownership check. - Scope-gated safe-merge lane. Auto-merge only within the producer's
write_scopewith green gates and no production/secret/migration/deploy/CI/auth/billing/external surface. Agent tool metadata (.serena/,.beads/issues.jsonl) no longer counts as a dirty-worktree blocker; screenshot proof only for user-visible UI changes. - Schedule de-clustering (generator). Deterministic per-job minute staggering so same-repo jobs never share a trigger minute; phase hours preserved.
Added
- P9 — cross-project approval digest (fleet-global).
scripts/approval_digest.pyreads every automation'shuman-approval.md(read-only), dedupes, ranks by age, filters self-resolved notes, and buckets items into "safe to batch-approve" vs "needs judgment", writing one~/.codex/DAILY-APPROVALS.md. Optional local macOS notification; external email/Slack off unless configured + opted in. - Structured approval-queue items (
risk/suggested_default/action/first_seen/evidence).
Verification
Self-test 24/24; live fleet 18 jobs upgraded v2→v4 with --strict PASS 19/19; atomic-lock race test (1 acquirer/round); digest dry-run across 4 projects.
v0.3.0 — Automation lifecycle modes
Manage a single automation across its whole life — on Codex, Claude, Gemini, or Cursor — with four new verbs in scripts/lifecycle.py. Every verb runs one pipeline: mutate suite.toml → validate the fleet → gate on approval → materialize per agent. Default is a dry run; --apply is the confirmation.
Added
setup— profile a project and stand up its whole suite (propose → confirm → install).add— add one pattern (P1..P8) to an existing suite, capability-checked and fleet-validated.remove— retire a job: disable by default (reversible);--purgearchives sidecar state then deletes. Refuses to orphan the fleet.update— change schedule / params / scope / mode / model; a safety-relevant change re-enters the approval gate.- All four agents executable via
scripts/agent_materializers.py:native_file(Codex, Claude) writes registry files;external_cron(Gemini) andcloud_api(Cursor) emit config and never edit cron or touch the cloud. - Cross-agent merge-authority guard — exactly one active integrator even across agents; others run in shadow.
scripts/pattern_bodies.py(P1..P8 prose as shared data) andscripts/selftest_lifecycle.py(23 end-to-end checks).
Changed
scaffold_suite.pyimports its template bodies from the shared module; output is byte-identical to v0.2.0 (verified by diff).
Full changelog: CHANGELOG.md