Skip to content

Add Nexus Chaos sandbox game#2

Open
nadvolod wants to merge 1 commit intotemporalio:initfrom
nadvolod:nadvolod/nexus-chaos-game
Open

Add Nexus Chaos sandbox game#2
nadvolod wants to merge 1 commit intotemporalio:initfrom
nadvolod:nadvolod/nexus-chaos-game

Conversation

@nadvolod
Copy link
Copy Markdown

Summary

Adds game/index.html — a single-file interactive HTML sandbox that mirrors PaymentProcessingWorkflow over the compliance-endpoint Nexus call. Stop the Payments / Nexus / Compliance services and watch in-flight workflows pend (not fail) until the service returns. No deps; just open the file in a browser.

Stacks onto #1.

Test plan

  • Open game/index.html in a browser
  • Click "Stop" on Compliance Worker — workflows visibly block at step 2
  • Click "Start" — they resume; nothing is lost

🤖 Generated with Claude Code

Single-file interactive HTML sandbox at game/index.html that mirrors
PaymentProcessingWorkflow over the compliance-endpoint Nexus call.
Stop the Payments / Nexus / Compliance services and watch in-flight
workflows pend (not fail) until the service returns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 29, 2026 18:19
@nadvolod nadvolod requested a review from MasonEgger as a code owner April 29, 2026 18:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a standalone, dependency-free browser “sandbox game” to visually simulate how PaymentProcessingWorkflow behaves when Payments / Nexus / Compliance are stopped (with step 2 pended rather than failed).

Changes:

  • Introduces game/index.html as a single-file interactive UI showing service topology, in-flight workflows, and an event history.
  • Implements a simple workflow state machine (validate → Nexus compliance → execute) with service stop/start controls.
  • Adds auto-spawn/reset controls and basic completion/decline metrics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread game/index.html
Comment on lines +279 to +281
row.innerHTML = `<span class="t">${fmtTs()}</span>` +
(id ? `<span class="id">${id}</span>` : "") +
`<span>${msg}</span>`;
Comment thread game/index.html
Comment on lines +324 to +340
stepProgress: 0,
stepDuration: 0,
stepStartedAt: 0,
stepStates: ["pending", "pending", "pending"],
el: null,
};
workflows.set(id, wf);
renderWorkflow(wf);
logEvent("info", id, `WorkflowExecutionStarted (PaymentRequest amount=${fmtMoney(amount)})`);
beginStep(wf, 1);
}

function beginStep(wf, step) {
wf.step = step;
wf.stepProgress = 0;
wf.stepStartedAt = Date.now();
if (step === 1) {
Comment thread game/index.html
let lastTs = Date.now();
let auto = true;
let autoTimer = null;
const counters = { completed: 0, declined: 0, lost: 0 };
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.

2 participants