Issue 4
Title
Missions completion: successful-return debrief, Firestore card mutation, and failed-run record logging
Body
Summary
Complete the Missions loop by adding:
successful-return aggregation
Firestore card mutation on successful return only
debrief UI
active-run cleanup/archive
failed-run history logging without gameplay penalties
Why
The mode’s central rule is: Only successful returns count.
This issue ensures that rewards and persistent mutation are only committed once the player returns to the Workshop, while failed runs remain non-punitive and are only recorded as history.
Scope
Aggregate POI and encounter outcomes
Apply successful-return-only mutation to the selected player card
Prevent duplicate completion writes
Add debrief summary UI
Clear/archive active run
Add failed-run baseball-card-style record logging on card and/or deck
Keep failure logging compatible with future squad mission support
Acceptance Criteria
Returning successfully to the Workshop aggregates the run’s POI and encounter outcomes exactly once.
Successful completion mutates the selected player card in Firestore exactly once, even if the client refreshes or retries during completion.
Successful completion can apply rewards and persistent stat/result changes only after the return to the Workshop is validated.
A readable debrief screen is shown after successful completion summarizing route, encounters, mission result, and final gains/losses.
The active run record is cleared or archived appropriately after successful completion.
Failed runs do not grant rewards.
Failed runs do not apply gameplay penalties to the player card.
Failed runs may record non-punitive history/loss metadata on the player card or player deck.
Failure logging is structured so that future squad-mission records can be supported without redesigning the schema.
Refresh/retry behavior cannot produce duplicate rewards or duplicate permanent card mutation.
Design constraints carried across the Missions series
Missions are modeled as round trips starting and ending at the Workshop.
Mission worlds should be generated per-user per-day for consistency, resumability, and cost control.
Generated media should be aggressively cached:
backdrop by user/day world seed
sprite by card + prompt version
Trust-sensitive outcomes should remain server-validated at checkpoints.
Only successful returns mutate the player card.
Failed runs may be recorded as history but should not incur gameplay penalties.
Issue 4
Title
Missions completion: successful-return debrief, Firestore card mutation, and failed-run record logging
Body
Summary
Complete the Missions loop by adding:
successful-return aggregation
Firestore card mutation on successful return only
debrief UI
active-run cleanup/archive
failed-run history logging without gameplay penalties
Why
The mode’s central rule is: Only successful returns count.
This issue ensures that rewards and persistent mutation are only committed once the player returns to the Workshop, while failed runs remain non-punitive and are only recorded as history.
Scope
Aggregate POI and encounter outcomes
Apply successful-return-only mutation to the selected player card
Prevent duplicate completion writes
Add debrief summary UI
Clear/archive active run
Add failed-run baseball-card-style record logging on card and/or deck
Keep failure logging compatible with future squad mission support
Acceptance Criteria
Returning successfully to the Workshop aggregates the run’s POI and encounter outcomes exactly once.
Successful completion mutates the selected player card in Firestore exactly once, even if the client refreshes or retries during completion.
Successful completion can apply rewards and persistent stat/result changes only after the return to the Workshop is validated.
A readable debrief screen is shown after successful completion summarizing route, encounters, mission result, and final gains/losses.
The active run record is cleared or archived appropriately after successful completion.
Failed runs do not grant rewards.
Failed runs do not apply gameplay penalties to the player card.
Failed runs may record non-punitive history/loss metadata on the player card or player deck.
Failure logging is structured so that future squad-mission records can be supported without redesigning the schema.
Refresh/retry behavior cannot produce duplicate rewards or duplicate permanent card mutation.
Design constraints carried across the Missions series
Missions are modeled as round trips starting and ending at the Workshop.
Mission worlds should be generated per-user per-day for consistency, resumability, and cost control.
Generated media should be aggressively cached:
backdrop by user/day world seed
sprite by card + prompt version
Trust-sensitive outcomes should remain server-validated at checkpoints.
Only successful returns mutate the player card.
Failed runs may be recorded as history but should not incur gameplay penalties.