Skip to content

feat(agent-fighter): seed local policy decisions - #25

Merged
SYMBaiEX merged 1 commit into
mainfrom
feat/cycle4-seeded-policy
Oct 4, 2026
Merged

SYMBaiEX merged 1 commit into
mainfrom
feat/cycle4-seeded-policy

Conversation

@SYMBaiEX

@SYMBaiEX SYMBaiEX commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Extract Agent Fighter local policy decisions into a pure module and add isolated, per-agent mulberry32-v1 streams for seeded local choices without modifying global Math.random.
  • Add --seed <uint32> for runner-spawned servers and expose seed/RNG scope metadata in server telemetry and headless JSON output. Reject --seed with --url; external server seeds are not reported by the runner.
  • Add seeded-policy tests to the root test workflow and document the observation, provider, timing, runtime, and version limits.

The seed controls only randomized local-policy branches. OpenAI Responses API outcomes and whole-match behavior are not deterministic claims in this change.

Validation

  • bun test examples/agent-fighter/__tests__/seeded-policy.test.ts — 4 passed.
  • bun run release:check — passed; 166 tests, 0 failures, typecheck/build/audit/package checks passed, no audit vulnerabilities.
  • bun --cwd examples/agent-fighter headless --seed 42 --duration-ms 1000 --poll-ms 100 --min-decisions 0 --min-decisions-per-player 0 --port 53143 --output /tmp/opencontroller-agent-fighter-seed-check.json — passed; summary and server telemetry both reported seed 42 and mulberry32-v1; 16 decisions used the local policy. The smoke used the existing system Chromium because the Playwright CDN download was blocked in this environment.
  • git diff --check — passed.

Closes #22

Summary by CodeRabbit

  • New Features
    • Added optional seed support for repeatable local fighter-policy decisions in headless matches and runner-started servers.
    • Headless summaries now report the seed and random-source details when available. External-server runs identify the random source as unknown when the runner cannot verify it.
    • The --seed option cannot be used with --url.
  • Documentation
    • Added guidance on seed setup and clarified that seeded decisions do not guarantee identical full-match results.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 22:44

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5b8b295-c649-41b1-b5d5-40c872debe33
📥 Commits

Reviewing files that changed from the base of the PR and between 4cef8d7 and 7efced7.

📒 Files selected for processing (9)
  • docs/agent-fighter.md
  • examples/agent-fighter/README.md
  • examples/agent-fighter/__tests__/seeded-policy.test.ts
  • examples/agent-fighter/headless-options.ts
  • examples/agent-fighter/headless.ts
  • examples/agent-fighter/local-policy.ts
  • examples/agent-fighter/server.ts
  • examples/agent-fighter/tsconfig.json
  • package.json
 _______________________________________________________________________________
< Fancy algorithms are slow when n is small, and n is usually small. - Rob Pike >
 -------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@SYMBaiEX
SYMBaiEX merged commit 8eb744c into main Oct 4, 2026
1 of 2 checks passed
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.

Seed Agent Fighter local decisions for repeatable evaluation

3 participants