Pack · source-control
scm.change
A change request: the ask to bring the revisions of a source reference into a target reference of one repository, what a forge calls a merge request or a pull request. It is opened at a head revision; every push moves the head. Checks and reviews are about one head: a check verdict or a review for an older head is refused, and an approval stays bound to the head it was given for. A merge names the head it saw and the authority grant it acts under, and is refused unless that is still the head, it is not a draft, the head is approved, its checks passed and the grant is active. A merge may be armed to happen when the checks pass; the passed verdict then makes it due. A change request carries the forge's own reference, whether a review was requested and the change requests it depends on. It may carry a proposal of a workspace (agentic.workspace) and deliver a task (agentic.work).
Depends on
- scm.repository · pack source-control · 9 references
- workspace · layer 8 · 21 references
- authority · layer 6 · 7 references
- work · layer 5 · 6 references
- principal · layer 1 · 23 references
- shared · layer 0 · 6 references
Used by
- tracking.issue · pack tracking · 6 references
Entities
ChangeRequest
The ask to merge a source reference into a target reference, at a head revision, with the checks verdict and the approval of that head.
Identified by change_request_id (ChangeRequestId).
| field | type | meaning |
|---|---|---|
repository_id | RepositoryId | |
source_reference | ReferenceName | |
target_reference | ReferenceName | |
head | Revision | The revision the source reference pointed at when last pushed. |
title | Content | |
opened_by | PrincipalId | |
opened_at | timestamp | |
checks | ChecksVerdict | |
approved_head | optional Revision | The head the last approval was given for; a later push leaves it on the older head. |
approved_by | optional PrincipalId | |
proposal_id | optional ProposalId | The workspace proposal this change request carries to the forge, when it came from one. |
task_id | optional TaskId | The task the change delivers, when it delivers one. |
merged_revision | optional Revision | |
merged_by | optional PrincipalId | |
merged_under | optional GrantId | |
review_ref | optional string | The forge's own reference of the change request, such as !42. |
draft | boolean | A draft is not merged and no merge is armed for it until it is marked ready. |
review_requested | boolean | A review of the change request was requested. |
depends_on | optional list of ChangeRequestId | The change requests that must merge first; recorded and shown, a merge does not read them. |
armed | boolean | A merge is armed to happen when the checks of the head pass. |
armed_by | optional PrincipalId | Who armed the merge, while it is armed. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
repositoryreferences Repository of scm.repository (one, byrepository_id)openerreferences Principal of principal (one, byopened_by)approverreferences Principal of principal (one, byapproved_by)mergerreferences Principal of principal (one, bymerged_by)armerreferences Principal of principal (one, byarmed_by)proposalreferences Proposal of workspace (one, byproposal_id)taskreferences Task of work (one, bytask_id)grantreferences Grant of authority (one, bymerged_under)reviewsowns Review (many, bychange_request_id)
Lifecycle of ChangeRequest
Merged.Review
One principal's review of one head of a change request.
Identified by review_id (ReviewId).
| field | type |
|---|---|
change_request_id | ChangeRequestId |
reviewer | PrincipalId |
head | Revision |
verdict | ReviewVerdict |
body | Content |
submitted_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
reviewer_principalreferences Principal of principal (one, byreviewer)
Lifecycle: one state, Submitted; a recorded Review does not change.
Commands
ApproveHead
Approve a head on the strength of a review. Binds the change request's approval to the head an approving review of it was given for. The approval stays on that head; a later push leaves it behind.
Called by: Reviewer.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
review_id | ReviewId |
head | Revision |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
stale-head refused | head != input. | Stale: The request names a head that is no longer the change request's head: someone pushed since. A check verdict, a review or a merge is about one head only. |
no-such-review refused | no Review for review_ | Review: No review of this identity exists. |
review-of-other-change-request refused | the Review of review_ has change_ | Review: The review is not an approval of this head of this change request. |
review-of-other-head refused | the Review of review_ has head != input. | Review: The review is not an approval of this head of this change request. |
review-not-approving refused | the Review of review_ has verdict != Approve | Review: The review is not an approval of this head of this change request. |
approved | otherwise | updates the ChangeRequest; emits Head |
More columns: swipe horizontally, or focus the table and use the arrow keys.
ArmMerge
Arm a merge for when the checks pass. Arms the change request to be merged when the checks of its head pass: RecordChecks then answers merge-due and emits MergeDue. A draft is not armed.
Called by: Merger.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
armed_by | PrincipalId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
draft refused | draft == true | Change: The change request is a draft; it is neither merged nor armed for a merge until marked ready. |
armed | otherwise | updates the ChangeRequest; emits Merge |
More columns: swipe horizontally, or focus the table and use the arrow keys.
CloseChangeRequest
Close a change request without merging.
Called by: Contributor, Merger.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
closed | otherwise | moves the ChangeRequest Open → Closed; emits Change |
wrong-state refused | the ChangeRequest is in a state that does not allow it | Change: The change request is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
DisarmMerge
Disarm an armed merge.
Called by: Merger.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
disarmed | otherwise | updates the ChangeRequest; emits Merge |
More columns: swipe horizontally, or focus the table and use the arrow keys.
MergeChangeRequest
Merge a change request. Brings the head into the target reference. Refused unless the named head is still the head, the change request is not a draft, an approval was given for exactly that head, its checks passed, and the grant the merger acts under is active.
Called by: Merger.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
head | Revision |
merged_revision | Revision |
merged_by | PrincipalId |
merged_under | GrantId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
stale-head refused | head != input. | Stale: The request names a head that is no longer the change request's head: someone pushed since. A check verdict, a review or a merge is about one head only. |
draft refused | draft == true | Change: The change request is a draft; it is neither merged nor armed for a merge until marked ready. |
not-approved refused | not (defined(approved_ | Not: No approval was given for any head of the change request. |
approval-for-other-head refused | approved_ | Approval: The approval was given for another head than the one to merge; a push after the approval needs a new approval. |
checks-not-passed refused | checks != Passed | Checks: The checks of the current head are pending, running or failed. |
unknown-grant refused | no Grant for merged_ | Unknown: No authority grant of this identity exists. |
grant-not-active refused | the Grant of merged_ has state != Active | Grant: The authority grant the merge names is revoked. |
merged | otherwise | moves the ChangeRequest Open → Merged; emits Change |
More columns: swipe horizontally, or focus the table and use the arrow keys.
OpenChangeRequest
Open a change request.
Called by: Contributor.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
repository_id | RepositoryId |
source_reference | ReferenceName |
target_reference | ReferenceName |
head | Revision |
title | Content |
opened_by | PrincipalId |
proposal_id | optional ProposalId |
task_id | optional TaskId |
review_ref | optional string |
draft | optional boolean |
depends_on | optional list of ChangeRequestId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
already-open refused | the ChangeRequest exists already | Change: A change request of this identity exists. |
unknown-repository refused | no Repository for repository_ | Unknown: No repository of this identity exists. |
unknown-opener refused | no Principal for opened_ | Unknown: No principal of this identity is registered. |
unknown-proposal refused | no Proposal for proposal_ | Unknown: No workspace proposal of this identity exists. |
unknown-task refused | no Task for task_ | Unknown: No task of this identity exists. |
archived refused | the Repository of repository_ has state == Archived | Repository: The repository is archived; it takes no new change request. |
opened | otherwise | creates a ChangeRequest in Open; emits Change |
More columns: swipe horizontally, or focus the table and use the arrow keys.
PushHead
Push a new head to a change request.
Called by: Contributor.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
head | Revision |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
pushed | otherwise | updates the ChangeRequest; emits Head |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RecordChecks
Record the checks verdict of a head.
Called by: Check reporter.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
head | Revision |
verdict | ChecksVerdict |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
stale-head refused | head != input. | Stale: The request names a head that is no longer the change request's head: someone pushed since. A check verdict, a review or a merge is about one head only. |
merge-due | armed == true and input. | updates the ChangeRequest; emits Checks, Merge |
recorded | otherwise | updates the ChangeRequest; emits Checks |
More columns: swipe horizontally, or focus the table and use the arrow keys.
ReopenChangeRequest
Reopen a closed change request.
Called by: Contributor.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
reopened | otherwise | moves the ChangeRequest Closed → Open; emits Change |
wrong-state refused | the ChangeRequest is in a state that does not allow it | Change: The change request is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RequestReview
Request a review of a change request.
Called by: Contributor.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
review-requested | otherwise | updates the ChangeRequest; emits Review |
More columns: swipe horizontally, or focus the table and use the arrow keys.
SetDraft
Mark a change request as a draft or as ready.
Called by: Contributor.
| field | type |
|---|---|
change_request_id | ChangeRequestId |
draft | boolean |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-change-request refused | no such ChangeRequest | Change: No change request of this identity exists. |
not-open refused | state != Open | Change: The change request is merged or closed. |
draft-set | otherwise | updates the ChangeRequest; emits Draft |
More columns: swipe horizontally, or focus the table and use the arrow keys.
SubmitReview
Submit a review of a head.
Called by: Reviewer.
| field | type |
|---|---|
review_id | ReviewId |
change_request_id | ChangeRequestId |
reviewer | PrincipalId |
head | Revision |
verdict | ReviewVerdict |
body | Content |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
already-submitted refused | the Review exists already | Review: A review of this identity exists. |
no-such-change-request refused | no ChangeRequest for change_ | Change: No change request of this identity exists. |
unknown-reviewer refused | no Principal for reviewer | Unknown: No principal of this identity is registered. |
not-open refused | the ChangeRequest of change_ has state != Open | Change: The change request is merged or closed. |
stale-head refused | the ChangeRequest of change_ has head != input. | Stale: The request names a head that is no longer the change request's head: someone pushed since. A check verdict, a review or a merge is about one head only. |
reviewed | otherwise | creates a Review in Submitted; emits Review |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Events
| event | fields | emitted by |
|---|---|---|
ChangeRequestClosed | change_ ChangeRequestId, at timestamp | Close |
ChangeRequestMerged | change_ ChangeRequestId, repository_ RepositoryId, target_ ReferenceName, head Revision, merged_ Revision, merged_ PrincipalId, merged_ GrantId, at timestamp | Merge |
ChangeRequestOpened | change_ ChangeRequestId, repository_ RepositoryId, source_ ReferenceName, target_ ReferenceName, head Revision, opened_ PrincipalId, proposal_ optional ProposalId, task_ optional TaskId, at timestamp | Open |
ChangeRequestReopened | change_ ChangeRequestId, at timestamp | Reopen |
ChecksRecorded | change_ ChangeRequestId, head Revision, verdict ChecksVerdict, at timestamp | Record |
DraftSet | change_ ChangeRequestId, draft boolean, at timestamp | Set |
HeadApproved | change_ ChangeRequestId, review_ ReviewId, head Revision, approved_ PrincipalId, at timestamp | Approve |
HeadPushed | change_ ChangeRequestId, from Revision, to Revision, at timestamp | Push |
MergeArmed | change_ ChangeRequestId, armed_ PrincipalId, at timestamp | Arm |
MergeDisarmed | change_ ChangeRequestId, at timestamp | Disarm |
MergeDueThe checks of an armed change request's head passed; the armed merge may now be made. | change_ ChangeRequestId, head Revision, armed_ optional PrincipalId, at timestamp | Record |
ReviewRequested | change_ ChangeRequestId, at timestamp | Request |
ReviewSubmitted | review_ ReviewId, change_ ChangeRequestId, reviewer PrincipalId, head Revision, verdict ReviewVerdict, at timestamp | Submit |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Views
| view | rows | fields |
|---|---|---|
ChangeRequestsChange requests | each ChangeRequest | change_ ChangeRequestId, repository_ RepositoryId, source_ ReferenceName, target_ ReferenceName, head Revision, title Content, opened_ PrincipalId, opened_ timestamp, checks ChecksVerdict, approved_ optional Revision, approved_ optional PrincipalId, proposal_ optional ProposalId, task_ optional TaskId, merged_ optional Revision, merged_ optional PrincipalId, merged_ optional GrantId, review_ optional string, draft boolean, review_ boolean, depends_ optional list of ChangeRequestId, armed boolean, armed_ optional PrincipalId, state State |
ReviewsReviews | each Review | review_ ReviewId, change_ ChangeRequestId, reviewer PrincipalId, head Revision, verdict ReviewVerdict, body Content, submitted_ timestamp, state State |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Types
| type | is | values or fields |
|---|---|---|
ChangeRequestId | an identifier or value | uuid |
ChecksVerdictThe combined verdict of the checks a merge requires, for the current head. Pending while no pipeline has started, Running while one runs and has not completed; a push makes it Pending again. A merge needs Passed. | one of | Pending, Running, Passed, Failed |
ReviewId | an identifier or value | uuid |
ReviewVerdictApprove binds an approval to the reviewed head; RequestChanges and Comment are recorded and approve nothing. | one of | Approve, Request, Comment |
More columns: swipe horizontally, or focus the table and use the arrow keys.
KPIs
4 KPIs from the pack's catalogue, packs/source-control/kpis.yaml. A gate must be zero for a variant of an architecture to count.
Correctness
| KPI | unit | better | gate | status |
|---|---|---|---|---|
merge_without_head_approvalChange requests merged at a head no approval was given for. How: ChangeRequestMerged events whose head is not the head of a HeadApproved event of the same change request after its last HeadPushed. Must be 0. | count | lower | gate | planned source: design |
merge_without_green_checksChange requests merged while the checks of their head had not passed. How: ChangeRequestMerged events whose head has no ChecksRecorded with verdict Passed for that head after the last HeadPushed. Must be 0. | count | lower | gate | planned source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Quality
| KPI | unit | better | gate | status |
|---|---|---|---|---|
change_request_cycle_secondsSeconds from a change request being opened to it being merged. How: Median of ChangeRequestMerged time minus ChangeRequestOpened time over merged change requests; closed ones are counted apart. | seconds | lower | – | planned source: design |
approval_invalidated_shareShare of approvals left behind by a later push to the change request. How: HeadApproved events followed by a HeadPushed of the same change request before it merged, divided by all HeadApproved events. Each one costs a second review. | share | lower | – | planned source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Settings
The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.
A part scm.change:
| setting | type | unit | default | contract | what |
|---|---|---|---|---|---|
count | integer of at least 1 | 1 | How many copies of the part run. | ||
per | part | One copy of the part for each copy of the named part. | |||
notes | notes | Free notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it. |
More columns: swipe horizontally, or focus the table and use the arrow keys.