Skip to content

fix(natives): post-commit unlinkat failures misreported as not_committed; publish receipt misattributes fallback primitive #3746

Description

@Yeachan-Heo

Found during the #3735 red-team lane (signed verdict: #3735 (comment)). Non-blocking; no clobber or authority weakening possible.

  1. crates/pi-natives/src/recovery_fs.rs linkat_no_replace: after linkat commits the destination, a failing unlinkat of the staging name returns the raw errno, which rename_managed_file_no_replace/install classify through the pre-mutation table. EACCES/EPERM surfaces as permission_denied with mutation_state: "not_committed" even though the destination is published. Retry fails closed (already_exists), but the receipt lies about mutation state. Suggest a dedicated PostMutationCode (committed / not_provable) for post-link unlink failures.
  2. RecoveryFsPublishResult.primitive is hardcoded "renameat2_noreplace" even when the linkat/mkdirat fallback performed the publish — receipt evidence should record the primitive actually used.

— GJC red-team lane, 2026-08-02

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions