Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
104 lines
6.9 KiB
Markdown
104 lines
6.9 KiB
Markdown
# Off-world medical-kit teardown
|
|
|
|
The installed vanilla `SCR_BaseSupportStationComponent.OnDelete` calls the
|
|
virtual `InitValidSetup` before removing its damage listeners. The item-station
|
|
validator requires a cached weak entity-catalog manager. An initialized station
|
|
can outlive that manager, although teardown does not need the catalog. The native
|
|
initialization routine also subscribes to resource replication independently of
|
|
range; the native teardown's early return for non-range stations misses that
|
|
subscription.
|
|
|
|
`ERR_ItemStationTeardown.c` changes only teardown of the exact stock US and USSR
|
|
medical-kit resupply stations initialized off the main world while `ERR_GameMode`
|
|
existed. Eligibility is recorded at the native damage-subscription phase, after
|
|
the full virtual validation succeeded. The two non-range station types cannot
|
|
have joined the support-station range manager. When their cached catalog has
|
|
expired, cleanup cancels queued initialization and removes actual damage and
|
|
resource subscriptions. A weak resource-component reference records the exact
|
|
subscription source. No catalog is kept alive, fabricated, or replaced.
|
|
|
|
The default super path remains for valid catalogs, main-world stations,
|
|
uninitialized stations, unrelated resources, other mission contexts, and edit
|
|
mode. Startup/runtime `InitValidSetup` is never overridden. This is a bounded
|
|
lifecycle correction, not an error filter.
|
|
|
|
## Evidence limits
|
|
|
|
The archived companion restart at `native-2026-09-19-084026-restart-station-error`
|
|
has two catalog errors between rounds despite 96 passing assertions. Diagnostic
|
|
runs, including 08:58:27 on September 19, show the two initialized off-world kits
|
|
deleted after the mode disappeared, but their cached/global catalogs were still
|
|
present. They do not reproduce the expired-catalog condition. The identity of
|
|
the native owner of these off-world objects (for example resource or preview
|
|
cache) remains unproven. A clean targeted fixture cannot retroactively turn the
|
|
archived restart failure into a pass or establish that this fix resolves it.
|
|
|
|
The optional `station-teardown` WORKBENCH probe owns a new preview world and two
|
|
stock kits in sequence. It runs actual native initialization (explicitly if that
|
|
preview world did not process the queued initialization), observes real resource
|
|
and any installed damage-source invokers, then clears only the isolated station's
|
|
cached catalog. It calls the production `OnDelete` boundary twice while the
|
|
callback sources remain alive, verifies unsubscribing, and waits 500 ms to prove
|
|
queued initialization does not run. Finally it deletes its kit and releases its
|
|
world. It never alters a shared preview/cache entity, current mission stock, or
|
|
the global manager.
|
|
|
|
This fixture is deliberately fault injection at the teardown boundary; it is not
|
|
an observed spontaneous weak-reference expiry, a native restart reproduction,
|
|
held UI interaction, or multiplayer evidence. Damage checks cover the sources
|
|
actually installed on the stock prefab; a kit without damage sources cannot
|
|
prove damage-callback removal dynamically. Python checks execute the actual
|
|
scope predicate and check source invariants; they do not compile Enforce.
|
|
|
|
Native compilation and the opt-in fixture must pass before integration can be
|
|
called verified. Follow with an ordinary companion restart with the diagnostic
|
|
flag disabled and retain all script/VM errors without filtering.
|
|
|
|
## Running the isolated case
|
|
|
|
The headless Workbench runner accepts `--smoke station-teardown --project core
|
|
--rounds 1`, using its existing disposable prefix/profile and default timeout.
|
|
Do not add `--station-teardown-diagnostics` for this qualification. Core steps
|
|
2000/2002 finish only after the probe returns success and then request the
|
|
explicit fixture reset. Existing prison, map, and flight outcomes remain intact.
|
|
|
|
Seven station policy/integration/runner tests, five environment restart runner
|
|
tests, and 32 ordinary game runner tests pass after integration. The runner
|
|
checks stop at argument or missing-prefix validation and never launch a process
|
|
or change audio. These counts are local checks, not native assertions.
|
|
|
|
## Recorded native result
|
|
|
|
[091641](evidence/native-2026-09-19-091641/report.json) passes 76 assertions with zero captured errors. Both US and USSR fixture kits execute native initialization and resource subscription, scoped cleanup, duplicate cleanup, callback detachment and delayed-initialization cancellation. Each reports `nativeDamageSources=0`; this run therefore does not dynamically verify damage-listener removal. The same global catalog remains alive and unchanged. Compilation and the targeted injected condition pass at that source; spontaneous catalog expiry and complete companion restart remain separate.
|
|
|
|
The [092512 full companion regression](evidence/native-2026-09-19-092512/report.json) then completes two escape/restart rounds, 96 assertions and zero errors, with teardown diagnostics disabled. The earlier failing archive is retained. This is a clean subsequent pair, not evidence of deliberate catalog expiry during those resets or a guarantee against intermittent recurrence.
|
|
|
|
## General item-station lifecycle repair — 7 October 2026
|
|
|
|
The RKS #2 log `logs_2026-10-07_13-53-05` also contains catalog errors while
|
|
stock medic equipment is constructed in `PreloadWorld`, before the main game
|
|
mode exists, and during scenario cleanup after POSTGAME. The older two-kit,
|
|
off-world, already-initialized fix does not cover those cases.
|
|
|
|
`ERR_ItemStationLifecycle.c` records successful native initialization and its
|
|
actual damage, range-manager and resource-event subscriptions for item stations
|
|
in Escape-enabled contexts. On deletion it cancels pending initialization and
|
|
removes those subscriptions exactly once. It does not call a startup validator
|
|
that requires the dying catalog. A never-initialized item has no subscriptions
|
|
to undo. Saved manager/resource references are weak and refer to the original
|
|
owner, so cleanup cannot unregister from the next round's manager.
|
|
|
|
Transient off-world equipment can skip initialization when no catalog exists.
|
|
Main-world startup still calls the complete native validator and still reports
|
|
missing catalogs or other invalid configuration. The game editor and scenarios
|
|
that explicitly opt out of takeover retain the original lifecycle. The older
|
|
stock-kit fallback remains compatible with this broader bookkeeping.
|
|
|
|
The [before/after native fixture](evidence/server-lifecycle-fixes-2026-10-07/report.json)
|
|
uses real stock medical kits in the main Nogova world. Before the change, immediate
|
|
deletion plus a kit-local expired-catalog injection produced four catalog errors
|
|
and failed both damage/resource cleanup assertions. With the change, seven native
|
|
checks pass with zero script errors, including duplicate deletion and unchanged
|
|
global catalog identity. This proves the exercised cleanup paths; it does not
|
|
prove every installed mod or reproduce all live-server round-end interleavings.
|