Pack · source-control
scm.repository
A history of files kept by a forge. A repository holds revisions, each a snapshot of files named by the version control system (agentic.workspace.Revision) with the digest of its tree and its parent revisions; and references, the names that point at a revision. A movable reference (what a version control system calls a branch) is moved only from the revision its mover last saw, so two writers never overwrite each other; a fixed reference (a tag) never moves. A checkout binds a workspace (agentic.workspace) to a repository and a reference, which is how an agent's files come from and go back to a repository. An archived repository takes no new revision, reference or checkout.
Depends on
- scm.forge · pack source-control · 7 references
- workspace · layer 8 · 18 references
- principal · layer 1 · 18 references
- shared · layer 0 · 8 references
Used by
- scm.change · pack source-control · 9 references
- scm.check · pack source-control · 9 references
Entities
Checkout
A workspace that holds a repository's files at a reference. Its writes leave the workspace as a proposal (agentic.workspace) or as a revision pushed to a reference.
Identified by checkout_id (CheckoutId).
| field | type |
|---|---|
repository_id | RepositoryId |
workspace_id | WorkspaceId |
reference | ReferenceName |
checked_out_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
repositoryreferences Repository (one, byrepository_id)workspacereferences Workspace of workspace (one, byworkspace_id)
Lifecycle of Checkout
Removed.Reference
A name in the repository that points at one revision.
Identified by reference_id (ReferenceId).
| field | type |
|---|---|
repository_id | RepositoryId |
name | ReferenceName |
kind | ReferenceKind |
target | Revision |
moved_by | PrincipalId |
moved_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
moverreferences Principal of principal (one, bymoved_by)
Lifecycle of Reference
Deleted.Repository
One repository on one forge.
Identified by repository_id (RepositoryId).
| field | type | meaning |
|---|---|---|
forge_id | ForgeId | |
name | Name | |
default_reference | ReferenceName | The reference a new checkout and a new change request target unless told otherwise. |
created_by | PrincipalId | |
created_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
forgereferences Forge of scm.forge (one, byforge_id)creatorreferences Principal of principal (one, bycreated_by)revisionsowns Revision (many, byrepository_id)referencesowns Reference (many, byrepository_id)
Lifecycle of Repository
Revision
One snapshot of the repository's files. It is recorded once and never changes; its name is the version control system's, its tree digest says what files it holds.
Identified by revision_id (RevisionId).
| field | type |
|---|---|
repository_id | RepositoryId |
revision | Revision |
tree_digest | TreeDigest |
tree | list of TreeEntry |
parents | list of Revision |
authored_by | PrincipalId |
message | Content |
recorded_at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
authorreferences Principal of principal (one, byauthored_by)
Lifecycle: one state, Recorded; a recorded Revision does not change.
Commands
ArchiveRepository
Archive a repository.
Called by: Repository manager.
| field | type |
|---|---|
repository_id | RepositoryId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-repository refused | no such Repository | Repository: No repository of this identity exists. |
archived | otherwise | moves the Repository Active → Archived; emits Repository |
wrong-state refused | the Repository is in a state that does not allow it | Repository: The repository is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
CheckOut
Check a repository out into a workspace.
Called by: Repository manager.
| field | type |
|---|---|
checkout_id | CheckoutId |
repository_id | RepositoryId |
workspace_id | WorkspaceId |
reference | ReferenceName |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-repository refused | no Repository for repository_ | Repository: No repository of this identity exists. |
unknown-workspace refused | no Workspace for workspace_ | Unknown: No workspace of this identity exists. |
archived refused | the Repository of repository_ has state == Archived | Repository: The repository is archived; it takes no new revision, reference or checkout. |
checked-out | otherwise | creates a Checkout in Active; emits Checked |
More columns: swipe horizontally, or focus the table and use the arrow keys.
CreateReference
Create a reference.
Called by: Committer.
| field | type |
|---|---|
reference_id | ReferenceId |
repository_id | RepositoryId |
name | ReferenceName |
kind | ReferenceKind |
target | Revision |
by | PrincipalId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
already-exists refused | the Reference exists already | Reference: A reference of this identity exists. |
no-such-repository refused | no Repository for repository_ | Repository: No repository of this identity exists. |
unknown-principal refused | no Principal for by | Unknown: No principal of this identity is registered. |
archived refused | the Repository of repository_ has state == Archived | Repository: The repository is archived; it takes no new revision, reference or checkout. |
created | otherwise | creates a Reference in Live; emits Reference |
More columns: swipe horizontally, or focus the table and use the arrow keys.
CreateRepository
Create a repository on a forge.
Called by: Repository manager.
| field | type |
|---|---|
repository_id | RepositoryId |
forge_id | ForgeId |
name | Name |
default_reference | ReferenceName |
created_by | PrincipalId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
unknown-forge refused | no Forge for forge_ | Unknown: No forge of this identity is registered. |
unknown-creator refused | no Principal for created_ | Unknown: No principal of this identity is registered. |
forge-retired refused | the Forge of forge_ has state == Retired | Forge: The forge is retired; it hosts no new repository. |
created | otherwise | creates a Repository in Active; emits Repository |
More columns: swipe horizontally, or focus the table and use the arrow keys.
DeleteReference
Delete a reference.
Called by: Committer.
| field | type |
|---|---|
reference_id | ReferenceId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-reference refused | no such Reference | Reference: No reference of this identity exists. |
fixed refused | kind == Fixed | Reference: The reference is fixed; it never moves and is never deleted. |
deleted | otherwise | moves the Reference Live → Deleted; emits Reference |
wrong-state refused | the Reference is in a state that does not allow it | Reference: The reference is deleted. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
MoveReference
Move a reference to another revision. Compare and set: the reference moves only when it still points at expected, the revision the mover last saw.
Called by: Committer.
| field | type |
|---|---|
reference_id | ReferenceId |
expected | Revision |
to | Revision |
by | PrincipalId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-reference refused | no such Reference | Reference: No reference of this identity exists. |
deleted refused | state == Deleted | Reference: The reference is deleted. |
fixed refused | kind == Fixed | Reference: The reference is fixed; it never moves and is never deleted. |
moved-since refused | target != input. | Reference: The reference no longer points where the mover saw it: someone moved it since. The mover reads it again and decides. |
unknown-principal refused | no Principal for by | Unknown: No principal of this identity is registered. |
moved | otherwise | updates the Reference; emits Reference |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RecordRevision
Record a revision.
Called by: Committer.
| field | type |
|---|---|
revision_id | RevisionId |
repository_id | RepositoryId |
revision | Revision |
tree_digest | TreeDigest |
tree | list of TreeEntry |
parents | list of Revision |
authored_by | PrincipalId |
message | Content |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
already-recorded refused | the Revision exists already | Revision: A revision of this identity is already recorded; a revision never changes. |
no-such-repository refused | no Repository for repository_ | Repository: No repository of this identity exists. |
unknown-author refused | no Principal for authored_ | Unknown: No principal of this identity is registered. |
archived refused | the Repository of repository_ has state == Archived | Repository: The repository is archived; it takes no new revision, reference or checkout. |
recorded | otherwise | creates a Revision in Recorded; emits Revision |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RemoveCheckout
Remove a checkout.
Called by: Repository manager.
| field | type |
|---|---|
checkout_id | CheckoutId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-checkout refused | no such Checkout | Checkout: No checkout of this identity exists. |
removed | otherwise | moves the Checkout Active → Removed; emits Checkout |
wrong-state refused | the Checkout is in a state that does not allow it | Checkout: The checkout is removed. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
UnarchiveRepository
Take a repository out of the archive.
Called by: Repository manager.
| field | type |
|---|---|
repository_id | RepositoryId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-repository refused | no such Repository | Repository: No repository of this identity exists. |
unarchived | otherwise | moves the Repository Archived → Active; emits Repository |
wrong-state refused | the Repository is in a state that does not allow it | Repository: The repository is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Events
| event | fields | emitted by |
|---|---|---|
CheckedOut | checkout_ CheckoutId, repository_ RepositoryId, workspace_ WorkspaceId, reference ReferenceName, at timestamp | Check |
CheckoutRemoved | checkout_ CheckoutId, at timestamp | Remove |
ReferenceCreated | reference_ ReferenceId, repository_ RepositoryId, name ReferenceName, kind ReferenceKind, target Revision, by PrincipalId, at timestamp | Create |
ReferenceDeleted | reference_ ReferenceId, at timestamp | Delete |
ReferenceMovedEvent | reference_ ReferenceId, from Revision, to Revision, by PrincipalId, at timestamp | Move |
RepositoryArchivedEvent | repository_ RepositoryId, at timestamp | Archive |
RepositoryCreated | repository_ RepositoryId, forge_ ForgeId, name Name, default_ ReferenceName, created_ PrincipalId, at timestamp | Create |
RepositoryUnarchived | repository_ RepositoryId, at timestamp | Unarchive |
RevisionRecorded | revision_ RevisionId, repository_ RepositoryId, revision Revision, tree_ TreeDigest, parents list of Revision, authored_ PrincipalId, at timestamp | Record |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Views
| view | rows | fields |
|---|---|---|
CheckoutsCheckouts | each Checkout | checkout_ CheckoutId, repository_ RepositoryId, workspace_ WorkspaceId, reference ReferenceName, checked_ timestamp, state State |
ReferencesReferences | each Reference | reference_ ReferenceId, repository_ RepositoryId, name ReferenceName, kind ReferenceKind, target Revision, moved_ PrincipalId, moved_ timestamp, state State |
RepositoriesRepositories | each Repository | repository_ RepositoryId, forge_ ForgeId, name Name, default_ ReferenceName, created_ PrincipalId, created_ timestamp, state State |
RevisionsRevisions | each Revision | revision_ RevisionId, repository_ RepositoryId, revision Revision, tree_ TreeDigest, tree list of TreeEntry, parents list of Revision, authored_ PrincipalId, message Content, recorded_ timestamp, state State |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Types
| type | is | values or fields |
|---|---|---|
CheckoutId | an identifier or value | uuid |
ReferenceId | an identifier or value | uuid |
ReferenceKindMovable is moved to later revisions (a branch); Fixed names one revision for good (a tag). | one of | Movable, Fixed |
ReferenceNameThe name of a reference inside its repository, such as main or release/1.2. | an identifier or value | string |
RepositoryId | an identifier or value | uuid |
RevisionId | an identifier or value | uuid |
TreeDigestThe digest of a revision's tree: every path and the digest of its content, in path order. Two revisions with the same tree digest hold the same files. | an identifier or value | string |
TreeEntry | a record | path Path, content Content, executable boolean |
More columns: swipe horizontally, or focus the table and use the arrow keys.
KPIs
2 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 |
|---|---|---|---|---|
reference_lost_updateReference moves that dropped a revision another writer had moved the reference to. How: ReferenceMovedEvent events whose from is not the reference's target at that moment, by the preceding ReferenceCreated or ReferenceMovedEvent. The compare-and-set of MoveReference refuses these; any found is an implementation defect. 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 |
|---|---|---|---|---|
revision_to_reference_secondsSeconds from a revision being recorded to a reference pointing to it. How: Median over revisions of the time from RevisionRecorded to the first ReferenceCreated or ReferenceMovedEvent whose target is that revision. Revisions no reference reaches are counted apart. | seconds | 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.repository:
| 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.