Skip to content

refactor(vrm-companion): split stage character lifecycle (H-2) - #4973

Merged
DoodleBears merged 1 commit into
mainfrom
codex/4521-h2-vrm-stage
Nov 22, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
codex/4521-h2-vrm-stage

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

H-2 #4521 | Agent work claim

Why the change

Give VRM character setup and resource release their own module so the stage can focus on rendering and lifecycle.

Special things to note

  • Refs Health H-2: split the 137 source files over 1000 lines by responsibility #4521. Task codex/local/01a204a0-debd-7873-96f6-6afc9f2e48ad.
  • Merge risk: Two-way door, revert this commit. Small blast radius limited to the optional VRM Companion Panel. Review the model and accessory helper calls, especially their position relative to rendering and disposal.
  • Verification: pnpm lint, pnpm typecheck and pre-commit hooks passed. pnpm exec vitest related --maxWorkers=2 passed all 117 affected tests. pnpm slides:build and pnpm exec vitest run --maxWorkers=2 apps/docs/test/changelog-public-surfaces.test.ts passed. pnpm exec vitest run --maxWorkers=2 packages/vrm-companion/test passed all 40 package tests, and pnpm build produced the VRM Host and Client artifacts. stage.ts went from 1,063 to 991 lines. The public type declarations, render loop, event-listener registration and disposal method match byte for byte. Re-inlining the extracted character operations produced an empty diff -u of the stage implementation, including Three.js object construction and disposal order.

Change outline

vrm-companion/src/client/
├── stage.ts             Stage entry point, rendering, listeners and lifecycle
├── stage-character.ts   VRM scene setup, headphones and model release
└── stage-types.ts       Stage types re-exported from the original entry point

Pre-existing issues found

  • None identified.

Issue: #4521
Agent-Task: codex/local/01a204a0-debd-7873-96f6-6afc9f2e48ad
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Touched Features Are Verified Warning The check fails. This PR changes runtime code of a mapped feature, and its verification notes name no run of that feature's journey and give no reason for skipping it. Evidence: - PR #4973 (author Doo… Run the touched feature's journey and record the run in the PR verification notes. For vrm-companion, run BH_E2E_INSTANCE=.humanlayer/verify/<name>/instance.json node scripts/e2e-vrm-companion.mjs with the open, send, work, `insta…
Passed Passed checks: 3 passed

Check name Status Explanation
Fix Targets The Root Cause Passed The check "Fix targets the root cause" applies only when the PR title starts with "fix". The PR title is "refactor(vrm-companion): split stage character lifecycle (H-2)". It starts with "refactor", no…
Consistent With Adrs And Existing Features Passed The check passes. The PR is a behavior-preserving refactor, and it does not violate any ADR or add a duplicate implementation. Evidence: - ADRs: docs/adr/ holds ADR-0353 to ADR-0361. A keyword s…
Product Terms Follow The Glossary Passed The check covers user-visible copy, docs, and the PR description that this PR adds. I checked them against GLOSSARY.md, which lists Avoid words for each product noun. - Added user-visible text is li…
Full details: Fix Targets The Root Cause

Explanation

The check "Fix targets the root cause" applies only when the PR title starts with "fix". The PR title is "refactor(vrm-companion): split stage character lifecycle (H-2)". It starts with "refactor", not "fix". The check is therefore inapplicable, and it passes. No code inspection was needed to reach this result. The PR description states that the change moves VRM character setup and release into a separate module. That is consistent with a refactor, not a defect fix. The review thread list was empty, so no other findings affect this result.

Full details: Consistent With Adrs And Existing Features

Explanation

The check passes. The PR is a behavior-preserving refactor, and it does not violate any ADR or add a duplicate implementation. Evidence: - ADRs: docs/adr/ holds ADR-0353 to ADR-0361. A keyword search for vrm, stage, companion, three, avatar, headphone, model and character found no ADR about the VRM Companion stage, character lifecycle, or Three.js resource disposal. No accepted ADR constrains the touched modules. - Diff (commit 4618e78): stage-character.ts is a new file. It contains mountCharacter, attachHeadphones and releaseCharacter. These are moved from stage.ts, not newly written. stage.ts imports them and removes the inline copies. The public types move to stage-types.ts and are re-exported from stage.ts. docs/architecture/feature-map.md is updated to describe the split. scripts/health-baseline.json drops the stage.ts entry. - Duplication: The only stage-character importer is stage.ts. decor.ts already has its own ImageBitmap close and VRMUtils.deepDispose logic. That overlap exists before this PR and this PR does not add it. The PR does not add a second implementation. - Scope: The PR changes structure, not behavior. The PR text says the public declarations, render loop, listeners and disposal method are unchanged. Nothing in the diff contradicts that claim. No ADR was contradicted, and no existing module gained a second implementation. The check passes.

Full details: Product Terms Follow The Glossary

Explanation

The check covers user-visible copy, docs, and the PR description that this PR adds. I checked them against GLOSSARY.md, which lists Avoid words for each product noun. - Added user-visible text is limited to one line in docs/architecture/feature-map.md (commit 4618e78). It uses "Avatar appearance", "stage", "Character scene helpers", and "VRM Companion Client". "Avatar" is the glossary term and is not used with an Avoid word. "Character" and "stage" have no glossary entry. "VRM Companion" is not "Window Companion", and the Avoid word "desktop pet" does not appear. - The code changes (stage.ts, stage-character.ts, stage-types.ts) add no UI strings, labels, or messages. The only quoted strings are import paths and a type literal, which are not copy. - The PR description uses "model" for the 3D VRM model. The glossary's "model" Avoid entry applies to Model Choice, so this sense is fine. "Agent work claim" refers to a coding-agent claim, not a PersonaBot, so the Agent entry does not apply. "Task" appears only in the branch name. No added product noun uses an Avoid word for its glossary meaning. The check passes.

Full details: Touched Features Are Verified

Explanation

The check fails. This PR changes runtime code of a mapped feature, and its verification notes name no run of that feature's journey and give no reason for skipping it. Evidence: - PR #4973 (author DoodleBears, head codex/4521-h2-vrm-stage, base main) changes commit 4618e78 against 9a4a0e3. The changed files are packages/vrm-companion/src/client/stage.ts (modified), stage-character.ts (added), and stage-types.ts (added). The other changed files are docs/architecture/feature-map.md and scripts/health-baseline.json. - The feature .agents/skills/verify-deepseekbot/features/vrm-companion.md has ## Sources packages/vrm-companion/**. The three changed src/client files match this glob. The change is runtime code, not docs-only or test-only. - The feature's journey is in "Driving it with verify-app". It uses scripts/e2e-vrm-companion.mjs with the phases open, send, work, instances and lifecycle. - The PR description's verification notes list pnpm lint, pnpm typecheck, vitest related, pnpm slides:build, a changelog test, packages/vrm-companion/test (40 package tests) and pnpm build. None of these runs the VRM Companion journey. The notes also give no reason why the journey was not run. - The PR description does not mention e2e-vrm-companion, the verify-app journey, or any skip reason. The standing FAIL from the previous run has no details. The current PR state shows the same gap, so the prior failure is not resolved.

Resolution

Run the touched feature's journey and record the run in the PR verification notes. For vrm-companion, run BH_E2E_INSTANCE=.humanlayer/verify/&lt;name&gt;/instance.json node scripts/e2e-vrm-companion.mjs with the open, send, work, instances and lifecycle phases against an isolated Host. Record the results, including any failure evidence and cleanup. If the journey cannot run, add a stated reason to the PR verification notes. Then the check passes for this PR.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@DoodleBears DoodleBears added harness:codex model:gpt-6.2-sol Code authored by GPT-6.2 Sol no-visual-change Touches UI files but renders nothing differently; skips the pr-visual-evidence check labels Nov 22, 2026
@DoodleBears
DoodleBears merged commit 079c0e6 into main Nov 22, 2026
32 of 45 checks passed
@DoodleBears
DoodleBears deleted the codex/4521-h2-vrm-stage branch November 22, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harness:codex model:gpt-6.2-sol Code authored by GPT-6.2 Sol no-visual-change Touches UI files but renders nothing differently; skips the pr-visual-evidence check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant