Repository navigation
merge(library): walk and digest trees through one module - #49
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One Walk with the link policy named by each caller (Record, Skip, Refuse), BuildContext (ex-BuildInputs, same JSON), and Listing::stage. The image step, the ground-truth check, declared inputs and the run's outputs read their trees through it; every digest is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The base and extension tags derive from the BuildContext digest, and the extension layer is staged from the listing that was digested. This is the one-time tag change: the base, env and extension images build once more. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
PR A1 of the pre-M6a cleanup round: one directory walker and one build-context digest, owned by a new core module
candler_core::tree.What moved
tree.rsholdsWalk(one recursive walker, sorted by the/-joined string, with the link policy named by each caller:Links::Record,Skip,Refuse; namesStrictorLossy; an optional name ruleScreen),BuildContext(ex-BuildInputs, same JSON and keys) andListing::stage(ex-copy_tree, which now makes links again so the staged tree is the tree the digest covers).Walkhas noorderoron_erroroption: nothing needs another order or a collecting walk (the import readers, which would, stay separate), so they were left out rather than added unused.Sites rewired:
BuildInputsinresolve/steps/image.rs(Record, Strict). Same bytes into the cell digest.experiment/inputs.rswalk/walk_dir(Refuse, Strict,unmountableas aScreen).InputErrortexts and codes kept.runner/exec/gather.rswalk(Skip, Strict).resolve/steps/ground_truth.rswalk_files(Skip, Lossy);context_exposuresreads throughBuildContext.isolation/image.rs(tree_digest,collect_files,copy_tree,extension_digest): gone, see the tag change below.Left alone, as the map says: W7/W8 import readers, W9
candler ls, the flat listers, D7, D9 and the test walkers (R3 is A2),skill_filesin candler-harness. D5 (store_input) and D6 (collect_filesdigests) keep their hashing; only their walk moved.Digest evidence
Commit 1 pins
guard_build_context(nested dirs,a-banda/b, a file link, a dir link, a non-ASCII name, a hidden file) before any move. ItsBUILD_INPUT_DIGESTliteral is unchanged through commits 2 and 3. Unchanged and green:guard_cell_digest,guard_context_digest,guard_run_context,guard_import_mini,guard_engineand the oraclescell_digest.toml,context_inputs.toml,live_context_runs.toml,context_digest_runs.toml.git diff --stat origin/main -- crates/candler-schemas/tests/fixtures __reports__/m2a-evaluation-parity/golden_parityis empty. Nocandler-schemasfile is touched.The one-time tag change (R1, commit 3)
Image tags now derive from the
BuildContextdigest:base_tag,context_digestand the extension tag. The pinBASE_TAGinguard_build_contextmoves fromcandler-base:src-31c20597ffe9tocandler-base:src-610940524574in that commit only (and the guard writes the base context's own Dockerfile, which the new digest covers). Effect: one rebuild of the base, env and extension images. Image ids and cell digests are unaffected. Behaviour changes that come with it: a link in an extension context is staged as a link, wherecopy_treefollowed a file link and failed on a directory link; an empty directory in a context is no longer staged (the limit below); the extension layer is staged from the listing that was digested.R2: D1 still ignores file modes and empty directories (no schema tag change). It is written as a limit in the
treemodule doc.Other changes
docs/contract/codes.toml:candler_core::tree::WalkErrorgoes in[internal]with a one-line reason; no code renamed.platform_inventory.toml:tree.rsis listed forstd::os::unix::fs::symlink(staging a link).BuildInputs(guard_treatment_context) useBuildContext.resolve/steps/image.rs: only the build-context code was touched, notprune_name_ok.Bites (each: break, see red, revert)
a_listing_is_sorted_by_the_joined_stringWalk::listguard_build_context,a_staged_copy_has_the_digest_of_its_listingBuildContext::walkRecord to Skipdeclared_input_refused_names_kind_and_paththe_files_of_a_run_leave_out_linksa_staged_copy_has_the_digest_of_its_listingstagedrops linksguard_build_contextThe first W6 bite was green against the existing guards, so
the_files_of_a_run_leave_out_linkswas added.Gates
cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningsare clean.cargo nextest run --workspace: 733 run, 730 passed; the 3 failures wereguard_imageguards that hard-code the base tag, which is the tag change above. Their literal (src-12bee9345901tosrc-83c18228eddb) moved in commit 3 and the fiveguard_imagetests pass; the rest of the workspace was green on that run. No container test flaked.🤖 Generated with Claude Code