Skip to main content

Module ports

Module ports 

Source
Expand description

Ports: the traits the engine’s business logic owns and adapters implement.

Dependency direction only (ADR 0020). These exist so pipeline, invariants, tree, worktree and crates/stack never name gitio::Repo — each function’s bound list is a reviewable statement of exactly how much git it is allowed to touch, and invariants can no longer so much as express git log.

Consumed by static dispatch. There is exactly one implementation of each git port, gitio::Repo, and ADR 0020 forbids a second one — a fake git for tests included. Invariants 1–4 compare the engine’s reconstruction against git’s own answer; against a fake they would compare the fake with the fake and pass while proving nothing (ADR 0002). Tests use hermetic temporary repositories and real git.

The two runtime-open abstractions in this crate — llm::LlmBackend and lang::Language — are deliberately NOT here. They are dyn because config and a plugin registry pick them at run time; nothing in this module is chosen at run time.

There is no trait Git: ObjectReader + … convenience supertrait, and there must not be: the whole value is that a consumer’s bounds name what it actually needs.

Structs§

AttrValue
One check-attr answer for one path.
CommitIdentity
Author/committer identity for a synthetic commit. Domain data: a renderer decides who its commits belong to.
CommitSummary
FiledReview
One review as the catalogue sees it.

Enums§

IndexEntry
One record to feed a scratch index.
ReviewIdentity
What a review was opened as. The id is a hash of this, so the id alone cannot answer what a review’s endpoints mean today.

Traits§

Ancestry
Placing one review’s head against another’s.
ArtefactStore
Somewhere the model can read the pre-group document from (ADR 0022).
AttributeSource
gitattributes lookup, for the generated-file hint — never enumeration.
CommitHistory
History browsing for the review-source picker.
CommitWriter
commit-tree. Separate from IndexSession because it does not touch an index — it takes a tree oid already written.
ConfigSource
Where configuration comes from.
DiffSource
Canonical enumeration (ADR 0005: total, no exclusions, ever).
GroupingCache
The grouping cache (ADR 0009).
IndexSession
A scratch index, alive as long as the value. Dropping it removes the temporary index file; blobs it wrote stay in the odb, unreferenced.
ObjectReader
Reading objects out of the odb.
ObjectWriter
Writing objects into the odb. Loose and unreferenced (so gc-able) by design — the engine creates a ref only where RefWriter says so.
RangeResolver
Turning what the user typed into diff endpoints. Consumed only by pipeline: nothing downstream of resolution ever re-resolves.
RecountSource
Invariant 4’s independent patch source, and nothing else.
RefWriter
update-ref. The only port in the engine that mutates repository state a user can see, with exactly one consumer: the shadow-branch renderer.
RepoLayout
Where this repository’s differential state lives. Path policy is domain (plan::grouping_cache_dir, plan::review_dir); this only says where the repository keeps its shared git directory.
ReviewCatalogue
Every review filed in this repository, and the joins between them.
ReviewStore
One review’s sidecar (ADR 0013).
TreeBuilder
Opening a scratch index. Never the user’s index, never a checkout (ADR 0011).
TreeResolver
Peeling an endpoint to its tree oid — the one thing invariant 3 compares against.
WorkingCopy
Reading the working copy. Only the ADR-0017 snapshots use this.