Skip to content

fix: remove dead throttled faction readback fallback in attack_system (#249)#250

Merged
abix- merged 1 commit into
devfrom
issue-249
Mar 21, 2026
Merged

fix: remove dead throttled faction readback fallback in attack_system (#249)#250
abix- merged 1 commit into
devfrom
issue-249

Conversation

@abix-

@abix- abix- commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Summary

Round 1-4 authority.md compliance audit for issue #249.

Round 1 (Inventory): Cataloged all GpuReadState read sites, GPU write sites, buffer sizing constants, combat target validation paths, and EntityMap count/iteration usage.

Round 2 (Violation Detection): Found one code-quality issue: dead code fallback at combat.rs:485 referenced gpu_state.factions (throttled readback, 60-frame staleness) in an unreachable unwrap_or_else branch. The target_npc is always Some at that point (None/dead filtered above), so the fallback never executes — but having it reference throttled readback was misleading and could become a real violation if the flow changed.

All other rules pass: no feedback loops, no throttled readback as hard gate, all buffer sizing uses MAX_ENTITIES, EntityMap methods used for all type-specific counts.

Round 3 (Fix): Removed the dead fallback. Replaced with target_npc.map(|n| n.faction).unwrap_or(-1). Added regression test attack_system_uses_ecs_faction_not_gpu_readback that sets gpu_state.factions to stale same-faction data and verifies combat still fires (proving ECS faction from EntityMap is used, not GPU readback).

Round 4 (Compliance table): Posted as issue comment.

@abix- abix- added the claude-5 Claude agent 5 is the current owner label Mar 21, 2026
@abix-

abix- commented Mar 21, 2026

Copy link
Copy Markdown
Owner Author

/review findings

Check Result
Linked issue pass -- #249
Issue acceptance checklist pass -- 5/5 checked in issue comment
PR checklist coverage pass -- summary covers all 4 rounds, linked issue, tests
Associated docs pass -- authority.md unchanged (no new patterns discovered)
authority.md pass -- fix removes throttled readback fallback, enforces ECS authority
k8s.md pass -- no entity architecture changes
performance.md not required
Build pass
Automated tests pass -- 381/381
Regression tests pass -- 1 new: attack_system_uses_ecs_faction_not_gpu_readback
Benchmarks not required
BRP launch not run
Issue-specific verification pass -- compliance table posted on issue, all systems pass/fixed

Verdict: ready to merge

Findings

  • No findings. Clean audit with one dead-code fix and proper regression test.

Acceptance coverage

  • Round 1 inventory -> pass (issue comment with file:line refs)
  • Round 2 violation detection -> pass (1 violation found, correctly identified)
  • Round 3 fix -> pass (dead fallback removed, regression test added)
  • Round 4 compliance table -> pass (15 systems audited, all pass or fixed)
  • Compliance verified -> pass (all 3 docs checked)

Docs and policy coverage

  • authority.md -> compliant (fix enforces Hard Rule Slice: Rest + Heal phase migration #1: never use throttled readback as validity gate)
  • k8s.md -> compliant (no entity changes)
  • performance.md -> not required

Regression coverage

  • attack_system_uses_ecs_faction_not_gpu_readback: sets stale same-faction GPU data, verifies combat still fires using ECS faction from EntityMap

@abix- abix- merged commit d9c5735 into dev Mar 21, 2026
3 of 4 checks passed
@abix- abix- deleted the issue-249 branch March 21, 2026 21:34
@abix- abix- removed the claude-5 Claude agent 5 is the current owner label Mar 21, 2026
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