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, the pair selection, and the Nix crate-shape judgment. src/landing.rs re-exports them under their old names.

The project-profile work extends ProjectionInput and the capability catalog this module selects from. It creates no second projection: one input type, one compute function, one candidate shape.

Re-exports§

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

Modules§

evidence
Gathering the target evidence a projection consumes.

Structs§

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.
Selected
One file selected for a pair: where it lands, which source it is, and what the source carries.
TargetEvidence
What a projection needs to know about the target, gathered before the projection runs and carried as values.

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_DESTINATION
The destination the routing block splices into.
AGENTS_LINE_BRANCHES
The routing block’s mode line, branches form.
AGENTS_LINE_WORKTREE
The routing block’s mode line, worktree form.
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.
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.
GLOSSARY_BLOCK
The authored glossary template.
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.
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.
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_WORKTREE_GUARD
The worktree mode’s guard entry.
REPO_PLACEHOLDER
The repository a preview stands in for where nothing answered.
REPO_TOKEN
The full recorded project path, including nested namespaces.
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.
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.
check_pair
Whether the embedded snippets ship the (tech, forge) pair, with the same refusals select_pair answers.
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, with the worktree mode’s guard entry where guard carries one.
compose_routing
The routing block from its authored template and the mode’s one orientation line.
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.
hooks_block
The hook block for one workflow mode, from this binary’s embedded templates.
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_is_osi_approved
Whether one SPDX expression is well formed and every licence in it is OSI-approved.
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.
render
Substitute the landing parameters into a rendered file’s bytes.
routing_block
The routing block for one workflow mode, from this binary’s embedded templates.
routing_line
The routing block’s mode line for one workflow.
scope_is_shaped
Whether one scope matches SCOPE_SHAPE.
select_pair
The files one (technology, forge) pair lands, selected from files, whose paths carry the snippets/ root.
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 (technology, forge) pair the embedded snippets ship, in path order.