Skip to content

feat(backend): enforce Forge process custody - #341

Draft
sandersonstabo wants to merge 6 commits into
agent/gate-integrity-port-ff54c7efrom
agent/backend-process-custody-port-e86c13e
Draft

feat(backend): enforce Forge process custody#341
sandersonstabo wants to merge 6 commits into
agent/gate-integrity-port-ff54c7efrom
agent/backend-process-custody-port-e86c13e

Conversation

@sandersonstabo

@sandersonstabo sandersonstabo commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add whole-process Forge custody backed by one retained nonblocking filesystem lock
  • reject missing/unsafe parent chains, symlink/reparse paths, and non-regular lock carriers
  • report typed same-process and cross-process contention without retrying or unlinking
  • register the real backend facade and cross-process Windows test in Cargo/Bazel quality gates

Verification

  • registration audit: 257 tests, 276 Clippy members, 267 format roots; zero findings
  • locked/offline Cargo metadata and Rust 1.98 rustfmt
  • focused //modules/backend:backend + //tests/backend:process_custody_test build
  • uncached cross-process custody test passes
  • fresh production/test Clippy markers after pedantic corrections
  • exhaustive //:format_test
  • exact hash/status/diff guards and Bazel shutdown

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds whole-process Forge custody so two processes can no longer open the same Forge storage concurrently. The backend now acquires one retained nonblocking filesystem lock, rejects missing or unsafe parent chains, symlink/reparse paths, and non-regular lock carriers, and reports typed same- and cross-process contention without retrying or unlinking the lock file.

New Features

  • ForgeProcessCustody guard is non-clone and must stay alive through shutdown; missing lock files are created atomically with owner-only permissions.
  • Adds a cross-process custody test covering create races, contention, and unsafe path shapes, registered in Cargo and Bazel quality gates.
  • Pins fs2 at =0.4.3 for the lock backend.

Written for commit 659a1af. Summary will update on new commits.

Review in cubic

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