Skip to content

Add safe upgrades, prunable rules, and target validation; publish 0.3.0 - #3

Merged
KingEmma7 merged 6 commits into
mainfrom
audit-fixes
Aug 12, 2026
Merged

KingEmma7 merged 6 commits into
mainfrom
audit-fixes

Conversation

@KingEmma7

@KingEmma7 KingEmma7 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

This release adds safe, ownership-aware upgrades, stronger target validation and doctor diagnostics, project detection, template fixes, and a GitHub Pages demo.

Safe upgrade contract

init --update now treats .cursor/.cursor-os-manifest.json as an ownership ledger rather than a snapshot of everything found on disk.

  • Cursor OS only records files it actually creates, restores, or refreshes.
  • Files that existed before Cursor OS remain unmanaged and are never silently adopted, even if they happen to match the current template byte-for-byte.
  • --update may refresh a managed file only when its current hash still matches the hash Cursor OS previously recorded.
  • Local edits are preserved and reported as customized.
  • Optional managed rules deleted during localization are persisted as pruned and are not recreated by later init or init --update runs.
  • Missing required managed files are restored.
  • Symlinks and other non-regular destination paths are reported as conflicts and are never followed or replaced.
  • Malformed ownership manifests fail closed instead of being treated as a fresh install. Manifest writes are atomic.
  • Managed files removed from a newer template are reported as obsolete; --update removes them only when they are still unchanged. Customized obsolete files are preserved.

doctor now reports ownership/update health in addition to install/localization health: stale managed files, customized files, unmanaged files, pruned optional rules, filesystem conflicts, obsolete paths, and manifest validity.

Other correctness fixes

  • init, doctor, and detect validate the target directory. init may create one final directory level when its parent exists, but refuses a mistyped missing tree.
  • OS/editor artifacts such as .DS_Store are ignored when enumerating the template.
  • frontend.mdc uses Cursor's comma-separated glob form.
  • The CLI keeps its established doctor output phrases for compatibility with scripts while adding richer diagnostics.
  • Version is 0.3.0, matching the CLI documented by the README.

Demo

  • demo/hero.svg renders the comparison inline on GitHub.
  • demo/index.html adds playback controls and a clean recording mode.
  • GitHub Pages deployment uses the current upload-pages-artifact@v4 action.
  • README leads with the comparison and a step-by-step npm quick start.

Regression coverage

The existing smoke suite remains in place. A separate upgrade-safety suite now covers the state transitions most likely to cause user data loss:

  • pre-existing file -> install -> future template change -> --update preserves it;
  • optional managed rule -> localization deletion -> future init/update preserves pruning;
  • missing required managed file -> restored;
  • malformed manifest -> update refused and doctor reports it;
  • missing/legacy manifest -> existing files remain unmanaged;
  • destination symlink -> conflict, linked target untouched;
  • obsolete unchanged managed file -> only --update removes it;
  • obsolete customized managed file -> preserved.

Verification

  • npm test
  • package.json parses
  • npm tarball packaging/E2E install succeeds
  • Node 20 and 22 smoke suites pass on Ubuntu and Windows
  • Installer does not silently adopt pre-existing files
  • Pruned optional rules remain pruned across upgrades
  • Symlink/non-regular destinations are never followed or overwritten
  • Invalid manifests fail closed

CI run #15 is green across the packaging/E2E job and all four Node/OS smoke-matrix jobs.

Contribution bar

  • This improves concrete agent behavior and upgrade safety.
  • This does not duplicate another layer.
  • Core installer behavior remains framework-neutral.

Template impact

  • Template files changed; README, CHANGELOG, and smoke expectations are part of the release diff.

Notes for reviewers

The most important invariant to review is ownership: a path must never become eligible for automatic overwrite merely because Cursor OS observed its contents. Only paths Cursor OS can prove it wrote are managed by --update.

Correctness

- init --update refreshes only files that still match the install manifest, so
  template improvements can reach existing installs without touching edits.
- install() now separates skipped (identical to template), stale (unedited but
  behind it), and customized (edited and preserved).
- doctor treats frontend.mdc and debugging.mdc as prunable. Localization is told
  to delete them when they do not apply, and that no longer fails the check.
- init, doctor, and detect validate the target directory. A mistyped multi-level
  --target is refused rather than created.
- The installer ignores OS artifacts. A stray .DS_Store in template/ was copied
  into every install and failed three smoke checks on macOS, which CI could not
  observe from Ubuntu and Windows.
- frontend.mdc declares globs in the comma-separated form Cursor documents; the
  previous YAML block sequence may not have parsed.
- Version bumped to 0.3.0 so the published package matches the documented CLI.
  0.2.0 shipped without the detect command the README describes.

Demo

- demo/hero.svg renders the comparison inline on GitHub via CSS keyframes.
- demo/index.html adds playback controls and a chrome-free recording mode.
- .github/workflows/pages.yml publishes demo/ to GitHub Pages.
- README leads with the comparison, then a step-by-step npm quick start.

Smoke suite at 194 checks, up from 159.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@KingEmma7 KingEmma7 self-assigned this Aug 7, 2026
@KingEmma7
KingEmma7 merged commit 243a90a into main Aug 12, 2026
5 checks passed
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