Skip to content

feat(workspace): cue the final part back in after a staggered return - #1112

Open
seonghobae wants to merge 8 commits into
developfrom
feat/workspace-first-leftover-last-dropout-remaining-last-return
Open

feat(workspace): cue the final part back in after a staggered return#1112
seonghobae wants to merge 8 commits into
developfrom
feat/workspace-first-leftover-last-dropout-remaining-last-return

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Product outcome

When several parts sit out and return in stages, the ready rehearsal map identifies the one unambiguous final part back in. The selected player gets a direct “come in” instruction; the rest of the band gets a count-in action. If the last return is tied or the activity sequence is incomplete, the cue fails closed instead of inventing a player.

Exact current identity

  • Protected target: develop@749511c3ad4000090048718f685c6bee6b3d2c25
  • Exact current head: 9285c5edbd505449442a82d0f4db8c503881f30c
  • Branch: feat/workspace-first-leftover-last-dropout-remaining-last-return

Current exact scope

  • firstLeftoverLastDropoutRemainingLastReturn tracks the full internal activity sequence needed to establish a unique final re-entry from existing partGraph evidence.
  • Blank labels, missing graph nodes, inherited or missing is_active, unnamed roles, incomplete transitions, singleton dropouts, and malformed roots fail closed.
  • A return that coincides with a new dropout invalidates the chain rather than being treated as a completed return.
  • Simultaneous final returns are ambiguous in all-roles mode and fail closed. Selected-role mode may disambiguate only when the selected role itself is one of the tied returners.
  • Customer-visible EN/KO copy uses rehearsal language: “final re-entry”, who is last back, the section where the band began returning, and the concrete come-in/count-in action. Internal state-machine terminology remains in implementation and doctoring only.

Regression-first repairs

The current branch contains regressions for the transition defects found during review:

  • firstLeftoverLastDropoutRemainingLastReturn.concurrent-dropout.test.ts proves a tracked return accompanied by a new dropout cannot complete a valid chain.
  • firstLeftoverLastDropoutRemainingLastReturn.simultaneous-return.test.ts proves tied final returns do not acquire graph-order authority, while selected-role mode can disambiguate its own return where valid.
  • apps/desktop/src/i18n/workspaceLastReturnCopy.test.ts rejects internal leftover / last-dropout vocabulary from English customer guidance and pins equivalent action-oriented English and Korean copy.
  • Workspace.test.tsx is aligned with the current final-re-entry copy, so the rendered callout contract and locale contract agree.

Security boundary

This helper consumes already-loaded RehearsalSong data only. It does not gain filesystem, network, IPC, subprocess, WebView, model, or export authority. Untrusted graph evidence is admitted only through own-property, complete, unique boolean activity records and meaningful role identities. Safe failure returns null.

No dependency, lockfile, workflow, credential, or central .github change is part of this PR. Canonical dependency/security authority remains inherited from protected develop and #783.

Verification

On exact 9285c5edbd505449442a82d0f4db8c503881f30c, repository build-baseline, Bandit, Security Scan, Semgrep, secret scan, security-audit, and release workflows are terminal-success. Repository ci and sbom remain queued and therefore are not passing evidence. Existing reviews are COMMENTED only; there is no qualifying independent non-author approval on this exact head.

Do not merge until one unchanged exact head has every applicable protected required check terminal-success, current-head security/SAST/SBOM/supply-chain/coverage/release evidence, zero valid unresolved actionable review findings, and a qualifying independent non-author approval. Queued, skipped-required, cancelled, neutral, failed, stale, predecessor, protected-base, self/author, model-only, synthetic, or administrative-bypass evidence is not success.

Relevant implementation and rationale remain documented in docs/doctoring/first-leftover-last-dropout-remaining-last-return.md, ARCHITECTURE.md, AGENTS.md, CLAUDE.md, CHANGELOG.md, and the design-system component contract.

… last-return on the map

Name the leftover last-dropout remaining last-return after leftover last-dropout remaining from existing partGraph evidence so the last leftover last-dropout remaining comes in, and the band counts that leftover last-dropout remaining last-return in.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 25 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 27a75a98-da9d-4a5f-94b4-fc23fd6582c9

📥 Commits

Reviewing files that changed from the base of the PR and between 749511c and 9285c5e.

📒 Files selected for processing (16)
  • AGENTS.md
  • ARCHITECTURE.md
  • CHANGELOG.md
  • CLAUDE.md
  • apps/desktop/src/features/workspace/Workspace.test.tsx
  • apps/desktop/src/features/workspace/Workspace.tsx
  • apps/desktop/src/features/workspace/firstLeftoverLastDropoutRemainingLastReturn.concurrent-dropout.test.ts
  • apps/desktop/src/features/workspace/firstLeftoverLastDropoutRemainingLastReturn.selected-role.test.ts
  • apps/desktop/src/features/workspace/firstLeftoverLastDropoutRemainingLastReturn.simultaneous-return.test.ts
  • apps/desktop/src/features/workspace/firstLeftoverLastDropoutRemainingLastReturn.test.ts
  • apps/desktop/src/features/workspace/firstLeftoverLastDropoutRemainingLastReturn.ts
  • apps/desktop/src/i18n/workspaceLastReturnCopy.test.ts
  • apps/desktop/src/locales/en/common.json
  • apps/desktop/src/locales/ko/common.json
  • docs/design-system/component-contract.md
  • docs/doctoring/first-leftover-last-dropout-remaining-last-return.md

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 5 potential issues.

Devin Review

Comment thread apps/desktop/src/locales/en/common.json Outdated

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Become the sole writer for canonical BandScope branch feat/workspace-first-leftover-last-dropout-remaining-last-return only while it still resolves to exact head bd84a94ebb13420ce724ea4a4cb01838e6b40096 and protected develop still resolves to 749511c3ad4000090048718f685c6bee6b3d2c25. Apply superpowers:using-superpowers, receiving-code-review, systematic-debugging, test-driven-development, and verification-before-completion; refetch exact head/base and every touched blob immediately before writing. Do not create another branch/PR, force-push, destructively rebase, weaken gates, or mutate foreign repositories.

Fresh current-head source verification confirms two real state-machine defects plus one buyer-copy defect.

  1. Thread PRRT_kwDORjvEXs6dpL2y: while pendingRemaining completes, the code only evaluates the tracked remainingIds. A role outside that tracked cohort can newly transition active→inactive in the same named section where the remaining cohort returns, yet the implementation still records pendingLastReturn. TDD first: create a RED chain that reaches pending remaining, has the tracked remainder fully return while an outside role newly drops in that same section, then continues through a later >=2 dropout, partial return, and final return. Expected: no cue may be emitted from that invalid predecessor chain. Repair at the transition boundary by rejecting/restarting that completed-last-return transition when outside-cohort newly-inactive evidence appears; do not merely suppress a later result.

  2. Thread PRRT_kwDORjvEXs6dpL3g: in pendingRemainingDropout, when multiple tracked remaining roles return together and none remain out, returningLast[0] arbitrarily names one graph entry even though the result/copy contract is singular. Add all-roles and selected-role RED regressions with two simultaneous final returners. The narrow safe contract for this PR is fail-closed unless exactly one role is demonstrably last; do not invent ordering from graph position. Preserve the existing single-return positive path.

  3. Thread PRRT_kwDORjvEXs6dpL8Q: exact current English strings repeat internal implementation jargon (leftover last-dropout remaining last-return) in customer-facing copy. After behavior is GREEN, replace only the customer-visible English/Korean copy necessary for this callout with short rehearsal language that tells the player what to do and where (for example, who comes back last and the section to enter from), while keeping translation keys/API stable and updating literal-copy tests. Do not expose state-machine terminology to players.

Run focused helper + selected-role + Workspace/i18n tests, desktop typecheck/lint and coverage-configured tests, then repository quickcheck/full applicable suite. Commit only the verified regressions, causal state fixes, and scoped copy cleanup to this canonical branch. Do not resolve any review thread until its successor exact-head evidence is GREEN; leave architecture-refactor analysis thread PRRT_kwDORjvEXs6dpL4a unresolved unless you actually address it.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair the existing contributor branch only, anchored to exact head bd84a94ebb13420ce724ea4a4cb01838e6b40096 and protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. Refetch head/base/source/review threads immediately before writing; if the lane has moved, inspect the intervening delta and adapt rather than racing it.

Apply receiving-code-review, systematic debugging, and TDD. Verify the two current-head Devin bugs against source, then add smallest realistic RED regressions before production changes: (1) while pendingRemaining is waiting for the tracked cohort, a role outside that cohort becoming newly inactive in the same section as the tracked final return must invalidate/reseed the candidate rather than completing a false last-return chain; carry the regression through later dropout/partial-return/final-return transitions so the stale chain cannot publish. (2) when two or more tracked remaining roles return together in the final-return section, do not arbitrarily pick returningLast[0]; the current scalar result/copy cannot truthfully represent a tie, so fail closed unless there is exactly one final role (including selected-role cases) unless you can make a strictly bounded, backward-compatible multi-role representation with complete UI/i18n coverage.

Also replace the customer-visible internal state-machine jargon with short rehearsal-action copy in English and Korean while preserving semantic parity; do not expose implementation labels such as “leftover last-dropout remaining last-return” to players. Keep docs/doctoring and PR contract consistent with the repaired executable behavior.

Obtain focused RED→GREEN, full desktop Vitest, typecheck, lint, and exact-head required CI/security/coverage evidence. Resolve only threads actually addressed. Do not self-approve, force-push, weaken gates, mutate central .github, or create a competing PR.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Take the sole writer lease for the current exact RED repair on canonical feat/workspace-first-leftover-last-dropout-remaining-last-return, only while it still resolves to a151751475de1e174b22fc9320231449d61aa72e over protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. The predecessor lease bound to bd84a94… is superseded by branch movement. Refetch head/base and every touched blob immediately before writing; abort/adapt if the lane moves. Apply superpowers:using-superpowers, receiving-code-review, systematic-debugging, TDD, and verification-before-completion.

Exact repository CI run 33392362940, job 99502610272, checked out merge result 8bf52896ca49539f08e8cbc25a79226b8ee6c3ab for this head/base and gives the required RED proof: the new concurrent-dropout regression receives an invalid ending cue instead of null, and the new simultaneous-final-return regression receives an arbitrary keys-right cue instead of null; all prior desktop tests remain green. This confirms both current Devin findings on the production state machine rather than a test-environment artifact.

Make the narrowest causal fixes in firstLeftoverLastDropoutRemainingLastReturn.ts: (1) when a tracked pendingRemaining cohort finishes, reject/restart that candidate if any role outside the tracked cohort newly becomes inactive in the same transition instead of manufacturing pendingLastReturn; preserve a legitimate new reduction as the next search baseline where appropriate. (2) A result model that names one remainingRoleId cannot truthfully represent a tied final return, so fail closed unless exactly one tracked remaining role returns in the terminal transition; do not select graph-order returningLast[0]. Preserve the selected-role contract and fail-closed malformed-graph behavior. Use the two already-committed RED files as acceptance tests; add only the smallest adjacent regression needed to protect restart behavior.

Also fix the still-current buyer-copy thread in the same owning lane: replace internal repeated “leftover last-dropout remaining last-return” wording in the English/Korean customer-facing cue with concrete rehearsal actions a player can scan (who is still out, who comes back last, where to enter/count in), without changing the underlying contract or inventing state. Keep docs/doctoring aligned with actual executable behavior after the repair rather than documenting contradictory transitions.

Run the two focused RED regressions first, then helper + selected-role + Workspace/i18n tests, desktop typecheck/lint, exact configured coverage, and repository quickcheck. Commit to this existing branch and report successor exact SHA plus RED→GREEN evidence. Do not resolve review threads yourself until successor exact-head evidence exists. No new branch/PR, force-push/rebase, workflow/gate/dependency changes, foreign-repo mutation, or self-review.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair the current canonical contributor branch only, anchored to exact head 762e48537e30a8eef131c734fdea8acf1b744c18 and protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. Refetch head/base and Workspace.test.tsx immediately before writing; if either moved, inspect the intervening delta and adapt rather than racing it.

Apply receiving-code-review, systematic-debugging, test-driven-development, and verification-before-completion. The two prior production findings are already repaired on this head and their regressions are present: concurrent outside-role dropout now fails closed during tracked final return, and simultaneous tied final return requires exactly one final role. The current exact-head Devin finding discussion_r3897340412 is a separate test-contract inconsistency caused by the buyer-copy cleanup: apps/desktop/src/locales/en/common.json now says Tonight's first final re-entry and uses practical last part back / others started returning / final re-entry wording, while three Workspace.test.tsx assertions still require the replaced internal state-machine phrase. Verify the mismatch against current source, then update only those stale Workspace expectations to the current localized copy. Do not revert the improved customer-facing copy or change production behavior merely to satisfy stale tests.

Run the affected Workspace test first, then desktop Vitest/typecheck/lint and exact configured coverage. Commit only the scoped expectation repair to this existing branch, refetch successor exact head/base, and leave current-head CI/review to rerun independently. Resolve discussion_r3897340412 only after successor evidence demonstrates the assertion contract is fixed. No new PR/branch, force-push/rebase, gate/workflow/dependency changes, foreign-repository mutation, or self-approval.

@seonghobae seonghobae changed the title feat(workspace): name tonight's first leftover last-dropout remaining last-return on the map feat(workspace): cue the final part back in after a staggered return Aug 31, 2026
@opencode-agent

Copy link
Copy Markdown
Contributor

Queued @opencode-agent for PR #1112 at head 9285c5edbd505449442a82d0f4db8c503881f30c. Central exact-name Actions artifacts are the durable dispatch ledger; existing review workflows remain authoritative for the final verdict and failure evidence.

@opencode-agent

Copy link
Copy Markdown
Contributor

Queued @opencode-agent for PR #1112 at head 9285c5edbd505449442a82d0f4db8c503881f30c. Central exact-name Actions artifacts are the durable dispatch ledger; existing review workflows remain authoritative for the final verdict and failure evidence.

@opencode-agent

Copy link
Copy Markdown
Contributor

Queued @opencode-agent for PR #1112 at head 9285c5edbd505449442a82d0f4db8c503881f30c. Central exact-name Actions artifacts are the durable dispatch ledger; existing review workflows remain authoritative for the final verdict and failure evidence.

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