Expand description
The dependent-version policy: manifest and import facts, the release plan and the policy over them. What: The dependent-version policy: manifest and import facts, the release plan and the policy over them. Why: One policy with many small helpers is easier to read as a folder than as a prefix.
In TS you’d write (pseudocode):
// dependent_version/index.ts: one `export * from './file'` per module below.Modules§
- dependent_
version_ bundled - Which development dependencies each dependent bundles.
What: Decide which development dependencies each dependent bundles, reading source
only where an edge could carry a raised version.
Why: A development dependency ships inside a dependent only when its non-test source
imports it. Scanning every package’s source on every commit would read the whole
workspace, so, as in the incumbent (
dependent-bump-workflow.ts:176-278), only dependents that could reach a raised package if every development dependency were bundled are scanned, and only for edges that lead toward a raised package. - dependent_
version_ content - 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 ispolicy-incomplete. - dependent_
version_ graph - The dependency walk and the plan of dependent bumps.
What: Walk the workspace dependency graph from the packages whose version was raised and
plan a patch bump for every publishable package that reaches one of them.
Why: A dependent’s published contents change when a dependency it ships with changes,
so its version must move too. This is the incumbent’s closure and filter
(
dependent-version-bump.ts:183-350): edges to names outside the workspace and self edges are ignored, the walk passes through unpublished packages and cycles, and only publishable, versioned, not-yet-raised packages are bumped. - dependent_
version_ imports - Whether source text imports a package.
What: Decide whether source text imports a package or one of its subpaths.
Why: A development dependency is bundled, and so carries a bump, only when non-test
source imports it. This is the incumbent’s specifier scan (
source-imports.ts:59-264): a quoted specifier equal to the name, or starting with the name and/, directly afterfrom,import,import(orrequire(. Every character it inspects is ASCII, so scanning UTF-8 bytes decides exactly what scanning UTF-16 units decides. - dependent_
version_ lifecycle - The dependent-version planner’s view of a prepared candidate state.
What: The dependent-version planner’s view of a prepared candidate state: every tracked
file of the private index, its bytes with this invocation’s corrections laid over
them, and the
HEADcommit’s copy of a file. Why: The planner reads workspace manifests, the registry configuration and source files wherever they are, not only the candidates; the installed wrapper’s policy reads them as tracked files of the candidate state (trackedFiles,bytes,headBytes). Everything goes through the store the candidates were prepared in, so a direct fix’s later pass reads what its earlier passes corrected. - dependent_
version_ manifest - Strict JSON reading of a manifest’s name, version and dependency names.
What: Read the facts a dependent bump needs from one
package.json: its name, its version, and the workspace names it depends on. Why: The incumbent parses manifests withJSON.parse(manifest-text.ts:130-161). This module accepts exactly JSON: it parses with the crate’s JSONC parser and first refuses the two things JSONC adds, comments and trailing commas. Keys followJSON.parse: the last duplicate wins. A manifest is decoded as strict UTF-8 after one optional byte-order mark, as the incumbent’s fatalTextDecoderdoes. - dependent_
version_ paths - Which paths the dependent-version planner reads: manifests, configuration, source.
What: Which repository paths the dependent-version planner reads: workspace manifests,
the registry configuration, and a package’s non-test source files.
Why: The planner selects these from the tracked-path list itself, so the provider needs
no pathspec support. The rules are the incumbent’s:
isWorkspaceManifestPath(dependent-version-bump-policy.ts:66-73), the manifest pathspec:(glob)package/*/*/package.json,PNPR_CONFIG_PATH(publishable-names.ts:10) andisNonTestSourcePath(source-imports.ts:38-55). - dependent_
version_ plan - The dependent-version plan with exact manifest bytes before and after.
What: Plan patch bumps for publishable dependents of packages whose version differs from
the base, with the exact manifest bytes before and after each bump.
Why: This is the one planner behind both entry points: the commit-time policy and the
release workflow’s ripple, which will call the native wrapper’s direct fix. It is
the incumbent’s
planWorkspaceBumps(dependent-bump-workflow.ts:280-388) over the content seam: it starts no Git process and reads no file. - dependent_
version_ policy - The decision and findings of
mono/dependent-version-bump. What: The decision ofmono/dependent-version-bump: when to plan, and the findings a plan becomes. Why: The plan is a pre-commit step. Another forwarded command such asgit addcould not apply its patches, so it plans only forgit commitamong forwarded commands, and forgit cli-git checkandgit cli-git fix; and only when a workspace manifest is modified, so ordinary commits read nothing. Each stale dependent is one finding whose patch rewrites a tracked manifest that may not be a candidate, which adds that manifest to the commit (dependent-version-bump-policy.ts:178-235). - dependent_
version_ publishable - Publishable package names from the generated registry configuration.
What: Read the publishable package names from the generated registry configuration
(
package/config/pnpr/config.yaml). Why: Only published packages receive a dependent bump. The generator writes each name as a single-quoted YAML list item on its own line underpackages:, so a line scan reads exactly what it wrote, as the incumbent does (publishable-names.ts:38-81). Lines are trimmed with JavaScript’sString.prototype.trimset of characters. - dependent_
version_ release - Patch bumps of plain release versions and
JSON.stringifyquoting. What: Patch-bump a plainmajor.minor.patchrelease version, and quote text the wayJSON.stringifydoes. Why: A dependent receives a patch bump. Only a plain release can be bumped automatically; anything else (a prerelease, build metadata, a leading zero, a missing component) is reported for a bump by hand, with the incumbent’s message (dependent-version-bump.ts:87-177). The patch component is incremented as a decimal digit string, so it is exact at any size. - dependent_
version_ states - Every workspace manifest at both states, and which versions were raised.
What: Read every workspace manifest at the candidate state and at the base, and decide
which packages’ versions were raised.
Why: The plan starts from these facts. The order of failures follows the incumbent’s:
every manifest is decoded before any is parsed (its reader decodes while listing,
dependent-version-bump-policy.ts:82-92), and each manifest’s base text is parsed before its current text (dependent-bump-workflow.ts:150-174). - dependent_
version_ text - The byte-preserving rewrite of a manifest’s top-level version.
What: Rewrite the top-level
versionvalue in a manifest’s text, leaving every other byte unchanged. Why: The bump is delivered as a full-content patch, so indentation, key order, line endings and the trailing newline must survive exactly. This is the incumbent’s scanner (manifest-text.ts:184-333) over bytes: it tracks{/[depth outside strings, finds the first"version"key at depth one, and requires its raw value to be exactly the JSON quoting of the expected version. - policy_
added_ path - Whether a direct fix may change a tracked file it did not select.
What: Whether a direct fix may change a tracked file it did not select, and the
patch-conflictmessage when it may not. Why:SPEC.md(“Added paths”) admits such a file only whenHEAD, the real index, the private index and the worktree all hold the blob the correction was computed against, so the fix discards nobody’s change. The reasons and the remedy are the installed wrapper’s words (commit-transaction-added-paths.ts,assertAddablePathand its direct-fix message), checked in its order. - policy_
dependent_ version - The
mono/dependent-version-bumpcheck over a lifecycle’s candidate state. What: Themono/dependent-version-bumpcheck: the native planner over the lifecycle’s prepared candidate state, its findings, and the corrections a direct fix applies. Why: The installed wrapper’s policy (dependent-version-bump-policy.ts) reports one finding per publishable dependent of a raised manifest, each with a full-content patch, ondirect-checkanddirect-fix; onpre-forwardit plans only for a forwardedcommit. A realgit commitruns through the commit transaction instead of being forwarded, sopre-forwardreaches this check only forgit add, where the policy finds nothing.