Skip to content

Add guarded artifact and rehearsal integration - #4

Merged
SamG-Coder merged 1 commit into
SamG-Coder:mainfrom
ghost2788:codex/gate3-infinity
Sep 1, 2026
Merged

SamG-Coder merged 1 commit into
SamG-Coder:mainfrom
ghost2788:codex/gate3-infinity

Conversation

@ghost2788

Copy link
Copy Markdown

Summary

Adds a small, capability-gated integration seam to the existing nine-tool Studio surface:

  • three_studio_project can import and guarded-export one configured-root-relative canonical JSON artifact.
  • three_studio_apply gains the exact, hash-guarded artifact.json.patch operation.
  • three_studio_job can invoke a configured external rehearsal using only a repository-relative run-spec reference.
  • The current upstream Plainform, Pathwire, blank/starter project, texture-bake, material-look, and scene-export capabilities remain intact.

Security and ownership boundary

  • No generic command, executable, argument vector, shell, raw code, or environment input is accepted.
  • Rehearsals invoke exactly tools/rehearsal-sidecar/src/cli.mjs with shell: false and a minimal environment.
  • Artifact exchange is confined to the configured root, rejects traversal and Windows reparse/junction escapes, and uses exact file/content SHA-256 guards.
  • Machine-local roots remain outside saved projects.
  • The external project remains authoritative for gameplay assertions, deterministic state, rendering, and evidence publication; Studio only authors the typed artifact and dispatches the fixed job.
  • Compile-heavy job calls use the existing bounded 120-second bridge policy and propagate cancellation.

Upstream compatibility

This branch is rebased onto current main (e0fe5b0). Conflict resolution unions the new guarded seam with upstream's sceneExport, blank project template, material.look.patch, Pathwire bridge codec, and Plainform runtime/tests. The generated nine-tool contract is 85,793 bytes, so its compact total-schema test ceiling moves narrowly from 85,000 to 86,000 bytes; the stricter 73,000-byte apply-schema ceiling and one-MiB transport ceiling are unchanged.

Verification

  • node --test tests/*.test.mjs: 741 passed, 0 failed on Node v24.19.0.
  • Checked-in JSON schema regenerated exactly from the live Zod schemas.
  • Native Studio v0.2.0 host previously completed two deterministic edited-source rehearsals and a clean-checkout committed-state rehearsal through this seam; the published bundles independently verified with identical state/capture hashes. After rebasing onto current upstream, the complete 741-test regression suite passed.
  • Negative coverage includes traversal, stale destination bytes/hashes, Windows junction escape, arbitrary-command rejection, cancellation, sidecar protocol validation, evidence-file hash verification, and authoritative-result consistency.

Review focus

Feedback is especially welcome on the generality and naming of the artifact exchange and fixed rehearsal hook. This proposal does not vendor an external project or establish a maintained fork.

@ghost2788

Copy link
Copy Markdown
Author

Post-rebase native verification

Verified the rebased PR head 57904f8b40ac94582611bfc0c820953b88b239f5 with the official Studio v0.2.0 native host:

  • Native WebGPU viewport reached ready state and loaded tool-contract hash 586b5319b558e4b3ec6866bdc78351f20c6c240ba5d25e42b74c7bc2e02fb3d3.
  • Live status retained textureBake, upstream sceneExport, and configured rehearsalRun, plus the guarded artifact project actions.
  • Rehearsal run 5d358f1a-f484-41a3-bb06-14bae23900e0 completed successfully from the clean committed external-project state.
  • Bundle caad8d7dd3d49d404d7faec5d1e3daef7fa7a9d02d6c894998f79f3319dae626 passed independent on-disk verification; the manifest SHA-256 exactly equals the bundle ID.
  • All three game-owned assertions passed. State digest is 4694f4f9570d12093f4c27200f6a89a77d91d0ea39a3cbfe9bb365e4c3f7aa8f.
  • Captures at requested/presented ticks 0/0, 420/420, and 900/900 were opened at 640x360 and visually inspected. They are clean, distinct, fully framed, and byte-identical to the earlier deterministic runs.
  • The manifest records git.dirty: true because Unity reserialized one ProjectSettings value after the verified clean launch and before publication. That generated change was inspected, restored, and not committed; source, digest, assertions, and capture hashes are unchanged.
  • Post-rebase Node regression remains 741 passed, 0 failed.

@ghost2788
ghost2788 marked this pull request as ready for review August 31, 2026 20:05
@SamG-Coder
SamG-Coder merged commit b1dadb8 into SamG-Coder:main Sep 1, 2026
@SamG-Coder

Copy link
Copy Markdown
Owner

Thank you for the contribution and for the thorough verification work. The guarded artifact exchange and rehearsal integration are a useful addition to Studio.

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.

2 participants