feat(as): compile against the deployment backup while a script mod stays installed - #115
Conversation
…ays installed Every product compile route validated the standalone compiler target against the LIVE PrecompiledScript_Shipping.Cache, while the base it emits and remaps against came from gore-mod's deployment-aware pristine selection. With a script mod deployed the two differed and the routes refused with "reset or undeploy active script mods before compiling", so iterating on an installed mod meant undeploy, compile, deploy. gore-mod now exposes the pristine SOURCE, not just its bytes: `pristine_script_cache_source` returns the file the selection names (the record-authenticated `*.gore-bak` while a deployment owns the cache, the live file otherwise, the live file again after a game update made the backup stale) together with its SHA-256 identity. The CLI (`gore as compile`, `compile-module`) and the FFI package resolver build the compiler target from that path, so the target handle pins the pristine file for the whole attempt and the installed mod stays in place. The check after the pin remains and now also proves the pinned bytes carry the identity selected before the pin; a mismatch is a base that changed in between and fails closed asking for a retry, never for an undeploy. Studio's script compile no longer falls back to the game compiler in that case. The full-graph closing audit and the drift handling are unchanged; the installed version is replaced only by the next deploy or Manager apply, which rebuild from the same pristine backup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`gore as compile` and `compile-module` accept `--expect-base <CACHE>` (a file the selected original must equal byte for byte, for example a frozen copy of the vanilla cache) or `--expect-base-sha256 <HEX>`. Neither selects the base: the deployment-aware selection stays the only source of truth, and the expectation only refuses a compile whose original is not the vouched-for one, naming both hashes and where the selected original came from. This makes the base a precondition rather than something the receipt records afterwards. The game backend now checks its guarded read against the selection identity too, mirroring the post-pin check of the standalone path. The MCP compile tools declare both arguments. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a28457334
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…the selected identity Three review findings on PR #115: - The game compiler regenerates into the live Shipping cache and restores it from the pinned target afterwards. With the target now validated against the deployment backup while a script mod is installed, that restore would have written the original over the mod (or left the raw regen live). The transaction now refuses a target whose Shipping path is not the live cache before its first install mutation; the standalone compiler keeps working from the backup and a game-capable policy reports the refusal as its fallback reason. - Studio's script compile compared the pinned target only against a fresh pristine read, discarding the identity selected before the pin. The FFI resolver now carries the pristine source with the package, and the check after the pin (script compile, managed project and story compilers) also proves the pinned bytes are the selected original. - The MCP `expect_base_sha256` argument was declared as Hex, which refused the documented `sha256:` prefix before the CLI could accept it; it is a plain string now and the CLI stays the validator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be8c8b0168
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… module base at the end Second review round on PR #115: - With the compiler base on the deployment backup, `standalone-then-game` used to run the game fallback after a standalone failure, and the refusal of that fallback became the reported result, hiding the standalone diagnostics. The module path now knows the blocker up front: it runs the standalone compiler only and reports the standalone failure with the skipped fallback appended. The CLI refuses an explicit `game` policy up front and announces the skipped fallback; Studio's script compile does the same and records the skipped fallback in its evidence. The full-graph game attempt refuses a backup-pinned target as a preflight failure before it consumes the target, and the transaction refusal no longer claims the standalone compiler could run. - `compile-module` had no closing audit: a game update replacing the live cache during a standalone compile against the backup could publish a mini remapped to a base gore-mod would no longer treat as pristine. The CLI and Studio now re-read the deployment-aware original before publishing and discard the mini when the selection or its bytes changed. - The MCP compile routes declare `expect_base` and `expect_base_sha256` as mutually exclusive, matching the clap contract, instead of spawning a CLI that fails at argument parsing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a1e6eb292
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Studio's script compile attached a game preflight fallback reason to every failed compile whose base was the deployment backup, including strict standalone requests that never had a game fallback. The note is now derived from the requested policy: only standalone_then_game skips a fallback and says so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
…ed policy, skip the project fallback Third review round on PR #115: - gore-mod reported every non-live pristine source as an installed script mod. An unowned `*.gore-bak` that is byte-identical to the live cache is admitted as a legacy source too, and no mod is installed in that case; the source now names the live cache there and derives `from_backup` from the deploy record owning the backup. - The CLI stored the effective execution mode in the variable it later sealed into the generation receipt, so a `standalone-then-game` request with a suppressed fallback was recorded as a strict standalone request. The caller's policy and the effective mode are separate now; receipts seal the former. - Studio's Revision 3 project compiler still entered the full-graph game fallback with a backup-pinned target after a standalone failure, turning the actionable standalone failure into a game preflight error without diagnostics. It now applies the same policy as the module path: on a backup-pinned base `standalone_then_game` runs the standalone compiler only, takes no install guard, and records the skipped fallback in its evidence. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4eeb414462
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…o's compile routes Fourth review round on PR #115: - The managed Quest/NPC compiler acquired the install-mutation guard for standalone_then_game even when the base is the deployment backup and the game fallback would never run; it now derives the effective policy first, takes no guard in that case, and records the skipped fallback only when the standalone attempt failed. - Studio's script compile omitted the skipped-fallback evidence when the standalone runner failed to initialize; the early response carries it now. - The project compiler recorded the skipped fallback on successful standalone results and derived the skip only from a resolved package; the pristine source is now selected independently, an explicit game policy is refused up front on a backup-pinned base, the note is evidence only for failures, and a skipped fallback without any package reports the package reason instead of panicking. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80d33e87ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ective policy With the game fallback skipped for an installed script mod, the Quest/NPC compiler still branched its sidecar initialization on the requested policy, so a runner failure fell through to a standalone compile without a runner and reported "no standalone compiler backend was injected". The branch now follows the effective policy and its early RUNNER_UNAVAILABLE response carries the skipped-fallback evidence, like the project and script routes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89c103d9ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Studio's script compile and the Quest/NPC checks still reached the legacy V1 managed compiler while a script mod was installed: an explicit game request bypassed the product handler, and standalone_then_game fell back to it when the standalone package was absent, unavailable or could not be located. Both routes now select the pristine source before dispatch. An explicit game request is refused with the same explanation the CLI gives, and a fallback without a package reports the standalone failure with the skipped game fallback as evidence instead of launching the game compiler. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7da9fd723
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…held The dispatch probe that keeps the legacy game path off an installed script mod ran before that path acquired the install-mutation guard, so a deploy landing in between could still send the game compiler against a modded live cache with a backup-based base. Both legacy paths (script compile, Quest/NPC checks) now ask again right after the guard is acquired and refuse with the same explanation, releasing the guard. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@cursor review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbdd9aab5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…e compiler runs A deploy landing between the base selection and the install-mutation guard leaves the original's bytes in place (its backup holds them) while installing a script mod the game compiler must not run on, so the identity comparison alone could not notice it. The CLI's guarded read and Studio's project compiler now select the source again once the guard is held and refuse a backup-based base, releasing the guard and pointing at the retry that will take the standalone route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77bc4a961d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…henticated-target routes Studio's script compile and the Quest/NPC managed check resolve their compiler target before acquiring the install-mutation guard. A deploy landing in between installs a script mod while leaving the original's bytes in place, so the byte comparison after the pin could not notice it and a failed standalone attempt would have entered the game fallback. Both routes now ask again once the guard is held and refuse with the retry hint. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@cursor review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e615b2ae3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rget path too `compile` and `compile-module` selected their base before the install guard and afterwards only compared the pinned bytes, which a deploy landing in between leaves untouched while it installs a script mod. The qualified target check now repeats the selection once the guard is held and refuses when its path, identity or backup ownership changed, like the no-package path and the Studio routes already did. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
…game fallback With the game fallback skipped for an installed script mod, a project check whose standalone bundle was absent, unavailable or could not be located was routed through the generic runner-unavailable response and lost the machine-readable package cause. The standalone-only decision is now made before package resolution, so those cases return the same bundle-absent, package-unavailable or package-location responses as a strict standalone request, with the skipped fallback attached as evidence. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ddcad2c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…fallback is skipped An empty Revision 3 project needs no compiler backend and reports not_needed_empty. With a script mod installed, the standalone-only decision turned an absent or unavailable package into an early failure before that path was reached. The early package failure now applies to strict standalone requests and to non-empty projects only. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7e171b5. Configure here.
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Iterating on an installed script mod no longer needs undeploy → compile → deploy.
gore as compile,gore as compile-module, the MCP compile tools, Studio's script compile and the managed project/story compilers) used to validate the standalone compiler target against the livePrecompiledScript_Shipping.Cache, while the base it emits and remaps against came from gore-mod's deployment-aware pristine selection. With a script mod deployed the two differed and the routes refused with "reset or undeploy active script mods before compiling".pristine_script_cache_sourcenames the file the selection picks (the record-authenticated*.gore-bakwhile a deployment owns the cache, the live file otherwise, the live file again after a game update made the backup stale) together with its SHA-256 identity. An unowned backup that is byte-identical to the live cache counts as the live cache, not as an installed mod.compiling against the deployment backup …).COMPILE_PRISTINE_BASE_CHANGEDon the wire).compile-module(CLI and Studio) re-reads the deployment-aware original after the compiler ran and discards a mini whose base changed meanwhile, as the full-graph closing audit already did.--backend game(and the explicitgamepolicy on every Studio route, including the legacy dispatch) is refused up front;standalone-then-gameruns the standalone compiler only and reports the standalone result with the skipped fallback noted (CLI stderr, Studio evidence, only on failure) instead of a refused game attempt hiding the standalone diagnostics. A package that is absent or unavailable then reports its own cause with the skipped fallback attached; an empty project still needs no compiler. Every route re-selects the pristine source once the install-mutation guard is held, so a deploy landing between selection and guard cannot reach the game compiler.--expect-base <CACHE>/--expect-base-sha256 <HEX>oncompileandcompile-modulelet a caller vouch for the original: they refuse a compile whose selected original differs (naming both hashes and where the original came from) and never select the base themselves. Receipts seal the caller's requested policy, not the effective one. The MCP compile tools declare both arguments as a plain string (the CLI validates the optionalsha256:prefix) and as mutually exclusive.scripts.md,cli-reference.md) and changelogs updated.Unchanged: drift handling, and the fact that the installed version is only replaced by the next
gore mod deploy/ Manager apply, which rebuild from the same pristine backup.Test plan
cargo test -p gore-mod(513 passed; new: source names the backup while a mod is installed, drift and undeploy return to live, unowned identical backup counts as live)cargo test -p gore-as(632 passed; new: backup-pinned target refused before the first install mutation, blocker detection, standalone-then-game keeps the standalone failure when the fallback is blocked)cargo test -p gore(377 passed + integration; new: target path from the backup, post-pin identity check, expectation parsing/matching, guarded game-backend read and post-guard re-selection, fallback policy, closing base audit)cargo test -p gore-ffi(525 passed; new: resolver target paths follow the pristine source, identity-aware post-pin check, closing base audit, skipped-fallback gating, installed-mod probe, changed failure code)cargo test -p gore-mcp(346 passed; new: expectation argument kinds and conflict sets)scripts/check_docs_links.pyclean; rustfmt clean on the touched regions🤖 Generated with Claude Code