Skip to content

chore(lint): NOLINT inventory audit — close 16 ADR-cite-form gaps (ADR-0278) - #353

Merged
lusoris merged 1 commit into
masterfrom
chore/nolint-inventory-audit
May 31, 2026
Merged

lusoris merged 1 commit into
masterfrom
chore/nolint-inventory-audit

Conversation

@lusoris

@lusoris lusoris commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Audit of every // NOLINT / // NOLINTNEXTLINE / // NOLINTBEGIN site in fork-touched
core/src/, core/test/, and core/tools/ (222 total). Found 16 sites whose preceding
comment described the load-bearing invariant in prose without naming an ADR. Append
inline ADR citations per CLAUDE.md §12 r12 and ADR-0278's cite-form rule. No behavioural
change; no function bodies split; no NOLINTs removed.

Post-edit classifier: 204 / 222 cited. The remaining 18 sites are all in files owned
by in-flight DRAFT PRs (core/src/model.cpp + core/src/output.cpp deleted by PR #205;
core/src/feature/sycl/integer_adm_sycl.cpp + integer_vif_sycl.cpp touched by 19
sibling drafts). Cite-form sweep on those files will follow once the owning PRs settle.

Type

  • chore — lint hygiene / cite-form sweep
  • refactor — no behavior change

Checklist

  • Commits follow Conventional Commits.
  • pre-commit run --files is green locally on touched files.
  • Unit tests pass: meson test -C build — comment-only changes; deferred to CI.
  • No SIMD/GPU code paths touched.
  • No new .c/.cpp/.cu/.h files; no license headers needed.
  • Not a breaking change.

Bug-status hygiene

  • no state delta: pure lint-citation sweep with no bug-status impact.

Netflix golden-data gate

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables (ADR-0108)

  • Research digest — docs/research/nolint-inventory-audit-2026-05-30.md written.
  • Decision matrix — no alternatives: only-one-way cite-form sweep per ADR-0278 established policy.
  • AGENTS.md invariant note — no rebase-sensitive invariants (comment-only additions; no signatures / symbols / build flags changed).
  • Reproducer / smoke-test command — see below.
  • CHANGELOG fragment — changelog.d/changed/nolint-inventory-audit-closeout.md.
  • Rebase note — no rebase impact: comment-only inline citations on fork-local touched files.

Reproducer

# Re-run the audit classifier against current tree:
grep -rn -E '// NOLINT(NEXTLINE|BEGIN)?' core/src core/test core/tools \
  | grep -vE 'feature/third_party|feature/iqa/_iqa|mcp/3rdparty/cJSON' \
  | grep -v 'NOLINTEND' \
  | wc -l   # → 222

# Format / lint touched files
pre-commit run --files \
  core/src/feature/integer_adm.c \
  core/src/feature/metal/float_psnr_metal.mm \
  core/src/feature/metal/integer_psnr_metal.mm \
  core/src/feature/metal/float_motion_metal.mm \
  core/src/feature/metal/float_ms_ssim_metal.mm \
  core/src/feature/metal/integer_motion_v2_metal.mm \
  core/src/feature/metal/float_moment_metal.mm \
  core/src/feature/metal/integer_motion_metal.mm \
  core/src/feature/metal/float_ssim_metal.mm \
  core/src/output.c \
  core/src/predict.c \
  core/src/svm.cpp \
  core/test/test_iqa_convolve.c

Files changed (cite-form sweep)

File Lines ADR(s) added
core/src/predict.c 497 ADR-0278
core/src/svm.cpp 31 ADR-0141 / ADR-0278 (vendored libsvm)
core/src/output.c 80 ADR-0141 / ADR-0278
core/test/test_iqa_convolve.c 99, 197 ADR-0141 / ADR-0278
core/src/feature/integer_adm.c 2870, 3069, 3323 ADR-0141 / ADR-0278
core/src/feature/metal/float_psnr_metal.mm 253 ADR-0361 / ADR-0278
core/src/feature/metal/integer_psnr_metal.mm 313 ADR-0361 / ADR-0278
core/src/feature/metal/float_motion_metal.mm 333 ADR-0361 / ADR-0278
core/src/feature/metal/float_ms_ssim_metal.mm 551 ADR-0361 / ADR-0490 / ADR-0278
core/src/feature/metal/integer_motion_v2_metal.mm 439 ADR-0421 / ADR-0278
core/src/feature/metal/float_moment_metal.mm 264 ADR-0361 / ADR-0278
core/src/feature/metal/integer_motion_metal.mm 322 ADR-0361 / ADR-0421 / ADR-0278
core/src/feature/metal/float_ssim_metal.mm 476 ADR-0361 / ADR-0589 / ADR-0278

Known follow-ups

  • After PR chore(cpp23): drop inert .cpp shadows where meson uses .c (ADR-0843) #205 (drops inert .cpp shadows) lands: re-audit will report the 16
    core/src/model.cpp + 1 core/src/output.cpp sites as gone.
  • After the ~19 sycl-touching drafts settle: open a cite-only sweep PR for
    core/src/feature/sycl/integer_adm_sycl.cpp:55 and integer_vif_sycl.cpp:57.
  • Future enforcement (backlog T7-5b per ADR-0278): scripts/ci/check-nolint-citation.sh
    to gate new NOLINTs lacking an inline ADR token.

🤖 Generated with Claude Code

@lusoris
lusoris marked this pull request as ready for review May 31, 2026 13:06
@lusoris
lusoris force-pushed the chore/nolint-inventory-audit branch from f74756f to c2de2fd Compare May 31, 2026 13:06
@lusoris
lusoris merged commit 6dd33a6 into master May 31, 2026
36 of 37 checks passed
@lusoris
lusoris deleted the chore/nolint-inventory-audit branch May 31, 2026 13:06
lusoris added a commit that referenced this pull request Jun 12, 2026
…CI) (#868)

* fix(codeql): resolve HIGH-severity security-cpp-high alerts (23 sites)

- cpp/integer-multiplication-cast-to-long (11): pre-cast one operand to
  size_t / double / ptrdiff_t before int*int multiplications in
  cambi.c, float_vif.c (log message), iqa/convolve.c (img_offset),
  moment.c, psnr.c, and vif_tools.c (four memcpy size expressions).
  Add stddef.h to convolve.c for ptrdiff_t.

- cpp/incomplete-parity-check (3): change `% 2 == 1` to `% 2 != 0`
  in vif_tools.c (assert), svm.cpp (powi loop), pdjson.c (JSON
  object key/value alternation). The == 1 form is wrong for negative
  operands; != 0 is always correct.

- cpp/wrong-type-format-argument (2): fix float_vif.c error log that
  printed size_t fields scaled_w/scaled_h with %d; change to %zu.

- cpp/world-writable-file-creation (1): in vmaf.cpp replace bare
  fopen("wb") with open(O_WRONLY|O_CREAT|O_TRUNC, 0644)+fdopen() on
  POSIX so the created file is never world-writable independent of the
  caller's umask. Add <fcntl.h>.

- cpp/path-injection (4): in test_output.c resolve the mkstemp-created
  path through realpath() immediately after creation, breaking the taint
  chain from getenv("TMPDIR") to the vmaf_write_output call site.

- cpp/toctou-race-condition (2): skipped — both sites are in test
  cleanup (RMDIR after stat assertion). The stat result drives a test
  assertion, not a security-sensitive access decision; no atomic
  replacement of open() is applicable to rmdir. Reported as skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(codeql): resolve security-python-and-ci CodeQL alerts

Fixes 18 open CodeQL alerts across the Python and CI categories:

- yaml.github-actions.security.run-shell-injection (#661): move
  github.event_name, github.base_ref, and github.event.before from
  inline ${{...}} interpolation to env: vars in the SYCL clang-tidy
  detect step of lint-and-format.yml.

- python.lang.security.use-defused-xml-parse (#216, #217): replace
  xml.etree.ElementTree with defusedxml.ElementTree in
  feature_extractor.py and quality_runner.py; add defusedxml>=0.7.1
  to python/pyproject.toml and python/requirements.txt.

- py/undefined-export (#352, #353, #354, #616): restructure
  aiutils/__init__.py to do a conditional eager import of the parquet
  helpers so the names are defined when pyarrow is present, and only
  include them in __all__ when the import succeeded.

- py/stack-trace-exposure (#178, #179, #585): log exception detail
  server-side and return a generic message to the HTTP client in
  http_transport.py _handle_score (invalid JSON, bad params, scorer
  error branches).

- python.lang.security.audit.dangerous-subprocess-use-tainted-env-args
  (#227, #372): add shlex.quote() around user-supplied path arguments
  passed into shell strings in extract_ugc_features.py and
  test_bbb_e2e_v5_bug_cluster.py.

- py/file-not-closed (#677, #678): replace bare open() calls with
  context managers in test_coverage_round3.py.

- py/redundant-comparison (#427, #431): remove redundant
  assert not (x != y) lines that duplicate the preceding assert x == y.

- py/equals-hash-mismatch (#182): convert RdPoint to frozen=True
  dataclass so __eq__ and __hash__ are generated consistently.

- py/inheritance/signature-mismatch (#197): add result_dict=None
  default to EnsembleVmafQualityRunner._populate_result_dict so the
  signature is compatible with the base class.

- py/multiple-definition (#201): drop redundant assignment to
  feature_found in feature_extractor.py wildcard discovery path.

- py/str-format/surplus-named-argument (#204): remove unused
  dataset= kwarg from the format() call in routine.py.

Skipped: python.lang.security.audit.insecure-file-permissions (#373) —
  the Unix socket at 0o660 is intentional (Go sidecar node must write
  to it and runs as the same UNIX group); tightening to 0o644 would
  break the IPC channel.

Skipped: py/path-injection (#180, #181) — _validate_path() already
  resolves the path and checks it against an allowlist before any file
  operation; the data flow is secure and the CodeQL dataflow trace is a
  false positive on this allowlisted pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Lusoris <lusoris@pm.me>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@lusoris lusoris added this to the 1.0.0 — First release milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant