github_grid_assets library

GitHub identity, authenticated transport, pull-request delivery, and reconciliation assets for grid extensions.

Classes

BdGitHubIntakeStore
bd-CLI implementation of GitHubIntakeStore.
CiFeedbackDecision
A feedback state correlated with the current durable rework generation.
CiFeedbackProjection
Projects normalized pull-request feedback into the durable bead/control rails.
DirectMergePolicy
Pushes a reviewed branch directly to an unprotected base branch.
FeedbackCommandCompleted
FeedbackCommandRefused
FeedbackCommandResult
FeedbackCommandSender
FileGitHubCursorStore
A per-seat file cursor store using atomic sibling-file replacement.
GitHubAppClient
An authenticated GitHub REST client using installation identity.
GitHubAppClientAssets
Provides one App-authenticated client for one seat composition.
GitHubAppConfig
Non-secret identifiers and endpoint configuration for a GitHub App.
GitHubAppCredentialLoader
Resolves a GitHub App private key with inert-or-loud semantics.
GitHubAppPrivateKey
An operator-provisioned GitHub App private key loaded from disk.
GitHubAppPrOpener
Opens — or REUSES — pull requests with a per-substation GitHub App identity.
GitHubAppTokenProvider
Signs GitHub App JWTs and exchanges them for installation access tokens.
GitHubAutoMergeDelivery
Opens a pull request through GitHubPrDelivery, then conditionally enables GitHub native auto-merge from the bounded validation and grade receipts.
GitHubCursorStore
Relocation seam for loading and atomically replacing one seat cursor.
GitHubDeliveryPolicy
A composition value selecting one GitHub delivery posture.
GitHubDirectMergeDelivery
Pushes a reviewed branch directly to an unprotected base branch, refusing loudly before any base mutation when protection cannot be ruled out.
GitHubGridAssets
Binds GitHub delivery and resident CI feedback for a substation.
GitHubHttpRequest
An HTTP request sent to the GitHub REST API.
GitHubHttpResponse
The relevant parts of an HTTP response from GitHub.
GitHubHttpTransport
Transport seam for GitHub REST API requests.
GitHubInstallationToken
An installation access token and its GitHub-provided expiry.
GitHubIntakeProjection
Projects admitted GitHub events into intake beads.
GitHubIntakeRecord
Thin GitHub entity content projected into a bead.
GitHubIntakeStore
Upserts GitHub intake records by stable node id.
GitHubIssueWatch
ONE outbound issue the station keeps watching after it was opened.
GitHubIssueWatchCursorRecord
The durable state of ONE watched outbound issue.
GitHubIssueWatchProjection
Projects observations on WATCHED OUTBOUND issues onto the beads that caused them.
GitHubIssueWatchUpdate
One watched-issue observation, projected onto the bead that CAUSED it.
GitHubKeyFileStat
File metadata used to enforce the private key storage policy.
GitHubMergeEnabled
Native auto-merge was enabled.
GitHubMergeRefused
Native auto-merge was refused.
GitHubMergeResult
Result of requesting native auto-merge.
GitHubMergeRunner
The GitHub command seam needed by merge delivery postures.
GitHubPollCoordinator
Serializes and start-spaces poll requests sharing an installation quota.
GitHubPollCoordinatorAssets
Owns the STATION's one GitHub poll coordinator and provides it to every repository beneath it.
GitHubPrDelivery
The substation's GitHub delivery method: commit residue, force-with-lease push, then reuse or open the pull request.
GitHubPrOpenerAssets
Provides App-authenticated pull-request opening when configured.
GitHubProtected
The base branch is protected.
GitHubProtectionProbeFailed
Branch protection could not be determined safely.
GitHubProtectionResult
Result of probing base-branch protection.
GitHubPullFeedbackCursorRecord
The durable BASELINE of one OPEN pull request's feedback state.
GitHubReadClient
A GET-only GitHub REST client that has NO installation.
GitHubReconciler
Polls one repository for one substation and emits normalized observations.
GitHubReconcilerAssets
Describes one repository's resident reconciler subtree — and owns no effect of its own.
GitHubReconcilerBindingAssets
Provides the durable cursor, the SELF-only intake sink, and the CI feedback projection for one seat.
GitHubReconcilerConfig
Value configuration for one repository's resident GitHub reconciler.
GitHubReconcilerCursor
Durable per-substation GitHub polling state.
GitHubReconcilerRuntime
One resident seat's reconciliation WORK — and nothing about its schedule.
GitHubReconciliationQuery
The STATION-REGISTERED standing query that runs seat reconciliation on the fenced service tick.
GitHubSelfTrust
SELF-only GitHub actor trust for v1 intake.
GitHubUnprotected
The base branch is not protected.
IoGitHubHttpTransport
A dart:io implementation of GitHubHttpTransport.
MountedSubstationSeed
The offline-enumerable projection mounted by one SubstationSeed.
NormalizedGitHubEvent
One transport-neutral GitHub observation consumed by projection siblings.
PendingObservation
One observation persisted PENDING, with the delivery legs that have acked.
PrAutoMergePolicy
Opens a pull request and enables native auto-merge when receipts qualify.
PrNoMergePolicy
Opens or reuses a pull request and leaves merging to a human.
ResidentFeedbackCommandSender
Sends CI feedback through the already-running station's command endpoint.
SubstationAppIdentity
A GitHub App DELIVERY IDENTITY for ONE substation seat — config identity only, a plain value type.
SubstationSeed
THE composed substation seed — one substation of the composing station, authored as a value-configured StatelessSeed.
SystemGitHubMergeRunner
Runs the minimal gh commands for native auto-merge and protection probes.
WorkflowRunFailedJob
One job of a concluded workflow run that did NOT succeed.
WorkflowRunIntakeRule
One seat-declared criterion selecting which completed workflow runs become station work.

Enums

CiFeedbackAction
The effect implied by one pull request's aggregate check state.
CommitteeGrade
Ordered committee grades, best to worst.
GitHubIssueWatchChange
The kind of life event observed on a watched OUTBOUND issue.
GitHubReconcilerArm
Selects whether a GitHub reconciler is constructed for a composition.
PullRequestCheckState
The AGGREGATE state of every check run GitHub reported for one pull request's head commit.
PullRequestMergeability
Whether GitHub could merge the pull request when it was observed.

Extensions

NormalizedGitHubEventPatterns on NormalizedGitHubEvent
Adds pattern-matching-related methods to NormalizedGitHubEvent.
WorkflowRunFailedJobPatterns on WorkflowRunFailedJob
Adds pattern-matching-related methods to WorkflowRunFailedJob.

Constants

kCiFeedbackCapGateUnresolvedFlare → const String
The flare name carried by a capped work bead whose ci-rework cap gate the grid STATE store refused to mint.
kCiFeedbackDeliveryLeg → const String
The delivery-leg name under which CiFeedbackProjection is registered.
kCiFeedbackIgnoredFlare → const String
The flare name carried by an observation this leg declined to act on.
kCiFeedbackLandingUnresolvedFlare → const String
The flare name carried by a merged pull request whose work bead the scoped work store could not resolve.
kCiFeedbackUnattributedFlare → const String
The flare name carried by an open pull request this leg could not attribute to a bead.
kDefaultWorkflowRunConclusions → const Set<String>
The completed-run conclusions a rule admits when it declares none.
kDefaultWorkflowRunEvents → const Set<String>
The workflow_run trigger events a rule admits when it declares none.
kForeignIssueWatchRateKey → const String
The GitHubPollCoordinator key every FOREIGN read is scheduled under.
kGitHubIssueWatchDeliveryLeg → const String
The delivery-leg name under which GitHubIssueWatchProjection is registered.
kGitHubWorkflowScheme → const String
The ActorIdentity scheme carrying a repository's OWN workflow identity.
kIssueWatchChangeKey → const String
The github.watch.* metadata key naming what last happened.
kIssueWatchCommentedChange → const String
The GitHubIssueWatchUpdate.change value carried by a COMMENT.
kIssueWatchNodeIdKey → const String
The github.watch.* metadata key naming the watched issue's node id.
kIssueWatchNumberKey → const String
The github.watch.* metadata key naming the watched issue number.
kIssueWatchObservationKey → const String
The github.watch.* metadata key naming the last projected observation.
kIssueWatchRepositoryKey → const String
The github.watch.* metadata key naming the watched repository.
kIssueWatchResourceActor → const String
The actor a watch observation carries when GitHub named nobody.
kIssueWatchStateKey → const String
The github.watch.* metadata key naming the issue's current state.
kIssueWatchStateReasonKey → const String
The github.watch.* metadata key naming the issue's current state reason.
kIssueWatchUpdatedAtKey → const String
The github.watch.* metadata key naming the issue's updated_at.
kMaxGitHubCauseChars → const int
The character budget a rendered cause gets in githubFailureCause.
kPullFeedbackSkippedFlare → const String
The flare name carried by an open pull the feedback leg could not observe.
kPullRequestGreenStallBound → const Duration
How long an OPEN pull request may sit GREEN before the feedback leg reports it as stalled.
kSinkDeliveryLeg → const String
The reserved delivery-leg name for the reconciler's own GitHubEventSink.
kUnauthenticatedGitHubMinimumSpacing → const Duration
The floor between two TOKEN-LESS GitHub reads.
kWorkflowRunActor → const String
The --actor a self-approved workflow-run filing is recorded under.
kWorkflowRunKind → const String
The GitHubIntakeRecord.kind of a concluded workflow run.

Functions

autoMergeGateRefusal(Map<String, String> payload, {required CommitteeGrade minimumGrade}) → String?
Returns null only when the bounded landing receipts permit auto-merge.
ciReworkCapGateNode(String beadId) → String
The node a ci-rework cap gate blocks, for beadId: the same <bead>/<leaf> shape every engine-minted gate's node carries.
createGitHubHttpTransport() → GitHubHttpTransport
Creates the production GitHub HTTP transport.
createGitHubReconcilerRuntime({required GitHubReconcilerConfig config, required GitHubAppClient client, required GitHubCursorStore cursors, required GitHubEventSink emit, required ExplorationTransport? transport, required GitHubReadClient? foreignClient, required GitHubPollCoordinator coordinator}) → GitHubReconcilerRuntime
Creates the production polling runtime for config on the station's shared coordinator.
decideCiFeedback({required String beadId, required String sessionId, required Iterable<String> workBeadKeys, required String feedbackIdentity, required PullRequestCheckState checkState}) → CiFeedbackDecision
Derives the effect of checkState against the immutable rework ledger.
githubFailureCause(Object error) → String
Renders error as the TYPE-LED, bounded cause every GitHub failure in this package ends with.
githubRestHeaders({String? token, Map<String, String> headers = const <String, String>{}, bool jsonBody = false}) → Map<String, String>
The REST headers EVERY GitHub request from this package carries.
matchWorkflowRunRule(Iterable<WorkflowRunIntakeRule> rules, {required String workflowPath, required String event, required String headBranch, required String conclusion, required String defaultBranch}) → WorkflowRunIntakeRule?
The FIRST rule in rules that matches, or null when none does.
nextGitHubPageUri(String? linkHeader) → Uri?
Returns the rel="next" target advertised by linkHeader, or null when the header is absent, empty, or advertises no next page.
parseGitHubRemote(String remote) → (String, String)
Parses git@host:owner/repo.git, ssh://git@host/owner/repo.git, or https://host/owner/repo.git into GitHub repository coordinates.
platformEnvironment() → Map<String, String>
Returns the current process environment.
platformRead(String path) → Future<String>
Reads the file at path as text.
platformStat(String path) → Future<GitHubKeyFileStat>
Reads platform file metadata for path.
projectCiFeedback(CiFeedbackProjection? projection, NormalizedGitHubEvent event) → Future<void>
Routes one observation to the CI-feedback leg, or nowhere.
projectIssueWatch(GitHubIssueWatchProjection? projection, NormalizedGitHubEvent event) → Future<void>
Routes one observation to the WATCH leg, or nowhere.
pullRequestBodyBeadReferences(String body) → List<String>
The DISTINCT bead references stated in body's Refs: trailers.
readOriginRemote(String workDir) → Future<String>
Reads remote.origin.url without consulting gh or its credentials.
utcNow() → DateTime
Returns the current UTC time.

Typedefs

CiFeedbackReporter = void Function(String flareName, String action, Object error, StackTrace stackTrace)
Reports one CI-feedback outcome the leg declined to act on.
EnvironmentReader = Map<String, String> Function()
Reads the current process environment.
GitHubClock = DateTime Function()
Supplies the current time, allowing deterministic token lifecycle tests.
GitHubEventSink = Future<void> Function(NormalizedGitHubEvent event)
Receives one normalized observation.
GitHubFeedbackStateRunnerFactory = BdRunner Function(String stateRoot)
Builds the bd runner for the grid STATE store rooted at stateRoot.
GitHubHttpTransportFactory = GitHubHttpTransport Function()
Creates the HTTP transport owned by one GitHub App client composition.
GitHubPollCoordinatorFactory = GitHubPollCoordinator Function()
Constructs the station's shared poll coordinator.
GitHubPullFeedbackErrorReporter = void Function(int pullNumber, String failure, StackTrace stackTrace)
Reports that ONE open pull could not be observed this cycle.
GitHubReadScheduler = Future<GitHubHttpResponse> Function(Future<GitHubHttpResponse> request())
Schedules one foreign read and returns its response.
GitHubReconcilerRuntimeFactory = GitHubReconcilerRuntime Function({required GitHubAppClient client, required GitHubReconcilerConfig config, required GitHubPollCoordinator coordinator, required GitHubCursorStore cursors, required GitHubEventSink emit, required GitHubReadClient? foreignClient, required ExplorationTransport? transport})
Constructs a runtime from composition values and injected implementations.
GitRemoteReader = Future<String> Function(String workDir)
Reads the origin URL for the checkout rooted at workDir.
KeyFileReader = Future<String> Function(String path)
Reads the PEM contents at a key path.
KeyFileStatReader = Future<GitHubKeyFileStat> Function(String path)
Reads filesystem metadata for a key path.
PollClock = DateTime Function()
Injectable polling clock.
PollDelay = Future<void> Function(Duration duration)
Injectable polling delay.

Exceptions / Errors

GitHubPollException
A failed conditional GitHub polling request.
GitHubReadException
A foreign read that could not be performed at all.