feat: add prototype Gate outcome report#167
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c90b22bf20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| } | ||
| else | ||
| { | ||
| _latestGameplayLedger = response; |
There was a problem hiding this comment.
Clear cached ledger on refresh failure
When ListGameplayLedger fails, _latestGameplayLedger is left untouched, so the Outcome panel can keep rendering stale rows while the HUD simultaneously reports Ledger unavailable. This happens after any transient auth/network error following a prior successful fetch, and it can mislead players/debuggers into treating old ledger data as current server-owned results. Reset the cached ledger (for example to null) in the error branch so the outcome report reflects the failure state instead of old entries.
Useful? React with 👍 / 👎.
| _gateOutcomeMode = string.IsNullOrWhiteSpace(mode) ? "ledger" : mode; | ||
| _gateOutcomeOpen = true; |
There was a problem hiding this comment.
Add a path back to ledger outcome mode
After a user clicks Success or Partial, SetGateOutcomeMode permanently switches _gateOutcomeMode away from ledger for the rest of the session, and there is no UI action that sets it back. Because BuildGateOutcomeReportText prioritizes that mode, reopening the panel will continue to show prototype previews and stop showing live ledger-backed outcomes even when server rows are available. Add a reset path (for example when reopening the panel or via a dedicated Ledger button) so users can return to server-backed output.
Useful? React with 👍 / 👎.
| var count = Mathf.Min(ledger.entries.Length, 5); | ||
| for (var i = 0; i < count; i++) |
There was a problem hiding this comment.
Filter outcome report rows to the active Gate run
The report is always titled Ash Underpass Signal, but it aggregates the first 5 ledger entries without any mission/quest filter, so unrelated combat, yard, or other quest rows can be presented as this Gate outcome. This will produce incorrect mission summaries whenever recent ledger history contains mixed activities. Restrict the aggregation to entries tied to the selected Gate mission (or show an explicit "unscoped recent ledger" state) before labeling it as a specific Gate outcome.
Useful? React with 👍 / 👎.
| if (string.Equals(entry.category, "body_time", System.StringComparison.OrdinalIgnoreCase)) | ||
| { | ||
| timeDelta += entry.body_time_delta_seconds; | ||
| } |
There was a problem hiding this comment.
Include reward deltas in TIME net calculation
The displayed TIME result ... net excludes reward category deltas because timeDelta is only updated for body_time entries, while rewards are counted separately in rewardSeconds. If a run has both a TIME cost and a TIME reward, the UI can report a net that is too negative (or otherwise wrong), which undermines the outcome report’s accuracy. Accumulate reward body_time_delta_seconds into the net calculation as well.
Useful? React with 👍 / 👎.
Summary
Closes #144.
Verification
git diff --check origin/dev..HEADnpx markdownlint-cli2@0.15.0 CHANGELOG.md ROADMAP.mdrg -n "—|–" CHANGELOG.md ROADMAP.md Unity/Assets/_SecondSpawn/Scripts/UI/HUDController.csreturned no matchesNotes
Unity MCP compile and Play Mode smoke should run after merge into root
dev, because the active Unity Editor is attached to the root project rather than the feature worktree.