Skip to content

docs: record the weave origin island (#388, closes #295) - #398

Merged
lazyxeon merged 7 commits into
mainfrom
cursor/doc-weave-origin-23f7
Oct 21, 2026
Merged

lazyxeon merged 7 commits into
mainfrom
cursor/doc-weave-origin-23f7

Conversation

@lazyxeon

@lazyxeon lazyxeon commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Description

Rebased onto main at 49d289eb. Head 37b6da35.

Status pages record #388, #394, #396, #397, #389, and #393.

A failed run_one drops that call's casts. An earlier script for the same agent stays applied, and a later success still lands. failed_script_keeps_an_earlier_ok_for_the_same_agent queues scripts/a.rhai, a failing scripts/b.rhai, then scripts/c.rhai, and compares two runs. That test is in 79122e78. docs/architecture/scripting.md is 1.7 and last_verified_commit is 79122e78. On 49d289eb the trace is 1.5. Revision 1.6 is withdrawn wording. #217 landed when the required replay set was fifteen. The required set is now nineteen.

#260 is closed and GitHub linked it to #397. #269 is closed. The fix is #389. GitHub cross-referenced that pull. The close was not attributed. #403 and #400 stay open.

Type of change

  • Documentation update

Security Considerations

No new dependencies, auth, sensitive data, or network changes. The weave-host test is in astraweave-scripting. deny.toml and .cargo/audit.toml are unchanged.

Checklist

  • cargo test -p astraweave-scripting --lib failed_script_keeps_an_earlier_ok_for_the_same_agent passed
  • cargo test -p aw_doc_lint — 21 passed
  • aw_doc_lint --mode warn — 634 files, 0 un-allowlisted
  • aw_trace_sync --check — in sync

CI on 37b6da35 is not settled yet.

Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: lazyxeon/AstraWeave/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91c2ff1d-ef3d-4215-8e1d-521866364089
  • Autofix · 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.

@lazyxeon
lazyxeon marked this pull request as ready for review October 21, 2026 13:09
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T13:09:38.071465Z 78c035f Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

cursoragent and others added 2 commits October 21, 2026 13:12
outside ±2048 cells and does not saturate, and the weaving replay
case still hashes NullField.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
#397 closed #260. The mod host rejects an out-of-island origin before
the cast is stored. #394 keeps the retired title out of player-facing
assets. The 0.323 ms figure is the cloud_shadow pass.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/doc-weave-origin-23f7 branch from 78c035f to 9498f0e Compare October 21, 2026 13:14

@cursor cursor Bot 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.

Docs-only against main at 49d289eb. I checked the weave-origin claims against queue_weave / enqueue, meters_to_cell, compile_legacy, apply_weave_op, push_ice, weaving_case_bytes, and the mod host in sim_mod.rs.

The island gate matches the code. ISLAND_HALF_CELLS is 2048 inclusive. enqueue returns OutsideIsland and does not saturate (origins_outside_the_island_are_rejected_without_saturation keeps the edge origin [2048, 0, -2048] and leaves the count at 1). The script host uses i32::try_from and the same constant before it stores a cast. weaving_case_bytes still runs 300 ticks on NullField with origins [0,0,0], [2,0,0], [0,1,0], and [0,0,1], and NullField::field_digest is 32 zero bytes. A queued origin plus a u8 radius cannot overflow the milli product: (2048 + 255 + 1) * 1000 = 2_304_000. This diff adds no dependency and no unsafe.

#295 is closed by #388 and #260 is closed by #397. The Gate job does run scripts/ci/player_facing_names.sh. The comments below are places where the new text and the code disagree, or where a pin will send the next reader to the wrong line.

assets/cells/*.ron still contain Veilweaver in tags and in one description (100_0_0.ron). Both checkers skip that directory on purpose.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread README.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved

@cursor cursor Bot 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.

Adversarial pass on 9498f0e5 against main at 49d289eb. The diff is documentation only (six files, no sim, render, or dependency change). I checked the claims against the weave queue, the mod host, the replay helper, the Hi-Z record path, the frame-budget gate, and the GitHub issue timeline.

What holds:

  • queue_weave returns OutsideIsland for any axis outside ±2048 and does not saturate. 2048 and -2048 still enqueue. meters_to_cell rejects non-finite metres and m * 1000 below i32::MIN as f32 or at or above i32::MAX as f32 before the cast, then div_euclid (-1.5 is cell -2). The finite f32 before 2^31 is 2147483520.
  • The mod host checks the island before WeaveCast is stored (sim_mod.rs). queue_weave_edges_fail_closed locks the edge, the outside origin, and “valid cast then outside island drops the script” (command list empty). DEFAULT_MAX_WEAVES is 64. run_one returns Err before apply_weave_casts.
  • weaving_case_bytes still runs on NullField. astraweave-core/tests/replay_hash.rs hashes those bytes. This diff does not touch that path. astraweave-weaving is #![forbid(unsafe_code)].
  • draw_into records Hi-Z only when both hiz_depth_load and sample_hiz are set. The default of sample_hiz is false. No draw_into pass samples HizPyramid::view. set_sample_hiz drops the pyramid when the flag changes.
  • gpu_frame_budget calls reject_gated_flags before the scene. Bare --name, --name=true, and --name true bail for the six gated flags. --name=false and --name false do not. The binary never calls the gated setters, so the printed median stays the baseline frame. record_gated_presentation does not call copy_to_history for SSGI, TAA, or upscale, and it does not copy those views onto hdr_tex. open_limited_image, Texture::from_file_with_usage, and the ktx2 fallback in set_smoke_test_texture still std::fs::read the whole file. read_capped_image rejects a regular file above 64 MiB from metadata before the read.
  • #295 closer is #388. #260 closer is #397. #269, #403, #400, #395, #371, and #372 are in the states the pages name. The intro companion line is thread-binder. The debrief .ron files do not use the retired title. The Gate job runs scripts/ci/player_facing_names.sh. Trace-sync on this head is green. The rest of CI was still queued.

The runtime story is right. The audit map is not. The comments below are the mismatches: a security pin that predates the behavior it describes, a closed parser hole still marked off main, line numbers that do not land on the reject, a Hi-Z predicate shortened on three pages, a missing echoes.toml in the name gate, and a scripting-trace SHA that is not on main.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread README.md Resolved
cursoragent and others added 2 commits October 21, 2026 13:26
A dropped wind returns from wind_direction before legacy_geometry_kept.
A failed mod run drops only that agent's casts. SEC-MOD-2 is the
range check already on main. The status pins name which sentences
were checked at 49d289e.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
draw_into records the pyramid only when hiz_depth_load and sample_hiz
are both set. The name gate includes echoes.toml. #269 was
cross-referenced by #389. The close was not attributed. compile_legacy
drop sites are the empty returns, not cell_origin.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>

@cursor cursor Bot 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.

Adversarial pass on d4893f86 against main at 49d289eb. The diff is documentation only (seven files, no sim, render, or dependency change). I checked the weave queue, the mod host, compile_legacy, apply_weave_op, push_ice, the replay helper, the Hi-Z record path, the frame-budget gate, the player-facing scans, and the GitHub close events.

What matches the code:

  • enqueue returns OutsideIsland for any axis outside ±2048 and does not saturate the origin (mod_queue.rs:183-185). queue_weave (:215-225) returns that result. 2048 and -2048 still enqueue. meters_to_cell rejects a non-finite metre, and m * 1000 below i32::MIN as f32 or at or above i32::MAX as f32, before the cast, then div_euclid (-1.5 is cell -2). The finite f32 before 2^31 is 2147483520.
  • compile_legacy drops at :55-57 (a), :84-86 (collapse b), and :97-99 (wind delta). cell_origin is :168-178. wind_delta_fits is :155-166 (1e-22 stays; 1e-23 underflows to 0). A dropped fortify, collapse, lower, or freeze returns at legacy_geometry_kept (astraweave-gameplay/src/weaving.rs:57-58) before the budget match at :60-73. A wind delta that compile_legacy drops returns from wind_direction at :48-52. Kinds 0 and 4 build the director rect with ax as i32 (legacy.rs:70-76), so -1.5 truncates to -1 on that rect while the density write uses the floored cell. push_ice debug_asserts the island (eval.rs:233-238), multiplies unchecked, and stores the sheet at :250-259. The only push_ice call is push_command.
  • parse_template_toml rejects an id outside u16 at mod_queue.rs:231-234 before as u16. The test locks 65536, -1, and 65535. Radius (:276-279) and node a (:286-289) check before the cast. SEC-MOD-2 and SEC-WEAVE-1 match main.
  • The mod host rejects the island at sim_mod.rs:269-274 before the WeaveCast is stored. apply_weave_casts is called from the Ok arm at :383-396. DEFAULT_MAX_WEAVES is 64. weaving_case_bytes still runs on NullField. This diff does not change a replay input.
  • record_hiz returns unless hiz_depth_load and sample_hiz are both set. sample_hiz defaults to false. set_sample_hiz drops the pyramid when the flag changes. No draw_into pass samples HizPyramid::view. #295's closer is #388. #260's closer is #397. #269's closer is null, and #389 cross-referenced it. #403, #400, #395, #371, and #372 are open.
  • The Gate script and the dialogue test both name echoes.toml. The test's npc and cinematics scan is one read_dir level with no extension filter. assets/cells/100_0_0.ron still says Veilweaver in the description and in the veilweaver tag. gpu_frame_budget calls reject_gated_flags before the scene. --name=false and --name false stay off. open_limited_image, Texture::from_file_with_usage, and the ktx2 fallback in set_smoke_test_texture still call uncapped std::fs::read. read_capped_image rejects a regular file above 64 MiB from its metadata. record_gated_presentation does not call copy_to_history for SSGI, TAA, or upscale, and it does not copy those views onto hdr_tex.

Two claims on this head are still wrong. A failed run_one drops that call's buffer, and an earlier script for the same agent stays applied. The scripting trace is stamped verified at 49d289eb while section 10 still says fifteen cross-OS cases; the workflow list has nineteen.

ENGINE_STATUS.md says "The default is off" after naming both Hi-Z flags. sample_hiz defaults to false. hiz_depth_load is depth_texture_load_supported at renderer init. Recording stays off because record_hiz requires both.

Earlier comments on the pin, SEC-MOD-2, the line map, the section stamp, the echoes scan, the #269 closer, and the two Hi-Z flags are addressed on this head.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/architecture/scripting.md Resolved
Comment thread docs/current/SECURITY_AUDIT.md Resolved
Comment thread docs/architecture/scripting.md Resolved
The tick walks scripts, then agents. An earlier Ok for the same agent
stays applied. The new test locks that. The scripting trace now says
nineteen replay cases, and sample_hiz is the flag that defaults off.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>

@cursor cursor Bot 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.

The per-call fail-closed claim now matches the host, and the new test passes. The trace stamp does not.

I checked the citations against the tree at 10ff3630. queue_weave returns OutsideIsland from enqueue (mod_queue.rs:183-185) for any axis outside the inclusive ±2048 cube and does not saturate. The script binding rejects that origin at sim_mod.rs:269-274 before the cast is written into WeaveBuf. run_one returns on the execute_deterministic error before it reads the scope buffer, and mod_script_system calls apply_weave_casts only on Ok (sim_mod.rs:383-396). Sources run in ModPrograms order, then entities sorted by id. An earlier Ok for the same agent stays. A later Err does not roll it back. queue_weave checks the island again. meters_to_cell, compile_legacy (legacy.rs:55-57, :84-86, :97-99), wind_delta_fits, the budget returns in apply_weave_op (weaving.rs:48-52 and :57-58 before :60-73), and push_ice (eval.rs:233-238, sheet :250-259, nav :260-265) match the sentences. parse_template_toml rejects an id outside u16 before the cast (mod_queue.rs:231-234); radius and node a do the same. Hi-Z records only when hiz_depth_load and sample_hiz are both set; sample_hiz defaults false. open_limited_image (image_limits.rs:35), Texture::from_file_with_usage, and the ktx2 fallback in set_smoke_test_texture still use uncapped std::fs::read. #295 closer is #388, #260 closer is #397, #269 closer is null with a cross-reference from #389. #403, #400, #395, #371, and #372 are open. assets/cells/100_0_0.ron still has Veilweaver in the description and the tag.

Determinism: this head does not change the sim path. weaving_case_bytes still hashes NullField. The nineteen-name list in determinism-replay.yml is unchanged. Replay hash on this head already succeeded for ubuntu-latest and macos-latest. No new unsafe, no wall clock, and no unseeded RNG.

cargo test -p astraweave-scripting --lib failed_script_keeps_an_earlier_ok_for_the_same_agent passed (1 passed).

The merge blocker is the verification stamp. docs/architecture/scripting.md is version 1.7 and names failed_script_keeps_an_earlier_ok_for_the_same_agent, but last_verified_commit is 49d289eb. That commit has doc version 1.5 and does not contain the test. The #397 bullet in ENGINE_STATUS.md repeats “the trace is 1.7” under a check pinned to 49d289eb. Revision 1.6 still records the agent-wide drop as verified at that commit. PROJECT_STATUS.md line 10, and the same sentence in ENGINE_STATUS.md line 71, still say the fifteen replay cases are unchanged.

Prior threads on the agent-wide rollback wording, the security-audit banner, and the section 10 count of fifteen are addressed on this head.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/architecture/scripting.md Resolved
Comment thread docs/architecture/scripting.md Resolved
Comment thread docs/current/ENGINE_STATUS.md Resolved
Comment thread docs/current/PROJECT_STATUS.md Resolved
Comment thread astraweave-scripting/src/sim_mod.rs Resolved
cursoragent and others added 2 commits October 21, 2026 14:25
The test queues a cast, a failing origin, then another cast, and
compares two runs. #217 landed when the required replay set was
fifteen. The required set is now nineteen. Revision 1.6 is withdrawn.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
last_verified_commit is 79122e7. That commit contains the three-source
weave test and invariant 9. 49d289e is trace 1.5 and does not.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>

@cursor cursor Bot 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.

Adversarial pass on 37b6da35 against main at 49d289eb. The production sim path is unchanged. The only code edit is failed_script_keeps_an_earlier_ok_for_the_same_agent under #[cfg(test)]. No new dependency and no unsafe.

What I re-checked on this head:

  • enqueue returns OutsideIsland at mod_queue.rs:183-185 for any axis outside the inclusive ±2048 cube and does not saturate. queue_weave is the delegate at :215-225. meters_to_cell rejects a non-finite metre, and m * 1000 below i32::MIN as f32 or at or above i32::MAX as f32, before the cast, then div_euclid (-1.5 is cell -2). The finite f32 before 2^31 is 2147483520.
  • compile_legacy drops at :55-57, :84-86, and :97-99. wind_delta_fits is :155-166 (1e-22 stays; 1e-23 underflows to +0). A dropped fortify, collapse, lower, or freeze returns at legacy_geometry_kept (weaving.rs:57-58) before the budget match at :60-73. A dropped wind delta returns from wind_direction at :48-52. Kinds 0 and 4 still truncate the director rect (legacy.rs:70-76); the density write uses the floored cell. push_ice debug_asserts the island and still stores the sheet. parse_template_toml range-checks the id at mod_queue.rs:231-234 before as u16.
  • The mod host rejects the island at sim_mod.rs:269-274 before the cast is stored. run_one returns on the execute_deterministic error before it reads the scope buffer, so that call's WeaveBuf is dropped. apply_weave_casts runs only on Ok (:383-396). The loop keeps walking sources, then entities. DEFAULT_MAX_WEAVES is 64. weaving_case_bytes still hashes NullField. This diff does not change a replay input. The required list in determinism-replay.yml is the nineteen names.
  • Hi-Z records only when hiz_depth_load and sample_hiz are both set. sample_hiz defaults to false. #295's closer is #388. #260's closer is #397. #269's closer is null, with a cross-reference from #389. #403, #400, #395, #371, and #372 are open. assets/cells/100_0_0.ron still says Veilweaver in the description and the tag. open_limited_image, Texture::from_file_with_usage, and the ktx2 fallback still use uncapped std::fs::read.

The five open threads on 10ff3630 are fixed on this head.

  • last_verified_commit is 79122e78. git show 79122e78:docs/architecture/scripting.md is version 1.7 and names the three-source test. 49d289eb is version 1.5 (last_verified_commit: a9837f2f), section 10 still says fifteen, and git grep finds no such test. 37b6da35 only moves the stamp.
  • Revision 1.6 is marked withdrawn. It no longer records the agent-wide drop as verified.
  • The #397 bullet says the host loop is on 49d289eb, where the trace is 1.5, and that this pull's trace is 1.7 at 79122e78. The banner calls out that clause.
  • PROJECT_STATUS.md and the CI burndown bullet say #217 landed when the required set was fifteen, and that the required set is now the nineteen cases.
  • The test queues scripts/a.rhai at origin 0, a failing scripts/b.rhai at 3000, then scripts/c.rhai at origin 2. It compares two fresh apps and expects [(1, [0, 0, 0]), (1, [2, 0, 0])] plus an error that contains both scripts/b.rhai: and outside the island. A source reversal, a stop on the first Err, or a rollback of the earlier Ok fails that assertion. Entity ids come from a per-world allocator, so the two error strings match.

I compiled astraweave-scripting and ran sim_mod::tests::failed_script_keeps_an_earlier_ok_for_the_same_agent. Result: 1 passed. The harness binary contains scripts/c.rhai.

One residual, not a merge blocker. The module comment says scripts run in mod-id then path order. refill_sources copies ModPrograms in place. The new paths are already a, b, c, so a later sort-by-path would still pass. Reversal and an early return would not. The test also does not assert errors.len()==1; check_case uses the same any needle.

Prior threads on the stamp, revision 1.6, the trace-version pin, the fifteen-case sentence, and the two-script test are addressed.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

@lazyxeon
lazyxeon merged commit 417f267 into main Oct 21, 2026
36 checks passed
@lazyxeon
lazyxeon deleted the cursor/doc-weave-origin-23f7 branch October 21, 2026 15:53
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