Skip to content

fix: preserve exact multiscan lock identities - #563

Merged
mldangelo-oai merged 1 commit into
mainfrom
mdangelo/codex/fix-multiscan-lock-identity
Aug 18, 2026
Merged

fix: preserve exact multiscan lock identities#563
mldangelo-oai merged 1 commit into
mainfrom
mdangelo/codex/fix-multiscan-lock-identity

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prevent failed multiscan owner publication from removing a replacement supervisor's empty lock directory when distinct large file IDs round to the same JavaScript number.

Changes

  • Read both lock-directory identities with lstat(..., { bigint: true }) before deciding whether cleanup owns the directory.
  • Extend the existing replacement-lock tests with distinct inode IDs that collide as numbers. Keep empty and published replacement cases separate, and isolate the filesystem spies in subprocesses.
  • Preserve the existing cleanup of an empty lock owned by the failed supervisor.

Testing

Using Bun 1.3.14:

  • bun test --timeout 30000 --seed 1 --test-name-pattern 'owner creation fails' ./tests-ts/multiscan.test.ts: before the fix, two cases passed and the empty-replacement case failed with ENOENT; after the fix, all three passed.
  • bun test --timeout 30000 --seed 1 ./tests-ts/multiscan.test.ts: 50 passed, zero failed.
  • pnpm run types, pnpm run format, and git diff --check: passed.
  • Three fresh native reviews and independent verification of 0cc84eca: no findings.

The full supported-runtime CI matrix, including Windows and installed-package checks, passed on this exact commit.

Risk and rollout

The production diff changes only the two identity reads in failed-owner cleanup. Lock leases, owner records, heartbeat behavior, and cleanup error handling are unchanged. This uses the same bigint stat API already used by the CLI. There are no public API, dependency, package-format, or migration changes.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 0cc84eca3f1575d1c5213425be8092a77d01ba3d. The production change is limited to exact bigint identity reads during failed multiscan owner-publication cleanup. The regression uses synthetic colliding numeric inode IDs and verifies both empty and published replacement locks.

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head 0cc84eca3f1575d1c5213425be8092a77d01ba3d, especially preservation of replacement-lock ownership and the unchanged cleanup lifecycle.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 0cc84eca3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mldangelo-oai
mldangelo-oai merged commit 33c1ab2 into main Aug 18, 2026
36 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/fix-multiscan-lock-identity branch August 18, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants