hoi4-agent-tools 4.6.4 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -5
- package/dist/hoi4_agent_tools/core/artifacts.js +9 -2
- package/dist/hoi4_agent_tools/core/changed-summary.js +41 -0
- package/dist/hoi4_agent_tools/core/engine-client.js +273 -0
- package/dist/hoi4_agent_tools/core/job-worker-host.js +5 -1
- package/dist/hoi4_agent_tools/core/operation-result.js +24 -5
- package/dist/hoi4_agent_tools/focus/compact.js +197 -18
- package/dist/hoi4_agent_tools/focus/engine-layout.js +201 -0
- package/dist/hoi4_agent_tools/focus/job-operations.js +3 -1
- package/dist/hoi4_agent_tools/focus/layout.js +3 -2
- package/dist/hoi4_agent_tools/focus/quality/branches.js +32 -0
- package/dist/hoi4_agent_tools/focus/quality/calibration.js +364 -0
- package/dist/hoi4_agent_tools/focus/quality/delta.js +85 -0
- package/dist/hoi4_agent_tools/focus/quality/focus-quality-calibration.json +2265 -0
- package/dist/hoi4_agent_tools/focus/quality/graph.js +170 -0
- package/dist/hoi4_agent_tools/focus/quality/index.js +24 -0
- package/dist/hoi4_agent_tools/focus/quality/inline-images.js +132 -0
- package/dist/hoi4_agent_tools/focus/quality/metrics.js +424 -0
- package/dist/hoi4_agent_tools/focus/quality/orthogonal.js +202 -0
- package/dist/hoi4_agent_tools/focus/quality/positions.js +41 -0
- package/dist/hoi4_agent_tools/focus/quality/schematic.js +241 -0
- package/dist/hoi4_agent_tools/focus/quality/scorecard.js +549 -0
- package/dist/hoi4_agent_tools/focus/quality/stored-calibration.js +7 -0
- package/dist/hoi4_agent_tools/focus/quality/tool-output.js +113 -0
- package/dist/hoi4_agent_tools/focus/quality/types.js +5 -0
- package/dist/hoi4_agent_tools/focus/tool-operations.js +206 -22
- package/dist/hoi4_agent_tools/focus/tool-support.js +1 -1
- package/dist/hoi4_agent_tools/map/references.js +26 -1
- package/dist/hoi4_agent_tools/map/render.js +29 -3
- package/dist/hoi4_agent_tools/map/service.js +3 -0
- package/dist/hoi4_agent_tools/map/tool-operations.js +5 -0
- package/dist/hoi4_agent_tools/mcp/server/instructions.js +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/focus.js +76 -4
- package/dist/hoi4_agent_tools/reference/game-text.js +109 -0
- package/dist/hoi4_agent_tools/reference/ranking.js +60 -2
- package/dist/hoi4_agent_tools/reference/service.js +92 -21
- package/dist/hoi4_agent_tools/schemas/focus-requests.js +64 -7
- package/dist/hoi4_agent_tools/schemas/focus.js +121 -6
- package/dist/hoi4_agent_tools/version.js +1 -1
- package/docs/configuration.md +17 -17
- package/docs/focus.md +100 -4
- package/docs/map.md +5 -2
- package/docs/reference.md +1 -1
- package/docs/research/reference-benchmark.md +111 -1
- package/docs/setup.md +1 -1
- package/docs/tools.md +5 -5
- package/docs/troubleshooting.md +12 -11
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
- package/schemas/configuration.schema.json +1 -1
- package/schemas/continuous-focus-palette.schema.json +1 -1
- package/schemas/custom-weighted-pool.schema.json +1 -1
- package/schemas/decision-inspect-input.schema.json +1 -1
- package/schemas/error-log-input.schema.json +1 -1
- package/schemas/event-feature-manifest.schema.json +1 -1
- package/schemas/focus-plan.schema.json +146 -120
- package/schemas/focus-planning-sidecar.schema.json +15 -7
- package/schemas/geography-model.schema.json +1 -1
- package/schemas/gui-animation-source.schema.json +1 -1
- package/schemas/gui-helper.schema.json +1 -1
- package/schemas/gui-scenario.schema.json +1 -1
- package/schemas/helper-expansion-request.schema.json +1 -1
- package/schemas/helper-expansion-summary.schema.json +1 -1
- package/schemas/impact-inspect-input.schema.json +1 -1
- package/schemas/map-operation.schema.json +1 -1
- package/schemas/mechanic-test-input.schema.json +1 -1
- package/schemas/mod-index-input.schema.json +1 -1
- package/schemas/operation-result.schema.json +1 -1
- package/schemas/package-check-input.schema.json +1 -1
- package/schemas/package-manifest.schema.json +1 -1
- package/schemas/probability-analysis-result.schema.json +1 -1
- package/schemas/probability-compare-input.schema.json +1 -1
- package/schemas/probability-evaluate-input.schema.json +1 -1
- package/schemas/probability-inspect-input.schema.json +1 -1
- package/schemas/probability-render-input.schema.json +1 -1
- package/schemas/probability-scenario-set.schema.json +1 -1
- package/schemas/probability-sequence-input.schema.json +1 -1
- package/schemas/probability-simulate-input.schema.json +1 -1
- package/schemas/probability-sweep-input.schema.json +1 -1
- package/schemas/reference-context-input.schema.json +1 -1
- package/schemas/reference-read-input.schema.json +1 -1
- package/schemas/reference-search-input.schema.json +1 -1
- package/schemas/reference-sheets.schema.json +1 -1
- package/schemas/scenario-suite.schema.json +1 -1
- package/schemas/scenario-test-input.schema.json +1 -1
- package/schemas/script-validate-input.schema.json +1 -1
- package/schemas/shared-scenario.schema.json +1 -1
- package/schemas/source-lookup-input.schema.json +1 -1
- package/server.json +2 -2
|
@@ -57,15 +57,125 @@ Most use vocabulary the documentation does not: "national spirit" where script s
|
|
|
57
57
|
Search the script name when it is known; the ranking does not add synonyms for individual questions.
|
|
58
58
|
These are 61 task questions over one documentation snapshot, not a general precision guarantee.
|
|
59
59
|
|
|
60
|
-
Run
|
|
60
|
+
Run the sets with:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
npx tsx scripts/evaluate-reference-discovery.ts MOD_ROOT GAME_ROOT
|
|
64
64
|
npx tsx scripts/evaluate-reference-discovery.ts MOD_ROOT GAME_ROOT --validation
|
|
65
|
+
npx tsx scripts/evaluate-reference-discovery.ts MOD_ROOT GAME_ROOT --held-out
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
The script exits with a failure when a case has no expected answer in the supplied sources.
|
|
68
69
|
|
|
70
|
+
## Refreshed wiki snapshot and a player vocabulary trial
|
|
71
|
+
|
|
72
|
+
Measured on 2026-11-01 against the Chaos Redux wiki snapshot refreshed on 2026-10-31 (54 wiki pages and 10 kit pages, 11,340 sections) and the installed 1.19.3.0 documentation (50 files, 3,281 sections).
|
|
73
|
+
The refresh renamed pages to snake case (`event_modding.md`), and the benchmark still expected `Event modding - Hearts of Iron 4 Wiki.md`, so it scored every wiki answer as a miss: 10 of 37 discovery answers first and seven cases reported as unanswerable.
|
|
74
|
+
The cases now accept both names.
|
|
75
|
+
|
|
76
|
+
A third set, `--held-out`, has 24 new questions written by a separate agent that was not told about the change below.
|
|
77
|
+
The validation set was no longer a clean check: two of its misses, "remove a national spirit" and "repeat effects", had been named in ADR 0040 as the motivating examples.
|
|
78
|
+
|
|
79
|
+
The trial expanded a plain-word query with the script word the documentation uses, at 0.6 of a query word's weight and never more informative than the player words it replaces.
|
|
80
|
+
`scripts/derive-reference-vocabulary.ts` mined the vocabulary from the game's English localisation, where `EFFECT_`, `TRIGGER_` and `MODIFIER_` keys name script and their text is what the player reads: 128 tooltip phrases of two or three words for documented commands ("at war" for `has_war`, "moves capital to" for `set_capital`) and 11 of 25 mined word pairs that name the same thing (conference for `pc`, technology for `tech`, freedom for `autonomy`).
|
|
81
|
+
The other 14 pairs only appear together ("male" and "female").
|
|
82
|
+
Five hand-checked entries covered what the localisation names only indirectly: national spirit to idea, temporary and expire to timed, repeat to loop, and skip to bypass ("at war" was listed by hand as well).
|
|
83
|
+
The entries and the weight were chosen on the discovery set alone: a hand entry from build to construction moved one discovery answer from first to second and was dropped, and weights of 0.4, 0.8 and 1.0 each placed 21 rather than 22 discovery answers first.
|
|
84
|
+
The held-out baseline was measured before the entries were final, but no entry was chosen from it; validation and held-out were each scored once with the final entries.
|
|
85
|
+
|
|
86
|
+
| Set and ranking | Answer first | Within three | Within five | Lands within three | Mean reciprocal rank |
|
|
87
|
+
| ---------------------------------- | -----------: | -----------: | ----------: | -----------------: | -------------------: |
|
|
88
|
+
| Discovery, current ranking | 19/37 | 27/37 | 28/37 | 25/37 | 0.595 |
|
|
89
|
+
| Discovery, with vocabulary (tuned) | 22/37 | 29/37 | 30/37 | 26/37 | 0.668 |
|
|
90
|
+
| Validation, current ranking | 11/24 | 15/24 | 18/24 | 15/24 | 0.559 |
|
|
91
|
+
| Validation, with vocabulary | 11/24 | 15/24 | 18/24 | 15/24 | 0.552 |
|
|
92
|
+
| Held-out, current ranking | 7/24 | 12/24 | 15/24 | 9/24 | 0.402 |
|
|
93
|
+
| Held-out, with vocabulary | 8/24 | 12/24 | 16/24 | 9/24 | 0.440 |
|
|
94
|
+
|
|
95
|
+
Both rankings placed all five exact identifiers first and returned nothing for the two negative queries.
|
|
96
|
+
The October discovery figures (19, 28 and 29 of 37) were measured on the previous snapshot and game documentation, so they are not a direct comparison.
|
|
97
|
+
|
|
98
|
+
The vocabulary lifted the set it was tuned on but not the questions it had never seen.
|
|
99
|
+
On validation, "is controlled by the AI" fell from second to third because "controlled by" also names `is_controlled_by`; on the held-out set "has researched" and "technology" found `has_tech`, "national spirit" moved `has_idea` no closer, and "does not own" pushed a claim question from third to fourth.
|
|
100
|
+
Across the 48 held-out and validation questions that is one more answer first and one more within five.
|
|
101
|
+
The trial was reverted and ADR 0040's rule against added synonyms stands; commit `ab56af1` reproduces it.
|
|
102
|
+
|
|
103
|
+
Two causes of the remaining misses are not vocabulary:
|
|
104
|
+
|
|
105
|
+
- The refreshed wiki documents some commands on more pages than the hand-checked answers name. `scopes.md` has a `for_loop_effect` row, `data_structures.md` a `check_variable` row, and `event_modding.md` a `news_event` row. The strict answers do not count them, before or after.
|
|
106
|
+
- When several sources have the same heading, later copies wait behind every distinct answer. For "remove a national spirit from a country" the console command `remove_ideas` ranks second, so the effect documentation and wiki copies of `remove_ideas` fall out of the first five.
|
|
107
|
+
|
|
108
|
+
## Game text, question intent and a blind test set
|
|
109
|
+
|
|
110
|
+
Measured on 2026-11-01 on the same sources (ADR 0076).
|
|
111
|
+
Two changes were developed on the discovery, validation and held-out sets together (85 plain-word questions): each command entry also carries the words of its in-game tooltip or modifier name from the game's English localisation, and a question that starts with a check or an action verb prefers triggers or effects over other commands, on actions and dynamic variables.
|
|
112
|
+
A fourth set, `--test`, was then written by a second agent that saw none of the other sets' results: 36 plain-word questions, four exact names and two negative queries. It was scored once, before and after.
|
|
113
|
+
|
|
114
|
+
| Set | Answer first | Within three | Within five | Lands within three | Mean reciprocal rank |
|
|
115
|
+
| ------------------------- | -----------: | -----------: | ----------: | -----------------: | -------------------: |
|
|
116
|
+
| Development, before | 37/85 | 54/85 | 61/85 | 49/85 | 0.530 |
|
|
117
|
+
| Development, after | 40/85 | 58/85 | 63/85 | 53/85 | 0.570 |
|
|
118
|
+
| Discovery, after | 20/37 | 27/37 | 28/37 | 25/37 | 0.623 |
|
|
119
|
+
| Validation, after | 14/24 | 17/24 | 19/24 | 17/24 | 0.660 |
|
|
120
|
+
| Held-out, after | 6/24 | 14/24 | 16/24 | 11/24 | 0.401 |
|
|
121
|
+
| Blind test, before (once) | 16/40 | 25/40 | 31/40 | 22/40 | 0.547 |
|
|
122
|
+
| Blind test, after (once) | 20/40 | 28/40 | 31/40 | 25/40 | 0.606 |
|
|
123
|
+
|
|
124
|
+
All exact names stayed first in every set.
|
|
125
|
+
One blind negative query ("how to fix my graphics card driver crashing in a shooter") returned one result before and after; the other negatives returned none.
|
|
126
|
+
Within the development sets the held-out set lost one first place (7 to 6) while the other two gained four.
|
|
127
|
+
On the blind set, four questions moved to first ("some command power", "the ruling party and elections", "at war with anyone", "a decision is currently active") and "extra manpower" entered the first five, while "make all buildings construct faster" fell out of the first five because the action intent lowers modifier rows, and "use less supply" fell from second to third.
|
|
128
|
+
|
|
129
|
+
On the development sets, the question intent alone placed three more answers first (40 of 85, with 61 within five). The in-game words alone placed one fewer first and one more within five, and on top of the intent they placed two more within five and none more first; they are kept for the questions they lift into reach of a first read.
|
|
130
|
+
Weights of 0.4 and 0.8 for the intent penalty scored within one question of 0.6.
|
|
131
|
+
Pooling the full text of every copy of a command into each entry placed fewer answers first (34 of 85) and was dropped. So was a rule that kept console-command copies from demoting the script entry with the same name, which changed nothing.
|
|
132
|
+
Following links between wiki pages was not tried: cross-page links mostly point at whole pages, and their text repeats the target heading ("Flags" for `data_structures.md#Flags`), so they add no words a section does not already have.
|
|
133
|
+
|
|
134
|
+
Half of the blind questions still miss first place, and nine miss the first five.
|
|
135
|
+
The remaining misses mostly need meaning rather than shared words: "access to the sea" for `is_coastal`, "share a border" for `is_neighbor_of`, "research faster" for `research_speed_factor`, "free a puppet" for `end_puppet`.
|
|
136
|
+
|
|
137
|
+
The maintainer updated the game to 1.19.4.1 the same day; its documentation adds the `stockpile_fuel` AI strategy, changes a token list and removes one console command.
|
|
138
|
+
Every expected answer in all four sets is still present. Rescored on 1.19.4.1, before and after:
|
|
139
|
+
|
|
140
|
+
| Set (1.19.4.1) | Answer first | Within three | Within five | Lands within three | Mean reciprocal rank |
|
|
141
|
+
| ------------------ | -----------: | -----------: | ----------: | -----------------: | -------------------: |
|
|
142
|
+
| Discovery, before | 19/37 | 27/37 | 28/37 | 25/37 | 0.595 |
|
|
143
|
+
| Discovery, after | 20/37 | 27/37 | 28/37 | 25/37 | 0.623 |
|
|
144
|
+
| Validation, before | 11/24 | 15/24 | 18/24 | 15/24 | 0.559 |
|
|
145
|
+
| Validation, after | 14/24 | 17/24 | 19/24 | 17/24 | 0.660 |
|
|
146
|
+
| Held-out, before | 7/24 | 12/24 | 15/24 | 9/24 | 0.402 |
|
|
147
|
+
| Held-out, after | 6/24 | 14/24 | 16/24 | 11/24 | 0.401 |
|
|
148
|
+
| Blind test, before | 16/40 | 25/40 | 31/40 | 22/40 | 0.547 |
|
|
149
|
+
| Blind test, after | 21/40 | 27/40 | 31/40 | 24/40 | 0.613 |
|
|
150
|
+
|
|
151
|
+
The maintainer's target is the right answer first for at least 22 of 24 blind questions and within three for all of them. This ranking places about half first and two thirds within three, so the gap remains large.
|
|
152
|
+
|
|
153
|
+
### Optional meaning layer trial
|
|
154
|
+
|
|
155
|
+
With the maintainer's approval, a local sentence-embedding layer was tried on top of the word ranking (commit `bb3c019`, reverted in `b5c1a46`).
|
|
156
|
+
It ran only when `HOI4_REFERENCE_EMBEDDINGS` named a cache folder and `@huggingface/transformers` 4.3.1 was installed, fetched the pinned `Xenova/all-MiniLM-L6-v2` revision `751bff37182d3f1213fa05d7196b954e230abad9` (the 22,972,370-byte quantized ONNX model and three tokenizer and config files, each checked against its pinned SHA-256), and embedded each section's page, heading and opening lines once into a 14 MB vector cache.
|
|
157
|
+
Meaning ranks were fused with word ranks by reciprocal rank (meaning weight 0.25, k = 10, cosine floor 0.35); exact names stayed with word ranking, and each result said which ranking ordered it.
|
|
158
|
+
Weights of 0.25 and 0.5 with k of 10 and 30, and embedding cleaned plain text instead of the Markdown excerpt, were compared on the development sets only.
|
|
159
|
+
|
|
160
|
+
| Set | Answer first | Within three | Within five | Lands within three | Mean reciprocal rank |
|
|
161
|
+
| ------------------------------------ | -----------: | -----------: | ----------: | -----------------: | -------------------: |
|
|
162
|
+
| Development, words | 40/85 | 58/85 | 63/85 | 53/85 | 0.570 |
|
|
163
|
+
| Development, words and meaning | 45/85 | 59/85 | 63/85 | 54/85 | 0.609 |
|
|
164
|
+
| Blind test, words (once) | 20/40 | 28/40 | 31/40 | 25/40 | 0.606 |
|
|
165
|
+
| Blind test, words and meaning (once) | 20/40 | 26/40 | 32/40 | 23/40 | 0.602 |
|
|
166
|
+
|
|
167
|
+
The gain on the development sets did not carry over to the blind set: the same number of first answers, two fewer within three, and the nonsense query "how to fix my graphics card driver crashing in a shooter" returned five troubleshooting sections rather than one. Exact names stayed first.
|
|
168
|
+
Installing the runtime adds about 470 MB (`onnxruntime-node` 288 MB, `onnxruntime-web` 141 MB, `sharp` and its images 29 MB, the library 14 MB), the model download is 23 MB, loading the model took 2.1 seconds, embedding all 14,621 sections took about 53 seconds once, and a query embedding took about 25 milliseconds.
|
|
169
|
+
The layer did not clearly win, so it was reverted, and the default install and ranking carry no model.
|
|
170
|
+
A stronger model or embedding the game's own text per command may do better, but would need a new blind set, because this one has now been used for both comparisons.
|
|
171
|
+
|
|
172
|
+
### Speed
|
|
173
|
+
|
|
174
|
+
Before the change, every search reopened, reread and hashed all 114 documentation files. On a lightly loaded machine that inventory took a median of 70 ms of a 94 ms warm search, and with the file stamps reused it took 36 ms of 50 ms.
|
|
175
|
+
A warm read took 13 ms rather than 25–84 ms.
|
|
176
|
+
Later end-to-end runs shared the machine with other heavy work: three alternating rounds of the old and new code measured warm search medians of 145–183 ms and 84–583 ms, so no end-to-end speed gain is claimed from them.
|
|
177
|
+
The first `hoi4.source_lookup` still builds the whole game and mod symbol index: 53–66 seconds in three runs before this change on a lightly loaded machine, 108–192 seconds under the later load. This change does not touch it, and moving that index to the shared Rust engine is planned separately.
|
|
178
|
+
|
|
69
179
|
## Compact context budgets
|
|
70
180
|
|
|
71
181
|
A 2026-09-27 check of the installed 3.5.0 server found that eight GUI results could contain only wiki sections even though the installed GUI documentation was available. The 3.5.1 source qualifies limits of one, two, and eight citations across the same six work surfaces. All eighteen cases retained installed documentation; limits of two or more also retained wiki citations. Required sources excluded by the limit appeared in `omittedSources`, separately from files absent under `missing`. The nine search queries still found all expected answer-bearing sections.
|
package/docs/setup.md
CHANGED
|
@@ -83,7 +83,7 @@ Entries that are not plain relative folders, such as `../outside` or wildcard pa
|
|
|
83
83
|
|
|
84
84
|
## Add local reference material
|
|
85
85
|
|
|
86
|
-
Place
|
|
86
|
+
Place the kit's HOI4 wiki in `hoi4_wiki/` inside the mod. A mod the kit has not updated yet keeps working with the older `paradox_wiki/` name; when both exist, `hoi4_wiki/` wins.
|
|
87
87
|
An optional generated documentation dump can go in `script_docs/`.
|
|
88
88
|
For a configured workspace, `wikiRoot` and `scriptDocsRoot` can point to other absolute directories.
|
|
89
89
|
The server reads these local files; it does not download the wiki.
|
package/docs/tools.md
CHANGED
|
@@ -27,11 +27,11 @@ MCP clients may ask for approval to create review files.
|
|
|
27
27
|
|
|
28
28
|
## Focus trees
|
|
29
29
|
|
|
30
|
-
| Tool | Purpose
|
|
31
|
-
| -------------------- |
|
|
32
|
-
| `hoi4.focus_inspect` | Read focus trees,
|
|
33
|
-
| `hoi4.focus_render` |
|
|
34
|
-
| `hoi4.focus_rewrite` | Create a focus tree or
|
|
30
|
+
| Tool | Purpose | Writes |
|
|
31
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
|
32
|
+
| `hoi4.focus_inspect` | Read focus trees, structural or reference problems and a layout verdict with scorecard, fixes and, with `previous`, a delta. | review files |
|
|
33
|
+
| `hoi4.focus_render` | Return an in-game-style picture of a tree inline with close-ups, plus PNG with icons, HTML, SVG, JSON and source maps. | review files |
|
|
34
|
+
| `hoi4.focus_rewrite` | Create a focus tree or palette from a plan, or repair a layout; returns the layout verdict and delta, or says nothing to improve. | mod files |
|
|
35
35
|
|
|
36
36
|
## Scripted GUIs
|
|
37
37
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -37,17 +37,18 @@ This page lists the codes you are most likely to meet, then the checks for probl
|
|
|
37
37
|
|
|
38
38
|
Use the error code to find what prevented a focus, GUI or map edit.
|
|
39
39
|
|
|
40
|
-
| Code | Cause and fix
|
|
41
|
-
| ---------------------------------------- |
|
|
42
|
-
| `TRANSACTION_STALE` | A source file changed after the review was made. Inspect again and repeat the rewrite on the current source.
|
|
43
|
-
| `TRANSACTION_RECOVERY_REQUIRED` | An earlier rewrite was interrupted and its journal could not be recovered yet. Reads still work; the message names the reason. Restart the server, and repair the named file if it persists.
|
|
44
|
-
| `TRANSACTION_ROLLBACK_STALE` | A file changed since the rewrite, so it cannot be rolled back safely. Restore the file from version control.
|
|
45
|
-
| `MAP_STATE_DISTRIBUTION_REQUIRED` | A state operation was given an incomplete explicit policy. Omit `distribution` for the automatic land-share policy, or send every field (see [Maps](map.md)).
|
|
46
|
-
| `MAP_STATE_REGION_DISTRIBUTION_CONFLICT` | Moved or merged provinces lie in different strategic regions. Use `strategicRegion: "move-to-target-region"`, or move the provinces between regions first.
|
|
47
|
-
| `MAP_EXTERNAL_REFERENCE_READ_ONLY` | Base-game or dependency scripts name a changed state. Repeat with `remapReferences` or `readOnlySources` set to `override` to copy them into the mod with the numbers changed.
|
|
48
|
-
| `MAP_DATED_STATE_HISTORY_CONFLICT` | A dated block (`1939.1.1 = { ... }`) overrides the value you are changing. Edit that block, or change the later date's value deliberately.
|
|
49
|
-
| `MAP_SCRIPT_REFERENCE_MISSING` (error) | A script names a state, province or region the map does not define. Remap it with `remap_map_references`, or correct the script.
|
|
50
|
-
| `
|
|
40
|
+
| Code | Cause and fix |
|
|
41
|
+
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `TRANSACTION_STALE` | A source file changed after the review was made. Inspect again and repeat the rewrite on the current source. |
|
|
43
|
+
| `TRANSACTION_RECOVERY_REQUIRED` | An earlier rewrite was interrupted and its journal could not be recovered yet. Reads still work; the message names the reason. Restart the server, and repair the named file if it persists. |
|
|
44
|
+
| `TRANSACTION_ROLLBACK_STALE` | A file changed since the rewrite, so it cannot be rolled back safely. Restore the file from version control. |
|
|
45
|
+
| `MAP_STATE_DISTRIBUTION_REQUIRED` | A state operation was given an incomplete explicit policy. Omit `distribution` for the automatic land-share policy, or send every field (see [Maps](map.md)). |
|
|
46
|
+
| `MAP_STATE_REGION_DISTRIBUTION_CONFLICT` | Moved or merged provinces lie in different strategic regions. Use `strategicRegion: "move-to-target-region"`, or move the provinces between regions first. |
|
|
47
|
+
| `MAP_EXTERNAL_REFERENCE_READ_ONLY` | Base-game or dependency scripts name a changed state. Repeat with `remapReferences` or `readOnlySources` set to `override` to copy them into the mod with the numbers changed. |
|
|
48
|
+
| `MAP_DATED_STATE_HISTORY_CONFLICT` | A dated block (`1939.1.1 = { ... }`) overrides the value you are changing. Edit that block, or change the later date's value deliberately. |
|
|
49
|
+
| `MAP_SCRIPT_REFERENCE_MISSING` (error) | A script names a state, province or region the map does not define. Remap it with `remap_map_references`, or correct the script. |
|
|
50
|
+
| `MAP_SCRIPT_PRIORITIZE_PROVINCE` | A `prioritize = { ... }` list holds a province id where the effects documentation gives state ids only (vanilla pairs states with ports, `prioritize = { 521 7564 }`). Replace it with the state that holds the province. |
|
|
51
|
+
| `MAP_REFERENCE_NEEDS_REVIEW` (info) | A single-valued argument such as `capital = 64` had no single successor and was left as it was. Choose its new target by hand. |
|
|
51
52
|
|
|
52
53
|
## Game and live testing
|
|
53
54
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hoi4-agent-tools",
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.7.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fontsource-variable/roboto": "5.3.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
3
|
"mcpName": "io.github.klimPaskov/hoi4-agent-tools",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"description": "Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"fixtures:generate:technology": "tsx scripts/generate-technology-fixture.ts",
|
|
103
103
|
"fixtures:generate:probability": "tsx scripts/generate-probability-fixture.ts",
|
|
104
104
|
"fixtures:check": "npm run fixtures:generate && tsx scripts/check-generated.ts fixtures",
|
|
105
|
+
"focus:calibrate": "tsx scripts/focus-quality-calibration.ts",
|
|
105
106
|
"schemas:generate": "tsx scripts/generate-schemas.ts",
|
|
106
107
|
"schemas:check": "tsx scripts/generate-schemas.ts && tsx scripts/check-generated.ts schemas",
|
|
107
108
|
"registry:validate": "tsx scripts/validate-registry.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/configuration.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/continuous-focus-palette.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/custom-weighted-pool.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/decision-inspect-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/error-log-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.7.0/schemas/event-feature-manifest.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|