Expand description
The repository content the dependent-version planner reads, and its two failure kinds.
What: The repository content the dependent-version planner reads, behind one small
interface, and the two ways planning can fail to finish.
Why: The planner is pure with respect to the repository: it never starts Git and never
reads the filesystem. The policy’s wiring answers from the wrapper’s candidate
layer, the release path from the worktree, and tests from memory. Failures are
reported by cause: content that could not be read is content-unavailable;
content that was read but that the planner cannot use is policy-incomplete.
In TS you’d write (pseudocode):
// interface WorkspaceContent { trackedPaths(): TrackedPath[]; candidateBytes(path): Uint8Array; baseBytes(path): Uint8Array | undefined }Structs§
- Content
Unavailable - What: Something the provider could not read.
Option<Vec<u8>>is “a path, or nothing” (nothing when the tracked-path listing itself failed);Stringis owned UTF-8 text. Why: The engine reports this ascontent-unavailable: the policy is intact, its input is missing. - Tracked
Path - What: One tracked path in the candidate state.
Vec<u8>is an owned list of bytes; Git paths are bytes, not necessarily UTF-8. Why: The planner selects manifests, the registry configuration and source files from this list itself, so the provider needs no knowledge of what the planner reads.
Enums§
- Plan
Error - What: Any failure to finish planning.
Fromconversions below let?lift either cause into this type. Why: The wiring maps the two variants to the two engine failure codes. - Policy
Incomplete - What: Why the planner’s own machinery could not finish although its input was read.
Why: The engine reports each of these as
policy-incomplete.ManifestShapecarries the incumbent’sManifestShapeErrortext exactly, so both implementations can be compared message for message. - Tracked
Mode - What: The Git file mode of a tracked path. An
enumis a closed set of named alternatives;#[derive(...)]generates copying, debug printing and==. Why: Only ordinary files can receive a full-content patch, so the policy drops a bump whose manifest is a symbolic link or a submodule, as the incumbent does (dependent-version-bump-policy.ts:209).
Traits§
- Workspace
Content - What: The repository facts the planner reads. A
traitis a named set of methods a type promises to provide, like a TSinterface;&mut selflends the provider for writing, because it may remember what it read;&[u8]borrows a path. Why: The planner asks only for what it needs: every manifest at both states, the registry configuration once a version was raised, and source files of the dependents whose bundled imports decide an edge.
Functions§
- display_
path - What: Show a repository path as text.
String::from_utf8_lossyreplaces bytes that are not UTF-8 with U+FFFD;.into_owned()makes the result an ownedString. Why: Messages and finding paths are text; Git paths are bytes. - plan_
error_ message - What: The complete diagnostic for a planning failure, naming the input and every way forward. Why: The person who ran the command must be able to act without reading the source.