Skip to content

a8n-attached: file-identity を BigInt stat で比較し、project 再読を最終 census の後に移す #390

Open

Description

@rebuildup

PR #379 の CodeRabbit 再レビュー指摘(release-0-6-0 への follow-up)。

指摘1: hostPathsEqual の dev/ino 比較が safe integer を超え得る

statSync の dev/ino を Number のまま比較している。file identifier が 2^53 を超える filesystem では別ファイルが同一と誤判定され、誤った project pin を受理し得る。

対応: statSync(path, { bigint: true }) を使い、zero-inode 判定を 0n にする(Node 22 でサポート)。genuine alias(symlink・case variant on case-insensitive volume)は引き続き同一視する。

指摘2: re-validation で project 読み取りが最終 census より前

revalidateTarget は project identity を読んだ後に censusVerdict() を await する。census は process identity のみを見るため、その await 中の project 切替を検出できず、記録済み project のまま { ok: true } を返し得る。

対応: project 比較を censusVerdict() の後に移し、最後の観測を project read にする(残余の TOCTOU は #385 の host-side guard が write と同一 ExtendScript 評価内で塞ぐ)。

検証

  • fake-host unit test: 巨大 ino の BigInt 比較、project read が census 後に行われる順序。
  • 実機 AE は不要(fake/mock レベルの修正)。

Activity

  1. added a commit that references this issue on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions