physical.DEFAULT_BASEconstno test imports itconst DEFAULT_BASE: "origin/main"The revision a plan compares with where none is given.
What repoctl prove does in the world (commons repoctl 0008-repoctl-prove FR-001, FR-006 to FR-008): it asks Git what changed (the files and their text at the merge base and now), reads the import graph of the libraries from their sources, has the compiler emit the declarations of a library at the base and now so that their fingerprints can be compared, asks the planner of the Logical layer for the plan (again, where it needs a surface it was not given), and runs the proofs of the tiers that run on this machine. Each proof is one program run in the folder it belongs to.
The declarations at the base come from git archive of the library's folder into a private folder that shares the checkout's node_modules, so that the base is compiled by the compiler of the checkout; a library's dependencies are the checkout's, so only the library's own sources differ between the two emits.
import { commandOf } from "./prove.ts";
commandOf("/repo", { kind: "sync-check" }, "origin/main")?.argv[0]; // "bun"physical.DEFAULT_BASEconstno test imports itconst DEFAULT_BASE: "origin/main"The revision a plan compares with where none is given.
physical.Changestypeno test imports ittype Changes = { readonly known: true; readonly mergeBase: string; readonly changed: readonly ChangedFile[] } | { readonly known: false; readonly why: string };What Git says changed: the merge base and the files with their text there and now, or that it cannot say.
physical.gatherChangesfunctionno test imports itfunction gatherChanges(w: World, base: string): Promise<Changes>The files changed since the merge base of base and the head (the working tree's tracked and new files included), each with its text at the merge base and now.
physical.readGraphfunctionno test imports itfunction readGraph(w: World): Promise<Result<readonly LibraryNode[], string>>The libraries of the repository as the planner reads them: what each imports from the others, whether it is foundation and the systems it has code of its own for.
physical.surfaceOfLibraryfunctionno test imports itfunction surfaceOfLibrary(w: World, node: LibraryNode, mergeBase: string, changedHere: boolean): Promise<LibrarySurface>The surface of a library now and, where it changed, against the merge base: the delta and what its declarations mention.
physical.Plannedtypeno test imports ittype Planned = {
readonly plan: ProofPlan;
readonly seconds: number;
readonly surfaces: number;
readonly changed: readonly ChangedFile[];
readonly graph: readonly LibraryNode[];
};What a plan was made from, for the numbers a run reports and the selection of tests: the changed files, the libraries and their surfaces.
physical.makePlanfunctionno test imports itfunction makePlan(w: World, base: string, all: boolean): Promise<Result<Planned, string>>The plan of the working tree against a base, or why it cannot be made.
physical.Commandtypeno test imports ittype Command = { readonly argv: readonly string[]; readonly cwd: string; readonly needs?: string };A program to run for a proof, in a folder, with what is needed to say that it does not apply here.
physical.commandOffunctionno test imports itfunction commandOf(repo: string, proof: Proof, base: string, folderOf?: (name: LibraryName) => string): Command | undefinedThe program a proof runs, from the checkout's root; none where the proof runs elsewhere (CI, the nightly run, the release).
physical.ProofOutcometypeno test imports ittype ProofOutcome =
| { readonly kind: "passed"; readonly seconds: number; readonly detail: string }
| { readonly kind: "failed"; readonly seconds: number; readonly output: readonly string[]; readonly detail: string }
| { readonly kind: "not-here"; readonly why: string };How a proof ended on this machine.
physical.runProoffunctionno test imports itfunction runProof(w: World, proof: Proof, base: string): Promise<ProofOutcome>Runs one proof's program in its folder.
physical.LOCAL_TIERSconstno test imports itconst LOCAL_TIERS: readonly ProofTier[]The tiers that run on a machine by default: the cheap ones, which are what an edit and a push need.
DEFAULT_BASEconstno test imports itconst DEFAULT_BASE: "origin/main"The revision a plan compares with where none is given.
Changestypeno test imports ittype Changes = { readonly known: true; readonly mergeBase: string; readonly changed: readonly ChangedFile[] } | { readonly known: false; readonly why: string };What Git says changed: the merge base and the files with their text there and now, or that it cannot say.
gatherChangesfunctionno test imports itfunction gatherChanges(w: World, base: string): Promise<Changes>The files changed since the merge base of base and the head (the working tree's tracked and new files included), each with its text at the merge base and now.
readGraphfunctionno test imports itfunction readGraph(w: World): Promise<Result<readonly LibraryNode[], string>>The libraries of the repository as the planner reads them: what each imports from the others, whether it is foundation and the systems it has code of its own for.
surfaceOfLibraryfunctionno test imports itfunction surfaceOfLibrary(w: World, node: LibraryNode, mergeBase: string, changedHere: boolean): Promise<LibrarySurface>The surface of a library now and, where it changed, against the merge base: the delta and what its declarations mention.
Plannedtypeno test imports ittype Planned = {
readonly plan: ProofPlan;
readonly seconds: number;
readonly surfaces: number;
readonly changed: readonly ChangedFile[];
readonly graph: readonly LibraryNode[];
};What a plan was made from, for the numbers a run reports and the selection of tests: the changed files, the libraries and their surfaces.
makePlanfunctionfunction makePlan(w: World, base: string, all: boolean): Promise<Result<Planned, string>>The plan of the working tree against a base, or why it cannot be made.
Commandtypeno test imports ittype Command = { readonly argv: readonly string[]; readonly cwd: string; readonly needs?: string };A program to run for a proof, in a folder, with what is needed to say that it does not apply here.
commandOffunctionno test imports itfunction commandOf(repo: string, proof: Proof, base: string, folderOf?: (name: LibraryName) => string): Command | undefinedThe program a proof runs, from the checkout's root; none where the proof runs elsewhere (CI, the nightly run, the release).
ProofOutcometypeno test imports ittype ProofOutcome =
| { readonly kind: "passed"; readonly seconds: number; readonly detail: string }
| { readonly kind: "failed"; readonly seconds: number; readonly output: readonly string[]; readonly detail: string }
| { readonly kind: "not-here"; readonly why: string };How a proof ended on this machine.
runProoffunctionno test imports itfunction runProof(w: World, proof: Proof, base: string): Promise<ProofOutcome>Runs one proof's program in its folder.
LOCAL_TIERSconstno test imports itconst LOCAL_TIERS: readonly ProofTier[]The tiers that run on a machine by default: the cheap ones, which are what an edit and a push need.