Repository navigation
Add cigen explain <job>: what a job's hash covers - #14
Merged
Merged
Conversation
ndbroadbent
force-pushed
the
tools/validate
branch
from
December 4, 2026 00:39
c7d66d3 to
8f88f54
Compare
ndbroadbent
force-pushed
the
tools/explain
branch
from
December 4, 2026 00:39
d799ffe to
f50182c
Compare
This was referenced Dec 4, 2026
ndbroadbent
force-pushed
the
tools/validate
branch
2 times, most recently
from
December 4, 2026 01:12
1bab206 to
79f8362
Compare
ndbroadbent
force-pushed
the
tools/explain
branch
from
December 4, 2026 01:25
f50182c to
0900d3b
Compare
This was referenced Dec 4, 2026
ndbroadbent
force-pushed
the
tools/explain
branch
from
December 4, 2026 03:03
0900d3b to
e430612
Compare
Job hashing moves from the hash command into the library (src/hashing/): file digests and the on-disk cache in files.rs, and hash_job in job.rs, which returns the hash with what went into it. hash --job and explain both call it, so explain always describes the hash hash --job prints. The digest is unchanged: the old and new binaries give the same hash for every job in this repo and the fixtures, with and without --cache. explain prints the job's inputs with @groups expanded and the files each pattern matched, the derived inputs (config parts, and files with their reason), what else is hashed, and the hash, as text or JSON. An unknown job is a ConfigError that suggests the closest id. The config-error footer ("The config has N problems") now prints only when there's more than one.
The CLI page documents cigen explain: its options, what the text output lists for an example config, and the JSON fields. The overview, roadmap and homepage list it as built.
Ports #30's needs hashing into hashing::hash_job: a job's hash covers the hashes of the jobs it needs, transitively, and without --modules-digest it uses the modules digest this cigen computes. cigen explain lists the needed jobs with their hashes.
#38 made every package.json a derived input, through the same list as the patterns modules contribute, so explain labelled `**/package.json` as coming from a module. Derived patterns now carry a reason, `from a module` or `every package.json`, like derived files do.
Ports #51: hashing::hash_job mixes a GitHub matrix entry into the job's hash (matrix_entry.rs moved to src/hashing/matrix.rs with its tests), so hash --matrix still gives each entry its own hash. cigen explain takes --matrix to show an entry's hash, and for a job that runs a matrix without one, says each entry is hashed in.
ndbroadbent
force-pushed
the
tools/explain
branch
from
December 4, 2026 03:20
e430612 to
348aa75
Compare
…t need module jobs The explain commit had dropped "The config has 1 problem." for a single error, which the quick start still shows; main's report.rs is back. STATUS says that a job needing a job with modules gets a new hash once, since needed jobs are hashed with this cigen's modules digest.
This was referenced Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 3 of the agent-tools work. Stacked on #13, which is stacked on #9. The base is
tools/validate; it retargets as those merge.What changed
src/hashing/).files.rsholdsFileHasher,HashCacheand pattern listing.job.rsholdshash_job, which returns aJobHash: the digest plus the declared inputs with each pattern's matched files, the derived inputs, and what else is hashed.src/commands/hash.rsgoes from 571 to 169 lines.--cache, and pattern mode (hash -p) matches too.cigen explain <job> [--config] [--base-dir] [--format text|json]calls the samehash_job, so its hash is exactly whatcigen hash --jobprints. It shows:inputs, in order, with@groups expanded (including nested groups) and the files each pattern matched;src/inputs.rs: config parts by label (command:<name>,service:<name>,provider:<name>,package.json:packageManager) and files with a reason (toolchain pin,lockfile,named in a step);ConfigErrorwith the closest id as its suggestion, forhash --jobtoo.For the modules worker: I didn't change
src/inputs.rs. The file reasons come from itsTOOLCHAIN_PINSandLOCKFILESlists inhashing/job.rs. When modules contribute inputs,inputs::Derivedcould carry a reason for each file, andexplainwould show it.Tests
tests/explain.rs:hash --job's, before and after a derived input changes;task cipasses with no warnings.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.