Skip to content

Reset inodes on index writes to better support hard links#679

Merged
jviotti merged 2 commits intomainfrom
inode-hard-links
Feb 26, 2026
Merged

Reset inodes on index writes to better support hard links#679
jviotti merged 2 commits intomainfrom
inode-hard-links

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Feb 25, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

@augmentcode
Copy link

augmentcode bot commented Feb 25, 2026

🤖 Augment PR Summary

Summary: This PR updates index/build output writes to recreate files instead of truncating them in-place.

Changes:

  • Deletes existing dependency/index/metapack output files before rewriting to force a fresh inode
  • Applies the inode-reset behavior across filesystem adapter writes, JSON output writes, URI-template route generation, and metapack stream writes
  • Adds a CLI regression test that rebuilds an index and asserts only the version marker keeps its inode

Technical Notes: The intent is to avoid hard-link side effects by ensuring rebuilds create new files rather than modifying existing hard-linked inodes.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/index/output.h">

<violation number="1" location="src/index/output.h:91">
P2: Unconditionally removing the file before opening the stream can delete the existing file if the open fails, causing data loss on error paths (and in release builds the assert doesn’t guard against a bad stream). Consider a safer write strategy that preserves the old file until the new write succeeds.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@jviotti jviotti force-pushed the inode-hard-links branch 3 times, most recently from abb5c78 to 935d7b6 Compare February 25, 2026 21:16
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit 31ec4bc into main Feb 26, 2026
8 of 9 checks passed
@jviotti jviotti deleted the inode-hard-links branch February 26, 2026 15:41
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