Skip to content

Architecture / Decision records / ADR-HIS-040

ADR-HIS-040 Session pull requests merged by an agent review, without a person

Status Accepted
Decided 2026-11-24 by the product owner
Record Drafted 2026-11-24; approved 2026-11-25 by the Enterprise Architecture Board
Where the rule lives Session plan, rule 11 and section 3; Architecture, section 10.3

Context

The session plan cuts the work into some three hundred agent sessions, each ending in a pull request. Rule 11 had a person review and merge every one. With sessions running side by side, the people who review become the limit on how fast the plan moves, and most build and screen pull requests need no decision only a person can take. FR-ISE-REL-001 requires every change to pass a peer-reviewed pull request and automated CI validation ## Options considered

  • A person reviews and merges every pull request
  • Merge every pull request whose checks pass, with no review
  • An independent review agent reviews every pull request whose checks pass, the launcher merges what it approves, and a person merges where the plan names one (approvals, safety duties, contracts, gates, specification and tool changes)
  • An independent review agent reviews every pull request whose checks pass, and the launcher merges what it approves, with no person before merge

Decision

The fourth option. A review agent that wrote none of the change reviews each session's pull request once its checks pass, against the card, the session rules and the specification, read-only. If it approves, the session launcher merges the pull request. If it does not, or if the branch conflicts with main, the work goes back to the session, which fixes it and pushes, and the next push is reviewed again. A question the review raises goes back to the session too, which settles it from the specification or stops on it under session rule 3.

No kind of session, no card and no file is held back for a person. The approvals, safety reviews, contract reviews, downtime rehearsals and gate signatures that the session plan names are still given by people, on the work after it is merged; what they find becomes a fix session or a follow-up.

The rules are AUTO_MERGE and REVIEW_PROMPT in docs/implementation_plan/tools/definitions/sessions_def.py. Naming a kind, a label or a path there puts those pull requests back with a person.

Rationale

The product owner chose delivery speed: people reviewing before each merge were the limit on how fast the plan moves. Every change is still reviewed by an agent that did not write it and validated by the pipeline before merge.

The second-to-last option was offered and not taken. It would have kept, at least, the safety-duty cards and the delivery tools with a person.

Consequences

  • A review by an agent that did not write the change meets the "peer-reviewed" of FR-ISE-REL-001: the Enterprise Architecture Board confirmed it when it approved this record on 2026-11-25.
  • Safety-critical changes (architecture section 13: identity matching, medication, closed loops, decision support, device data, governed AI, and the blood bank, a SaMD under design control) are merged before the named safety review. The review is given on the merged work, and the hazard log and the design-control record are brought up to date after merge. The blood bank's design-control evidence and its NIE registration need that review before production use.
  • The delivery tools, the workflows and the session permissions can be changed by a session and merged without a person, including the rules in AUTO_MERGE and the permissions in SESSION_PERMISSIONS. A change to them shows in the history of main and in the pull request's review comment, which people should watch.
  • Until foundation session FN-S05 builds the pipeline, the only checks are the documentation checks, so the foundation sessions are merged on the agent review alone.
  • Contracts are merged before the domain leads review them; a correction afterwards is a contract change under session rule 4, which every later session sees.
  • A slice gate's evidence is merged before the owner signs it. The signature (ACC-002) and the downtime rehearsal (ACC-007) are still needed for the slice to count as passed and before go-live.
  • A pull request the review keeps sending back is not handed to a person; it goes on spending the plan's usage allowance until the session fixes it or stops under rule 3.
  • Reviews spend the plan's usage allowance like any session, and are held back with new sessions when usage is high. Merges are made by the account the launcher runs under.
  • For production, the change process of section 10.3 (review enforced in the self-managed GitLab, change records and the release board) applies unchanged.