Skip to content

feat: merge-actor column, count rule in code, seeded audit sample (M1.4) #606

Closed

Description

@Jammy2211

Overview

Programme task M1.4 (epic autonomous-orchestrators, phase 8), finding FLOW-2 (confirmed). The glance window counts merges the organism made itself, but its count still includes human-typed /prm rows (the AUTONOMY.md "Ledger accuracy" rule exists only in prose), no row records who merged, and the 11-04 audit was hand-picked. This task makes the merge actor a tool-written fact, applies the count rule in code, and makes audits a seeded random sample.

Human decisions (live, 2026-11-12, programme session): "All three as recommended"

  1. Merge-actor column, tool-written, classes human-/prm | in-turn-human-commanded | in-turn-autonomous | unattended-watcher | unknown; the count leaves out human-/prm and in-turn-human-commanded.
  2. Audits of the glance window are a seeded 1-in-5 random sample, audited within a week, instead of hand-picked rows.
  3. A read-by-human date column is recorded but does not gate the count yet (gating is a judge question after the recount).
    The stage-1 recount is printed only; if it changes what the 11-04 glance ruling rests on, that is a separate judge question for the human.

Plan

  • Add the merge-actor and read-by-human columns to the shadow tables (stage 1 and stage 2) and to every writer (lifecycle.py close --tier glance / shadow-row, the watcher's stage-2 row path); the actor is derived from gh pr view --json mergedBy plus how the merge was started.
  • Make the count function apply the actor rule; existing rows without the column count as unknown (still counted, as today) and the recount prints the three-way classification from the completion records.
  • A seeded sampler draws the 1-in-5 audit sample reproducibly.
  • A dated AUTONOMY.md amendment records decisions 1–3 with a revert condition.

Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary

Witness

(a) each new shadow row carries a merge actor written by the tool (from gh pr view --json mergedBy and whether /prm was typed by the human), shown on one real row; (b) a test shows the count function leaves out human-typed /prm (and in-turn-human-commanded) rows; (c) the recount of the stage-1 rows is printed in classes (review expected: about 30 human /prm, 8 to 10 automatic or in-turn, about 29 not stated); (d) the sampler draws the same 1-in-5 sample twice from the same seed.

Original Prompt

Prompt

Autonomy log: record who merged, and audit a random sample

Type: feature
Target: PyAutoBrain
Repos:

  • PyAutoBrain
  • PyAutoMind
    Difficulty: small
    Autonomy: supervised
    Priority: normal
    Status: draft
    Filed: 2026-11-10
    Epic: autonomous-orchestrators
    Consequence: glance
    Witness: (a) each new shadow row carries a merge actor written by the tool (from gh pr view --json mergedBy and whether /prm was typed by the human), shown on one real row; (b) a test shows the count function leaves out human-typed /prm rows; (c) the recount of the 69 stage-1 rows is printed in three classes (expected: about 30 human /prm, 8 to 10 automatic or in-turn, about 29 not stated); (d) the sampler draws the same 1-in-5 sample twice from the same seed
    Review-minutes: 10
    Unattended: never
    Lane: any

Source: the ecosystem review of 2026-11-10, finding FLOW-2, confirmed by an independent verifier. Report: https://claude.ai/artifact/4A94P1cevvkESoM22QoMWm (private) and Science/scratch/ecosystem_review_2026-11/REPORT.md, section B4 and Appendix A. Data: evidence/workflows_as_run/.

What was measured. In the 69 counted rows of the glance window (2026-10-06 to 11-03, all recorded merged-unchanged), about 30 merges were a human-typed /prm according to the matching completion records, 8 to 10 state an automatic or in-turn merge, and about 29 do not say who merged. The ruling's own ledger-accuracy rule says human-typed /prm rows are re-marked and left out of the count; it was applied to one row, and the counting code has no merge-actor test, so the count still includes them. The 8 of 8 audit was a sample chosen by the session that proposed the grant.

Doctrine already withholds unattended merging until ten adversary-legged stage-2 rows exist, and that table has 0 rows. So the gap is the uncounted merge actor and the non-random audit, not a missing gate.

The change.

  1. Add a merge-actor column to the shadow row, written by the tool at close-out.
  2. Make the count function apply the ledger-accuracy rule in code, and print the recount of stage 1.
  3. Replace hand-picked audits with a seeded random sample (for example 1 row in 5), audited within a week.
  4. Record "read by the human on ", so that merged-unchanged is an answer and not a default.

What this does not do. It does not change the glance ruling. If the recount changes what the ruling rests on, that is a judge question for the human and a separate prompt. The ten stage-2 rows need real shifts, not code.

Unattended: never because it changes the autonomy ledger itself.

Activity

  1. Jammy2211 commented on Nov 12, 2026

    @Jammy2211
    ContributorAuthor

    Heart RED override (development only), recorded per AUTONOMY.md.

    The live human authorized it in the programme session on 2026-11-12: "Override + merge on green". That covers the development-only override for this issue and the merge command (Mind PR first, then Brain), on condition that every required check is green within the turn.

    Current RED reasons, verbatim (pyauto-heart readiness, ts 2026-11-12T18:29:55Z): "PyAutoNerves: 2 commit(s) behind origin"; "PyAutoArray: 2 commit(s) behind origin"; "PyAutoGalaxy: 4 commit(s) behind origin"; "PyAutoLens: on branch feature/extra-galaxies-review (not main)"; "PyAutoLens: 2 uncommitted source change(s)"; "PyAutoCTI: 2 commit(s) behind origin"; "install verification FAILED (testpypi; checks F)"; "release validation FAILED (stage integrate)"

    None of these is in PyAutoBrain or PyAutoMind. Branch gates passed:

    • Mind suite: 772 passed.
    • Brain closeout tests: 21 passed.
    • Independent review: CLEAN after one round of fixes.
    • Smoke: not applicable.

    PRs: PyAutoLabs/PyAutoMind#558 and #607

    🤖 Generated with Claude Code

  2. added a commit that references this issue on Nov 12, 2026
  3. Jammy2211 commented on Nov 12, 2026

    @Jammy2211
    ContributorAuthor

    Shipped. PyAutoLabs/PyAutoMind#558 and #607 were merged on green CI.

    The witness holds:

    • (a) A tool-written actor appears on the real close row: in-turn-human-commanded (mergedBy Jammy2211).
    • (b) The count test passes.
    • (c) The recount on the 69 rows the ruling rested on gives human /prm 31, automatic/in-turn 10, not stated 28.
    • (d) Same seed, same sample.

    Programme M1.4 is done.

    🤖 Generated with Claude Code

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