Skip to main content

Module projection

Module projection 

Source
Expand description

The one pure target-specific projection over this binary’s embedded sources.

Projection::compute takes a ProjectionInput, values alone, and answers the complete candidate artifact tree this installed binary would land in one target: every destination with its ownership Kind, its Placement, the complete proposed bytes, the rendered region where the destination is a marked region, and the embedded source paths it was rendered from. Staging and production landing share it byte for byte, so what an agent studies in a stage is what a landing writes.

This module reads snippets and blocks through src/embedded.rs directly and reads nothing else: no target file, no environment, no Git state, no clock, no registry, no network. Whatever a projection needs from the target arrives as TargetEvidence, gathered before construction by evidence::gather, which lives in its own file so a source scan can hold this one to the pure boundary.

Every pure piece of the landing model has one implementation here: the kind table, the token substitution, the block templating, the splice and marker judgments, and the Nix crate-shape judgment. Which embedded source belongs to which capability, and whether a capability is available at the target’s dimensions, is the catalog’s answer in crate::profile::catalog, and this module renders what the catalog selects. src/landing.rs re-exports the pieces under their old names.

One input type, one compute function, one candidate shape: staging and every landing verb consume this one projection.

Re-exports§

pub use crate::landing::manifest::Provider;

Modules§

evidence
Gathering the target evidence a projection consumes.

Structs§

BlockShape
The axes every landed block reads, resolved from one target’s parameters.
Candidate
One proposed destination.
Collision
One block destination the target’s document cannot take.
CrateShape
The structural facts of the target’s crate that the seeded Nix package expression and the seed flake’s smoke check rely on.
Omission
One destination withheld from this target, with why.
Projection
The complete candidate artifact tree for one target.
ProjectionInput
The complete input to one projection: the resolved landing parameters and the typed evidence read from the target beforehand.
RoutingGuards
The two policy fragments the workflow guards add to the routing block.
TargetEvidence
What a projection needs to know about the target, gathered before the projection runs and carried as values.
TrunkGuards
The authored guard entries the integration mode selects between, beside the mode itself, and the release mode’s tag guard.
WorkflowHooks
The hook entries the workflow guards add to the hook block.

Enums§

Kind
Who owns a landed file’s bytes after landing.
Placement
How a candidate occupies its destination.

Constants§

AGENTS_BLOCK
The authored routing-block template.
AGENTS_BLOCK_WORKFLOW
The routing block’s workflow variant, for a target whose release mode is none: no ## Releases heading and no release reason.
AGENTS_DESTINATION
The destination the routing block splices into.
AGENTS_LINE_AGENT_POLICY
The routing block’s agent policy lines, under the workflow guards.
AGENTS_LINE_AGENT_POLICY_WORKFLOW
The agent policy lines of the workflow variant, which name the two workflow terms and no tag.
AGENTS_LINE_COMMIT_POLICY
The routing block’s commit policy lines, under the workflow guards: the message source and the scope rule, each the target’s own variant, and the scope vocabulary line.
AGENTS_LINE_COMMIT_SCOPE_PREFERRED
The scope line under release.mode = "none": a scope is preferred.
AGENTS_LINE_COMMIT_SCOPE_REQUIRED
The scope line wherever the record names a release: a scope is required.
AGENTS_LINE_COMMIT_SOURCE_REBASE
The message source line under the rebase merge form: every commit reaches the trunk with its own message.
AGENTS_LINE_COMMIT_SOURCE_SQUASH
The message source line under the squash merge form: the request’s title becomes the trunk’s one commit.
BLOCK_BEGIN
The block’s opening marker.
BLOCK_DESTINATIONS
Every block destination, in the order a landing writes them.
BLOCK_END
The block’s closing marker.
BRANCH_GRAMMAR
The one branch grammar.
BRANCH_SHAPE_TOKEN
The head-branch shape the release driver gives its own request.
CODE_SCANNING_DESTINATIONS
Every destination the opt-in code scanning capability can land, against the provider that lands it.
CODE_SCANNING_TECHS
The bindings that ship a code scanning workflow.
DEV_ENVIRONMENT_GIT_USER
The git identity step both GitHub halves take under a recorded development environment.
DEV_ENVIRONMENT_RELEASE
The GitHub release half under a recorded development environment.
DEV_ENVIRONMENT_REQUEST
The GitHub request half under a recorded development environment.
DEV_ENVIRONMENT_SPANS
The four replaceable spans a recorded development environment answers.
DEV_GIT_USER_TOKEN
Where a GitHub release job’s git identity step composes in.
DEV_RUN_TOKEN
The run prefix a release job calls a project tool through.
DEV_SETUP_STEPS_TOKEN
The setup steps a release job takes before its first project tool, rendered from the recorded answer.
FORCE_SCOPE_ARG
The argument that makes the landed conventional-pre-commit hook require a scope, as the authored message guards carry it.
GITLAB_COMMIT_FRAGMENT
The GitLab commit fragment the root pipeline includes under rebase.
GITLAB_GATE_FRAGMENT_TOKEN
The forge gate fragment a binding’s GitLab root pipeline includes: the title fragment under squash and the commit fragment under rebase.
GITLAB_ROOT_PIPELINE
The GitLab root pipeline, the one destination a release-less landing withholds where the target owns it.
GITLAB_TITLE_FRAGMENT
The GitLab title fragment the root pipeline includes under squash.
GLOSSARY_BLOCK
The authored glossary template.
GLOSSARY_BLOCK_WORKFLOW
The glossary’s workflow variant, which carries no release term.
GLOSSARY_DESTINATION
The destination the glossary block splices into.
HOOKS_BEGIN
The hook block’s opening marker, a YAML comment at column zero.
HOOKS_DESTINATION
The destination the hook block splices into.
HOOKS_END
The hook block’s closing marker.
HOOK_TYPES_LINE
The top-level key the fresh hook file carries and the skills verify on an existing one: the commit-msg and pre-push hooks run only where their hook types are installed.
IF_NO_REGISTRY_TOKEN
Opens the commented-out form of a line a rust pair carries only where its crate publishes to no registry.
IF_NO_RELEASE_TOKEN
Marks a line a forge gate carries only where the release mode is none: its release-less wording, dropped wherever a release stands.
IF_REGISTRY_TOKEN
Ends a line a rust pair carries wherever its crate publishes to a registry.
IF_RELEASE_TOKEN
Marks a line a forge gate carries wherever the record names a release.
LINE_PREFIX_RE_TOKEN
The same prefix, escaped for a slash-delimited regular expression.
LINE_PREFIX_TOKEN
The release-line branch prefix, naming the lines a release trigger accepts beside the trunk.
MERGE_FLAG_TOKEN
The merge flag a GitHub release arm passes to gh pr merge: the one method the trunk ruleset allows under the recorded merge form.
NIX_DESTINATIONS
The destinations of the opt-in Nix capability, present in a projection only where the landing’s nix parameter is on.
NIX_WITHHOLDABLE
The subset a target with a flake of its own keeps out: the seed pair, whose files would sit beside a flake release-kit did not author.
OWNER_TOKEN
The mechanical substitution sites in rendered files.
PRE_COMMIT_BLOCK
The authored hook-block template.
PRE_COMMIT_BRANCH_NAME_GUARD
The workflow guards’ branch name hook.
PRE_COMMIT_INTEGRATE_NOTE
The header note naming the pre-integrate contract.
PRE_COMMIT_LOCAL_TRUNK_COMMIT_GUARD
The local integration mode’s guard against a trunk commit, at the pre-commit stage alone, so the operator’s trunk push stays open.
PRE_COMMIT_LOCAL_TRUNK_PUSH_GUARDS
The local integration mode’s two pre-push guards: no force push to the trunk, and no merge commit on it.
PRE_COMMIT_MESSAGE_GUARDS
The workflow guards’ commit message hooks.
PRE_COMMIT_STATUS_RELEASE_FILES
The release files the status check watches, wherever the record names a release.
PRE_COMMIT_SWEEP_NONE
The header note for the pairing whose sweep skips nothing.
PRE_COMMIT_SWEEP_SKIP
The header note naming what a CI sweep skips.
PRE_COMMIT_TAG_GUARD
The tag guard, wherever the record names a release.
PRE_COMMIT_TRUNK_COMMIT_GUARD
The forge integration mode’s guard against a trunk commit.
PRE_COMMIT_TRUNK_PUSH_GUARD
The forge integration mode’s guard against a trunk push.
PRE_COMMIT_WORKTREE_GUARD
The worktree mode’s guard entry, under the workflow guards.
PUSH_GUARD_TOKEN
The token a release workflow’s job condition carries, so that a rendering which adds a second trigger cannot let the new event enter a job written for a push.
RELEASE_GATE_JOB
The gate’s own job, added to a release workflow.
RELEASE_GATE_TRIGGER
The gate’s trigger block, added to a release workflow’s on key.
REPO_PLACEHOLDER
The repository a preview stands in for where nothing answered.
REPO_TOKEN
The full recorded project path, including nested namespaces.
REQUEST_JOB_TOKEN
The id of the job that opens and refreshes the release request.
REQUIRED_CHECK_TOKEN
The check the release gate judges.
REQUIRED_WORKFLOW_TOKEN
The workflow whose completion wakes the release gate.
SCOPED_TOKEN
The word a gate’s step name gives the Conventional Commit it requires: scoped wherever the record names a release, and nothing where a scope is preferred and not required.
SCOPE_CLOSE_TOKEN
The closing end of a gate pattern’s scope group: see SCOPE_OPEN_TOKEN.
SCOPE_OPEN_TOKEN
The opening end of a gate pattern’s scope group.
SCOPE_SHAPE
The one commit scope shape.
SCOPE_SHAPE_TOKEN
The one scope shape: the title checks’ regular expression.
SCORECARD_DESTINATIONS
The destinations of the opt-in Scorecard capability, present in a projection only where the landing’s scorecard parameter is on.
SECURITY_SPANS
The three replaceable spans of a landed security policy, each as its ordered begin and end marker.
SQUASH_ON_MERGE_TOKEN
The squash answer a GitLab release arm passes to the merge call: true under squash, false under rebase, whose project squashes nothing.
STYLE_TOKEN
The recorded release style: trunk arms the bot’s request in the landed release workflow, lines leaves every request unarmed.
TRUNK_BRANCH_TOKEN
The one permanent branch. A landed release trigger, ref guard, and branch guard each name it, so a target whose trunk is not master needs its own answer in its own bytes.

Functions§

authored
An authored block without the one final newline the repository’s hooks enforce on every file under blocks/; a test in src/embedded.rs holds each file to exactly one.
block_markers
The markers of a block destination, or None for a whole-file one.
code_scanning_incompatibility
Why the named code scanning provider cannot run at this (technology, forge), or None where it can or none is named.
code_scanning_licence_refusal
Why the code scanning capability’s licence condition refuses this target, or None where no condition applies or the licence satisfies it.
compose_glossary
The glossary block from its authored template: markers included and without a trailing newline. It carries no token and no mode, so the same bytes land in every target.
compose_hooks
The hook block from its authored template.
compose_routing
The routing block from its authored template, with the workflow guards’ two fragments where the target selects them.
destinations
Every destination the embedded sources can land, in declaration order.
embedded_block
One authored block this binary embeds, as text, by its embedded path.
extract_block
The marked block inside a document, markers included, or None where the text carries no complete block.
flake_pair_withheld
Why the flake half of the Nix capability stays out of this landing, or None where the pair lands whole.
glossary_block
The glossary block from this binary’s embedded template, for a target that names a release.
glossary_block_of
The glossary block one shape selects: the workflow variant, which carries no release term, where the record names no release.
hooks_block
The hook block for one checkout mode and one integration mode, with or without the workflow guards, from this binary’s embedded templates, for a target that names a release.
hooks_block_of
The hook block one shape selects.
hooks_marker_defect
marker_defect for the hook file, the destination whose entries execute.
kind_of
The declared kind of a destination, or None for a file the sources does not classify.
licence_states_an_open_source_codebase
Whether one SPDX expression is well formed and states an open-source codebase.
marker_defect
The one definition of an ill-formed block document, shared by every splice and every reader that judges one: None for a whole-file destination or a well-formed document.
nix_unsupported_shape
Why the whole Nix capability stays out of a landing, or None where the target’s crate shape supports the seed.
nix_withholding
The Nix destinations an opted-in landing withholds at this target, with the one reason, or None where the capability lands whole or nix is off.
registry_lines
Keep the lines that fit where the crate publishes, each with its marker removed, and drop the rest. A file that carries neither marker passes through unchanged.
release_driver_shape
What a release driver’s own release request is shaped like, and which job maintains it, where this release drives that driver on GitHub.
release_gate_spans
The three replaceable spans of a release workflow under the rendering that gates its request, each as its ordered begin and end marker.
render
Substitute the landing parameters into a rendered file’s bytes.
routing_block
The routing block, with or without the workflow guards, from this binary’s embedded templates, for a release-bearing squash target.
routing_block_of
The routing block one shape selects.
scope_is_shaped
Whether one scope matches SCOPE_SHAPE.
splice_hooks_block
The whole .pre-commit-config.yaml content after splicing the rendered hook block.
splice_marked_block
The whole document’s bytes after splicing a marked block into it.
substitute
Every token occurrence replaced with value.
supported_pairs
Every (driver, forge) pair at which the release automation is available, in path order.