/** * @module pr-helpers * * Helper functions for Pull Request lifecycle, cryptographic Sync Delegate Keystone * verification, admission policy gating, and AOT target index synchronization. */ import { MetaspaceService } from '../../witness/space/metaspace/metaspace-types.mjs'; import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs'; import { CosmosIbGib_V1 } from '../cosmos/cosmos-types.mjs'; import { PR_STATUS_AUTO_MERGED, PR_STATUS_MERGED, PR_STATUS_PENDING, PR_STATUS_REJECTED } from './pr-constants.mjs'; import { ApprovePullRequestOpts, IngestionGateResult, IngestPullRequestCommitOpts, PullRequestIb_V1, PullRequestIbGib_V1, PullRequestSubmission, RejectPullRequestOpts, ValidateSyncDelegateKeystoneParams, ValidateSyncDelegateKeystoneResult } from './pr-types.mjs'; /** * Constructs an ib string for a PullRequestIbGib. * Format: `pull-request ` */ export declare function getPullRequestIb({ targetCosmosName, targetGalaxyName, targetBranchName, }: { targetCosmosName: string; targetGalaxyName: string; targetBranchName: string; }): string; /** * Parses a pull-request ib string into its constituent cosmos, galaxy, and branch names. */ export declare function parsePullRequestIb({ ib }: { ib: string; }): PullRequestIb_V1; /** * Type guard for PullRequestIbGib_V1. */ export declare function isPullRequest(x: any): x is PullRequestIbGib_V1; /** * Creates a new Genesis PullRequestIbGib representing a candidate PR or staged submission. */ export declare function createPullRequestIbGib({ submission, status, rejectionReason, mergedCommitAddr, reviewerKeystoneTjp, space, metaspace, }: { submission: PullRequestSubmission; status?: typeof PR_STATUS_PENDING | typeof PR_STATUS_AUTO_MERGED | typeof PR_STATUS_MERGED | typeof PR_STATUS_REJECTED; rejectionReason?: string; mergedCommitAddr?: string; reviewerKeystoneTjp?: string; space: IbGibSpaceAny; metaspace?: MetaspaceService; }): Promise; /** * Links a pull request stone to a CosmosIbGib under the `@pull_request` soft link in data. */ export declare function linkPullRequestToCosmos({ cosmosIbGib, pullRequestIbGib, space, metaspace, }: { cosmosIbGib: CosmosIbGib_V1; pullRequestIbGib: PullRequestIbGib_V1; space: IbGibSpaceAny; metaspace?: MetaspaceService; }): Promise; /** * Retrieves all staged/pending pull requests linked to a CosmosIbGib. */ export declare function getStagedPullRequests({ cosmosIbGib, space, metaspace, }: { cosmosIbGib: CosmosIbGib_V1; space: IbGibSpaceAny; metaspace?: MetaspaceService; }): Promise; /** * Cryptographically validates an evolved Sync Delegate Keystone: * 1. Validates intrinsic hash integrity of the keystone stone. * 2. Verifies proof and claim: claim verb must be 'sync' or 'sign'. * 3. Enforces cryptographic target binding (claim.target matches expected candidate target address, if specified). * 4. Verifies delegate lineage and permissions under author's primary keystone identity. * 5. Enforces server lock-step invariant and keystone evolution transition (n -> n+1). * 6. Burns frame against replay attacks by persisting frame n+1 in server space. */ export declare function validateSyncDelegateKeystone(params: ValidateSyncDelegateKeystoneParams): Promise; /** * Primary Ingestion Gate: * Ingests a candidate commit or pull request submission into a Cosmos/Galaxy branch. * * 1. Cryptographically validates evolvedSyncDelegateKeystone (intrinsic hash, claim verb, * n -> n+1 transition, frame burning). * 2. Evaluates admission policy via `isAuthorizedToPost` on target Cosmos. * 3. Handles: * - Rejection (returns status: 'rejected') * - Moderation (stages in PR queue, returns status: 'staged-pr') * - Public-open / Authorized Auto-Merge (commits files, updates Metatext AOT targets index, * returns status: 'auto-merged'). */ export declare function ingestPullRequestCommit(opts: IngestPullRequestCommitOpts): Promise; /** * Approves a staged Pull Request, committing its candidate changes into the target branch * and synchronizing AOT target indices if in a Metatext galaxy. */ export declare function approvePullRequest(opts: ApprovePullRequestOpts): Promise; /** * Rejects a staged Pull Request with a reason. */ export declare function rejectPullRequest(opts: RejectPullRequestOpts): Promise; //# sourceMappingURL=pr-helpers.d.mts.map