fix: reject stale plans before preview and apply - #265
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7d85ff9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ae29b61 to
4093386
Compare
4093386 to
2f0cae3
Compare
|
@pullfrog please review |
2f0cae3 to
1016e5c
Compare
There was a problem hiding this comment.
Caution
File preview now rejects valid greenfield Plans and BOM-prefixed text files as stale. These false positives block --dry-run --show-files and valid incremental file previews.
Reviewed changes across the Plan baseline contract, repository capture and freshness checks, guarded Apply, virtual file preview, CLI serialization, integration tests, and supporting documentation:
- Repository authority: Plans now carry canonical roots and path fingerprints, with typed stale errors for drift.
- Execution and preview: Apply validates state before composition and each write; file preview seeds a private filesystem and reruns guarded Apply.
- Coverage and documentation: Added drift, partial-write, and host-preservation tests and recorded the contract in OKF.
GPT Sol | 𝕏
39c1e61 to
7d85ff9
Compare
|
@pullfrog please review the latest head, including the greenfield and BOM preview fixes. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, including the greenfield and BOM preview fixes and their VFS compatibility update:
- Preserved preview bytes: Seeded fingerprinted files with raw bytes so BOM-prefixed files remain valid.
- Restored greenfield previews: Adapted the missing-root baseline to the initialized virtual root and checked host state before and after seeding.
- Verified coverage: Added regressions for both cases;
bun run test --filter=@repo/scaffoldandbun run type-checkpass.
GPT Sol | 𝕏

Goals/Scope
Ensure that Apply uses the repository state represented by Plan. Review the baseline checks before composition and each write, including the preview path.
Description
Plan records the canonical repository root and fingerprints of inspected text files. Preview and Apply now return
StalePlanFailurewhen those paths change. File preview seeds an isolated memory filesystem and uses the same guarded Apply path. Tests cover drift, root changes, partial writes, and host file preservation.