Skip to content

fix(update): protect legacy scripts without ownership proof - #43

Merged
Kucell merged 1 commit into
mainfrom
codex/fix-legacy-script-manifest-safety
Oct 8, 2026
Merged

Kucell merged 1 commit into
mainfrom
codex/fix-legacy-script-manifest-safety

Conversation

@Kucell

@Kucell Kucell commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Protect scripts in legacy projects whose .agent/.script-manifest.json is missing or was created by the old cold-start behavior.

Problem

The first update recorded an unknown existing script's own hash as its managed origin. A later update could then treat that custom script as an unchanged framework script and replace it. init on an existing project could make the same ownership claim. Cold-start dry runs also wrote a manifest.

Changes

  • Register ownership only after a script matches a shipped language or shared template, or after Cortex writes that template itself.
  • Mark newly verified manifest entries with ownership_proof: template_match. Treat legacy entries without that proof as protected when their origin differs from the current template.
  • Keep reconcileScripts(..., apply: false) read-only and use its ownership classification in the update --dry-run report.
  • Report protected scripts and require explicit review before --force-scripts.
  • Document the old-project upgrade boundary.

Verification

  • Focused update, upgrade, manifest, report, and semantic-merge tests: 71 passed.
  • Additional CLI regression for a pre-fix manifest: 6 passed.
  • node tests/security/scan.test.js: 17 checks passed.
  • JavaScript syntax checks and git diff --check passed.

This PR addresses managed-script ownership only. Historical Decision and Waitpoint migration remains in M-043 / PR #23. Old projects still need read-only preflight, separate product and governance backups, and a trial upgrade before switching.

@Kucell
Kucell merged commit 5d53a01 into main Oct 8, 2026
1 check passed
@Kucell
Kucell deleted the codex/fix-legacy-script-manifest-safety branch October 10, 2026 07:28
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