feat: index loaded resource discovery

This commit is contained in:
Rijad Zuzo
2026-07-17 00:34:30 +02:00
parent 2c88ed6ea8
commit 5356c34fd7
21 changed files with 1392 additions and 69 deletions
+15 -5
View File
@@ -551,11 +551,21 @@ profession, and NPC comfort range. The first scoring pass stores
`safety_risk`, `comfort_distance`, and `discovery_priority` on resource state
and uses them when selecting NPC resource targets.
The first validated spread contains twelve finite resources: berry bushes and
patches, animal camps, trees, and one village woodpile. Placement is guarded by
headless tests for stable IDs, food/wood coverage, semantic contexts,
discovery metadata, navigation reachability, and non-overlapping pantry/player
interaction range.
The current validated spread contains eighteen finite resources: berry bushes
and patches, animal camps, farm crops, trees, and village/mill woodpiles.
Placement is guarded by headless tests for stable IDs, food/wood coverage,
semantic contexts, discovery metadata, navigation reachability, and
non-overlapping pantry/player interaction range.
Loaded discovery now goes through a resource-specific horizontal grid owned by
`ActiveWorldAdapter`. Queries expand from nearby cells until authoritative
resource metadata proves that no farther source can beat the current scored
winner. The index preserves stable registration-order ties and contains no
amount, reservation, or save authority. ResourceNode unload removes only the
loaded anchor; rebinding the same ID restores its indexed position against the
existing `ResourceStateRecord`. The reviewed 18/180/1,800-source benchmark and
exact-selection contract live in
[Loaded Resource Discovery 01](benchmarks/LOADED_RESOURCE_DISCOVERY_01.md).
## Test scenarios