Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c": {
|
||||
"working_sha256": "34f7eaa01dc68e97aae8c1177b7f8fd6c15d5a41c6dc86de377f00b3613a8e77",
|
||||
"index_sha256": "34f7eaa01dc68e97aae8c1177b7f8fd6c15d5a41c6dc86de377f00b3613a8e77"
|
||||
},
|
||||
"tests/test_mortar_transactions.py": {
|
||||
"working_sha256": "b169cee3ccde42a24b6a0aa0ac2c3ff879bd1478bed1979dbea7b82c8006ee43",
|
||||
"index_sha256": "b169cee3ccde42a24b6a0aa0ac2c3ff879bd1478bed1979dbea7b82c8006ee43"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"finding": "A deleted exact shell leaves ERR_MortarSupplyTransfer.Unresolved true indefinitely when accepted native move never supplies a failure callback. Deadline invalidates authority but never resolves uncertainty. Battery.SupplyPending remains true, so MortarSystem skips new orders even with other physical shells.",
|
||||
"source_boundary": [
|
||||
"ERR_MortarSupplyTransfer.Poll/Unresolved",
|
||||
"ERR_MortarBattery.SupplyPending and SupplyState",
|
||||
"ERR_MortarSystem.Assign: battery.SupplyPending gate"
|
||||
],
|
||||
"fix": "Mirror existing ERR_MortarCourierTransfer.Poll null-shell rule after server guard: mark exact deletion resolved and invalidated, clear ready, return FAILED. No damage/capture/unknown-storage inference, no refund/retry/spawn/new transfer.",
|
||||
"red": "Updated actual Poll+Unresolved+Battery.SupplyPending program compiles then assertion-fails on exact weak identity deletion; red.log.",
|
||||
"green": "All existing test_mortar_transactions.py programs pass plus zero/success/failure callbacks, already-cancelled branch, late acknowledgement, timeout, and nonnull detached ambiguity. green.log.",
|
||||
"limits": "Entity deletion modeled by native weak-reference invalidation; no engine run. Other mortar cancellation guard pattern was not reproduced because success is authorized by later Poll. Existing test had asserted null remains pending; changed explicitly to permanent loss, matching existing courier behavior.",
|
||||
"preservation": "One source and one existing test proposal; baseline working/index hashes retained. Original and successor untouched.",
|
||||
"apply_check_exit": 0,
|
||||
"test_command": "PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/home/jakub/devel/escapistsrereintroduced/tests ERR_MORTAR_SUPPLY_TRANSFER_SOURCE=/tmp/erri-mortar-review-1804/addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c python3 /tmp/erri-mortar-review-1804/tests/test_mortar_transactions.py"
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
--- a/addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c
|
||||
+++ b/addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c
|
||||
@@ -81,6 +81,13 @@
|
||||
ERR_MortarSupplyState Poll(float now)
|
||||
{
|
||||
if (!Replication.IsServer()) return ERR_MortarSupplyState.FAILED;
|
||||
+ // The exact deleted shell cannot complete later. Match courier settlement:
|
||||
+ // release only uncertainty, never authorize a shot or retry this lost item.
|
||||
+ if (!m_Shell)
|
||||
+ {
|
||||
+ m_Resolved = true; m_Invalidated = true; m_Ready = false;
|
||||
+ return ERR_MortarSupplyState.FAILED;
|
||||
+ }
|
||||
bool valid = Valid(now);
|
||||
bool sourceContains = Contains(m_Source);
|
||||
bool destinationContains = Contains(m_Destination);
|
||||
--- a/tests/test_mortar_transactions.py
|
||||
+++ b/tests/test_mortar_transactions.py
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Actual Enforce policies and transaction observation body under narrow API fakes."""
|
||||
from policy_harness import ROOT, body, run
|
||||
+from pathlib import Path
|
||||
+import os
|
||||
r=ROOT/'addons/core/Scripts/Game/ERR/10_AI'
|
||||
-readiness=r/'ERR_MortarReadiness.c'; transfer=r/'ERR_MortarSupplyTransfer.c'; battery=r/'ERR_MortarBattery.c'
|
||||
+readiness=r/'ERR_MortarReadiness.c'; transfer=Path(os.environ.get('ERR_MORTAR_SUPPLY_TRANSFER_SOURCE',r/'ERR_MortarSupplyTransfer.c')); battery=r/'ERR_MortarBattery.c'
|
||||
policy='\n'.join([body(readiness,'static ERR_MortarSupplyState Population('),body(readiness,'static bool AllocationValid('),body(readiness,'static int CycleGate('),body(transfer,'static bool Authority('),body(transfer,'static bool Proven(')])
|
||||
policy=policy.replace('ERR_MortarSupplyState.','ERR_MortarSupplyState::')
|
||||
run('''#include <cassert>
|
||||
@@ -44,6 +46,7 @@
|
||||
poll=poll.replace('ERR_MortarSupplyState.','ERR_MortarSupplyState::').replace('Replication.IsServer()','Replication::IsServer()').replace('InventoryItemComponent item;','InventoryItemComponent* item=nullptr;').replace('if (m_Shell) item = InventoryItemComponent.Cast(m_Shell.FindComponent(InventoryItemComponent));','if (m_Shell) item = m_Shell;').replace('item.GetParentSlot().GetStorage()','item->GetParentSlot()->GetStorage()').replace('item.GetParentSlot()','item->GetParentSlot()')
|
||||
ack=body(transfer,'void Acknowledge(')
|
||||
run('''#include <cassert>
|
||||
+#include <initializer_list>
|
||||
enum class ERR_MortarSupplyState {FAILED=-1,PENDING,READY};
|
||||
struct Replication { static bool IsServer(){return true;} };
|
||||
struct Slot { void* storage; void* GetStorage(){return storage;} };
|
||||
@@ -57,7 +60,10 @@
|
||||
Slot slot{this}; InventoryItemComponent item{&slot}; InventoryItemComponent* m_Shell=&item;
|
||||
bool Valid(float){return valid&&!m_Invalidated;}
|
||||
bool Contains(int which){return m_Shell && (which==1 ? source : destination);}
|
||||
-'''+ack+poll+'''
|
||||
+'''+ack+body(transfer,'bool Unresolved(')+poll+'''
|
||||
+};
|
||||
+struct Battery {Transfer* m_Transfer=nullptr;
|
||||
+'''+body(battery,'bool SupplyPending(').replace('m_Transfer.Unresolved()', 'm_Transfer->Unresolved()')+'''
|
||||
};
|
||||
int main(){
|
||||
using S=ERR_MortarSupplyState;
|
||||
@@ -76,8 +82,19 @@
|
||||
assert(late.Poll(8000)==S::FAILED); // no deadline-boundary success bypass
|
||||
Transfer failed;failed.Acknowledge(false);failed.Acknowledge(true);
|
||||
assert(failed.Poll(1)==S::FAILED && failed.m_Acknowledgement==-1 && failed.m_Resolved);
|
||||
- Transfer gone;gone.m_Shell=nullptr;gone.Acknowledge(true);
|
||||
- assert(gone.Poll(1)==S::PENDING && !gone.m_Resolved); // ambiguous until deadline, never another move
|
||||
+ // Exact deletion is permanent loss, not an operation that can still arrive.
|
||||
+ for(int ack=0;ack<3;ack++)for(bool invalidated:{false,true}){
|
||||
+ Transfer gone;Battery battery;battery.m_Transfer=&gone;gone.m_Invalidated=invalidated;assert(gone.Unresolved()&&battery.SupplyPending());gone.m_Shell=nullptr;
|
||||
+ if(ack==1)gone.Acknowledge(true);
|
||||
+ if(ack==2)gone.Acknowledge(false);
|
||||
+ assert(gone.Poll(1)==S::FAILED&&gone.m_Resolved&&gone.m_Invalidated&&!gone.m_Ready&&!gone.Unresolved());
|
||||
+ assert(!battery.SupplyPending());
|
||||
+ gone.Acknowledge(true);assert(gone.Poll(90000)==S::FAILED&&!gone.Unresolved()&&!gone.m_Ready);
|
||||
+ }
|
||||
+ // A surviving detached shell, missing inventory or lost authority remains
|
||||
+ // uncertain; only exact identity deletion permits unconditional settlement.
|
||||
+ Transfer detached;detached.source=false;detached.destination=false;detached.Acknowledge(true);
|
||||
+ assert(detached.Poll(1)==S::PENDING&&detached.Unresolved());assert(detached.Poll(8000)==S::FAILED&&detached.Unresolved());
|
||||
Transfer unauthorized;unauthorized.valid=false;
|
||||
assert(unauthorized.Poll(0)==S::FAILED && !unauthorized.m_Resolved);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS: actual startup/generation/ownership/timeout/callback policies and native-counter wait; integration preserves one-shot allocation and pending-crew cancellation
|
||||
PASS: rapid mortar cycle counts eight physical rounds once and waits for native completion without a ninth aim or shell
|
||||
@@ -0,0 +1,19 @@
|
||||
check: /tmp/err-policy-lld04iiy/check.cpp:77: int main(): Assertion `gone.Poll(1)==S::FAILED&&gone.m_Resolved&&gone.m_Invalidated&&!gone.m_Ready&&!gone.Unresolved()' failed.
|
||||
Traceback (most recent call last):
|
||||
File "/tmp/erri-mortar-review-1804/tests/test_mortar_transactions.py", line 48, in <module>
|
||||
run('''#include <cassert>
|
||||
~~~^^^^^^^^^^^^^^^^^^^^^^
|
||||
#include <initializer_list>
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...<50 lines>...
|
||||
}
|
||||
^
|
||||
''')
|
||||
^^^^
|
||||
File "/home/jakub/devel/escapistsrereintroduced/tests/policy_harness.py", line 14, in run
|
||||
subprocess.run([str(p/'check')],check=True)
|
||||
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/lib/python3.14/subprocess.py", line 578, in run
|
||||
raise CalledProcessError(retcode, process.args,
|
||||
output=stdout, stderr=stderr)
|
||||
subprocess.CalledProcessError: Command '['/tmp/err-policy-lld04iiy/check']' died with <Signals.SIGABRT: 6>.
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS: actual startup/generation/ownership/timeout/callback policies and native-counter wait; integration preserves one-shot allocation and pending-crew cancellation
|
||||
PASS: rapid mortar cycle counts eight physical rounds once and waits for native completion without a ninth aim or shell
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"decision": "Approved: exact deleted-shell identity can no longer finish later and safely settles only uncertainty.",
|
||||
"hashes": {
|
||||
"addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c": "ad71084f507ad9c32d3055e7ec6844a1ec5ddf568c0216ab8391e902b56e417c",
|
||||
"tests/test_mortar_transactions.py": "5db4ec737355a7ae995240dc93f1dce146e07c0110c2da2c23451f180b134d26",
|
||||
"fix.patch": "cd6b39cf18e7ce49744ffaa28474fb4160abba936599a71e3acd86300af415d0"
|
||||
},
|
||||
"independent_runs": {
|
||||
"baseline": {
|
||||
"exit": 1,
|
||||
"runtime_assertion": true
|
||||
},
|
||||
"proposal": {
|
||||
"exit": 0,
|
||||
"runtime_assertion": false
|
||||
}
|
||||
},
|
||||
"checks": [
|
||||
"Guard is only !m_Shell after server check: donor death/capture, missing storage, or nonnull damaged shell cannot trigger it.",
|
||||
"Deletion sets resolved+invalidated, clears ready and returns FAILED for all acknowledgement states, including late completion.",
|
||||
"Existing nonnull ambiguity, invalid authority and timeout paths retain uncertainty unless preexisting native failure/physical-proof rules settle.",
|
||||
"Actual Battery.SupplyPending becomes false after Poll; production Battery.Update polls existing transfer before MortarSystem checks pending gate.",
|
||||
"No item retry/refund/spawn or new shot authorization added; other physical shells remain under existing order/readiness controls."
|
||||
],
|
||||
"limits": [
|
||||
"Native weak reference deletion modeled as null; no engine or multiplayer run.",
|
||||
"Actor/damage validity is modeled by existing Valid adapter; native component behavior was not newly qualified."
|
||||
],
|
||||
"target_changes": false,
|
||||
"native_run": false
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
PASS: 64 bounded distinct storage candidates; native gates, five-store barrier and finite-stock ownership retained; native placement pending
|
||||
@@ -0,0 +1 @@
|
||||
PASS: shoot adapter waits for a physical round; bounded same-shell retries, interrupted/never-started loads, committed no-retry, order/owner changes and normal native delegation
|
||||
@@ -0,0 +1,3 @@
|
||||
PASS: actual finite-courier age, token, exact ownership/callback and delivered-status admission reject stale, replayed, captured, canceled and ambiguous work
|
||||
PASS: actual native-gun ownership gate rejects player/foreign/replaced/dead occupant, faction change, missing seat and missing registry
|
||||
PASS: four-battery courier selection preserves pending trip/report/transfer identity, skips unavailable crews, and selects the next depleted battery without new stock
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
PASS: actual startup/generation/ownership/timeout/callback policies and native-counter wait; integration preserves one-shot allocation and pending-crew cancellation
|
||||
PASS: rapid mortar cycle counts eight physical rounds once and waits for native completion without a ninth aim or shell
|
||||
@@ -0,0 +1,19 @@
|
||||
check: /tmp/err-policy-o1_n7d8q/check.cpp:77: int main(): Assertion `gone.Poll(1)==S::FAILED&&gone.m_Resolved&&gone.m_Invalidated&&!gone.m_Ready&&!gone.Unresolved()' failed.
|
||||
Traceback (most recent call last):
|
||||
File "/tmp/erri-mortar-review-1804/tests/test_mortar_transactions.py", line 48, in <module>
|
||||
run('''#include <cassert>
|
||||
~~~^^^^^^^^^^^^^^^^^^^^^^
|
||||
#include <initializer_list>
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...<50 lines>...
|
||||
}
|
||||
^
|
||||
''')
|
||||
^^^^
|
||||
File "/home/jakub/devel/escapistsrereintroduced/tests/policy_harness.py", line 14, in run
|
||||
subprocess.run([str(p/'check')],check=True)
|
||||
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/lib/python3.14/subprocess.py", line 578, in run
|
||||
raise CalledProcessError(retcode, process.args,
|
||||
output=stdout, stderr=stderr)
|
||||
subprocess.CalledProcessError: Command '['/tmp/err-policy-o1_n7d8q/check']' died with <Signals.SIGABRT: 6>.
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"change": "Exact shell deletion settles a failed mortar transfer so other physical shells are not permanently blocked. Surviving ambiguous custody remains quarantined.",
|
||||
"files": {
|
||||
"tests/test_mortar_transactions.py": "5db4ec737355a7ae995240dc93f1dce146e07c0110c2da2c23451f180b134d26",
|
||||
"addons/core/Scripts/Game/ERR/10_AI/ERR_MortarSupplyTransfer.c": "ad71084f507ad9c32d3055e7ec6844a1ec5ddf568c0216ab8391e902b56e417c"
|
||||
},
|
||||
"focused_tests": {
|
||||
"test_mortar_transactions.py": 0,
|
||||
"test_mortar_courier_storage.py": 0,
|
||||
"test_mortar_logistics.py": 0,
|
||||
"test_mortar_load_ack.py": 0
|
||||
},
|
||||
"preservation": {
|
||||
"prior_working_paths_checked": 4338,
|
||||
"index_unchanged": true,
|
||||
"original_workspace_written": false
|
||||
},
|
||||
"limits": "No native or multiplayer run; current runtime package and sealed source predate this fix."
|
||||
}
|
||||
Reference in New Issue
Block a user