Skip to content

os/v3/puppy/patch-sfs: an addition under a new directory below the root is part of the declared set (engine#3287) - #3315

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/patch-sfs-nested-newdir
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/patch-sfs-nested-newdir

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Part of #3287 (release tooling: the cut).

Problem. diff -rq reports a file added under a new directory as Only in <tree>/new/<parent>: <newdir>. only_in_path in os/v3/puppy/patch-sfs.sh resolved that record only when the new directory sat at the tree root, so a manifest that adds usr/local/sbin/1bit-grow-data (main's os/v3/puppy/embed; the v2026.47 base has usr/local but no usr/local/sbin) is refused:

patch-sfs.sh: REFUSED: 53 path(s) differ and these are outside the declared set:
Only in /root/wt/sfs-patch/run.QTqcLz/new/usr/local: sbin

Measured 2026-11-22 cutting engine main against the v2026.47 base on ryzen (the c35 cut predates 1bit-grow-data, so it never hit this).

Fix. The record resolves to usr/local/sbin, an ancestor of the declared target, which matches_target already accepts (the same rule as the root-level case from 2026-11-08). One case line.

Tests. patch-sfs-selftest.sh gains case 2b with exactly that shape (asserts the fixture has no usr/local/sbin first): before the fix 2 rows FAIL (rc 1, no output); after, selftest: 26 passed, 0 failed (as root, as the selftest requires). tests/patch_sfs_atomic_test.sh: 11 checks, 0 failed. scripts/pre-pr-checks.sh --base origin/main: 17 green, 3 skipped. Not a hardware change.

🤖 Generated with Claude Code

…ot is part of the declared set (engine#3287)

diff -rq reports a file added under a new directory as 'Only in <tree>/new/<parent>: <newdir>'. only_in_path resolved
that record only when the new directory sat at the tree root, so a manifest adding usr/local/sbin/1bit-grow-data
(usr/local exists, sbin does not) was refused with '53 path(s) differ and these are outside the declared set: Only in
.../new/usr/local: sbin' - measured on a cut of engine main against the v2026.47 base. The record now resolves to
usr/local/sbin, an ancestor of the declared target, which matches_target already accepts.

patch-sfs-selftest.sh case 2b adds exactly that shape (failed 2 rows before, 26/26 after, as root);
tests/patch_sfs_atomic_test.sh 11/11.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3287 - Partially compliant

Compliant requirements:

  • The cut must use the freshly rolled payload
  • The pre-write probe must be able to stop the write
  • Keep the shipped image

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Path resolution for nested new directories

The fix correctly handles the case where a new directory is added below the root level, such as usr/local/sbin, by resolving the path to its ancestor directory. This prevents false positives when a manifest adds a file under a new directory that doesn't exist in the base image. The change ensures that Only in <tree>/new/usr/local: sbin is interpreted as usr/local/sbin, which aligns with the existing logic for root-level additions.

only_in_path() {
    case $1 in
        "Only in "*": "*)
            local pre dir name
            pre=${1#Only in }
            dir=${pre%: *}
            name=${pre##*: }
            [ "$dir" = "$2" ] && { printf '%s\n' "$name"; return 0; }
            # a new directory BELOW the root is named under its parent: `Only in <tree>/new/usr/local: sbin` is
            # usr/local/sbin (engine#3287: a cut adding usr/local/sbin/1bit-grow-data was refused on exactly this line)
            case $dir in "$2"/*) printf '%s/%s\n' "${dir#"$2"/}" "$name"; return 0 ;; esac
            return 1 ;;
    esac
    return 1
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant