Skip to content

Interface: GitNamespace ​

Defined in: git/src/builders/git-namespace-contract.ts:35

Public git builder and schema namespace contract (import { git } from '@paraharness/git').

Mounts ScopeReceiptSchema, SyncReceiptSchema, AbortMetaSchema, and all declarative Copy-on-Write worktree, hook, cross-verifier, tool, and delivery step builders.

Methods ​

candidateComparisonTools() ​

ts
candidateComparisonTools(runner?): readonly GitCandidateComparisonToolNode<GitWorktreeHandle>[];

Defined in: git/src/builders/git-namespace-contract.ts:192

Creates the speculative candidate comparison tool bundle (diffCandidates, readCandidateFile, evalInCandidates).

Enables candidateArbiter and .refineWinnerWhen() to compare candidate refs and run sandboxed benchmarks.

Parameters ​

ParameterTypeDescription
runner?MaybeBuilder<NodeRunnerNode>Optional subprocess runner pool governing git and benchmark command slots (defaults to DEFAULT_NODE_RUNNER_AST_NODE).

Returns ​

readonly GitCandidateComparisonToolNode<GitWorktreeHandle>[]

Frozen tuple of candidate comparison tool AST nodes.


commitAndPush() ​

ts
commitAndPush<TIn>(id, options): GitCommitAndPushBuilder<TIn>;

Defined in: git/src/builders/git-namespace-contract.ts:67

Creates a fluent builder for a retry-safe squash, rebase, verify, and push step.

Compiles into a passive GitCommitAndPushNode<TIn> dispatched via RuntimeExecutorRegistry.steps.

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownStep input payload type.

Parameters ​

ParameterTypeDescription
idstringUnique step node identifier.
optionsGitCommitAndPushOptions<TIn>Remote branch and commit message projections.

Returns ​

GitCommitAndPushBuilder<TIn>

Immutable fluent commit-and-push step builder.


cowWorktree() ​

ts
cowWorktree(options?): GitCowWorktreeBuilder;

Defined in: git/src/builders/git-namespace-contract.ts:53

Creates a fluent builder for a Tier-3 branchable Copy-on-Write Git worktree scope.

Provisions disjoint sibling <dir>/roots/<runId> and <dir>/forks/<runId>/<forkId> worktrees at runtime, defaulting repo to '.' and dir to '.paraharness/worktree'.

Parameters ​

ParameterTypeDescription
options?GitCowWorktreeOptionsOptional host repository path and worktree base directory.

Returns ​

GitCowWorktreeBuilder

Immutable fluent worktree scope builder.


discardBranch() ​

ts
discardBranch(id?): AstBuilder<GitDiscardBranchNode>;

Defined in: git/src/builders/git-namespace-contract.ts:132

Alias for git.resetWorktree() compiling to GitDiscardBranchNode (resetsRunOverlay: true).

Restores the worktree to targetStepBaseScopeCheckpoint and discards uncommitted overlay mutations.

Parameters ​

ParameterTypeDescription
id?stringOptional custom rewind hook identifier.

Returns ​

AstBuilder<GitDiscardBranchNode>

Immutable rewind hook builder.


keepWorktree() ​

ts
keepWorktree(id?): AstBuilder<GitKeepWorktreeNode>;

Defined in: git/src/builders/git-namespace-contract.ts:110

Creates a rewind hook builder preserving the active worktree and topology overlay in-place (resetsRunOverlay: false).

Used with .rewindTo(stepId, { onRewind: git.keepWorktree() }) for live steering without discarding work.

Parameters ​

ParameterTypeDescription
id?stringOptional custom rewind hook identifier.

Returns ​

AstBuilder<GitKeepWorktreeNode>

Immutable rewind hook builder.


mergeQueue() ​

ts
mergeQueue<TIn, TOut>(id, options): GitMergeQueueBuilder<TIn, TOut>;

Defined in: git/src/builders/git-namespace-contract.ts:85

Creates a fluent builder for a cumulative batch merge-train verification step.

Constructs a speculative rebase chain $R_1 \dots R_k$ up to maxBatchSize and binary-bisects on failure.

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownValidated step input type.
TOutunknownValidated step output type.

Parameters ​

ParameterTypeDescription
idstringUnique merge queue step identifier.
optionsGitMergeQueueOptions<TIn, TOut>Target branch, batch size, and verification check.

Returns ​

GitMergeQueueBuilder<TIn, TOut>

Immutable fluent merge queue step builder.


patchEquivalence() ​

ts
patchEquivalence(id?): CrossVerifierBuilder<GitWorktreeHandle, GitScopeReceipt, Record<string, unknown>, GitPatchEquivalenceNode<Record<string, unknown>>>;

Defined in: git/src/builders/git-namespace-contract.ts:161

Creates a CrossVerifierBuilder grouping speculative candidates by normalized patch equivalence.

Computes canonicalized patch digests and equivalence classes across surviving tournament branches.

Parameters ​

ParameterTypeDescription
id?stringOptional custom cross-verifier identifier.

Returns ​

CrossVerifierBuilder<GitWorktreeHandle, GitScopeReceipt, Record<string, unknown>, GitPatchEquivalenceNode<Record<string, unknown>>>

Immutable cross-verifier builder.


publicSurfaceCrossTester() ​

ts
publicSurfaceCrossTester(options): CrossVerifierBuilder<GitWorktreeHandle, GitScopeReceipt, Record<string, unknown>, GitPublicSurfaceCrossTesterNode<Record<string, unknown>>>;

Defined in: git/src/builders/git-namespace-contract.ts:143

Creates a CrossVerifierBuilder transplanting boundary-only tests across speculative worktree candidates.

Parses test imports against partitionMap.partitions[*].boundaryGlobs and cross-executes eligible tests.

Parameters ​

ParameterTypeDescription
optionsGitPublicSurfaceCrossTesterOptionsSubprocess runner and partition map configuration.

Returns ​

CrossVerifierBuilder<GitWorktreeHandle, GitScopeReceipt, Record<string, unknown>, GitPublicSurfaceCrossTesterNode<Record<string, unknown>>>

Immutable cross-verifier builder.


refReaderTools() ​

ts
refReaderTools(runner?): readonly GitRefReaderToolNode<GitWorktreeHandle>[];

Defined in: git/src/builders/git-namespace-contract.ts:179

Creates the read-only git ref inspection tool bundle (readRefFile, diffRefs, listRefFiles).

Enables actors to inspect refs/harness/aborted/<run-id>/<stepExecId> snapshots against the object store.

Parameters ​

ParameterTypeDescription
runner?MaybeBuilder<NodeRunnerNode>Optional subprocess runner pool governing git command slots (defaults to DEFAULT_NODE_RUNNER_AST_NODE).

Returns ​

readonly GitRefReaderToolNode<GitWorktreeHandle>[]

Frozen tuple of ref reader tool AST nodes.


resetWorktree() ​

ts
resetWorktree(id?): AstBuilder<GitDiscardBranchNode>;

Defined in: git/src/builders/git-namespace-contract.ts:121

Creates a rewind hook builder resetting the worktree to targetStepBaseScopeCheckpoint (resetsRunOverlay: true).

Restores both the physical working tree and the run's Copy-on-Write topology overlay to the target step entry.

Parameters ​

ParameterTypeDescription
id?stringOptional custom rewind hook identifier.

Returns ​

AstBuilder<GitDiscardBranchNode>

Immutable rewind hook builder.


snapshotAndReset() ​

ts
snapshotAndReset(id?): AstBuilder<GitSnapshotAndResetNode>;

Defined in: git/src/builders/git-namespace-contract.ts:99

Creates an idempotent abort hook builder snapshotting the dirty worktree to refs/harness/aborted/<run-id>/<stepExecId>.

Resets the working tree to handle.baseRef and clears unresolvedConflictPaths after snapshotting.

Parameters ​

ParameterTypeDescription
id?stringOptional custom abort hook identifier.

Returns ​

AstBuilder<GitSnapshotAndResetNode>

Immutable abort hook builder.

Properties ​

PropertyModifierTypeDescriptionDefined in
AbortMetaSchemareadonlyZodObject<{ abortedSnapshotRef: ZodString; resetToRef: ZodString; }, $strip>Zod schema validating GitAbortMeta objects returned by git.snapshotAndReset().git/src/builders/git-namespace-contract.ts:41
ScopeReceiptSchemareadonlyZodObject<{ baseBranch: ZodDefault<ZodString>; baseRef: ZodString; branchName: ZodOptional<ZodString>; diffStat: ZodString; headRef: ZodString; mutatedFiles: ZodReadonly<ZodArray<ZodString>>; }, $strip>Zod schema validating GitScopeReceipt objects returned by inspect() and commitChild().git/src/builders/git-namespace-contract.ts:37
SyncReceiptSchemareadonlyZodObject<{ baseBranch: ZodDefault<ZodString>; rebasedOntoRef: ZodString; updatedFiles: ZodReadonly<ZodArray<ZodString>>; }, $strip>Zod schema validating GitSyncReceipt objects returned by syncChild() and syncRoot().git/src/builders/git-namespace-contract.ts:39

Released under the MIT License.