Skip to content

licensing: the duplicated Apache notice, in the 13 quiet files (Refs #1547) - #1554

Merged
bong-water-water-bong merged 1 commit into
mainfrom
pkg/1547-notice-dedup
Nov 8, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
pkg/1547-notice-dedup

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Twenty files carry the Apache notice twice: the block at the top, then the Copyright + SPDX-License-Identifier pair repeated right after "limitations under the License". This is the issue's own suggested first step — the quiet files, comment-only, and never the ones where the second occurrence is load-bearing.

Refs #1547 (partial: 13 of the 20; the rest are named below and left where they belong).

What the diff is

git diff --numstat   0 added, 26 deleted across 13 files   (two lines each, no other edit)
tools/copyright.py --check   rc 0
every touched file: exactly one SPDX-License-Identifier — except tools/npu-arena/make_task.sh, which keeps
two (its own, and the one its heredoc EMITS into the generated build.sh)
bash -n on the shell scripts, python3 -m py_compile on the .py files: clean

Files: onnx/build_ort.sh, os/v3/puppy/catalogue-manifest.py, os/v3/puppy/embed/etc/sysctl.d/60-1bit-console.conf, os/v3/puppy/shell-login.sh, scripts/check_repack_config.py, tools/flm_head_pb16i.py, tools/npu-arena/{TOOLCHAIN.lock.example,ceiling.sh,lib/env.sh,make_probe.sh,make_task.sh,oracle.sh,runner/build.sh}.

Two corrections to the issue's classification

Both came from reading each file's second pair instead of deleting the second occurrence:

  1. tools/npu_leaderboard.py is load-bearing — a fourth file for that list. Its second pair sits inside NOTICE = """<!-- … -->""", the template the generator writes into docs/npu-leaderboard.md. Untouched here.
  2. tools/npu-arena/make_task.sh is load-bearing inside a quiet file — it carries three pairs: its own, the duplicate after the licence text (removed), and one inside cat > "$D/kernel/build.sh" <<'EOF' that emits the header into a generated script. "Remove all but the first" would have stripped that generated header, which is precisely the failure the issue warns about.

The sweep is anchored on the pair that follows "limitations under the License", so a heredoc's or a template's header is not a candidate by construction — the anchor is what makes it safe rather than the file list.

Deliberately not in this PR

  • the two live files (onnx/tests/ort_run_generic.sh, tools/fconst19_measure{,_test}.py) — touched the same day by their authors;
  • the four load-bearing ones (scripts/mk-kernel-packages.sh, tests/copyright_check_untracked_test.py, tools/amd-rai-sweep/README.md, and tools/npu_leaderboard.py above);
  • the uniqueness rule in has_notice() — it must land after the whole sweep, since it would red 20 files on main immediately.

…1547)

Twenty files carry the notice twice: the block at the top, then the Copyright + SPDX pair repeated right after
"limitations under the License". This is the issue's own suggested first step - the quiet files, comment-only,
and never the ones where the second occurrence is load-bearing.

  git diff --numstat   0 added, 26 deleted across 13 files (two lines each, no other edit)
  tools/copyright.py --check   rc 0
  every touched file: exactly one SPDX-License-Identifier, except tools/npu-arena/make_task.sh which keeps
  two - its own, and the one its heredoc EMITS into the build.sh it generates (see below)
  bash -n on the shell scripts, python3 -m py_compile on the .py files: clean

Two corrections to the issue's classification, both found by reading each file's second pair rather than
deleting the second occurrence:

1. **tools/npu_leaderboard.py is load-bearing**, a fourth file for that list: its second pair sits inside
   `NOTICE = """<!-- ... -->"""`, the template the generator writes into docs/npu-leaderboard.md. It is
   skipped here untouched.
2. **tools/npu-arena/make_task.sh is load-bearing INSIDE a quiet file**: it carries three pairs - its own, the
   duplicate after the licence text (removed here), and one inside
   `cat > "$D/kernel/build.sh" <<'EOF'` which emits the header into a generated script. Removing "all but the
   first" would have stripped that generated header, exactly the failure the issue warned about.

The sweep is anchored on the pair that follows "limitations under the License", so a heredoc's or a template's
header is not a candidate by construction.

Not in this PR, per the issue: the two live files (onnx/tests/ort_run_generic.sh,
tools/fconst19_measure{,_test}.py) and the four load-bearing ones; and the uniqueness rule in has_notice()
must come after the rest of the sweep, since it would red main immediately.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at e0bbd020e00aa260ba7935a6276ba7289dd7013a

All thirteen files now carry exactly one notice block, and the one file that shows four header lines is correct:

tools/npu-arena/make_task.sh:2-3    the script's own notice
tools/npu-arena/make_task.sh:55-56  inside a `cat > build.sh <<'EOF'` heredoc — a generated file's notice

so the count of 4 there is two legitimate blocks, not a miss. Every other file is 2 lines (one Copyright + one SPDX), which is what one notice looks like.

The gap this leaves, and it is the same one #1396 recorded: tools/copyright.py has no concept of "duplicate" — grep -cE "duplicate|twice" tools/copyright.py → 0. It checks presence, so 26 lines of duplicated notice across 13 files passed it, and the fourteenth will too. A second predicate ("more than one Copyright … / SPDX-License-Identifier pair in a file → flag it, unless the extra pair is inside a heredoc that writes another file") would have found all thirteen mechanically, and it is the only way this PR stays fixed.

One incidental observation, not this PR's fault: running copyright.py --check in a worktree that has a build dir flags 36 generated files under build1336/generated/ as "missing copyright notice". CI has no such directory, so it never sees them, but a lane running the check locally gets a wall of false positives — worth a skip for generated/build paths at some point.

The removal itself is mechanical and safe: two comment lines per file, nothing else touched (26 deletions, 0 insertions), and the licence terms are unchanged — a duplicate removal cannot alter what a file is licensed under.

@bong-water-water-bong
bong-water-water-bong merged commit 1ffc15e into main Nov 8, 2026
9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the pkg/1547-notice-dedup branch November 8, 2026 22:33
bong-water-water-bong added a commit that referenced this pull request Nov 8, 2026
…ate passes on main (#1560)

#1544 added os/v3/puppy/base-modes-keep with the copyright + SPDX lines twice, and #1551/#1554
(merged in the same batch) made a duplicated notice inside the header window a gate failure.
Each PR was green alone; together main failed tools/copyright.py --check (run 42530891923).
This removes the second copy; the check passes over the whole tree.

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1547 - Partially compliant

Compliant requirements:

  • Removed duplicated Apache license notices from 13 quiet files as specified
  • Ensured that the 3 load-bearing files were not modified
  • Verified that tools/copyright.py --check returns rc 0
  • Confirmed that git diff --numstat shows only deletions

Non-compliant requirements:

  • Did not process the 2 recently modified files (onnx/tests/ort_run_generic.sh and tools/fconst19_measure{,_test}.py) as mentioned in the ticket
  • Did not process the 14 quiet files that were not mentioned in the PR description

Requires further human verification:

  • Need to verify that the 2 recently modified files are handled in a separate PR
  • Need to verify that the 14 quiet files are handled in a separate PR
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Load-bearing notice

The file tools/npu-arena/make_task.sh contains a second occurrence of the Apache license notice inside a heredoc that emits the header into a generated build.sh file. This second occurrence is load-bearing and should not be removed. The PR removes this notice, which would break the generated file's license header.

# limitations under the License.
#
# make_task.sh -- create or refresh a task bundle for one phase.

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