Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0003-planning-reconcile FR-010
The plan of a patch and its preview (0037-planning FR-011 , FR-032 ): a plan is what a source would write to carry a patch out, effect by effect (a target, the revision it expects, the text it makes and a sentence); a preview is that, with the SHA-256 of the plan as its hash. A write is held to a hash: with none it is a dry run, with another it is refused, and with the hash of the plan it is that plan.
import { decide, previewOf } from "./preview.ts" ;
// const p = await previewOf(plan); (await decide(plan, undefined)).kind === "dry-run" Source: commons/planning/src/logical/preview.ts
0 of 13 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
logical.Effecttype no test imports it type Effect = { readonly target : string ; readonly expect : string | null ; readonly after : string ; readonly summary : string };One thing a plan writes: where, the revision it expects of what is there (none where it must be absent), the text, and a sentence.
logical.Plantype no test imports it type Plan = { readonly source : string ; readonly place : string ; readonly patch : Patch ; readonly effects : readonly Effect [] };What a source would write to carry a patch out.
logical.Previewtype no test imports it type Preview = {
readonly source : string ;
readonly place : string ;
readonly effects : readonly { readonly target : string ; readonly expect : string | null ; readonly afterHash : string ; readonly summary : string }[];
readonly hash : string ;
};What a plan says it writes, with the hash a write is held to.
logical.previewOffunction no test imports it function previewOf (plan : Plan ): Promise <Preview >logical.Decisiontype no test imports it type Decision =
| { readonly kind : "dry-run" ; readonly preview : Preview }
| { readonly kind : "apply" ; readonly preview : Preview }
| { readonly kind : "stale" ; readonly given : string ; readonly preview : Preview };What a write asked for with a hash comes to.
logical.decidefunction no test imports it function decide (plan : Plan , given : string | undefined ): Promise <Decision >A write is a dry run unless it names the hash of the preview of the plan, and a hash that is not that of the plan is refused.
logical.changesfunction no test imports it function changes (plan : Plan ): boolean Whether a plan changes anything.
Effecttype no test imports it type Effect = { readonly target : string ; readonly expect : string | null ; readonly after : string ; readonly summary : string };One thing a plan writes: where, the revision it expects of what is there (none where it must be absent), the text, and a sentence.
Plantype no test imports it type Plan = { readonly source : string ; readonly place : string ; readonly patch : Patch ; readonly effects : readonly Effect [] };What a source would write to carry a patch out.
Previewtype no test imports it type Preview = {
readonly source : string ;
readonly place : string ;
readonly effects : readonly { readonly target : string ; readonly expect : string | null ; readonly afterHash : string ; readonly summary : string }[];
readonly hash : string ;
};What a plan says it writes, with the hash a write is held to.
previewOffunction no test imports it function previewOf (plan : Plan ): Promise <Preview >decidefunction no test imports it function decide (plan : Plan , given : string | undefined ): Promise <Decision >A write is a dry run unless it names the hash of the preview of the plan, and a hash that is not that of the plan is refused.
changesfunction no test imports it function changes (plan : Plan ): boolean Whether a plan changes anything.