Skip to content

refactor(index): assert stored-form scan paths and describe the macOS backlog case - #365

Merged
sunerpy merged 2 commits into
mainfrom
refactor/index-scan-stored-form-assert
Dec 1, 2026
Merged

sunerpy merged 2 commits into
mainfrom
refactor/index-scan-stored-form-assert

Conversation

@sunerpy

@sunerpy sunerpy commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • The full index now asserts, in debug builds, that every path the scan returned is in stored form before it joins the path to the project root. The migration and the incremental sync already assert this for the same scan results; release builds do not change.
  • The comment on dead_socket_entry and the daemon lifecycle section of docs/architecture.md said that a full accept backlog always leaves a socket in place. That holds on Linux, where such a listener answers EAGAIN. On macOS a listener whose backlog is full refuses the connect with ECONNREFUSED, the same answer as a socket nobody listens on, so there it counts as dead. Both now describe the two platforms.

Follow-up to #363 and #360; no change to the stored graph or to release behavior.

Verification

  • cargo fmt --all --check, make fmt-oxfmt-check, python3 scripts/docs-check.py.
  • The pre-push gate (make pre-ci) ran the debug test suite, so every test that runs an init exercised the new assertion; none failed.
  • The macOS behavior was measured on a macos-15 runner: with backlog 128, the 129th unaccepted non-blocking connect returns ECONNREFUSED; on ubuntu-24.04 it returns EAGAIN.

… paths

The full index parses the files the scan returned, as the migration and
the incremental sync do. Those two readers already assert in debug builds
that every scanned path is in stored form; the full index now asserts the
same before it joins the path to the project root. Release builds do not
change.
…cket

Cleanup removes a socket only when a non-blocking connect to it is
refused. On Linux a listener whose accept backlog is full answers EAGAIN,
so its socket is left alone. On macOS such a listener refuses the connect
with ECONNREFUSED, the same answer a socket nobody listens on gives, so
there the socket of a daemon with a full backlog counts as dead. The
comment on dead_socket_entry and the daemon lifecycle section of
docs/architecture.md said a full backlog always leaves the entry; they
now describe both platforms.
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #365   +/-   ##
=======================================
  Coverage   96.42%   96.42%           
=======================================
  Files         372      372           
  Lines      258295   258297    +2     
=======================================
+ Hits       249070   249074    +4     
+ Misses       9225     9223    -2     
Files with missing lines Coverage Δ
crates/codegraph-cli/src/main.rs 92.01% <100.00%> (+<0.01%) ⬆️
crates/codegraph-daemon/src/transport.rs 94.57% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 2017ccd into main Dec 1, 2026
19 of 21 checks passed
@sunerpy
sunerpy deleted the refactor/index-scan-stored-form-assert branch December 1, 2026 18:04
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