Skip to content

feat: add prototype Gate outcome report#167

Merged
JOY (JOY) merged 1 commit into
devfrom
codex/gate-outcome-ui
May 23, 2026
Merged

feat: add prototype Gate outcome report#167
JOY (JOY) merged 1 commit into
devfrom
codex/gate-outcome-ui

Conversation

@JOY
Copy link
Copy Markdown
Contributor

Summary

  • Add a HUD Outcome button next to the quest tracker actions.
  • Add a debug-labeled Gate outcome report panel for Ash Underpass Signal.
  • Render recent server-owned gameplay ledger rows when available, with explicit success and partial prototype previews for SECOND, TIME, injury, memory, relationship, and agent recommendation copy.
  • Keep the UI read-only: it does not start Gate runs, grant rewards, spend TIME, or mutate quest or mission state client-side.

Closes #144.

Verification

  • git diff --check origin/dev..HEAD
  • npx markdownlint-cli2@0.15.0 CHANGELOG.md ROADMAP.md
  • rg -n "—|–" CHANGELOG.md ROADMAP.md Unity/Assets/_SecondSpawn/Scripts/UI/HUDController.cs returned no matches
  • Local code-review fallback: approved. This is a Unity HUD/docs-only change, contains no provider API call or key path, does not grant rewards/TIME/quest state, and labels prototype previews as non-authoritative.

Notes

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.

@JOY JOY (JOY) merged commit 3799697 into dev May 23, 2026
1 check passed
@JOY JOY (JOY) deleted the codex/gate-outcome-ui branch May 23, 2026 04:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +1001 to +1002
_gateOutcomeMode = string.IsNullOrWhiteSpace(mode) ? "ledger" : mode;
_gateOutcomeOpen = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +1089 to +1090
var count = Mathf.Min(ledger.entries.Length, 5);
for (var i = 0; i < count; i++)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +1104 to +1107
if (string.Equals(entry.category, "body_time", System.StringComparison.OrdinalIgnoreCase))
{
timeDelta += entry.body_time_delta_seconds;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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