Skip to content

feat: dev-ship verdict scoped to touched repos; 6 h feed age; rehearsal ancestry (M2.1, #340) - #342

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/heart-dev-scope
Nov 13, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/heart-dev-scope

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Programme M2.1. Closes #340. Also carries the Heart partner of M2.4.

pyauto-heart readiness --dev --repos A,B [--json] [--max-feed-age-hours <=6]:

  • Blocks on red main CI of each declared CI workflow (dev_ship.ci_workflows) in the touched repos and the libraries downstream of them.
  • STALE, which never passes: unfinished or unrecorded runs, unpolled repos, a feed over 6 h old or timestamped in the future, and in-scope evidence with no conclusion.
  • Shown, never blocking: ops workflows and release-scope workflows.
  • Unchanged: plain and release verdicts.

Other changes:

  • ci_status fetches declared workflows that fall off the 30-run page.
  • heart-health.yml gains repository_dispatch: heart-refresh and a trigger on Release Integrate completion. lib-tests.yml sends the refresh after a library's CI on main; this cannot turn the library red.
  • heart/checks/rehearsal_ancestry.py: a rehearsal whose SHAs are ancestors of main stays fresh, with "N ahead". It merges after Hands#337.

Test plan

  • Heart pytest tests/: 1423 passed.
  • Tenant firewall clean.
  • Replay of 268 logged ships: 6 (2.2 percent) red-blocked. Plus STALE for repos Heart does not poll, which the human ruled on 2026-11-13 to make not Heart-gated with a PR-check guard, as the next task.
  • The independent review took 4 rounds: FINDINGS, then fixed, then CLEAN.

Heart RED override (development only)

Authorization from the live human at the programme M2 gate, 2026-11-13: "Override + merge all". This authorizes the development-only RED override for PyAutoLabs/PyAutoBrain#614, #340 and PyAutoLabs/PyAutoHands#337 and gives the merge command (order Mind, Hands, Brain, Heart), conditional on every required check being green within the turn.

Heart verdict RED (pyauto-heart readiness, verdict ts 2026-11-12T22:43:14Z). The current RED reasons, verbatim: "PyAutoNerves: 4 commit(s) behind origin"; "PyAutoFit: 2 commit(s) behind origin"; "PyAutoArray: 4 commit(s) behind origin"; "PyAutoGalaxy: on branch feature/galaxy-guide-rebalance (not main)"; "PyAutoGalaxy: 1 uncommitted source change(s)"; "PyAutoLens: 1 uncommitted source change(s)"; "PyAutoLens: 45 commit(s) behind origin"; "PyAutoCTI: 4 commit(s) behind origin"; "install verification FAILED (testpypi; checks F)"; "release validation FAILED (stage integrate)"

None of these is in PyAutoMind, PyAutoBrain, PyAutoHeart or PyAutoHands. Branch gates passed: tests, independent review CLEAN after fix rounds, smoke not applicable. This PR does not fix Heart, and Heart stays RED for release.

Tier: glance. Merge mode: auto-merge on green if the Witness passes, with a post-merge summary. A RED override additionally needs the human's merge command, which was given in the same turn.

🤖 Generated with Claude Code

Jammy2211 and others added 6 commits November 12, 2026 21:21
… STALE never passes (#340)

Programme M2.1, human ruling 2026-11-12.

- `pyauto-heart readiness --dev --repos A,B [--json] [--max-feed-age-hours H]`
  (`--repos` implies `--dev`): computes the release verdict and partitions it.
  Only CI on `main` of the touched repos and of their dependants
  (config/repos.yaml `dependencies:`, transitive) blocks; every other reason
  (release validation, install verification, floors, organ workflows, dev-box
  checkout state) is carried in `shown_reasons`. In-scope CI unreadable or
  unobserved is STALE.
- Feed age: a snapshot older than 6 h, or of unknown age, is STALE. Only
  GREEN passes (`pass`); STALE means re-check, or park. An in-scope RED
  outranks an aged feed.
- Release gating unchanged: `compute` and the plain `readiness` call read as
  before (one additive `repository_reasons` row for an unknown library).
- Event triggers: heart-health.yml also runs on `repository_dispatch:
  heart-refresh` and on Release Integrate completing; the reusable
  lib-tests.yml gains a non-fatal `heart-refresh` job that sends the event
  when a library's CI finishes on `main`. Daily cron kept as the backstop.
- Docs: module docstring, AGENTS.md, REFERENCE.md, CLI help, capabilities.

Witness: tests/test_dev_ship.py (scope, STALE never passes, 6 h rule, CLI),
live-graph tests in test_readiness.py, trigger wiring in
test_heart_health_wiring.py. Replay of autonomy_log.md's first table: 268
ships, 6 still blocked (2.2%), upper bound 30 (11.2%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…LE, skew, age bounds (#340)

Independent review of cf2ecc8 returned FINDINGS; each fixed with a test.

1. In-scope main CI is read from the snapshot for a repo of ANY group
   (organism, build_workflow, workspaces_developer): runs on the main HEAD,
   failing → RED, unfinished → STALE; with none on HEAD, the newest run.
   Release-scope workflows living in organ repos (config/repos.yaml
   `dev_ship.release_scope_workflows`: Release Integrate, Workspace Smoke,
   Python Version Matrix, Nightly Release, ...) never count as the repo's own
   CI, per the ruling's "release scope shown, not enforced".
2. A touched repo Heart does not poll is STALE ("not polled by Heart: X"); a
   name config/repos.yaml never mentions is a usage error (exit 2). The 12
   body-map repos Heart does not poll (PyAutoReduce, Cortex, Gut, Scientist,
   Broca, DNA, assistants, ...) are named under `excluded:`.
3. A snapshot dated more than 5 min in the future is unknown age → STALE.
4. --max-feed-age-hours must be finite, positive and at most 6.
5. In-scope CI with no conclusion (library mid-run, a required workspace
   workflow without a conclusion) is STALE; each CI sidecar is aged by its
   own collection ts as well as the snapshot by its aggregation ts.
6. The verdict names its source (the LOCAL ~/.pyauto-heart/state.json) and
   that source's age; docs state the event triggers refresh the published
   cloud feed, not that file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it (M2.4)

Heart partner of PyAutoHands#337: a release publishes exactly the rehearsed
SHAs even if main moved (human ruling 2026-11-12). The release-validation
SHA leg no longer reads STALE merely because main's HEAD differs from the
rehearsed commit_shas.

- heart/checks/rehearsal_ancestry.py: for each release-gate library whose
  rehearsed SHA differs from the ci_status main HEAD, asks the GitHub
  compare API (`gh api repos/<owner>/<repo>/compare/<rehearsed>...<head>`,
  injected seam) and writes rehearsal_ancestry.json; status ahead/identical
  = ancestor, with ahead_by. Run in the tick and the cloud heart-health job;
  folded into the snapshot by state.aggregate.
- readiness.compute: a moved repo stays fresh when the record proves the
  rehearsed SHA an ancestor of the current HEAD (both SHAs matching); the
  verdict carries validation_ahead {repo: n} and validation_note. STALE
  (validation_stale_sha) when a rehearsed SHA is not an ancestor (main
  rewritten / off-main commit), or when the record is missing, for another
  HEAD, or the compare failed. Every other release gate is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stry check bounded, no mid-tick aggregate (#340)

Re-review items on 0b24896:

1. Dev-ship scope, advisory groups (organs, build workflow, developer
   workspaces): only the repo's own CI counts — config/repos.yaml
   `dev_ship.ci_workflows`, seeded from the M2.2 required-check survey and
   each repo's pull_request-triggered workflows (minus dashboard refreshes).
   With nothing on the main HEAD, the newest CI run decides, never a newer
   ops run. A failing ops workflow on HEAD (boards, sweeps, schedules) is
   shown, never blocking. A polled advisory repo with no declaration is STALE;
   `[]` declares "no CI". A live test keeps the declaration complete.
2. rehearsal_ancestry: reads the validation report and ci_status sidecars
   directly and writes only its own sidecar — the tick's normal aggregate
   folds it in. Compare calls run in parallel under one 20 s budget (15 s per
   call); a call not back in time is recorded unknown, which readiness reads
   as STALE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Must-fix from review: with no declared run on the main HEAD only the newest
declared run was judged, so a red Lifecycle Drift at 10:00 was hidden by a
green Spawn Drift at 11:00 (GREEN). Now every declared workflow's latest run
(ci_status keeps one per workflow) is judged: any red blocks; any unfinished
one is STALE; a declared workflow with no recorded run — e.g. absent from
ci_status's 30-run page — is STALE, never skipped silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…page (#340)

A declared own-CI workflow (config/repos.yaml dev_ship.ci_workflows) can fall
off ci_status's newest-30-runs page behind busy ops workflows — today Mind's
Tenant Firewall Gate and Spawn Drift — and the dev-ship gate then read every
Mind ship STALE. ci_status now fetches the latest main run of each such
workflow directly (`actions/workflows/<id>/runs?branch=main&per_page=1`),
resolving the id from the name via `actions/workflows` once and caching it
($HEART_STATE_DIR/ci_workflow_ids/<repo>.json). Bounded: one extra call per
missing declared workflow per tick (plus the listing on a cache miss), each
under the tick's 10 s gh bound. Entries are flagged `backfilled` in the
sidecar, so `readiness --dev` judges them; STALE only if the fetch fails.
The rolled-up conclusion is computed first, so the release rollup is
unchanged. ci_status.sh passes --owner.

Real state, 2026-11-12: PyAutoMind's sidecar gains Tenant Firewall Gate and
Spawn Drift (both success, backfilled); `dev_ship(['PyAutoMind'])` → GREEN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: dev-ship verdict scoped to touched repos; 6 h feed age never passes (M2.1)

1 participant