Skip to content

chore: add Unity validation worktree workflow#273

Draft
JOY (JOY) wants to merge 3 commits into
devfrom
feat/unity-validation-workflow
Draft

chore: add Unity validation worktree workflow#273
JOY (JOY) wants to merge 3 commits into
devfrom
feat/unity-validation-workflow

Conversation

@JOY
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the local Unity validation worktree workflow for parallel agents. The workflow keeps feature agents in separate worktrees, uses one fixed unity-validation worktree for Unity integration, and validates one or more refs through disposable validation/* branches instead of merging into root dev.

Linked issue / ADR

Refs local multi-agent Unity validation workflow.

Touched areas

  • Unity client (Unity/)
  • Dedicated server build flags / CI
  • Nakama runtime (backend/nakama/)
  • Supabase schema / RLS policies
  • DOS Chain integration / NFT contracts
  • AI agent runtime
  • Design docs (docs/design/) or ADRs (docs/adr/)
  • CI / project tooling

Test plan

  • PASS: root dev cleaned and fast-forwarded to origin/dev; previous dirty work preserved on local branch wip/root-dirty-20260526-141239 commit 52d32b49.
  • PASS: created fixed validation worktree at D:\Projects\Second-Spawn\.claude\worktrees\unity-validation.
  • PASS: tools/unity-validation/Initialize-UnityValidationWorktree.ps1 is idempotent from a feature worktree and resets validation lane to validation/unity from origin/dev.
  • PASS: tools/unity-validation/Invoke-UnityValidation.ps1 -Refs feat/facial-voice-mvp -QueueName dryrun-default-root -SkipUnity merged PR feat: add facial voice presentation hooks #272 branch into a disposable validation branch without touching root dev.
  • PASS: git diff --cached --check.
  • PASS: npx.cmd --yes markdownlint-cli2 docs/setup/unity-validation-workflow.md docs/setup/agent-handoff.md docs/setup/docs-navigation-and-gitbook.md docs/SUMMARY.md.
  • PASS: AGENTS.md and .claude/CLAUDE.md are synced after their header line.
  • EXPECTED BLOCKER CAUGHT: full Unity batch validation of PR feat: add facial voice presentation hooks #272 now exits non-zero because fresh validation worktree package resolution still reports The "path" argument must be of type string. Received undefined. No packages loaded. The script correctly fails on this log pattern instead of returning a false pass.

Server-authority check (mandatory if touching gameplay)

  • No new gameplay logic runs on the Unity client
  • No new API key embedded in the Unity client
  • LLM outputs are validated as intent server-side, never auto-applied
  • If this PR adds a new state mutation path, it goes through the Nakama runtime validator before any gameplay system consumes it

No gameplay or state mutation path changed.

Reviewer pass

  • AI agent reviewer pass attached

Local code-review fallback verdict: APPROVED.

Review summary:

  • The workflow preserves root dev, uses ignored worktrees, and avoids cross-repo edits.
  • The scripts fail closed on dirty validation state, unresolved refs, merge conflicts, Unity compile/package errors, and missing Unity executables.
  • The new docs align AGENTS.md, .claude/CLAUDE.md, handoff rules, and GitBook navigation.
  • Residual operational blocker: fresh Unity batch validation still hits the existing package resolver error, which this PR now detects correctly.

@JOY
Copy link
Copy Markdown
Contributor Author

Validation hardening update:

  • Added tools/unity-validation/Open-UnityValidationEditor.ps1 so the validation Editor opens with -force-d3d11 by default.
  • Updated Invoke-UnityValidation.ps1 to pass -force-d3d11 by default, wait for the Unity process, and read the real exit code/log instead of returning early on Windows.
  • Removed tracked .unitypackage.meta files for ignored Photon .unitypackage archives that made a clean validation import dirty.
  • Verified Invoke-UnityValidation.ps1 -Refs feat/unity-validation-workflow -QueueName workflow-d3d11 -GraphicsApi d3d11 passes Unity batch compile. Log shows Forcing GfxDevice: Direct3D 11 and return code 0 with no crash or compile/package failure.

Reason: manual opening of the fresh validation project crashed in Unity 6000.5 beta on D3D12 during import (GfxTaskExecutorD3D12::DoExecuteCopy). The root project was unaffected because its Library was already imported.

@JOY
Copy link
Copy Markdown
Contributor Author

Local reviewer fallback: APPROVED.

Reviewed scope:

  • tools/unity-validation/Invoke-UnityValidation.ps1
  • tools/unity-validation/Open-UnityValidationEditor.ps1
  • docs/setup/unity-validation-workflow.md
  • AGENTS.md and .claude/CLAUDE.md
  • stale Photon .unitypackage.meta cleanup

Findings: no blocking issues. The update keeps Unity validation isolated in .claude/worktrees/unity-validation, preserves AGENTS/CLAUDE sync, avoids changing project renderer settings, waits for the Unity process on Windows, and validates against the real Unity log. Unity D3D11 batch validation passed for this branch.

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