Skip to content

chore: Document reflection-based state recovery and pause-point capture edge cases#1874

Merged
hatayama merged 4 commits into
v3-betafrom
docs/pause-point-skill-second-round-feedback
Jul 20, 2026
Merged

chore: Document reflection-based state recovery and pause-point capture edge cases#1874
hatayama merged 4 commits into
v3-betafrom
docs/pause-point-skill-second-round-feedback

Conversation

@hatayama

@hatayama hatayama commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Documents pause-point and dynamic-code techniques discovered during second-round PlayMode/E2E verification that were previously only known ad hoc, not written into the skill guidance AI agents read.

User Impact

  • Before: agents using execute-dynamic-code/await-pause-point had no documented way to recover a stuck PlayMode session without stopping Play and recompiling, no warning about UnityEngine.Object capture limits or capture-depth limits, no documented pattern for arranging state in a self-progressing game, no tip for pausing on lines that run every frame, and no note that a marker's timeout no longer needs padding for slow setup steps.
  • After: all five techniques are documented in the relevant skill files, in English, alongside the existing related guidance they extend.

Changes

  • ExecuteDynamicCode skill: documents using reflection to write private fields directly and recover/steer a stuck PlayMode session, without stopping Play, editing code, or recompiling.
  • PausePoint skill:
    • Notes that a captured UnityEngine.Object value only ever carries identifying info, never custom fields, and how to get a custom field's value instead.
    • Notes the MaxCollectionPreviewDepth (2-level) budget on nested-field previews off this, independent per captured variable, with a tip to target a line where the value is a direct local/parameter instead.
    • Documents a pattern for self-progressing games: arrange board/state via TryGetCapturedValue("this") while paused, reserving real simulated input for only the verified move.
    • Documents a temporary if-guarded Debug.Assert as an observation line for cases where every reachable line runs unconditionally every frame.
    • Notes that await-pause-point now extends a marker's own timeout before waiting (see the pause-point marker expiry fix), so enable-pause-point --timeout-seconds no longer needs to be inflated to survive a slow multi-step CLI sequence.
  • Regenerated .claude/.agents skill copies via uloop skills install --claude --agents. This also picks up one already-merged source change (the find-game-objects zero-hit hint) whose generated copies had drifted out of sync before this PR.

Verification

  • dist/darwin-arm64/uloop compile --project-path <repo> -> 0 errors, 0 warnings (doc-only change; confirms no incidental breakage).
  • diff between each edited source SKILL.md and its regenerated .claude/.agents copy -> byte-identical.

Review in cubic

… edge cases

Second-round PlayMode/E2E verification surfaced several pause-point
and dynamic-code techniques that were only discovered ad hoc during
testing, not written down anywhere:

- execute-dynamic-code: writing private fields via reflection to
  recover or steer a stuck PlayMode session without stopping Play,
  editing code, or recompiling.
- pause-point: UnityEngine.Object captures only ever carry identifying
  info, never custom fields; nested-field previews off `this` bottom
  out at MaxCollectionPreviewDepth (2) per captured variable; setting
  up a self-progressing game's board via TryGetCapturedValue("this")
  while paused, reserving real input for only the verified move; using
  a temporary if-guarded Debug.Assert as an observation line when every
  reachable line runs unconditionally every frame; and that
  await-pause-point now extends a marker's own timeout before waiting,
  so enable's --timeout-seconds no longer needs to be inflated to
  survive a slow multi-step CLI sequence.

Regenerated .claude/.agents skill copies with `uloop skills install`
and confirmed byte-identical match against source. This also picks up
one already-merged source change (#1729's zero-hit hint) whose
generated copies had drifted out of sync before this PR.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aac93a97-68f4-4161-80d4-32004944582a

📥 Commits

Reviewing files that changed from the base of the PR and between a3b100b and 7a56e4a.

📒 Files selected for processing (6)
  • .agents/skills/uloop-execute-dynamic-code/SKILL.md
  • .agents/skills/uloop-pause-point/SKILL.md
  • .claude/skills/uloop-execute-dynamic-code/SKILL.md
  • .claude/skills/uloop-pause-point/SKILL.md
  • Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Skill/SKILL.md

📝 Walkthrough

Walkthrough

Changes

Skill guidance documentation

Layer / File(s) Summary
Live state injection guidance
.agents/skills/uloop-execute-dynamic-code/SKILL.md, .claude/skills/uloop-execute-dynamic-code/SKILL.md, Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Skill/SKILL.md
Documents reflection-based private-field updates in unrecoverable running PlayMode sessions as one-off diagnostics.
Exact search result guidance
.agents/skills/uloop-find-game-objects/SKILL.md, .claude/skills/uloop-find-game-objects/SKILL.md
Clarifies exact full-name matching and zero-hit Message hints recommending Contains or Regex.
Pause-point workflow guidance
.agents/skills/uloop-pause-point/SKILL.md, .claude/skills/uloop-pause-point/SKILL.md, Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
Clarifies timeout timing, captured-value traversal and Unity object metadata, deterministic paused-state setup, and conditional line placement.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: documenting reflection-based state recovery and pause-point edge cases.
Description check ✅ Passed The description accurately matches the documented pause-point and dynamic-code updates and is clearly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/pause-point-skill-second-round-feedback

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

Comment @coderabbitai help to get the list of available commands.

hatayama added 2 commits July 20, 2026 18:17
Advisor review of PR-I found three documentation defects: the
timeout note conflated the setup window with the wait window even
though a marker already expired before await-pause-point starts
cannot be resurrected; the if+Debug.Assert observation pattern
guarded on the same postcondition it asserted, making the assert a
tautology instead of checking the actual mutation; and the
reflection-is-otherwise-disallowed line stated the author's personal
global policy as if it were a project-wide skill contract, which
this skill package ships to every user.
The previous fix commit reworded these sections in the implementer's
own words. The user asked that the skill wording itself come from
the advisor, so this replaces that wording verbatim with the text
the advisor supplied for the timeout note, the if+Debug.Assert
observation pattern, and the reflection rationale.
Advisor-authored pass over the remaining implementer-written additions:

- Depth-cap note now names the symptom (type name where contents were
  expected), shows the this-vs-local contrast with a concrete example,
  and states that primitives and ToString-overriding types always render
- UnityEngine.Object note drops the incorrect ToString() suggestion
  (the formatter only reads .name) and shows the rename workaround
- Self-progressing-game note explains why the race is lost (CLI round
  trips outlast the game tick) before giving the pattern
- Live-state-injection intro replaces the self-contradictory
  "unrecoverable state" framing with concrete trigger cases

Generated copies regenerated via uloop skills install --claude --agents.
@hatayama
hatayama merged commit af50cf4 into v3-beta Jul 20, 2026
5 of 6 checks passed
@hatayama
hatayama deleted the docs/pause-point-skill-second-round-feedback branch July 20, 2026 13:17
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
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