Skip to main content

Module dependent_version_content

Module dependent_version_content 

Source
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§

ContentUnavailable
What: Something the provider could not read. Option<Vec<u8>> is “a path, or nothing” (nothing when the tracked-path listing itself failed); String is owned UTF-8 text. Why: The engine reports this as content-unavailable: the policy is intact, its input is missing.
TrackedPath
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§

PlanError
What: Any failure to finish planning. From conversions below let ? lift either cause into this type. Why: The wiring maps the two variants to the two engine failure codes.
PolicyIncomplete
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. ManifestShape carries the incumbent’s ManifestShapeError text exactly, so both implementations can be compared message for message.
TrackedMode
What: The Git file mode of a tracked path. An enum is 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§

WorkspaceContent
What: The repository facts the planner reads. A trait is a named set of methods a type promises to provide, like a TS interface; &mut self lends 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_lossy replaces bytes that are not UTF-8 with U+FFFD; .into_owned() makes the result an owned String. 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.