Expand description
Command-level next_steps[] builder.
Computes a small list of read-only, runnable follow-up commands from a run’s
findings, surfaced at the JSON root (and as a one-line human Next: hint).
The purpose is to point agents and humans sideways to fallow’s adjacent
verification capabilities (trace, complexity breakdown, audit, workspace
scoping) that telemetry shows agents rarely discover, because they act on the
output in front of them rather than on reference docs.
Two hard contracts, both enforced by the tests in this module and by the
next_step constructor’s debug assertions:
- Read-only. A step NEVER suggests
fallow fixor any mutating command. - Runnable, placeholder-free. Every
commandruns as-is; it never contains an angle-bracket placeholder. Finding-derived values come from a real, deterministically-selected finding; values that cannot be made concrete (a coverage path) are dropped from v1 rather than shipped as a placeholder, and an unresolvable git ref omits its step entirely.
Constants§
- SETUP_
HINT - One-line human setup hint for bare
fallowoutput: the prose counterpart of thesetupnext-step (agents get the JSON form, humans get this line). Worded as an offer, not a deficiency: zero-config is a supported happy path.
Functions§
- build_
audit_ next_ steps - Next-steps for
fallow audit. Noaudit-changed(audit IS the changed scope) and noscope-workspaces(audit already gates the change). Thechecktuple carries the changed-file analysis results plus the project root so the trace anchor is made root-relative the same way every other surface does it (in-memory finding paths are absolute; the wire form is relative). - build_
combined_ next_ steps - Aggregated next-steps for bare
fallow(combined). Candidates are pushed in priority order, then capped.trace-unused-exportleads because it is the highest-value verification path;scope-workspacesis boosted above the trace-clone / complexity tier so big-repo runs that trigger everything still surface the rare monorepo-scoping capability instead of always dropping it under the cap.audit-changedis last (broadly applicable, least specific). - build_
dead_ code_ next_ steps - Next-steps for standalone
fallow dead-code.offer_setupis the caller’ssetup_pointer_applicableresult (threaded as a parameter so the builders stay free of env/filesystem probes and deterministic under test). - build_
dupes_ next_ steps - Next-steps for standalone
fallow dupes. Seebuild_dead_code_next_stepsfor theoffer_setupparameter contract. - build_
health_ next_ steps - Next-steps for standalone
fallow health. Seebuild_dead_code_next_stepsfor theoffer_setupparameter contract. - due_
impact_ digest - Read-and-stamp the due periodic impact digest for the envelope being built.
Returns
Nonein CI or when suggestions are disabled, WITHOUT consuming the cadence stamp, so the digest is never burned by a surface that will not show it. - impact_
digest_ line - One-line human counterpart of the
impact-reportnext-step, printed with the run summary on barefallow. - setup_
pointer_ applicable - Shared first-contact gate for the
setupnext-step and the human setup hint on barefallow: the project has no fallow config (searched up to the repo root, same as config loading), the run is not in CI, and onboarding has not been declined for this project (fallow init --decline). - suggestions_
enabled FALLOW_SUGGESTIONS=off(or0/false/no/disabled) disables next-steps entirely. Default on. This is the documented escape hatch for CI consumers that snapshot-diff raw--format jsonoutput; it reaches the spawned-CLI and MCP surfaces without a CLI flag.- top_
combined_ next_ step - The single highest-priority next-step for the human
Next:line, computed from the same candidates and ordering as the combined JSON array so a human and an agent on the same run never see a contradictory top step. Thesetuppointer is deliberately excluded here (offer_setup: false): humans get the dedicated proseSETUP_HINTline instead, so theNext:slot always shows an analysis follow-up.