Repository navigation
feat(qa): replay the Aravath slice across three OS - #280
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
Scripted and goal policies call run_aravath_slice once and must share a trace. The failure artifact and ddmin stay off pull requests. The new gameplay_qa_aravath_slice case joins the existing replay set. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The Windows archive deleted tests/assets while this test still had a wav there. Write the beep in a private temp directory instead. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
3e80553 to
e564037
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5640375c3
ℹ️ 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 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 address that feedback".
| fn state_bytes(slice: &AravathSlice) -> Vec<u8> { | ||
| let mut out = Vec::with_capacity(8 * 3 + 1); | ||
| push_i64(&mut out, slice.sword_hp); | ||
| push_i64(&mut out, slice.weave_hp); | ||
| out.push(u8::from(slice.cover_intact)); | ||
| push_i64(&mut out, slice.cover_damage); |
There was a problem hiding this comment.
Hash the canonical raw gameplay state
When combat changes only fractional Q32.32 bits, or destruction diverges in fields other than this bond's rounded damage/intact flag, this encoding remains identical because it hashes only four lossy summary values. The required three-OS case can therefore pass despite a real gameplay-state divergence; include raw combat values and DestructionWorld::state_hash() (or an equivalent canonical full-state digest) in the trace.
Useful? React with 👍 / 👎.
| let RunOutcome::Pass(first) = first else { | ||
| panic!("scripted and goal traces diverged or Reach failed"); | ||
| }; |
There was a problem hiding this comment.
Persist the artifact before failing the replay test
When the required CI scenario returns RunOutcome::Fail because the goal trace or Reach check regresses, this arm discards the constructed artifact and immediately panics. Neither this test nor the workflow calls write_failure_artifact, so the advertised replayable diagnostic is unavailable precisely when the gate fails; write it under the target directory before aborting and arrange for the workflow to retain it on failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open findings
This crate mostly pins dependencies via the workspace, butronis introduced with an inline… · NewReach.by_tickis parsed and validated (must be >= 1) but is never used when evaluating the… · New The replay-hash JSON is currently constructed via string formatting. Even if today’s inputs are… · New The ddmin predicate callsfailure_kind, which (in this implementation) re-generates goal edges… · New Tick numbering is inconsistent with the scenario schema: the file format usesReach.by_tickwith… · New
What changed in this PR
Implements “Scenario 1” of gameplay QA for the Aravath one-tick slice and wires it into cross-OS determinism replay comparison.
Changes:
- Added a new
astraweave-weavinggameplay QA module that loads a bundled RON scenario, verifies scripted-vs-goal trace equality, emits a deterministic SHA-256 case, and can ddmin failures off-PR. - Extended the determinism replay workflow (and CI docs) to require and merge the new
gameplay_qa_aravath_slicereplay case across Ubuntu/Windows/macOS. - Adjusted an audio stress test to generate its beep in a private temp directory to avoid cross-test races.
| File | Description |
|---|---|
| scripts/ci/test_workflow_policy.py | Updates deferred PR filter expectations to include the new replay case name. |
| docs/current/CI_ARCHITECTURE.md | Documents the expanded determinism required-case set and updated replay behavior. |
| docs/current/AUTONOMOUS_GAMEPLAY_QA.md | Updates the QA design doc to reflect Scenario 1 implementation and required replay cases. |
| docs/architecture/weaving.md | Bumps doc version and documents new gameplay QA components and invariants. |
| astraweave-weaving/src/lib.rs | Exposes the new gameplay_qa module and re-exports key APIs/constants. |
| astraweave-weaving/src/gameplay_qa.rs | Adds scenario parsing/execution, hashing, artifact writing, and ddmin minimization logic with tests. |
| astraweave-weaving/src/aravath.rs | Factors out ARAVATH_SLICE_SEED constant and uses it consistently. |
| astraweave-weaving/scenarios/aravath_slice_sword.ron | Adds the shipped Scenario 1 RON file for the slice replay. |
| astraweave-weaving/examples/aravath_slice.rs | Updates the example to run the bundled scenario and print the replay case digest. |
| astraweave-weaving/Cargo.toml | Adds ron, serde_json, and sha2 dependencies needed by gameplay QA. |
| astraweave-audio/tests/advanced_edge_cases.rs | Writes rapid-volume beep into a temp dir instead of shared tests/assets. |
| .github/workflows/determinism-replay.yml | Runs the new gameplay QA test and merges its replay-hash JSON into the required set. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [dependencies] | ||
| # Core dependencies | ||
| anyhow = { workspace = true } | ||
| ron = "0.8" |
| pub struct Reach { | ||
| pub by_tick: u64, | ||
| pub sword_hp: i64, | ||
| pub weave_hp: i64, | ||
| pub cover_intact: bool, | ||
| pub min_cover_damage: i64, | ||
| } |
| pub fn write_replay_case(trace_sha256: &str) -> Result<PathBuf> { | ||
| let path = replay_case_path(); | ||
| if let Some(parent) = path.parent() { | ||
| std::fs::create_dir_all(parent).with_context(|| format!("create {}", parent.display()))?; | ||
| } | ||
| let body = format!("[\n {{ \"case\": \"{CASE_NAME}\", \"sha256\": \"{trace_sha256}\" }}\n]\n"); | ||
| std::fs::write(&path, body).with_context(|| format!("write {}", path.display()))?; | ||
| Ok(path) | ||
| } |
| let reduced = minimize(inputs, |candidate| { | ||
| failure_kind(scenario, candidate) == Some(kind) | ||
| }); |
| inputs: records(&chosen), | ||
| hashes: vec![HashRow { | ||
| tick: 0, | ||
| sha256: report.state_sha256, | ||
| }], | ||
| failure: FailureBody { | ||
| kind: kind.as_str().to_string(), | ||
| tick: 0, | ||
| detail, | ||
| }, |

Description
Scenario 1 of the approved gameplay QA plan, rebased onto current
mainafter #243, #277, and #290. Still a draft. Not for merge.run_aravath_slicestays one call. The scripted policy and the goal policyslice_sword_then_weavefinish on:ef7e38b580f2d157041d2d58bc0cac41dcf1442ac0ff6064d6ba52039adfc089Required replay cases, all of them:
planner_pureperception_worldgameplay_rngfixed64combat_resolvedestructiongameplay_qa_aravath_sliceThe audio rapid-volume test still writes its beep in a private temp directory (the #289 fix). It does not use the shared
tests/assetstree.ddmin runs only when
QA_MINIMIZE=1and the GitHub event is notpull_request.Type of change
Security Considerations
astraweave-weavingdepends onron0.8,serde_json, andsha2, already in the lockfile. The audio test uses the existingtempfiledev-dependency.Checklist