Skip to content

fix(build): invalidate kernel stamps for untracked source edits - #394

Merged
bompus merged 2 commits into
fork/consolidatedfrom
fix/kernel-untracked-stamp
Oct 5, 2026
Merged

bompus merged 2 commits into
fork/consolidatedfrom
fix/kernel-untracked-stamp

Conversation

@bompus

@bompus bompus commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Editing a new, untracked Rust module could leave the native kernel source stamp unchanged. Tests could then use a prebuild made from earlier source bytes. The stamp now includes each untracked path and its content, even inside new directories or when Git status hides untracked files.

Git ignore rules still exclude build outputs. Symlinks contribute their link text, as tracked Git symlinks do; external target changes remain outside that contract. Listing and read failures now stop stamp validation rather than silently accepting an incomplete stamp. The no-Git behavior and explicit native-path override are preserved.

Validation: eight regression cases failed against the original implementation. The unreadable-directory case then caught a successful Git exit with incomplete output. All 14 focused tests now pass. npm run build, native clippy/release and the final full suite passed on Node 24.21.0 (578 files, 7,388 passes, 39 existing skips). The test floor guard and diff check passed. The focused matrix passed on Linux and macOS (14 tests each) and Windows (5 tests; 9 POSIX cases skipped), without a native build. No extraction or resolution behavior changed.

README check: reviewed About this fork's source-install instructions, feature table, parsing/runtime rows and measured results. This internal build freshness fix changes none of their commands, features or reported measurements.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (3)
.cursor/rules/codegraph.mdc — auto-discovered
Generated by CodeRabbit — auto-discovered
docs/viewer-launch-changelog.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bacb8c61-62c5-4dab-bae6-36e7d420aa3d
📥 Commits

Reviewing files that changed from the base of the PR and between 47f7037 and a8095d5.

📒 Files selected for processing (4)
  • .github/workflows/kernel-stamp.yml
  • CHANGELOG.md
  • __tests__/ensure-kernel-stamp.test.ts
  • scripts/kernel-stamp.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Source builds now detect changes to new, untracked kernel source files and rebuild the native kernel instead of reusing an outdated prebuild.
    • Builds now report an error when they cannot inspect source changes, rather than continuing with potentially stale results.
  • Tests
    • Added automated checks on Linux, Windows, and macOS for source-stamp behavior, including untracked files, special filenames, symlinks, ignored build outputs, and missing Git metadata.

Walkthrough

The kernel source stamp now includes untracked files under codegraph-kernel/. Fixture tests cover stamp inputs and errors. A pull-request workflow runs the targeted tests on three operating systems.

Changes

Kernel source stamps

Layer / File(s) Summary
Include untracked sources in stamps
scripts/kernel-stamp.mjs
The stamp includes sorted untracked paths and hashes regular-file contents or symlink text. Git input failures and unsupported file types now raise errors.
Test untracked source stamp behavior
__tests__/ensure-kernel-stamp.test.ts
Fixture tests cover stale prebuild detection, untracked file changes, path and symlink handling, ignored files, read errors, and missing Git metadata.
Run stamp tests across platforms
.github/workflows/kernel-stamp.yml, CHANGELOG.md
The workflow runs the targeted fixture on Ubuntu, Windows, and macOS. The changelog states that edits to new, untracked source files trigger a native kernel rebuild.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to a8095

The source-stamp change is ready to merge after normal checks. Permission tests may need adjustment if run with elevated filesystem capabilities.

Architecture Summary

Architecture risk: 🟡 Medium · up to a8095

The change affects 3 systems.

Changed systems: scripts, CHANGELOG.md, __tests__

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — scripts (service) was modified; 1 changed file maps to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.
  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Adds a changelog entry stating that source builds rebuild the native kernel after edits to new, untracked source files instead of using an older prebuild.
  • observed — Modified behavior in tests/ensure-kernel-stamp.test.ts: The setup and cleanup hooks move from inside the platform-conditional describe to the outer scope, so the shared temporary Git fixture is initialized and removed independently of that conditional. The fixture’s ignore rules now also exclude target/, target-*/, and *.node, and the platform condition applies only to the ensure-kernel source stamp tests.
  • observed — Modified behavior in tests/ensure-kernel-stamp.test.ts: Adds a test that changes an untracked source after stamping and expects ensure-kernel to report a stale prebuild. It also checks that Git enumeration failure makes ensure-kernel exit nonzero and report the enumeration error.
  • observed — Modified behavior in tests/ensure-kernel-stamp.test.ts: Adds coverage that nested untracked file additions and byte changes affect the source stamp, including when Git’s status.showUntrackedFiles setting is no.

Reliability and maintainability

  • inferred — Risk-relevant change factors for scripts: blast_radius_1; direct_dependents_1
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: invalidating kernel stamps when untracked source files are edited.
Description check ✅ Passed The description explains the untracked-source stamp issue, the fix, its boundaries, and validation results. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Suppressions Explained ✅ Passed The pull request adds no lint, type-check, or compiler suppression directive. The diff adds test conditions and a fixture .gitignore; neither suppresses a lint, type-check, or compiler diagnostic.
User-Visible Changes Documented ✅ Passed The changed-file inventory contains only the kernel-stamp workflow, changelog, regression tests, and scripts/kernel-stamp.mjs; it contains no README.md or site documentation page. The source-stamp…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@bompus

bompus commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@bompus
bompus merged commit 07c6778 into fork/consolidated Oct 5, 2026
4 checks passed
@bompus
bompus deleted the fix/kernel-untracked-stamp branch October 5, 2026 09:07
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