diff --git a/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/01-leave-and-pick-up.md b/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/01-leave-and-pick-up.md deleted file mode 100644 index f117a984..00000000 --- a/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/01-leave-and-pick-up.md +++ /dev/null @@ -1,20 +0,0 @@ -# 01 — loadouts on the ground, FARP left open, packed into crates on the ground - -Status: done - -See the [PRD](../PRD.md). - -## Where - -`src/CTLD_fatCow.lua`: `loadLoadout` (crates set down with `spawnCratesAligned`, partial content and mass kept, instead of `loadIntoHold`), `deployFromHold` (crates consumed), `packIntoHold` (becomes a pack into crates on the ground at the FARP), `onTakeoff` / `onDead` / `onBirth` (no pack for a piloted FARP), `_farpNameFor` / `_releaseFarpName` (one name per open FARP), the cow menu section (the pack command offered near an open FARP). Today an open piloted FARP is a `CTLDFatCow` keyed by the helicopter's unit name, with `cow.crates` still on board: that key and those crates are what this ticket changes. Check that a partial crate's `metadata.fatCow` and `metadata.massKg` survive a ground spawn and the CTLD load (`loadCrate`). - -## Acceptance - -- A loadout sets its crates next to the helicopter, partial last crate included, and puts nothing in the hold; once the pilot has loaded them, deploying gives the loadout's stock. -- Deploying takes the cow crates out of the hold; the helicopter's mass drops by theirs. -- Taking off, the CH-47 leaves the FARP open and its pilot is told so, with what it holds; the FARP serves the next helicopter landing on it. -- The FARP stays open, its stock intact, when the CH-47 is destroyed, its pilot leaves, or another pilot takes the slot. -- Any piloted cow of the coalition landed within 150 m of an open FARP gets "Pack the Fat Cow FARP": what is left is set down as cow crates at the FARP, and the FARP's name is freed. Beyond 150 m or in the air, the pack is refused with the reason. -- Those crates, loaded by any CH-47 of the coalition and deployed elsewhere, open a FARP with the stock the first one had left. -- Two FARPs can be open at once. -- The AI cows behave as before (existing specs untouched and green). diff --git a/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/02-live-check.md b/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/02-live-check.md deleted file mode 100644 index ad8bd1ca..00000000 --- a/.backlog/FEAT-FAT-COW-LEAVE-FARP/tickets/02-live-check.md +++ /dev/null @@ -1,15 +0,0 @@ -# 02 — live check (Zip) - -Status: done — verified in game by Zip, 2026-11-05 - -See the [PRD](../PRD.md). - -To run in DCS once ticket 01 is merged, with two players or one player changing slot. - -1. CH-47 at a logistic zone: "Load" > a loadout with fuel and Hellfires. Expected: the crates appear on the ground next to the helicopter, the hold stays empty. -2. Load the crates with the usual CTLD loading, fly out, land, "Deploy the Fat Cow FARP". Expected: the FARP opens with the loadout's stock, and the hold is empty. -3. Take off and fly 5 km away. Expected: a message says the FARP stays open; the FARP is still on the F10 map. -4. Another helicopter lands on the FARP, refuels and rearms. Expected: it does, and "FARP status" shows the stock going down. -5. Come back with the CH-47, land within 150 m, "Pack the Fat Cow FARP". Expected: crates appear on the ground at the FARP with what is left; the FARP no longer serves. -6. Load those crates, fly elsewhere, deploy. Expected: the FARP opens with the stock packed in step 5. -7. Deploy, then leave the CH-47 slot (or let it crash), and take a second CH-47: land at the FARP and pack it. Expected: the second CH-47 packs it. diff --git a/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/01-go-home-say-so-take-over.md b/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/01-go-home-say-so-take-over.md deleted file mode 100644 index d97065f6..00000000 --- a/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/01-go-home-say-so-take-over.md +++ /dev/null @@ -1,13 +0,0 @@ -# 01 — despawn only at home, announce the orphan, take it over - -Status: done - -See the [PRD](../PRD.md). - -## Acceptance - -- A returning cow landing more than 2 km from home is not despawned; at home it is. -- A cow whose flight is gone tells each helicopter player flight of its coalition without a cow (one message per group), and no one else. -- "Take over a Fat Cow" lists, to those flights, every cow of the coalition flying home (lost flight or RTB, empty or not), nearest first with its distance, refreshed every 30 s; an entry leaves every menu once its cow is taken over, home or dead. -- "Release the Fat Cow" leaves the cow where it stands (FARP open on the ground, orbit in the air), tells those flights and lists it as `waiting`. -- Taking one over: the cow follows the new flight, which commands it like a cow it requested; a flight with a cow already, or a cow no longer going home, is told why not. diff --git a/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/02-live-check.md b/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/02-live-check.md deleted file mode 100644 index 04962407..00000000 --- a/.backlog/FEAT-FAT-COW-TAKEOVER/tickets/02-live-check.md +++ /dev/null @@ -1,70 +0,0 @@ -# 02 — Live check in DCS - -**Status:** ✅ done — verified in game by Zip, 2026-11-05 · **Type:** HITL (live DCS, Zip) - -## Parent - -[PRD — FEAT-FAT-COW-TAKEOVER](../PRD.md). - -## What to check - -The unit specs mock DCS; three things only DCS can answer: - -1. A cow on the ground sent home lifts off and flies home, instead of vanishing on the spot (the 2026-10-29 bug), and despawns once there. -2. A grounded cow given a `Follow` task by a take-over lifts off and follows the new flight. -3. **Release the Fat Cow** on the ground leaves the cow and its FARP serving where they are, and the cow packs before it follows the flight that takes it over. -4. The message and the **Take over a Fat Cow** submenu reach a client of another helicopter flight (nearest cow first, with its distance), and an entry leaves the menu once its cow is taken. - -## Kit - -`Test_FatCow_LiveCheck.miz` (FEAT-FAT-COW ticket 06, on Zip's machine), rebuilt with this branch's `CTLD.lua`: slots `Gunfighter`, `Apache-150m`, `Apache-300m` in the `LGZ_cowbase_B` logistic zone, the AI flight `Hawk` and its mission-placed cow `Fat Cow Hawk`. -Or the server variant on Privé 1 with this build: any two AH-64D slots in different groups. - -## Procedure - -**Print Screen** where marked 📸. Nothing to copy: `dcs.log` and the screenshots are read afterwards. - -### A — The flight is lost while its cow serves on the ground (the 2026-10-29 case) - -1. Slot **Gunfighter**. Take off and land about 10 km out of the zone, on open ground (the cow then needs about 2.5 min to fly home: time to change slot). -2. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Request a Fat Cow** → the first loadout. - Wait for the cow, then **Fat Cow** → **Land here**, and wait for `Fat Cow FARP open: …`. -3. **Esc** → **Choose slot** → **Spectators**: Gunfighter has no player, its flight is lost. -4. **F10** map, 30 s later: the cow is no longer on the ground at your landing spot, it flies back towards the zone. 📸 - If it is still there, note whether it has its crew and FARP around it. -5. Slot **Apache-150m** before the cow is home: go straight in. - `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Take over a Fat Cow**: one entry, `Fat Cow … km away, going home to LGZ_cowbase_B`. 📸 - Wait 30 s and open it again: the distance went down. -6. Pick that entry: expected `Fat Cow joining your flight: … km, in about … min, with …`. - **Fat Cow** again: **Take over a Fat Cow** is gone. 📸 -7. Take off: the cow turns back and follows you. **Land here**: it lands next to you and opens its FARP a minute later. - -### B — Back home - -8. With the cow on the ground and its FARP open, **Fat Cow** → **RTB**. -9. On the way, **Fat Cow** → **Take over a Fat Cow** lists it again (an RTB cow can be taken back). 📸 - Do not pick it: on the **F10** map the cow lifts off, flies to the zone, lands there and disappears, and the entry goes with it. 📸 - -### C — Released on the ground - -10. Slot **Gunfighter**, request a cow, **Land here** away from the zone, wait for its FARP. -11. **Fat Cow** → **Release the Fat Cow**: expected `Fat Cow released: …`; the cow and its FARP stay. 📸 -12. **Fat Cow** → **Take over a Fat Cow**: `Fat Cow … km away, waiting`. Pick it: the FARP packs (crew and depot gone), the cow lifts off and follows you. 📸 - -### D — The message, with a second player (Griffin or Paluche), or the AI flight - -13. Player 1 in **Gunfighter**, player 2 in **Apache-300m**: player 2 requests a cow, lets it land next to him, then leaves his slot. - Player 1 gets, within a few seconds, `A Fat Cow lost its flight and is going home to LGZ_cowbase_B: … km at …° from you, with …`. 📸 - Without a second player: Claude kills the `Hawk` leader through the bridge (`trigger.action.explosion` on its position) once `Fat Cow Hawk` has landed with it, while Zip sits in **Gunfighter**; the message then says "going home" without a zone name (a mission-placed cow). - -## Result so far (2026-10-30, `tests/dcs/pilotPassive/scenario_fatcow_takeover.lua` on `Test_FatCow_Takeover.miz`, nobody flying) - -- 1 and 2: **PASS**. Hawk removed while its cow served on the ground 1.3 km from home: the cow stayed, lifted off 20 s after the re-task, was taken over by the AI flight `Viper` 3 km away and closed on it; sent RTB, it landed home and despawned. -- 3: released **in flight** (holding), then taken back: PASS. A release on the ground, and the FARP packing on the take-over that follows, are not checked yet (C). -- 4: the lost-flight and released messages reached Gunfighter's group with distance and bearing; the submenu's content is not checked yet (A 5–6, B 9). - -## Log lines expected (`dcs.log`) - -- `CTLDFatCowManager: cow '…' lost flight '…', offered for take-over`, or `… released by flight '…', offered for take-over` -- possibly `CTLDFatCowManager: cow '…' landed … m from home: not despawned` right after (the event that despawned the cow on 2026-10-29) -- `CTLDFatCowManager: cow '…' taken over by flight 'Apache-150m' (was 'Gunfighter')` diff --git a/.backlog/FEAT-FAT-COW/tickets/01-spike-runtime-farp.md b/.backlog/FEAT-FAT-COW/tickets/01-spike-runtime-farp.md deleted file mode 100644 index f45857fa..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/01-spike-runtime-farp.md +++ /dev/null @@ -1,106 +0,0 @@ -# 01 — In-game spike: a runtime FARP, its finite stock, its vehicles - -**Status:** 🧑 waiting-human — phase 1 done (2026-10-26), phase 2 (multiplayer client) not run yet · **Type:** HITL (live DCS, Zip) - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). Decision 4. - -## Questions - -- **(a)** Does a FARP spawned mid-mission serve refuel/rearm to a player who was already in game? -- **(b)** Is a finite warehouse stock respected, and seen identically by the server and by a client? -- **(c)** Does DCS require a refuel/ammo vehicle in range of an Invisible FARP? - -## Kit - -- `tests/dcs/pilotActive/scenario_fatcow_spike.lua` — pure DCS API, no CTLD. An F10 menu per player group, "Fat Cow spike": 1 Invisible FARP under me · 2 Finite stock (300 kg, 2 Hellfire) · 3 Read stock + my aircraft · 4 Add fuel + ammo trucks · 5 Crates only (barrels + ammo crate) · 6 Remove everything · 7 Add FARP props (fuel depot, ammo dump, barrels, ammo crate) · 8 Fuel depot only · 9 Ammo dump only. Commands 5, 7–9 were added after the first runs (the single-pad variant and a fuel-truck-only command were dropped once moot). Every measurement goes to the screen and to `dcs.log`, prefixed `[FCSPIKE]`. -- `missions/Test_FatCow_Spike.miz` — Caucasus, a flat field 19 km from Senaki and from Kutaisi (no airfield ground crew in reach). Two AH-64D slots (`Apache-1`, `Apache-2`, 80 m apart), ground start with engines running (`TakeOffGroundHot`) on the field, 30 % fuel (342 kg), empty pylons: the spike needs no flying (Zip, 2026-10-26: no stick at hand). Trees at the exact spot are not checked by any file: a slot that explodes at spawn means a tree. The script is embedded and runs at mission start. -- Built with the VMCT `veaf-mission-editor` actions on a blank Caucasus mission (`veaf_libs.blank_mission`): `add_player_slot` ×2 (air start), `set_group_properties` `move_to` ×2 and `edit_route` `set` waypoint 1 to `TakeOffGroundHot` ×2 (`add_player_slot` refuses a ground start off an airfield), `add_startup_script_trigger` (`file_static`). To rebuild after a script change, redo these actions on a fresh blank mission. - -The 300 kg of fuel is below the ~800 kg a 30 % Apache takes to fill up, and the 2 Hellfires below the 4 a rail takes: a cap shows as a partial service. - -## Procedure — phase 1, single player (answers a, c, and b on one machine) - -Press **Print Screen** (DCS screenshot, saved in `Saved Games\DCS\Screenshots`) where marked 📸: the screenshots and `dcs.log` are read afterwards, nothing has to be copied by hand. - -1. DCS main menu → **MISSION** → `Test_FatCow_Spike.miz` → **OK**. If a slot is asked, take **Apache-1**. -2. You are on the ground, engines running. A message `[FCSPIKE] loaded` shows at start. Touch nothing. -3. `\` → **F10 Other** → **Fat Cow spike** → **F1** "1. Invisible FARP under me". Green smoke under you; lines `SPAWNED` and `INITIAL STOCK`. 📸 -4. `\` → **F8 Ground Crew** → **F1 Rearm & Refuel**. The rearm window opens (or not). 📸 Close it. -5. `\` → **F10 Other** → **Fat Cow spike** → **F2** "2. Finite stock". Lines `SET STOCK` and `STOCK READ BACK`. 📸 -6. `\` → **F8 Ground Crew** → **F1 Rearm & Refuel**. 📸 In the window: fuel to **100 %**, and **4 × AGM-114K** on one pylon. Confirm the window. -7. Wait until the ground crew is done (or says it cannot). 📸 -8. `\` → **F10 Other** → **Fat Cow spike** → **F3** "3. Read stock + my aircraft". 📸 -9. **Only if step 6 or 7 refused the service:** `\` → **F10 Other** → **Fat Cow spike** → **F4** "4. Add fuel + ammo trucks", then redo steps 6 to 8. -10. **Only if step 3 printed `getWarehouse() = nil`:** `\` → **F10 Other** → **Fat Cow spike** → **F6** "6. Remove everything", then **F5** "5. Single pad FARP ahead", hover-taxi onto the green smoke 40 m ahead, land, and redo steps 4 to 8. This step needs flight controls: without them, stop at step 9 and report. -11. Quit the mission. Say "phase 1 done". - -## Procedure — phase 2, multiplayer (the client side of b) - -Needs the mission on a dedicated server (the VEAF test server) and Zip joining it as a client: in single player the server and the client are the same process. - -1. Load `Test_FatCow_Spike.miz` on the server. Join it as a client, slot **Apache-1**. -2. Steps 2 to 8 of phase 1. -3. Back to spectators (**Esc** → **Choose slot** → spectators), then take **Apache-1** again: a new birth. The script prints `STOCK AT BIRTH`. -4. `\` → **F8 Ground Crew** → **F1 Rearm & Refuel**. 📸 -5. Quit. The server's `dcs.log` holds the `[FCSPIKE]` lines. - -## Reading the results - -| What is seen | Conclusion | -|---|---| -| Step 3 `INITIAL STOCK` prints numbers | (b) The Invisible FARP has a warehouse: the countryside scene's step 11 comment is wrong. | -| Step 3 prints `getWarehouse() = nil` | No finite stock on an Invisible FARP → step 10; if the single pad has one, decision 2 changes its FARP type (to Zip). | -| Step 4 window opens with nothing to take | (b) The runtime FARP starts empty, as the forum guide says: the cow must stock it, which it does anyway. | -| Step 6–7 serves, without trucks | (a) yes and (c) no vehicle needed: decision 2 holds. | -| Step 6–7 refuses, step 9 serves | (c) DCS needs vehicles: fallback, a vehicle hidden under the cow's fuselage. | -| Step 9 still refuses | (a) a runtime FARP does not serve a player already in game: stop, report to Zip (the RotorOps route, teleporting pre-placed FARPs, becomes the candidate). | -| Step 8: aircraft got ~300 kg and 2 Hellfires, stock 0 | (b) finite stock respected on the server. | -| Step 8: aircraft got full fuel and 4 Hellfires | (b) the stock is not enforced: stop, report to Zip (decision 3). | -| Phase 2: rearm window shows the same quantities as `STOCK NOW` | (b) client and server agree. | -| Phase 2: the client's window shows something else (empty, or unlimited) | (b) no network sync: the stock has to be re-applied on each birth, as VMCT does, and enforcement checked server-side. | - -## Answers - -### Phase 1 — single player, 2026-10-26 (Zip, DCS 2.9.30.28738, no stick: Apache on the ground, engines running) - -From `dcs.log` and Zip's screenshots. - -| Step | Measured | -|---|---| -| 3 | `INITIAL STOCK`: jet fuel 0, every Hellfire 0, inventory empty. `getWarehouse()` is not nil. DCS logs `NO ATC COMM HELIPAD + FCSPIKE_FARP_1:127500000` (a warning, no effect seen). | -| 4 | The Mission Resources window opens, loadout list empty. | -| 5 | `STOCK READ BACK`: jet fuel 300, `AGM_114K` 2, the two other Hellfire names 0. | -| 6–7 (no trucks) | Fuel 100 % + 4 × AGM-114K, OK: nothing happens, no message. | -| 9 (trucks) | Same request: the ground crew answers, works ~30 s, then "Unable to comply". | -| 9 again | Fuel 50 %: "We don't have this in stock". | -| 7 (props, new mission) | Fuel 100 % + 4 × AGM-114K: "Copy", then served; `STOCK NOW` 0, `AIRCRAFT` 634 kg and `AGM_114K` ×2. | -| 8 | `STOCK NOW`: jet fuel 0, `AGM_114K` 0. `AIRCRAFT`: fuel 631 kg / 1 140 kg (342 at spawn), `AGM_114K` ×2, `M230_HEDP M789` ×1 200 (already full). The window shows 56 % and 2 Hellfires on pylon 2. | - -- **(a) Yes.** An Invisible FARP spawned by `coalition.addStaticObject` mid-mission serves a player already in game. -- **(b) Yes, on the server side.** The runtime FARP has a warehouse and starts empty. A finite stock set by script is served until it runs out, then refused: +289 kg for 300 kg in stock (the rest burnt at idle during the test), 2 Hellfires out of 4 asked. A request bigger than the stock is partly served, then answered "Unable to comply". Liquids are in kg. The Hellfire item is `weapons.missiles.AGM_114K`. -- **(c) A supplier is required, but statics are enough: no vehicle.** With the FARP alone the window opens but nothing is served and nothing is said. With an M978 HEMTT Tanker and an M 818 30 m away, it is served. With **statics only** (command 7: `FARP Fuel Depot`, `FARP Ammo Dump Coating`, `barrels_cargo`, `ammo_cargo`, 25–30 m away, no vehicle) the ground crew answers "Copy" and serves: fuel 342 → 634 kg, `AGM_114K` ×2, stock down to 0. Decision 2 holds as is, no hidden vehicle. Then each static alone, on a new FARP with a new 300 kg / 2 Hellfire stock each time: - - | Statics around the FARP | Fuel | Hellfire | - |---|---|---| - | none | no (no answer) | no | - | `barrels_cargo` + `ammo_cargo` (command 5), or each alone | no (no answer) | no | - | **`FARP Fuel Depot` alone** (command 8) | **yes** (+292 kg, stock 0) | **yes** (2, stock 0) | - | `FARP Ammo Dump Coating` alone (command 9) | no ("No can do", stock stays 300) | yes (2 → 4) | - - **The `FARP Fuel Depot` alone supplies both fuel and weapons**; the ammo dump supplies weapons only; cargo statics supply nothing. The cow scene therefore needs the fuel depot and nothing else as a supplier: no ammo dump, no tent, no vehicle (Zip dislikes the bunker and the tent). Not measured: the range (25–30 m was used). -- Where the rule lives: not in DCS's Lua files (`db.Units.lua` gives the M978 and M 818 only generic attributes, and the FARP statics none), nor as text in the clear DLLs of `bin/`; it is in the compiled engine, probably `Inter.dll` or `WorldGeneral.dll`. Measuring in game was preferred over decompiling. -- The countryside scene's step 11 comment ("Invisible FARP airbases … return nil for getWarehouse()") is wrong, measured. - -No answer kills the design. - -### Phase 2 — multiplayer client - -Not run yet: needs the mission on a dedicated server with Zip joining it as a client. - -## Acceptance criteria - -- [x] (a), (b) on one machine, (c) answered from `dcs.log` and the screenshots, in this ticket and the PRD. -- [ ] (b) client side answered by phase 2, or marked not measured with the reason. -- [x] If an answer kills the design, reported to Zip before ticket 02 is written. diff --git a/.backlog/FEAT-FAT-COW/tickets/02-core-stock-and-scene.md b/.backlog/FEAT-FAT-COW/tickets/02-core-stock-and-scene.md deleted file mode 100644 index bf71f541..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/02-core-stock-and-scene.md +++ /dev/null @@ -1,22 +0,0 @@ -# 02 — Core: a cow's stock, its scene, deploy and pack - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). Decisions 2, 3; ticket 01 answers. - -## What to build - -- A `CTLDFatCow` entity (Manager + Entity, `src/core/class.lua`) holding a **stock**: fuel in kg and weapons by warehouse item name (`weapons.missiles.AGM_114K`, the 30 mm item), and a state: `stowed` (on board), `deploying`, `deployed`. -- A `CTLDFatCowManager` singleton keyed by cow unit name. -- A **Fat Cow scene** (`src/scenes/CTLD_fatCowScene.lua`): an Invisible FARP at the cow, a `FARP Fuel Depot` 25 m behind it (the only supplier needed, ticket 01), a few ammo crates and barrels as dressing, 3 standing infantry. No vehicle, no tent, no ammo dump, no bunker. -- **Deploy**: plays the scene; on its last step, sets the FARP warehouse to the stock (jet fuel = stock fuel, every other liquid 0, each stocked item to its count). -- **Pack**: reads the FARP warehouse back into the stock (what the players took is gone), then removes the scene. -- **Re-sync**: on every player birth, each deployed cow re-writes its warehouse with the values the server holds (read, then write): ticket 01 did not measure the client side, and VMCT re-applies on birth for that reason. Costs nothing if DCS already syncs. -- Fix the countryside scene's step 11 comment: an Invisible FARP does have a warehouse (measured). - -## Acceptance criteria - -- [x] Busted: deploy writes the stock into the warehouse; pack reads the remainder back; a stock emptied by players reads back as empty; re-sync writes back what the server holds; the scene spawns no vehicle and includes a `FARP Fuel Depot`. -- [x] Scene assets pass the design-time asset gate. diff --git a/.backlog/FEAT-FAT-COW/tickets/03-piloted-cow.md b/.backlog/FEAT-FAT-COW/tickets/03-piloted-cow.md deleted file mode 100644 index db7cce7a..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/03-piloted-cow.md +++ /dev/null @@ -1,21 +0,0 @@ -# 03 — Piloted cow: cow crates in a CH-47F and the F10 commands - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). Decision 1, piloted mode. - -## What to build - -- Cow crates in the CTLD crate catalogue, requestable in a logistic zone by a cow-capable type (`CH-47Fbl1` by default): - - **fuel tank**: one 800 gal ERFS tank, 2 400 kg of fuel, that mass in the hold; - - **Hellfire**: a crate of Hellfires (count and mass configurable); - - **30 mm**: a crate of 30 mm rounds (count and mass configurable). -- F10, once landed with cow crates on board: **Deploy Fat Cow FARP** — the stock is the sum of the cow crates on board, which stay on board (the fuel stays in the cow, as in reality). -- F10, deployed: **Pack Fat Cow FARP** — reads the remaining stock back; the cow crates on board are reduced to what is left (fuel mass in the hold goes down; an emptied crate disappears). -- Taking off while deployed packs automatically. - -## Acceptance criteria - -- [x] Busted: stock = sum of the cow crates on board; pack reduces the crates and the hold mass to what is left; the deploy command needs the cow on the ground and at least one cow crate; take-off packs. diff --git a/.backlog/FEAT-FAT-COW/tickets/04-ai-cow.md b/.backlog/FEAT-FAT-COW/tickets/04-ai-cow.md deleted file mode 100644 index 782c32cf..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/04-ai-cow.md +++ /dev/null @@ -1,20 +0,0 @@ -# 04 — AI cow: requested by a flight, escorts it, serves it, goes home - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). Decision 1, AI mode. - -## What to build - -- F10 **Request a Fat Cow** for a player of a flight, only on the ground inside a friendly CTLD logistic zone. CTLD spawns a CH-47 from the configured template next to the zone, with the default AI stock (full fuel, 3 × 800 gal ≈ 7 200 kg, and 6 Hellfires). -- The cow **follows** the flight (DCS `Follow` task on the requesting group). -- When the flight's leader lands, the cow gets a `Land` task (a task on a turning point, not a `Land` waypoint: VMCT measured that a `Land` waypoint goes to the nearest airfield) on open ground near the leader; **60 s** after its own landing, it deploys. -- When the flight's leader takes off, the cow packs, takes off and follows again. -- Empty stock, or F10 **Release the Fat Cow**: it packs if deployed, flies back to its logistic zone, lands and despawns. -- A **mission-placed** AI CH-47 is a cow when a config entry names it with the flight it escorts (the VMCT contract, see the PRD). - -## Acceptance criteria - -- [x] Busted: request refused outside a logistic zone or in the air; one cow per flight; land → deploy after the delay; take-off → pack + follow; empty → home + despawn; release → home + despawn; a configured mission cow is picked up at start. diff --git a/.backlog/FEAT-FAT-COW/tickets/05-config-docs-release.md b/.backlog/FEAT-FAT-COW/tickets/05-config-docs-release.md deleted file mode 100644 index b72928d4..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/05-config-docs-release.md +++ /dev/null @@ -1,17 +0,0 @@ -# 05 — Config, VMCT contract doc, CHANGELOG and release notes - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). - -## What to build - -- One `fatCow` block in `src/CTLD_config.yaml` + schema (EN/FR labels) + `configVersion` bump + catalogue shape + regenerated oracles. -- `docs/pilot/` and `docs/mission-maker/` pages, EN + FR: flying a cow, requesting one, and the contract VMCT relies on (config keys, how a mission-placed AI CH-47 is declared a cow). -- `CHANGELOG.md` `[Unreleased]`, and a release-notes line poking fun at ED's native Fat Cow, announced on 2024-04-19 and 2024-08-23 and absent from DCS 2.9.30.28738. - -## Acceptance criteria - -- [x] `test_catalogue_shape.py` and `config_spec.lua` green; docs build; CHANGELOG guard green. diff --git a/.backlog/FEAT-FAT-COW/tickets/06-live-check.md b/.backlog/FEAT-FAT-COW/tickets/06-live-check.md deleted file mode 100644 index aa1dcdb7..00000000 --- a/.backlog/FEAT-FAT-COW/tickets/06-live-check.md +++ /dev/null @@ -1,111 +0,0 @@ -# 06 — Live check in DCS - -**Status:** ✅ done — passed in use (Zip, 2026-11-04: the squadron flew the Fat Cow several evenings in a row, it works) · **Type:** HITL (live DCS, Zip) - -## Parent - -[PRD — FEAT-FAT-COW](../PRD.md). - -## What to check - -- Piloted: a CH-47F loads cow crates, lands, deploys; an Apache landed next to it is served up to the stock; pack; the hold mass went down. -- AI: an Apache requests a cow in a logistic zone, takes off, the cow follows, both land, the FARP deploys after 60 s, the Apache is served, takes off, the cow packs and follows; release sends it home. -- The range: how far from the cow an Apache can land and still be served (ticket 01 used 0 m). -- The 30 mm crate: whether `weapons.shells.M230_HEDP M789` is the warehouse item the Apache's gun reload draws from. -- The AI cow's DCS behaviour, which the unit tests only mock: the `Follow` task on a player flight, the `Land` task next to the leader on open ground, the take-off when re-tasked, the despawn at home. -- If a second player is available: the client side of ticket 01 (b). - -## Kit - -`Test_FatCow_LiveCheck.miz`, in `Saved Games\DCS\Missions` on Zip's machine and **not in the repository**: it embeds a built `CTLD.lua`, which `CLAUDE.md` forbids committing (and `CTLD_DEV_ROOT` loading needs a de-sanitised `os`, which this machine does not have). -Rebuild it after any `src/` change, with the VMCT `veaf-mission-editor` actions on a blank Caucasus mission (`veaf_libs.blank_mission`): - -- `add_trigger_zone` `LGZ_cowbase_B` at x -290000, y 665150, radius 400 m: a logistic zone on a flat field 19 km from Senaki and from Kutaisi, so no airfield warehouse serves anyone; -- `add_player_slot` + `edit_route` (waypoint 1 → `TakeOffGroundHot`), all inside the zone, engines running: `Cow-1` (CH-47Fbl1) at y 665000; `Gunfighter` (AH-64D_BLK_II, 30 % fuel, empty pylons) 60 m east of it, `Apache-150m` 150 m east, `Apache-300m` 300 m east; -- `add_air_group` + `edit_route`: `Hawk`, an AI AH-64D 3 km south, taking off hot, landing (Land task) at x -291000, y 666500 for 300 s, then at x -292500, y 667500 for good; `Fat Cow Hawk`, a late-activated AI CH-47Fbl1 at y 665650 in the zone, taking off hot; -- `add_startup_script_trigger`: `file_static` of the built `CTLD.lua`, then `inline`: `CTLDConfig.get().settings["fatCowAICows"] = { { group = "Fat Cow Hawk", escort = "Hawk" } }` and `CTLDFatCowManager.getInstance():_activateMissionCows()` (the mission-placed cow, the VMCT contract, without a full config snapshot). - -The `Hawk` run needs nobody: CTLD logs it (`CTLDFatCowManager:` lines in `dcs.log`) while the piloted checks go on. - -### Server variant (multiplayer, 2026-10-26) - -`VEAF_OpenTraining_Syria_FatCowTest_ICAO_LTAG_20261026.miz` (Saved Games\DCS\Missions, not in any repository): the Syria Open Training v6 at its committed state, rebuilt in a copy (`D:\tmp\OT-Syria-FatCow`) with `published/src/scripts/community/CTLD.lua` replaced by this branch's build (`ctld.VERSION` `2.0.0-rc13-fatcow-d8da3839`, so develop's fixes since rc13 are in too) and the `fatCow*` block added to `ctld-config.yaml` (catalogue 2.3.0). Mission name `VEAF_OpenTraining_Syria_FatCowTest_ICAO_LTAG`, so it never replaces the production file. CH-47F and AH-64D dynamic slots at Hatay and FARP Reyhanli; every airfield and FARP ammo dump is a CTLD logistic zone. On a server, Zip is a client: the client side of ticket 01 (b) is measured by the same checks (the rearm window shows the cow's stock, served up to it). - -### First server run — 2026-10-26 afternoon (Zip, Privé 1, client) - -- Piloted CH-47F near Akrotiri (4.5 km from the airfield): deployed with 2 400 kg; an Apache landed at the FARP was refuelled and rearmed. A client on a dedicated server is served by a cow FARP: ticket 01 (b) client side answered in practice. -- The pilot changing slot leaves the FARP in place: kept on purpose (decision 4a). -- Findings, all addressed in the second build (`-v2`, `ctld.VERSION` `2.0.0-rc13-fatcow-5cd3286a`): loading one crate at a time is tedious (loadouts); the AI cow reported an empty stock until it landed (bug: it read crates it does not have); its request was refused outside a logistic zone (now from anywhere, from the nearest zone, with an ETA); it packed and left whenever the leader hopped onto its FARP (a player flight now commands it: Land here, Take off, Hold here, Join us); no way to know what the FARP you are at still holds (FARP status). -- Measurement for "FARP status on every FARP": the Open Training's mission FARPs (filled by VMCT) read jet fuel 1000000 and AGM_114K 1000000 through `getLiquidAmount` / `getItemCount`, while `getInventory` lists 0 weapon types. A follow-up can show such a warehouse as "full". - -### Evening run — 2026-10-26 (Privé 1, Zip, Griffin, Paluche): findings - -1. **The AI cow exploded on take-off** (21:06:29.9), under a second after its FARP was packed: the Invisible FARP under it was destroyed. Hypothesis, not measured: an AI aircraft sitting on an airbase dies when the airbase is destroyed (Zip's piloted CH-47 survived the same pack at 21:06:16). -2. **A packed FARP stays on the F10 map**: destroying a heliport static leaves its airbase. One ghost per deployment (`CS_FARP-55`, `-61`, `-67`, `-73`). - Proposed for 1 and 2: one FARP per cow, never destroyed: packing removes the depot, dressing and crew and empties the warehouse; the next deployment re-adds the heliport under the same name at the new spot (RotorOps PERKS moves its Fat Cow FARPs this way). -3. **The cow's FARP became unlimited**: VMCT's `veafGrass.onBirth` refills every FARP warehouse (50 000 kg of each liquid, ~5 000 of every weapon) on every player birth; packs read 50 035 and 50 055 kg. Proposed: the cow's FARP named `CTLD_…`, VMCT's refill skips `CTLD_` FARPs (VMCT PR), and CTLD restores its own count if fuel or Hellfires go up. -4. **"Load: Max weapons + max fuel" refused on the French server**: CTLDConfig translates every config `desc`, so the crate is named "Réservoir Fat Cow (800 gal)" while the loadout names it in English. Proposed: look the crate up by its translated name, with a test in French. -5. **No CSAR menu in the CH-47F**: VMCT's `CSAR.lua` lists no `CH-47Fbl1` in `csar.aircraftType`, in every VMCT mission. Proposed: one line in the same VMCT PR. -6. **Radar missiles** (Zip): the cow should also carry AGM-114L (Longbow, radar). - -Fixed on 2026-10-27, in this PR (Zip's lot 1): -- 1 and 2: one FARP per cow (`CTLD_FatCow_FARP_`), never destroyed: packing removes the depot, dressing and crew and empties the warehouse; the next deployment adds the heliport again under the same name, where the cow is. To measure in game: that adding a static under an existing name moves the FARP and leaves no ghost. -- 3, CTLD side: a warehouse count that went up is put back to the cow's own, weapons the cow does not carry are removed, and the warehouses are written again 2 s after a birth too. The VMCT side (GRASS skipping `CTLD_` FARPs) is a separate VMCT PR. -- 4: a loadout no longer names crates: it lists fuel kg and items, and CTLD splits it into the crates that carry them. -- 5: VMCT side, the same VMCT PR. -- 6, and Zip's loadout profiles: four loadouts, each two 800 gal tanks (4 800 kg) with 40 Hellfires (25 laser, 15 radar) + 2 400 rounds, 60 (38 + 22) + 1 200, 40 laser + 2 400, 60 laser + 1 200 (crates of 20 laser, 20 radar, 1 200 rounds); an AI cow flies with 80 % internal fuel and carries the loadout the requesting flight picks (submenu). Masses from the DCS data mine: AGM-114K 45.3 kg, AGM-114L (warehouse name `weapons.missiles.AGM_114`, to check in game) 49 kg. -- F10 menus regrouped: a piloted cow's **Load** and **Request a crate** submenus, an AI request's loadout submenu. - -## Procedure - -**Print Screen** where marked 📸. Nothing to copy: `dcs.log` and the screenshots are read afterwards. - -### A — Piloted cow and range (no flying) - -1. **MISSION** → `Test_FatCow_LiveCheck.miz` → **OK**, slot **Cow-1**. - The message `[Fat Cow live check] CTLD loaded…` shows. -2. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Request a crate** → **Fat Cow fuel tank (800 gal)**. 📸 - Then **Request a crate** → **Fat Cow laser Hellfires (x20)**. -3. `\` → **F10 Other** → **CTLD** → **Crate Commands** → **Load Crate** → the fuel tank; again for the Hellfires. - If **Load Crate** is not there, load them with the DCS cargo window. -4. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Fat Cow stock**: expected 2400 kg of fuel, laser Hellfire x20. 📸 -5. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Deploy the Fat Cow FARP**. - Wait for `Fat Cow FARP open: …` (a few seconds). **F2** (external view) to look at the layout. 📸 -6. **Esc** → **Choose slot** → **Gunfighter** (60 m away). - `\` → **F8 Ground Crew** → **F1 Rearm & Refuel** → **FUEL 100 %**, **4 × AGM-114K** on one pylon → **OK**. Wait for the ground crew. 📸 -7. Same as 6 with **Apache-150m**, then **Apache-300m**: fuel only (the Hellfires are gone). - Note for each what the ground crew says: "Copy", "Unable to comply", or nothing. -8. Back to **Cow-1**: `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Fat Cow stock**. 📸 - Then **Pack the Fat Cow FARP**. 📸 -9. Quit. - -### B — Requested AI cow (needs flying) - -1. **MISSION** → `Test_FatCow_LiveCheck.miz` → **OK**, slot **Gunfighter**. -2. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **Request a Fat Cow** → a loadout. A CH-47 comes from the nearest logistic zone. -3. Take off, fly 2 km over open fields, land in the open. The cow should land about 120 m to your left and announce `Fat Cow FARP open` one minute after touching down. 📸 -4. Rearm and refuel as in A6. 📸 -5. Take off: the cow should pack and follow. Land again somewhere else: it lands next to you again. -6. `\` → **F10 Other** → **CTLD** → **Fat Cow** → **RTB**: it flies back to where it appeared and disappears. -7. Quit. - -### C — Lot 1 fixes (2026-10-27), on the server with the next build - -1. CH-47F in a logistic zone: **Fat Cow** → **Load** → **40 Hellfires (25 laser, 15 radar), 2400 rounds**: 7 crates in the hold, the message lists 4800 kg of fuel, laser Hellfire x25, radar Hellfire x15, 30 mm rounds x2400. -2. Land elsewhere, **Deploy the Fat Cow FARP**; an Apache rearms with **radar** Hellfires (AGM-114L) and the gun: served, or "We don't have this in stock" (then the warehouse name `weapons.missiles.AGM_114` or the 30 mm name is wrong: tell the session). -3. Another player takes a slot, then **FARP status** at the cow: the stock has not jumped to 50 000 kg (VMCT's refill is undone). -4. Take off (the FARP packs), land 2 km further, deploy again: on the F10 map, **one** FARP for the cow, now at the new spot, and no new one at the old spot. -5. Apache: **Request a Fat Cow** → **60 laser Hellfires, 1200 rounds**; **Land here**, wait for the FARP, then **Take off**: the cow lifts off and does **not** blow up. -6. Ka-50: **Request a Fat Cow** → **Russian** → **40 Vikhr, 920 rounds (Ka-50)**; rearm with Vikhr and the gun at its FARP. Mi-24P: same with **32 Ataka, 500 rounds (Mi-24P)**. Each refused item ("We don't have this in stock") is a warehouse name to correct: tell the session which. - -## Reading the results - -| What is seen | Conclusion | -|---|---| -| A6: "Copy", fuel and 4 Hellfires served | Piloted cow works; 60 m is in range. | -| A7: "Copy" at 150 m but nothing at 300 m (or the other way) | The FARP's service range lies in between: the docs say to land within it. | -| A8: stock = 2400 minus what the three Apaches took; after pack the CH-47 is lighter | Pack reads the remainder back and the hold mass follows. | -| A5: depot, crates or soldiers under the rotor, or no `FARP open` message | Layout or scene problem: screenshot needed. | -| B3: the cow lands far away, hovers, or goes to an airfield | The AI `Land` task does not behave as VMCT measured: the cow's landing needs rework. | -| B5: the cow stays on the ground after the take-off | The re-task to `Follow` does not lift a landed AI helicopter. | -| `dcs.log`: `cow 'Fat Cow Hawk…' deployed`, then `packed` | The mission-placed cow (VMCT contract) works without a player. | diff --git a/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/PRD.md b/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/PRD.md deleted file mode 100644 index 556371be..00000000 --- a/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/PRD.md +++ /dev/null @@ -1,25 +0,0 @@ -# FEAT-JTAC-LOG-REAL-LASER-CODE — the JTAC never logs its laser code or its spot, so a "no laser" report cannot be settled - -Status: ✅ done — the log lines are in (2026-11-04); verified in game by Zip, 2026-11-05 - -## Found - -David and Claude, 2026-10-12, Sinai Open Training v6 on dcs.veaf.org (Privé 1, VMCT 6.29.0). -Reaper 1 is an ASSETS drone with `jtac: 1511`. -The log shows it claiming nine targets one after the other between 19:59 and 20:58 UTC (`[JTAC] claim` / `release claim`), yet David, in an A-10C_2 with the TGP LSS on 1511 for about a minute at 15 nm, found no spot. His own TGP laser was on 1681, so the kills that coincided with a claim release were his own. -The log cannot say which code the drone's spot actually carried, nor whether `Spot.createLaser` returned a spot at all: `_claimTarget` and `_releaseTarget` are the only JTAC lines. - -## Tickets - -| # | Ticket | Status | -|---|---|---| -| [01](tickets/01-log-the-code-then-measure-the-lss.md) | Log the real code and the spot, then find why the LSS saw nothing | ✅ logging done, verified in game by Zip, 2026-11-05 | - -## Definition of done - -- The new log lines exist and a Lua test asserts them. -- The ticket ends with a cause, or with the measurement that rules the drone out; DCS is needed (David or a running session), so it cannot be closed from the repository alone. -- VMCT then takes the vendored file (a chore on that side); a surprising DCS behaviour measured goes into VMCT's `known-limitations.yaml`. -- `CHANGELOG.md` entry under `[Unreleased]`. - -Related, already merged: `FIX-JTAC-IMPOSED-CODE-AND-RADIO` (PR #258), which keeps an imposed code out of the pool. diff --git a/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/tickets/01-log-the-code-then-measure-the-lss.md b/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/tickets/01-log-the-code-then-measure-the-lss.md deleted file mode 100644 index 5d58e758..00000000 --- a/.backlog/FEAT-JTAC-LOG-REAL-LASER-CODE/tickets/01-log-the-code-then-measure-the-lss.md +++ /dev/null @@ -1,24 +0,0 @@ -# 01 — Log the real code and the spot, then find why the LSS saw nothing - -Status: ✅ done — logging done 2026-11-04; verified in game by Zip, 2026-11-05 - -- Add at `INFO`: the JTAC's laser code and radio when it registers (`_resolveLaserCode`, `spawnJTAC`), and the code, the target and the range from the drone at each `startLase`, plus whether `Spot.createLaser` returned a spot. -- Then **measure** the reported case: Sinai OT, Medium zone of Gizeh, A-10C_2, TGP LSS on 1511 at 15 nm, nothing found in a minute while Reaper 1 lased a target. - Hypotheses to test one at a time, each outcome written down with what it concludes: - a. the code actually lased is not 1511 (the new log line settles it); - b. the spot is on but the LSS range is shorter than 15 nm in this configuration (repeat at 5 and 10 nm, with a mate lasing at a fixed distance); - c. the spot is created but not visible to the player because of the drone's line of sight to the target (`checkLOS`) or its altitude; - d. a second JTAC holds 1511 (`FIX-JTAC-IMPOSED-CODE-AND-RADIO` should have closed this; check the vendored version carries it). -- The outcome is a fix, or a measured range / behaviour handed to VMCT for `known-limitations.yaml` (`kind: dcs`, dated) and the mission briefing. - -## Logging — done - -`CTLDJTACManager:_logRegistered` and `_logLaseStart`, tested in `tests/ci/functional/jtac_manager_spec.lua`. -The lines, as they read in `dcs.log` (see [the developer page](../../../docs/developer/subsystems/troops-jtac.md#what-the-log-says-about-a-jtac)): - -``` -[JTAC] register: 'Reaper 1', code 1511 (imposed), radio 36.0 FM -[JTAC] lase: 'Reaper 1', code 1511 on 'BMP-2 #1' (BMP-2), range 5000 m, JTAC at 3000 m, spot created -``` - -Hypothesis a is settled by the `lase` line's code, c in part by its range and altitude, and d by a second `register` line on the same code. diff --git a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/01-troops-unloaded.md b/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/01-troops-unloaded.md deleted file mode 100644 index e376cd61..00000000 --- a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/01-troops-unloaded.md +++ /dev/null @@ -1,35 +0,0 @@ -# 01 — A dropped troop group is announced (`OnTroopsUnloaded`) - -**Status:** ✅ done (PR #311) · **Type:** AFK - -## Parent - -[PRD — FEAT-TROOP-GESTURE-EVENTS](../PRD.md). Stories 1, 2, 3, 7, 8, 9, 11, 15, 16, 17. GitHub issue #308. - -## What to build - -When a troop group is dropped — on the ground, by fast-rope, or into an extraction zone — CTLD publishes `OnTroopsUnloaded`, on the model of `OnVehicleUnloaded`. - -The event is published at the end of a **successful** drop, from the one place every drop goes through (the menu, "Unload All", the choice of a group, the AI transports). A drop of several groups at once publishes one event per group. - -Payload: the troop group, the carrier unit's name, the player (the slot unit name for a player transport, empty for an AI transport), the **method** (on the ground, or by fast-rope), the **destination** (into combat, or into an extraction zone, with the zone's name) shaped like the one of `OnTroopsDeployed`, and a timestamp. - -A refused drop publishes nothing: no troops on board, too high or too fast to fast-rope, the group could not be spawned. - -The events documentation (EN and FR) gets the event in its troop section and its count. - -## Acceptance criteria - -- [ ] A successful ground drop publishes one `OnTroopsUnloaded` with the group, the carrier, the player, method "ground", destination "combat", and a timestamp. -- [ ] A fast-rope drop carries method "fast_rope"; a drop into an extraction zone carries destination "extraction zone" and the zone's name. -- [ ] "Unload All" with several groups publishes one event per group; choosing a group by index publishes one event for that group. -- [ ] An AI transport's drop publishes the event with an empty player. -- [ ] No event on a refusal (no troops, too high, too fast, spawn failure). -- [ ] The parachute events are unchanged. -- [ ] The new cases fail before the change and pass after it; the existing troop specs pass unchanged. -- [ ] `events.md` and `events.fr.md` list the event in the troop section, with the method that publishes it. -- [ ] `busted tests/ci/` green; luacheck clean; no new translation key. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/02-troops-loaded-and-returned.md b/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/02-troops-loaded-and-returned.md deleted file mode 100644 index d95f7147..00000000 --- a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/02-troops-loaded-and-returned.md +++ /dev/null @@ -1,34 +0,0 @@ -# 02 — Loading in a pickup zone and returning to it are announced (`OnTroopsLoaded`, `OnTroopsReturned`) - -**Status:** ✅ done (PR #311) · **Type:** AFK - -## Parent - -[PRD — FEAT-TROOP-GESTURE-EVENTS](../PRD.md). Stories 4, 6, 7, 9, 11, 12, 15, 16, 17. GitHub issue #308. - -## What to build - -The two gestures that bracket a pickup zone publish an event. - -- **`OnTroopsLoaded`**: troops loaded in a pickup zone, at the end of a successful load. It covers the player's menu load, the AI transports and the scripted `loadTransport`, which all go through the same place. -- **`OnTroopsReturned`**: troops given back to the pickup zone, once the stock has been restored. - -Payload of both: the troop group (for a return, every group handed back, one event each), the carrier unit's name, the player (the slot unit name for a player transport, empty for an AI one), the pickup zone's name, and a timestamp. - -A refused gesture publishes nothing: the zone is not available to the coalition, no stock, the aircraft cannot carry them, no troops to return. - -The events documentation (EN and FR) gets both events in the troop section. - -## Acceptance criteria - -- [ ] A successful load in a pickup zone publishes one `OnTroopsLoaded` with the group, the carrier, the player, the zone's name and a timestamp. -- [ ] The AI load and the scripted `loadTransport` publish it too, the AI one with an empty player. -- [ ] A successful return publishes one `OnTroopsReturned` per group returned, with the zone's name. -- [ ] No event on a refusal (zone not available, stock exhausted, transport limit, no troops on board). -- [ ] The new cases fail before the change and pass after it; the existing troop specs pass unchanged. -- [ ] `events.md` and `events.fr.md` list both events in the troop section, with the method that publishes each. -- [ ] `busted tests/ci/` green; luacheck clean; no new translation key. - -## Blocked by - -- [01 — A dropped troop group is announced](01-troops-unloaded.md) (the shared payload conventions and the documentation section) diff --git a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/03-troops-extracted-and-migration-guide.md b/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/03-troops-extracted-and-migration-guide.md deleted file mode 100644 index 63284bd3..00000000 --- a/.backlog/FEAT-TROOP-GESTURE-EVENTS/tickets/03-troops-extracted-and-migration-guide.md +++ /dev/null @@ -1,28 +0,0 @@ -# 03 — Extraction in the field is announced (`OnTroopsExtracted`), and the migration guide tells the truth - -**Status:** ✅ done (PR #311) · **Type:** AFK - -## Parent - -[PRD — FEAT-TROOP-GESTURE-EVENTS](../PRD.md). Stories 5, 7, 9, 10, 13, 14, 15, 16, 17. GitHub issue #308. - -## What to build - -- **`OnTroopsExtracted`**: a dropped group picked up in the field, at the end of a successful extraction. It covers the nearest-group extraction and the extraction of a chosen group. Payload: the troop group, the carrier unit's name, the player (the slot unit name for a player transport, empty for an AI one), and a timestamp. A refused extraction (in the air, no group nearby, transport full) publishes nothing. -- **The events documentation (EN and FR)**: the troop section lists the six events, with the method that publishes each. -- **The migration guide (EN and FR)**: its v1 → v2 example subscribes to `OnTroopsDeployed` for "Troops landed!". It is corrected to say that `OnTroopsDeployed` covers the **parachute** drop, and to use `OnTroopsUnloaded` for a drop on the ground. -- **The CHANGELOG** gets one `[Unreleased]` entry under "Added" for the lot, listing the four events and what they carry. - -## Acceptance criteria - -- [ ] A successful field extraction publishes one `OnTroopsExtracted` with the group, the carrier, the player and a timestamp; extracting a chosen group publishes it too. -- [ ] No event on a refusal; an AI transport's extraction publishes it with an empty player. -- [ ] The new cases fail before the change and pass after it; the existing troop specs pass unchanged. -- [ ] The troop section of `events.md` and `events.fr.md` lists the six events. -- [ ] The migration guide example, in both languages, no longer implies that `OnTroopsDeployed` fires on a ground drop and points at `OnTroopsUnloaded`. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in the PR that delivers the lot (the three tickets ship in one PR). - -## Blocked by - -- [02 — Loading in a pickup zone and returning to it are announced](02-troops-loaded-and-returned.md) diff --git a/.backlog/FIX-AA-CRATE-REGISTRY/tickets/01-consume-through-the-crate-manager.md b/.backlog/FIX-AA-CRATE-REGISTRY/tickets/01-consume-through-the-crate-manager.md deleted file mode 100644 index 7530f71a..00000000 --- a/.backlog/FIX-AA-CRATE-REGISTRY/tickets/01-consume-through-the-crate-manager.md +++ /dev/null @@ -1,27 +0,0 @@ -# 01 — AA repair and rearm consume their crate through the crate manager - -**Status:** ✅ done (PR #302) · **Type:** AFK - -## Parent - -[PRD — FIX-AA-CRATE-REGISTRY](../PRD.md). Stories 1-6. - -## What to build - -When a pilot repairs or rearms an AA system, the repair or launcher crate is consumed the way the assembly consumes its parts: through the crate manager's destroy, by crate name. The DCS object goes, the crate's entry leaves the registry, and `OnCrateCleared` (reason "destroyed") is published so the F10 unpack menu refreshes for the pilots nearby. - -The consumption stays after the creation of the new group (ADR 0028): a refused respawn keeps the crate and the damaged system, as today. Nothing else changes: messages, repair and rearm events, order of operations. - -## Acceptance criteria - -- [ ] Success of a repair: the repair crate is no longer in the crate manager's registry, and `OnCrateCleared` was published once for it with reason `destroyed`. -- [ ] Success of a rearm: the same for the launcher crate. -- [ ] The refusal cases (DCS refuses the new group) still keep the crate in the registry and publish nothing. -- [ ] The new cases fail before the change and pass after it; the existing AA cases pass unchanged. -- [x] The live scenario of FIX-CREATE-BEFORE-DESTROY asserts, in checks 4.3 and 5.2, that the registry entry is gone (replacing the "static destroyed" check and its comment). Run in DCS 2.9.30.28738 on 2026-11-09 with the build of `develop` at `a88b43f`: PASS 24/24, no ghost crate, no residue left in the mission. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in this PR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/tickets/01-tell-the-dropper-and-log-the-truth.md b/.backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/tickets/01-tell-the-dropper-and-log-the-truth.md deleted file mode 100644 index 342e003f..00000000 --- a/.backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/tickets/01-tell-the-dropper-and-log-the-truth.md +++ /dev/null @@ -1,32 +0,0 @@ -# 01 — Tell the dropper, and log the truth, when a parachuted equipment crate cannot be unpacked - -**Status:** ✅ done (PR #307) · **Type:** AFK - -## Parent - -[PRD — FIX-AUTO-UNPACK-SILENT-FAILURE](../PRD.md). Stories 1-12. GitHub issue #294. - -## What to build - -When a parachuted equipment crate lands and its equipment cannot be created, the pilot who dropped it reads why, and the log stops claiming a success. - -- At the drop, CTLD records on each parachuted crate the unit name of the pilot who dropped it (the *dropper*). It is empty by default and cleared when the crate is loaded again. -- On landing, the automatic unpack passes the crate's dropper as the player to the equipment creation, which already sends the DCS refusal and the JTAC-limit reason to a player that exists in the world, and does nothing for a name that does not. -- The log line "auto-unpack (parachute) EQUIPMENT" is written only when the equipment was created. Otherwise a WARNING says it was not created, the cause (the group refused by DCS, or nothing attempted) and that the crates were kept. -- A crate released by the DCS cargo system itself has no dropper: nobody is told, the WARNING is the only trace. - -When the equipment is created, nothing changes. - -## Acceptance criteria - -- [ ] A parachuted crate records the unit name of the pilot who dropped it, and loading it again clears it. -- [ ] A group refused by DCS, and the JTAC limit, are told to the dropper with the same wording as the menu path. -- [ ] A crate with no dropper tells nobody and logs the WARNING; a dropper who left the slot never raises an error. -- [ ] The unpack INFO line is written only on success; otherwise a WARNING names the cause and says the crates were kept. The success path is unchanged. -- [ ] The new cases fail before the change and pass after it; the existing cases pass unchanged. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in this PR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-CONFIG-LABELS-I18N-LANG/tickets/01-translate-the-labels-after-the-settings.md b/.backlog/FIX-CONFIG-LABELS-I18N-LANG/tickets/01-translate-the-labels-after-the-settings.md deleted file mode 100644 index 6b79fd0d..00000000 --- a/.backlog/FIX-CONFIG-LABELS-I18N-LANG/tickets/01-translate-the-labels-after-the-settings.md +++ /dev/null @@ -1,26 +0,0 @@ -# 01 — Translate the labels of the configuration after the settings are in place - -**Status:** ✅ done (PR #314) · **Type:** AFK - -## Parent - -[PRD — FIX-CONFIG-LABELS-I18N-LANG](../PRD.md). Stories 1-6. GitHub issue #310. - -## What to build - -Loading a configuration translates its labels (every `desc` and `name` string) into the language of the snapshot's own `i18n_lang`, not into the global language a host script may have aligned on the mission. - -The load fills the settings first and translates the labels afterwards, so the language lookup that every other text goes through can read the snapshot's `i18n_lang`. A snapshot that sets none keeps using the global language, and the default configuration (no snapshot) is unchanged. - -## Acceptance criteria - -- [ ] A snapshot with `i18n_lang: fr` and a global language `en` gives the French label. -- [ ] A snapshot with `i18n_lang: en` and a global language `fr` gives the English label. -- [ ] A snapshot with no `i18n_lang` falls back to the global language, unchanged; the default configuration (no snapshot) is unchanged. -- [ ] The new cases fail before the change and pass after it; the existing configuration specs pass unchanged. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in this PR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-CONFIG-NEW-LISTS/tickets/01-date-the-lists.md b/.backlog/FIX-CONFIG-NEW-LISTS/tickets/01-date-the-lists.md deleted file mode 100644 index 3caf85bf..00000000 --- a/.backlog/FIX-CONFIG-NEW-LISTS/tickets/01-date-the-lists.md +++ /dev/null @@ -1,11 +0,0 @@ -# 01 — date the lists, default the newer ones - -Status: done - -See the [PRD](../PRD.md). - -## Acceptance - -- A `2.2.0` snapshot without `fatCowCrates` reads the catalogue's crates, reported by `getDefaultedParameters()`. -- A `2.3.0` snapshot without it reads nothing; `aiZones` (not dated) stays removed at any version. -- `complete()` adds `fatCowCrates` to a `2.2.0` configuration, not to a `2.3.0` one. diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/01-helper-adr-and-vehicle-pack.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/01-helper-adr-and-vehicle-pack.md deleted file mode 100644 index 9362c27f..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/01-helper-adr-and-vehicle-pack.md +++ /dev/null @@ -1,38 +0,0 @@ -# 01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack - -**Status:** ✅ done (PR #300) · **Type:** AFK - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). Stories 1-3, 12-18, 20-21. GitHub issue #293. - -## What to build - -The foundation and its first user, end to end. - -- **The shared helper.** One way to create a batch of crates all-or-nothing, with the arguments of the existing aligned crate creation: when - every crate was created it returns them; when only some were, it removes those through the crate manager's own destroy (so `OnCrateCleared` - fires for each, reason `destroyed`) and returns nothing; when none were, nothing. -- **The vehicle pack.** *Pack Vehicle* creates the crates first. Only once they all exist does it deregister the vehicle's JTAC, destroy the unit, - and publish "ground unit removed". If the creation failed, the vehicle stays exactly where it was, still a registered JTAC if it was one; the - pilot reads "Pack failed: the crates could not be created." (an existing key in the four dictionaries) and an ERROR line is logged naming the - vehicle and the pilot's unit. No `OnVehiclePacked` is published on a failure. -- **`OnVehiclePacked`** publishes the number of crates actually created as `cratesSpawned`. -- **ADR 0028** (`dev/adr/0028-*.md`, plus its line in the ADR index): the rule "create the replacement first, destroy the original only once the - creation succeeded", the all-or-nothing choice and why, the non-destructive reads that move before the creation, and the stepped-scene - exception (PRD decision 3). -- **The backlog index** line of the lot in `.backlog/README.md` already exists ("in progress"); each delivering PR amends it, and the last one sets it to `merged (PR #NN)`. - -## Acceptance criteria - -- [ ] A refused creation (the crate creation double makes none of the crates) leaves the vehicle in place, tells the pilot "Pack failed: the crates could not be created.", logs an ERROR, publishes neither `OnVehiclePacked` nor "ground unit removed", and leaves a JTAC vehicle registered. -- [ ] A partial creation (some crates made) leaves no crate behind, the vehicle in place, and the same message and ERROR. -- [ ] The success path is unchanged for the pilot: same message "%1 packed into %2 crate(s).", same crate placement, same menu refresh. -- [ ] The existing test that freezes `cratesSpawned` to the requested count is rewritten to the created count; each new case fails before the change and passes after it. -- [ ] The helper has its own cases: all, some (rolled back, `OnCrateCleared` per removed crate), none. -- [ ] ADR 0028 written and indexed; no legacy-parity concern recorded on the success path. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; dictionaries unchanged (no new key) or regenerated by `merge_CTLD.ps1`. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/02-farp-scene-pack.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/02-farp-scene-pack.md deleted file mode 100644 index 39e303f3..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/02-farp-scene-pack.md +++ /dev/null @@ -1,32 +0,0 @@ -# 02 — FARP scene pack creates its crates before destroying the scene - -**Status:** ✅ done (PR #300) · **Type:** AFK - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). Stories 4, 5, 12, 16, 17, 19-21. - -## What to build - -*Pack * on a deployed FARP: the pilot ends up with the FARP's crates on the ground and the FARP gone, or — if DCS cannot create all the -crates — with the FARP still open, warehouse stock included. - -The scene manager's pack splits into its two halves: **capture** (the scene model's repack hook reads the live warehouse into a snapshot; it -changes nothing) and **destroy** (every spawned object goes, the scene leaves the active set). The pack command captures first, creates the -crates through the helper of ticket 01, gives each created crate the snapshot, and only then destroys the scene. A failed creation leaves the -scene active and untouched; the pilot reads "Pack failed: the crates could not be created." and an ERROR is logged naming the scene and the unit. - -A pack whose scene model carries no repack hook, or no crate definition, behaves as today. - -## Acceptance criteria - -- [ ] A refused or partial creation leaves the scene deployed, its objects and warehouse intact, no crate on the ground, the message and an ERROR; the scene is still in the active set and can be packed again. -- [ ] On success the crates carry the warehouse snapshot taken before the destruction, as today, and the message "FARP packed successfully!" is unchanged. -- [ ] The partial-count message and its WARNING added by PR #268 are retired, since a partial creation can no longer happen; the key may stay in the dictionaries. -- [ ] A scene that fails midway through its own deployment, and every other caller of the scene manager's pack, still destroy as before. -- [ ] New cases in the FARP pack spec fail before the change and pass after it; existing cases pass unchanged. -- [ ] CHANGELOG, `busted tests/ci/` green, luacheck clean, dictionaries regenerated if a key changed; the lot's index line amended. - -## Blocked by - -- [01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack](01-helper-adr-and-vehicle-pack.md) (the helper) diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/03-fat-cow-farp-pack.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/03-fat-cow-farp-pack.md deleted file mode 100644 index 4ada64f8..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/03-fat-cow-farp-pack.md +++ /dev/null @@ -1,33 +0,0 @@ -# 03 — Fat Cow FARP pack creates its crates before closing the FARP - -**Status:** ✅ done (PR #300) · **Type:** AFK - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). Stories 6, 7, 12, 16, 17, 19-21. - -## What to build - -*Pack the Fat Cow FARP* from a landed piloted cow: the FARP's remaining stock becomes cow crates on the ground next to the cow and the FARP -closes, or — if the crates cannot all be created — the FARP stays open with its stock. - -The order becomes: read the warehouse back into the cow's stock (a read, nothing is changed) → split that stock into the crates that carry it -→ create them through the helper of ticket 01 → only then empty the FARP, remove its scene, free its name and forget the piloted cow. - -- A stock that no `fatCowCrates` entry can carry no longer ends as "lost": the FARP is kept, an ERROR is logged naming the missing kind, and the - pilot is told the pack failed. -- An empty FARP (nothing to carry) still packs and closes, and gives no crate, as today. -- Anyone of the coalition may still pack the FARP; the distance rule and the message of a successful pack are unchanged. - -## Acceptance criteria - -- [ ] A refused or partial creation leaves the FARP open, its warehouse holding what the players left, its name still taken, and no crate on the ground; the pilot reads "Pack failed: the crates could not be created." -- [ ] A stock no crate entry carries leaves the FARP open with an ERROR; it is never logged as lost. -- [ ] On success the crates carry exactly the stock read back (full crates, a part-full last one of each kind), the FARP is closed and its name freed, as today. -- [ ] An empty FARP packs with no crate and closes. -- [ ] New cases in the Fat Cow spec fail before the change and pass after it; existing cases pass unchanged. -- [ ] CHANGELOG, `busted tests/ci/` green, luacheck clean, dictionaries regenerated if a key changed; the lot's index line amended. - -## Blocked by - -- [01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack](01-helper-adr-and-vehicle-pack.md) (the helper) diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/04-unpack-to-a-unit.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/04-unpack-to-a-unit.md deleted file mode 100644 index 3119c5a7..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/04-unpack-to-a-unit.md +++ /dev/null @@ -1,36 +0,0 @@ -# 04 — Unpacking crates into a unit keeps the crates until the unit exists - -**Status:** ✅ done (PR #300) · **Type:** AFK - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). Stories 8, 9, 16, 19-21. - -## What to build - -Unpacking crates into a vehicle, a static or a JTAC — by the *Unpack Crate* menu command and by the auto-unpack when a parachuted load lands — -creates the equipment first and consumes the crates only once it exists. - -Today the crate manager's unpack marks the crates unpacked, publishes `OnCrateUnpacked` and `OnCrateCleared`, and destroys the statics before the -caller asks DCS for the equipment; a refusal leaves the pilot with neither. The equipment creation reports one of three outcomes: created, -refused by DCS (the group is already told), or nothing attempted (missing data, JTAC drop disabled, JTAC limit reached). Only "created" -consumes the crates; the two others leave them on the ground, so the pilot can unpack again or move them. - -- The `OnCrateUnpacked` and `OnCrateCleared` events are published when the crates are really consumed, not before. -- Messages: those of PR #267 stay (a refusal or limit is already reported to the group; success only on a created equipment), and so does the log line `_spawnUnpacked` already writes on a refusal (a WARNING naming the type, country and coalition). -- The other unpack paths that start a stepped scene (FOB, FARP, any scene) are **out of scope** (PRD decision 3) and keep their order. -- The AA-system assembly path is ticket 05. - -## Acceptance criteria - -- [ ] Equipment refused by DCS: the crates are still on the ground and registered, no `OnCrateUnpacked` / `OnCrateCleared`, the pilot reads the refusal and not "unpacked successfully". -- [ ] Nothing attempted (JTAC limit, JTAC drop disabled, no spawn position): the crates stay too. -- [ ] Created: the crates are consumed and the events published, as today; "%1 unpacked successfully!" unchanged. -- [ ] The same holds for the auto-unpack of a parachuted equipment crate. -- [ ] A multi-crate descriptor consumes all its crates or none. -- [ ] New cases in the unpack specs fail before the change and pass after it; existing cases pass unchanged. -- [ ] CHANGELOG, `busted tests/ci/` green, luacheck clean, dictionaries regenerated if a key changed; the lot's index line amended. - -## Blocked by - -- [01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack](01-helper-adr-and-vehicle-pack.md) (ADR 0028 only; this ticket needs no helper, so it may start once the ADR is written) diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/05-aa-system-rearm-repair.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/05-aa-system-rearm-repair.md deleted file mode 100644 index d26e9be5..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/05-aa-system-rearm-repair.md +++ /dev/null @@ -1,33 +0,0 @@ -# 05 — AA system rearm and repair keep the old system until the new one exists - -**Status:** ✅ done (PR #300) · **Type:** AFK - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). Stories 10, 11, 16, 19-21. - -## What to build - -Rearming or repairing an AA system respawns it at the same positions, types and headings. It now creates the new group first; only when it -exists does it destroy the old group, consume the rearm or repair crate, and replace the system in the manager's list of complete systems. - -The same holds for the **assembly of a new system** from its crates: the group is spawned first and the crates are consumed only once it exists. - -If the respawn fails the damaged system stays standing, still in the list, the crate stays on the ground, an ERROR is logged, and the -pilot is told the action failed, with the existing message "Unpack failed: the equipment could not be created." (no new key). -A refused rearm is reported as handled, so the same crates are not then used to assemble a second system. -The success path — the rearmed/repaired events, the coalition message — is unchanged. - -The new group is created while the old one still stands on the same spots; DCS must accept it. If the live check shows it does not, this ticket -returns to the maintainer with the measurement instead of working around it. - -## Acceptance criteria - -- [ ] Respawn refused on a rearm or a repair: the old group is untouched and still tracked, the crate is still there, no "rearmed" / "repaired" event, an ERROR, the pilot is told. -- [ ] On success the old group and the crate are destroyed after the new group exists; the new system is tracked; events and message as today. -- [ ] Both `_rearm` and `_repair` covered, each with a refusal case that fails before the change and passes after it. -- [ ] CHANGELOG, `busted tests/ci/` green, luacheck clean, dictionaries regenerated if a key changed; the lot's index line amended. - -## Blocked by - -- [01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack](01-helper-adr-and-vehicle-pack.md) (ADR 0028 only) diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/06-live-check.md b/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/06-live-check.md deleted file mode 100644 index f689ff2c..00000000 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/tickets/06-live-check.md +++ /dev/null @@ -1,43 +0,0 @@ -# 06 — Live check in DCS - -**Status:** ✅ done — automated checks PASS and the hand test in the CH-47F cockpit confirmed by the maintainer (2026-11-09) · **Type:** HITL - -## Parent - -[PRD — FIX-CREATE-BEFORE-DESTROY](../PRD.md). - -## What to build - -Verify in a running mission what the unit tests cannot: DCS cannot be made to refuse a creation without tampering, so the check is that the -**success path of each site is unchanged**, and that the AA respawn on top of the old group works. - -Through the DCS bridge's Python scenario runner (never the MCP tool), on `Test_CTLDNEXT_01.miz`, with a scenario per site under `tests/dcs/` -(from the template, tier header set), keeping clear of any live player unit when spawning: - -1. Pack a vehicle (a JTAC one too: it must stop being a JTAC only once packed), then unpack its crates again. -2. Pack a deployed FARP scene and redeploy it: the warehouse stock comes back from the crates. -3. Deploy a piloted Fat Cow FARP, pack it, deploy again: the stock matches. -4. Unpack an equipment crate and a parachuted crate (auto-unpack). -5. Repair and rearm an AA system: the new group appears over the old one, which then goes; no ghost unit, no double system. - -The maintainer plays one pack by hand in the cockpit (a CH-47F pack of a vehicle) to confirm what the pilot reads. - -## Result (2026-11-09, DCS 2.9.30.28738 mission `Test_CTLDNEXT_01.miz`, CTLD built from `fix/FIX-CREATE-BEFORE-DESTROY`) - -Two scenarios, driven over the bridge's HTTP API with a mock transport 3 km from the player, real DCS objects, cleaned up afterwards: - -- `tests/dcs/noPlayer/scenario_create_before_destroy.lua` (CBD): **PASS 24/24**. Pack Vehicle (3 crates, `cratesSpawned` 3, Humvee gone), unpack of the parachuted crates into a vehicle, AA assembly, repair and rearm of a KUB system. - The new AA group is spawned over the old one and DCS accepts it; the old group is then destroyed, one system is left. -- `tests/dcs/noPlayer/scenario_create_before_destroy_farp.lua` (CBD2): **PASS 12/12**. A Countryside FARP packed through the real F10 *Pack Equipt* callback (crates with the warehouse snapshot, scene gone), and a piloted Fat Cow FARP packed (the fuel crate carries 2 400 kg, cow forgotten, FARP emptied). - -Found on the way, **not caused by this lot**: after an AA repair or rearm the crate is destroyed with `crate:destroy()`, which leaves its registry entry behind, and an entry with no DCS static counts as on the ground (a ghost crate); and the Countryside FARP's guard and repair-truck groups survive its pack. - -## Acceptance criteria - -- [x] Each of the five checks recorded PASS or FAIL with the DCS log lines that prove it. -- [x] AA respawn overlap: no error in the DCS log, one system left, the repair crate static destroyed. -- [x] The maintainer confirms the hand test (Zip, 2026-11-09); the lot's index line and PRD status are set to done. - -## Blocked by - -- [01](01-helper-adr-and-vehicle-pack.md), [02](02-farp-scene-pack.md), [03](03-fat-cow-farp-pack.md), [04](04-unpack-to-a-unit.md), [05](05-aa-system-rearm-repair.md) diff --git a/.backlog/FIX-FARP-PACK-FALSE-SUCCESS/tickets/01-report-the-crates-created.md b/.backlog/FIX-FARP-PACK-FALSE-SUCCESS/tickets/01-report-the-crates-created.md deleted file mode 100644 index 96118874..00000000 --- a/.backlog/FIX-FARP-PACK-FALSE-SUCCESS/tickets/01-report-the-crates-created.md +++ /dev/null @@ -1,23 +0,0 @@ -# 01 — Report how many crates the FARP pack created - -**Status:** ✅ done (PR #268) · **Type:** AFK - -## Parent - -[PRD — FIX-FARP-PACK-FALSE-SUCCESS](../PRD.md). Stories 1-6. GitHub issue #263. - -## What to build - -In the Pack command, read the number of crates created and announce it: failure (none), partial (some), or the existing message (all), -with an ERROR / WARNING log. Add the two messages and translate FR, ES, KO. Tests first in the pack spec. Then CHANGELOG, backlog index, PR. - -## Acceptance criteria - -- [ ] New cases fail before the change and pass after it; the existing pack cases pass unchanged. -- [ ] No crate created: failure message and ERROR log, no "packed successfully". -- [ ] Some crates created: the partial message with the counts and a WARNING log. -- [ ] Dictionaries regenerated by `merge_CTLD.ps1`, FR/ES/KO translated; luacheck clean; `busted` green; CHANGELOG entry. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-FAT-COW-AI-LANDING/tickets/01-clearing-and-vanished-cow.md b/.backlog/FIX-FAT-COW-AI-LANDING/tickets/01-clearing-and-vanished-cow.md deleted file mode 100644 index 2772d172..00000000 --- a/.backlog/FIX-FAT-COW-AI-LANDING/tickets/01-clearing-and-vanished-cow.md +++ /dev/null @@ -1,22 +0,0 @@ -# 01 — land in a clearing, forget a vanished cow - -Status: done - -See the [PRD](../PRD.md). - -## Acceptance - -- The Land task point is the nearest `Disposition.getSimpleZones` candidate within 300 m of the point 120 m left of the leader, at the widest clearance (100, 50, 30 m) that offers one, on land and at least 60 m from the leader; the asked point when there is none or the call fails. -- An AI cow whose unit no longer exists is forgotten within 10 s, as if it had died: its flight can request another cow. - -## Live check (Zip, then Claude drives) - -Kit: `Test_FatCow_Takeover.miz` in Zip's `Saved Games\DCS\Missions` (not in the repository: it embeds a built `CTLD.lua` and `dcs-bridge.lua`), rebuilt with this branch's `CTLD_fatCow.lua` spliced into the `dev` build (`ctld.VERSION` `2.0.0-rc15-f49c6c7+ai-landing-2`). - -1. Claude starts `dcs-serve` (`tools/dcs-bridge/venv/Scripts/dcs-serve.exe --config dcs-serve.yaml`, from the main checkout). -2. Zip opens the mission, slot **Gunfighter**, stays on the ground, no pause. -3. Claude injects a probe (cow state every second, every event naming the cow) and re-injects `tests/dcs/pilotPassive/scenario_fatcow_takeover.lua` every 20 s until PASS / FAIL / ABORT. - -Expected: the cow lands at Hawk's first stop and lives; the scenario then runs the FEAT-FAT-COW-TAKEOVER take-over, release and RTB, and passes. - -Result (2026-10-30): **PASS**. The cow landed in a clearing at Hawk's first stop, 1284 m from home, with no hit (life 58/58 throughout), and opened its FARP. Once Hawk was gone it lifted off 20 s after the re-task; Viper took it over from 3 km, released it, took it back, and sent it RTB; it despawned on landing 2 m from home, 141 s after the RTB. Hawk never leaves its first stop, so the scenario's step 1 now waits for a FARP more than 1 km from home instead of 2.5 km. diff --git a/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/01-probe-the-real-search-output.md b/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/01-probe-the-real-search-output.md deleted file mode 100644 index b37ca625..00000000 --- a/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/01-probe-the-real-search-output.md +++ /dev/null @@ -1,54 +0,0 @@ -# 01 — Check the real output of the clearing search - -**Status:** ✅ done (probe of 2026-11-18, PR #316) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-CLEARING-LOG](../PRD.md). Story 14. GitHub issue #299. - -## What to build - -A one-off, read-only probe of the real `Disposition.getSimpleZones`, run over the DCS bridge's HTTP API on the mission that is loaded (no mission reload, nothing created), so that the definition of a *well-formed candidate* used by ticket 02 rests on what DCS really returns and not on the code's assumption ("a candidate may be a vec2"). - -- Call the search near a point of the map far from the player, with the three clearances the cow uses (100, 50 and 30 m), a 300 m radius and 10 attempts, as `clearingAt` does. -- Record, for each call: whether the call succeeded, the type of what it returned, the number of candidates, and the exact shape of the first candidate (its type, its keys, vec2 or vec3, `x`/`z` or `x`/`y`). -- Say whether the points the code reads (a table with `x` and a `z`, else a `y`) are what DCS returns. -- If the real shape differs from that assumption, say what it is: ticket 02 then adjusts the definition of *well-formed* before it is written into the tests. - -The probe script stays in the scratchpad; its output is pasted in this ticket. Nothing is committed but the ticket. - -## Acceptance criteria - -- [x] The probe ran against the live mission and its output (return type, candidate count, shape of the first candidate, for each clearance) is recorded in this ticket. -- [x] The ticket states whether the code's assumption about a candidate holds on the real output, and the definition of *well-formed* ticket 02 must use. -- [x] No group, object, setting or timer was created or changed in the mission. - -## Blocked by - -None - can start immediately. - -## Result — probe of 2026-11-18 - -Run over the DCS bridge's HTTP API on `Test_CTLDNEXT_01.miz` (CTLD of the `develop` build loaded; the probe reads nothing of CTLD): `Disposition.getSimpleZones(point, 300, clearance, 10)` with a vec3 point, as `clearingAt` calls it, at four sites 6 to 11 km from the BLUE player, at the three clearances. The singleton exists (`type(Disposition) = table`, `getSimpleZones` is a function) and **12 calls out of 12 succeeded and returned a table**. - -| Clearance | Returns, over the four sites | -| --- | --- | -| 100 m | `#r` = 0, 0, 0, 7 | -| 50 m | `#r` = 0, 9, 10, 5 | -| 30 m | `#r` = 0, 10, 10, 10 | - -(A site over the sea gave 0 at every clearance. `#r` and the number of `pairs` agree: the table is a plain sequence.) - -The shape of a candidate, identical in every sample (first and second entries): - -``` -table{course=number(0), x=number(-355930.0625), y=number(626050.625)} -``` - -- A candidate is a **vec2 with a `course`**: `x` and `y`, where **`y` is the map's z**; there is no `z` key. The code's reading (`x`, and `z` else `y`) is therefore right, and its comment "a candidate may be a vec2" is in fact the only case seen. -- The candidates are **not limited to the radius** that was asked: the first candidate was 77, 67, 640, 895, 907, 103 and 60 m from the asked point, so points beyond 300 m do come back, and the existing filter (`d <= 300`) does reject real candidates. A well-formed list whose candidates are all rejected, the benign "no clearing", is therefore a realistic outcome and not a corner case. -- They are not sorted by distance (the first one is not the nearest), which the existing code already handles by picking the nearest. - -**Verdict.** The code's assumption holds on the real output. The definition of *well-formed* for ticket 02: **a table whose `x` is a number and whose `z`, else `y`, is a number.** (Requiring numbers is the only refinement: today a non-numeric coordinate would raise inside the distance arithmetic, outside any `pcall`; it will count as malformed instead. For every real candidate the choice of the point is unchanged.) A well-formed list that comes back empty, or all rejected, is benign; the shape `WARN` must not fire on the real output seen here. - -Nothing was created or changed in the mission: no group, object, timer or setting. The probe script stayed in the scratchpad. diff --git a/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/02-log-the-clearing-search.md b/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/02-log-the-clearing-search.md deleted file mode 100644 index 31809fef..00000000 --- a/.backlog/FIX-FAT-COW-CLEARING-LOG/tickets/02-log-the-clearing-search.md +++ /dev/null @@ -1,37 +0,0 @@ -# 02 — The clearing search leaves a trace when it cannot do its job - -**Status:** ✅ done (PR #316) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-CLEARING-LOG](../PRD.md). Stories 1 to 13 and 15. GitHub issue #299. - -## What to build - -When the AI cow cannot land in a clearing, the log says why. The search tells its caller which of five outcomes it got, and both landing paths of the cow (its flight landing, and "Land here") log it. The point the cow lands on does not change in any case. - -- **Found**: unchanged, the existing "lands in a clearing" line. -- **Singleton missing**: a `WARN`, once per mission, naming the cow. -- **Error raised**: a `WARN`, once per mission, carrying the error as it was raised. -- **Wrong shape**: a `WARN`, once per mission, saying what came back: something that is not a table, or a non-empty table none of whose entries is a well-formed point. The definition of *well-formed* is the one the probe of ticket 01 confirmed on the real output: a table whose `x` is a number and whose `z`, else `y`, is a number (real candidates are vec2 `{ x, y, course }`, `y` being the map's z). -- **No clearing**: an `INFO` at every landing, when the table is empty or every well-formed candidate is rejected by the filters (too close to the leader, in water, out of range) at the three clearances. It is the benign outcome and never a `WARN`. - -The three `WARN` causes (missing, error, shape) are tracked independently, so that a first cause does not hide a later, different one. The exact texts are those of the PRD, in English and untranslated. - -A `CHANGELOG` *Fixed* entry under `[Unreleased]` records it. No configuration key: no `configVersion` change, no catalogue shape, no dictionary regeneration. - -## Acceptance criteria - -- [x] With the singleton missing, a landing logs the `WARN` naming the cow; a second landing in the same mission does not log it again. -- [x] With a search that raises an error, the `WARN` carries the error text, once per mission. -- [x] With a return that is not a table, the shape `WARN` names its type; with a non-empty list of malformed entries, the shape `WARN` is logged; each once per mission. -- [x] With an empty list, and with well-formed candidates that are all rejected, an `INFO` "no clearing" is logged at every landing and no `WARN`. -- [x] The three `WARN` causes are independent (an error does not silence a later shape warning). -- [x] The success case still logs its line, and neither a `WARN` nor the "no clearing" line. -- [x] Both landing paths log alike, and the landing point is the same as before in every case (the existing assertions stay green). -- [x] The new cases fail before the change, for the right reason (nothing is logged today), and pass after it. -- [x] `busted tests/ci/` green; luacheck clean; the `CHANGELOG` entry is there. - -## Blocked by - -- [01 — Check the real output of the clearing search](01-probe-the-real-search-output.md) (the definition of *well-formed*; if DCS cannot be reached, this ticket may start on the code's assumption and the probe confirms it afterwards) diff --git a/.backlog/FIX-FAT-COW-DEPLOY-REFUSALS/tickets/01-report-a-refused-deployment.md b/.backlog/FIX-FAT-COW-DEPLOY-REFUSALS/tickets/01-report-a-refused-deployment.md deleted file mode 100644 index cfb117b6..00000000 --- a/.backlog/FIX-FAT-COW-DEPLOY-REFUSALS/tickets/01-report-a-refused-deployment.md +++ /dev/null @@ -1,39 +0,0 @@ -# 01 — The AI cow's deployment timer reports a refused deployment - -**Status:** ✅ done (PR #319) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-DEPLOY-REFUSALS](../PRD.md). Stories 1 to 16. GitHub issue #296. - -## What to build - -When an AI cow lands and the deployment that follows the delay is refused, the flight is told and the log says why. The timer reads the answer of the deployment instead of throwing it away. - -- **Per reason.** - - *empty*: a dedicated message to the flight ("The Fat Cow is empty: send it home with RTB."), and a warning line in the log. - - *airborne*, *scene*, *unknown*: the existing message "The Fat Cow FARP could not be deployed.", and a warning line that names the reason. - - *deployed*: no message, an information line. - - *failed*: unchanged. The scene's failure path has already told the audience; the timer adds no second message. -- **Who is told.** The flight the cow serves, and only if it still exists. The log line is written in every case, with the cow's name and the reason (the exact lines are those of the PRD, in English and untranslated). -- **Nothing else changes.** The nominal path is untouched (a cow with stock deploys with no warning and no refusal message). There is no immediate refusal in **Land here** for an empty cow, and an empty cow is not sent home when it folds its FARP. -- **The new text.** The empty-cow message is one literal passed to the translation function, naming the **RTB** command as each language's menu does. The dictionaries are regenerated by the build; French and Spanish are provided, Korean is written by the assistant and flagged for review in the pull request. -- **The documentation.** One sentence in the pilot guide (English and French), by the **Land here** command: a cow with nothing left opens no FARP, and the flight is told when the delay runs out, with the advice to send it home with **RTB**. -- **The CHANGELOG** records it under *Fixed*. No configuration key: no `configVersion` change, no catalogue shape. - -## Acceptance criteria - -- [x] After the delay, an empty cow tells the flight "The Fat Cow is empty: send it home with RTB." and logs a warning that names the reason. -- [x] A cow that is airborne, whose scene did not start, or that is no longer registered tells the flight "The Fat Cow FARP could not be deployed." and logs a warning that names the reason. -- [x] A cow already deployed when the delay runs out tells the flight nothing and logs an information line. -- [x] A deployment that failed (its FARP or fuel depot could not be added) gives the flight exactly one message, the scene's; the timer adds none. -- [x] When the flight no longer exists, no message is sent and the line is logged. -- [x] A cow with stock deploys as before, with no warning and no refusal message; the existing nominal and cancellation tests pass unchanged. -- [x] The new cases fail before the change, for the right reason (nothing is said and nothing is logged), and pass after it. -- [x] The dictionaries are regenerated and the new text has French and Spanish translations; the Korean one is flagged for review. -- [x] The pilot guide (English and French) says that a cow with nothing left opens no FARP, and the `CHANGELOG` entry is there. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-FAT-COW-EMPTY-AI-TYPE/tickets/01-keep-the-menu-with-an-empty-type.md b/.backlog/FIX-FAT-COW-EMPTY-AI-TYPE/tickets/01-keep-the-menu-with-an-empty-type.md deleted file mode 100644 index e1483d7e..00000000 --- a/.backlog/FIX-FAT-COW-EMPTY-AI-TYPE/tickets/01-keep-the-menu-with-an-empty-type.md +++ /dev/null @@ -1,32 +0,0 @@ -# 01 — The Fat Cow menu stays when `fatCowAIType` is empty - -**Status:** ✅ done (PR #318) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-EMPTY-AI-TYPE](../PRD.md). Stories 1 to 15. GitHub issue #297. - -## What to build - -An empty `fatCowAIType` removes only **Request a Fat Cow**, as the guide and the editor already say, and the rest of the Fat Cow menu stays for the pilots a cow serves. - -- **The menu.** The guard that returns when the type is empty no longer sits at the top of the AI cow menu. The **Fat Cow** submenu and every command are built as before, and only the **Request a Fat Cow** submenu, with the loadout commands under it, is left out when the type is empty. Land here, Take off, Hold here, Join us, Fat Cow status, FARP status, RTB, Release the Fat Cow and, when a cow can be taken over, Take over a Fat Cow stay, with their labels and order unchanged. A flight with no cow still gets "Your flight has no Fat Cow." from the commands that need one. -- **The texts.** Four places say what an empty value does, and are made complete: the mission maker's guide in English and in French, and the description of the setting in the `ctld-tools` schema in English and in French. They say that **Request a Fat Cow** alone disappears and that the other commands stay, because a cow placed in the mission (`fatCowAICows`) needs no type and **FARP status** needs no AI cow; the exact words are those of the PRD. The pilot guide (English and French) is read, and adjusted only if it claims something this contradicts. -- **No configuration change.** No new key, no `configVersion` change, no catalogue shape (a schema description is not part of it), and no dictionary change (the menu labels are untouched). The build is run before the pull request to confirm there is no drift. -- **The CHANGELOG** records it under *Fixed*. - -## Acceptance criteria - -- [x] With an empty `fatCowAIType`, a helicopter flight with no cow sees the Fat Cow submenu with FARP status, Land here, Take off, Hold here, Join us, Fat Cow status, RTB and Release the Fat Cow, and neither **Request a Fat Cow** nor its loadout commands. -- [x] With the default type the menu is unchanged, **Request a Fat Cow** included. -- [x] With an empty type, **Take over a Fat Cow** still appears when a cow can be taken over. -- [x] With an empty type and a cow placed by the mission, the pilot's **Land here** reaches the cow, which lands. -- [x] With an empty type and no cow, **Fat Cow status** and **Land here** answer "Your flight has no Fat Cow.". -- [x] The new cases fail before the change, for the right reason (the whole menu is absent), and pass after it; the other Fat Cow specs pass unchanged. -- [x] The mission maker's guide (English and French) and the description of the setting in the schema (English and French) say that only **Request a Fat Cow** disappears and why the other commands stay; the pilot guide is consistent with them. -- [x] No catalogue shape or dictionary changes after the build; the `CHANGELOG` entry is there. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-FAT-COW-GROUND-TEST/tickets/01-ask-the-shared-ground-helper.md b/.backlog/FIX-FAT-COW-GROUND-TEST/tickets/01-ask-the-shared-ground-helper.md deleted file mode 100644 index ad9691e5..00000000 --- a/.backlog/FIX-FAT-COW-GROUND-TEST/tickets/01-ask-the-shared-ground-helper.md +++ /dev/null @@ -1,33 +0,0 @@ -# 01 — The Fat Cow asks the shared helper whether it is on the ground - -**Status:** ✅ done (PR #320) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-GROUND-TEST](../PRD.md). Stories 1 to 12. GitHub issue #295. - -## What to build - -The Fat Cow code asks `ctld.utils.inAir`, as the rest of CTLD does, instead of DCS's raw `inAir()`, at its three places. A landed CH-47 is then on the ground for the cow, whatever DCS's raw answer. - -- **Deploying the FARP.** A cow that has landed deploys, AI or piloted. A cow really in the air is still refused with the reason "airborne". -- **Land here.** A flight whose cow is already on the ground reads "The Fat Cow is already on the ground." and the cow is not re-tasked. A cow really in the air is still sent to land. -- **Release the Fat Cow.** A landed cow stays where it is, its FARP open, with no orbit task. A cow really in the air still orbits where it stands. -- **Nothing else changes.** Messages, labels and order are unchanged, and so is the mine field scene (two raw calls of its own, out of scope). The shared helper and its threshold are not touched. -- **The tests.** The existing AI cow and piloted cow specs stub DCS's `inAir()` and the shared helper on the same flag, so they cannot tell them apart. The new cases use a unit for which they disagree, the CH-47 at rest: its raw `inAir()` says "in the air" while the helper says "on the ground". -- **The CHANGELOG** records it under *Fixed*. No text, no dictionary, no configuration key, no catalogue shape. No live check and no probe: the pull request says that DCS's behaviour for the CH-47 was not re-measured. - -## Acceptance criteria - -- [x] An AI cow that has landed deploys its FARP when the delay expires, with a unit whose raw `inAir()` says "in the air" and whose helper says "on the ground". -- [x] A piloted cow, landed, with cow crates in its hold, deploys its FARP from **Deploy the Fat Cow FARP** and the pilot does not read "The Fat Cow FARP could not be deployed.". -- [x] **Land here** on a landed cow answers "The Fat Cow is already on the ground." and gives the cow no new landing task. -- [x] **Release the Fat Cow** on a landed cow gives it no orbit task and leaves its FARP open. -- [x] A cow really in the air (both answers say so) is still refused by the deployment as "airborne", is still sent to land by **Land here**, and still orbits when released. -- [x] The new cases fail before the change, for the right reason (the landed cow is taken for airborne), and pass after it; the other Fat Cow specs pass (one existing mock, which lacked a velocity, is completed now that the deployment reads it). -- [x] The `CHANGELOG` entry is there; no dictionary, text or configuration change. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-FAT-COW-HELICOPTERS-ONLY/tickets/01-helicopters-only.md b/.backlog/FIX-FAT-COW-HELICOPTERS-ONLY/tickets/01-helicopters-only.md deleted file mode 100644 index ab85ddd3..00000000 --- a/.backlog/FIX-FAT-COW-HELICOPTERS-ONLY/tickets/01-helicopters-only.md +++ /dev/null @@ -1,10 +0,0 @@ -# 01 — the AI Fat Cow menu and request, helicopters only - -Status: done — 2026-11-04 (PR #285); verified in game by Zip, 2026-11-05 - -See the [PRD](../PRD.md). - -## Acceptance - -- An A-10 (an `AIRPLANE` unit) gets no Fat Cow menu section; an AH-64D gets "Request a Fat Cow". -- `requestAICow` from an A-10 creates no cow. diff --git a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/01-number-the-cows.md b/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/01-number-the-cows.md deleted file mode 100644 index c8922e62..00000000 --- a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/01-number-the-cows.md +++ /dev/null @@ -1,30 +0,0 @@ -# 01 — Every AI cow has a number, and the announcements name it - -**Status:** ✅ done (PR #317) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-TAKEOVER-LABELS](../PRD.md). Stories 6, 7, 9, 10, 11, 12 and 18 (the announcement texts). GitHub issue #298. - -## What to build - -Give every AI Fat Cow a stable number, and let the messages that tell a flight about a free cow name it, so that ticket 02 can name the entries of the "Take over a Fat Cow" list the same way. - -- **The number.** Every AI cow gets a number when it is registered, drawn from the counter that already numbers the group names of requested cows ("Fat Cow #N"). A requested cow keeps exactly the number of its group name. A cow placed by the mission (`fatCowAICows`) takes the next number when it is activated, in the order of that list. The number is kept on the cow and never changes. Neither the group name of a requested cow nor the group name a mission maker gave a placed cow changes, and the latter is never shown to pilots. -- **The announcements.** The three messages sent to the flights that could take a cow over (released; lost its flight and going home to a base; lost its flight and going home) name the cow with its number, in the words of the PRD ("Fat Cow #3 lost its flight and is going home to Akrotiri: 12.4 km at 270° from you, with …"). They keep their distance and bearing. -- **The texts.** The three messages are changed texts, each a single literal passed to the translation function. The dictionaries are regenerated by the build; French and Spanish are provided, Korean is written by the assistant and flagged for review in the pull request. - -## Acceptance criteria - -- [x] A cow requested by a flight carries the number found in its group name. -- [x] A cow placed by the mission carries the next number from the same counter, and several placed cows are numbered in the order of `fatCowAICows`; the numbers of requested cows created afterwards go on from there, with no number used twice. -- [x] The number of a cow does not change while it exists. -- [x] The group name of a requested cow, and the group name of a placed cow, are unchanged. -- [x] Each of the three announcements names the cow with its number and keeps its distance, bearing and stock. -- [x] The new cases fail before the change (the cows have no number, the messages do not name it) and pass after it; the other Fat Cow specs pass unchanged. -- [x] The dictionaries are regenerated and the new texts have French and Spanish translations; the Korean ones are flagged for review. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/02-stable-take-over-list.md b/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/02-stable-take-over-list.md deleted file mode 100644 index d6c8ae7e..00000000 --- a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/tickets/02-stable-take-over-list.md +++ /dev/null @@ -1,36 +0,0 @@ -# 02 — The "Take over a Fat Cow" list holds still - -**Status:** ✅ done (PR #317) · **Type:** AFK - -## Parent - -[PRD — FIX-FAT-COW-TAKEOVER-LABELS](../PRD.md), [ADR 0027](../../../dev/adr/0027-stable-f10-entries.md). Stories 1 to 5, 8 and 13 to 20. GitHub issue #298. - -## What to build - -The list a pilot reads stops changing under their finger, and a click always reaches the cow the entry names. - -- **Labels.** One entry per cow that can be taken over, named "Fat Cow #N — waiting" (released), "Fat Cow #N — going home to " or "Fat Cow #N — going home" (no base known), with the cow's number from ticket 01. No distance, nothing that moves between two events. -- **Order.** By cow number, ascending, whatever the distances. "Nearest first" is dropped. -- **No periodic refresh.** The timer that rebuilds the menus every 30 s, its period, the function it calls and the parameter that limited a rebuild to the candidate pilots (used only by that function) are removed. The menus are still rebuilt by every event that changes the cows that can be taken over (a cow destroyed or vanished, its arrival at home, its return home, its release, a take-over); nothing else is needed, and a click on an entry whose cow is gone still answers "This Fat Cow is no longer available." -- **The texts.** The three labels are changed texts, each a single literal passed to the translation function; dictionaries regenerated by the build, French and Spanish provided, Korean flagged for review. -- **The tests.** A regression test against the `missionCommands` double that recycles ids as DCS does (the one of the stable-entries spec), red first: two successive refreshes with a cow that came closer, and no entry created or removed. The existing assertions on the old labels with a distance, and the test that the distances are updated every so often, assert the behaviour being removed: they are rewritten. -- **The documentation.** The pilot guide (English and French) describes the list as it now is: one stable entry per cow, in the order of their numbers, named with its number and state; the distance comes in the message the flight receives and in the confirmation of the take-over. The mission maker's page that mentions the take-over is adjusted only if it claims the distance. -- **The CHANGELOG** records it under *Fixed*. No configuration key: no `configVersion` change, no catalogue shape. - -## Acceptance criteria - -- [x] Two successive refreshes of the list, with a cow that came closer in between, create and remove no entry. -- [x] Two cows in the same state get two distinct labels; the label carries the number and the state, for each of the three states, and no distance. -- [x] The order is the same whatever the distances, including when they invert. -- [x] After two cows swap their distance ranks, the first entry still takes the cow it names. -- [x] The periodic refresh is gone (no timer registered, no function, no unused parameter), and every event that changes the cows that can be taken over still rebuilds the menus. -- [x] The take-over itself, its messages and its refusal for a cow no longer available behave as before. -- [x] The new regression test fails before the change, for the right reason (the entry is recreated), and passes after it; the rewritten assertions describe the new labels. -- [x] The dictionaries are regenerated and the new labels have French and Spanish translations; the Korean ones are flagged for review. -- [x] The pilot guide (English and French) and, if needed, the mission maker's page, and the `CHANGELOG`, are updated. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -- [01 — Every AI cow has a number, and the announcements name it](01-number-the-cows.md) (the number of the cow) diff --git a/.backlog/FIX-I18N-TRANSLATE-ALIAS/tickets/01-jtac-through-tr-and-guard-sees-the-alias.md b/.backlog/FIX-I18N-TRANSLATE-ALIAS/tickets/01-jtac-through-tr-and-guard-sees-the-alias.md deleted file mode 100644 index 9c479bee..00000000 --- a/.backlog/FIX-I18N-TRANSLATE-ALIAS/tickets/01-jtac-through-tr-and-guard-sees-the-alias.md +++ /dev/null @@ -1,24 +0,0 @@ -# 01 — JTAC messages through `ctld.tr`, and the guard sees the alias - -**Status:** ✅ done (PR #269) · **Type:** AFK - -## Parent - -[PRD — FIX-I18N-TRANSLATE-ALIAS](../PRD.md). Stories 1-6. GitHub issue #265. - -## What to build - -Replace the 16 alias calls of the JTAC module with `ctld.tr`; make the generator also match the alias; regenerate the dictionaries (13 new keys) -and translate them FR, ES, KO; add the invariant spec (every literal key used in `src/` is in the English dictionary); update the i18n -developer page (EN + FR). Test first. Then CHANGELOG, backlog index, PR. - -## Acceptance criteria - -- [ ] The new spec fails before the change (the 13 keys) and passes after it; the existing specs pass unchanged. -- [ ] `src/` has no caller of `ctld.i18n_translate` left; the alias is still defined. -- [ ] The generator finds a key written through the alias. -- [ ] Dictionaries regenerated by `merge_CTLD.ps1`, FR/ES/KO translated; luacheck clean; `busted` green; CHANGELOG entry; docs EN + FR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/01-imposed-code-reserved.md b/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/01-imposed-code-reserved.md deleted file mode 100644 index a81f5c45..00000000 --- a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/01-imposed-code-reserved.md +++ /dev/null @@ -1,18 +0,0 @@ -# 01 — An imposed laser code is reserved, whatever the order - -**Status:** ✅ done - -Files: `src/CTLD_jtac.lua` (`spawnJTAC`, `startLaseTroopUnit`, `_assignLaserCode`, `_freeLaserCode`, -`_initLaserPool`), possibly `src/CTLD_core.lua` (INIT-C order), busted tests. - -## What to do - -- An imposed `cfg.laserCode` leaves `_laserPool` when it is imposed, and `_freeLaserCode` returns only - codes that came from the pool. -- Apply decision a so that a code imposed after INIT-C does not end up shared with a JTAC INIT-C coded - automatically. - -## Done when - -- busted: JTAC A imposed on 1688 then JTAC B automatic → distinct codes; JTAC B automatic first (taking - 1688) then JTAC A imposed on 1688 → distinct codes; A's death does not put 1688 back in the pool. diff --git a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/02-supplied-radio-kept.md b/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/02-supplied-radio-kept.md deleted file mode 100644 index 2a0ac8ad..00000000 --- a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/02-supplied-radio-kept.md +++ /dev/null @@ -1,16 +0,0 @@ -# 02 — A supplied radio is kept - -**Status:** ✅ done - -Files: `src/CTLD_jtac.lua` (`autoLase`, `spawnJTAC`, `CTLDJTAC:new`), busted tests. - -## What to do - -- `spawnJTAC` passes `cfg.radio` on to the JTAC; `CTLDJTAC:new` keeps it, and computes - `calculateFMRadio` only when none is given. -- Apply decision b on the shape: VEAF passes its ASSETS entry (`freq = "36.0"`, `mod = "FM"`, other fields). - -## Done when - -- busted: a JTAC given `{ freq = "36.0", mod = "FM" }` has that radio; one given none keeps the - code-derived radio; a code above `jtacLaserCodeMax` with a supplied radio still has one. diff --git a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/03-valid-laser-codes.md b/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/03-valid-laser-codes.md deleted file mode 100644 index 63bc3189..00000000 --- a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/03-valid-laser-codes.md +++ /dev/null @@ -1,15 +0,0 @@ -# 03 — The laser pool holds valid codes only - -**Status:** ✅ done — rule from the legacy `ctld.generateLaserCode`, verified in game by Zip, 2026-11-05 (1199 refused) - -Files: `src/CTLD_jtac.lua` (`_initLaserPool`), busted tests, the mission-maker docs on laser codes. - -## What to do - -- Verify in DCS (or a sourced reference) which codes a laser accepts: the reporter says none with a 9 or - a 0 (1199). Record the measurement, then leave the refused codes out of `_initLaserPool`. - -## Done when - -- The rule is written down with its source; busted: the pool holds no refused code; the docs say which - codes CTLD hands out. diff --git a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/04-late-activated-not-coded.md b/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/04-late-activated-not-coded.md deleted file mode 100644 index cca477c6..00000000 --- a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/04-late-activated-not-coded.md +++ /dev/null @@ -1,13 +0,0 @@ -# 04 — A late-activated JTAC group is not coded at start - -**Status:** ✅ done - -Files: `src/CTLD_core.lua` (`_initMMJTACs`), `tests/ci/unit/core_manager_spec.lua`. - -## What to do - -- INIT-C reads activation on the group's first unit (`Unit.isActive`); DCS `Group` has no `isActive()`, and the failed call fell back to "active". - -## Done when - -- busted: a late-activated `*jtac*` group is marked pending and not registered at start; an active one is registered. diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/01-dropped-groups-act-alone.md b/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/01-dropped-groups-act-alone.md deleted file mode 100644 index aca904e0..00000000 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/01-dropped-groups-act-alone.md +++ /dev/null @@ -1,30 +0,0 @@ -# 01 — Troops dropped by a pilot or an AI transport act on their own - -**Status:** ✅ done (PR #315) · **Type:** AFK - -## Parent - -[PRD — FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS](../PRD.md), [ADR 0029](../../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md). Stories 1, 2, 3 (rope), 5, 6, 7, 8, 9, 10, 11, 23, 24, 25. GitHub issue #309. - -## What to build - -The foundation: the behaviour of a dropped group, and the settings that drive it, for the troops a player or an AI transport drops on the ground or by fast-rope. - -- **The behaviour, decided in one place** that the other drop paths (tickets 02 and 03) will call. The nearest alive leader of an enemy ground group within `maximumSearchDistance` of the drop point, with no line-of-sight requirement, gets the group ordered toward it (two waypoints, off road); with none in range, the group is ordered toward a random point within `maximumMoveDistance` of the drop point. A waypoint zone keeps priority (the group marches to its centre), then a task the troop template declares; this default comes last. Both distances at 0 give no order. A drop into an extraction zone spawns no group, so nothing happens. -- **The settings.** `maximumMoveDistance` joins the catalogue (2000, metres); `maximumSearchDistance` goes back from 3000 to 4000. The catalogue version goes up and its shape is recorded, as the project requires for a new key. The `ctld-tools` schema gets the new setting (group troops, English and French label and description, unit, advanced) and the clarified description of `maximumSearchDistance`; both descriptions carry the tip that setting both distances to 0 leaves a dropped group where it was dropped. -- **The documentation** of the two settings in the mission makers' tables, English and French. - -## Acceptance criteria - -- [x] A group dropped with an enemy ground group in range is ordered toward the nearest one (no line of sight needed). -- [x] With none in range it is ordered toward a random point within `maximumMoveDistance` of the drop point; the random source is the only thing a test fixes. -- [x] With both distances at 0 no order is given. -- [x] A waypoint zone and a template task keep priority over this default; a drop into an extraction zone orders nothing. -- [x] A pilot's ground drop, a fast-rope drop and an AI transport's drop all behave so. -- [x] `maximumMoveDistance` (2000) is in the catalogue, `maximumSearchDistance` defaults to 4000; the catalogue version is raised and its shape file recorded; the `ctld-tools` schema and the settings tables (EN and FR) describe both settings. -- [x] The new cases fail before the change and pass after it; the existing troop specs pass unchanged (the drop specs that assert no order are updated only where they now contradict the decision). -- [x] `busted tests/ci/` green; luacheck clean; the catalogue shape test passes. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/02-parachute-and-vehicles.md b/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/02-parachute-and-vehicles.md deleted file mode 100644 index f389a9c9..00000000 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/02-parachute-and-vehicles.md +++ /dev/null @@ -1,27 +0,0 @@ -# 02 — Parachuted troops and whole vehicles unloaded act on their own - -**Status:** ✅ done (PR #315) · **Type:** AFK - -## Parent - -[PRD — FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS](../PRD.md), [ADR 0029](../../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md). Stories 3, 4, 23, 24. GitHub issue #309. - -## What to build - -Two more ways a group reaches the ground now follow the behaviour built in ticket 01. - -- **Parachuted troops**: once they land and their group exists, they get the order of a dropped group (a waypoint zone and a template task keep priority). -- **A whole vehicle unloaded from a transport** gets the same order, a JTAC vehicle included (v1 parity, no exception). A vehicle that comes out of a crate being unpacked is not concerned: v1 did not move it either. - -## Acceptance criteria - -- [x] Troops that land by parachute get the order of a dropped group: toward the nearest enemy in range, else a random point within `maximumMoveDistance`; a waypoint zone and a template task keep priority. -- [x] A whole vehicle unloaded from a transport gets the same order, a JTAC vehicle included. -- [x] A vehicle spawned by unpacking a crate gets no order. -- [x] With both distances at 0 none of these gets an order. -- [x] The new cases fail before the change and pass after it; the existing parachute and vehicle specs pass unchanged. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -- [01 — Troops dropped by a pilot or an AI transport act on their own](01-dropped-groups-act-alone.md) (the behaviour and the settings) diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/03-scripted-spawns.md b/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/03-scripted-spawns.md deleted file mode 100644 index 94bf9c60..00000000 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/03-scripted-spawns.md +++ /dev/null @@ -1,28 +0,0 @@ -# 03 — Scripted spawns keep the v1 meaning of their search distance - -**Status:** ✅ done (PR #315) · **Type:** AFK - -## Parent - -[PRD — FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS](../PRD.md), [ADR 0029](../../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md). Stories 12, 13, 23, 24. GitHub issue #309. - -## What to build - -A group a mission script spawns (`spawnGroupAtTrigger`, `spawnGroupAtPoint`) is a dropped group too, so it acts on its own, and the deprecated v1 functions keep the v1 meaning of their last argument. - -- The two CTLD 2 methods gain a new optional **search-distance** parameter; `nil` means `maximumSearchDistance`. Their existing `radius` stays the placement circle. -- The deprecated `ctld.spawnGroupAtTrigger` and `ctld.spawnGroupAtPoint` pass their last argument through that parameter, as v1 read it: a negative value counts as 0, and with 0 no enemy is looked for, so the group walks at random within `maximumMoveDistance` (what the v1 code does, whatever its comment says). -- The spawned group gets the order of a dropped group (ticket 01). - -## Acceptance criteria - -- [x] A scripted spawn with no search distance orders the group as a dropped group, with `maximumSearchDistance`. -- [x] A scripted spawn with a search distance looks for the enemy within that distance; with 0 it looks for none and walks at random. -- [x] The deprecated `ctld.*` wrappers pass their last argument as the search distance, a negative one as 0. -- [x] The CTLD 2 methods keep `radius` as the placement circle; an existing call with `radius` only is unchanged in placement. -- [x] The new cases fail before the change and pass after it; the existing scripted-spawn specs pass unchanged. -- [x] `busted tests/ci/` green; luacheck clean. - -## Blocked by - -- [01 — Troops dropped by a pilot or an AI transport act on their own](01-dropped-groups-act-alone.md) (the behaviour and the settings) diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/04-unpack-guard-and-retired-key.md b/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/04-unpack-guard-and-retired-key.md deleted file mode 100644 index 400ae0e6..00000000 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/04-unpack-guard-and-retired-key.md +++ /dev/null @@ -1,29 +0,0 @@ -# 04 — An optional guard against unpacking in a logistic zone, and a notice for the retired v1 key - -**Status:** ✅ done (PR #315) · **Type:** AFK - -## Parent - -[PRD — FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS](../PRD.md), [ADR 0029](../../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md). Stories 14-22, 25. GitHub issue #309. - -## What to build - -- **`forbidUnpackInLogisticZone`**: a new boolean setting, off by default (nothing is blocked, CTLD 2's logic is kept). When on, an ordinary crate (a vehicle, an AA system) is refused by the *Unpack Crate* menu inside a friendly logistic zone, and a parachuted equipment crate no longer unpacks by itself there. The refusal message is the v1 one, "You can't unpack that here! Take it to where it's needed!", whose translations already exist (the Korean one is checked and added if missing). The FOB and the FARP scenes keep their own rules. The test of "inside a friendly logistic zone" is the one the FOB guard already uses. -- **The catalogue and `ctld-tools`**: the key joins the catalogue (the version goes up again only if ticket 01 has not already raised it for this release, and the shape is recorded), the schema gets a boolean entry in the crates family with an English and French label and description, and the settings tables (EN and FR) get the row. -- **A start-up notice** when a snapshot still carries `minimumDeployDistance`: it is not read by CTLD 2, and the notice names `forbidUnpackInLogisticZone`, built the way the `dropOffZones` one is. -- **The migration guide (EN and FR)** covers the two v1 settings and what each became, and the **CHANGELOG** records the lot: the new default behaviour of dropped groups and how to get idle groups back (both distances at 0), the new option, the notice. -- **The backlog index** line of the lot is added in the pull request ("in progress"), then set to `merged (PR #315)`. - -## Acceptance criteria - -- [x] With the option on, the menu unpack of a vehicle or an AA system inside a friendly logistic zone is refused with the v1 message and nothing is consumed; outside a zone it unpacks as before. -- [x] With the option on, a parachuted equipment crate landing in a logistic zone is not unpacked by itself; with it off, nothing changes. -- [x] The FOB and the FARP scenes behave as before in every case. -- [x] A snapshot carrying `minimumDeployDistance` produces the start-up notice naming the new setting; one without it produces none. -- [x] The key is in the catalogue (false), the catalogue version and shape are consistent, the `ctld-tools` schema and the settings tables (EN and FR) describe it; the migration guide (EN and FR) and the CHANGELOG are updated. -- [x] The new cases fail before the change and pass after it; the existing unpack and configuration specs pass unchanged; the dictionaries are regenerated for the reactivated message. -- [x] `busted tests/ci/` green; luacheck clean; the catalogue shape test passes. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/05-live-check.md b/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/05-live-check.md deleted file mode 100644 index ea160617..00000000 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/05-live-check.md +++ /dev/null @@ -1,41 +0,0 @@ -# 05 — Live check in DCS - -**Status:** ✅ done (PR #315) · **Type:** AFK, needs the mission reloaded - -## Parent - -[PRD — FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS](../PRD.md). Verification of stories 1, 2, 4 and 12. GitHub issue #309. - -## What to build - -A `noPlayer` live scenario, run over the DCS bridge's HTTP API on `Test_CTLDNEXT_01.miz`, in the manner of `scenario_create_before_destroy.lua`: a mock transport 3 km from the first BLUE player, real DCS groups, everything cleaned up afterwards. - -1. An enemy group is placed within `maximumSearchDistance` of the mock transport; troops dropped by it get a route whose destination is that enemy. -2. With no enemy in range, the dropped troops get a route whose destination lies within `maximumMoveDistance` of the drop point. -3. With both distances at 0 the dropped troops get no route. -4. A scripted spawn through the deprecated `ctld.spawnGroupAtPoint` with a search distance behaves as in 1 and 2. - -The result is recorded in the lot's backlog. - -## Acceptance criteria - -- [x] Each of the four checks is recorded PASS or FAIL with the DCS log lines that prove it. -- [x] No object, group or setting change is left in the mission afterwards. -- [x] The lot's index line and PRD status record the live check. - -## Blocked by - -- [01](01-dropped-groups-act-alone.md), [02](02-parachute-and-vehicles.md), [03](03-scripted-spawns.md), [04](04-unpack-guard-and-retired-key.md) - -## Result — live check of 2026-11-18 - -Scenario `tests/dcs/noPlayer/scenario_dropped_group_orders.lua` (tier `auto-check`), run with `tools/integration-runner/run_scenarios.py` on `Test_CTLDNEXT_01.miz` after a mission reload on the freshly built `CTLD.lua` (mock transport 3 km from the BLUE player, a real enemy infantry group 700 m from the drop point, the two settings overridden for the run only): **`[DGO] PASS 17/17`** in 48.5 s, recorded in `dcs.log`. - -| Check | Result | Proof | -| --- | --- | --- | -| A. Enemy in range (pilot drop) | PASS | one order whose destination is the enemy (A.3); the group really walks toward it, 8 m closer or more after 16 s (A.4) | -| B. No enemy in range | PASS | one order, destination within `maximumMoveDistance` of the drop point and not the enemy (B.3, B.4); the group walks toward it (B.5) | -| C. Both distances at 0 | PASS | no order (C.2); the group moved less than 4 m (C.3) | -| D. `ctld.spawnGroupAtPoint` | PASS | a last argument of 5000 reaches the enemy although `maximumSearchDistance` is 0 (D.2); 50 does not reach it although the setting is 4000, so the group walks at random within `maximumMoveDistance` (D.4) | - -Cleanup verified afterwards: no `DGO_` group left, the overridden settings and patched functions restored, the scenario's running flag cleared. A first run failed at once (the mock has no DCS cargo weight to update): the scenario now skips that call, and the failed attempt had changed nothing in the mission. diff --git a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/01-measure-dcs-id-reuse.md b/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/01-measure-dcs-id-reuse.md deleted file mode 100644 index 37c56943..00000000 --- a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/01-measure-dcs-id-reuse.md +++ /dev/null @@ -1,24 +0,0 @@ -# 01 — Measure how DCS reuses a freed menu id - -**Status:** ✅ done (2026-10-09, Zip + Claude, from the VMCT session) · **Type:** HITL (live DCS, Zip) - -## Parent - -[PRD — FIX-MENU-STABLE-ENTRIES](../PRD.md). Source: GitHub issue #257. Decisions D3, D5. - -## Answers - -The tables are in the PRD, "What DCS does — measured 2026-10-09". - -1. **Scope of reuse** — one pool for the whole server: an id freed in the global menu went to a command created for another group (P1); group menus recycle as well (P2c). -2. **Order of reuse** — consistent with last freed, first reused (test 1: B fired C after an identical rebuild). -3. **Create before remove** — not measured; superseded by parking, which consumes each freed id right after its removal whatever the order. -4. **Submenus** — not measured directly; the implementation removes a submenu's children one by one before it and parks each id, which covers it whatever DCS does. -5. **Delay** — not measured; parking makes it irrelevant. - -And the measurement this ticket did not plan, which settles D5: a command created for a group no player holds, right after a removal, takes the freed id, in global and group menus (P1, P2). - -## Acceptance criteria - -- [x] Each question answered with the table of tests, in #257 and in the PRD. -- [ ] The busted `missionCommands` double of ticket 02 reproduces the measured behaviour (moved to ticket 02). diff --git a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/02-render-by-difference.md b/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/02-render-by-difference.md deleted file mode 100644 index 5e5fd3ed..00000000 --- a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/02-render-by-difference.md +++ /dev/null @@ -1,31 +0,0 @@ -# 02 — Render the menu by difference, park every freed id - -**Status:** ✅ done (2026-10-09) · **Type:** AFK - -## Parent - -[PRD — FIX-MENU-STABLE-ENTRIES](../PRD.md). Source: GitHub issue #257. Decisions D1, D2, D3, D5, D6. -Reference implementation: VMCT `veafRadio.RadioMenuBuilder` (`_render`, `_removeEntry`, `rebuild`), VEAF/VEAF-Mission-Creation-Tools#1113. - -Files: `src/CTLD_menu.lua` (`refreshMenuForGroup`, `_rebuildMenuNode`, `_rebuildPagedChildren`, `_wipeGroupHandles`), `src/CTLD_player.lua` (last-occupant teardown), `tests/ci/helpers/dcs_stubs.lua` or a dedicated double, `tests/ci/unit/menu_manager_spec.lua`. - -## What to build - -- A `missionCommands` double that hands out ids as measured (one global pool, last freed first reused) and lets a spec click an id captured before a refresh. -- A rendered mirror per group (D6), key = parent key + type + label + occurrence index (D1). -- The render step builds the rendered tree (enabled filter, order, pagination), creates what appeared, then removes what disappeared, deepest first. -- Every removal is followed by an inert command for the parking group id (D5). -- Commands go through one stable dispatcher resolving the current node at click time (D2). -- An insertion recreates the siblings that follow it, so the declared `order` holds (D3, if confirmed as recommended). -- The last-occupant teardown goes through the manager, which removes and parks every live entry and drops the mirror. - -## Acceptance criteria - -- [x] busted, written first and seen failing on `develop`: after an identical refresh, a click captured before it fires the same command (test 1 of #257); after a removal and a creation, a click on the removed entry fires the parked command (test 9b); a branch cleared and refilled identically makes no DCS call; a changed argument under an unchanged label runs the new argument without recreating the entry; a submenu turned command parks every id it freed. -- [x] Each fix mutation-checked (spec fails with the parking line removed, and with the reuse disabled). -- [x] Ordering and pagination specs pass unchanged, or are adapted to D3 with the reason in the PR. -- [ ] luacheck clean; `busted` green. - -## Blocked by - -- D1, D2, D3 confirmed. diff --git a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/03-drop-ambient-delay-and-adr.md b/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/03-drop-ambient-delay-and-adr.md deleted file mode 100644 index 4558b059..00000000 --- a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/03-drop-ambient-delay-and-adr.md +++ /dev/null @@ -1,25 +0,0 @@ -# 03 — Drop the ambient delay, record the decision - -**Status:** ✅ done (2026-10-09) · **Type:** AFK - -## Parent - -[PRD — FIX-MENU-STABLE-ENTRIES](../PRD.md). Source: GitHub issue #257. Decision D4. - -Files: `src/CTLD_menu.lua` (`deferredRefreshForGroup`, `cancelPending`, `AMBIENT_REBUILD_DELAY_S`, `_pendingAmbient`, possibly `runUrgent`), `tests/ci/unit/menu_manager_spec.lua`, `dev/adr/0027-*.md` (new), `dev/adr/0015-*.md` (status: superseded), `dev/adr/README.md`, `docs/developer/subsystems/menu.md` (+ `.fr.md`), `CONTEXT.md` if it defines ambient / urgent refresh, `CHANGELOG.md`. - -## What to build - -- Every refresh applies the difference at once, behind the existing `DEBOUNCE_S` coalescing; the ambient wipe and its delayed rebuild go. -- ADR 0027: the measurement of #257 (and ticket 01), why the atomic rebuild and the ambient delay both reassign ids, the decisions D1-D6, parking as the answer to case 2. -- ADR 0015 marked superseded by 0027; the developer menu doc rewritten where it describes "atomic, all-or-nothing rebuilds" and the ambient delay. - -## Acceptance criteria - -- [x] busted: the specs that pinned the ambient wipe and its 4 s rebuild are replaced by specs of the immediate, diffed refresh. -- [x] Docs EN + FR, ADR index, `CHANGELOG.md` `[Unreleased]`. -- [ ] luacheck clean; `busted` green. - -## Blocked by - -- 02. diff --git a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/04-live-check.md b/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/04-live-check.md deleted file mode 100644 index 9dcd3e9d..00000000 --- a/.backlog/FIX-MENU-STABLE-ENTRIES/tickets/04-live-check.md +++ /dev/null @@ -1,25 +0,0 @@ -# 04 — Live check in a CTLD mission - -**Status:** ✅ done — verified in game by Zip, 2026-11-05 · **Type:** HITL (live DCS, Zip) - -## Parent - -[PRD — FIX-MENU-STABLE-ENTRIES](../PRD.md). Source: GitHub issue #257. - -## What to check - -On the built `CTLD.lua` of the branch, in a test mission: - -1. Hold `Troop Commands` (or any CTLD submenu) open on a transport parked in a logistic zone; trigger an ambient refresh (another aircraft lands nearby, a crate is spawned near by another player); click an entry; the logged command is the one clicked. -2. Same with `Crate Commands > Load Crate` while a crate is added nearby: an existing entry still fires its own crate. -3. Same with a list long enough to page, while one entry is added before the page boundary. -4. Same while the clicked entry itself is replaced (a crate picked up by another player while its entry is on screen): the click fires nothing, the parked command logs it. - -## Acceptance criteria - -- [ ] The three checks give the clicked command, recorded with the test table in the PR. -- [ ] Check 4 fires nothing; any case that still misfires is reported in #257 with its table. - -## Blocked by - -- 02, 03. diff --git a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/01-scheduler-remove-exit.md b/.backlog/FIX-REVIEW-HYGIENE-B/tickets/01-scheduler-remove-exit.md deleted file mode 100644 index dbb33931..00000000 --- a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/01-scheduler-remove-exit.md +++ /dev/null @@ -1,28 +0,0 @@ -# 01 — `ctld.scheduler.remove`: the exit symmetric to `schedule` - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FIX-REVIEW-HYGIENE-B](../PRD.md). Source: GitHub issue #254. Decision D4. - -Files: `src/CTLD_utils.lua` (`ctld.scheduler`), `src/CTLD_menu.lua`, `src/CTLD_recon.lua`, `tests/ci/unit/scheduler_spec.lua`, `tests/ci/unit/scheduler_guard_spec.lua`, `docs/developer/architecture.md` (+ `.fr.md`, scheduler section). - -## What to build - -- `ctld.scheduler.remove(id)`: `pcall(timer.removeFunction, id)` then `_pending[id] = nil`; returns at once for a nil id. -- `register` (previous id of the same name) and `cancel(name)` go through it. -- The six direct `timer.removeFunction` calls of `src/CTLD_menu.lua` (`:159`, `:220`, `:226`) and `src/CTLD_recon.lua` (`:607`, `:692`, `:781`) become `ctld.scheduler.remove`; the comment of `src/CTLD_menu.lua:168` that names `timer.removeFunction` follows. -- The guard spec gains a second case: no `src/` file other than `CTLD_utils.lua` mentions `timer.removeFunction` outside a comment, and `CTLD_utils.lua` mentions it exactly twice (`remove`, `cancelAll`). - -## Acceptance criteria - -- [x] busted, written first and seen failing: `remove` cancels the id in DCS and drops it from `_pending`; after `remove(a)`, `cancelAll()` cancels only what is still pending; `remove(nil)` and an id DCS refuses raise nothing. -- [x] The new guard case fails on `develop` (six offenders) and passes after the migration. -- [x] Existing menu and recon specs pass unchanged. -- [x] Developer doc of the scheduler names `remove` (EN + FR). -- [x] luacheck clean; `busted` green. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/02-scene-pack-through-aligned-spawn.md b/.backlog/FIX-REVIEW-HYGIENE-B/tickets/02-scene-pack-through-aligned-spawn.md deleted file mode 100644 index 6f451360..00000000 --- a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/02-scene-pack-through-aligned-spawn.md +++ /dev/null @@ -1,26 +0,0 @@ -# 02 — Packing a scene places its crates by the common rule - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FIX-REVIEW-HYGIENE-B](../PRD.md). Source: GitHub issue #253. Decisions D1, D2. - -Files: `src/CTLD_crate.lua` (`spawnCratesAligned`, `_spawnCratesInRow`, the "Pack *<scene>*" callback of `refreshPackEquiptSection`), `tests/ci/functional/` (a scene-pack spec, or the existing pack spec if one covers the callback), `docs/developer/subsystems/crates.md` (+ `.fr.md`) if it lists the callers of `spawnCratesAligned`. - -## What to build - -- `spawnCratesAligned` returns a third value, the list of `CTLDCrate` it created, from both the row branch (`_spawnCratesInRow`) and the radial branch. -- The scene pack callback builds `cratesRequired` descriptors and calls `spawnCratesAligned(descriptors, t, t:getCoalition(), t:getName(), CTLDCrate.SPAWN_METHOD.CRATE_SPAWN)` in place of the direct `ctld.utils.getSpawnObjectPositions` + `spawnCrate` loop, then sets `metadata.warehouseSnapshot` on each returned crate. -- The `trigger.action.outText("[PackCallback] ENTER ...")` broadcast (`src/CTLD_crate.lua:990`) is removed; the `ctld.utils.log` line above it stays. - -## Acceptance criteria - -- [x] busted, written first and seen failing, driving the F10 "Pack *<scene>*" command: for a type that declares a plan (UH-1H, side 3.0 m), the crates of the packed scene stand in a row at the declared distance; for a type without one, the radial routine receives the other aircraft's volumes (as in `crate_drop_placement_spec`); every created crate carries the warehouse snapshot; nothing is sent through `trigger.action.outText`. -- [x] Request Equipment, Drop Crate(s) and Pack Vehicle specs pass unchanged. -- [x] `CHANGELOG.md` `[Unreleased]` (with ticket 03 and 01: one entry per issue). -- [x] luacheck clean; `busted` green. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/03-row-requires-a-declared-crate-size.md b/.backlog/FIX-REVIEW-HYGIENE-B/tickets/03-row-requires-a-declared-crate-size.md deleted file mode 100644 index 562bd522..00000000 --- a/.backlog/FIX-REVIEW-HYGIENE-B/tickets/03-row-requires-a-declared-crate-size.md +++ /dev/null @@ -1,26 +0,0 @@ -# 03 — The row layout requires a crate model with a declared size - -**Status:** ✅ done · **Type:** AFK - -## Parent - -[PRD — FIX-REVIEW-HYGIENE-B](../PRD.md). Source: GitHub issue #255 (its step 2). Decision D3. - -Files: `src/CTLD_crate.lua` (`getCrateSize`, `spawnCratesAligned`, `getCrateDropPositions`), `tests/ci/unit/crate_spawn_config_spec.lua`, `tests/ci/functional/crate_spawn_layout_spec.lua`, `tests/ci/functional/crate_drop_placement_spec.lua`, `docs/mission-maker/crates-catalogue.md` (+ `.fr.md`), `docs/developer/subsystems/crates.md` (+ `.fr.md`), `dev/adr/0024-native-crates-spawn-at-hull-clearance.md` (consequences). - -## What to build - -- `getCrateSize(modelKey)` returns nil when the model declares no positive `size`; the 1.5 m `_DEFAULT_CRATE_SIZE` goes. -- `spawnCratesAligned` takes the row only when the type has a plan **and** the crate model it uses has a size; otherwise the radial rule. -- `getCrateDropPositions` takes the row only when every dropped crate's model has a size; otherwise the radial rule for the whole wave. -- Docs (EN + FR): a model without `size` keeps the radial rule; with the default catalogue that is every crate of a `slingLoad: true` mission. The ADR 0024 consequences say the same. - -## Acceptance criteria - -- [x] busted, written first and seen failing: with `slingLoad: true` and a type that declares a plan, a requested wave and a dropped crate take the radial rule; a mission-maker `size` on `sling` brings the row back; the spec that pinned 1.5 m for `sling` now asserts that `sling` has no size. -- [x] Existing row specs (`load`, `dynamic` at 1.31 m) pass unchanged. -- [x] luacheck clean; `busted` green. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/tickets/01-stop-the-scene-before-destroying-it.md b/.backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/tickets/01-stop-the-scene-before-destroying-it.md deleted file mode 100644 index 5ba91152..00000000 --- a/.backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/tickets/01-stop-the-scene-before-destroying-it.md +++ /dev/null @@ -1,26 +0,0 @@ -# 01 — Stop a scene that is still laying out before destroying it - -**Status:** ✅ done (PR #304) · **Type:** AFK - -## Parent - -[PRD — FIX-SCENE-PACK-WHILE-LAYING-OUT](../PRD.md). Stories 1-7. - -## What to build - -A scene records that it completed when its last step finished. The scene manager's destroy of a scene, which every pack goes through, stops the scene first when it has neither completed nor been stopped: the steps that have not run yet are never run, so nothing is spawned after the pack. A scene that finished, or that was already stopped (the Fat Cow stops its own), is destroyed as before and is not stopped twice. - -The *Pack* entry, the messages and the crates are unchanged. - -## Acceptance criteria - -- [ ] A scene packed while a step is still waiting for its timer never runs that step, and the objects already spawned are destroyed, both through the destroy and through the pack entry point. -- [ ] A scene that finished is destroyed without being stopped; a scene already stopped is not stopped a second time. -- [ ] The new cases fail before the change and pass after it; the existing Fat Cow and scene specs pass unchanged. -- [x] Live check in DCS: a Countryside FARP packed a few seconds after it starts leaves no object (group or static) in the mission sixty seconds later, the diagnostic that found the defect on 2026-11-09. Run on 2026-11-09 with the build of the PR branch: 6 objects tracked at pack time, the scene stopped by the pack, 0 object left 60 s later (6 orphans before the fix). -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in this PR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/01-country-of-the-coalition.md b/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/01-country-of-the-coalition.md deleted file mode 100644 index ae4b24c6..00000000 --- a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/01-country-of-the-coalition.md +++ /dev/null @@ -1,14 +0,0 @@ -# 01 — The country of the coalition, not USA or Russia - -**Status:** ✅ done (PR #256) - -Files: `src/CTLD_utils.lua` (new `ctld.utils.resolveCountryId`), `src/CTLD_crate.lua`, `src/CTLD_jtac.lua`, `src/CTLD_troop.lua`, `src/CTLD_beacon.lua`, `src/CTLD_vehicle.lua`, busted tests. - -## What to do - -- `ctld.utils.resolveCountryId(coalitionId, unit)`: the live unit's `getCountry()`; else the lowest id of `country.id` that `coalition.getCountryCoalition` places on `coalitionId`; else `country.id.USA` (blue) / `country.id.RUSSIA` (red). -- Replace every hardcoded default with it; the crate paths that hold the requesting aircraft pass its country. - -## Done when - -- busted: the helper's three steps in order; a Request Equipment click in a mission whose blue holds only CJTF Blue creates the crate under CJTF Blue; a crate created without a unit goes under a country of its coalition. diff --git a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/02-failed-creation-visible.md b/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/02-failed-creation-visible.md deleted file mode 100644 index e14abb64..00000000 --- a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/tickets/02-failed-creation-visible.md +++ /dev/null @@ -1,17 +0,0 @@ -# 02 — A failed creation is visible - -**Status:** ✅ done (PR #256) - -Files: `src/CTLD_utils.lua` (`dynAddStatic`), `src/CTLD_crate.lua` (`_spawnStatic`, `_spawnUnpacked`, the menu unpack, the `_log` calls), i18n dictionaries, busted tests, `CHANGELOG.md`. - -## What to do - -- `dynAddStatic` returns false and the DCS error when `spawnAs` fails, instead of the object data. -- `_spawnStatic` logs a `WARNING` with the error and the country when no static results. -- `_spawnUnpacked` returns whether it created the group and tells the unpacking group when it did not; the menu unpack announces success only then. -- The `_log` calls of `src/CTLD_crate.lua` pass the level first. - -## Done when - -- busted: a Request Equipment click whose static creation raises tells the pilot and logs a `WARNING` holding the DCS error; an unpack whose group creation fails tells the group and does not announce success. -- `CHANGELOG.md` `[Unreleased]`. diff --git a/.backlog/FIX-TROOP-UNLOAD-TRANSPORT/tickets/01-drop-the-troops-again.md b/.backlog/FIX-TROOP-UNLOAD-TRANSPORT/tickets/01-drop-the-troops-again.md deleted file mode 100644 index c07a4f91..00000000 --- a/.backlog/FIX-TROOP-UNLOAD-TRANSPORT/tickets/01-drop-the-troops-again.md +++ /dev/null @@ -1,31 +0,0 @@ -# 01 — The scripted troop drops drop the troops again - -**Status:** ✅ done (PR #313) · **Type:** AFK - -## Parent - -[PRD — FIX-TROOP-UNLOAD-TRANSPORT](../PRD.md). Stories 1-10. - -## What to build - -`unloadTransport` and `unloadInProximityToEnemy` of the troop manager, and so the deprecated `ctld.unloadTransport` and `ctld.unloadInProximityToEnemy`, work again. They asked the troop manager for a drop method that no longer exists and raised an error. - -- **`unloadTransport`**: in an extraction zone the troops are dropped to the objective; otherwise in a pickup zone they go back to its stock; otherwise every group on board is dropped. No troops on board, or an unknown unit: nothing happens and it answers false. -- **`unloadInProximityToEnemy`**: an AI transport with an enemy in sight drops every group; with none in sight it drops nothing; a player-controlled transport is left alone. - -The drop and the return publish the troop events added by FEAT-TROOP-GESTURE-EVENTS. - -## Acceptance criteria - -- [ ] `unloadTransport` drops every group on board, without raising an error. -- [ ] Standing in a pickup zone, it returns the troops to the stock and drops nothing; an extraction zone takes priority and drops the troops to the objective. -- [ ] With no troops on board, or for an unknown unit, it answers false without raising an error. -- [ ] `unloadInProximityToEnemy`: an AI transport with an enemy in sight drops every group; with no enemy in sight it drops nothing; a player-controlled transport is left alone. -- [ ] The deprecated `ctld.unloadTransport` and `ctld.unloadInProximityToEnemy` wrappers work. -- [ ] The new cases fail before the change and pass after it; the existing troop specs pass unchanged. -- [ ] CHANGELOG `[Unreleased]` entry; `busted tests/ci/` green; luacheck clean; no new translation key. -- [ ] The lot's line in `.backlog/README.md` ("in progress") is set to `merged (PR #NN)` in this PR. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-UNPACK-FALSE-SUCCESS/tickets/01-announce-success-only-on-true.md b/.backlog/FIX-UNPACK-FALSE-SUCCESS/tickets/01-announce-success-only-on-true.md deleted file mode 100644 index 939a13c5..00000000 --- a/.backlog/FIX-UNPACK-FALSE-SUCCESS/tickets/01-announce-success-only-on-true.md +++ /dev/null @@ -1,22 +0,0 @@ -# 01 — Announce "unpacked successfully" only when the group was created - -**Status:** ✅ done (PR #267) · **Type:** AFK - -## Parent - -[PRD — FIX-UNPACK-FALSE-SUCCESS](../PRD.md). Stories 1-5. GitHub issue #264. - -## What to build - -In the Unpack Crate callback, announce success only when `_spawnUnpacked` returned `true`; log the click when nothing could be attempted. -Tests first (JTAC limit reached, creation succeeds, DCS refuses, no spawn position). Then CHANGELOG, backlog index, PR. - -## Acceptance criteria - -- [ ] New cases fail before the change and pass after it. -- [ ] A JTAC unpack blocked by the limit shows the refusal reason and no success message. -- [ ] luacheck clean; `busted` green; CHANGELOG entry. - -## Blocked by - -None - can start immediately. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/PRD.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/PRD.md index dcc26ce6..057154f3 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/PRD.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/PRD.md @@ -1,6 +1,6 @@ # FIX-VMCT-REVIEW-FINDINGS — five defects found by the VMCT review of `develop` (issues #322 to #326) -**Status:** 🟡 ready — decisions taken by the control session on 2026-11-23 (below, each with its reason). They are defaults, not questions: apply them unless the code proves one wrong, and then say why in the PR. +**Status:** ✅ merged (PR #330), live check PASS 10/10 (2026-11-23) — decisions taken by the control session on 2026-11-23 (below, each with its reason). They are defaults, not questions: apply them unless the code proves one wrong, and then say why in the PR. GitHub issues #322 to #326, opened by VMCT on 2026-11-19 from a read of `develop` at `1dfea2c`. Every finding was re-read in the code on 2026-11-23 and holds; the line numbers of the issues are right. The sibling lot [`FEAT-VMCT-V1-PARITY`](../FEAT-VMCT-V1-PARITY/PRD.md) (#327, #328) runs in parallel. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md index b8975d25..4b06c3ac 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md @@ -1,6 +1,6 @@ # 01 — Parachuted troops keep their template (#322) -**Status:** 🟡 ready · **Type:** AFK +**Status:** ✅ done (PR #330) · **Type:** AFK ## Parent [PRD](../PRD.md), issue #322. @@ -9,7 +9,7 @@ `CTLDTroopManager:parachuteTroops` (`src/CTLD_troop.lua` ~1814-1822) builds each unit from the template's own unit list, resolving `unitType(coalition)` per unit, as the landed unload does through `CTLDObjectRegistry.spawnObject`. `"Soldier AK"` remains only as a logged fallback. ## Acceptance criteria -- [ ] A parachuted "Standard Group" (blue) lands with the same types, in the same order, as the same group unloaded on the ground. -- [ ] A red template resolves the red types. -- [ ] A JTAC template still lases (wiring by position unchanged). -- [ ] CHANGELOG `[Unreleased]` *Fixed* entry. +- [x] A parachuted "Standard Group" (blue) lands with the same types, in the same order, as the same group unloaded on the ground. +- [x] A red template resolves the red types. +- [x] A JTAC template still lases (wiring by position unchanged). +- [x] CHANGELOG `[Unreleased]` *Fixed* entry. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md index 4f756b18..96e7b17e 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md @@ -1,6 +1,6 @@ # 02 — Inactive zones stay inactive (#323) -**Status:** 🟡 ready · **Type:** AFK +**Status:** ✅ done (PR #330) · **Type:** AFK ## Parent [PRD](../PRD.md), issue #323. @@ -9,6 +9,6 @@ `self.active = data.active ~= false` in `CTLDTroopZone:init` (`src/CTLD_zone.lua:136`) and `CTLDLogisticZone:init` (`:408`). ## Acceptance criteria -- [ ] A `troopZones` entry with `"no"` and a `wpZones` entry with `"no"` load inactive; `activate()` opens them. -- [ ] `active` absent or `true` still loads active. -- [ ] CHANGELOG *Fixed* entry. +- [x] A `troopZones` entry with `"no"` and a `wpZones` entry with `"no"` load inactive; `activate()` opens them. +- [x] `active` absent or `true` still loads active. +- [x] CHANGELOG *Fixed* entry. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md index 077073f1..95884075 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md @@ -1,6 +1,6 @@ # 03 — Repair crates can be requested from the menu (#324) -**Status:** 🟡 ready · **Type:** AFK +**Status:** ✅ done (PR #330) · **Type:** AFK ## Parent [PRD](../PRD.md), issue #324. @@ -9,6 +9,6 @@ In the Request Equipment menu (`src/CTLD_crate.lua` ~3131 and ~3181), single crates are passed by `weight` and looked up with `findDescriptorByWeight`, as the `multiple` branch does. ## Acceptance criteria -- [ ] "HAWK Repair" (and the five others) requested in a logistic zone spawns its crate. -- [ ] Every other single crate of the default catalogue is still requested correctly (one test iterating the catalogue). -- [ ] CHANGELOG *Fixed* entry. +- [x] "HAWK Repair" (and the five others) requested in a logistic zone spawns its crate. +- [x] Every other single crate of the default catalogue is still requested correctly (one test iterating the catalogue). +- [x] CHANGELOG *Fixed* entry. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md index 582b02a0..084e1eb7 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md @@ -1,6 +1,6 @@ # 04 — Each AA group gets a unique name (#325) -**Status:** 🟡 ready · **Type:** AFK +**Status:** ✅ done (PR #330) · **Type:** AFK ## Parent [PRD](../PRD.md), issue #325. @@ -9,6 +9,6 @@ `CTLDCrateAssemblyManager:_spawnGroup` (`src/CTLD_aasystem.lua` ~840) puts the `groupUid` it already computes into the group name. ## Acceptance criteria -- [ ] Two systems of the same type spawned at the same `timer.getAbsTime()` get two different group names. -- [ ] Rearm and repair (new group over the old one, ADR 0028) still work. -- [ ] CHANGELOG *Fixed* entry. +- [x] Two systems of the same type spawned at the same `timer.getAbsTime()` get two different group names. +- [x] Rearm and repair (new group over the old one, ADR 0028) still work. +- [x] CHANGELOG *Fixed* entry. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md index 2339a227..4524995c 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md @@ -1,6 +1,6 @@ # 05 — Coalition messages name the player (#326) -**Status:** 🟡 ready · **Type:** AFK +**Status:** ✅ done (PR #330) · **Type:** AFK ## Parent [PRD](../PRD.md), issue #326. @@ -9,6 +9,6 @@ A `ctld.utils` helper equivalent to v1's `ctld.getPlayerNameOrType` (player name, else type name). Used in "%1 started building a FOB" (`src/CTLD_fob.lua` ~253) and the three SAM messages (`src/CTLD_aasystem.lua` ~546, ~623, ~692). The `player` doc line of `unpackFOBCrates` says "unit name". ## Acceptance criteria -- [ ] With a player in the slot, the four messages show the player's name; with an AI unit, its type name. -- [ ] Event payloads unchanged (`OnFOBDeployed.player` stays the unit name). -- [ ] CHANGELOG *Fixed* entry. +- [x] With a player in the slot, the four messages show the player's name; with an AI unit, its type name. +- [x] Event payloads unchanged (`OnFOBDeployed.player` stays the unit name). +- [x] CHANGELOG *Fixed* entry. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md index ce1b9d12..5848a761 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md @@ -1,6 +1,6 @@ # 06 — Live check in DCS -**Status:** 🟡 ready · **Type:** AFK, needs DCS running (Zip launches DCS; the session launches dcs-serve) +**Status:** ✅ done — live scenario PASS 10/10 (2026-11-23) · **Type:** AFK, needs DCS running (Zip launches DCS; the session launches dcs-serve) ## Parent [PRD](../PRD.md). Blocked by 01-05. @@ -11,6 +11,18 @@ A `noPlayer` live scenario over the DCS bridge on `Test_CTLDNEXT_01.miz`, in the The Fat Cow is out of scope: used in game for weeks, considered tested (Zip, 2026-11-23). ## Acceptance criteria -- [ ] Each check PASS or FAIL with the DCS log lines that prove it. -- [ ] Nothing left in the mission afterwards. -- [ ] Result recorded in this ticket and the lot's index line. +- [x] Each check PASS or FAIL with the DCS log lines that prove it. +- [x] Nothing left in the mission afterwards. +- [x] Result recorded in this ticket and the lot's index line. + +## Result (2026-11-23) + +`tests/dcs/noPlayer/scenario_vmct_review_findings.lua` on `Test_CTLDNEXT_01.miz`, one DCS launch shared with FEAT-VMCT-V1-PARITY: the mission loaded a `CTLD.lua` built from `develop` + this branch at `c027ea36` + `feat/FEAT-VMCT-V1-PARITY`. Runner: `[PASS] noPlayer/scenario_vmct_review_findings.lua -- 56.1s -- [VRF] PASS 10/10`. + +DCS log lines (`[CTLD][INFO] [VRF] …`): + +- #322: `landed Standard Group (Standard Group-1): Soldier M4 GRG ×6, Soldier M249 ×2, Paratrooper RPG-16 ×2`, identical to the template's expected list; `landed Mortar Squad (Mortar Squad-2): 2B11 mortar, Soldier M4 GRG` ×6 (mortars with their servants). PASS 1.0, 1.1, 1.2 ×2. +- #324: `PASS 2.0 Request Equipment lists HAWK Repair in the temporary zone`, `PASS 2.1 a HAWK Repair crate was brought out`, `PASS 2.2 the crate is a DCS static` (through the real menu callback). +- #325: `AA groups: Hawk ln_CTLD_AA_6, Hawk ln_CTLD_AA_18`, `PASS 3.0 both spawns accepted in the same second`, `PASS 3.1 two distinct group names`, `PASS 3.2 both systems exist in the world`. + +No ERROR or WARN line in the DCS log during the run. Checked afterwards over dcs-serve: `groups=[] mockCrates=0 tempZone=false aaSystems=0 menu=false inTransit=false running=false`, nothing left in the mission. diff --git a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md index 54d738e6..c30799d5 100644 --- a/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md +++ b/.backlog/FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md @@ -1,6 +1,6 @@ # 07 — Backlog housekeeping -**Status:** 🟡 ready · **Type:** AFK, no `src/` change +**Status:** ✅ done (PR #330) · **Type:** AFK, no `src/` change ## Parent [PRD](../PRD.md). @@ -10,4 +10,4 @@ - In `CHANGELOG.md` `[Unreleased]`, FIX-CREATE-BEFORE-DESTROY, AA systems paragraph: drop "to be confirmed on the live check". That live check passed on 2026-11-09 (ticket 06 of that lot). ## Acceptance criteria -- [ ] `Active lots` holds only the lots merged on or after 2026-11-20 and this pair; every archived lot has its file and its `Delivered` line; no link broken. +- [x] `Active lots` holds only the lots merged on or after 2026-11-20 and this pair; every archived lot has its file and its `Delivered` line; no link broken. diff --git a/.backlog/README.md b/.backlog/README.md index 105dc9fc..8359f043 100644 --- a/.backlog/README.md +++ b/.backlog/README.md @@ -14,35 +14,8 @@ authored **per lot, when the lot is started** (not in batch). | Lot | Status | Description | Branch | |-----|--------|-------------|--------| -| [`FIX-VMCT-REVIEW-FINDINGS`](FIX-VMCT-REVIEW-FINDINGS/PRD.md) | ready — 7 tickets (01 [parachuted troops keep their template](FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md), 02 [inactive zones stay inactive](FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md), 03 [repair crates from the menu](FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md), 04 [unique AA group name](FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md), 05 [player name in coalition messages](FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md), 06 [live check](FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md), 07 [backlog housekeeping](FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md)) | Issues #322-#326 (VMCT review of `develop`, 2026-11-19): parachuted troops all land as "Soldier AK"; inactive troop/waypoint zones load active; the six "… Repair" crates cannot be requested from the menu; two AA systems of the same type spawned in the same second share a group name; FOB and SAM coalition messages name the unit instead of the player. | `fix/FIX-VMCT-REVIEW-FINDINGS` | +| [`FIX-VMCT-REVIEW-FINDINGS`](FIX-VMCT-REVIEW-FINDINGS/PRD.md) | merged (PR #330) — 06 ✅ live scenario PASS 10/10 (2026-11-23) — 7 tickets (01 [parachuted troops keep their template](FIX-VMCT-REVIEW-FINDINGS/tickets/01-parachuted-troops-keep-their-template.md), 02 [inactive zones stay inactive](FIX-VMCT-REVIEW-FINDINGS/tickets/02-inactive-zones-stay-inactive.md), 03 [repair crates from the menu](FIX-VMCT-REVIEW-FINDINGS/tickets/03-repair-crates-from-the-menu.md), 04 [unique AA group name](FIX-VMCT-REVIEW-FINDINGS/tickets/04-unique-aa-group-name.md), 05 [player name in coalition messages](FIX-VMCT-REVIEW-FINDINGS/tickets/05-player-name-in-coalition-messages.md), 06 [live check](FIX-VMCT-REVIEW-FINDINGS/tickets/06-live-check.md), 07 [backlog housekeeping](FIX-VMCT-REVIEW-FINDINGS/tickets/07-backlog-housekeeping.md)) | Issues #322-#326 (VMCT review of `develop`, 2026-11-19): parachuted troops all land as "Soldier AK"; inactive troop/waypoint zones load active; the six "… Repair" crates cannot be requested from the menu; two AA systems of the same type spawned in the same second share a group name; FOB and SAM coalition messages name the unit instead of the player. | `fix/FIX-VMCT-REVIEW-FINDINGS` | | [`FEAT-VMCT-V1-PARITY`](FEAT-VMCT-V1-PARITY/PRD.md) | merged (PR #329) — verified in game (live scenario 15/15, 2026-11-23) — 3 tickets (01 [spawned units player can drive](FEAT-VMCT-V1-PARITY/tickets/01-spawned-units-player-can-drive.md), 02 [link crates and groups in events](FEAT-VMCT-V1-PARITY/tickets/02-link-crates-and-groups-in-events.md), 03 [live check](FEAT-VMCT-V1-PARITY/tickets/03-live-check.md)) | Issues #327, #328 (VMCT): units spawned by a CTLD gesture are drivable again (new setting `spawnedUnitsPlayerCanDrive`, default `true` as in v1); unpack, rearm and repair events carry both the crates and the spawned group. | `feat/FEAT-VMCT-V1-PARITY` | -| [`FIX-FAT-COW-GROUND-TEST`](FIX-FAT-COW-GROUND-TEST/PRD.md) | merged (PR #320) — 1 ticket ([ask the shared ground helper](FIX-FAT-COW-GROUND-TEST/tickets/01-ask-the-shared-ground-helper.md)) | Issue #295 (found by an automated review): the Fat Cow called DCS's raw `inAir()` at three places (deploying the FARP, Land here, Release the Fat Cow) instead of `ctld.utils.inAir`, which exists for high-chassis aircraft such as the CH-47 that read "in the air" at rest. A landed cow could be refused as airborne (its FARP never opened, the piloted cow read a wrong message), or, on release, lifted off from its open FARP. The three go through the shared helper; the tests used one flag for both forms and could not tell them apart. | `fix/FIX-FAT-COW-GROUND-TEST` | -| [`FIX-FAT-COW-DEPLOY-REFUSALS`](FIX-FAT-COW-DEPLOY-REFUSALS/PRD.md) | merged (PR #319) — 1 ticket ([report a refused deployment](FIX-FAT-COW-DEPLOY-REFUSALS/tickets/01-report-a-refused-deployment.md)) | Issue #296 (found by an automated review): the AI cow's deployment timer dropped the answer of `deploy`, so five of the six refusals (empty cow, airborne, scene, deployed, unknown) were silent, for the flight and for the log; the piloted cow's path already reported them. A flight whose cow was emptied, folded with Take off, then landed with Land here waited for an announced FARP that never came. The timer now reads the answer: an empty cow says so and advises RTB, the other refusals reuse the existing message, all are logged. | `fix/FIX-FAT-COW-DEPLOY-REFUSALS` | -| [`FIX-FAT-COW-EMPTY-AI-TYPE`](FIX-FAT-COW-EMPTY-AI-TYPE/PRD.md) | merged (PR #318) — 1 ticket ([keep the menu with an empty type](FIX-FAT-COW-EMPTY-AI-TYPE/tickets/01-keep-the-menu-with-an-empty-type.md)) | Issue #297 (found by an automated review): an empty `fatCowAIType` removed the whole Fat Cow menu from the pilots a cow serves (eight commands, FARP status included, and the commands of cows placed by the mission), while the guide, the schema and the editor say it removes only "Request a Fat Cow". The guard moves onto that one command; the rest of the menu stays, and the four texts say why. | `fix/FIX-FAT-COW-EMPTY-AI-TYPE` | -| [`FIX-FAT-COW-TAKEOVER-LABELS`](FIX-FAT-COW-TAKEOVER-LABELS/PRD.md) | merged (PR #317) — 2 tickets (01 [number the cows](FIX-FAT-COW-TAKEOVER-LABELS/tickets/01-number-the-cows.md), 02 [a stable take-over list](FIX-FAT-COW-TAKEOVER-LABELS/tickets/02-stable-take-over-list.md)) | Issue #298 (found by an automated review): the "Take over a Fat Cow" entries carried the cow's distance in their label, which is their identity (ADR 0027), and a 30 s timer rebuilt them, so an entry was recreated under the pilot's finger (a click fired a parked command and nothing happened), and two cows at the same rounded km shared a label and could be swapped. Every AI cow now has a number; the entry reads "Fat Cow #N — state", in the order of the numbers, with no distance and no periodic refresh; the three announcements name the cow and keep its distance. | `fix/FIX-FAT-COW-TAKEOVER-LABELS` | -| [`FIX-FAT-COW-CLEARING-LOG`](FIX-FAT-COW-CLEARING-LOG/PRD.md) | merged (PR #316) — 2 tickets (01 [check the real output of the clearing search](FIX-FAT-COW-CLEARING-LOG/tickets/01-probe-the-real-search-output.md), 02 [log the clearing search](FIX-FAT-COW-CLEARING-LOG/tickets/02-log-the-clearing-search.md)) | Issue #299 (found by an automated review): the AI cow's clearing search (`Disposition.getSimpleZones`, undocumented) falls back to the raw landing point in five situations and logs none of them, so a DCS patch could bring back the tree strikes of 2026-10-30 without a trace. The API failures (singleton missing, error, wrong shape) get a `WARN` once per mission and per cause, the benign "no clearing" an `INFO` at every landing; the landing point does not change. Log only, no start-up alert. | `fix/FIX-FAT-COW-CLEARING-LOG` | -| [`FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS`](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/PRD.md) | merged (PR #315) — 5 tickets (01 [dropped groups act alone](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/01-dropped-groups-act-alone.md), 02 [parachute and vehicles](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/02-parachute-and-vehicles.md), 03 [scripted spawns](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/03-scripted-spawns.md), 04 [unpack guard and retired key](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/04-unpack-guard-and-retired-key.md), 05 [live check](FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/tickets/05-live-check.md)) | Issue #309 (VMCT): the v1 settings `maximumMoveDistance` and `minimumDeployDistance` have no key in CTLD 2, and the behaviours they drove are gone too. Dropped groups (troops and vehicles) act on their own again by default (nearest enemy, else a random walk; both distances at 0 to keep them still), and an optional `forbidUnpackInLogisticZone` forbids unpacking crates in a friendly logistic zone ([ADR 0029](../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md)). | `fix/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS` | -| [`FIX-CONFIG-LABELS-I18N-LANG`](FIX-CONFIG-LABELS-I18N-LANG/PRD.md) | merged (PR #314) — 1 ticket ([translate the labels after the settings](FIX-CONFIG-LABELS-I18N-LANG/tickets/01-translate-the-labels-after-the-settings.md)) | Issue #310 (VMCT): the `desc` / `name` labels of the configuration were translated before the settings were filled, so they followed the global language and ignored the snapshot's own `i18n_lang` (an English mission with `i18n_lang: fr` got a French menu and English labels). They are now translated after the settings are in place. | `fix/FIX-CONFIG-LABELS-I18N-LANG` | -| [`FIX-TROOP-UNLOAD-TRANSPORT`](FIX-TROOP-UNLOAD-TRANSPORT/PRD.md) | merged (PR #313) — 1 ticket ([drop the troops again](FIX-TROOP-UNLOAD-TRANSPORT/tickets/01-drop-the-troops-again.md)) | Found while preparing FEAT-TROOP-GESTURE-EVENTS: the scripted troop drops (`ctld.unloadTransport`, `ctld.unloadInProximityToEnemy`) called a troop manager method that no longer exists and raised an error. They drop the troops again with the v1 rules (back to the stock in a pickup zone, otherwise every group dropped; the proximity drop for AI transports only). | `fix/FIX-TROOP-UNLOAD-TRANSPORT` | -| [`FEAT-TROOP-GESTURE-EVENTS`](FEAT-TROOP-GESTURE-EVENTS/PRD.md) | merged (PR #311) — verified in game (live scenario 17/17, 2026-11-18) — 3 tickets (01 [unloaded](FEAT-TROOP-GESTURE-EVENTS/tickets/01-troops-unloaded.md), 02 [loaded and returned](FEAT-TROOP-GESTURE-EVENTS/tickets/02-troops-loaded-and-returned.md), 03 [extracted and migration guide](FEAT-TROOP-GESTURE-EVENTS/tickets/03-troops-extracted-and-migration-guide.md)) | Issue #308 (VMCT): four troop gestures (drop on the ground, load in a pickup zone, field extraction, return to the zone) publish no event, so a layer that followed them through the v1 callbacks loses four of its twelve gestures. Four new events (`OnTroopsLoaded`, `OnTroopsUnloaded`, `OnTroopsExtracted`, `OnTroopsReturned`), on the model of the vehicle ones, for players and AI transports; the migration guide is corrected. | `feat/FEAT-TROOP-GESTURE-EVENTS` | -| [`FIX-AUTO-UNPACK-SILENT-FAILURE`](FIX-AUTO-UNPACK-SILENT-FAILURE/PRD.md) | merged (PR #307) — 1 ticket ([tell the dropper and log the truth](FIX-AUTO-UNPACK-SILENT-FAILURE/tickets/01-tell-the-dropper-and-log-the-truth.md)) | Issue #294: a parachuted equipment crate that cannot be unpacked on landing (JTAC limit, group refused by DCS) failed in silence and the log announced a success. The pilot who dropped it is now told why, and the log says "unpacked" only when it was. | `fix/FIX-AUTO-UNPACK-SILENT-FAILURE` | -| [`FIX-SCENE-PACK-WHILE-LAYING-OUT`](FIX-SCENE-PACK-WHILE-LAYING-OUT/PRD.md) | merged (PR #304) — verified in game (2026-11-09) — 1 ticket ([stop the scene before destroying it](FIX-SCENE-PACK-WHILE-LAYING-OUT/tickets/01-stop-the-scene-before-destroying-it.md)) | Found while checking an observation of the FIX-CREATE-BEFORE-DESTROY live check (2026-11-09): a FARP packed during the thirty seconds or so it takes to lay itself out leaves orphan objects (repair truck, tent, guards, lights), because its remaining steps keep running after the pack. Packing a scene now stops it first when it has not finished. | `fix/FIX-SCENE-PACK-WHILE-LAYING-OUT` | -| [`FIX-AA-CRATE-REGISTRY`](FIX-AA-CRATE-REGISTRY/PRD.md) | merged (PR #302) — verified in game (live scenario 24/24, 2026-11-09) — 1 ticket ([consume through the crate manager](FIX-AA-CRATE-REGISTRY/tickets/01-consume-through-the-crate-manager.md)) | Found on the live check of FIX-CREATE-BEFORE-DESTROY (2026-11-09): after an AA repair or rearm, the repair or launcher crate keeps its entry in the crate registry and still counts as on the ground. Both paths now consume the crate through the crate manager, as the assembly does. | `fix/FIX-AA-CRATE-REGISTRY` | -| [`FIX-CREATE-BEFORE-DESTROY`](FIX-CREATE-BEFORE-DESTROY/PRD.md) | merged (PR #300) — 06 ✅ verified in game (Zip, 2026-11-09) — 6 tickets (01 [helper, ADR 0028, vehicle pack](FIX-CREATE-BEFORE-DESTROY/tickets/01-helper-adr-and-vehicle-pack.md), 02 [FARP scene pack](FIX-CREATE-BEFORE-DESTROY/tickets/02-farp-scene-pack.md), 03 [Fat Cow FARP pack](FIX-CREATE-BEFORE-DESTROY/tickets/03-fat-cow-farp-pack.md), 04 [unpack to a unit](FIX-CREATE-BEFORE-DESTROY/tickets/04-unpack-to-a-unit.md), 05 [AA rearm and repair](FIX-CREATE-BEFORE-DESTROY/tickets/05-aa-system-rearm-repair.md), 06 [live check](FIX-CREATE-BEFORE-DESTROY/tickets/06-live-check.md)) | Issue #293 (Zip, 2026-11-09, widened to every destructive action): an action that replaces one thing by another (pack a vehicle, a FARP or a Fat Cow FARP, unpack crates, rearm or repair an AA system) destroyed the original first, so a DCS refusal lost it. Create the replacement first, all or nothing, and destroy the original only once it exists. | `fix/FIX-CREATE-BEFORE-DESTROY` | -| [`FIX-FAT-COW-HELICOPTERS-ONLY`](FIX-FAT-COW-HELICOPTERS-ONLY/PRD.md) | merged (PR #285) — 1 ticket ([helicopters only](FIX-FAT-COW-HELICOPTERS-ONLY/tickets/01-helicopters-only.md)); verified in game (Zip, 2026-11-05) | An aeroplane got the AI Fat Cow menu and could request a cow (Zip, A-10, 2026-11-01): the menu and the request are now a helicopter's only, as taking a cow over already was. | `fix/fat-cow-helicopters-only` | -| [`FEAT-FAT-COW-LEAVE-FARP`](FEAT-FAT-COW-LEAVE-FARP/PRD.md) | merged (PR #286) — 2 tickets (01 [leave and pick up](FEAT-FAT-COW-LEAVE-FARP/tickets/01-leave-and-pick-up.md), 02 [live check](FEAT-FAT-COW-LEAVE-FARP/tickets/02-live-check.md) ✅); verified in game (Zip, 2026-11-05) | Zip, 2026-11-03: a loadout sets its crates on the ground to be loaded, like CTLD; a piloted Fat Cow's FARP stays open when the CH-47 takes off (the crates are consumed at deploy) and outlives its helicopter; any piloted cow of the coalition landed within 150 m packs it back into crates on the ground. AI cows unchanged. | `feature/fat-cow-leave-farp` | -| [`FIX-FAT-COW-AI-LANDING`](FIX-FAT-COW-AI-LANDING/PRD.md) | merged (PR #278) — 1 ticket ([clearing and vanished cow](FIX-FAT-COW-AI-LANDING/tickets/01-clearing-and-vanished-cow.md)); live check PASS 2026-10-30, with FEAT-FAT-COW-TAKEOVER ticket 02 | Found on the take-over live check (2026-10-30): an AI cow landing 120 m left of its leader struck a tree, and DCS fired no death event, leaving a ghost cow. It now lands in the nearest clearing (`Disposition.getSimpleZones`), and the 10 s loop forgets a cow whose unit is gone. | `fix/fat-cow-ai-landing` | -| [`FEAT-FAT-COW-TAKEOVER`](FEAT-FAT-COW-TAKEOVER/PRD.md) | merged (PR #277) — 02 ✅ verified in game (Zip, 2026-11-05) — 01 ✅ [go home, say so, take over](FEAT-FAT-COW-TAKEOVER/tickets/01-go-home-say-so-take-over.md), 02 [live check](FEAT-FAT-COW-TAKEOVER/tickets/02-live-check.md) | An AI Fat Cow that lost its flight goes home instead of vanishing on the spot (Marteau du Golan, 2026-10-29: a landing event right after the re-task was taken for its arrival), tells the helicopter flights that could take it over; **Take over a Fat Cow** lists every cow flying home (lost flight or RTB) or released where it stands (**Release the Fat Cow**), nearest first with its distance. | `feature/fat-cow-takeover` | -| [`FIX-CONFIG-NEW-LISTS`](FIX-CONFIG-NEW-LISTS/PRD.md) | merged (PR #275) — 1 ticket ([date the lists](FIX-CONFIG-NEW-LISTS/tickets/01-date-the-lists.md)) | A list the catalogue gained after a mission configuration's version takes its default instead of reading as removed: the Fat Cow lists were empty on every `2.2.0` configuration (ADR 0011 Addendum 3). | `fix/config-new-lists-default` | -| [`FEAT-FAT-COW`](FEAT-FAT-COW/PRD.md) | merged (PR #273) — 06 ✅ (passed in use, Zip 2026-11-04) — 01 spike ✅ (a runtime Invisible FARP serves, enforces a finite stock, and needs only a FARP Fuel Depot as supplier), 02-05 ✅ | A CH-47 that lands in the field and becomes a forward refuel/rearm point (AI escort of a flight, or player-flown with cow crates), stocked with what it carries. | `feature/fat-cow` | -| [`FIX-I18N-TRANSLATE-ALIAS`](FIX-I18N-TRANSLATE-ALIAS/PRD.md) | merged (PR #269) — 1 ticket ([JTAC through tr, guard sees the alias](FIX-I18N-TRANSLATE-ALIAS/tickets/01-jtac-through-tr-and-guard-sees-the-alias.md)) | The 16 JTAC radio keys reach the four dictionaries; the JTAC module calls ctld.tr and the generator also recognises the alias. | -| [`FIX-FARP-PACK-FALSE-SUCCESS`](FIX-FARP-PACK-FALSE-SUCCESS/PRD.md) | merged (PR #268) — 1 ticket ([report the crates created](FIX-FARP-PACK-FALSE-SUCCESS/tickets/01-report-the-crates-created.md)) | Packing a FARP now reports a pack that created no crate, or only some, instead of always announcing a success. | -| [`FIX-UNPACK-FALSE-SUCCESS`](FIX-UNPACK-FALSE-SUCCESS/PRD.md) | merged (PR #267) — 1 ticket ([announce success only on true](FIX-UNPACK-FALSE-SUCCESS/tickets/01-announce-success-only-on-true.md)) | The Unpack Crate click no longer announces a success when a JTAC limit or a missing spawn position produced nothing. | -| [`FEAT-JTAC-LOG-REAL-LASER-CODE`](FEAT-JTAC-LOG-REAL-LASER-CODE/PRD.md) | merged (PR #287) — 01 ✅ verified in game (Zip, 2026-11-05) — 1 ticket ([01 log the code, then measure the LSS](FEAT-JTAC-LOG-REAL-LASER-CODE/tickets/01-log-the-code-then-measure-the-lss.md)) | Reported by VMCT from the Sinai Open Training v6 (2026-10-12): Reaper 1 (imposed 1511) claimed nine targets in an hour, yet an A-10C's TGP LSS on 1511 at 15 nm found no spot. The log holds only claim and release, never the code or the spot, so the report cannot be settled. Log both, then test the hypotheses (code, LSS range, line of sight, shared code). | `feature/jtac-log-real-laser-code` | -| [`FIX-MENU-STABLE-ENTRIES`](FIX-MENU-STABLE-ENTRIES/PRD.md) | merged (PR #261) — 04 ✅ verified in game (Zip, 2026-11-05) — D1-D4 confirmed as recommended (2026-10-09) — 4 tickets (01 ✅ [measure DCS id reuse](FIX-MENU-STABLE-ENTRIES/tickets/01-measure-dcs-id-reuse.md), 02 ✅ [render by difference](FIX-MENU-STABLE-ENTRIES/tickets/02-render-by-difference.md), 03 ✅ [drop the ambient delay + ADR 0027](FIX-MENU-STABLE-ENTRIES/tickets/03-drop-ambient-delay-and-adr.md), 04 [live check](FIX-MENU-STABLE-ENTRIES/tickets/04-live-check.md)) | Issue #257: wrong F10 commands persist after ADR 0015. DCS reuses a removed entry's id for the next entry created, so the full wipe + rebuild of each refresh (immediate or 4 s later) repoints every entry of a screen left open. Render by difference so an unchanged entry keeps its id, and park each freed id on an inert command for a group no player holds (measured 2026-10-09, shipped in VMCT #1113). | — | -| [`FIX-REVIEW-HYGIENE-B`](FIX-REVIEW-HYGIENE-B/PRD.md) | merged (PR #260) — 3 tickets (01 [scheduler remove exit](FIX-REVIEW-HYGIENE-B/tickets/01-scheduler-remove-exit.md), 02 [scene pack through the aligned spawn](FIX-REVIEW-HYGIENE-B/tickets/02-scene-pack-through-aligned-spawn.md), 03 [row requires a declared crate size](FIX-REVIEW-HYGIENE-B/tickets/03-row-requires-a-declared-crate-size.md)) | Issues #253, #254, #255 from the automated review of `affd2c9`: FARP packing bypasses the ADR 0024 placement (and broadcasts a debug line to every player); a crate model without `size` gets a row computed on 1.5 m (every crate of a `slingLoad` mission); timers cancelled by id never leave `ctld.scheduler._pending`. | — | -| [`FIX-SPAWN-COUNTRY-FALLBACK`](FIX-SPAWN-COUNTRY-FALLBACK/PRD.md) | merged (PR #256) — 2 tickets (01 [country of the coalition](FIX-SPAWN-COUNTRY-FALLBACK/tickets/01-country-of-the-coalition.md), 02 [failed creation visible](FIX-SPAWN-COUNTRY-FALLBACK/tickets/02-failed-creation-visible.md)) | Reported by VMCT from a campaign mission (2026-10-09): with only CJTF Blue / CJTF Red in the coalitions, a requested crate never appears. Spawn sites without a country default to USA / Russia, which are in no coalition there, and `dynAddStatic` swallows the DCS error. One helper resolves the country (the unit's, else one of the coalition, else USA / Russia), and a failed creation is logged and told to the group. | `fix/FIX-SPAWN-COUNTRY-FALLBACK` | -| [`FIX-JTAC-IMPOSED-CODE-AND-RADIO`](FIX-JTAC-IMPOSED-CODE-AND-RADIO/PRD.md) | merged (PR #258) — 4 tickets (01 [imposed code reserved](FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/01-imposed-code-reserved.md), 02 [supplied radio kept](FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/02-supplied-radio-kept.md), 03 [valid laser codes](FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/03-valid-laser-codes.md), 04 [late-activated not coded](FIX-JTAC-IMPOSED-CODE-AND-RADIO/tickets/04-late-activated-not-coded.md)); 1199 refused and the template not coded at start, verified in game (Zip, 2026-11-05) | Reported by VMCT from the Syria Open Training v6 (2026-10-02): an ASSETS drone imposed on 1688 shared the code with a catalogue drone INIT-C had coded automatically, and announced itself on the code-derived frequency instead of the one VEAF passed. An imposed code never leaves the pool (and goes back in on death), INIT-C codes before VEAF imposes, and `CTLDJTAC:new` always recomputes the radio. | — | ### Planned lots @@ -128,36 +101,54 @@ Completed lots are compacted under `archive/.md`. | [`FEAT-EXTR-GROUP-NAMING-CONVENTION`](archive/FEAT-EXTR-GROUP-NAMING-CONVENTION.md) | merged (PR #200) | Formalizes the `dev/roadmap.md` "extractableGroups — détection automatique par convention de nommage" entry + a `grill-with-docs` session (2026-09-27): a pre-placed group named `EXTR_` in the Mission Editor becomes extractable with no `extractableGroups` config entry needed. Bare prefix, no positional metadata (unlike `TRZ_`) — coalition is already read live from the DCS group object. Scans `coalition.getGroups(side)` on RED+BLUE+NEUTRAL, init-only (no late-activation, same acknowledged gap as "Zones dynamiques"), deduplicated union with the existing explicit list so a group named both ways registers once. New `CONTEXT.md` term "Auto-discovered group" (sibling to "Auto-discovered zone"), retroactively covering the existing JTAC/`SVNT_` conventions. | | [`FEAT-EXZ-AUTODISCOVERY`](archive/FEAT-EXZ-AUTODISCOVERY.md) | merged (PR #181) | Formalizes the `grill-with-docs` session (2026-09-23) on the `dev/roadmap.md` "AIZ_" entry, opened while diagnosing why `Test_CTLDNEXT_01.miz`'s AI zones silently stopped working during `FIX-UH1H-CAPABILITIES-REALISM`. Two pieces: (1) the dev/test mission gets a real per-mission `ctld.configUser` (via `ctld-tools`' "configuration only" install) declaring the `aiZones` the live regression scenarios need, instead of a session-scoped HTTP workaround — verified live from a full DCS restart across F-176/MT-07/MT-11–14; (2) `EXZ_` (extraction zone) gains naming-convention auto-discovery alongside `TRZ_`/`LGZ_`/`WPZ_` — format `EXZ___`, registered under its **full** DCS zone name (not a parsed short name, deliberately avoiding `TRZ_`'s own collision class, `ADR 0016`) — plus the mission-maker docs it never had. | | [`FEAT-FARP-TROOP-PICKUP`](archive/FEAT-FARP-TROOP-PICKUP.md) | merged (PR #137) | Follows `FIX-FOB-TROOP-PICKUP` (PR #136): a built FARP has **no** troop-pickup capability at all today, unlike a FOB. New `troopPickupAtFARP` (default `true`) + dedicated `farpTroopPickupRadius` (150 m) make a scripted FARP (`farpScene`/`FARP Alpha`/`Countryside FARP`) register a troop zone on build, reusing `registerFOBAsTroopZone`/`unregisterTroopZone` as-is. Destruction detection needs **no new manager** — a FARP is a real DCS `Airbase` object (binary `isExist()`), so it reuses `CTLDStaticWatcher`, already proven for this exact object class by the recon FARP-detection code. Deliberately not the generic "zone ↔ owner link" system (`dev/roadmap.md`) — grilled explicitly, rejected as premature since the FARP case needed no new lifecycle mechanism. | +| [`FEAT-FAT-COW`](archive/FEAT-FAT-COW.md) | merged (PR #273) — 06 ✅ (passed in use, Zip 2026-11-04) | A CH-47 that lands in the field and becomes a forward refuel/rearm point (AI escort of a flight, or player-flown with cow crates), stocked with what it carries. | +| [`FEAT-FAT-COW-LEAVE-FARP`](archive/FEAT-FAT-COW-LEAVE-FARP.md) | merged (PR #286) — 02 live check ✅, verified in game (Zip, 2026-11-05) | Zip, 2026-11-03: a loadout sets its crates on the ground to be loaded, like CTLD; a piloted Fat Cow's FARP stays open when the CH-47 takes off (the crates are consumed at deploy) and outlives its helicopter; any piloted cow of the coalition landed within 150 m packs it back into crates on the ground. AI cows unchanged. | +| [`FEAT-FAT-COW-TAKEOVER`](archive/FEAT-FAT-COW-TAKEOVER.md) | merged (PR #277) — 02 ✅ verified in game (Zip, 2026-11-05) | An AI Fat Cow that lost its flight goes home instead of vanishing on the spot (Marteau du Golan, 2026-10-29: a landing event right after the re-task was taken for its arrival), tells the helicopter flights that could take it over; **Take over a Fat Cow** lists every cow flying home (lost flight or RTB) or released where it stands (**Release the Fat Cow**), nearest first with its distance. | | [`FEAT-JTAC-DRONE-GLOBALS`](archive/FEAT-JTAC-DRONE-GLOBALS.md) | merged (PR #73) | **Lot C** — drone orbit parameters become global settings. FullGas proposed a `specificParams` sub-panel; decided to remove the concept instead. Four globals **rebased on today's per-crate values** so only the chosen change lands: `JTAC_droneAltitude` 4000→**3000**, new `JTAC_droneRadiusNoLase` 2000 / `JTAC_droneRadiusOnLase` 1000 / `JTAC_droneSpeed` 150; `JTAC_droneRadius` retired (one key cannot express both radii). `specificParams` leaves the schema, the catalogue **and** the engine, with a startup NOTICE for stale configs — `validate` and `version-gap` are both blind to a field nested inside a crate entry. Also aligns spawn and orbit altitude, which diverge today. The troop-path `specificParams.task` (Feature I) is untouched. CHANGELOG: in-flight behaviour change. Parallel with A/B/D. | +| [`FEAT-JTAC-LOG-REAL-LASER-CODE`](archive/FEAT-JTAC-LOG-REAL-LASER-CODE.md) | merged (PR #287) — 01 ✅ verified in game (Zip, 2026-11-05) | Reported by VMCT from the Sinai Open Training v6 (2026-10-12): Reaper 1 (imposed 1511) claimed nine targets in an hour, yet an A-10C's TGP LSS on 1511 at 15 nm found no spot. The log holds only claim and release, never the code or the spot, so the report cannot be settled. Log both, then test the hypotheses (code, LSS range, line of sight, shared code). | | [`FEAT-MOVING-ZONE`](archive/FEAT-MOVING-ZONE.md) | ✅ merged (PR #49) | Resolve CTLD zone positions lazily via `trigger.misc.getZone()` so zones attached to a DCS Moving Zone follow their anchor unit. | | [`FEAT-NATIVE-CRATE-SPAWN-NEAR`](archive/FEAT-NATIVE-CRATE-SPAWN-NEAR.md) | merged (PR #221) | Follows the roadmap entry on the Pack spawn distance for the Mi-8MT: crates for a native-cargo aircraft appeared 23 m or more away (UserBox diagonal + 5 m, +5 m per extra crate) while DCS loads a crate natively only from about 5 m. Each native-cargo type now declares a crate spawn sector (`side` for helicopters, `rear` for the C-130J-30) and distance, from the model's collision shell at crate height plus 1.5 m; crates stand in a row `crate size + 0.5 m` apart; a type with no value keeps the old rule. Vehicles, unpack distance, scenes and troops are untouched (**ADR 0024**). | | [`FEAT-NON-TRANSPORT-PILOTS`](archive/FEAT-NON-TRANSPORT-PILOTS.md) | merged (PR #153) | **A fighter pilot gets the CTLD functions that concern him.** Closes [#150](https://github.com/VEAF/CTLD/issues/150). Recon works for any pilot, aircraft included — but with `addPlayerAircraftByType = false` a pilot absent from `transportPilotNames` had **no CTLD menu at all**, because `onPlayerEnterUnit` returned before registering him. A setting meant to reserve the *transport* menus for a named list was cutting every function that has nothing to do with transport. Measured rather than assumed: **17 `isTransport` guards already exist inside the sections**, so the default configuration already hands a fighter a menu in which every transport section closes itself — which is why this lot needs no `requiresTransport` field and no section-by-section arbitration. The whitelist now decides `isTransport` instead of registration, forced to `false` **whatever the aircraft type** (a Huey off the list must not recover the transport menus through capability detection, or the setting means nothing). Four menu decisions on top: **smoke** opens to everyone (it drops at the player's own position and reads no cargo), **`List Beacons`** opens while beacon placement stays transport-only, **`JTAC Status`** was already open, and **`Check Cargo`** is now hidden since it could only ever report an empty hold. Also takes the `S_EVENT_BIRTH` safety net into `CTLDPlayerManager` and **deletes `CTLDPlayerTracker`** (~150 lines, never instantiated since 2026-04-02). Changes a documented guarantee, so both languages of the mission-maker and developer docs move with it. | | [`FEAT-ONE-CLICK-INSTALL`](archive/FEAT-ONE-CLICK-INSTALL.md) | merged (PR #92) | **The Mission Maker's entry point becomes the tool**: download `ctld-tools.exe`, run it, and the engine, the beacon sounds, the configuration and the triggers all go into the `.miz` — the VMCT model. Today that is five manual steps, and step 3 bites hardest: `beacon.ogg` / `beaconsilent.ogg` are **not release assets** (repo-only, in `assets/`), so a mission ships with silent beacons and nothing says why. Decided: the exe **carries** CTLD + the sounds rather than downloading them (+7% on a 21 MB exe, works offline, an exe can only install its own release's engine — and the `--add-data` mechanism already bundles the YAML and the schema); everything lands as **files** with `DO SCRIPT FILE` triggers, config before engine; and the tool can **read a configuration back out of a `.miz`**, which is trivial once the config travels as a file instead of an escaped Lua string inside `mission`. Read VMCT's mission builder for the resource-key plumbing rather than reinventing it. | | [`FEAT-PARACHUTE-DROP-GATE`](archive/FEAT-PARACHUTE-DROP-GATE.md) | merged (PR #198) | Formalizes the `dev/roadmap.md` "Parachutage — garde générale d'activation" entry + a `grill-with-docs` session (2026-09-27): a new global `enableParachuteDrop` setting (default `true`, `group: parachute`, `standard: true`) acts as a first-rank gate ahead of the existing per-aircraft `canParachuteDrop` — when `false`, all three parachute F10 entries (Crates/Troops/Vehicle) disappear for every aircraft regardless of its own capability. No centralized `registerMenuSection`-style mechanism and no shared capability-predicate helper: the flag is checked inline at the 5 existing call sites across 3 files, matching the codebase's own no-helper convention for capability checks (**ADR 0019**). | | [`FEAT-TOOL-VERSION-AND-DOCS`](archive/FEAT-TOOL-VERSION-AND-DOCS.md) | merged (PR #93) | A help button worth pressing, linking to the documentation **of the tool's own version** — which needs two missing bricks. The tool does not know its version (`pyproject.toml` still says `0.1.0`, the API declares `version="2.0"` as a literal, no `--version`), and the published docs have exactly one version (`versions.json` = `dev` only; `docs.yml` deploys on push to `develop`, nothing on a tag). Decided: one source of truth — the tool reports `ctld.VERSION` — plus `mike deploy` on `published-v*` tags, where a **stable** moves the `latest` alias and a **pre-release does not**, same discipline as `published-latest` for downloads. Until stable ships, the link rule is `dev` for any `-rc` version and the exact `x.y.z` otherwise: honest today, correct by itself the day a stable is tagged. | +| [`FEAT-TROOP-GESTURE-EVENTS`](archive/FEAT-TROOP-GESTURE-EVENTS.md) | merged (PR #311) — verified in game (live scenario 17/17, 2026-11-18) | Issue #308 (VMCT): four troop gestures (drop on the ground, load in a pickup zone, field extraction, return to the zone) publish no event, so a layer that followed them through the v1 callbacks loses four of its twelve gestures. Four new events (`OnTroopsLoaded`, `OnTroopsUnloaded`, `OnTroopsExtracted`, `OnTroopsReturned`), on the model of the vehicle ones, for players and AI transports; the migration guide is corrected. | | [`FEAT-TROOP-ZONE-SCRIPTED-API`](archive/FEAT-TROOP-ZONE-SCRIPTED-API.md) | merged (PR #129) | `CTLDZoneManager:createTroopZoneAtObject(objectName, trzName)` — a scripted way to add a pickup-capable `TRZ_` troop zone on any named DCS object (Mission Editor zone, unit, static, group, or airbase/FARP) after init, generalizing a FOB-only idea from `dev/roadmap.md`. `trzName` reuses the existing `TRZ_` naming convention (promoted `_parseTRZ` → `parseTRZ`) so coalition/stock/flag/target come from the same syntax as an editor-placed zone; the zone anchors to the resolved object when it can move (`dcsName` for a Moving Zone, `linkedUnit` for a unit/static/group), fixed otherwise (airbase/FARP). No new removal function — the existing `removeExtractZone` already works. Direct precedent: `createExtractZone`/`removeExtractZone` and the beacon scripted API (`FEAT-VMCT-INTEGRATION` ticket 03). | | [`FEAT-TRUCK-MOBILE-PICKUP-ZONE`](archive/FEAT-TRUCK-MOBILE-PICKUP-ZONE.md) | done (verified, no PR) | Formalizes `dev/roadmap.md`'s "Pickup zone mobile sur un camion de transport" entry (requested 2026-08-26) — a **verification-first** lot with no code change. New live-DCS integration scenario (`tests/dcs/noPlayer/scenario_truck_anchor.lua`) confirms `createTroopZoneAtObject`/`linkedUnit` already anchor a `TRZ_` to a moving ground vehicle correctly — position tracking, `isDynamic()`, and freeze-at-last-position on destruction, identical to the already-proven ship case. Run live 2026-09-28 against `Test_CTLDNEXT_01.miz`'s `truckai_anchor_test` (a late-activated truck group with a short road route): `PASS 4/4`. | | [`FEAT-TRZ-DYNAMIC-OBJECT-AUTODISCOVERY`](archive/FEAT-TRZ-DYNAMIC-OBJECT-AUTODISCOVERY.md) | merged (PR #217) | Formalizes `dev/roadmap.md`'s "TRZ_ automatique" + "Zones dynamiques" entries, grilled jointly (2026-09-28): `TRZ_____` is now also recognized on a **static, unit, or group** (bunker, convoy, ship) — not just a Mission-Editor trigger zone — detected continuously (init + `S_EVENT_BIRTH`), reusing `createTroopZoneAtObject`'s existing resolution/construction path, no config toggle. Any dynamic zone create/remove (troop or logistic) now refreshes the F10 menu for every tracked ground player, closing the "player already standing there" gap. A destroyed anchor now **really removes** its troop zone (name freed) instead of freezing forever — retroactive fix for the existing ship/truck cases too, via `S_EVENT_DEAD` (unit/group) or `CTLDStaticWatcher` polling (static), per **ADR 0021**. | | [`FEAT-USERCONFIG-API`](archive/FEAT-USERCONFIG-API.md) | ✅ merged (PR #45) | Replace broken Section 2 of `CTLD_userConfig.lua` with a safe MM API (`ctld.userSetup` callbacks + helpers), relocate `injectAACrates` to bootstrap, fix all parity bugs in userConfig template. | | [`FEAT-VMCT-INTEGRATION`](archive/FEAT-VMCT-INTEGRATION.md) | merged (PR #80) | What CTLD 2 must expose so the VEAF Mission Creation Tools can drop their v1 engine. VMCT switches to CTLD 2 in one move, moves its configuration out to a dedicated `ctld-config.yaml` injected by its build, and keeps only the bridge code by which its runtime modules talk to CTLD. Auditing those bridges found three gaps, all the same shape — **a caller that is not a pilot in a cockpit**: logistic points cannot be declared **by unit type** (01) nor ship pickup points (02), so 50 lines of mission-scanning live in VMCT for want of a hook, hand-written ten unit names at a time by everyone else; and **no beacon can be created without a `transport` and a `player`** (03), although `dropBeacon` already takes an `overridePosition` and an `isFOB` — a scripted FARP simply cannot carry a beacon. Ticket 02 also fixes the existing ship-backed troop zone, snapshotted at init and therefore left behind by a carrier under way. | +| [`FIX-AA-CRATE-REGISTRY`](archive/FIX-AA-CRATE-REGISTRY.md) | merged (PR #302) — verified in game (live scenario 24/24, 2026-11-09) | Found on the live check of FIX-CREATE-BEFORE-DESTROY (2026-11-09): after an AA repair or rearm, the repair or launcher crate keeps its entry in the crate registry and still counts as on the ground. Both paths now consume the crate through the crate manager, as the assembly does. | | [`FIX-AASYSTEM-NOCRATE-LINGERS`](archive/FIX-AASYSTEM-NOCRATE-LINGERS.md) | merged (PR #148) | Reported by **a.lingo**: after assembling a HAWK AA system, the F10 Unpack Crate menu kept showing a crate as still available. Found by code reading (no live repro — see PRD): `Hawk pcp`/`Hawk cwar` ([CTLD_aasystem.lua](../src/CTLD_aasystem.lua)) are `NoCrate = true` parts that nonetheless get a real, individually-loadable `spawnableCrates` entry each ([CTLD_config.yaml](../src/CTLD_config.yaml)) — deliberately, per `docs/developer/subsystems/aa.md`. `_assemble()`'s crate-collection loop counts a real ground crate found for one of these parts toward completeness, but its destruction loop unconditionally skips every `NoCrate` part, so that real crate is never destroyed and lingers in the Unpack menu forever. Same pattern confirmed for Patriot AMG; S-300's own `NoCrate` part has no catalogue entry and is unaffected. Fix: destroy every crate actually found for a `NoCrate` part too (bypassing the non-`NoCrate` "how many crates per system" arithmetic, which doesn't apply to an always-satisfied part) — one generic change, fixes both systems. | | [`FIX-AASYSTEM-UNPACK-BUGS`](archive/FIX-AASYSTEM-UNPACK-BUGS.md) | merged (PR #101) | Two AA system unpack bugs: stale F10 menu after assembly (missing `OnCrateCleared`), and overlapping unit spawn for multi-unit parts (wrong arc-step formula in `_buildSpawnArrays`). | | [`FIX-AI-C2-BUGS`](archive/FIX-AI-C2-BUGS.md) | ✅ merged (PR #30) | Two bugs in the AI transport C2 (virtual stock) path: wrong activation guard when a physical vehicle is weight-rejected (Bug 1), and invalid typeName `M1025 HMMWV Armament` in example config causing s | | [`FIX-AIZONE-NAME-COLLISION`](archive/FIX-AIZONE-NAME-COLLISION.md) | merged (PR #88) | An `aiZones` entry whose `dcsZoneName` is already a registered troop zone is **skipped in silence** — no WARN, no NOTICE, no log line — leaving the mission maker an AI zone that does nothing. Reachable by accident: a TRZ registers under its **parsed** name, so `TRZ_dropzone1_B_0_nil_0` occupies the key `dropzone1` and an `aiZones` entry on a genuinely different ME zone called `dropzone1` collides with it. The obvious way in is the workaround the migration guide documents — superimposing an inert `TRZ_` marker on an AI drop-off zone, which is never smoked — where naming the marker after the AI zone disables it. `_validateZoneNames` already reports four other `entry ignored` cases as ERROR; this is the only one that says nothing. Found while reading for `FIX-DROPOFFZONES-PARITY` ticket 01. | +| [`FIX-AUTO-UNPACK-SILENT-FAILURE`](archive/FIX-AUTO-UNPACK-SILENT-FAILURE.md) | merged (PR #307) | Issue #294: a parachuted equipment crate that cannot be unpacked on landing (JTAC limit, group refused by DCS) failed in silence and the log announced a success. The pilot who dropped it is now told why, and the log says "unpacked" only when it was. | | [`FIX-AUTODISCOVERED-ZONE-FULLNAME-KEY`](archive/FIX-AUTODISCOVERED-ZONE-FULLNAME-KEY.md) | merged (PR #210) | Formalizes `dev/roadmap.md`'s "Piège du nom court..." entry + a `grill-with-docs` session (2026-09-27): `TRZ_`/`LGZ_`/`WPZ_` zones (and the scripted `createTroopZoneAtObject` API) register under a parsed short name instead of their full DCS/caller-given name, letting an unrelated `aiZones` entry silently lose to one by accident (`FIX-AIZONE-NAME-COLLISION`, PR #88, only ever detected this, never fixed it). Verified during the grill that all 4 registration sites share the trap, not just `TRZ_` as the roadmap assumed. Fix: register under the full name everywhere, matching `EXZ_`'s already-correct behavior — deliberately **no backward-compatible short-name fallback** (**ADR 0020**), accepted because the project is still pre-public-release. | | [`FIX-BEACON-FM-POOL-GAP`](archive/FIX-BEACON-FM-POOL-GAP.md) | merged (PR #140) | Reported by **Zip** ([GitHub issue #127](https://github.com/VEAF/CTLD/issues/127)): the FM beacon pool (`_buildFreqPools`) caps its tens digit at `s=0..5` instead of `0..9`, missing 160 of 460 possible 100 kHz steps (four gaps: 36.0–39.9, 46.0–49.9, 56.0–59.9, 66.0–69.9 MHz), including ordinary frequencies like 38.00 MHz. Confirmed inherited from legacy (`migration/source/CTLD.lua:6171`, same `s=0..5` shape) — fixing it is a legacy-parity deviation, which the issue explicitly requests. Confirmed as an artefact, not a deliberate exclusion: the legacy source carries a comment describing a never-implemented 4-digit/0.05 MHz scheme, and a dead loop right above the FM generator that reads as an uncleaned UHF-generator copy-paste. Minimal fix: widen `s` to `0..9`, closing the gaps at the existing 0.1 MHz granularity — the finer 0.05 MHz grid the dead comment gestures at is explicitly out of scope. | | [`FIX-BUILT-FILE-DOES-NOT-LOAD`](archive/FIX-BUILT-FILE-DOES-NOT-LOAD.md) | ✅ merged (PR #144) | `CTLD.lua` 2.0.0-rc8 did not load at all — a scene file's main-chunk log call hit the post-`FIX-CONFIG-NOT-LOADED-GUARD` refusal before `ctld.initialize()` ran; guarded the pre-init `debugScreenLog` read with `pcall` and added a CI `smoke` job that runs the built `CTLD.lua` under Lua 5.1. Released as 2.0.0-rc9. | | [`FIX-CANCELPENDING-URGENT-TIMER`](archive/FIX-CANCELPENDING-URGENT-TIMER.md) | merged (PR #154) | **A cancelled menu rebuild could still land on the next occupant of the slot** ([#152](https://github.com/VEAF/CTLD/issues/152)). `cancelPending` cancelled the *ambient* rebuild properly — that path stores its timer id — but the *urgent* (debounced) path stored only a flag, so clearing it left the timer scheduled and it fired regardless. DCS reuses a numeric group id for the next occupant, so the rebuild could wipe and rebuild a **different player's** menu 0.15 s into his flight: the exact misfire ADR 0015 and the ambient/urgent split exist to prevent. Only reachable at all since [#151](https://github.com/VEAF/CTLD/pull/151) — before it the leave handler raised before getting there, on every slot and coalition change. Two things came out of building it: removing the timer was **not enough** (the callback only checks that a menu exists, and in the reported case the new occupant has one), so the entry now doubles as the callback's claim on the group; and `cancelPending` could **raise** on the player-teardown path, aborting the cleanup #151 just repaired. The spec that agreed with the bug — asserting only that the flag was cleared, with a comment claiming the timer *could not* be retracted while the ambient branch ten lines below does exactly that — is rewritten. | | [`FIX-CATALOGUE-TRUTH`](archive/FIX-CATALOGUE-TRUTH.md) | merged (PR #72) | **Lot B** — the schema and catalogue describe what the engine actually reads. **Must precede lot D.** `tableFields.AIZones` → `aiZones` rewritten from `_loadAIZonesFromConfig` (the dead positional format PR #69 left behind); `GROUND_UNIT` purged (in no map — falls back to GROUND through the error path); `modTypes` `{}`→`[]` (the engine walks it with `ipairs`; the map shape is why the app fell through to `JsonEditor`) + a real description; dead `spawnableCratesModels[*].category` removed (never reaches DCS, and `dynAddStatic` forces `'Cargos'` anyway); hover-height reference frames stated per use — closes roadmap 5 as **no-bug**, wording only. Every closed value set it touches is declared as a `choices` list so a **hand-editing MM** reads the vocabulary in the schema, not in a Svelte component (backward-compatible: `/api/schema` drops unknown keys today, so no flag day with D). Plus `dropCrate` + `maxDropHeight` deleted (closes roadmap 4): no caller, absent from the legacy monolith, and superseded by the fully-wired `parachuteCrates` — the one ticket here that touches `src/`. | +| [`FIX-CONFIG-LABELS-I18N-LANG`](archive/FIX-CONFIG-LABELS-I18N-LANG.md) | merged (PR #314) | Issue #310 (VMCT): the `desc` / `name` labels of the configuration were translated before the settings were filled, so they followed the global language and ignored the snapshot's own `i18n_lang` (an English mission with `i18n_lang: fr` got a French menu and English labels). They are now translated after the settings are in place. | +| [`FIX-CONFIG-NEW-LISTS`](archive/FIX-CONFIG-NEW-LISTS.md) | merged (PR #275) | A list the catalogue gained after a mission configuration's version takes its default instead of reading as removed: the Fat Cow lists were empty on every `2.2.0` configuration (ADR 0011 Addendum 3). | | [`FIX-CONFIG-NOT-LOADED-GUARD`](archive/FIX-CONFIG-NOT-LOADED-GUARD.md) | merged (PR #141) | Reported by **Zip** ([GitHub issue #125](https://github.com/VEAF/CTLD/issues/125)): reading a CTLD setting before `ctld.initialize()` returns `nil` silently, then usually crashes a few lines later on ordinary arithmetic — a stack trace naming neither CTLD nor the missing init. Fix: a single guard in `CTLDConfig:getSetting` (not the issue's own suggestion of 18 per-manager `getInstance()` guards, nor `ctld.gs`) — the deepest choke point, catching every real call path plus the documented-but-unused direct `getSetting()` API. `error(msg, 0)` (message-only — a fixed stack level breaks for real tail-call sites in Lua 5.1). Confirmed compatible with `CTLD_i18n.lua`'s existing `pcall`-based pre-init tolerance — no regression there. | | [`FIX-CRATE-DROP-PLACEMENT`](archive/FIX-CRATE-DROP-PLACEMENT.md) | merged (PR #248) | From the `dev/roadmap.md` entry noticed in the live check of `FIX-NATIVE-CRATE-CTLD-ACTIONS`: *Drop Crate(s)* ignored the crate spawn plan of ADR 0024 and the anti-collision that Request Equipment uses, so a crate dropped on a native-cargo helicopter landed 20 m or more away, out of DCS's loading range. Placement is now two shared routines (plan row; radial rule, both with anti-collision); Drop uses them with one size per crate. New setting `crateDropExtraDistance` (default 2 m, catalogue **2.2.0**) keeps the dropped row slightly farther so the aircraft can leave without touching it (ADR 0024 addendum). Not yet confirmed in game. | | [`FIX-CRATE-ORIENTATION`](archive/FIX-CRATE-ORIENTATION.md) | merged (PR #249) | Raised by the maintainer in the live check of `FIX-CRATE-DROP-PLACEMENT` (UH-1H): a requested crate was not parallel to the helicopter. Every crate was created with a hard-coded heading of zero (north), for every aircraft. The crate-creation routines take an optional heading and the callers that have an aircraft — requested waves and single crates, packs, scene packs, menu drops and unloads, slingload release — pass its geographic heading; crates with no aircraft (mission maker, parachute landing) keep zero. Visible effect to be confirmed in game. | +| [`FIX-CREATE-BEFORE-DESTROY`](archive/FIX-CREATE-BEFORE-DESTROY.md) | merged (PR #300) — 06 ✅ verified in game (Zip, 2026-11-09) | Issue #293 (Zip, 2026-11-09, widened to every destructive action): an action that replaces one thing by another (pack a vehicle, a FARP or a Fat Cow FARP, unpack crates, rearm or repair an AA system) destroyed the original first, so a DCS refusal lost it. Create the replacement first, all or nothing, and destroy the original only once it exists. | | [`FIX-CTLD-TOOLS-AIZ-STOCK-GAP`](archive/FIX-CTLD-TOOLS-AIZ-STOCK-GAP.md) | merged (PR #180) | Formalizes the `dev/roadmap.md` "`ctld-tools` — aiZones : `troopStock`/`vehicleStock` absents..." entry (2026-09-24): `FEAT-CTLD-TOOLS-AIZ-SYNC` ticket 03's decision to leave a silently-added entry's stock absent relied on a validation warning that turns out not to exist anywhere in `ctld-tools`. Reading the actual engine code (`CTLD_core.lua`) showed the two fields fail asymmetrically — `troopStock` absent silently disables troop pickup entirely (no fallback), `vehicleStock` absent is a legitimate mode (the engine falls back to a physical-vehicle scan in the zone). Fix: both zone-creation paths (the naming-convention reconciliation and the manual "+ AI zone" button) now default `troopStock` to `{All: -1}` when cargo includes troops (never `vehicleStock`, which stays a deliberate choice), a matching `WARNING`-level validation check catches a hand-edited config that bypasses both paths, and an inline indicator marks an affected zone (on its summary heading and its specific field) — no `src/` change. | | [`FIX-CTLD-TOOLS-INTEGER-FIELDS`](archive/FIX-CTLD-TOOLS-INTEGER-FIELDS.md) | merged (PR #191) | Formalizes a `grill-with-docs` session (2026-09-24) on [GitHub issue #157](https://github.com/VEAF/CTLD/issues/157) ("Fields using decimals instead of integers"): `ctld-tools`' `EditorType` has no `integer` variant, so every numeric field — soldier counts in `loadableGroups`, `capabilitiesByType` onboard limits, `cratesRequired`, `aiZones` stock counts, and several scalar settings (JTAC quotas/limits, laser codes, `beaconTextSize`) — inherited whichever blanket `step` its rendering component hardcoded (`RecordListEditor`'s `step="0.01"`, `SettingRow`'s `step="any"`), none of it distinguishing a whole-number count from a legitimately continuous weight/distance/duration. Added a real `integer` `EditorType`, declared via a new schema annotation for scalar settings (an explicit, ADR-0018-documented exception to ADR 0011 Addendum 1's derive-don't-declare principle) and via the existing hardcoded field lists for the three bespoke table editors, paired with a `WARNING`-severity `validate` check for a value that bypassed the UI, plus an independent `spawnableCrates.side` mixed-set dropdown fix. | | [`FIX-CTLD-TOOLS-REVIEW`](archive/FIX-CTLD-TOOLS-REVIEW.md) | merged (PR #69) | Findings from FullGas's manual review of PR #68 — a data-corrupting editor, double-encoded FR text, a dead catalogue key, and three editor gaps | | [`FIX-CTLD-TOOLS-WEB-NODE-TYPES-GAP`](archive/FIX-CTLD-TOOLS-WEB-NODE-TYPES-GAP.md) | merged (PR #196) | Investigated why [Dependabot PR #193](https://github.com/VEAF/CTLD/pull/193)/[#194](https://github.com/VEAF/CTLD/pull/194) (duplicate `vitest` `3.2.0`→`5.0.1` bumps in `tools/ctld-tools/web`) both failed CI's "Web App (ctld-tools)" job identically: `tsconfig.app.json`'s `types` array never declared `"node"`, so `src/lib/i18n.parity.test.ts`'s genuine `node:fs`/`node:path`/`process` usage only type-checked before by accident of `vitest@3.2.0`'s own internal `.d.ts` import graph incidentally pulling in `@types/node`'s ambient globals — `vitest@5.0.1` restructured that graph and the accidental leak stopped. Fix: declared `"node"` explicitly, landed the bump for real, closed both duplicate PRs as superseded. | | [`FIX-DCS-OBJECT-NAME-COMPARISON`](archive/FIX-DCS-OBJECT-NAME-COMPARISON.md) | merged (PR #243) | Lot C of the automated review of `develop` (issues #236, #238), decided in a `grill-with-docs` session: "is this crate on board this transport?" was answered by name in four places and by DCS object identity in four others, so the Parachute Crates action, the slingload overspeed penalty and the capacity check could silently disagree; the hover hook-up also counted only slung crates against `maxCratesOnboard`. One by-name predicate for all eight sites, `maxCratesOnboard` a total as in the legacy script, and the troop-zone anchor-death removal compares names. Three neighbouring findings recorded in `dev/roadmap.md`. | | [`FIX-DROPOFFZONES-PARITY`](archive/FIX-DROPOFFZONES-PARITY.md) | merged (PR #83) | A v1 config's `dropOffZones` is **read by the legacy monolith and by nothing in `src/`** — an AI transport that used to auto-unload there simply stops, with no error, no NOTICE, no log line. Found by the doc audit for `2.0.0-rc2` (PR #75), which only removed the false claim from `zones.{md,fr.md}`. The setting carries **two** features: AI auto-unload of troops *and* vehicles (`ctld.checkAIStatus` via `ctld.inDropoffZone`), replaced — richer — by an `aiZones` entry with `isDropoff` + `aiDropMode`; and **smoke marking** on the periodic refresh, which `aiZones` appears not to support at all (to confirm — ticket 01). Not a reimplementation: a second spelling for one concept is what the last four lots removed. Delivers a startup NOTICE, a migration-guide entry (the guide has **zero** occurrences of `dropOffZones` today), and a written decision on whether an unmarkable AI zone is a deliberate choice or a gap worth its own lot. | +| [`FIX-FARP-PACK-FALSE-SUCCESS`](archive/FIX-FARP-PACK-FALSE-SUCCESS.md) | merged (PR #268) | Packing a FARP now reports a pack that created no crate, or only some, instead of always announcing a success. | +| [`FIX-FAT-COW-AI-LANDING`](archive/FIX-FAT-COW-AI-LANDING.md) | merged (PR #278) — live check PASS 2026-10-30, with FEAT-FAT-COW-TAKEOVER ticket 02 | Found on the take-over live check (2026-10-30): an AI cow landing 120 m left of its leader struck a tree, and DCS fired no death event, leaving a ghost cow. It now lands in the nearest clearing (`Disposition.getSimpleZones`), and the 10 s loop forgets a cow whose unit is gone. | +| [`FIX-FAT-COW-CLEARING-LOG`](archive/FIX-FAT-COW-CLEARING-LOG.md) | merged (PR #316) | Issue #299 (found by an automated review): the AI cow's clearing search (`Disposition.getSimpleZones`, undocumented) falls back to the raw landing point in five situations and logs none of them, so a DCS patch could bring back the tree strikes of 2026-10-30 without a trace. The API failures (singleton missing, error, wrong shape) get a `WARN` once per mission and per cause, the benign "no clearing" an `INFO` at every landing; the landing point does not change. Log only, no start-up alert. | +| [`FIX-FAT-COW-DEPLOY-REFUSALS`](archive/FIX-FAT-COW-DEPLOY-REFUSALS.md) | merged (PR #319) | Issue #296 (found by an automated review): the AI cow's deployment timer dropped the answer of `deploy`, so five of the six refusals (empty cow, airborne, scene, deployed, unknown) were silent, for the flight and for the log; the piloted cow's path already reported them. A flight whose cow was emptied, folded with Take off, then landed with Land here waited for an announced FARP that never came. The timer now reads the answer: an empty cow says so and advises RTB, the other refusals reuse the existing message, all are logged. | +| [`FIX-FAT-COW-EMPTY-AI-TYPE`](archive/FIX-FAT-COW-EMPTY-AI-TYPE.md) | merged (PR #318) | Issue #297 (found by an automated review): an empty `fatCowAIType` removed the whole Fat Cow menu from the pilots a cow serves (eight commands, FARP status included, and the commands of cows placed by the mission), while the guide, the schema and the editor say it removes only "Request a Fat Cow". The guard moves onto that one command; the rest of the menu stays, and the four texts say why. | +| [`FIX-FAT-COW-GROUND-TEST`](archive/FIX-FAT-COW-GROUND-TEST.md) | merged (PR #320) | Issue #295 (found by an automated review): the Fat Cow called DCS's raw `inAir()` at three places (deploying the FARP, Land here, Release the Fat Cow) instead of `ctld.utils.inAir`, which exists for high-chassis aircraft such as the CH-47 that read "in the air" at rest. A landed cow could be refused as airborne (its FARP never opened, the piloted cow read a wrong message), or, on release, lifted off from its open FARP. The three go through the shared helper; the tests used one flag for both forms and could not tell them apart. | +| [`FIX-FAT-COW-HELICOPTERS-ONLY`](archive/FIX-FAT-COW-HELICOPTERS-ONLY.md) | merged (PR #285) — verified in game (Zip, 2026-11-05) | An aeroplane got the AI Fat Cow menu and could request a cow (Zip, A-10, 2026-11-01): the menu and the request are now a helicopter's only, as taking a cow over already was. | +| [`FIX-FAT-COW-TAKEOVER-LABELS`](archive/FIX-FAT-COW-TAKEOVER-LABELS.md) | merged (PR #317) | Issue #298 (found by an automated review): the "Take over a Fat Cow" entries carried the cow's distance in their label, which is their identity (ADR 0027), and a 30 s timer rebuilt them, so an entry was recreated under the pilot's finger (a click fired a parked command and nothing happened), and two cows at the same rounded km shared a label and could be swapped. Every AI cow now has a number; the entry reads "Fat Cow #N — state", in the order of the numbers, with no distance and no periodic refresh; the three announcements name the cow and keep its distance. | | [`FIX-FIELD-EXTRACT-CASUALTIES`](archive/FIX-FIELD-EXTRACT-CASUALTIES.md) | merged (PR #111) | Field extraction (`embarkFromField`) returns the troop count frozen at deploy time instead of the survivor count — an undeclared legacy-parity deviation. Fix counts live DCS units (excluding `SVNT_*` servants) at extraction time; adds troop counts to the "Extract from field" menu labels; auto-despawns an orphaned mortar servant when its operator dies leaving zero real troops. Also fixed a pre-existing bug where `onUnitDead` never fired in-game. | | [`FIX-FOB-TROOP-PICKUP`](archive/FIX-FOB-TROOP-PICKUP.md) | merged (PR #136) | `troopPickupAtFOB` (default `true`, schema: "Allow troop pickup at built FOBs") sets a per-FOB flag read only by `CTLDFOBManager:isInFOBTroopZone`, which has **zero callers** anywhere else in `src/` — the F10 "Load Troops" menu only consults `CTLDZoneManager`'s `_troopZones` (TRZ_ zones), never FOBs. Legacy (`ctld.builtFOBS` + `ctld.inPickupZone()`) fully wires the equivalent check; this is an undeclared parity regression on a default-on setting, invisible to every test level (grepped — none exercise the behavior, only a config-defaults snapshot). Fix mirrors the existing `registerFOBAsLogistic`/`unregisterLogistic` pattern for troop zones (`registerFOBAsTroopZone`/`unregisterTroopZone`), reusing the FOB's existing `fobTroopPickupRadius` setting — no new config. | | [`FIX-I18N-DEBT-REPAYMENT`](archive/FIX-I18N-DEBT-REPAYMENT.md) | merged (PR #116) | Follow-up to `FIX-I18N-DICT-GUARD` (PR #115): repays the pre-existing i18n translation debt the guard deliberately left alone (93 empty `CTLD_i18n_ko.lua` entries + 78 empty `CTLD_i18n_es.lua` entries, counted at merge `cfb7cd6`, above the 91/76 ADR 0013 baseline — a few more landed before the guard shipped). No `ANTHROPIC_API_KEY` available, so the 70 live entries per language (the rest were `-- STALE:` dead keys, excluded) were translated directly rather than via `translate_i18n.py`; `JTAC` and `%1 [%2] %3.` added to `__keep_en`. No code changes — translation content only, no new tooling. | @@ -167,15 +158,19 @@ Completed lots are compacted under `archive/.md`. | [`FIX-I18N-HARDCODED`](archive/FIX-I18N-HARDCODED.md) | merged (PR #61) | Wrapper dans `ctld.tr()` les chaînes player-facing hardcodées : noms de couches RECON (7) + messages outText AA system (6). | | [`FIX-I18N-PURGE-SUPERSEDED`](archive/FIX-I18N-PURGE-SUPERSEDED.md) | merged (PR #121) | Two loose ends from `FIX-I18N-STALE-COMMENT-PARSING` (PR #119), found reviewing it. **The CHANGELOG overstates the bug**: it claims "broken/missing text in F10 menus and the AA system UI, in every language", but `ctld.tr()` falls back *active language → EN → the key itself*, and the key **is** the English text — replaying the pre-fix dictionaries in Lua 5.1 returns `HAWK Launcher` for `tr(en)`, `tr(fr)` and `tr(ko)` alike, and nothing reads `ctld.i18n[...]` directly outside the i18n module. Real symptom: those labels rendered **in English in FR/ES/KO**, English unaffected — the reported symptom, nothing broken. It matters because `[Unreleased]` freezes into the 2.0.0 section at the stable tag. **And 225 superseded `-- STALE:` lines remain**: #119 revived the 56 keys by appending live lines without deleting the commented ones they replace, so `"HAWK Launcher"` sat at both `CTLD_i18n_en.lua:78` (inert) and `:596` (live) — a translator editing the first one it finds sees nothing render. `generate_i18n_dicts.ps1` gains a `SUPERSEDED` category (reported in dry-run, purged under `-Apply`) so the duplicates cannot return on the next revival; the 582 genuinely dead lines stay, being the archive that let #119 recover the FR/ES/KO translations instead of re-writing them. | | [`FIX-I18N-STALE-COMMENT-PARSING`](archive/FIX-I18N-STALE-COMMENT-PARSING.md) | merged (PR #119) | The shared i18n dict parser (`i18n_dict_utils.py`), `generate_i18n_dicts.ps1`'s `Get-DictKeys`, and `translate_i18n.py`'s `_apply_translations` all matched a `ctld.i18n[...] = "..."` line regardless of a `-- STALE:` comment prefix. Fixing it and re-running `-Apply` for real surfaced a production bug much bigger than the KO/ES cosmetic drift this lot was scoped for: **56 keys — every AA system component label plus several F10 menu labels — were wrongly marked `-- STALE:` in all four dictionaries including English**, breaking F10/AA-system text in every language. `-Apply` revived all 56; the FR/ES/KO translations sitting in the old dead comments were hand-recovered into the fresh entries rather than lost. No ADR — a bug fix, not a design trade-off. | +| [`FIX-I18N-TRANSLATE-ALIAS`](archive/FIX-I18N-TRANSLATE-ALIAS.md) | merged (PR #269) | The 16 JTAC radio keys reach the four dictionaries; the JTAC module calls ctld.tr and the generator also recognises the alias. | | [`FIX-INAIR-DEBOUNCE-LEAK`](archive/FIX-INAIR-DEBOUNCE-LEAK.md) | merged (PR #192) | Closes [GitHub issue #156](https://github.com/VEAF/CTLD/issues/156) ("The flight-state debounce record outlives the player, and the next occupant inherits it", davidp57/Zip): `CTLDPlayerManager`'s flight-state poller keeps a per-unit-name debounce record (`confirmed`/`pending`/`ticks`) that nothing ever clears, unlike the player registry it sits beside — a reused unit name's new occupant inherits the previous occupant's `confirmed` state, the poller reads the mismatch as a real transition, and fires an unsolicited F10 menu rebuild about a second into the new occupant's slot (the same misfire class ADR 0015/#147/#154 exist to prevent, via a different trigger). Fix: clear the debounce record in the same shared teardown path that already clears the player registry entry — a one-line `src/CTLD_player.lua` change. Scope audit performed and recorded: two other per-unit-name tables in `src/` checked and ruled out (a separate AI-only lifecycle; a list whose stale key is functionally absent). | | [`FIX-INSTALL-SOUND-ORPHANS`](archive/FIX-INSTALL-SOUND-ORPHANS.md) | merged (PR #96) | Two defects reported by **Zip** minutes apart, using the `2.0.0-rc4` exe on a real mission — both capabilities that shipped and that the mission never saw. **The installed beacon sounds vanish**: `install()` wrote both `.ogg` into `l10n/DEFAULT/` and declared neither, on the correct-but-incomplete ground that a sound needs no resource key to be *played*. It needs one to *survive* — the Mission Editor rebuilds the archive from its own model on save and drops orphan files, so the beacons fall silent with nothing to explain it, the exact failure `FEAT-ONE-CLICK-INSTALL` existed to end. Fixed with the preload idiom the VEAF mission set already uses and this repo's own test mission carries (`ResKey_Action_10/11`): a key per sound plus a MISSION START `a_out_sound` reference, **646 occurrences across 491 real missions**, copied rather than invented — and *not* the per-coalition variant first suggested, since `coalitionlist` only ever takes `blue` or `red` (no neutral value in those 491 missions), so "a coalition with no unit" cannot be chosen generically. **And no way to open a `.miz`**: `load_path` has read a mission since rc4, but the dialog filtered on `*.yaml *.yml` and the button said "config **file**", making it reachable only via "All files" — a gap CI could not catch, the native dialog being interactive. | +| [`FIX-JTAC-IMPOSED-CODE-AND-RADIO`](archive/FIX-JTAC-IMPOSED-CODE-AND-RADIO.md) | merged (PR #258) — 1199 refused and the template not coded at start, verified in game (Zip, 2026-11-05) | Reported by VMCT from the Syria Open Training v6 (2026-10-02): an ASSETS drone imposed on 1688 shared the code with a catalogue drone INIT-C had coded automatically, and announced itself on the code-derived frequency instead of the one VEAF passed. An imposed code never leaves the pool (and goes back in on death), INIT-C codes before VEAF imposes, and `CTLDJTAC:new` always recomputes the radio. | | [`FIX-LEGACY-API-PARAM-PREFIX`](archive/FIX-LEGACY-API-PARAM-PREFIX.md) | merged (PR #206) | "Lot A" of the luacheck warning cleanup (`TOOLING-LUACHECK-CI-RATCHET`'s debt): all 58 parameters in `src/legacy/legacy_api.lua` shared the codebase's "deliberately unused" `_` prefix convention while actually being used (forwarded verbatim to the v2 manager call) — the convention itself was misleading, not the code. Pure rename (signature + body, both places a name appears), one exception (`_coalition` → `coalitionId`, avoiding a DCS global shadow). `LUACHECK_WARNING_CEILING` lowered 89 → 31 in the same PR. "Lot B" (the remaining 31, ~9 files, individual judgment per warning) stays a separate future lot. | +| [`FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS`](archive/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS.md) | merged (PR #315) | Issue #309 (VMCT): the v1 settings `maximumMoveDistance` and `minimumDeployDistance` have no key in CTLD 2, and the behaviours they drove are gone too. Dropped groups (troops and vehicles) act on their own again by default (nearest enemy, else a random walk; both distances at 0 to keep them still), and an optional `forbidUnpackInLogisticZone` forbids unpacking crates in a friendly logistic zone ([ADR 0029](../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md)). | | [`FIX-LGZ-POLL-FIRST-OBSERVATION`](archive/FIX-LGZ-POLL-FIRST-OBSERVATION.md) | merged (PR #252) | The logistics poller no longer rebuilds a just-built Request Equipment menu on its first pass (a 4 s ambient blank that lost the first click). | | [`FIX-LGZ-POLL-NIL-ISFLYING`](archive/FIX-LGZ-POLL-NIL-ISFLYING.md) | ✅ merged (PR #37) | LGZ ground-position poll skips players with `_isFlying=nil` (never flown) — `== false` guard → `~= true`; regression test. | | [`FIX-LIVE-DCS-FAILURES`](archive/FIX-LIVE-DCS-FAILURES.md) | delivered | Triaged the 10 (of 18) failures from the first live run (2026-07-10) not already fixed by `POST-FULLGAS-FIXES` — all 10 turned out to be cross-scenario state contamination, cleared by a mission reload | | [`FIX-LUACHECK-REMAINING-WARNINGS`](archive/FIX-LUACHECK-REMAINING-WARNINGS.md) | merged (PR #208) | "Lot B" of the luacheck warning cleanup: the last 30 of the 89 original warnings fixed individually (8 more `_`-prefix renames, 10 verified-dead unused variables, 5 shadowing fixes, 5 line-wraps, 1 negation simplification, 1 trivial empty-if inversion), across `CTLD_beacon.lua`/`CTLD_config.lua`/`CTLD_crate.lua`/`CTLD_jtac.lua`/`CTLD_recon.lua`/`CTLD_troop.lua`/`CTLD_utils.lua`/`CTLD_vehicle.lua`/`CTLD_zone.lua`. One case (`CTLD_vehicle.lua:734`, an empty `if` whose body is entirely comments describing an unimplemented native-cargo bbox-exit feature) is deliberately **not** fixed — suppressed via inline `luacheck: ignore 542` and tracked as a real feature gap in `dev/roadmap.md` instead. `LUACHECK_WARNING_CEILING` reaches `0` for the first time. | | [`FIX-MENU-AMBIENT-REFRESH-RACE`](archive/FIX-MENU-AMBIENT-REFRESH-RACE.md) | merged (PR #147) | Reported live by **a.lingo**: a C-130 parked on a TRZ requested "Load Standard Group" and instead triggered `Smoke > Red`. Reproduced twice live via `dcs-serve`/`exec_lua`: `ctld.MenuManager:refreshMenuForGroup` ([CTLD_menu.lua](../src/CTLD_menu.lua)) atomically wipes+rebuilds a group's whole F10 menu on every call (by design); a background refresh (`_lgzGroundPoll`, [CTLD_crate.lua](../src/CTLD_crate.lua), 10s tick) landing while the player navigates causes the next click to resolve against the rebuilt tree instead of the stale screen — misfired 4.2s after a forced rebuild in testing. DCS exposes no "menu open" signal (verified). Fix: any non-player-direct ("ambient") refresh now wipes immediately then delays the rebuild by a fixed `AMBIENT_REBUILD_DELAY_S` (a click mid-gap resolves to nothing, confirmed live), while player-direct ("urgent") refreshes (embark/disembark/pack/unpack completion, takeoff/land) opt out and stay immediate. Partial/targeted submenu removal (legacy's own model) explicitly rejected — see **ADR 0015**. | | [`FIX-MENU-DOUBLE-MULTICREW`](archive/FIX-MENU-DOUBLE-MULTICREW.md) | merged (PR #106) | F10 menu duplication on multi-crew aircraft (CH-47 pilot + copilot); menu loss when one crew member leaves a shared group. | +| [`FIX-MENU-STABLE-ENTRIES`](archive/FIX-MENU-STABLE-ENTRIES.md) | merged (PR #261) — 04 ✅ verified in game (Zip, 2026-11-05) — D1-D4 confirmed as recommended (2026-10-09) | Issue #257: wrong F10 commands persist after ADR 0015. DCS reuses a removed entry's id for the next entry created, so the full wipe + rebuild of each refresh (immediate or 4 s later) repoints every entry of a screen left open. Render by difference so an unchanged entry keeps its id, and park each freed id on an inert command for a group no player holds (measured 2026-10-09, shipped in VMCT #1113). | | [`FIX-NATIVE-CARRY-DETECTION`](archive/FIX-NATIVE-CARRY-DETECTION.md) | merged (PR #220) | Formalizes `dev/roadmap.md`'s "Native-cargo bbox-exit detection is unimplemented" entry + `grill-with-docs` sessions (2026-09-29, revised 2026-10-01) that widened it to a symmetric **native carry** model (`CONTEXT.md` terms **Virtual carry** / **Native carry** / **On-board cargo list**). Native carry of crates and vehicles is read from the DCS on-board cargo list (**ADR 0022**, replacing the first geometric design with a per-type hold box): a tracked item is in native carry while it is on the list and is released when it leaves it, on the ground or in flight (parachute release: falling state until landing, unit never respawned); scan limited to player units of native-cargo types (any category); transport-lost handling; `convertNativeLoadToCTLD` kept with an anti-duplicate mark; F10 unload/parachute lists show virtual-carry vehicles only; CH-47F becomes whole-vehicle capable by default; docs corrected (the Il-76 is AI-only, no native cargo). | | [`FIX-NATIVE-CONVERSION-DOORS`](archive/FIX-NATIVE-CONVERSION-DOORS.md) | merged (PR #251) | Raised by the maintainer in the live checks of 2026-10-03 (UH-1H): after a crate loaded through the DCS cargo UI was converted by CTLD, the cargo window still listed it (a "ghost"), the weight stayed above the maximum and the next load was refused. A 0.1 s probe showed DCS releases a cargo (`UnloadCargo`) only with the doors open and on the ground — ignored with the doors closed or in flight — while CTLD destroyed the static anyway. CTLD now verifies the cargo left the on-board list before taking the crate over; otherwise it stays DCS-native, the pilot is told to open the doors before takeoff to fit a parachute, and the release is retried on the ground. Live check by the maintainer pending. | | [`FIX-NATIVE-CRATE-CTLD-ACTIONS`](archive/FIX-NATIVE-CRATE-CTLD-ACTIONS.md) | merged (PR #247) | From two `dev/roadmap.md` entries raised by the automated review (issue #236), with the intended rules stated by the maintainer in a `grill-with-docs` session: a crate in native carry (DCS cargo UI) is unloaded and parachuted through the DCS cargo UI and DCS weighs it itself; CTLD acts and adds weight for virtual carry only (already true for whole vehicles). `isLoadedByCTLD()` (same body as `isLoaded()`) now means virtual carry; *Drop Crate(s)*, *Parachute Crates* and the transport weight use it; `load()` clears the native flag; dead native parachute branch removed. Verified live in a C-130J-30 (weight pushed to DCS 1000 kg -> 0, displayed total no longer moves). | @@ -188,12 +183,17 @@ Completed lots are compacted under `archive/.md`. | [`FIX-PRELOAD-AND-INSTALL-DOCS`](archive/FIX-PRELOAD-AND-INSTALL-DOCS.md) | merged (PR #99) | Follow-up to `FIX-INSTALL-SOUND-ORPHANS`, opened for three documentation asks — and the reading behind them found a defect in the lot merged an hour earlier. **The sound preload was audible**: #96 shipped `a_out_sound`, which plays to everyone, so every player connected at mission start heard a beacon tone. Zip's instruction had been "pour une coalition sans unité" and I had searched the *coalition* predicates, found `coalitionlist` only ever takes `blue` or `red` across 491 missions, concluded it "cannot be expressed generically" and wrote that into the code — wrong axis, and the counter-evidence was in this repo all along: the README's manual-install section says *"pick an unused country like Australia so no player hears them at mission start"*. `a_out_sound_c`, 1274 occurrences in those same missions. The country is now resolved **per mission** among those it does not declare (Peru, the VEAF set's de-facto choice at 363 uses; then Australia; then any free id, from the datamine country table) — hard-coding one is a bet whose downside is the original bug. Plus **Windows unblock instructions** (unsigned exe → SmartScreen hides *Run anyway* behind *More info*) in the README, the mission-maker guide EN+FR and the release skill; and **the README resynced** — it documented `ctld.yamlConfigDatas`, absent from the whole repository, and `_cfg.settings`, the model ADR 0011 replaced, with an installation section predating `ctld-tools`. | | [`FIX-REQUEST-EQUIPMENT-SILENT-FAILURE`](archive/FIX-REQUEST-EQUIPMENT-SILENT-FAILURE.md) | merged (PR #250) | Raised by the maintainer in the live check of `FIX-CRATE-DROP-PLACEMENT`: a first Request Equipment produced nothing and the pilot had to ask again, with no message and no trace (same family as the silent parachute spawn failure, #235). A request that produces nothing — crate with no descriptor, crate or set whose creation failed, vehicle whose creation failed (which still announced "Vehicle ready for loading") — now tells the pilot (new key, FR/ES/KO) and logs an ERROR; a partial set logs a WARNING. The cause of the observed failure is undetermined. | | [`FIX-REVIEW-HYGIENE-A`](archive/FIX-REVIEW-HYGIENE-A.md) | merged (PR #241) | Lot A of the automated review of `develop` (issues #237, #239): the `EXTR_` group scan matches the bare prefix `EXTR`, so any pre-placed group named `EXTRACTION…` silently becomes extractable (anchored `^EXTR_` + negative test); and the comment justifying the aiZones collision check still describes the parsed-name key removed by ADR 0020 (comment rewrite only, no code change). | +| [`FIX-REVIEW-HYGIENE-B`](archive/FIX-REVIEW-HYGIENE-B.md) | merged (PR #260) | Issues #253, #254, #255 from the automated review of `affd2c9`: FARP packing bypasses the ADR 0024 placement (and broadcasts a debug line to every player); a crate model without `size` gets a row computed on 1.5 m (every crate of a `slingLoad` mission); timers cancelled by id never leave `ctld.scheduler._pending`. | +| [`FIX-SCENE-PACK-WHILE-LAYING-OUT`](archive/FIX-SCENE-PACK-WHILE-LAYING-OUT.md) | merged (PR #304) — verified in game (2026-11-09) | Found while checking an observation of the FIX-CREATE-BEFORE-DESTROY live check (2026-11-09): a FARP packed during the thirty seconds or so it takes to lay itself out leaves orphan objects (repair truck, tent, guards, lights), because its remaining steps keep running after the pack. Packing a scene now stops it first when it has not finished. | | [`FIX-SCHEDULER-SINGLE-ENTRY`](archive/FIX-SCHEDULER-SINGLE-ENTRY.md) | merged (PR #244) | Last lot of the automated review of `develop` (issue #234), decided in a `grill-with-docs` session with a live baseline: only 2 of ~15 perpetual loops registered with `ctld.scheduler`, so `cancelAll()` before a re-injection left the rest running on top of the new instance. One entry point, `ctld.scheduler.schedule`, replaces all 44 direct `timer.scheduleFunction` calls and records every pending id; a busted guard spec forbids direct calls; `cancelAll()` cancels everything. Also fixes the beacon loop's double-start guard (it could not restart after `cancelAll()`, live check F-139.4), recreates `shutdown_ctld.lua` and adds a live scenario run against the real DCS timer. | | [`FIX-SHIP-ZONE-ANCHOR-PARITY`](archive/FIX-SHIP-ZONE-ANCHOR-PARITY.md) | merged (PR #79) | A `troopZones` entry backed by a **ship** is snapshotted at init, so a carrier steams away and leaves its pickup point in the water. v1 re-resolved the position on **every** check (`ctld.inPickupZone`, 200 m radius) — this is an undeclared parity deviation, not a design choice, and it contradicts the lazy-resolution principle `FEAT-MOVING-ZONE` established. The anchor is even already known: `CTLDTroopZone` carries `_anchorUnitName` and `isAnchorAlive()`, but `getCenter()` never consults them, unlike `CTLDLogisticZone:getCenter()`. Fix is the missing `linkedUnit` branch. Blocks `FEAT-VMCT-INTEGRATION` ticket 02. | +| [`FIX-SPAWN-COUNTRY-FALLBACK`](archive/FIX-SPAWN-COUNTRY-FALLBACK.md) | merged (PR #256) | Reported by VMCT from a campaign mission (2026-10-09): with only CJTF Blue / CJTF Red in the coalitions, a requested crate never appears. Spawn sites without a country default to USA / Russia, which are in no coalition there, and `dynAddStatic` swallows the DCS error. One helper resolves the country (the unit's, else one of the coalition, else USA / Russia), and a failed creation is logged and told to the group. | | [`FIX-SPEC-ISOLATION`](archive/FIX-SPEC-ISOLATION.md) | merged (PR #94) | `aircraft_capabilities_spec` passed locally and failed in CI: `troop_manager_spec` empties `loadableGroups` and nulls `CTLDTroopManager._instance` in a `before_each` and **never restores them**, so every spec running after it sees an emptied catalogue. FullGas fixed the consumer side in PR #91; the producer is still there — **9 mutations with zero `after_each` in `troop_manager_spec`, 8 in `type_collector_spec`**, `menu_gating_spec` being the only one of the three that restores. Worth fixing at the producer because "which spec runs first" is unknowable: busted takes the order the filesystem gives (a directory hash on Linux), while the local runner sorts by name and is therefore **blind to this class of bug** — which is why it only failed in CI. Cheap proof: a reversed-order run must agree with a forward one. | | [`FIX-TOOL-I18N-LANG`](archive/FIX-TOOL-I18N-LANG.md) | merged (PR #92) | Reported by **FullGas**: CTLD's interface language could not be set from the tool. Neither the engine nor the schema was at fault — `CTLD_i18n` resolves it through `ctld.gs("i18n_lang")` and the schema declares it with `default: en` and `choices: [en, fr, es, ko]`. The app never showed it because it lists **catalogue** keys, and this is the only setting of ~150 deliberately absent from the catalogue: a scalar there would make it a *parameter* under ADR 0011 Addendum 1, so completeness would demand it and every rc1–rc3 config would report a missing setting at startup. A regression from the TUI → web app move, the TUI having listed schema keys. Fixed by offering schema-declared settings the catalogue does not carry, rather than by cataloguing this one. | +| [`FIX-TROOP-UNLOAD-TRANSPORT`](archive/FIX-TROOP-UNLOAD-TRANSPORT.md) | merged (PR #313) | Found while preparing FEAT-TROOP-GESTURE-EVENTS: the scripted troop drops (`ctld.unloadTransport`, `ctld.unloadInProximityToEnemy`) called a troop manager method that no longer exists and raised an error. They drop the troops again with the v1 rules (back to the stock in a pickup zone, otherwise every group dropped; the proximity drop for AI transports only). | | [`FIX-TROOP-ZONE-ISALIVE-FILTER`](archive/FIX-TROOP-ZONE-ISALIVE-FILTER.md) | merged (PR #245) | From the `dev/roadmap.md` entry raised by the automated review (issue #238): the troop-zone position/coalition/unit queries never consulted `isAlive()`, unlike the logistic-zone ones, so a zone whose anchor vanished without a death event stayed usable at its last position. The eight queries now skip a zone whose anchor is gone; un-anchored zones and the lookup by registry key are unchanged. | | [`FIX-UH1H-CAPABILITIES-REALISM`](archive/FIX-UH1H-CAPABILITIES-REALISM.md) | merged (PR #159) | Requested by **a.lingo** for realism: `capabilitiesByType.UH-1H.canTransportWholeVehicle` was `true`, contradicting the published docs ([docs/pilot/vehicles.md](../docs/pilot/vehicles.md), which already describes the UH-1H as crate-only) — set to `false`; `maxTroopsOnboard` raised `8`→`10` to match the airframe (deliberate legacy-parity deviation). `Mi-8MT`'s own `canTransportWholeVehicle: true` was inert (`maxWholeVehiclesOnboard: 0`, no weight/vehicle-list fields) — completed with a realistic `maxVehicleWeight: 3000` (external sling-load rating, not the 13000 kg MTOW) so the two live DCS scenarios that exercised AI whole-vehicle transport on the UH-1H (MT-08, MT-08B, MT-09 — the only other helicopter-category survivor of `canTransportWholeVehicle: true`, the rest being fixed-wing) can migrate to it and keep testing real behaviour. | +| [`FIX-UNPACK-FALSE-SUCCESS`](archive/FIX-UNPACK-FALSE-SUCCESS.md) | merged (PR #267) | The Unpack Crate click no longer announces a success when a JTAC limit or a missing spawn position produced nothing. | | [`FIX-VALIDATE-MODTYPES`](archive/FIX-VALIDATE-MODTYPES.md) | merged (PR #87) | `modTypes` has exactly one job — the schema says listing a type there "is what stops validation rejecting it as unknown to DCS" — and `ctld-tools validate` does not honour it: `_validate_crates` compares every crate `unit` to the datamine set alone, so a **modded crate is an ERROR that blocks export**, which is precisely what declaring it was supposed to prevent (reproduced). The Lua side has it right, excusing `CTLDTypeCollector`'s `extras`; the two layers disagree and the blocking one is wrong. `FEAT-VMCT-INTEGRATION` added a second, correct behaviour for the type lists rather than widen the bug, so one file now holds both — flagged in PR #80 and left for this lot. | | [`FIX-ZONE-ANCHOR-DUPLICATION`](archive/FIX-ZONE-ANCHOR-DUPLICATION.md) | merged (PR #213) | Formalizes `dev/roadmap.md`'s "Lien générique zone ↔ objet de référence" entry — launched directly to `to-prd` (no dedicated grill, per explicit instruction) with a scope **narrowed** from the roadmap's original framing: extracts the verified-identical anchor logic (`getCenter`/`isDynamic`/`isAlive`, `_linkedUnit`/`_anchorUnitName`) duplicated between `CTLDTroopZone` and `CTLDLogisticZone` into a shared `CTLDAnchoredZone` base class. The roadmap's own `linkZonesToOwner`/`unlinkOwner` generic owner-registry proposal is deliberately **not built** — `FEAT-FARP-TROOP-PICKUP` already confirmed the FARP (the only other candidate composite owner) doesn't need it, leaving just one real consumer (the FOB) for a generic multi-owner mechanism, which would be exactly the speculative abstraction `CLAUDE.md` asks not to build. The truck-mounted mobile pickup zone use case is also out of scope — code reading suggests it already works via the existing `createTroopZoneAtObject`, needing only live-DCS verification, not new code. | | [`FIX-ZONE-REGISTRY-KEY`](archive/FIX-ZONE-REGISTRY-KEY.md) | merged (PR #219) | Regression of PR #210 / ADR 0020: the F10 Request Equipment menu (every crate answered "not close enough to friendly logistics") and the Load from troop menu passed a zone's short name to a registry now keyed by full name. A zone now reports its own **registry key** (`registryKey()`), the menus pass it, and zone event payloads carry it as `name` — a deliberate breaking payload change at RC stage (**ADR 0023**). Includes an audit of every other short-name lookup and the legacy layer. | diff --git a/.backlog/FEAT-FAT-COW-LEAVE-FARP/PRD.md b/.backlog/archive/FEAT-FAT-COW-LEAVE-FARP.md similarity index 81% rename from .backlog/FEAT-FAT-COW-LEAVE-FARP/PRD.md rename to .backlog/archive/FEAT-FAT-COW-LEAVE-FARP.md index 820823dc..378debb9 100644 --- a/.backlog/FEAT-FAT-COW-LEAVE-FARP/PRD.md +++ b/.backlog/archive/FEAT-FAT-COW-LEAVE-FARP.md @@ -1,8 +1,27 @@ -# FEAT-FAT-COW-LEAVE-FARP — a piloted Fat Cow leaves its FARP behind, and packs it into crates on the ground +# FEAT-FAT-COW-LEAVE-FARP + +**Status:** merged (PR #286) — 02 live check ✅, verified in game (Zip, 2026-11-05). Compacted from `FEAT-FAT-COW-LEAVE-FARP/` on 2026-11-23; the ticket files live on in git history. + +Zip, 2026-11-03: a loadout sets its crates on the ground to be loaded, like CTLD; a piloted Fat Cow's FARP stays open when the CH-47 takes off (the crates are consumed at deploy) and outlives its helicopter; any piloted cow of the coalition landed within 150 m packs it back into crates on the ground. AI cows unchanged. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-leave-and-pick-up` | — | 01 — loadouts on the ground, FARP left open, packed into crates on the ground | +| `02-live-check` | — | 02 — live check (Zip) | + +## PRD + +## FEAT-FAT-COW-LEAVE-FARP — a piloted Fat Cow leaves its FARP behind, and packs it into crates on the ground Status: done — merged (PR #286); 02 live check verified in game by Zip, 2026-11-05 -## Problem +### Problem A player-flown Fat Cow (FEAT-FAT-COW) is tied to its FARP: the stock stays in the crates on board while the FARP is open, and the FARP packs itself back into the hold the moment the CH-47 takes off (`onTakeoff` → `packIntoHold`), dies (`onDead` → `removeCow`) or a new pilot takes the slot (`onBirth`). @@ -13,7 +32,7 @@ The loadouts also skip the CTLD way of handling cargo. A single cow crate requested from the menu is set down next to the helicopter (`requestCrate` → `spawnCratesAligned`) and loaded by the pilot, but a loadout (two fuel tanks and 40 Hellfires, say) goes straight into the hold (`loadLoadout` → `loadIntoHold`), with no crate ever on the ground. Zip, 2026-11-03: a loadout should set its crates down, like CTLD does, for the pilot to load. -## Solution +### Solution 1. **A loadout sets its crates down.** "Load" > a loadout lays its crates next to the helicopter, a partial last crate keeping its partial content and mass, and says so; the pilot loads them with the usual CTLD crate loading. Nothing goes straight into the hold any more. 2. **Deploying consumes the crates.** "Deploy the Fat Cow FARP" takes the cow crates out of the hold: their content is now the FARP's warehouse, the helicopter is lighter by their mass, and its hold is free for other cargo. @@ -22,7 +41,7 @@ Zip, 2026-11-03: a loadout should set its crates down, like CTLD does, for the p 5. **Packing puts the FARP back into crates on the ground.** "Pack the Fat Cow FARP", from a piloted cow landed close to an open FARP: what is left becomes cow crates set down at the FARP (full crates, a partial last one of each kind; an empty FARP gives none), the scene is removed and the FARP emptied. The pilot then loads the crates by hand and deploys them elsewhere, or leaves them there. 6. **One heliport per FARP, not per unit.** A pilot can open a second FARP elsewhere while the first one still stands: each open FARP gets its own name, and a packed FARP's name goes back to the pool (`_freeFarps`) for the next deployment. -## Decisions +### Decisions - **Who may pack a FARP: any piloted cow of its coalition** (a `fatCowTypes` helicopter with a player), not only the one that laid it out. Why: the pilot who left it may have disconnected or crashed, and a FARP nobody but a vanished pilot can pack would be stuck on the map. Zip asked for "the same CH-47 coming back"; any CH-47 of the side covers that case and the others. - **Pack range: within 150 m of the FARP, on the ground**, like the deploy. @@ -32,14 +51,14 @@ Zip, 2026-11-03: a loadout should set its crates down, like CTLD does, for the p - **"Unload the Fat Cow crates" at a logistic zone stays** as it is (the crates in the hold go back to the zone). - **The AI cows do not change.** An AI cow still carries its stock as cargo mass, packs before it moves (`_readyToMove`, `_onAITakeoff`), and the take-over (FEAT-FAT-COW-TAKEOVER) still deals with AI cows only. -## Definition of done +### Definition of done - Unit specs (`tests/ci/unit/`): a loadout sets its crates on the ground, partial last crate included, and puts nothing in the hold; loading those crates and deploying gives the loadout's stock; deploy empties the hold and lightens the helicopter; take-off, death and a new pilot on the slot leave the FARP open and its stock untouched; pack from a CH-47 other than the one that laid it out, within and beyond 150 m, airborne, and with an emptied FARP; the packed crates on the ground carry what the FARP held, and loading and deploying them again gives that stock back; two FARPs open at once under two names, and a packed FARP's name reused; `_resyncFarps` keeps re-writing a FARP whose helicopter is gone. - Pilot docs (EN + FR): a loadout is set down to be loaded, the FARP stays open after take-off, packing sets the crates down; mission-maker docs say an open FARP outlives its helicopter. - CHANGELOG `[Unreleased]`, i18n keys in the four dictionaries. - Live check written for Zip (ticket 02). -## Out of scope +### Out of scope - Packing an AI cow's FARP with a piloted CH-47, or handing a player FARP over to an AI cow. - Keeping open FARPs, or packed crates, across a mission restart. diff --git a/.backlog/FEAT-FAT-COW-TAKEOVER/PRD.md b/.backlog/archive/FEAT-FAT-COW-TAKEOVER.md similarity index 77% rename from .backlog/FEAT-FAT-COW-TAKEOVER/PRD.md rename to .backlog/archive/FEAT-FAT-COW-TAKEOVER.md index a77c6c08..cea5d8a8 100644 --- a/.backlog/FEAT-FAT-COW-TAKEOVER/PRD.md +++ b/.backlog/archive/FEAT-FAT-COW-TAKEOVER.md @@ -1,8 +1,27 @@ -# FEAT-FAT-COW-TAKEOVER — a Fat Cow that lost its flight goes home, says so, and can be taken over +# FEAT-FAT-COW-TAKEOVER + +**Status:** merged (PR #277) — 02 ✅ verified in game (Zip, 2026-11-05). Compacted from `FEAT-FAT-COW-TAKEOVER/` on 2026-11-23; the ticket files live on in git history. + +An AI Fat Cow that lost its flight goes home instead of vanishing on the spot (Marteau du Golan, 2026-10-29: a landing event right after the re-task was taken for its arrival), tells the helicopter flights that could take it over; **Take over a Fat Cow** lists every cow flying home (lost flight or RTB) or released where it stands (**Release the Fat Cow**), nearest first with its distance. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-go-home-say-so-take-over` | — | 01 — despawn only at home, announce the orphan, take it over | +| `02-live-check` | ✅ done — verified in game by Zip, 2026-11-05 | 02 — Live check in DCS | + +## PRD + +## FEAT-FAT-COW-TAKEOVER — a Fat Cow that lost its flight goes home, says so, and can be taken over Status: done — merged (PR #277); 02 live check verified in game by Zip, 2026-11-05 -## Problem +### Problem An AI Fat Cow (FEAT-FAT-COW) serves the flight that requested it. When that flight is lost (shot down, or its player leaves), the cow packs and goes home without a word, and nobody else can use it. @@ -11,7 +30,7 @@ On 2026-10-29 it did not even go home. On "Marteau du Golan" (Syria, Privé 1, CTLD embedded by VMCT 6.34.0), the cow `Fat Cow Rosh Pina_AH-64D BLK.II_10 #1-1`, deployed near MASADA since 21:09:06 UTC, vanished on the spot at 21:25:16 UTC, about a minute after its flight's AH-64D (Paluche) was shot down (21:24:14). Its crew (`FatCow_Crew_Grp-3`) went the same second. -### Root cause (server `dcs.log`, 2026-10-29) +#### Root cause (server `dcs.log`, 2026-10-29) ``` 21:25:15.476 CTLDSceneManager:packScene: 'Fat Cow FARP#1' packed (5 object(s) destroyed) @@ -26,7 +45,7 @@ Its crew (`FatCow_Crew_Grp-3`) went the same second. No time limit, no false loss detection: the despawn trusted a landing event without checking where it happened. A cow released with **RTB** while on the ground was exposed to the same despawn. -## Solution +### Solution 1. **Despawn only at home**: a returning cow that lands more than 2 km from its home point is left alone (logged with the distance). 2. **The cow says it is going home**: when its flight is lost, every helicopter flight of its coalition that could take it over gets a message: where it is from them, where it goes, what it carries, and the F10 command. @@ -34,20 +53,20 @@ A cow released with **RTB** while on the ground was exposed to the same despawn. 4. **"Release the Fat Cow"** (Zip, 2026-10-30), next to RTB: the cow leaves its flight and stays where it is, FARP open on the ground, orbiting in the air (landing if it was landing). The helicopter flights that could take it over are told, and it is listed as `waiting` until one does; it packs its FARP before it moves. -## Decisions +### Decisions - **Who is told, who may take over**: the helicopter flights of the cow's coalition that see the AI Fat Cow menu (not a cow pilot) and have no cow (Zip, 2026-10-30: helicopters only). The message names a command only they can use. - **Which cows can be taken**: any cow flying home, sent with RTB or empty included, until it has landed at home, and any cow its flight released (Zip, 2026-10-30, reversing the first version, which offered only a cow that lost its flight and still carried something). - **One entry per cow, nearest first, with its distance** (Zip, 2026-10-30). The distance is the one at the menu's last build: the menus are rebuilt when a cow starts home, is taken over, lands home or dies, and every 30 s for the flights that may take one over. A label that changes is a removed entry and a new one: ADR 0027 parks the freed id, so a screen left open across the update fires nothing rather than the wrong cow. - **Home radius 2 km**: the Land task puts the cow down at the home point itself; the wrong landing was measured tens of km away. -## Definition of done +### Definition of done - Unit specs (`tests/ci/unit/fatcow_ai_spec.lua`): no despawn away from home; the message to eligible flights only; the submenu listing the cows going home, nearest first, to helicopter flights without a cow only, and each entry gone once its cow is taken, home or dead; the take-over re-tasks the cow to follow the new flight, which then commands it. - Docs (pilot + mission maker, EN + FR), CHANGELOG, i18n (four dictionaries). - Live check written for Zip (ticket 02). -## Out of scope +### Out of scope - Keeping the FARP open for other flights when the escorted flight is lost. - Automatic re-attachment to a flight respawning under the same group name (it can take the cow over with the command). diff --git a/.backlog/FEAT-FAT-COW/PRD.md b/.backlog/archive/FEAT-FAT-COW.md similarity index 71% rename from .backlog/FEAT-FAT-COW/PRD.md rename to .backlog/archive/FEAT-FAT-COW.md index 8c966b06..154b5ba4 100644 --- a/.backlog/FEAT-FAT-COW/PRD.md +++ b/.backlog/archive/FEAT-FAT-COW.md @@ -1,10 +1,33 @@ -# FEAT-FAT-COW — a CH-47 that lands in the field and becomes a forward refuel/rearm point +# FEAT-FAT-COW + +**Status:** merged (PR #273) — 06 ✅ (passed in use, Zip 2026-11-04). Compacted from `FEAT-FAT-COW/` on 2026-11-23; the ticket files live on in git history. + +A CH-47 that lands in the field and becomes a forward refuel/rearm point (AI escort of a flight, or player-flown with cow crates), stocked with what it carries. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-spike-runtime-farp` | 🧑 waiting-human — phase 1 done (2026-10-26), phase 2 (multiplayer client) not run yet | 01 — In-game spike: a runtime FARP, its finite stock, its vehicles | +| `02-core-stock-and-scene` | ✅ done | 02 — Core: a cow's stock, its scene, deploy and pack | +| `03-piloted-cow` | ✅ done | 03 — Piloted cow: cow crates in a CH-47F and the F10 commands | +| `04-ai-cow` | ✅ done | 04 — AI cow: requested by a flight, escorts it, serves it, goes home | +| `05-config-docs-release` | ✅ done | 05 — Config, VMCT contract doc, CHANGELOG and release notes | +| `06-live-check` | ✅ done — passed in use (Zip, 2026-11-04: the squadron flew the Fat Cow several evenings in a row, it works) | 06 — Live check in DCS | + +## PRD + +## FEAT-FAT-COW — a CH-47 that lands in the field and becomes a forward refuel/rearm point **Status:** ✅ done — live check passed in use (Zip, 2026-11-04: the squadron flew the Fat Cow several evenings in a row, it works). Ticket 01 phase 1 done (2026-10-26): a runtime Invisible FARP serves a player already in game, enforces a finite stock, and needs a supplier in range, which the `FARP Fuel Depot` static alone satisfies, for fuel and weapons, without any vehicle. Phase 2 (a remote multiplayer client) not run: Zip hosted, so his view was the server's; the design re-applies the stock on every birth instead. Tickets 02-05 implemented (Zip, 2026-10-26: "implémente"), then reworked after the first server run (loadouts, F10-commanded AI cow, statuses, RTB); PR #273. Ticket 06, the live check with the squadron, passed in use. Designed with Zip on 2026-10-26 (VMCT session). Zip decided that the runtime belongs in CTLD, not in the VMCT Lua; VMCT will vendor this CTLD and add a static mission-editing tool for it afterwards. -## Problem Statement +### Problem Statement Attack helicopters (typically AH-64D) on a long sortie have to fly back to an airfield or a mission-placed FARP to refuel and rearm. The US Army answers this with the "Fat Cow": a CH-47 that lands near them and serves fuel from its internal tanks. @@ -15,7 +38,7 @@ So the cow can only be a FARP spawned next to it, stocked with what the cow carr ED announced a native Fat Cow on 2024-04-19 and again on 2024-08-23; it is absent from DCS 2.9.30.28738. -## Decisions (Zip, 2026-10-26) +### Decisions (Zip, 2026-10-26) 1. **Two modes, one core.** - **AI:** a cow can be requested only on the ground, inside a friendly CTLD logistic zone. It escorts the requesting flight, lands near it when it lands, and deploys the FARP after **60 s** on the ground. When the flight takes off, it packs the FARP and follows again. It flies back to its logistic zone and despawns when its stock is empty, and also on an F10 "release the Fat Cow" command. @@ -24,21 +47,21 @@ ED announced a native Fat Cow on 2024-04-19 and again on 2024-08-23; it is absen 3. **Stock = what the cow carries**, as a finite FARP warehouse, not unlimited. **AI default: full fuel (3 × 800 gal, about 7 200 kg) and 6 Hellfires**, configurable in the CTLD config. The 6 is Zip's call: no source gives the Hellfire load of a cow. 4. **Ticket 01 is an in-game spike, before building the rest.** If an answer kills the design, stop and report to Zip. -## What the spike must settle, and why it is not obvious +### What the spike must settle, and why it is not obvious - `src/scenes/CTLD_countrysideFarpScene.lua` contradicts itself: its header says the Invisible FARP "creates a proper DCS airbase (warehouse…)", its step 11 says "Invisible FARP airbases (DCS built-in) return nil for getWarehouse()". The finite stock of decision 3 needs a warehouse. - VMCT refills FARP warehouses on every player birth (`veafGrass.fillFarpWarehouse`) because warehouses do not sync over the network, and an ED forum guide (2024) says dynamically spawned FARPs start empty and resupply badly by script. - RotorOps PERKS does not spawn its Fat Cow FARP: it teleports FARP statics pre-placed in the Mission Editor (`RotorOpsPerks.teleportStatic`), and skips the deployment when enemies are within 1.1 nm, because DCS refuses to rearm/refuel there. Both are hints that a runtime FARP is fragile. - DCS historically needed a fuel truck and an ammo truck near a FARP. Decision 2 has none; if DCS still needs them, the fallback is a vehicle hidden under the cow's fuselage. -## Design (to be confirmed by the spike) +### Design (to be confirmed by the spike) - **Core:** a `CTLDFatCow` entity (Manager + Entity pattern) holding a stock (fuel kg, items by warehouse name) and a state (`flying`, `landed`, `deployed`, `packing`, `returning`). Deploy = run the cow scene next to the cow, then set the FARP warehouse to the stock. Pack = read the warehouse back into the stock (what the players consumed is gone), then remove the scene. Empty stock → the AI cow goes home. - **AI mode** listens to `S_EVENT_LAND` / `S_EVENT_TAKEOFF` of the escorted flight (CTLD already subscribes to these for players and AI transports), and drives the cow with DCS tasks (`Follow`/escort, `Land`). - **Piloted mode** reuses the crate system: cow crates are crate models whose weight is the fuel mass; the deploy command sums the loaded cow crates into the stock. - **Config** under one `fatCow` block in `src/CTLD_config.yaml` (adds keys → `configVersion` bump and a catalogue shape, per `CLAUDE.md`). -## Contract for VMCT +### Contract for VMCT Documented for mission makers in `docs/mission-maker/fat-cow.md` (EN + FR). @@ -46,17 +69,17 @@ Documented for mission makers in `docs/mission-maker/fat-cow.md` (EN + FR). - **Settings:** `fatCowEnabled`, `fatCowTypes` (`[CH-47Fbl1]`), `fatCowCrates` (`desc`, `weight`, and `fuelKg` or `item` + `count`), `fatCowLoadouts` (`desc`, `fuelKg`, `items`: what a cow carries, piloted or AI), `fatCowDeployDelay` (60 s), `fatCowAIType` (`CH-47Fbl1`; empty disables the request), `fatCowAICows` (`fatCowAIFuelKg` and `fatCowAIItems`, in no release, were replaced by the loadouts). Catalogue version 2.3.0. - A requested AI cow is created by script (`coalition.addGroup`, type `fatCowAIType`), so no template group is needed in the mission; the draft's `fatCow.aiTemplate` was dropped for that reason. -## Tickets +### Tickets | # | Ticket | Status | |---|---|---| -| 01 | [In-game spike: a runtime FARP, its finite stock, its vehicles](tickets/01-spike-runtime-farp.md) | 🧑 phase 1 done (a yes, b yes server side, c the FARP Fuel Depot alone suffices, no vehicle); phase 2 to run | -| 02 | [Core: a cow's stock, its scene, deploy and pack](tickets/02-core-stock-and-scene.md) | ✅ done | -| 03 | [Piloted cow: cow crates in a CH-47F and the F10 commands](tickets/03-piloted-cow.md) | ✅ done | -| 04 | [AI cow: requested by a flight, escorts it, serves it, goes home](tickets/04-ai-cow.md) | ✅ done | -| 05 | [Config, VMCT contract doc, CHANGELOG and release notes](tickets/05-config-docs-release.md) | ✅ done (release-notes jab in the CHANGELOG entry, for the release to carry) | -| 06 | [Live check in DCS](tickets/06-live-check.md) | ✅ passed in use (Zip, 2026-11-04) | - -## Release notes +| 01 | In-game spike: a runtime FARP, its finite stock, its vehicles (`01-spike-runtime-farp`) | 🧑 phase 1 done (a yes, b yes server side, c the FARP Fuel Depot alone suffices, no vehicle); phase 2 to run | +| 02 | Core: a cow's stock, its scene, deploy and pack (`02-core-stock-and-scene`) | ✅ done | +| 03 | Piloted cow: cow crates in a CH-47F and the F10 commands (`03-piloted-cow`) | ✅ done | +| 04 | AI cow: requested by a flight, escorts it, serves it, goes home (`04-ai-cow`) | ✅ done | +| 05 | Config, VMCT contract doc, CHANGELOG and release notes (`05-config-docs-release`) | ✅ done (release-notes jab in the CHANGELOG entry, for the release to carry) | +| 06 | Live check in DCS (`06-live-check`) | ✅ passed in use (Zip, 2026-11-04) | + +### Release notes When the feature ships, the release notes poke fun at ED's native Fat Cow, announced on 2024-04-19 and 2024-08-23 and still absent from DCS 2.9.30.28738. diff --git a/.backlog/archive/FEAT-JTAC-LOG-REAL-LASER-CODE.md b/.backlog/archive/FEAT-JTAC-LOG-REAL-LASER-CODE.md new file mode 100644 index 00000000..0a5c487b --- /dev/null +++ b/.backlog/archive/FEAT-JTAC-LOG-REAL-LASER-CODE.md @@ -0,0 +1,43 @@ +# FEAT-JTAC-LOG-REAL-LASER-CODE + +**Status:** merged (PR #287) — 01 ✅ verified in game (Zip, 2026-11-05). Compacted from `FEAT-JTAC-LOG-REAL-LASER-CODE/` on 2026-11-23; the ticket files live on in git history. + +Reported by VMCT from the Sinai Open Training v6 (2026-10-12): Reaper 1 (imposed 1511) claimed nine targets in an hour, yet an A-10C's TGP LSS on 1511 at 15 nm found no spot. The log holds only claim and release, never the code or the spot, so the report cannot be settled. Log both, then test the hypotheses (code, LSS range, line of sight, shared code). + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-log-the-code-then-measure-the-lss` | — | 01 — Log the real code and the spot, then find why the LSS saw nothing | + +## PRD + +## FEAT-JTAC-LOG-REAL-LASER-CODE — the JTAC never logs its laser code or its spot, so a "no laser" report cannot be settled + +Status: ✅ done — the log lines are in (2026-11-04); verified in game by Zip, 2026-11-05 + +### Found + +David and Claude, 2026-10-12, Sinai Open Training v6 on dcs.veaf.org (Privé 1, VMCT 6.29.0). +Reaper 1 is an ASSETS drone with `jtac: 1511`. +The log shows it claiming nine targets one after the other between 19:59 and 20:58 UTC (`[JTAC] claim` / `release claim`), yet David, in an A-10C_2 with the TGP LSS on 1511 for about a minute at 15 nm, found no spot. His own TGP laser was on 1681, so the kills that coincided with a claim release were his own. +The log cannot say which code the drone's spot actually carried, nor whether `Spot.createLaser` returned a spot at all: `_claimTarget` and `_releaseTarget` are the only JTAC lines. + +### Tickets + +| # | Ticket | Status | +|---|---|---| +| 01 (`01-log-the-code-then-measure-the-lss`) | Log the real code and the spot, then find why the LSS saw nothing | ✅ logging done, verified in game by Zip, 2026-11-05 | + +### Definition of done + +- The new log lines exist and a Lua test asserts them. +- The ticket ends with a cause, or with the measurement that rules the drone out; DCS is needed (David or a running session), so it cannot be closed from the repository alone. +- VMCT then takes the vendored file (a chore on that side); a surprising DCS behaviour measured goes into VMCT's `known-limitations.yaml`. +- `CHANGELOG.md` entry under `[Unreleased]`. + +Related, already merged: `FIX-JTAC-IMPOSED-CODE-AND-RADIO` (PR #258), which keeps an imposed code out of the pool. diff --git a/.backlog/FEAT-TROOP-GESTURE-EVENTS/PRD.md b/.backlog/archive/FEAT-TROOP-GESTURE-EVENTS.md similarity index 82% rename from .backlog/FEAT-TROOP-GESTURE-EVENTS/PRD.md rename to .backlog/archive/FEAT-TROOP-GESTURE-EVENTS.md index ee84e71a..5c30f34c 100644 --- a/.backlog/FEAT-TROOP-GESTURE-EVENTS/PRD.md +++ b/.backlog/archive/FEAT-TROOP-GESTURE-EVENTS.md @@ -1,10 +1,30 @@ -# FEAT-TROOP-GESTURE-EVENTS — four troop gestures publish no event +# FEAT-TROOP-GESTURE-EVENTS + +**Status:** merged (PR #311) — verified in game (live scenario 17/17, 2026-11-18). Compacted from `FEAT-TROOP-GESTURE-EVENTS/` on 2026-11-23; the ticket files live on in git history. + +Issue #308 (VMCT): four troop gestures (drop on the ground, load in a pickup zone, field extraction, return to the zone) publish no event, so a layer that followed them through the v1 callbacks loses four of its twelve gestures. Four new events (`OnTroopsLoaded`, `OnTroopsUnloaded`, `OnTroopsExtracted`, `OnTroopsReturned`), on the model of the vehicle ones, for players and AI transports; the migration guide is corrected. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-troops-unloaded` | ✅ done (PR #311) | 01 — A dropped troop group is announced (`OnTroopsUnloaded`) | +| `02-troops-loaded-and-returned` | ✅ done (PR #311) | 02 — Loading in a pickup zone and returning to it are announced (`OnTroopsLoaded`, `OnTroopsReturned`) | +| `03-troops-extracted-and-migration-guide` | ✅ done (PR #311) | 03 — Extraction in the field is announced (`OnTroopsExtracted`), and the migration guide tells the truth | + +## PRD + +## FEAT-TROOP-GESTURE-EVENTS — four troop gestures publish no event **Status:** ✅ done (PR #311) — verified in game 2026-11-18 (live scenario `scenario_troop_gesture_events.lua`, 17/17, DCS 2.9.30.28738, build of `develop` at `3f4618a`) GitHub issue #308 (reported by VMCT, 2026-11-18), decided with the maintainer on 2026-11-18 on the recommendation below. -## Problem Statement +### Problem Statement A layer that follows what players do with troops (VMCT, for instance: a troop drop counts in its scoring and keys the JTAC fire) subscribes to CTLD's events. For troops, only one gesture speaks: the **parachute drop** (`OnTroopsDeployed`, `OnTroopsParachuteLanded`). @@ -21,7 +41,7 @@ Two signs show the events were meant to exist: `OnTroopsDeployed` already carrie The vehicle and crate gestures do have their events (`OnVehicleLoaded`, `OnVehicleUnloaded`, `OnCrateLoaded`, …). Troops are the odd one out. -## Solution +### Solution Four new events, on the model of the vehicle ones, published when the gesture really happened: @@ -32,7 +52,7 @@ Four new events, on the model of the vehicle ones, published when the gesture re They fire for AI transports as well, with no player name; a consumer tells them apart from player transports by that field. `OnTroopsDeployed` is unchanged. The migration guide says what it really covers and points at `OnTroopsUnloaded` for a ground drop. -## User Stories +### User Stories 1. As a mission maker, I want an event when troops are dropped on the ground, so that my script can score the drop. 2. As a mission maker, I want the event to say whether the drop was on the ground or by fast-rope, so that I can tell them apart. @@ -52,7 +72,7 @@ They fire for AI transports as well, with no player name; a consumer tells them 16. As a CTLD developer, I want tests that fail when a gesture stays silent, so that it cannot regress. 17. As a CTLD developer, I want `OnTroopsDeployed` and `OnTroopsParachuteLanded` untouched, so that no existing consumer breaks. -## Implementation Decisions +### Implementation Decisions - **Four new events, additive.** `OnTroopsLoaded`, `OnTroopsUnloaded`, `OnTroopsExtracted`, `OnTroopsReturned`. The existing troop events are not changed. - **One shape.** Every event carries the troop group, the carrier unit's name, the player, and the time of the gesture; a zone when the gesture has one. @@ -64,20 +84,20 @@ They fire for AI transports as well, with no player name; a consumer tells them - **Migration guide (EN and FR)**: its example is corrected to say that `OnTroopsDeployed` covers the parachute drop, and to use `OnTroopsUnloaded` for a ground drop. - No translation key, no configuration or catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes what is published and what is not, with which payload, not how the manager is organised. - Seam: the troop manager's existing unit specs, which double the transport unit, the zone manager and the object registry. For each event: published once with the documented payload on success; not published on a refusal; empty `player` for an AI unit. "Unload All" with several groups publishes one event per group. The parachute events keep passing unchanged. - The events documentation is checked by reading: the troop section lists six events, with the method that publishes each. -## Out of Scope +### Out of Scope - Repairing `unloadTransport` and `unloadInProximityToEnemy` (see Further Notes). - Any change to `OnTroopsDeployed` or `OnTroopsParachuteLanded`. - Events for crates and vehicles (they exist). - A v1 `addCallback` compatibility layer: the migration guide already sends v1 code to the event bus. -## Further Notes +### Further Notes While reading the code for this lot, two scripted entry points turned out to be broken independently of it: `unloadTransport` and `unloadInProximityToEnemy` call a troop manager method named `deploy`, which no longer exists (the drop is `disembark`). `ctld.unloadTransport` and `ctld.unloadInProximityToEnemy` therefore raise an error when called. Not fixed here; a separate task is opened. The scripted **load** (`loadTransport`) works and will publish `OnTroopsLoaded`. diff --git a/.backlog/FIX-AA-CRATE-REGISTRY/PRD.md b/.backlog/archive/FIX-AA-CRATE-REGISTRY.md similarity index 78% rename from .backlog/FIX-AA-CRATE-REGISTRY/PRD.md rename to .backlog/archive/FIX-AA-CRATE-REGISTRY.md index b7b0bff7..c1808990 100644 --- a/.backlog/FIX-AA-CRATE-REGISTRY/PRD.md +++ b/.backlog/archive/FIX-AA-CRATE-REGISTRY.md @@ -1,10 +1,28 @@ -# FIX-AA-CRATE-REGISTRY — repairing or rearming an AA system leaves its crate behind as a ghost +# FIX-AA-CRATE-REGISTRY + +**Status:** merged (PR #302) — verified in game (live scenario 24/24, 2026-11-09). Compacted from `FIX-AA-CRATE-REGISTRY/` on 2026-11-23; the ticket files live on in git history. + +Found on the live check of FIX-CREATE-BEFORE-DESTROY (2026-11-09): after an AA repair or rearm, the repair or launcher crate keeps its entry in the crate registry and still counts as on the ground. Both paths now consume the crate through the crate manager, as the assembly does. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-consume-through-the-crate-manager` | ✅ done (PR #302) | 01 — AA repair and rearm consume their crate through the crate manager | + +## PRD + +## FIX-AA-CRATE-REGISTRY — repairing or rearming an AA system leaves its crate behind as a ghost **Status:** ✅ done (PR #302) — verified in game 2026-11-09 (the live scenario, 24/24, on the build of `develop` at `a88b43f`) Found on the live check of FIX-CREATE-BEFORE-DESTROY (PR #300, 2026-11-09, DCS 2.9.30.28738), decided with the maintainer the same day. The faulty call predates that lot (it is in `dba0410`). -## Problem Statement +### Problem Statement A pilot repairs a damaged AA system with a repair crate, or rearms it with a launcher crate. The system comes back and the crate's object disappears from the ground, but CTLD still lists the crate as one of its crates: it is only the DCS object that was destroyed, not the crate's entry in the registry. @@ -12,13 +30,13 @@ A crate whose object is gone and whose state is still "spawned" is treated as on The assembly of a new AA system does not have the problem: it consumes its crates through the crate manager, which destroys the object, removes the entry and announces it. -## Solution +### Solution Repair and rearm consume their crate the way the assembly does. Once the new system exists, the crate is destroyed through the crate manager: the object goes, the entry is removed from the registry, and `OnCrateCleared` is published (reason "destroyed") so the F10 unpack menu refreshes for the pilots nearby. Nothing else changes: the order of the operations (the new group first, ADR 0028), the messages, the events of the repair and the rearm. -## User Stories +### User Stories 1. As a pilot, I want a repair crate I used to be gone for good, so that no phantom crate appears in the unpack menu or in the crate counts. 2. As a pilot, I want a launcher crate I used to rearm a system to be gone for good, so that it cannot be used a second time. @@ -27,25 +45,25 @@ Nothing else changes: the order of the operations (the new group first, ADR 0028 5. As a CTLD developer, I want one way to consume a crate in the AA manager, so that the three paths (assemble, rearm, repair) behave alike. 6. As a CTLD developer, I want the test of a repair and a rearm to fail when the crate stays in the registry, so that the ghost cannot come back. -## Implementation Decisions +### Implementation Decisions - The AA manager's rearm and repair consume their crate through the crate manager's destroy, by crate name, exactly as the assembly already does for its parts. - The consumption stays after the creation of the new group: if DCS refuses the group, the crate is kept (ADR 0028). - The crate's own destroy (object only) is left as it is: it is correct for the callers that want only that. - No new message, no new translation key, no configuration change, no catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes what is left in the world and what is published, not how the manager is organised. - Seam: the existing AA manager specs in the deployment managers unit spec (a crate stand-in registered in the crate manager, a double of the group creation). New assertions on the existing success cases of a repair and of a rearm: the crate is no longer in the registry, and `OnCrateCleared` was published for it once. The refusal cases already there keep asserting that the crate stays. - The live scenario of FIX-CREATE-BEFORE-DESTROY (checks 4.3 and 5.2) is tightened to assert the registry entry is gone, replacing the weaker "static destroyed" check and its comment. -## Out of Scope +### Out of Scope - The guard and repair-truck groups of a Countryside FARP that survive its pack (observed once, not confirmed as a defect). - The semantics of "on the ground" for a crate with no DCS reference. - Any other site that destroys before creating (all handled by FIX-CREATE-BEFORE-DESTROY). -## Further Notes +### Further Notes Seen on the live check as two failures, "repair crate still registered" and "launcher crate still registered", while the DCS statics were gone. The unit specs of FIX-CREATE-BEFORE-DESTROY only counted calls to the crate's own destroy, which is why they passed. diff --git a/.backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/PRD.md b/.backlog/archive/FIX-AUTO-UNPACK-SILENT-FAILURE.md similarity index 83% rename from .backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/PRD.md rename to .backlog/archive/FIX-AUTO-UNPACK-SILENT-FAILURE.md index 6ed04a1d..d43ee91b 100644 --- a/.backlog/FIX-AUTO-UNPACK-SILENT-FAILURE/PRD.md +++ b/.backlog/archive/FIX-AUTO-UNPACK-SILENT-FAILURE.md @@ -1,10 +1,28 @@ -# FIX-AUTO-UNPACK-SILENT-FAILURE — a parachuted equipment crate that cannot be unpacked fails in silence and is logged as a success +# FIX-AUTO-UNPACK-SILENT-FAILURE + +**Status:** merged (PR #307). Compacted from `FIX-AUTO-UNPACK-SILENT-FAILURE/` on 2026-11-23; the ticket files live on in git history. + +Issue #294: a parachuted equipment crate that cannot be unpacked on landing (JTAC limit, group refused by DCS) failed in silence and the log announced a success. The pilot who dropped it is now told why, and the log says "unpacked" only when it was. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-tell-the-dropper-and-log-the-truth` | ✅ done (PR #307) | 01 — Tell the dropper, and log the truth, when a parachuted equipment crate cannot be unpacked | + +## PRD + +## FIX-AUTO-UNPACK-SILENT-FAILURE — a parachuted equipment crate that cannot be unpacked fails in silence and is logged as a success **Status:** ✅ done (PR #307) GitHub issue #294 (automated review of `develop` at `1b61b10`), decided with the maintainer on 2026-11-10 (who is told: the dropper). -## Problem Statement +### Problem Statement A pilot parachutes an equipment crate (a vehicle, a static, a JTAC drone) above the objective. When it touches the ground, CTLD unpacks it by itself. If the equipment cannot be created — the coalition's JTAC quota is reached, or DCS refuses the group — nothing appears and **nobody is told**: not the pilot, on screen or over the radio, and not the log, which says it unpacked. @@ -17,7 +35,7 @@ Since the lot FIX-CREATE-BEFORE-DESTROY (PR #300) the crates are no longer lost The menu path has none of this: it reads the result and tells the pilot (PR #267). -## Solution +### Solution The pilot who dropped the crate is told. CTLD notes who dropped each parachuted crate at the moment of the drop, and when the crate lands and its equipment cannot be created, that pilot reads the same message as on the menu path: the DCS refusal, or the reason of the JTAC limit. A pilot who has left in the meantime is simply not told. @@ -27,7 +45,7 @@ A crate released by the DCS cargo system itself (CTLD does not see who) has no r When the equipment is created, nothing changes. -## User Stories +### User Stories 1. As a pilot who parachuted a vehicle crate, I want to be told when the vehicle could not be created, so that I do not wait for it. 2. As a pilot who parachuted a JTAC drone crate, I want to read the reason when the coalition's JTAC limit blocked it, so that I know what to do. @@ -42,7 +60,7 @@ When the equipment is created, nothing changes. 11. As a CTLD developer, I want the dropper forgotten when the crate is loaded again, so that a later drop does not message a previous pilot. 12. As a CTLD developer, I want a test that fails when the failure is silent, so that the path cannot regress. -## Implementation Decisions +### Implementation Decisions - A crate has a new, optional **dropper**: the unit name of the pilot who parachuted it. Empty by default; set by the CTLD parachute at the drop (the unit is known there); cleared when the crate is loaded again, like the existing parachute flag. - The automatic unpack of an equipment crate passes the crate's dropper as the player to the equipment creation. The creation already sends the refusal and the JTAC-limit messages to that player when it exists in the world, and does nothing for an unknown name. @@ -51,20 +69,20 @@ When the equipment is created, nothing changes. - The order of the operations (equipment first, crates consumed only if it exists, ADR 0028) is unchanged. - No new message, no translation key, no configuration or catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes what the pilot reads and what is logged, not how the manager is organised. - Seam: the unpack result functional spec, whose parachute cases (added by PR #300) land a parachuted crate with the equipment creation doubled. New cases: a refused group tells a registered dropper the refusal; the JTAC limit tells the dropper the limit; a crate with no dropper tells nobody and logs the warning; a success logs the unpack line and no warning. - Seam for the dropper itself: the parachute functional spec, where the crate drop is already driven with a transport double: the crate records the dropper's unit name; loading it again clears it. - The new cases fail before the change and pass after it; the existing cases pass unchanged. -## Out of Scope +### Out of Scope - A message to the dropper when the equipment **is** created. - The scene and FOB branches of the automatic unpack (a stepped scene has its own failure path). - The menu path (already honest since PR #267). - Recording the dropper for a DCS-native release. -## Further Notes +### Further Notes The issue proposed passing the crate's original requester instead. The dropper was preferred: the pilot who requested a crate is not always the one who dropped it. diff --git a/.backlog/FIX-CONFIG-LABELS-I18N-LANG/PRD.md b/.backlog/archive/FIX-CONFIG-LABELS-I18N-LANG.md similarity index 76% rename from .backlog/FIX-CONFIG-LABELS-I18N-LANG/PRD.md rename to .backlog/archive/FIX-CONFIG-LABELS-I18N-LANG.md index a3be3094..92dda308 100644 --- a/.backlog/FIX-CONFIG-LABELS-I18N-LANG/PRD.md +++ b/.backlog/archive/FIX-CONFIG-LABELS-I18N-LANG.md @@ -1,10 +1,28 @@ -# FIX-CONFIG-LABELS-I18N-LANG — the labels of the configuration ignore the configuration's own `i18n_lang` +# FIX-CONFIG-LABELS-I18N-LANG + +**Status:** merged (PR #314). Compacted from `FIX-CONFIG-LABELS-I18N-LANG/` on 2026-11-23; the ticket files live on in git history. + +Issue #310 (VMCT): the `desc` / `name` labels of the configuration were translated before the settings were filled, so they followed the global language and ignored the snapshot's own `i18n_lang` (an English mission with `i18n_lang: fr` got a French menu and English labels). They are now translated after the settings are in place. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-translate-the-labels-after-the-settings` | ✅ done (PR #314) | 01 — Translate the labels of the configuration after the settings are in place | + +## PRD + +## FIX-CONFIG-LABELS-I18N-LANG — the labels of the configuration ignore the configuration's own `i18n_lang` **Status:** ✅ done (PR #314) GitHub issue #310 (reported by VMCT), decided with the maintainer on 2026-11-18. -## Problem Statement +### Problem Statement A mission maker writes `i18n_lang: fr` in the mission's `ctld-config.yaml`. The setting is explicit; the guide of the host project says it wins, "c'est voulu". It does, for every text CTLD shows: the F10 menu, the messages. @@ -12,11 +30,11 @@ It does not win for the **labels of the configuration**: the descriptions of cra The cause is the order of the load: CTLD translates the labels **before** it fills the settings. At that moment the language lookup cannot see the snapshot's `i18n_lang` yet, so it falls back to the global language. -## Solution +### Solution The labels are translated after the settings are in place, so they follow the snapshot's `i18n_lang` like every other text. A snapshot that sets no `i18n_lang` keeps using the global language, as today. -## User Stories +### User Stories 1. As a mission maker, I want the labels of my configuration in the language I set with `i18n_lang`, so that the menu and the labels agree. 2. As a mission maker, I want an explicit `i18n_lang` to win over the language a host script aligned on the mission, so that my choice is not overridden. @@ -25,25 +43,25 @@ The labels are translated after the settings are in place, so they follow the sn 5. As a host-project maintainer (VMCT), I want the sentence of my guide ("your explicit `i18n_lang` wins") to be true for the labels too, so that I do not have to name an exception. 6. As a CTLD developer, I want a test that sets a snapshot language different from the global one, in both directions, so that the order of the load cannot regress. -## Implementation Decisions +### Implementation Decisions - The load fills the settings first, then translates the labels. The label tables are shared with the settings, so translating them in place translates what the settings hold. - The default lists a snapshot lacks (the version-gap block) were already translated after the settings were filled: unchanged. - `i18n_lang` stays out of the engine catalogue on purpose (it is a bare global read by the translation function; a snapshot that sets it lands in the settings): so a snapshot without it still falls back to the global language. - No new message, no translation key, no configuration or catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes the label a loaded configuration holds, not how the load is organised. - Seam: the configuration unit spec, which already loads snapshots. Three cases: a snapshot with `i18n_lang: fr` and a global `en` gives the French label; a snapshot with `i18n_lang: en` and a global `fr` gives the English one; a snapshot with no `i18n_lang` and a global `fr` gives the French one (control, unchanged). The spec loads the French dictionary itself (the test loader only loads English). - The two first cases fail before the change and pass after it; every existing case passes unchanged. - Not run in DCS: the load order is fully covered by the unit spec. -## Out of Scope +### Out of Scope - The second half of the issue, the sentence of the VMCT guide (`GUIDE.md`, `GUIDE.en.md`): it lives in VEAF-Mission-Creation-Tools. After this fix it is true as written. - Re-translating labels when the language changes after the load (they are translated once, at load). -## Further Notes +### Further Notes The issue suggested either reading `i18n_lang` from the snapshot before translating, or translating after the settings are filled. The second is the smaller change and reuses the lookup every other text already goes through. diff --git a/.backlog/FIX-CONFIG-NEW-LISTS/PRD.md b/.backlog/archive/FIX-CONFIG-NEW-LISTS.md similarity index 65% rename from .backlog/FIX-CONFIG-NEW-LISTS/PRD.md rename to .backlog/archive/FIX-CONFIG-NEW-LISTS.md index 6163839a..a08abe2c 100644 --- a/.backlog/FIX-CONFIG-NEW-LISTS/PRD.md +++ b/.backlog/archive/FIX-CONFIG-NEW-LISTS.md @@ -1,8 +1,26 @@ -# FIX-CONFIG-NEW-LISTS — a list newer than the mission configuration is not a removal +# FIX-CONFIG-NEW-LISTS + +**Status:** merged (PR #275). Compacted from `FIX-CONFIG-NEW-LISTS/` on 2026-11-23; the ticket files live on in git history. + +A list the catalogue gained after a mission configuration's version takes its default instead of reading as removed: the Fat Cow lists were empty on every `2.2.0` configuration (ADR 0011 Addendum 3). + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-date-the-lists` | — | 01 — date the lists, default the newer ones | + +## PRD + +## FIX-CONFIG-NEW-LISTS — a list newer than the mission configuration is not a removal Status: done — 2026-10-27 (PR #275) -## Problem +### Problem A mission configuration (`ctld.configUser`) omits a list on purpose to remove it (ADR 0011). But a configuration written before a catalogue version never had the lists that version added. @@ -11,18 +29,18 @@ The Fat Cow (catalogue `2.3.0`) added `fatCowTypes`, `fatCowCrates`, `fatCowLoad Found on 2026-10-27 vendoring rc14 into VMCT: the VEAF Open Trainings' `ctld-config.yaml` date from `2.2.0`, and the `.miz` published that morning carried a `CTLD_userConfig.lua` without a single Fat Cow list. `ctld-tools` had the same gap: its completion (ADR 0011 Addendum 2) adds scalars and entry fields, never a whole list, and saving stamps the new version, which makes the omission a removal for good. -## Decision +### Decision ADR 0011 Addendum 3. The build dates every list from the pinned shapes (`ctld-tools since` → `ctld.configListSince`); the engine and `ctld-tools` give a list its default when the configuration's `configVersion` is older than the list. -## Definition of done +### Definition of done - `ctld.configListSince` generated by the build and merged into `CTLD.lua`. - `CTLDConfig:load()` gives a newer list its default, localised, and names it in the startup notice; an omission at or after the list's version stays a removal. - `complete()` adds such a list when `ctld-tools` opens the configuration. - busted and pytest cover both sides; docs (mission-maker configuration EN + FR), ADR, CHANGELOG. -## Not claimed +### Not claimed Not flown: the Open Trainings were completed by hand in their own `ctld-config.yaml` on 2026-10-27 and run with that, not with this fix. diff --git a/.backlog/FIX-CREATE-BEFORE-DESTROY/PRD.md b/.backlog/archive/FIX-CREATE-BEFORE-DESTROY.md similarity index 85% rename from .backlog/FIX-CREATE-BEFORE-DESTROY/PRD.md rename to .backlog/archive/FIX-CREATE-BEFORE-DESTROY.md index 2f210590..3846fa7b 100644 --- a/.backlog/FIX-CREATE-BEFORE-DESTROY/PRD.md +++ b/.backlog/archive/FIX-CREATE-BEFORE-DESTROY.md @@ -1,4 +1,27 @@ -# FIX-CREATE-BEFORE-DESTROY — an action that replaces one thing by another creates the new one first, and destroys the old one only if that worked +# FIX-CREATE-BEFORE-DESTROY + +**Status:** merged (PR #300) — 06 ✅ verified in game (Zip, 2026-11-09). Compacted from `FIX-CREATE-BEFORE-DESTROY/` on 2026-11-23; the ticket files live on in git history. + +Issue #293 (Zip, 2026-11-09, widened to every destructive action): an action that replaces one thing by another (pack a vehicle, a FARP or a Fat Cow FARP, unpack crates, rearm or repair an AA system) destroyed the original first, so a DCS refusal lost it. Create the replacement first, all or nothing, and destroy the original only once it exists. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-helper-adr-and-vehicle-pack` | ✅ done (PR #300) | 01 — All-or-nothing crate creation, ADR 0028, and the vehicle pack | +| `02-farp-scene-pack` | ✅ done (PR #300) | 02 — FARP scene pack creates its crates before destroying the scene | +| `03-fat-cow-farp-pack` | ✅ done (PR #300) | 03 — Fat Cow FARP pack creates its crates before closing the FARP | +| `04-unpack-to-a-unit` | ✅ done (PR #300) | 04 — Unpacking crates into a unit keeps the crates until the unit exists | +| `05-aa-system-rearm-repair` | ✅ done (PR #300) | 05 — AA system rearm and repair keep the old system until the new one exists | +| `06-live-check` | ✅ done — automated checks PASS and the hand test in the CH-47F cockpit confirmed by the maintainer (2026-11-09) | 06 — Live check in DCS | + +## PRD + +## FIX-CREATE-BEFORE-DESTROY — an action that replaces one thing by another creates the new one first, and destroys the old one only if that worked **Status:** ✅ done (PR #300) — live check passed 2026-11-09 (automated scenarios and a hand test by the maintainer); both decisions confirmed by the maintainer on 2026-11-09 (see "Decisions (Zip, 2026-11-09)"). @@ -8,7 +31,7 @@ never the crates *created*), widened by the maintainer on 2026-11-09 to every de Precedents: FIX-FARP-PACK-FALSE-SUCCESS (PR #268) and FIX-UNPACK-FALSE-SUCCESS (PR #267) made the *message* honest and explicitly left the *order* of the operations to a separate decision. This lot takes that decision. -## Problem Statement +### Problem Statement Several actions turn one object into another: a pilot packs a vehicle or a FARP into crates, unpacks crates into a vehicle, a mechanic rearms or repairs an AA system. Each of them destroys the original first and creates its replacement second. DCS can refuse the creation (a static or a @@ -23,7 +46,7 @@ Two honest messages (PRs #267, #268) tell the pilot *that* something was lost. N The `OnVehiclePacked` event also publishes the number of crates *requested* as `cratesSpawned`: wrong by construction for any future consumer (statistics, scoring, an external plugin). -## Solution +### Solution Every replace action follows one rule: **create the replacement first; destroy the original only once the creation succeeded.** @@ -32,7 +55,7 @@ vehicle is still there, the FARP still open with its stock, the crates still on When the creation succeeds, what the pilot sees is unchanged. -## Decisions (Zip, 2026-11-09) +### Decisions (Zip, 2026-11-09) 1. **Create before destroying**, for every action that replaces one thing by another (stated twice by the maintainer). 2. **Partial creation is all or nothing** (confirmed). If only some of the crates were created (say 1 of 2), the crates already created are @@ -43,7 +66,7 @@ When the creation succeeds, what the pilot sees is unchanged. scene has its own failure path (`onSceneFailed`). The ADR notes it. Keeping the crates until the scene's last step would be a different design (a deferred consume) and its own lot. -## User Stories +### User Stories 1. As a pilot, I want my vehicle to stay where it is when DCS refuses to create its crates, so that a failed pack costs me nothing. 2. As a pilot, I want to be told the pack failed and why nothing happened, so that I can try again from a better spot. @@ -67,7 +90,7 @@ When the creation succeeds, what the pilot sees is unchanged. 20. As a CTLD developer, I want the tests to fail when a refused creation destroys the original, so that the order cannot regress. 21. As a pilot, I want no change to the menus, the distances or the placement of the crates (ADR 0024), so that this lot is invisible when nothing fails. -## Implementation Decisions +### Implementation Decisions - **The rule.** Create the replacement first. Destroy the original and run every side effect that presupposes its disappearance only after the creation reported full success. @@ -94,7 +117,7 @@ When the creation succeeds, what the pilot sees is unchanged. - **Unchanged:** the placement of crates (ADR 0024), the menus, the messages of a successful action, the Fat Cow deploy (its crates are already consumed only once the FARP is laid out), the loading of crates and troops (no replacement is created). -## Testing Decisions +### Testing Decisions - A good test observes what the pilot reads, what is left in the world, what is logged and which events are published; it does not observe how an action is organised. @@ -108,14 +131,14 @@ When the creation succeeds, what the pilot sees is unchanged. - Live check in DCS (one ticket): DCS can only be made to refuse a creation by tampering, so the check is the **success path** on each site (pack a vehicle, pack a FARP, pack a Fat Cow FARP, unpack, repair an AA system) and the overlap of the AA respawn. -## Out of Scope +### Out of Scope - An unpack that starts a stepped scene (decision 2). - Giving back an original already lost before this lot ships. - Any change to what a successful action does, says or places. - Fat Cow deploy, crate and troop loading. -## Further Notes +### Further Notes The sites, as found in `develop` at `dba0410`: diff --git a/.backlog/FIX-FARP-PACK-FALSE-SUCCESS/PRD.md b/.backlog/archive/FIX-FARP-PACK-FALSE-SUCCESS.md similarity index 76% rename from .backlog/FIX-FARP-PACK-FALSE-SUCCESS/PRD.md rename to .backlog/archive/FIX-FARP-PACK-FALSE-SUCCESS.md index 67aeddec..72eae425 100644 --- a/.backlog/FIX-FARP-PACK-FALSE-SUCCESS/PRD.md +++ b/.backlog/archive/FIX-FARP-PACK-FALSE-SUCCESS.md @@ -1,11 +1,29 @@ -# FIX-FARP-PACK-FALSE-SUCCESS — packing a FARP announces "packed successfully" without checking that a crate was created +# FIX-FARP-PACK-FALSE-SUCCESS + +**Status:** merged (PR #268). Compacted from `FIX-FARP-PACK-FALSE-SUCCESS/` on 2026-11-23; the ticket files live on in git history. + +Packing a FARP now reports a pack that created no crate, or only some, instead of always announcing a success. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-report-the-crates-created` | ✅ done (PR #268) | 01 — Report how many crates the FARP pack created | + +## PRD + +## FIX-FARP-PACK-FALSE-SUCCESS — packing a FARP announces "packed successfully" without checking that a crate was created **Status:** ✅ done (PR #268) GitHub issue #263 (automated review of `develop` at `673b064`), decided with the maintainer on 2026-10-20 (message only; the order of the operations is unchanged). -## Problem Statement +### Problem Statement The *Pack * command of a deployed FARP destroys every object of the scene first (`CTLDSceneManager:packScene`), then creates the crates. The creation can produce nothing or only part of the crates (DCS refuses an object, no position was computed). The first return value @@ -13,13 +31,13 @@ of the crate creation, which is exactly the number of crates created, is thrown A FARP can therefore disappear with no crate at all, and the warehouse share that should have travelled in the missing crates is lost, with no trace except a server-side log line. -## Solution +### Solution The command reads the number of crates created. None: the pilot is told the pack failed, and an ERROR is logged. Fewer than expected: the pilot is told how many were created, and a WARNING is logged. All of them: the message does not change. The creation is still attempted after the scene is destroyed, as today. -## User Stories +### User Stories 1. As a pilot, I want to be told when packing a FARP produced no crate, so that I know the FARP is lost and why nothing is on the ground. 2. As a pilot, I want to be told how many crates were created when only some were, so that I know the pack is incomplete. @@ -28,7 +46,7 @@ after the scene is destroyed, as today. 5. As a CTLD developer, I want the same wording style as Request Equipment, so that failures read alike. 6. As a maintainer, I want the question of creating the crates before destroying the scene left to a separate decision. -## Implementation Decisions +### Implementation Decisions - `refreshPackEquiptSection`'s Pack callback keeps the first return value of the crate creation and announces by its value: 0 → failure message + ERROR log; below the expected number → partial message (`%1` created, `%2` expected) + WARNING log; otherwise the existing message. @@ -37,18 +55,18 @@ after the scene is destroyed, as today. - Unchanged: the order (the scene is destroyed, then the crates are created), the warehouse snapshot carried by the crates that exist, the menu refresh after the pack, the scene manager, the catalogue. -## Testing Decisions +### Testing Decisions - A good test observes what the pilot reads and what is logged, not how the command is organised. - The existing pack spec (`crate_scene_pack_placement_spec`, prior art: the menu builder and the real command with a double of the crate creation): new cases with a creation that makes none, only some, or all of the crates (control). -## Out of Scope +### Out of Scope - Creating the crates before destroying the scene (a safer order, but it changes the order of a destructive action; own decision and ADR if wanted). - Giving the FARP back when the creation fails. -## Further Notes +### Further Notes None. diff --git a/.backlog/FIX-FAT-COW-AI-LANDING/PRD.md b/.backlog/archive/FIX-FAT-COW-AI-LANDING.md similarity index 72% rename from .backlog/FIX-FAT-COW-AI-LANDING/PRD.md rename to .backlog/archive/FIX-FAT-COW-AI-LANDING.md index 5f96b9c6..cf3c05e4 100644 --- a/.backlog/FIX-FAT-COW-AI-LANDING/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-AI-LANDING.md @@ -1,8 +1,26 @@ -# FIX-FAT-COW-AI-LANDING — an AI Fat Cow lands in a clearing, and a cow dead without an event is forgotten +# FIX-FAT-COW-AI-LANDING + +**Status:** merged (PR #278) — live check PASS 2026-10-30, with FEAT-FAT-COW-TAKEOVER ticket 02. Compacted from `FIX-FAT-COW-AI-LANDING/` on 2026-11-23; the ticket files live on in git history. + +Found on the take-over live check (2026-10-30): an AI cow landing 120 m left of its leader struck a tree, and DCS fired no death event, leaving a ghost cow. It now lands in the nearest clearing (`Disposition.getSimpleZones`), and the 10 s loop forgets a cow whose unit is gone. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-clearing-and-vanished-cow` | — | 01 — land in a clearing, forget a vanished cow | + +## PRD + +## FIX-FAT-COW-AI-LANDING — an AI Fat Cow lands in a clearing, and a cow dead without an event is forgotten Status: in progress -## Problem +### Problem Found running the FEAT-FAT-COW-TAKEOVER live check (2026-10-30, `Test_FatCow_Takeover.miz`, twice, same spot): the mission cow `Fat Cow Hawk`, sent to land 120 m left of its AI leader at Hawk's first stop, hovered at 13 m, drifted, and struck a map object (id `87975593`, most likely a tree) at about 10 m above the ground. A probe logged every event naming the cow and its state every second: @@ -17,22 +35,22 @@ A probe logged every event naming the cow and its state every second: 1. **The landing point**: CTLD sends the cow to a fixed offset from the leader (or from the requester of **Land here**, who may well be hovering), wherever that falls: trees included. 2. **The death goes unnoticed**: DCS fired no `S_EVENT_DEAD`, `S_EVENT_CRASH` nor `S_EVENT_UNIT_LOST` for the cow, and CTLD listens to the first two only. The cow stayed registered in phase `landing`: its FARP never opens, its flight is refused a new cow ("Your flight already has a Fat Cow"). -## Solution +### Solution 1. **A clearing around the asked point**: the point 120 m left of the leader is searched for the nearest clearing within 300 m, with the widest clearance from scenery that offers one (100 m, else 50, else 30), with `Disposition.getSimpleZones` — the undocumented DCS singleton VMCT's `veaf.findSpawnPoint` uses for its helicopter landings (measured on 2026-08-06: its points avoid buildings and forests; `veafAircraftSpawn` HELICOPTER_LZ_SEARCH 300 m; descending clearances as `veaf.findSpawnPoint`'s). A single 30 m clearance (VMCT's, for a Mi-8) was the first try: on the live check of 2026-10-30 it put the cow next to the only tree of an open field, which the CH-47, drifting down at 3 m/s, struck (`87975620`, screenshot by Zip). With 50 m the nearest point there is 100 m from the leader, with 100 m 227 m. A candidate closer than 60 m to the leader, or on water, is skipped. No singleton, an error, or no candidate: the asked point, as today. 2. **A vanished cow is forgotten**: the 10 s loop that re-syncs the FARPs also checks every AI cow's unit; one no longer in the world is handled as a dead cow (FARP packed and released, flight free to request another, take-over menus updated). -## Measured in game (2026-10-30, `Test_FatCow_Takeover.miz`) +### Measured in game (2026-10-30, `Test_FatCow_Takeover.miz`) - The vanished cow is forgotten: `registered=false`, Hawk free of its cow, within the 10 s loop. - 30 m clearance: not enough (above). -## Definition of done +### Definition of done - Unit specs (`tests/ci/unit/fatcow_ai_spec.lua`): the landing point moves to the nearest acceptable clearing, keeps the asked point without the singleton or on an error, never closer than 60 m to the leader; a cow whose unit is gone is forgotten by the loop and its flight can request another. - The FEAT-FAT-COW-TAKEOVER live check run on the same kit (ticket 02): the cow lands and lives, and the take-over scenario passes. - CHANGELOG, pilot doc (the landing spot). -## Out of scope +### Out of scope - Piloted cows: a pilot picks the spot. diff --git a/.backlog/FIX-FAT-COW-CLEARING-LOG/PRD.md b/.backlog/archive/FIX-FAT-COW-CLEARING-LOG.md similarity index 86% rename from .backlog/FIX-FAT-COW-CLEARING-LOG/PRD.md rename to .backlog/archive/FIX-FAT-COW-CLEARING-LOG.md index ee1e7154..f586face 100644 --- a/.backlog/FIX-FAT-COW-CLEARING-LOG/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-CLEARING-LOG.md @@ -1,10 +1,29 @@ -# FIX-FAT-COW-CLEARING-LOG — the AI cow's clearing search can fail without leaving anything in the log +# FIX-FAT-COW-CLEARING-LOG + +**Status:** merged (PR #316). Compacted from `FIX-FAT-COW-CLEARING-LOG/` on 2026-11-23; the ticket files live on in git history. + +Issue #299 (found by an automated review): the AI cow's clearing search (`Disposition.getSimpleZones`, undocumented) falls back to the raw landing point in five situations and logs none of them, so a DCS patch could bring back the tree strikes of 2026-10-30 without a trace. The API failures (singleton missing, error, wrong shape) get a `WARN` once per mission and per cause, the benign "no clearing" an `INFO` at every landing; the landing point does not change. Log only, no start-up alert. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-probe-the-real-search-output` | ✅ done (probe of 2026-11-18, PR #316) | 01 — Check the real output of the clearing search | +| `02-log-the-clearing-search` | ✅ done (PR #316) | 02 — The clearing search leaves a trace when it cannot do its job | + +## PRD + +## FIX-FAT-COW-CLEARING-LOG — the AI cow's clearing search can fail without leaving anything in the log **Status:** ✅ done (PR #316) — decisions taken in the grill of 2026-11-18 (no ADR: reversible and unsurprising; no `CONTEXT.md` term: it has no Fat Cow vocabulary). GitHub issue #299 (found by an automated review of `develop`). -## Problem Statement +### Problem Statement `FIX-FAT-COW-AI-LANDING` (PR #278) makes the AI Fat Cow land in a clearing instead of on the raw point 120 m to the left of its leader. It searches the clearing with `Disposition.getSimpleZones`, an undocumented DCS singleton. Five situations make the cow land on the raw point, and **none of them leaves a trace in the log**: @@ -18,7 +37,7 @@ The first four are an API failure; the fifth is benign. Only the case that works A DCS patch that changes the signature, the argument order, the return type or removes the singleton would put CTLD back on the defect the batch was opened for: a cow struck a tree at 10 m, twice at the same place on 2026-10-30. Back then there was a clue (a destroyed cow, an `S_EVENT_HIT`, a FARP that did not open). Now the DCS log would say nothing at all and the diagnosis would start from scratch. The benign case cannot be told apart from an API failure either, when reading the log of a mission where a cow crashed on landing. -## Solution +### Solution Log the situations the silent fallback mixes up, and nothing else: @@ -28,7 +47,7 @@ Log the situations the silent fallback mixes up, and nothing else: Log only: no start-up notice, no probe of the API at boot, no on-screen message. -## User Stories +### User Stories 1. As a mission maker, I want a warning in the log when the clearing search is unavailable, so that I know the AI cow lands on the raw point and not in a clearing. 2. As a mission maker, I want the error `getSimpleZones` raised written in the log, so that I can tell a changed signature from a removed singleton. @@ -46,7 +65,7 @@ Log only: no start-up notice, no probe of the API at boot, no on-screen message. 14. As a maintainer, I want the real DCS output of the search checked once against the code's assumption about its shape, so that the new warning does not fire on a healthy game. 15. As a maintainer, I want the change to need no configuration key, so that the catalogue version and the dictionaries stay as they are. -## Implementation Decisions +### Implementation Decisions - **One shared path.** The logging lives in the clearing helpers used by both landing paths of the cow manager, so that the flight landing and "Land here" are covered by the same change. - **Five outcomes instead of two.** The clearing search tells its caller which of found / singleton missing / error / wrong shape / no clearing it got, instead of returning a bare point or nothing. The choice of the point is unchanged: the nearest well-formed candidate that passes today's filters, at the widest clearance that offers one. @@ -61,7 +80,7 @@ Log only: no start-up notice, no probe of the API at boot, no on-screen message. - **No configuration change**: no new key, so no `configVersion` bump, no catalogue shape, no dictionary regeneration. - **CHANGELOG**: one *Fixed* entry under `[Unreleased]`. -## Testing Decisions +### Testing Decisions - **A good test** asserts what an observer sees: the log lines (level and key words) and the point the cow lands on. It does not look at the helpers' return values or the flags. - **Seam**: the existing Fat Cow AI landing spec, which already drives both landing paths with the singleton replaced by a double (absent, raising, returning an empty list) and checks the landing point. The log is captured the way other specs of the repository capture it. @@ -76,14 +95,14 @@ Log only: no start-up notice, no probe of the API at boot, no on-screen message. - the landing point is the same as before in every case: the existing assertions stay green. - **Live probe** (ticket 02): one read-only call of the real search over the DCS bridge to confirm the shape of its output (see *Further Notes*). -## Out of Scope +### Out of Scope - Probing the API at start-up, or any visible alert (notice, on-screen message). - Changing which clearing is chosen, the clearances, the search radius or the fallback point. - Replacing `Disposition.getSimpleZones`. - The other Fat Cow issues (#295 to #298): the ground test of the cow, the return value of its deployment, the menu entries. -## Further Notes +### Further Notes - **Why a live probe.** The "wrong shape" warning rests on an assumption about the points the real API returns; the code itself only says a point "may be" a vec2. If the real shape were another one, the warning would fire at the first landing of every mission and the log would lie the other way. One read-only call near a point of the map, far from the player (clearances 100, 50 and 30 m, a 300 m radius, 10 attempts), records the type of the return, the number of candidates and the exact shape of the first. No group or object is created, and no mission reload is needed. If the real shape differs, the definition of "well-formed" is adjusted before the pull request and the ticket says so. - Two tickets, in the order they run: 01 the live probe, which fixes the definition of *well-formed* on the real output; 02 the log lines, with their tests and the CHANGELOG entry. diff --git a/.backlog/FIX-FAT-COW-DEPLOY-REFUSALS/PRD.md b/.backlog/archive/FIX-FAT-COW-DEPLOY-REFUSALS.md similarity index 87% rename from .backlog/FIX-FAT-COW-DEPLOY-REFUSALS/PRD.md rename to .backlog/archive/FIX-FAT-COW-DEPLOY-REFUSALS.md index 4ee53326..78084a68 100644 --- a/.backlog/FIX-FAT-COW-DEPLOY-REFUSALS/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-DEPLOY-REFUSALS.md @@ -1,10 +1,28 @@ -# FIX-FAT-COW-DEPLOY-REFUSALS — the AI cow's deployment timer drops the reason `deploy` gave: every refusal is silent +# FIX-FAT-COW-DEPLOY-REFUSALS + +**Status:** merged (PR #319). Compacted from `FIX-FAT-COW-DEPLOY-REFUSALS/` on 2026-11-23; the ticket files live on in git history. + +Issue #296 (found by an automated review): the AI cow's deployment timer dropped the answer of `deploy`, so five of the six refusals (empty cow, airborne, scene, deployed, unknown) were silent, for the flight and for the log; the piloted cow's path already reported them. A flight whose cow was emptied, folded with Take off, then landed with Land here waited for an announced FARP that never came. The timer now reads the answer: an empty cow says so and advises RTB, the other refusals reuse the existing message, all are logged. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-report-a-refused-deployment` | ✅ done (PR #319) | 01 — The AI cow's deployment timer reports a refused deployment | + +## PRD + +## FIX-FAT-COW-DEPLOY-REFUSALS — the AI cow's deployment timer drops the reason `deploy` gave: every refusal is silent **Status:** ✅ done (PR #319) — decisions taken in the grill of 2026-11-18 (no ADR, no `CONTEXT.md` term). GitHub issue #296 (found by an automated review of `develop`; the code has moved since, the analysis holds). -## Problem Statement +### Problem Statement When an AI Fat Cow lands, a timer waits for the deployment delay (60 s by default) and then asks the cow to open its FARP. The request answers either "done", or "refused" with a reason, and the timer **throws the answer away**. The reasons are six: @@ -28,7 +46,7 @@ The simplest way to meet it needs no DCS failure at all: The flight waits for a FARP it was promised and never learns that the cow is empty, although **Fat Cow status** and **RTB** exist for that. On the server, the log carries no trace either: the only deployment line sits on the path that is never reached. The other four refusals are rare and silent the same way. No test makes the deployment that follows the delay fail. -## Solution +### Solution The timer reads the answer and says what happened, to the flight and to the log: @@ -39,7 +57,7 @@ The timer reads the answer and says what happened, to the flight and to the log: Nothing else about the cow changes: it still lands when asked, and it is not sent home on its own. -## User Stories +### User Stories 1. As a pilot whose flight's cow is empty, I want to be told when its FARP does not open, so that I do not wait for a FARP that will not come. 2. As a pilot, I want that message to say the cow is empty and to point to **RTB**, so that I know what to do next. @@ -58,7 +76,7 @@ Nothing else about the cow changes: it still lands when asked, and it is not sen 15. As a maintainer, I want tests that make the deployment fail for each reason, so that a refusal cannot go silent again unseen. 16. As a maintainer, I want no new setting, so that the catalogue and the saved configurations stay as they are. -## Implementation Decisions +### Implementation Decisions - **The timer reports the answer.** After the delay, it reads what the deployment returned. When the deployment is refused, it tells the flight the cow serves, if that flight still exists, and writes a line in the log whether the flight exists or not. - **Per reason:** @@ -78,7 +96,7 @@ Nothing else about the cow changes: it still lands when asked, and it is not sen - **Documentation.** One sentence in the pilot guide (English and French), by the **Land here** command: a cow with nothing left opens no FARP, and the flight is told when the delay runs out, with the advice to send it home with **RTB**. Today the guide only promises that the FARP opens one minute after touchdown. - **CHANGELOG**: one *Fixed* entry under `[Unreleased]`. No configuration key: no `configVersion` change, no catalogue shape. -## Testing Decisions +### Testing Decisions - **A good test** observes what the flight reads and what the log says, not the internals of the timer. - **Seam**: the existing AI Fat Cow spec, in which the cow lands and the scheduled timers can be run by hand; its scene is a double that can be made to refuse. Logs are captured the way the clearing-search specs capture them. @@ -93,7 +111,7 @@ Nothing else about the cow changes: it still lands when asked, and it is not sen - nominal path: a cow with stock deploys, with no warning and no refusal message; the existing nominal and cancellation tests pass unchanged. - **No live DCS check**: the path depends on a timer and on the cow's state, both covered by the unit tests. The pull request says so. -## Out of Scope +### Out of Scope - An immediate refusal in **Land here** for an empty cow. - Sending an empty cow home when it folds its FARP. @@ -102,7 +120,7 @@ Nothing else about the cow changes: it still lands when asked, and it is not sen - Changing the return contract of the deployment or its reasons. - Retrying a failed deployment, or refilling a cow. -## Further Notes +### Further Notes - One ticket is planned; the `to-issues` quiz is short. - The reasons *airborne*, *scene*, *unknown* and *deployed* are rare. The generic message and the log line are enough for them: they cost one existing text and two lines, and keep the contract honoured on both callers. diff --git a/.backlog/FIX-FAT-COW-EMPTY-AI-TYPE/PRD.md b/.backlog/archive/FIX-FAT-COW-EMPTY-AI-TYPE.md similarity index 87% rename from .backlog/FIX-FAT-COW-EMPTY-AI-TYPE/PRD.md rename to .backlog/archive/FIX-FAT-COW-EMPTY-AI-TYPE.md index ce433176..ab96d427 100644 --- a/.backlog/FIX-FAT-COW-EMPTY-AI-TYPE/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-EMPTY-AI-TYPE.md @@ -1,10 +1,28 @@ -# FIX-FAT-COW-EMPTY-AI-TYPE — an empty `fatCowAIType` removes the whole Fat Cow menu from the pilots a cow serves, not just "Request a Fat Cow" +# FIX-FAT-COW-EMPTY-AI-TYPE + +**Status:** merged (PR #318). Compacted from `FIX-FAT-COW-EMPTY-AI-TYPE/` on 2026-11-23; the ticket files live on in git history. + +Issue #297 (found by an automated review): an empty `fatCowAIType` removed the whole Fat Cow menu from the pilots a cow serves (eight commands, FARP status included, and the commands of cows placed by the mission), while the guide, the schema and the editor say it removes only "Request a Fat Cow". The guard moves onto that one command; the rest of the menu stays, and the four texts say why. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-keep-the-menu-with-an-empty-type` | ✅ done (PR #318) | 01 — The Fat Cow menu stays when `fatCowAIType` is empty | + +## PRD + +## FIX-FAT-COW-EMPTY-AI-TYPE — an empty `fatCowAIType` removes the whole Fat Cow menu from the pilots a cow serves, not just "Request a Fat Cow" **Status:** ✅ done (PR #318) — decisions taken in the grill of 2026-11-18 (no ADR, no `CONTEXT.md` term). GitHub issue #297 (found by an automated review of `develop`; the code has moved since, the analysis holds). -## Problem Statement +### Problem Statement `fatCowAIType` is the DCS type of the helicopter brought in when a flight requests an AI Fat Cow. The three places that document it say that **an empty value only removes the command "Request a Fat Cow"**: the mission maker's guide (English and French) and the description the `ctld-tools` editor shows next to the setting. @@ -21,7 +39,7 @@ One more case, not in the issue, found in the grill: **cows placed by the missio No test covers an empty `fatCowAIType`: the AI cow specs set a type, and the piloted-cow spec only builds the piloted menu. -## Solution +### Solution An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts already say: @@ -29,7 +47,7 @@ An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts - those commands already defend themselves: with no cow in the flight they answer "Your flight has no Fat Cow."; - the three texts are made complete, so that the mission maker also learns why the other commands stay. -## User Stories +### User Stories 1. As a pilot of a helicopter a cow serves, I want the Fat Cow menu to stay when the server has no AI cow type, so that I still find the commands that do not depend on it. 2. As a pilot, I want **FARP status** whatever the server's AI cow setting, so that I can read what the FARP I am at still holds before I ask for a rearm. @@ -47,7 +65,7 @@ An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts 14. As a maintainer, I want tests for an empty `fatCowAIType`, so that the menu cannot disappear unseen again. 15. As a maintainer, I want no new setting, so that the catalogue version and the saved configurations stay as they are. -## Implementation Decisions +### Implementation Decisions - **The guard moves down.** The AI cow menu no longer returns when `fatCowAIType` is empty. It builds the **Fat Cow** submenu and every command as before, and leaves out only the **Request a Fat Cow** submenu with the loadout commands under it, the only part that needs the type. - **Everything else is unchanged**: the labels, the order numbers, the **Take over a Fat Cow** submenu (still shown when a cow can be taken over), and the answer "Your flight has no Fat Cow." of the commands a flight without a cow clicks. A server with no AI cow at all sees commands that only answer that: the accepted cost. @@ -60,7 +78,7 @@ An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts - **No configuration change.** A schema description is not part of the catalogue shape: no `configVersion` change, no catalogue shape file. The menu labels are unchanged and the guide and schema texts are not in the dictionaries, so no dictionary change either; the build is still run before the pull request to confirm there is no drift. - **CHANGELOG**: one *Fixed* entry under `[Unreleased]`. -## Testing Decisions +### Testing Decisions - **A good test** observes what the pilot sees in the menu and what a click does, not the internals of the menu builder. - **Seam**: the existing AI Fat Cow spec, with its fake menu that collects the labels and its settings table, where the type can be emptied for the case. @@ -72,7 +90,7 @@ An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts - with an empty type and no cow, **Fat Cow status** and **Land here** answer "Your flight has no Fat Cow.". - **No live DCS check**: F10 cannot be read from the DCS bridge. The pull request says the on-screen result was not checked in a mission. -## Out of Scope +### Out of Scope - The other Fat Cow issues: the ground test of the cow (#295) and the return value of its deployment (#296). - Changing which commands exist, their labels or their order. @@ -80,7 +98,7 @@ An empty `fatCowAIType` removes **only "Request a Fat Cow"**, as the three texts - Hiding the commands that need a cow when there is none. - Making `fatCowAIType` required or validating it: an empty value stays valid. -## Further Notes +### Further Notes - One ticket is planned; the `to-issues` quiz is short. - The guard was almost certainly written at the top of the function to protect the creation of the AI cow, whose request command is the only one that needs the type; the commands added around it afterwards ended up behind it. diff --git a/.backlog/FIX-FAT-COW-GROUND-TEST/PRD.md b/.backlog/archive/FIX-FAT-COW-GROUND-TEST.md similarity index 84% rename from .backlog/FIX-FAT-COW-GROUND-TEST/PRD.md rename to .backlog/archive/FIX-FAT-COW-GROUND-TEST.md index b1908252..dd8f9fb3 100644 --- a/.backlog/FIX-FAT-COW-GROUND-TEST/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-GROUND-TEST.md @@ -1,10 +1,28 @@ -# FIX-FAT-COW-GROUND-TEST — the Fat Cow tests for the ground with DCS's raw `inAir()`, the case `ctld.utils.inAir` exists for +# FIX-FAT-COW-GROUND-TEST + +**Status:** merged (PR #320). Compacted from `FIX-FAT-COW-GROUND-TEST/` on 2026-11-23; the ticket files live on in git history. + +Issue #295 (found by an automated review): the Fat Cow called DCS's raw `inAir()` at three places (deploying the FARP, Land here, Release the Fat Cow) instead of `ctld.utils.inAir`, which exists for high-chassis aircraft such as the CH-47 that read "in the air" at rest. A landed cow could be refused as airborne (its FARP never opened, the piloted cow read a wrong message), or, on release, lifted off from its open FARP. The three go through the shared helper; the tests used one flag for both forms and could not tell them apart. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-ask-the-shared-ground-helper` | ✅ done (PR #320) | 01 — The Fat Cow asks the shared helper whether it is on the ground | + +## PRD + +## FIX-FAT-COW-GROUND-TEST — the Fat Cow tests for the ground with DCS's raw `inAir()`, the case `ctld.utils.inAir` exists for **Status:** ✅ done (PR #320) — decisions taken in the grill of 2026-11-18 (no ADR, no `CONTEXT.md` term). GitHub issue #295 (found by an automated review of `develop`; the code has moved since, the analysis holds). -## Problem Statement +### Problem Statement DCS gives every unit an `inAir()` answer. For a high-chassis helicopter such as the CH-47, which is the cow of the whole feature (`fatCowTypes` and `fatCowAIType` are both `CH-47Fbl1`), it can answer "in the air" while the aircraft sits landed and stationary. CTLD has a replacement for exactly this, `ctld.utils.inAir`: when DCS says "in the air" but the unit is below the configured `groundAglThreshold` and nearly still (under 0.5 m/s), it counts as on the ground. The helper's own header names the CH-47, and the rest of the code goes through it. This is inherited knowledge from v1, and it was not re-measured on the current DCS for this lot. @@ -21,7 +39,7 @@ What a pilot sees: The tests cannot see any of this: they stub DCS's `inAir()` and the shared helper on **the same flag**, so the two are indistinguishable. A test needs a unit for which they disagree: the CH-47 at rest. -## Solution +### Solution The Fat Cow code asks the shared helper, like the rest of CTLD, at its three places: @@ -31,7 +49,7 @@ The Fat Cow code asks the shared helper, like the rest of CTLD, at its three pla A cow that is really in the air is treated exactly as before. -## User Stories +### User Stories 1. As a pilot whose flight's AI cow has landed, I want its FARP to open when the delay runs out, so that I can rearm and refuel. 2. As a pilot of a piloted cow, I want my landed CH-47 to deploy its FARP from the crates in my hold, so that the FARP opens. @@ -46,7 +64,7 @@ A cow that is really in the air is treated exactly as before. 11. As a maintainer, I want tests with a unit for which DCS's raw answer and the shared helper disagree, so that the divergence can be seen and cannot come back unseen. 12. As a maintainer, I want no new setting, text or translation, so that the catalogue, the dictionaries and the saved configurations stay as they are. -## Implementation Decisions +### Implementation Decisions - **Three places go through the shared helper**: the deployment of the FARP, the **Land here** guard, and the **Release the Fat Cow** test of whether to orbit. Nothing else in the Fat Cow code changes. - **Rejected: the two places of the issue only.** It would leave **Release the Fat Cow** making a landed cow take off from its open FARP. @@ -55,7 +73,7 @@ A cow that is really in the air is treated exactly as before. - **No live probe.** The premise (DCS's raw answer for a landed CH-47) is documented in the helper and not re-measured on the current DCS; measuring it would mean spawning a parked CH-47 far from the player and removing it again, and would not change the decision: going through the helper the rest of CTLD uses is right whether or not DCS still misreports. The pull request says the DCS behaviour was not re-measured; unit tests, not a measurement, prove the fix. - **CHANGELOG**: one *Fixed* entry under `[Unreleased]`. No text, no configuration key, no catalogue shape, no dictionary change; the pilot guide is already right. -## Testing Decisions +### Testing Decisions - **A good test** observes what the cow does and what the flight reads, with a unit that tells DCS's raw answer apart from the shared helper's. - **Seams**: the existing AI cow spec and the existing piloted cow spec. The mock is the one the issue describes: a unit whose raw `inAir()` says "in the air" while the helper says "on the ground", the CH-47 at rest. @@ -67,14 +85,14 @@ A cow that is really in the air is treated exactly as before. - controls with a cow really in the air (both answers say so): the deployment still refuses it as airborne, **Land here** lands it, **Release the Fat Cow** makes it orbit. - **No live DCS check**; the pull request says so. -## Out of Scope +### Out of Scope - The two raw calls of the mine field scene. - Re-measuring DCS's `inAir()` for the CH-47. - Changing the shared helper or the `groundAglThreshold` setting. - Any other Fat Cow behaviour. -## Further Notes +### Further Notes - One ticket is planned; the `to-issues` quiz is short. - Since the previous lot, a landed AI cow refused as "airborne" is at least reported to the flight and logged. That is what makes this defect visible on a server: a log line "did not deploy after the delay: airborne" for a cow standing on the ground is this lot's symptom. diff --git a/.backlog/FIX-FAT-COW-HELICOPTERS-ONLY/PRD.md b/.backlog/archive/FIX-FAT-COW-HELICOPTERS-ONLY.md similarity index 57% rename from .backlog/FIX-FAT-COW-HELICOPTERS-ONLY/PRD.md rename to .backlog/archive/FIX-FAT-COW-HELICOPTERS-ONLY.md index 231069a7..a1133415 100644 --- a/.backlog/FIX-FAT-COW-HELICOPTERS-ONLY/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-HELICOPTERS-ONLY.md @@ -1,25 +1,43 @@ -# FIX-FAT-COW-HELICOPTERS-ONLY — an aeroplane gets no Fat Cow menu +# FIX-FAT-COW-HELICOPTERS-ONLY + +**Status:** merged (PR #285) — verified in game (Zip, 2026-11-05). Compacted from `FIX-FAT-COW-HELICOPTERS-ONLY/` on 2026-11-23; the ticket files live on in git history. + +An aeroplane got the AI Fat Cow menu and could request a cow (Zip, A-10, 2026-11-01): the menu and the request are now a helicopter's only, as taking a cow over already was. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-helicopters-only` | — | 01 — the AI Fat Cow menu and request, helicopters only | + +## PRD + +## FIX-FAT-COW-HELICOPTERS-ONLY — an aeroplane gets no Fat Cow menu Status: done — 2026-11-04 (PR #285); verified in game by Zip, 2026-11-05 -## Problem +### Problem Zip, in an A-10 on an Open Training (2026-11-01), could request a Fat Cow. `CTLDFatCowManager:buildMenuSection` gave the AI Fat Cow menu (request, orders, status) to every player who was not a cow pilot, and the pilot guide said so ("Any player whose aircraft is not a cow"). The cow refuels and rearms helicopters: an aeroplane has nothing to do with it. Taking a cow over was already a helicopter's only (FEAT-FAT-COW-TAKEOVER, Zip 2026-10-30). -## Solution +### Solution - The AI Fat Cow menu is built for a helicopter only, with the test taking a cow over uses (`isHelicopter`, now defined before the menu code). - `requestAICow` sends nothing for an aircraft that is not a helicopter, in case a menu built for another aircraft is still on screen. - A mission-placed cow escorting a client flight is commanded from that menu: the mission-maker guide says to escort a helicopter flight. -## Definition of done +### Definition of done - busted: an aeroplane sees no Fat Cow menu, a helicopter sees "Request a Fat Cow"; a request from an aeroplane creates no cow. - Docs: pilot and mission-maker Fat Cow pages, EN + FR; CHANGELOG. -## Not claimed +### Not claimed Not flown: the check is the next session on a server running a CTLD with this fix. diff --git a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/PRD.md b/.backlog/archive/FIX-FAT-COW-TAKEOVER-LABELS.md similarity index 89% rename from .backlog/FIX-FAT-COW-TAKEOVER-LABELS/PRD.md rename to .backlog/archive/FIX-FAT-COW-TAKEOVER-LABELS.md index 11467f03..310e3cdd 100644 --- a/.backlog/FIX-FAT-COW-TAKEOVER-LABELS/PRD.md +++ b/.backlog/archive/FIX-FAT-COW-TAKEOVER-LABELS.md @@ -1,10 +1,29 @@ -# FIX-FAT-COW-TAKEOVER-LABELS — the "Take over a Fat Cow" entries are rebuilt under the pilot's finger, and two cows can share a label +# FIX-FAT-COW-TAKEOVER-LABELS + +**Status:** merged (PR #317). Compacted from `FIX-FAT-COW-TAKEOVER-LABELS/` on 2026-11-23; the ticket files live on in git history. + +Issue #298 (found by an automated review): the "Take over a Fat Cow" entries carried the cow's distance in their label, which is their identity (ADR 0027), and a 30 s timer rebuilt them, so an entry was recreated under the pilot's finger (a click fired a parked command and nothing happened), and two cows at the same rounded km shared a label and could be swapped. Every AI cow now has a number; the entry reads "Fat Cow #N — state", in the order of the numbers, with no distance and no periodic refresh; the three announcements name the cow and keep its distance. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-number-the-cows` | ✅ done (PR #317) | 01 — Every AI cow has a number, and the announcements name it | +| `02-stable-take-over-list` | ✅ done (PR #317) | 02 — The "Take over a Fat Cow" list holds still | + +## PRD + +## FIX-FAT-COW-TAKEOVER-LABELS — the "Take over a Fat Cow" entries are rebuilt under the pilot's finger, and two cows can share a label **Status:** ✅ done (PR #317) — decisions taken in the grill of 2026-11-18 (no ADR: the rule "a label is an identity, so nothing that moves goes in it" already follows from [ADR 0027](../../dev/adr/0027-stable-f10-entries.md) decision 1; no `CONTEXT.md` term: it has no Fat Cow vocabulary). GitHub issue #298 (found by an automated review of `develop`; the code has moved since, the analysis holds). -## Problem Statement +### Problem Statement A helicopter flight with no Fat Cow finds, under *Fat Cow → Take over a Fat Cow*, one entry per AI cow that is going home (sent RTB, or lost its flight) or that its flight released. Each entry is labelled with the cow's distance rounded to the kilometre ("Fat Cow 12 km away, going home to Akrotiri"), the list is sorted nearest first, and a timer rebuilds the menu of every flight that may take a cow over every 30 seconds. @@ -16,7 +35,7 @@ Since ADR 0027, **an F10 entry's label is its identity**: a changed label means The tests do not see any of this. The Fat Cow specs drive the entries against a fake menu that keeps only a label and a cow name, with no keys and no memory of the previous rendering, and one of them asserts the very behaviour that produces the defect (that the timer rebuilds the menu). The double that can see it exists in the repository: the one that recycles ids as DCS does, used by the stable-entries spec. -## Solution +### Solution The entry names the cow, never its distance, and the list stops moving under the pilot: @@ -27,7 +46,7 @@ The entry names the cow, never its distance, and the list stops moving under the A pilot who reads the list and clicks always reaches the cow the entry names, and a click that cannot be honoured always answers. -## User Stories +### User Stories 1. As a helicopter pilot, I want the entry I read under "Take over a Fat Cow" to stay the same entry while I read it, so that my click takes the cow I chose. 2. As a helicopter pilot, I want a click on an entry whose cow went away to tell me "This Fat Cow is no longer available", so that I am never left clicking into the void. @@ -50,7 +69,7 @@ A pilot who reads the list and clicks always reaches the cow the entry names, an 19. As a pilot reading the guide, I want the documentation to describe the list as it now is (stable entries, ordered by number, no distance in the menu), so that I do not look for a distance that is not there. 20. As a maintainer, I want no new configuration key, so that the catalogue version and the saved configurations stay as they are. -## Implementation Decisions +### Implementation Decisions - **Entry = identity.** The label of a "Take over" entry is "Fat Cow #N — " followed by its state; it never carries a distance or anything that moves between events. The three states are the three cases that exist: waiting (released), going home to a named base, going home (no base known). The state changes only on an event (the cow is released, taken over, or arrives), which ADR 0027 accepts. - **Stable order.** Entries are ordered by cow number, ascending: the order in which the cows were registered. "Nearest first" is dropped. @@ -62,7 +81,7 @@ A pilot who reads the list and clicks always reaches the cow the entry names, an - **CHANGELOG**: one *Fixed* entry under `[Unreleased]`. No configuration key: no `configVersion` change, no catalogue shape. - **Parked commands**: fewer removals now; nothing else to do about ADR 0027's pool. -## Testing Decisions +### Testing Decisions - **A good test** observes the menu the way DCS does: which entries are created and removed, and which cow a click reaches. It does not call the internal helpers of the manager. - **Seam**: the real menu rendering against the `missionCommands` double that recycles ids as DCS does (the one the stable-entries spec uses, mutation-checked under ADR 0027). The Fat Cow AI spec keeps the unit-level cases that do not depend on the rendering (the numbers, the announcements, the take-over itself). @@ -79,7 +98,7 @@ A pilot who reads the list and clicks always reaches the cow the entry names, an - **Rewritten, not preserved**: the existing assertions on the old labels with a distance, and the test that "updates the distances every so often", assert the behaviour being removed. - **No live DCS check**: F10 cannot be read from the DCS bridge, and the double is the reference since ADR 0027. The pull request says the on-screen result was not checked in a mission. -## Out of Scope +### Out of Scope - The other Fat Cow issues: the ground test of the cow (#295), the return value of its deployment (#296), the empty `fatCowAIType` that hides the whole menu (#297). - Who may take a cow over, and which cows can be taken over; the take-over mechanics themselves. @@ -87,7 +106,7 @@ A pilot who reads the list and clicks always reaches the cow the entry names, an - The pagination of ADR 0027 and its pool of parked commands. - A cow's identity in any other message than the three announcements listed above. -## Further Notes +### Further Notes - The ordering by number replaces "nearest first" on purpose: ADR 0027 recreates entries that leave the wanted order, so any order that depends on a moving value would bring the dead click back. The pilot loses the at-a-glance distance in a list that rarely holds more than one or two cows, and keeps it in the message the flight received. - Two tickets are proposed, to confirm with the user in the `to-issues` quiz: 01 the cow's number and the announcements that name it; 02 the stable take-over list (labels, order, removal of the refresh, the regression test, the documentation). diff --git a/.backlog/FIX-I18N-TRANSLATE-ALIAS/PRD.md b/.backlog/archive/FIX-I18N-TRANSLATE-ALIAS.md similarity index 79% rename from .backlog/FIX-I18N-TRANSLATE-ALIAS/PRD.md rename to .backlog/archive/FIX-I18N-TRANSLATE-ALIAS.md index 1bf4307b..c97315ab 100644 --- a/.backlog/FIX-I18N-TRANSLATE-ALIAS/PRD.md +++ b/.backlog/archive/FIX-I18N-TRANSLATE-ALIAS.md @@ -1,4 +1,22 @@ -# FIX-I18N-TRANSLATE-ALIAS — 13 JTAC radio messages escape the i18n guard through the `ctld.i18n_translate` alias +# FIX-I18N-TRANSLATE-ALIAS + +**Status:** merged (PR #269). Compacted from `FIX-I18N-TRANSLATE-ALIAS/` on 2026-11-23; the ticket files live on in git history. + +The 16 JTAC radio keys reach the four dictionaries; the JTAC module calls ctld.tr and the generator also recognises the alias. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-jtac-through-tr-and-guard-sees-the-alias` | ✅ done (PR #269) | 01 — JTAC messages through `ctld.tr`, and the guard sees the alias | + +## PRD + +## FIX-I18N-TRANSLATE-ALIAS — 13 JTAC radio messages escape the i18n guard through the `ctld.i18n_translate` alias **Status:** ✅ done (PR #269) @@ -6,7 +24,7 @@ GitHub issue #265 (automated review of `develop` at `673b064`), decided with the that nothing in the code uses it any more, and keep it supported (defined and recognised by the guard) for the scripts outside the repository that may still call it. -## Problem Statement +### Problem Statement `ctld.i18n_translate` is a plain alias of `ctld.tr`. The dictionary generator (`generate_i18n_dicts.ps1`), the `i18n-guard` CI job and the `pre-push` hook all rely on a scan for the literal name `ctld.tr(`, so everything written through the alias is invisible to the three of them. @@ -15,14 +33,14 @@ back to the English key, so on a French, Spanish or Korean server every JTAC rad inserted in the middle of a translated sentence. The gap widens on its own: the last batch of changes added two JTAC messages through the alias that reached no dictionary, with no signal. -## Solution +### Solution The JTAC module calls `ctld.tr` like the rest of `src/`, so the guard sees its keys. The alias stays defined, for the scripts outside the repository, and the generator also recognises it, so any key written through it still reaches the dictionaries. The 13 missing keys are added to the four dictionaries and translated. A test locks the rule: every literal key passed to `ctld.tr` or to the alias in `src/` is a key of the English dictionary. -## User Stories +### User Stories 1. As a player on a French, Spanish or Korean server, I want the JTAC radio messages in my language, so that I read one language in a sentence. 2. As a CTLD developer, I want one way of writing a translated text in `src/`, so that the guard sees every key. @@ -33,7 +51,7 @@ the English dictionary. happen again whatever the guard does. 6. As a maintainer, I want to know the alias has no remaining caller in `src/`. -## Implementation Decisions +### Implementation Decisions - The 16 `ctld.i18n_translate(...)` calls of `CTLD_jtac.lua` become `ctld.tr(...)`; same arguments, same behaviour. - The alias definition in `CTLD_i18n.lua` stays, with its comment now saying it is kept for external scripts (new code uses `ctld.tr`). @@ -43,19 +61,19 @@ the English dictionary. - Documentation: the i18n developer page (EN + FR) says the alias is kept for external scripts and that the guard recognises it. - No catalogue or configuration change. -## Testing Decisions +### Testing Decisions - A good test observes the invariant (every literal key is translatable), not how the scan is written. - A busted spec reads the source files of `src/`, extracts the literals passed to `ctld.tr` and to the alias, and checks each is a key of the English dictionary. It fails before the change (the 13 JTAC keys) and passes after. - The existing i18n specs and the `i18n-guard` job stay as they are. -## Out of Scope +### Out of Scope - Removing the alias (it stays for external scripts). - Translating keys not passed as a literal, or the config catalogue labels. - Any change to the JTAC messages themselves. -## Further Notes +### Further Notes The legacy monolith (`migration/source/`, immutable) uses the alias heavily; it is not part of `src/` and not scanned. diff --git a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/PRD.md b/.backlog/archive/FIX-JTAC-IMPOSED-CODE-AND-RADIO.md similarity index 72% rename from .backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/PRD.md rename to .backlog/archive/FIX-JTAC-IMPOSED-CODE-AND-RADIO.md index d90621bc..2e140057 100644 --- a/.backlog/FIX-JTAC-IMPOSED-CODE-AND-RADIO/PRD.md +++ b/.backlog/archive/FIX-JTAC-IMPOSED-CODE-AND-RADIO.md @@ -1,4 +1,25 @@ -# FIX-JTAC-IMPOSED-CODE-AND-RADIO — an imposed laser code taken twice, a supplied radio ignored +# FIX-JTAC-IMPOSED-CODE-AND-RADIO + +**Status:** merged (PR #258) — 1199 refused and the template not coded at start, verified in game (Zip, 2026-11-05). Compacted from `FIX-JTAC-IMPOSED-CODE-AND-RADIO/` on 2026-11-23; the ticket files live on in git history. + +Reported by VMCT from the Syria Open Training v6 (2026-10-02): an ASSETS drone imposed on 1688 shared the code with a catalogue drone INIT-C had coded automatically, and announced itself on the code-derived frequency instead of the one VEAF passed. An imposed code never leaves the pool (and goes back in on death), INIT-C codes before VEAF imposes, and `CTLDJTAC:new` always recomputes the radio. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-imposed-code-reserved` | ✅ done | 01 — An imposed laser code is reserved, whatever the order | +| `02-supplied-radio-kept` | ✅ done | 02 — A supplied radio is kept | +| `03-valid-laser-codes` | ✅ done — rule from the legacy `ctld.generateLaserCode`, verified in game by Zip, 2026-11-05 (1199 refused) | 03 — The laser pool holds valid codes only | +| `04-late-activated-not-coded` | ✅ done | 04 — A late-activated JTAC group is not coded at start | + +## PRD + +## FIX-JTAC-IMPOSED-CODE-AND-RADIO — an imposed laser code taken twice, a supplied radio ignored **Status:** ✅ merged (PR #258) — decisions taken 2026-10-09 (below) @@ -6,7 +27,7 @@ Reported by VMCT on 2026-10-02 (VMCT lot `FIX-OPEN-TRAINING-SYRIA-FINDINGS`, tic David. Found in game on the Syria Open Training v6 (dcs-serve), checked in the code of 2.0.0-rc11 — the release VMCT vendors — and still so on `develop` at `576f5411`. -## What happened +### What happened The mission's `modules.ASSETS` declares a drone, Reaper 1, with `jtac = 1688`, `freq = "36.0"`, `mod = "FM"`. VEAF starts it through `CTLDJTACManager:autoLase(groupName, 1688, false, "all", nil, asset)` @@ -15,7 +36,7 @@ The mission's `modules.ASSETS` declares a drone, Reaper 1, with `jtac = 1688`, ` `veafSpawn-MQ9 - AFAC - JTAC - DRONE`, which `_initMMJTACs` (INIT-C) registers by its name. And Reaper 1 announced itself on about 40.4 FM, not 36.0. -## Causes, in `src/CTLD_jtac.lua` / `src/CTLD_core.lua` +### Causes, in `src/CTLD_jtac.lua` / `src/CTLD_core.lua` 1. **An imposed code never leaves the pool.** `spawnJTAC` (`:447`) and `startLaseTroopUnit` (`:794`) take `cfg.laserCode` when given, else `_assignLaserCode()` (`:1399`), which is `table.remove(self._laserPool)` @@ -34,13 +55,13 @@ announced itself on about 40.4 FM, not 36.0. `jtacLaserCodeMin..jtacLaserCodeMax` (1111..1688 by default). The reporter says codes with a 9 or a 0 (1199) are invalid in DCS — **to verify** against DCS before acting on it. -## Workaround in the Syria mission meanwhile +### Workaround in the Syria mission meanwhile `jtacLaserCodeMax = 1686` (the catalogue drone takes 1686), the Reapers on 1511 / 1512, and the briefing announces 35.55 / 35.6 FM — the frequencies CTLD computes for those codes. VMCT carries it as the known limitation `ctld-jtac-imposed-code-and-radio`. -## Decisions to take at the start +### Decisions to take at the start - **a. How an imposed code wins over an automatic one already handed out** (cause 2). Options: a `reserveLaserCode(code)` API that a caller (VEAF, from its ASSETS) uses before INIT-C, the pool skipping @@ -51,18 +72,18 @@ limitation `ctld-jtac-imposed-code-and-radio`. `mod` `"FM"` upper case, extra fields (`name`, `jtac`, `description`...). CTLD's own is `{ name, freq = , mod = "fm" }`. Normalise what is given, or require CTLD's shape and adapt VEAF. -## Decisions taken (2026-10-09, David) +### Decisions taken (2026-10-09, David) - **a.** Hybrid: an imposed code leaves the pool when imposed and never comes back (`jtac.codeImposed`, not freed on death or deregistration); a JTAC holding it automatically is re-coded from the pool; two JTACs imposed on the same code are tolerated, with a `WARN`. - **b.** A supplied radio is kept as given, as in the legacy `ctld.JTACAutoLase`: `name` defaulted to the group name when absent, `freq` turned into a string; nothing else normalised. - **c.** A re-coded JTAC announces its new code (and its new radio) to its coalition on the radio it was using; no new API event (its lasing stops with `STOP_REASON.CODE_CHANGED`, so `OnJTACLaseStop` carries the old code). - **Ticket 03.** The pool leaves out codes with a 0 or a 9 and keeps 8. Rule from the legacy `ctld.generateLaserCode` comment (digits after the first run 1–8); **to verify in game** (is 1199 refused?), not blocking. -## Finding: the catalogue template was coded by a CTLD bug (ticket 04) +### Finding: the catalogue template was coded by a CTLD bug (ticket 04) The template `veafSpawn-MQ9 - AFAC - JTAC - DRONE` is `lateActivation = true` in `VEAF_OpenTraining_Syria_ICAO_LTAG_20261002.miz` (checked 2026-10-09). INIT-C should have left it pending. It did not because `_initMMJTACs` called `group:isActive()`, which DCS groups do not have (Hoggit `DCS_Class_Group`; `isActive` is a `Unit` function): the `pcall` failed and fell back to "active", so **every** late-activated group named `*jtac*` was coded at start. Fixed by reading `group:getUnit(1):isActive()`. Not a VMCT issue: nothing to change in the mission. Hoggit is the source; to confirm in game with the next release (the template no longer appears in the JTAC list at start). -## Done when +### Done when - Two JTACs, one imposed on 1688 and one automatic, get distinct codes **in either order of registration**; an imposed code is never handed out automatically, and never returned to the pool. @@ -71,16 +92,16 @@ The template `veafSpawn-MQ9 - AFAC - JTAC - DRONE` is `lateActivation = true` in - busted tests for each; `CHANGELOG.md` `[Unreleased]`; a release VMCT vendors, after which VMCT sets the known limitation's `fixed_in`. -## Out of scope +### Out of scope - Whether VEAF's catalogue template should carry "JTAC" in its name — a template is late-activated and never meant to lase; that is VMCT's call, raised to it separately if the fix above does not settle it. -## Tickets +### Tickets | # | Ticket | Status | |---|--------|--------| -| 01 | [An imposed laser code is reserved, whatever the order](tickets/01-imposed-code-reserved.md) | ✅ | -| 02 | [A supplied radio is kept](tickets/02-supplied-radio-kept.md) | ✅ | -| 03 | [The laser pool holds valid codes only](tickets/03-valid-laser-codes.md) | ✅ (verified in game by Zip, 2026-11-05) | -| 04 | [A late-activated JTAC group is not coded at start](tickets/04-late-activated-not-coded.md) | ✅ | +| 01 | An imposed laser code is reserved, whatever the order (`01-imposed-code-reserved`) | ✅ | +| 02 | A supplied radio is kept (`02-supplied-radio-kept`) | ✅ | +| 03 | The laser pool holds valid codes only (`03-valid-laser-codes`) | ✅ (verified in game by Zip, 2026-11-05) | +| 04 | A late-activated JTAC group is not coded at start (`04-late-activated-not-coded`) | ✅ | diff --git a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/PRD.md b/.backlog/archive/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS.md similarity index 84% rename from .backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/PRD.md rename to .backlog/archive/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS.md index af1e6089..981da2fe 100644 --- a/.backlog/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/PRD.md +++ b/.backlog/archive/FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS.md @@ -1,10 +1,32 @@ -# FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS — dropped groups stay put, and crates unpack next to a logistic zone: two CTLD v1 behaviours are gone +# FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS + +**Status:** merged (PR #315). Compacted from `FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS/` on 2026-11-23; the ticket files live on in git history. + +Issue #309 (VMCT): the v1 settings `maximumMoveDistance` and `minimumDeployDistance` have no key in CTLD 2, and the behaviours they drove are gone too. Dropped groups (troops and vehicles) act on their own again by default (nearest enemy, else a random walk; both distances at 0 to keep them still), and an optional `forbidUnpackInLogisticZone` forbids unpacking crates in a friendly logistic zone ([ADR 0029](../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md)). + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-dropped-groups-act-alone` | ✅ done (PR #315) | 01 — Troops dropped by a pilot or an AI transport act on their own | +| `02-parachute-and-vehicles` | ✅ done (PR #315) | 02 — Parachuted troops and whole vehicles unloaded act on their own | +| `03-scripted-spawns` | ✅ done (PR #315) | 03 — Scripted spawns keep the v1 meaning of their search distance | +| `04-unpack-guard-and-retired-key` | ✅ done (PR #315) | 04 — An optional guard against unpacking in a logistic zone, and a notice for the retired v1 key | +| `05-live-check` | ✅ done (PR #315) | 05 — Live check in DCS | + +## PRD + +## FIX-LEGACY-MOVE-AND-DEPLOY-SETTINGS — dropped groups stay put, and crates unpack next to a logistic zone: two CTLD v1 behaviours are gone **Status:** ✅ done (PR #315) — decisions taken in the grill of 2026-11-18, recorded in [ADR 0029](../../dev/adr/0029-dropped-groups-act-alone-and-the-unpack-guard-is-optional.md) and the `Dropped group` term of `CONTEXT.md`. GitHub issue #309 (reported by VMCT). -## Problem Statement +### Problem Statement VMCT's missions set two CTLD v1 settings, `maximumMoveDistance` (100 m on 28 of its parts) and `minimumDeployDistance` (50 m on 25 of them), and found no key for either in CTLD 2. The issue takes it for a missing key. Reading the legacy source shows that **the behaviours are gone too**: @@ -13,7 +35,7 @@ VMCT's missions set two CTLD v1 settings, `maximumMoveDistance` (100 m on 28 of A mission maker who moves over to CTLD 2 loses both rules **without a word**: a snapshot that still carries the two keys is simply ignored. -## Solution +### Solution - **A dropped group acts on its own by default, as in v1.** The troops a pilot drops, a whole vehicle he unloads, a group a script spawns, whatever the way down (ground, rope, parachute, an AI transport), goes for the nearest enemy in range, and walks at random when there is none. A waypoint zone or a template task keeps priority. Setting both distances to 0 leaves the group where it was dropped. - **`maximumMoveDistance` is a setting again** (2000 m), and `maximumSearchDistance` goes back to its v1 value (4000 m). @@ -21,7 +43,7 @@ A mission maker who moves over to CTLD 2 loses both rules **without a word**: a - **A new option, `forbidUnpackInLogisticZone`**, off by default, forbids unpacking an ordinary crate inside a friendly logistic zone. Off keeps CTLD 2's absence of blocking. - **A snapshot that still carries `minimumDeployDistance` is told**, at start-up, which setting replaces it. -## User Stories +### User Stories 1. As a pilot, I want the troops I drop to go for the nearest enemy, so that they fight without my ordering them. 2. As a pilot, I want troops with no enemy in range to wander near the drop point, so that they are not sitting targets on the landing spot. @@ -49,7 +71,7 @@ A mission maker who moves over to CTLD 2 loses both rules **without a word**: a 24. As a CTLD developer, I want tests that fail when a dropped group stays idle with an enemy in range. 25. As a CTLD developer, I want the catalogue's new version and shape recorded, so that `ctld-tools` completes older configurations. -## Implementation Decisions +### Implementation Decisions - **One decision point for the behaviour of a dropped group.** The order a dropped group receives (toward the nearest enemy in range, else toward a random point near where it was dropped) is worked out in one place that every drop path calls: the drop by the pilot, by fast-rope and by an AI transport, the parachute landing, the vehicle unload, and the scripted spawns. Priority: a waypoint zone first, then a template task, then this default. - **The default follows v1.** The nearest enemy is the nearest alive leader of an enemy ground group within `maximumSearchDistance` of the drop point, with **no line-of-sight requirement**. With none, the destination is a random point within `maximumMoveDistance` of the drop point, in the horizontal plane. The route is two waypoints, off road, as v1 ordered it. Both distances at 0 give no order. @@ -60,14 +82,14 @@ A mission maker who moves over to CTLD 2 loses both rules **without a word**: a - **The retired key.** `minimumDeployDistance` in a snapshot produces a start-up notice, built the way the `dropOffZones` one is. - **Documentation.** The settings tables (EN and FR), the migration guide (EN and FR), the changelog. -## Testing Decisions +### Testing Decisions - A good test observes the order a dropped group receives (or none) and what an unpack does, not how the code is organised. - **Seams.** The troop manager's functional specs, with the transport, the zones and the object registry doubled and the random source stubbed (prior art: the drop and the post-spawn task cases). The vehicle spawner's unload and its specs. The crate manager's unpack specs, the same ones that carry the FIX-UNPACK cases. The configuration specs for the retired-settings notice (prior art: `dropOffZones`). The catalogue shape test of `ctld-tools`. - **Cases:** an enemy in range gets the group ordered toward it; none in range gives a random destination within `maximumMoveDistance`; both distances at 0 give no order; a waypoint zone and a template task keep priority; a pilot's drop, a fast-rope drop, a parachute landing and a scripted spawn each behave so; a whole vehicle and a JTAC vehicle too, a crate-unpacked vehicle not; the legacy wrappers pass the search distance (0 means no search), the CTLD 2 methods keep `radius` as the placement circle; the guard refuses in a logistic zone with the message, is off by default, spares the FOB and the scenes and binds the automatic unpack; the notice appears for `minimumDeployDistance`. - **Live check in DCS** (last ticket): a mock transport 3 km from the player drops a group with an enemy group in range, then one with none; the first gets a route to the enemy, the second moves within `maximumMoveDistance`. -## Out of Scope +### Out of Scope - Any other legacy setting. - The behaviour of vehicles spawned from crates. @@ -75,7 +97,7 @@ A mission maker who moves over to CTLD 2 loses both rules **without a word**: a - The DCS-native cargo path. - A master switch to turn the behaviour off (both distances at 0 does it). -## Further Notes +### Further Notes - VMCT's `minimumDeployDistance` of 50 m never mattered in v1: the logistic zone's own 200 m radius always dominated it, so their effective rule was "not inside the zone", which is exactly `forbidUnpackInLogisticZone`. - The default behaviour of dropped groups changes in this release for every CTLD 2 mission; a mission that relied on groups staying put sets both distances to 0. The changelog and the settings' descriptions say so. diff --git a/.backlog/FIX-MENU-STABLE-ENTRIES/PRD.md b/.backlog/archive/FIX-MENU-STABLE-ENTRIES.md similarity index 85% rename from .backlog/FIX-MENU-STABLE-ENTRIES/PRD.md rename to .backlog/archive/FIX-MENU-STABLE-ENTRIES.md index 53c1d0b5..12bcb5b6 100644 --- a/.backlog/FIX-MENU-STABLE-ENTRIES/PRD.md +++ b/.backlog/archive/FIX-MENU-STABLE-ENTRIES.md @@ -1,4 +1,25 @@ -# FIX-MENU-STABLE-ENTRIES — an F10 entry that did not change is never recreated +# FIX-MENU-STABLE-ENTRIES + +**Status:** merged (PR #261) — 04 ✅ verified in game (Zip, 2026-11-05) — D1-D4 confirmed as recommended (2026-10-09). Compacted from `FIX-MENU-STABLE-ENTRIES/` on 2026-11-23; the ticket files live on in git history. + +Issue #257: wrong F10 commands persist after ADR 0015. DCS reuses a removed entry's id for the next entry created, so the full wipe + rebuild of each refresh (immediate or 4 s later) repoints every entry of a screen left open. Render by difference so an unchanged entry keeps its id, and park each freed id on an inert command for a group no player holds (measured 2026-10-09, shipped in VMCT #1113). + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-measure-dcs-id-reuse` | ✅ done (2026-10-09, Zip + Claude, from the VMCT session) | 01 — Measure how DCS reuses a freed menu id | +| `02-render-by-difference` | ✅ done (2026-10-09) | 02 — Render the menu by difference, park every freed id | +| `03-drop-ambient-delay-and-adr` | ✅ done (2026-10-09) | 03 — Drop the ambient delay, record the decision | +| `04-live-check` | ✅ done — verified in game by Zip, 2026-11-05 | 04 — Live check in a CTLD mission | + +## PRD + +## FIX-MENU-STABLE-ENTRIES — an F10 entry that did not change is never recreated **Status:** ✅ done — D1-D4 confirmed by Zip as recommended (2026-10-09); tickets 02 and 03 merged (PR #261), 04 (live DCS) verified in game by Zip, 2026-11-05 @@ -6,13 +27,13 @@ Formalizes GitHub issue #257 (Zip, 2026-10-09), from wrong F10 commands still re Supersedes part of ADR 0015: a new ADR is part of the lot. Replanned on 2026-10-09 evening with the full measurement and the VMCT implementation (VEAF/VEAF-Mission-Creation-Tools#1113), which answer what the first version left open. -## Problem Statement +### Problem Statement A player clicks an F10 CTLD command and another one fires. ADR 0015 (2026-09-16) attributed it to a refresh landing while the player is mid-navigation, and answered with a delay: an ambient refresh wipes the group's CTLD menu at once and rebuilds it 4 s later. Players still report wrong commands. -## What DCS does — measured 2026-10-09 +### What DCS does — measured 2026-10-09 Single player, raw `missionCommands` (no CTLD, no VEAF), mission restarted before each test, clicks with the mouse, the change applied from the fiddle hook while the player held `TEST MENU > Liste` (A, B, C, D) open. Kit and first tables in #257. @@ -39,13 +60,13 @@ Checked in VMCT on the real `veafRadio` code (hot-loaded in a running mission): Not measured, and not needed once every removal is parked: how long a freed id stays reusable, and coalition menus (CTLD only uses group menus). -## Cause in CTLD +### Cause in CTLD `ctld.MenuManager:refreshMenuForGroup` (`src/CTLD_menu.lua:251`) removes every top-level CTLD handle of the group and recreates the whole tree: test 1 at the scale of the whole menu, on every refresh. The ambient delay of ADR 0015 only moves the moment: the wipe frees the ids, the rebuild 4 s later hands them out again, and a screen opened before the wipe still points at them. ADR 0015 considered and rejected targeted removal for consistency with the atomic model; the measurement shows the atomic model is what reassigns the ids. -## Solution +### Solution 1. **Render by difference**: build the rendered tree (enabled filter, `order` sort, pagination with its "→ Next Page" submenus), compare it by key with what is live in DCS for the group, create what appeared, remove what disappeared, leave every other entry and its id alone. 2. **Park every freed id**: right after each `removeItemForGroup`, create an inert command for a group id no player can hold (VMCT uses `999999`), with a unique label and a callback that only logs at debug level. A submenu's children are removed one by one before it, each id parked. @@ -53,7 +74,7 @@ ADR 0015 considered and rejected targeted removal for consistency with the atomi VMCT's implementation is the reference: `RadioMenuBuilder:_render`, `_removeEntry`, `rebuild` in `src/scripts/veaf/veafRadio.lua` (VEAF/VEAF-Mission-Creation-Tools#1113), with its specs in `test/lua/test_veafRadio.lua` (`TestVeafRadioIncrementalRender`). -## Decisions — recommendation each, to confirm +### Decisions — recommendation each, to confirm - **D1 — What identifies an entry across two renders.** Recommendation: parent key + type (submenu / command) + label, in the **rendered** tree, so "→ Next Page" submenus are diffed like the rest; two siblings with the same label take an occurrence index (`#2`). @@ -79,7 +100,7 @@ VMCT's implementation is the reference: `RadioMenuBuilder:_render`, `_removeEntr - **D5 — The reuse of a freed id (case 2).** Settled by the measurement: parking, in this lot (Solution 2). - **D6 — Handles of every entry.** Settled: a rendered mirror per group, key → `{ handle, type, depth }`; today `menu._activeHandles` keeps only top-level handles and command handles are discarded (`src/CTLD_menu.lua:340`). -## Implementation deviations (2026-10-09) +### Implementation deviations (2026-10-09) - **Removals before creations, within one level** (Solution 3 said after): DCS addresses an entry by its label path, so a recreated entry must not coexist with its old self under one path; parking each freed id at once keeps the goal of Solution 3 (nothing created takes an unparked id). - **Removal by the handle DCS returned**: the developer doc records that `removeItemForGroup` ignores a label path rebuilt by the caller; the mirror keeps each returned handle, and the busted double honours only the handles it issued. @@ -87,7 +108,7 @@ VMCT's implementation is the reference: `RadioMenuBuilder:_render`, `_removeEntr - **Root level not paginated**, as before; every submenu is. - **The dispatcher runs the node of the last refresh**, not the logical tree at click time: between a model change and its debounced refresh, the click runs what the player saw. -## Implementation notes (from the current code) +### Implementation notes (from the current code) - `ctld.Menu` is the logical model; callers mutate it (`clearBranch` + `addCommand`, `setBranchEnabled`, `removeMenuBranch`) then call `refresh`. Outside `src/CTLD_menu.lua`, only the last-occupant teardown of `src/CTLD_player.lua:512-516` touches `missionCommands` (it removes `menu._activeHandles` itself): it should go through the manager, which removes every live entry, parks each id and drops the mirror. @@ -95,7 +116,7 @@ VMCT's implementation is the reference: `RadioMenuBuilder:_render`, `_removeEntr - DCS reuses a numeric group id for the next occupant of a slot (#152): the teardown dropping the mirror is what keeps the next occupant from inheriting a mirror of entries that no longer exist. - The parking group id must be one no slot can hold; check CTLD's own group id ranges before reusing VMCT's `999999`, and share the constant if both scripts run in one mission (two parkings on one id are harmless: they are inert). -## Testing Decisions +### Testing Decisions - busted: a `missionCommands` double that hands out ids as measured (one global pool, freed ids reused last-freed-first) and lets a spec "click" an id captured before a refresh. Written first and seen failing on `develop`: after an identical refresh, a click captured before it fires the same command (test 1); after a removal and a creation, a click on the removed entry fires the parked command, not the new one (test 9b). @@ -103,11 +124,11 @@ VMCT's implementation is the reference: `RadioMenuBuilder:_render`, `_removeEntr - Each fix mutation-checked: the spec must fail with the parking line removed, and with the reuse disabled. - Live DCS (Zip): ticket 04. -## Out of Scope +### Out of Scope - Any change to what the menu contains, its order or its labels. -## Further Notes +### Further Notes Source issue: #257 — `Fixes #257` once parking is in. VMCT side: lot `FIX-RADIO-MENU-ID-RECYCLING`, trap `f10-menu-entry-id-is-recycled` in its `known-limitations.yaml`. diff --git a/.backlog/FIX-REVIEW-HYGIENE-B/PRD.md b/.backlog/archive/FIX-REVIEW-HYGIENE-B.md similarity index 83% rename from .backlog/FIX-REVIEW-HYGIENE-B/PRD.md rename to .backlog/archive/FIX-REVIEW-HYGIENE-B.md index 5111696a..d9502e68 100644 --- a/.backlog/FIX-REVIEW-HYGIENE-B/PRD.md +++ b/.backlog/archive/FIX-REVIEW-HYGIENE-B.md @@ -1,4 +1,24 @@ -# FIX-REVIEW-HYGIENE-B — scene packing, crate size fallback and scheduler exit +# FIX-REVIEW-HYGIENE-B + +**Status:** merged (PR #260). Compacted from `FIX-REVIEW-HYGIENE-B/` on 2026-11-23; the ticket files live on in git history. + +Issues #253, #254, #255 from the automated review of `affd2c9`: FARP packing bypasses the ADR 0024 placement (and broadcasts a debug line to every player); a crate model without `size` gets a row computed on 1.5 m (every crate of a `slingLoad` mission); timers cancelled by id never leave `ctld.scheduler._pending`. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-scheduler-remove-exit` | ✅ done | 01 — `ctld.scheduler.remove`: the exit symmetric to `schedule` | +| `02-scene-pack-through-aligned-spawn` | ✅ done | 02 — Packing a scene places its crates by the common rule | +| `03-row-requires-a-declared-crate-size` | ✅ done | 03 — The row layout requires a crate model with a declared size | + +## PRD + +## FIX-REVIEW-HYGIENE-B — scene packing, crate size fallback and scheduler exit **Status:** ✅ done @@ -6,7 +26,7 @@ Formalizes GitHub issues #253, #254 and #255, all three found by the same automa Re-read against `develop` at `6010d52` (2026-10-09): the three defects are still present, the line numbers below are those of `6010d52`. Follow-up of `FIX-REVIEW-HYGIENE-A`, and of the two lots the findings are about: `FEAT-NATIVE-CRATE-SPAWN-NEAR` (ADR 0024) and `FIX-SCHEDULER-SINGLE-ENTRY`. -## Problem Statement +### Problem Statement **Scene packing ignores the crate placement rule (#253).** ADR 0024 routes crate placement through `CTLDCrateManager:spawnCratesAligned`: a row just clear of the hull for a type that declares `crateSpawnSector` + `crateSpawnDistance`, the radial rule otherwise, with the anti-collision against other aircraft in both cases. @@ -32,13 +52,13 @@ DCS forgets the timer, `_pending[id]` stays `true` for the rest of the mission. `_pending` grows with every menu action that preempts an ambient rebuild, every group that loses its last occupant, every recon pass; `cancelAll()` then calls `timer.removeFunction` on thousands of dead ids and reports them as cancelled timers. The guard spec only watches `timer.scheduleFunction(`, so nothing stops the next direct removal. -## Solution +### Solution - Scene packing goes through `spawnCratesAligned`, which also returns the crates it created so the caller can attach the FARP warehouse snapshot; the debug broadcast goes. - The row layout requires a crate model with a declared size; a model without one keeps the radial rule. - `ctld.scheduler.remove(id)` is the exit symmetric to `schedule`; the six sites use it; the guard spec watches `timer.removeFunction` too. -## Decisions +### Decisions - **D1 — Scene packing joins ADR 0024 (not the other way round).** #253 offers the alternative: keep the generic rule for scenes and fix the doc instead. @@ -56,16 +76,16 @@ The guard spec only watches `timer.scheduleFunction(`, so nothing stops the next - No i18n, no config key, no catalogue change (under D3 as recommended). - **Legacy parity:** the legacy script has no row layout, no scene packing through a manager and no scheduler registry; nothing to preserve. -## Testing Decisions +### Testing Decisions - busted, written first and seen failing, through the existing seams: `tests/ci/functional/crate_spawn_layout_spec.lua` (spawn entry with doubles of the aircraft and of `spawnCrate`), `tests/ci/functional/crate_drop_placement_spec.lua` (Drop Crate(s) through the F10 menu), `tests/ci/unit/scheduler_spec.lua` (stubbed `timer`), `tests/ci/unit/scheduler_guard_spec.lua` (scan of the merge list). - The live DCS check of the FARP pack is optional: the row itself is already verified live by `FEAT-NATIVE-CRATE-SPAWN-NEAR` ticket 04, and this lot only changes which entry point the FARP calls. -## Out of Scope +### Out of Scope - Measuring `bw_container_cargo` and giving sling missions the row (see D3). - Any change to the radial rule or to the row geometry. -## Further Notes +### Further Notes Source issues: #253, #254, #255. The PR closes them with `Fixes #253`, `Fixes #254`, `Fixes #255`. diff --git a/.backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/PRD.md b/.backlog/archive/FIX-SCENE-PACK-WHILE-LAYING-OUT.md similarity index 79% rename from .backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/PRD.md rename to .backlog/archive/FIX-SCENE-PACK-WHILE-LAYING-OUT.md index 517faf44..11c45880 100644 --- a/.backlog/FIX-SCENE-PACK-WHILE-LAYING-OUT/PRD.md +++ b/.backlog/archive/FIX-SCENE-PACK-WHILE-LAYING-OUT.md @@ -1,10 +1,28 @@ -# FIX-SCENE-PACK-WHILE-LAYING-OUT — packing a FARP before it has finished laying out leaves orphan objects +# FIX-SCENE-PACK-WHILE-LAYING-OUT + +**Status:** merged (PR #304) — verified in game (2026-11-09). Compacted from `FIX-SCENE-PACK-WHILE-LAYING-OUT/` on 2026-11-23; the ticket files live on in git history. + +Found while checking an observation of the FIX-CREATE-BEFORE-DESTROY live check (2026-11-09): a FARP packed during the thirty seconds or so it takes to lay itself out leaves orphan objects (repair truck, tent, guards, lights), because its remaining steps keep running after the pack. Packing a scene now stops it first when it has not finished. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-stop-the-scene-before-destroying-it` | ✅ done (PR #304) | 01 — Stop a scene that is still laying out before destroying it | + +## PRD + +## FIX-SCENE-PACK-WHILE-LAYING-OUT — packing a FARP before it has finished laying out leaves orphan objects **Status:** ✅ done (PR #304) — verified in game 2026-11-09 (a Countryside FARP packed 3 s after it started left nothing 60 s later; six orphans before the fix) Found while checking an observation of the live check of FIX-CREATE-BEFORE-DESTROY (2026-11-09, DCS 2.9.30.28738), decided with the maintainer the same day. -## Problem Statement +### Problem Statement A scene (a FARP, for instance the Countryside FARP) takes about thirty seconds to lay itself out: the heliport and the flags first, the trucks five seconds later, the tent, the ammunition box, then the guards, the lights, the windsock, and last the warehouse stock. The scene is in the *Pack* list from its very first tick. @@ -16,13 +34,13 @@ Measured in game: packed three seconds after it started, a Countryside FARP left The Fat Cow already guards this case for its own FARP (it stops a scene that is still deploying before packing it). The pack of a scene does not. -## Solution +### Solution Packing a scene stops it first if it has not finished laying out. The steps that have not run are never run, so the pack leaves exactly what was packed: no orphan object after it. A scene that has finished is packed as before, and so is one already stopped. -## User Stories +### User Stories 1. As a pilot, I want a FARP I pack while it is still being laid out to leave nothing behind, so that no tent, truck, guard or light stays on the spot. 2. As a pilot, I want a FARP packed after it finished to behave exactly as it does today, so that I relearn nothing. @@ -32,7 +50,7 @@ A scene that has finished is packed as before, and so is one already stopped. 6. As a CTLD developer, I want the stop to be safe when the scene is already stopped (the Fat Cow stops its own first), so that the two guards do not fight. 7. As a CTLD developer, I want a test that fails when a step runs after the pack, so that the orphan cannot come back. -## Implementation Decisions +### Implementation Decisions - A scene records that it **completed** when its last step finished. - The scene manager's destroy of a scene stops it, with a reason, when it has neither completed nor been stopped, before destroying its objects. Stopping is idempotent: a scene already stopped is left as it is. @@ -41,19 +59,19 @@ A scene that has finished is packed as before, and so is one already stopped. - No change to the menus: the *Pack* entry still appears from the first tick. Hiding it until the scene is complete would be a user-interface change with its own decision. - No new message, no translation key, no configuration or catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes what is left in the world and which steps ran, not how the scene is organised. - Seam: the scene execution unit spec (a model with several steps, the unit and the scheduler doubled; the scheduler holds the timer so the test decides when it fires). New cases: a scene packed while a step is still waiting never runs that step, and its objects are destroyed; the same through the pack entry point; control: a scene that finished is destroyed without being stopped. - The Fat Cow specs, which pack scenes through doubles, keep passing unchanged. - Live check: the Countryside FARP packed three seconds after it starts leaves nothing after sixty seconds (the diagnostic that found it). -## Out of Scope +### Out of Scope - Hiding the *Pack* entry until the scene has finished laying out (a user-interface decision of its own). - What a half-laid-out FARP's warehouse holds when its crates take the snapshot. - Any other behaviour of the scenes or of the FARP pack. -## Further Notes +### Further Notes The observation first looked like a FARP whose guard and repair truck survive any pack. The second measurement showed it is the premature pack only. diff --git a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/PRD.md b/.backlog/archive/FIX-SPAWN-COUNTRY-FALLBACK.md similarity index 70% rename from .backlog/FIX-SPAWN-COUNTRY-FALLBACK/PRD.md rename to .backlog/archive/FIX-SPAWN-COUNTRY-FALLBACK.md index 08202588..c593c1fd 100644 --- a/.backlog/FIX-SPAWN-COUNTRY-FALLBACK/PRD.md +++ b/.backlog/archive/FIX-SPAWN-COUNTRY-FALLBACK.md @@ -1,18 +1,37 @@ -# FIX-SPAWN-COUNTRY-FALLBACK — objects created under a country that is in no coalition, silently +# FIX-SPAWN-COUNTRY-FALLBACK + +**Status:** merged (PR #256). Compacted from `FIX-SPAWN-COUNTRY-FALLBACK/` on 2026-11-23; the ticket files live on in git history. + +Reported by VMCT from a campaign mission (2026-10-09): with only CJTF Blue / CJTF Red in the coalitions, a requested crate never appears. Spawn sites without a country default to USA / Russia, which are in no coalition there, and `dynAddStatic` swallows the DCS error. One helper resolves the country (the unit's, else one of the coalition, else USA / Russia), and a failed creation is logged and told to the group. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-country-of-the-coalition` | ✅ done (PR #256) | 01 — The country of the coalition, not USA or Russia | +| `02-failed-creation-visible` | ✅ done (PR #256) | 02 — A failed creation is visible | + +## PRD + +## FIX-SPAWN-COUNTRY-FALLBACK — objects created under a country that is in no coalition, silently **Status:** ✅ done (PR #256) Reported by VMCT on 2026-10-09 (VMCT lot `FIX-CAMPAIGN-MISSION-1-FINDINGS`, ticket 05), measured in DCS on a VEAF campaign mission running CTLD 2.0.0-rc12, and still so on `develop` at `affd2c9c`. David chose to fix the cause in CTLD rather than add USA and Russia to the coalitions of every VMCT mission. -## What happened +### What happened The mission's blue coalition holds only CJTF Blue (country id 80), red only CJTF Red (81) — every VEAF campaign mission built by VMCT is like that. A CH-47F pilot landed in an active logistic zone picks a crate in Request Equipment, and nothing appears. Replayed through the fiddle hook: `CTLDCrateManager:spawnCrate(descriptor, pos, coalition.side.BLUE, unitName, CTLDCrate.SPAWN_METHOD.MENU_CTLD, nil, "dynamic")` returns nil. `coalition.getCountryCoalition(country.id.USA)` is 0 in that mission, and `coalition.addStaticObject(country.id.USA, data)` raises; the same static under `country.id.CJTF_BLUE` is created. -## Causes +### Causes 1. **A hardcoded country.** When a spawn site has no country, it takes `country.id.USA` for blue and `country.id.RUSSIA` for red, whether or not that country is in the coalition: - `src/CTLD_crate.lua` `_spawnStatic` (every crate created without a country: Request Equipment, crate sets, crates returning to the ground, mission-maker crates), the menu unpack, the landed-crate unpack; @@ -28,18 +47,18 @@ Replayed through the fiddle hook: `CTLDCrateManager:spawnCrate(descriptor, pos, On `develop` the Request Equipment menu already tells the pilot when nothing came out (`FIX-REQUEST-EQUIPMENT-SILENT-FAILURE`, after rc12), but without the cause. -## Decision +### Decision One helper, `ctld.utils.resolveCountryId(coalitionId, unit)`, used at every site: the unit's country when there is a live unit; else the lowest country id that `coalition.getCountryCoalition` places on that coalition; only then USA for blue, Russia for red. -## Done when +### Done when - A blue coalition without USA gets its crate under the requesting unit's country, and a site without a unit under a country of that coalition. - No `country.id.USA` / `country.id.RUSSIA` default remains outside the helper. - A failed static or group creation logs a `WARNING` naming the DCS error and the country, and the requesting group is told. - busted tests for each; `CHANGELOG.md` `[Unreleased]`; a release VMCT vendors. -## Tickets +### Tickets -1. [01 — the country of the coalition](tickets/01-country-of-the-coalition.md) -2. [02 — a failed creation is visible](tickets/02-failed-creation-visible.md) +1. 01 — the country of the coalition (`01-country-of-the-coalition`) +2. 02 — a failed creation is visible (`02-failed-creation-visible`) diff --git a/.backlog/FIX-TROOP-UNLOAD-TRANSPORT/PRD.md b/.backlog/archive/FIX-TROOP-UNLOAD-TRANSPORT.md similarity index 82% rename from .backlog/FIX-TROOP-UNLOAD-TRANSPORT/PRD.md rename to .backlog/archive/FIX-TROOP-UNLOAD-TRANSPORT.md index 7e3e2b9f..555e8735 100644 --- a/.backlog/FIX-TROOP-UNLOAD-TRANSPORT/PRD.md +++ b/.backlog/archive/FIX-TROOP-UNLOAD-TRANSPORT.md @@ -1,10 +1,28 @@ -# FIX-TROOP-UNLOAD-TRANSPORT — the scripted troop drops call a method that no longer exists +# FIX-TROOP-UNLOAD-TRANSPORT + +**Status:** merged (PR #313). Compacted from `FIX-TROOP-UNLOAD-TRANSPORT/` on 2026-11-23; the ticket files live on in git history. + +Found while preparing FEAT-TROOP-GESTURE-EVENTS: the scripted troop drops (`ctld.unloadTransport`, `ctld.unloadInProximityToEnemy`) called a troop manager method that no longer exists and raised an error. They drop the troops again with the v1 rules (back to the stock in a pickup zone, otherwise every group dropped; the proximity drop for AI transports only). + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-drop-the-troops-again` | ✅ done (PR #313) | 01 — The scripted troop drops drop the troops again | + +## PRD + +## FIX-TROOP-UNLOAD-TRANSPORT — the scripted troop drops call a method that no longer exists **Status:** ✅ done (PR #313) Found on 2026-11-18 while preparing FEAT-TROOP-GESTURE-EVENTS (PR #311), decided with the maintainer the same day (the v1 rules are kept). -## Problem Statement +### Problem Statement A mission maker's script makes a transport unload its troops: a trigger that fires on arrival (`ctld.unloadTransport`), or a continuous trigger that makes an AI transport unload as soon as an enemy is in sight (`ctld.unloadInProximityToEnemy`). Both are v1 functions CTLD 2 keeps as deprecated wrappers. @@ -17,7 +35,7 @@ What v1 did (the immutable reference): v1 carried one troop group at a time; CTLD 2 can carry several. -## Solution +### Solution Both functions drop the troops again, with the v1 rules, for every group on board: @@ -26,7 +44,7 @@ Both functions drop the troops again, with the v1 rules, for every group on boar The deprecated wrappers work again. The events of FEAT-TROOP-GESTURE-EVENTS follow: `OnTroopsUnloaded` for a drop, `OnTroopsReturned` for a return to the zone. -## User Stories +### User Stories 1. As a mission maker, I want `ctld.unloadTransport` to drop the troops of a transport, so that my arrival trigger works again. 2. As a mission maker, I want it to give the troops back to the zone's stock when the transport stands in a pickup zone, so that the stock is right, as in v1. @@ -39,7 +57,7 @@ The deprecated wrappers work again. The events of FEAT-TROOP-GESTURE-EVENTS foll 9. As a mission maker, I want the drop and the return to publish their events, so that my scoring sees them. 10. As a CTLD developer, I want a test that fails when either function raises, so that a renamed method cannot break them silently again. -## Implementation Decisions +### Implementation Decisions - The troop manager's two scripted drops use the existing drop and return operations instead of the method that no longer exists: the drop of every group (`disembarkAll`) and the return to a pickup zone (`returnToTroopZone`). - `unloadTransport` picks between them by the zone the unit stands in, extraction zone first, then pickup zone, as the *Disembark* menu entry already does. @@ -47,19 +65,19 @@ The deprecated wrappers work again. The events of FEAT-TROOP-GESTURE-EVENTS foll - The deprecated wrappers are unchanged; they only needed their target to work. `ctld.unloadTransport` still returns nothing, as in v1. - No new message, no translation key, no configuration or catalogue change. -## Testing Decisions +### Testing Decisions - A good test observes what is dropped, returned or published, and that nothing raises, not how the manager is organised. - Seam: a new functional spec of the scripted drops, with the transport unit, the zone manager and the object registry doubled (the troop manager specs are the prior art). Cases: the drop, every group, the return to a pickup zone (stock restored, nothing spawned), an extraction zone before a pickup zone, no troops and an unknown unit, the deprecated wrappers; for the proximity drop: an AI transport with an enemy, none in sight, a player's transport left alone, the wrapper. - The new cases fail before the change (the method does not exist) and pass after it; the existing troop specs pass unchanged. - Not run in DCS: it needs a mission script calling the function; the logic is covered with doubles, and the gestures it calls were checked in game by FEAT-TROOP-GESTURE-EVENTS. -## Out of Scope +### Out of Scope - The **vehicles** half of v1 `unloadTransport` (it also unloaded vehicles): v2 vehicles belong to the vehicle spawner, and these functions never covered them. - Any other legacy function. - The return value of the deprecated `ctld.unloadTransport` wrapper. -## Further Notes +### Further Notes The old `deploy` method was renamed `disembark` in the rewrite; its two callers were not updated. The repository history only shows the bootstrap commit, so the exact moment is not recorded. diff --git a/.backlog/FIX-UNPACK-FALSE-SUCCESS/PRD.md b/.backlog/archive/FIX-UNPACK-FALSE-SUCCESS.md similarity index 71% rename from .backlog/FIX-UNPACK-FALSE-SUCCESS/PRD.md rename to .backlog/archive/FIX-UNPACK-FALSE-SUCCESS.md index 2174522c..4e4ee05f 100644 --- a/.backlog/FIX-UNPACK-FALSE-SUCCESS/PRD.md +++ b/.backlog/archive/FIX-UNPACK-FALSE-SUCCESS.md @@ -1,10 +1,28 @@ -# FIX-UNPACK-FALSE-SUCCESS — unpacking announces "unpacked successfully" when nothing was created +# FIX-UNPACK-FALSE-SUCCESS + +**Status:** merged (PR #267). Compacted from `FIX-UNPACK-FALSE-SUCCESS/` on 2026-11-23; the ticket files live on in git history. + +The Unpack Crate click no longer announces a success when a JTAC limit or a missing spawn position produced nothing. + +## Tickets + +> **On the ticket statuses below:** the lot's own status is what was tracked; per-ticket +> `Status:` lines were not always updated on the way out. Where they disagree, the lot status +> and the delivering PR are authoritative. + +| Ticket | Status | Title | +|---|---|---| +| `01-announce-success-only-on-true` | ✅ done (PR #267) | 01 — Announce "unpacked successfully" only when the group was created | + +## PRD + +## FIX-UNPACK-FALSE-SUCCESS — unpacking announces "unpacked successfully" when nothing was created **Status:** ✅ done (PR #267) GitHub issue #264 (automated review of `develop` at `673b064`), decided with the maintainer on 2026-10-20. -## Problem Statement +### Problem Statement `CTLDCrateManager:_spawnUnpacked` returns three values: `true` (group created), `false` (DCS refused it, the pilot is told), `nil` (nothing was attempted: missing data, JTAC drop disabled, JTAC slot limit reached). The Unpack Crate menu callback announces success when the @@ -12,12 +30,12 @@ result is `~= false`, so `nil` counts as a success. A pilot who unpacks a JTAC c reason of the refusal, then "… unpacked successfully!" — two contradictory messages, with the crates already consumed and no JTAC created. The same happens when the descriptor or the spawn position is missing and `_spawnUnpacked` is never called. -## Solution +### Solution The success message is announced only when the group was created (`true`). A refusal already reported to the pilot (DCS refusal, JTAC limit) stays reported once. When the unpack could not even be attempted (no descriptor, no unit type, no spawn position), the click is logged. -## User Stories +### User Stories 1. As a pilot, I want no "unpacked successfully" message when the JTAC limit blocked the unpack, so that I am not told two opposite things. 2. As a pilot, I want still to be told why the JTAC was refused. @@ -25,24 +43,24 @@ stays reported once. When the unpack could not even be attempted (no descriptor, 4. As a pilot, I want a DCS refusal still reported as a failure, once. 5. As a CTLD developer, I want an unpack that could not be attempted logged, so that a silent click leaves a trace. -## Implementation Decisions +### Implementation Decisions - The callback announces success on `spawned == true` only. - When the descriptor, its unit type or the spawn position is missing, the callback logs it (nothing is attempted, as today). - No change to `_spawnUnpacked`, to the messages, to the keys or to the catalogue. -## Testing Decisions +### Testing Decisions - A good test observes what the pilot reads and what is logged, not how the callback is organised. - A functional spec over the real menu builder and the real callback (prior art: `crate_request_failure_spec`): JTAC limit reached → only the refusal reason; creation succeeds → the success message; DCS refuses → the failure message only; no spawn position → no success message and a log. -## Out of Scope +### Out of Scope - The order of the operations (crates consumed before the spawn is attempted), unchanged. - The FARP pack message (issue #263, own lot). -## Further Notes +### Further Notes None. diff --git a/CHANGELOG.md b/CHANGELOG.md index 978a2c82..c76a1f07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ Versioning follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Fixed — five defects found by the VMCT review of `develop` (FIX-VMCT-REVIEW-FINDINGS, issues #322 to #326) + +- **Parachuted troops keep their template** (#322): every parachuted group landed as "Soldier AK", blue or red, whatever its roles (a Mortar Squad landed as riflemen), because the drop read a unit field the troop templates do not have. The drop now builds the group from the template's own units, with the types of the group's coalition and its `componentTypes`, as the same group unloaded on the ground: same types, same order, mortar servants included. A group re-embarked from the field after losses lands its first surviving-count slots of the template, not the survivors' own types. A servant and a JTAC carry the `SVNT` / `JTAC` name prefix of the landed ones, so a field pickup does not count the servants as troops and still recognises the JTAC; a JTAC behind a mortar still lases. "Soldier AK" remains only as a logged fallback for an unknown template. +- **Inactive zones stay inactive** (#323): a `troopZones` or `wpZones` entry marked `"no"` was active from the start of the mission, because the zone's constructor turned `active = false` into `true`. It now loads inactive, as in v1, until `ctld.activatePickupZone` / `ctld.activateWaypointZone` (or `CTLDZoneManager:setTroopZoneActive`) opens it. As in v1, only `yes` (or `1`) in the active field opens a zone at load: any other value, a hand-written `true` included, now loads it inactive. The logistic zone's constructor had the same expression (no caller passed `false` yet) and is fixed too. +- **Repair crates can be requested from the menu** (#324): the six "… Repair" crates (HAWK, NASAMS, BUK, KUB, Patriot, S-300) answered "Request failed: the equipment could not be brought out.", so a SAM could not be repaired with a crate from **Request Equipment**. A single crate was looked up by its unit type, which a repair crate does not have; every single crate is now looked up by its weight, as the crate sets already were. The other single crates of the default catalogue resolve to the same entry as before. +- **Each AA group gets a unique name** (#325): an AA system's group was named `_CTLD_AA_`, so two systems of the same type spawned in the same second (two pilots, or two AI deliveries) shared it, and DCS silently replaced the first one with the second. The group name now carries the same uid as its unit names: `_CTLD_AA_`. +- **Coalition messages name the player** (#326): "%1 started building a FOB" and the AA "successfully deployed / rearmed / repaired a full %2" messages showed the unit name of the slot (`UH-1H-Slot-7`). They now show the player's name, or the aircraft type for an AI unit (or an empty player name), with the rule of v1's `ctld.getPlayerNameOrType`, implemented as `ctld.utils.getPlayerNameOrType` (v1's global is not provided). The event payloads are unchanged: `OnFOBDeployed.player` is still the unit name. + ### Added — the events link a crate and the group it became (FEAT-VMCT-V1-PARITY, issue #328) - CTLD v1's callbacks gave both the crate and the spawned group for every unpack, rearm and repair. In CTLD 2, `OnCrateUnpacked` gave the crate without the group, and the AA system events the group without the crates, so a layer had to rebuild the link by proximity, and two simultaneous unpacks could be crossed (reported by VMCT). @@ -93,7 +101,7 @@ Versioning follows [Semantic Versioning](https://semver.org/). - **Pack ** destroyed the FARP's objects, then created the crates, so a refusal from DCS lost the FARP and its warehouse stock (since #268 the pilot was at least told). The warehouse snapshot is now read first, the crates are created all or nothing, and the FARP is destroyed only once they exist; otherwise it stays deployed, stock included, and can be packed again. The "FARP packed: X of Y crates created." message is gone, a partial pack no longer exists. - **Pack the Fat Cow FARP** closed the FARP and emptied it before setting the cow crates down, so a refusal from DCS, or a stock no `fatCowCrates` entry could carry, lost the fuel and ammunition (it only logged "lost"). The stock is now read back first, the crates are set down all or nothing, and the FARP closes only once they exist; otherwise it stays open with its stock and the pilot reads "Pack failed: the crates could not be created.". - **Unpack Crate** (a vehicle, a static, a JTAC), and the automatic unpack of a parachuted load, consumed the crates before asking DCS for the equipment, so a refusal, a JTAC limit or a missing spawn position cost the crates for nothing. The equipment is now created first and the crates are consumed only once it exists; otherwise they stay on the ground and `OnCrateUnpacked` is not published. An unpack that starts a stepped scene (FOB, FARP) is unchanged (ADR 0028). -- **AA systems**: assembling a system from its crates, rearming it and repairing it destroyed the crates, or the old group, before spawning the new group, so a refusal from DCS lost them (a repair left no defence at all). The new group is now spawned first; the crates and the old group go only once it exists, and a refusal keeps them and tells the pilot "Unpack failed: the equipment could not be created.". A refused rearm no longer falls through to assembling a second system from the same crates. The new group is created over the old one for the instant before it is destroyed, so each AA group now gets its own unit names (`CTLD_AA___`): to be confirmed on the live check. +- **AA systems**: assembling a system from its crates, rearming it and repairing it destroyed the crates, or the old group, before spawning the new group, so a refusal from DCS lost them (a repair left no defence at all). The new group is now spawned first; the crates and the old group go only once it exists, and a refusal keeps them and tells the pilot "Unpack failed: the equipment could not be created.". A refused rearm no longer falls through to assembling a second system from the same crates. The new group is created over the old one for the instant before it is destroyed, so each AA group now gets its own unit names (`CTLD_AA___`). --- diff --git a/docs/developer/events.fr.md b/docs/developer/events.fr.md index ec0eec41..09a61178 100644 --- a/docs/developer/events.fr.md +++ b/docs/developer/events.fr.md @@ -462,7 +462,7 @@ Des troops parachutées atterrissent (asynchrone, après le timer de descente). | --- | --- | --- | | `troops` | CTLDTroopGroup | | | `spawnedGroup` | Group | Group DCS spawné au sol | -| `positions` | table | Tableau de vec3, un par soldat | +| `positions` | table | Tableau de vec3, un par unité créée (un servant de mortier se pose à 1 m de son mortier) | | `transport` | string | | | `player` | string | | | `startAltitude` | number | | diff --git a/docs/developer/events.md b/docs/developer/events.md index 689e83ee..f87613cf 100644 --- a/docs/developer/events.md +++ b/docs/developer/events.md @@ -460,7 +460,7 @@ failure is logged at `ERROR` level and the player is told the troops were lost. | --- | --- | --- | | `troops` | CTLDTroopGroup | | | `spawnedGroup` | Group | DCS group spawned on the ground | -| `positions` | table | Array of vec3, one per soldier | +| `positions` | table | Array of vec3, one per spawned unit (a mortar servant lands 1 m beside its mortar) | | `transport` | string | | | `player` | string | | | `startAltitude` | number | | diff --git a/src/CTLD_aasystem.lua b/src/CTLD_aasystem.lua index eb25451a..de30bae2 100644 --- a/src/CTLD_aasystem.lua +++ b/src/CTLD_aasystem.lua @@ -547,7 +547,7 @@ function CTLDCrateAssemblyManager:_assemble(heli, crate, allCrates, template, ra trigger.action.outTextForCoalition( coalitionId, ctld.tr("%1 successfully deployed a full %2 in the field.\n\nAA Active System limit: %3\nActive: %4", - heli:getName(), template.name, allowed, active + 1), + ctld.utils.getPlayerNameOrType(heli), template.name, allowed, active + 1), 10) ctld.utils.log("INFO", string.format( @@ -625,7 +625,7 @@ function CTLDCrateAssemblyManager:_rearm(heli, crate, allCrates, template) trigger.action.outTextForCoalition( heli:getCoalition(), ctld.tr("%1 successfully rearmed a full %2 in the field", - heli:getName(), + ctld.utils.getPlayerNameOrType(heli), template.name), 20) @@ -695,7 +695,7 @@ function CTLDCrateAssemblyManager:_repair(heli, crate, template) trigger.action.outTextForCoalition( heli:getCoalition(), ctld.tr("%1 successfully repaired a full %2 in the field.", - heli:getName(), + ctld.utils.getPlayerNameOrType(heli), template.name), 10) @@ -843,7 +843,11 @@ end function CTLDCrateAssemblyManager:_spawnGroup(positions, types, headings, countryId) if #positions == 0 then return nil end - local baseName = types[1] .. "_CTLD_AA_" .. tostring(math.floor(timer.getAbsTime())) + -- A rearm or a repair spawns the new group while the old one still stands (ADR 0028), and two systems + -- of the same type can be spawned in the same second: the group name and its unit names carry a uid of + -- their own, since DCS replaces a group spawned under an existing name (#325). + local groupUid = ctld.utils.getNextUniqId() + local baseName = types[1] .. "_CTLD_AA_" .. groupUid local groupData = { visible = false, hidden = false, @@ -854,9 +858,6 @@ function CTLDCrateAssemblyManager:_spawnGroup(positions, types, headings, countr units = {}, } - -- A rearm or a repair spawns the new group while the old one still stands (ADR 0028): its unit names - -- must differ from the old group's, so each group gets its own suffix. - local groupUid = ctld.utils.getNextUniqId() for i, pos in ipairs(positions) do local hdg = headings[i] or 0 groupData.units[i] = { diff --git a/src/CTLD_crate.lua b/src/CTLD_crate.lua index a2c8d073..50a76f98 100644 --- a/src/CTLD_crate.lua +++ b/src/CTLD_crate.lua @@ -3097,7 +3097,7 @@ function CTLDCrateManager:refreshRequestEquipmentSection(playerObj) -- A request that produces nothing must say so and leave a trace: it used to do nothing at all. local function failed(reason) ctld.utils.log("ERROR", "Request Equipment: nothing brought out for '%s' (unit=%s zone=%s): %s", - tostring(arg.unit or "crate set"), tostring(arg.unitName), tostring(arg.zoneName), reason) + tostring(arg.desc or arg.unit or "crate set"), tostring(arg.unitName), tostring(arg.zoneName), reason) trigger.action.outTextForGroup(gid, ctld.tr("Request failed: the equipment could not be brought out."), 10) end @@ -3131,7 +3131,8 @@ function CTLDCrateManager:refreshRequestEquipmentSection(playerObj) end else local mKey = mgr:_crateModelKey(t) - local descriptor = mgr:findDescriptorByTypeName(arg.unit) + -- By weight, the key of every catalogue entry, as the sets do: a "… Repair" crate has no unit (#324). + local descriptor = mgr:findDescriptorByWeight(arg.weight) if not descriptor then failed("no crate descriptor for this item") else @@ -3181,7 +3182,7 @@ function CTLDCrateManager:refreshRequestEquipmentSection(playerObj) crateOrder = crateOrder + 1 menu:addCommand({ root, spawnSub, lgzName, category }, sc.desc, spawnFn, - { unit = sc.unit, desc = sc.desc, zoneName = lgzName, + { unit = sc.unit, weight = sc.weight, desc = sc.desc, zoneName = lgzName, unitName = playerObj.unitName, coalition = playerObj.coalition, spawnAsVehicle = spawnAsVehicle }, { order = crateOrder }) diff --git a/src/CTLD_fob.lua b/src/CTLD_fob.lua index d7aa6607..0896d463 100644 --- a/src/CTLD_fob.lua +++ b/src/CTLD_fob.lua @@ -189,7 +189,7 @@ end -- sceneName identifies the exact FOB variant (e.g. "FOB", "FOB Heavy") so -- cratesRequired and crate collection are always consistent with the scene model. -- @param transport DCS Unit --- @param player string player name (display only) +-- @param player string unit name of the transport (scene and OnFOBDeployed payload) -- @param sceneName string registered scene model name (from model.name) function CTLDFOBManager:unpackFOBCrates(transport, player, sceneName) if not ctld.gs("enabledFOBBuilding") then return end @@ -253,7 +253,7 @@ function CTLDFOBManager:unpackFOBCrates(transport, player, sceneName) -- Visual feedback — scene duration defines the 120 s build time trigger.action.outTextForCoalition(coalitionId, ctld.tr("%1 started building a FOB (%2 crate(s)). Construction in progress.", - player, #cratesUsed), 10) + ctld.utils.getPlayerNameOrType(transport), #cratesUsed), 10) -- Start scene immediately. -- All post-scene registration (LGZ, beacon, event) is handled by fobScene's last step. diff --git a/src/CTLD_troop.lua b/src/CTLD_troop.lua index f453fce3..a1148775 100644 --- a/src/CTLD_troop.lua +++ b/src/CTLD_troop.lua @@ -1785,7 +1785,7 @@ end --- Parachute troops currently loaded on a transport. -- Altitude AGL is checked at call time. If below parachuteMinAltitudeTroops, -- a message is sent to the group and nothing happens. --- Each unit in the group gets its own independent landing position. +-- Each unit gets its own independent landing position; a mortar servant lands 1 m beside its mortar. -- The DCS ground group is spawned with all unit positions after descentTime. -- Publishes OnTroopsDeployed (trigger="parachute") immediately, -- and OnTroopsParachuteLanded after descentTime. @@ -1815,32 +1815,76 @@ function CTLDTroopManager:parachuteTroops(transport, playerObj) local unitDefs = {} local landPositions = {} - -- Resolve unit type from template registry (fallback to generic infantry) + -- Unit list from the template registry, resolved for the group's coalition as the landed + -- unload does (CTLDObjectRegistry.spawnObject) — issue #322. Mortar servants (svntOf) are + -- included, like on the ground, but do not count toward unitTotal. Generic infantry is the + -- last fallback when the template or a unit type cannot be resolved. local template = troopGroup.templateKey and CTLDObjectRegistry._db[troopGroup.templateKey] local unitCount = troopGroup.unitTotal or 1 - local unitType = (template and template.units and template.units[1] and template.units[1].type) - or "Soldier AK" + local coalitionId = troopGroup.coalitionId or playerObj.coalition or 2 + local unitSpecs = {} -- { type, svnt } + if template and template.units then + local logical, keepServant = 0, false + for _, uDesc in ipairs(template.units) do + local include + if uDesc.svntOf then + include = keepServant + else + logical = logical + 1 + include = logical <= unitCount + keepServant = include + end + if include then + local uType = uDesc.unitType + if type(uType) == "function" then uType = uType(coalitionId) end + if type(uType) ~= "string" then + ctld.utils.log("WARN", "parachuteTroops: no unit type for '%s' (coalition %s), using 'Soldier AK'", + tostring(troopGroup.templateName), tostring(coalitionId)) + uType = "Soldier AK" + end + table.insert(unitSpecs, { type = uType, svnt = uDesc.svntOf and true or false, + jtac = uDesc.namePrefix == "JTAC" }) + end + end + else + ctld.utils.log("WARN", "parachuteTroops: template '%s' not found, landing %d 'Soldier AK'", + tostring(troopGroup.templateKey), unitCount) + for _ = 1, unitCount do table.insert(unitSpecs, { type = "Soldier AK", svnt = false }) end + end -- Unique DCS group name: two groups loaded from the same template must not collide -- (coalition.addGroup destroys/replaces an existing group spawned under the same -- name) — FIX-PARACHUTE-GROUP-NAME-COLLISION. Units are named after the resolved - -- group name, matching standard DCS Mission Editor naming (GroupName-N). + -- group name, matching standard DCS Mission Editor naming (GroupName-N). A servant and a JTAC keep + -- the "SVNT" / "JTAC" prefix a field pickup recognises them by (_isServantUnitName, BUG-03/05). local groupName = troopGroup.templateName .. "-" .. ctld.utils.getNextUniqId() - -- Compute one landing position per unit + -- Compute one landing position per unit; a servant lands 1 m beside its mortar, as on the ground. + -- slotToPos maps the logical slot (servants not counted, as in the _jtacUnits "_u" names) + -- to the unit's position in the spawned group. local firstDescentTime = nil - for i = 1, unitCount do - local landPos, descentTime = ctld.utils.calcDropPosition(transport, descentRate) + local slotToPos = {} + local lastLand = nil + for i, spec in ipairs(unitSpecs) do + local landPos, descentTime + if spec.svnt and lastLand then + landPos = { x = lastLand.x + 1, y = lastLand.y, z = lastLand.z } + else + landPos, descentTime = ctld.utils.calcDropPosition(transport, descentRate) + lastLand = landPos + slotToPos[#slotToPos + 1] = i + end table.insert(landPositions, landPos) + local prefix = spec.svnt and "SVNT-" or (spec.jtac and "JTAC-" or "") unitDefs[i] = { - type = unitType, - name = groupName .. "-" .. i, + type = spec.type, + name = prefix .. groupName .. "-" .. i, x = landPos.x, y = landPos.z, -- DCS ground group: position.y = world Z axis heading = math.random(0, 360) * math.pi / 180, playerCanDrive = ctld.utils.spawnedUnitsPlayerCanDrive(), } - if i == 1 then firstDescentTime = descentTime end + if not firstDescentTime then firstDescentTime = descentTime end end local descentTime = firstDescentTime or @@ -1885,6 +1929,7 @@ function CTLDTroopManager:parachuteTroops(transport, playerObj) local _groupName = groupName local _unitDefs = unitDefs local _landPositions = landPositions + local _slotToPos = slotToPos local _dropData = dropData local _coalition = playerObj.coalition or 2 local _countryId = troopGroup.countryId -- captured here: the country the troops were loaded under @@ -1919,12 +1964,13 @@ function CTLDTroopManager:parachuteTroops(transport, playerObj) specificParams = _troopGroup.specificParams, } -- Register any JTAC units with CTLDJTACManager. - -- _jtacUnits slot names end with "_u" — map to spawned unit by position. + -- _jtacUnits slot names end with "_u" — map to spawned unit by position + -- (slotToPos skips the mortar servants, which the slot numbering does not count). if _troopGroup:hasAliveJtac() then local jtacSlots = {} for slotName, _ in pairs(_troopGroup._jtacUnits) do local idx = tonumber(slotName:match("_u(%d+)$")) - if idx then jtacSlots[idx] = true end + if idx and _slotToPos[idx] then jtacSlots[_slotToPos[idx]] = true end end local jm = CTLDJTACManager.getInstance() local spawnedUnits = grp:getUnits() diff --git a/src/CTLD_utils.lua b/src/CTLD_utils.lua index 8cbc807e..a4cf225f 100644 --- a/src/CTLD_utils.lua +++ b/src/CTLD_utils.lua @@ -2196,6 +2196,19 @@ function ctld.utils.getGroupId(unit) return grp and grp:getID() or -1 end +--- Name to show players for the unit behind an action: the player's name, else the unit's type name +-- (an AI unit has no player). v1's ctld.getPlayerNameOrType (issue #326); an empty name also counts as no +-- player, as CTLDTroopManager:_callsign already does, so a message never names "". +-- @param unit DCSUnit +-- @return string +function ctld.utils.getPlayerNameOrType(unit) + local playerName = unit:getPlayerName() + if playerName == nil or playerName == "" then + return unit:getTypeName() + end + return playerName +end + --- Name of an on-board cargo object, or nil when the object cannot be read (a stale or invalid -- handle). The native scans run in periodic timers that DCS stops for good once they raise, so a -- bad entry is skipped instead of stopping the scan. diff --git a/src/CTLD_zone.lua b/src/CTLD_zone.lua index 90eb030f..a76821d4 100644 --- a/src/CTLD_zone.lua +++ b/src/CTLD_zone.lua @@ -133,7 +133,7 @@ function CTLDTroopZone:init(data) self._aiVehicleStock = data._aiVehicleStock or nil self.smoke = (data.smoke ~= nil) and data.smoke or -1 - self.active = (data.active ~= nil) and data.active or true + self.active = data.active ~= false -- A DCS object the zone rides on (a ship, typically): its position is resolved on every -- getCenter(), never snapshotted. Same field and same role as CTLDLogisticZone. self._linkedUnit = data.linkedUnit or nil @@ -405,7 +405,7 @@ function CTLDLogisticZone:init(data) self._linkedUnit = data.linkedUnit or nil self.dcsName = data.dcsName or nil self._anchorUnitName = data.anchorUnitName or nil - self.active = (data.active ~= nil) and data.active or true + self.active = data.active ~= false self.services = data.services or { cratesPickup = true, cratesDropoff = true, diff --git a/tests/ci/functional/crate_request_failure_spec.lua b/tests/ci/functional/crate_request_failure_spec.lua index 3ed351b3..0c47f64b 100644 --- a/tests/ci/functional/crate_request_failure_spec.lua +++ b/tests/ci/functional/crate_request_failure_spec.lua @@ -173,7 +173,7 @@ describe("Request Equipment reports a request that produced nothing", function() end) it("whose descriptor cannot be found tells the pilot and logs an ERROR", function() - CTLDCrateManager.getInstance().findDescriptorByTypeName = function() return nil end + CTLDCrateManager.getInstance().findDescriptorByWeight = function() return nil end click(isSingle) assert.is_true(said(tr(FAILURE))) assert.is_true(logged("ERROR", "descriptor")) diff --git a/tests/ci/functional/crate_request_repair_spec.lua b/tests/ci/functional/crate_request_repair_spec.lua new file mode 100644 index 00000000..e17da97b --- /dev/null +++ b/tests/ci/functional/crate_request_repair_spec.lua @@ -0,0 +1,193 @@ +---@diagnostic disable +-- FIX-VMCT-REVIEW-FINDINGS ticket 03 (issue #324): every single crate of Request Equipment is brought out, +-- the six "… Repair" crates included. They carry a weight and no unit; the single-crate path looked the +-- crate up by unit and answered "Request failed". The menu is built by the real builder over a real zone +-- manager and the callback is the real one read back from the menu node; the crate creation is a double. +-- ============================================================ + +describe("Request Equipment brings out every single crate of the catalogue (#324)", function() + + local tr = ctld.tr + local ROOT = tr("CTLD") + local PLAYER_UNIT = "UH2_rp1" + local CX, CZ = 100, 200 + local FAILURE = "Request failed: the equipment could not be brought out." + + local savedMission, savedGetZone, origGetByName, origInAir, origOutText, origGs + local messages, created + + local function resetSingletons() + ctld.MenuManager._instance = nil + CTLDPlayerManager._instance = nil + CTLDTroopManager._instance = nil + CTLDCrateManager._instance = nil + CTLDVehicleSpawner._instance = nil + CTLDFOBManager._instance = nil + CTLDBeaconManager._instance = nil + CTLDReconManager._instance = nil + CTLDJTACManager._instance = nil + CTLDZoneManager._instance = nil + EventDispatcher._instance = nil + CTLDDCSEventBridge._instance = nil + end + + local function collectSingleCommands(node, out) + if node.type == "command" then + local a = node.anyArgument + if type(a) == "table" and a.desc and not a.multiple and not a.spawnAsVehicle then + out[#out + 1] = node + end + return out + end + for _, child in ipairs(node.children or {}) do collectSingleCommands(child, out) end + return out + end + + local function singleCommands() + local playerObj = { + unitName = PLAYER_UNIT, groupId = 9907, groupName = "Grp_rp1", coalition = coalition.side.BLUE, + typeName = "UH-1H", isTransport = true, canCarryVehicles = false, + } + CTLDPlayerManager.getInstance():buildMenu(playerObj) + local menu = ctld.MenuManager:getInstance():getMenuByGroupId(playerObj.groupId) + return collectSingleCommands(menu:_getNode({ ROOT, tr("Request Equipment") }), {}) + end + + -- display label -> set of catalogue weights shown under that label + local function weightsByLabel() + local byLabel = {} + for _, data in pairs(CTLDCrateManager.getInstance()._processedCrates or {}) do + for _, entry in ipairs(data.singleCrates) do + local sc = entry.singleCrate + byLabel[sc.desc] = byLabel[sc.desc] or {} + byLabel[sc.desc][sc.weight] = true + end + end + return byLabel + end + + local function said(text) + for _, m in ipairs(messages) do if m == text then return true end end + return false + end + + before_each(function() + ctld.startupReport._entries = {} + resetSingletons() + messages, created = {}, {} + savedMission = env.mission + savedGetZone = trigger.misc.getZone + origGs = ctld.gs + trigger.misc.getZone = function(_) return { point = { x = CX, y = 0, z = CZ }, radius = 300 } end + env.mission = { triggers = { zones = { { name = "LGZ_rp1_B" } } } } + ctld.gs = function(k) + if k == "JTAC_dropEnabled" then return true end + return origGs(k) + end + + EventDispatcher.getInstance() + CTLDDCSEventBridge.getInstance() + CTLDZoneManager.getInstance() + CTLDPlayerManager.getInstance() + CTLDTroopManager.getInstance() + CTLDVehicleSpawner.getInstance() + CTLDCrateManager.getInstance() + CTLDFOBManager.getInstance() + CTLDBeaconManager.getInstance() + CTLDReconManager.getInstance() + CTLDJTACManager.getInstance() + + origGetByName = Unit.getByName + Unit.getByName = function(n) + if n == PLAYER_UNIT then + return { + getName = function() return PLAYER_UNIT end, + getTypeName = function() return "UH-1H" end, + getCoalition = function() return coalition.side.BLUE end, + getCountry = function() return country.id.USA end, + getPoint = function() return { x = CX, y = 0, z = CZ } end, + getPosition = function() + return { p = { x = CX, y = 0, z = CZ }, x = { x = 1, y = 0, z = 0 }, + y = { x = 0, y = 1, z = 0 }, z = { x = 0, y = 0, z = 1 } } + end, + getDesc = function() + return { box = { min = { x = -8, y = -1.6, z = -1.6 }, max = { x = 4, y = 1.6, z = 1.6 } } } + end, + getPlayerName = function() return "tester" end, + isExist = function() return true end, + inAir = function() return false end, + getGroup = function() return { getID = function() return 9907 end } end, + } + end + return origGetByName and origGetByName(n) or nil + end + origInAir = ctld.utils.inAir + ctld.utils.inAir = function() return false end + origOutText = trigger.action.outTextForGroup + trigger.action.outTextForGroup = function(_, text) messages[#messages + 1] = text end + + local mgr = CTLDCrateManager.getInstance() + mgr.spawnCratesAligned = function(_, descriptors) + created[#created + 1] = descriptors[1] + return 1, { clock = "3", positions = {} } + end + mgr.spawnCrate = function(_, descriptor) + created[#created + 1] = descriptor + return {} + end + end) + + after_each(function() + Unit.getByName = origGetByName + ctld.utils.inAir = origInAir + ctld.gs = origGs + trigger.action.outTextForGroup = origOutText + env.mission = savedMission + trigger.misc.getZone = savedGetZone + resetSingletons() + ctld.startupReport._entries = {} + end) + + for _, label in ipairs({ "HAWK Repair", "NASAMS Repair", "Patriot Repair" }) do + it("brings out a '" .. label .. "' crate", function() + local cmd + for _, c in ipairs(singleCommands()) do + if c.anyArgument.desc:find(label, 1, true) == 1 then cmd = c end + end + assert.is_not_nil(cmd, "Request Equipment lists no '" .. label .. "'") + cmd.functionToCall(cmd.anyArgument) + assert.is_false(said(tr(FAILURE))) + assert.equals(1, #created) + assert.equals(label, created[1].desc) + end) + end + + it("brings out, for every single crate the blue menu lists, the crate of that very entry", function() + local byLabel = weightsByLabel() + local cmds = singleCommands() + assert.is_true(#cmds > 20) + for _, cmd in ipairs(cmds) do + created = {} + cmd.functionToCall(cmd.anyArgument) + local label = cmd.anyArgument.desc + assert.equals(1, #created, "nothing brought out for '" .. label .. "'") + assert.is_true(byLabel[label][created[1].weight] == true, + "'" .. label .. "' brought out the crate of '" .. tostring(created[1].desc) .. "'") + end + assert.is_false(said(tr(FAILURE))) + end) + + it("resolves every single crate of the catalogue, red ones included, by its own weight", function() + local mgr = CTLDCrateManager.getInstance() + for _, data in pairs(mgr._processedCrates) do + for _, entry in ipairs(data.singleCrates) do + local sc = entry.singleCrate + local d = mgr:findDescriptorByWeight(sc.weight) + assert.is_not_nil(d, "no descriptor for weight " .. tostring(sc.weight)) + assert.equals(sc.unit, d.unit) + assert.equals(sc.cratesRequired, d.cratesRequired) + end + end + end) + +end) diff --git a/tests/ci/functional/parachute_spec.lua b/tests/ci/functional/parachute_spec.lua index f09de926..40a1dd40 100644 --- a/tests/ci/functional/parachute_spec.lua +++ b/tests/ci/functional/parachute_spec.lua @@ -440,6 +440,142 @@ describe("parachuteTroops — unique group/unit names (FIX-PARACHUTE-GROUP-NAME- end end) + -- Issue #322: a parachuted group lands with its template's unit types, resolved for its + -- coalition, exactly as the same group unloaded on the ground (CTLDObjectRegistry.spawnObject). + describe("template unit types (#322)", function() + + local function registerTemplate(tmpl) + tm:_registerOneTemplate(tmpl) + return tmpl + end + + local function loadedGroup(tmpl, coalitionId, jtacSlots) + return CTLDTroopGroup:new({ + templateName = tmpl.name, + templateKey = tmpl._dbKey, + unitTotal = tmpl.total, + weight = 100 * tmpl.total, + coalitionId = coalitionId, + countryId = coalitionId == 1 and 0 or 2, + _jtacUnits = jtacSlots or {}, + }) + end + + local function onlySpawnedTypes() + local name = spawnedNames()[1] + local types = {} + for _, u in ipairs(spawnedGroups[name].units) do table.insert(types, u.type) end + return types + end + + local function landedTypes(tmpl, coalitionId) + spawnedGroups = {} + CTLDObjectRegistry.spawnObject(tmpl._dbKey, coalitionId, 2, 0, 0, 0, { circleRadius = 5 }) + return onlySpawnedTypes() + end + + local function parachutedTypes(tmpl, coalitionId) + spawnedGroups = {} + tm._inTransit["UH-1H-1"] = { loadedGroup(tmpl, coalitionId) } + tm:parachuteTroops(mockTransport, + { unitName="UH-1H-1", groupId=9901, groupName="G", coalition=coalitionId }) + return onlySpawnedTypes() + end + + it("a blue group lands with the same types, in the same order, as unloaded on the ground", function() + local tmpl = registerTemplate({ name = "P322 Blue Mix", inf = 2, mg = 1, at = 1, aa = 1 }) + local expected = landedTypes(tmpl, 2) + assert.same(expected, parachutedTypes(tmpl, 2)) + assert.equals("Soldier stinger", expected[1]) + end) + + it("a red group resolves the red types", function() + local tmpl = registerTemplate({ name = "P322 Red Mix", inf = 1, mg = 1 }) + assert.same({ "Infantry AK", "Paratrooper AKS-74" }, parachutedTypes(tmpl, 1)) + end) + + it("a mortar squad lands as mortars with their servants, not as riflemen", function() + local tmpl = registerTemplate({ name = "P322 Mortar", mortar = 2 }) + local expected = landedTypes(tmpl, 2) + assert.same(expected, parachutedTypes(tmpl, 2)) + assert.equals("2B11 mortar", expected[1]) + end) + + it("a componentTypes override is honoured", function() + local tmpl = registerTemplate({ name = "P322 Custom", inf = 1, + componentTypes = { inf = { [1] = "Infantry AK Ins", [2] = "Soldier M4" } } }) + assert.same({ "Soldier M4" }, parachutedTypes(tmpl, 2)) + end) + + it("still lands generic infantry when the template is unknown", function() + tm._inTransit["UH-1H-1"] = { makeGroup("Unknown Template") } + tm:parachuteTroops(mockTransport, { unitName="UH-1H-1", groupId=9901, groupName="G", coalition=2 }) + assert.same({ "Soldier AK", "Soldier AK" }, onlySpawnedTypes()) + end) + + it("lases with the JTAC unit even when mortar servants come before it", function() + local tmpl = registerTemplate({ name = "P322 Mortar JTAC", mortar = 1, jtac = 1 }) + -- slots as embarkFromTroopZone numbers them: mortar = _u1, jtac = _u2 (servants not counted) + local jtacSlots = { [tmpl.name .. "_u2"] = true } + local lased = {} + local jm = CTLDJTACManager.getInstance() + local _origLase = jm.startLaseTroopUnit + jm.startLaseTroopUnit = function(_, unitName) table.insert(lased, unitName) end + Group.getByName = function(name) + local g = spawnedGroups[name] + if not g then return nil end + local units = {} + for _, u in ipairs(g.units) do + local uName, uType = u.name, u.type + table.insert(units, { + getName = function() return uName end, + getTypeName = function() return uType end, + isExist = function() return true end, + }) + end + return { + getName = function() return g.name end, + isExist = function() return true end, + getUnits = function() return units end, + } + end + + tm._inTransit["UH-1H-1"] = { loadedGroup(tmpl, 2, jtacSlots) } + local ok, err = pcall(tm.parachuteTroops, tm, mockTransport, + { unitName="UH-1H-1", groupId=9901, groupName="G", coalition=2 }) + jm.startLaseTroopUnit = _origLase + assert.is_true(ok, tostring(err)) + + local g = spawnedGroups[spawnedNames()[1]] + assert.equals(3, #g.units) -- mortar, servant, JTAC + assert.same({ g.units[3].name }, lased) + assert.equals("Soldier M4 GRG", g.units[3].type) + end) + + -- A field pickup recognises a servant by its "SVNT" prefix and a JTAC by its "JTAC" prefix + -- (_isServantUnitName, BUG-03/05): the parachuted units must carry them like the landed ones. + it("names a servant SVNT… and a JTAC JTAC…, and keeps every unit name unique", function() + local tmpl = registerTemplate({ name = "P322 Names", inf = 1, mortar = 1, jtac = 1 }) + tm._inTransit["UH-1H-1"] = { loadedGroup(tmpl, 2), loadedGroup(tmpl, 2) } + tm:parachuteTroops(mockTransport, { unitName="UH-1H-1", groupId=9901, groupName="G", coalition=2 }) + tm:parachuteTroops(mockTransport, { unitName="UH-1H-1", groupId=9901, groupName="G", coalition=2 }) + local seen = {} + for _, g in pairs(spawnedGroups) do + local u = g.units -- inf, mortar, servant, JTAC + assert.equals(4, #u) + assert.is_nil(u[1].name:match("^SVNT") or u[1].name:match("^JTAC")) + assert.is_nil(u[2].name:match("^SVNT") or u[2].name:match("^JTAC")) + assert.is_not_nil(u[3].name:match("^SVNT")) + assert.is_not_nil(u[4].name:match("^JTAC")) + for _, unit in ipairs(u) do + assert.is_nil(seen[unit.name]) + seen[unit.name] = true + end + end + end) + + end) + describe("spawn failure (coalition.addGroup raises)", function() local _origOutText, _origLog diff --git a/tests/ci/unit/aasystem_spec.lua b/tests/ci/unit/aasystem_spec.lua index 8c9b8194..71240af8 100644 --- a/tests/ci/unit/aasystem_spec.lua +++ b/tests/ci/unit/aasystem_spec.lua @@ -423,6 +423,8 @@ describe("CTLDCrateAssemblyManager _assemble publishes OnCrateCleared per consum getCoalition = function() return coalition.side.BLUE end, getCountry = function() return country.id.USA end, getName = function() return "test_heli" end, + getPlayerName = function() return nil end, + getTypeName = function() return "UH-1H" end, getGroup = function() return { getID = function() return 1 end } end, } end @@ -514,6 +516,8 @@ describe("CTLDCrateAssemblyManager _assemble destroys real crates found for NoCr getCoalition = function() return coalition.side.BLUE end, getCountry = function() return country.id.USA end, getName = function() return "test_heli" end, + getPlayerName = function() return nil end, + getTypeName = function() return "UH-1H" end, getGroup = function() return { getID = function() return 1 end } end, } end @@ -717,3 +721,56 @@ describe("baked AA crate catalogue", function() end) end) + +-- ───────────────────────────────────────────────────────────── +-- Issue #325: the group name was _CTLD_AA_; two systems of the same type spawned in the +-- same second shared it, and DCS replaces a group spawned under an existing name. +describe("CTLDCrateAssemblyManager:_spawnGroup — unique group name (#325)", function() + + local _origDynAdd, _origGetAbsTime, _origGetByName + local added + + before_each(function() + CTLDCrateAssemblyManager._instance = nil + added = {} + _origDynAdd, _origGetAbsTime, _origGetByName = ctld.utils.dynAdd, timer.getAbsTime, Group.getByName + ctld.utils.dynAdd = function(_, data) + added[#added + 1] = data + return { name = data.name } + end + timer.getAbsTime = function() return 43200.4 end + Group.getByName = function(name) return { getName = function() return name end } end + end) + + after_each(function() + ctld.utils.dynAdd, timer.getAbsTime, Group.getByName = _origDynAdd, _origGetAbsTime, _origGetByName + end) + + local function spawnHawk(m) + return m:_spawnGroup( + { { x = 0, y = 0, z = 0 }, { x = 10, y = 0, z = 0 } }, + { "Hawk ln", "Hawk sr" }, + { 0, 0 }, 2) + end + + it("gives two systems of the same type spawned in the same second two different group names", function() + local m = CTLDCrateAssemblyManager.getInstance() + local g1, g2 = spawnHawk(m), spawnHawk(m) + assert.equals(2, #added) + assert.not_equal(added[1].name, added[2].name) + assert.not_equal(g1:getName(), g2:getName()) + end) + + it("keeps the type and the CTLD_AA marker in the group name", function() + spawnHawk(CTLDCrateAssemblyManager.getInstance()) + assert.is_truthy(added[1].name:find("^Hawk ln_CTLD_AA_")) + end) + + it("shares the uid between the group name and its unit names", function() + spawnHawk(CTLDCrateAssemblyManager.getInstance()) + local uid = added[1].name:match("_(%d+)$") + assert.is_not_nil(uid) + assert.is_truthy(added[1].units[1].name:find("_" .. uid .. "$")) + end) + +end) diff --git a/tests/ci/unit/deploy_managers_spec.lua b/tests/ci/unit/deploy_managers_spec.lua index 8f769f23..c33ccf00 100644 --- a/tests/ci/unit/deploy_managers_spec.lua +++ b/tests/ci/unit/deploy_managers_spec.lua @@ -57,6 +57,8 @@ describe("CTLDCrateAssemblyManager assembly + repair", function() getCoalition = function() return coa or coalition.side.BLUE end, getCountry = function() return country.id.USA end, getName = function() return "heli_aa" end, + getPlayerName = function() return nil end, + getTypeName = function() return "UH-1H" end, getGroup = function() return { getID = function() return 1 end } end, } end diff --git a/tests/ci/unit/player_name_messages_spec.lua b/tests/ci/unit/player_name_messages_spec.lua new file mode 100644 index 00000000..337c5d69 --- /dev/null +++ b/tests/ci/unit/player_name_messages_spec.lua @@ -0,0 +1,251 @@ +---@diagnostic disable +-- FIX-VMCT-REVIEW-FINDINGS ticket 05 (issue #326): the coalition messages "%1 started building a FOB" and +-- the three AA "deployed / rearmed / repaired" messages name the player, else the unit's type name, as +-- v1's ctld.getPlayerNameOrType did. They showed the unit name. Event payloads are unchanged. +-- ============================================================ + +local function makeHeli(playerName) + return { + getPoint = function() return { x = 1000, y = 0, z = 2000 } end, + getPosition = function() + return { x = { x = 1, y = 0, z = 0 }, p = { x = 1000, y = 0, z = 2000 } } + end, + getCoalition = function() return coalition.side.BLUE end, + getCountry = function() return country.id.USA end, + getName = function() return "UH-1H-Slot-7" end, + getTypeName = function() return "UH-1H" end, + getPlayerName = function() return playerName end, + getGroup = function() return { getID = function() return 1 end } end, + isExist = function() return true end, + inAir = function() return false end, + } +end + +describe("ctld.utils.getPlayerNameOrType (#326)", function() + + it("returns the player's name when a player sits in the unit", function() + assert.equals("Zip", ctld.utils.getPlayerNameOrType(makeHeli("Zip"))) + end) + + it("returns the unit's type name for an AI unit", function() + assert.equals("UH-1H", ctld.utils.getPlayerNameOrType(makeHeli(nil))) + end) + + it("returns the type name when DCS gives an empty player name", function() + assert.equals("UH-1H", ctld.utils.getPlayerNameOrType(makeHeli(""))) + end) + +end) + +describe("coalition messages name the player (#326)", function() + + local origOutCoalition, origPublish + local texts, events + + local function saidContaining(fragment) + for _, t in ipairs(texts) do + if t:find(fragment, 1, true) then return true end + end + return false + end + + before_each(function() + texts, events = {}, {} + origOutCoalition = trigger.action.outTextForCoalition + trigger.action.outTextForCoalition = function(_, text) texts[#texts + 1] = text end + EventDispatcher._instance = nil + local ed = EventDispatcher.getInstance() + origPublish = ed.publish + ed.publish = function(self, name, payload) + events[name] = payload + return origPublish(self, name, payload) + end + end) + + after_each(function() + trigger.action.outTextForCoalition = origOutCoalition + EventDispatcher._instance = nil + end) + + -- ── FOB ─────────────────────────────────────────────────── + describe("FOB construction", function() + + local origGs, played + local fm, cm, sm, zm + local saved = {} + + before_each(function() + CTLDFOBManager._instance = nil + CTLDCrateManager._instance = nil + CTLDSceneManager._instance = nil + CTLDZoneManager._instance = nil + played = nil + origGs = ctld.gs + ctld.gs = function(k) + if k == "enabledFOBBuilding" then return true end + return origGs(k) + end + fm = CTLDFOBManager.getInstance() + cm = CTLDCrateManager.getInstance() + sm = CTLDSceneManager.getInstance() + zm = CTLDZoneManager.getInstance() + local crates = {} + for i = 1, 3 do + crates[i] = { crateName = "fob_c" .. i, coalition = coalition.side.BLUE, + descriptor = { unit = "FOB", cratesRequired = 3 } } + end + saved.getCratesInRange = cm.getCratesInRange + saved.destroyCrate = cm.destroyCrate + saved.getModel = sm.getModel + saved.playScene = sm.playScene + saved.lgzAt = zm.getLogisticZoneAtPoint + saved.lgzFor = zm.getLogisticZonesForCoalition + cm.getCratesInRange = function() return crates end + cm.destroyCrate = function() end + sm.getModel = function() return { crate = { cratesRequired = 3, fobCompatible = true } } end + sm.playScene = function(_, _, _, params) played = params end + zm.getLogisticZoneAtPoint = function() return nil end + zm.getLogisticZonesForCoalition = function() return {} end + end) + + after_each(function() + ctld.gs = origGs + cm.getCratesInRange, cm.destroyCrate = saved.getCratesInRange, saved.destroyCrate + sm.getModel, sm.playScene = saved.getModel, saved.playScene + zm.getLogisticZoneAtPoint, zm.getLogisticZonesForCoalition = saved.lgzAt, saved.lgzFor + CTLDFOBManager._instance = nil + CTLDCrateManager._instance = nil + CTLDSceneManager._instance = nil + CTLDZoneManager._instance = nil + end) + + it("names the player who started building", function() + fm:unpackFOBCrates(makeHeli("Zip"), "UH-1H-Slot-7", "FOB") + assert.is_true(saidContaining("Zip started building a FOB")) + end) + + it("names the type of an AI transport", function() + fm:unpackFOBCrates(makeHeli(nil), "UH-1H-Slot-7", "FOB") + assert.is_true(saidContaining("UH-1H started building a FOB")) + end) + + it("keeps the unit name as the scene's player parameter", function() + fm:unpackFOBCrates(makeHeli("Zip"), "UH-1H-Slot-7", "FOB") + assert.equals("UH-1H-Slot-7", played.player) + end) + + end) + + -- ── AA systems ──────────────────────────────────────────── + describe("AA systems", function() + + local m, cm, origGetHeading + local hawk + + local function findTemplate(name) + for _, t in ipairs(CTLDCrateAssemblyManager.TEMPLATES) do + if t.name == name then return t end + end + error("template not found: " .. name) + end + + local function liveUnit(typeName) + return { + getLife = function() return 1 end, + getTypeName = function() return typeName end, + getPoint = function() return { x = 1000, y = 0, z = 2000 } end, + } + end + + before_each(function() + CTLDCrateAssemblyManager._instance = nil + CTLDCrateManager._instance = nil + m = CTLDCrateAssemblyManager.getInstance() + cm = CTLDCrateManager.getInstance() + hawk = findTemplate("HAWK AA System") + m._spawnGroup = function() + return { getName = function() return "new_aa_group" end, getUnits = function() return {} end } + end + m._getDetails = function() return {} end + cm.destroyCrate = function() end + origGetHeading = ctld.utils.getHeadingInRadians + ctld.utils.getHeadingInRadians = function() return 0 end + end) + + after_each(function() + ctld.utils.getHeadingInRadians = origGetHeading + CTLDCrateManager._instance = nil + CTLDCrateAssemblyManager._instance = nil + end) + + local function assembleHawk(heli) + local allCrates, clicked, idx = {}, nil, 0 + for _, part in ipairs(hawk.parts) do + if not part.NoCrate then + idx = idx + 1 + local c = { + crateName = "hawk_c" .. idx, + position = { x = 1000 + idx, y = 0, z = 2000 + idx }, + coalition = coalition.side.BLUE, + descriptor = { unit = part.DCSTypename, cratesRequired = 1 }, + isOnGround = function() return true end, + destroy = function() end, + } + cm.crates[c.crateName] = c + allCrates[c.crateName] = c + if not part.launcher and not clicked then clicked = c end + end + end + m:_assemble(heli, clicked, allCrates, hawk, 500) + end + + local function nearHawkGroup() + local units = {} + for _, part in ipairs(hawk.parts) do units[#units + 1] = liveUnit(part.DCSTypename) end + local grp = { + getName = function() return "old_aa_group" end, + getUnits = function() return units end, + destroy = function() end, + } + m._completeSystems["old_aa_group"] = { details = {}, template = hawk } + m._findNearest = function() return { dist = 0, group = grp } end + end + + it("a deployed system names the player, an AI deployment the type", function() + assembleHawk(makeHeli("Zip")) + assert.is_true(saidContaining("Zip successfully deployed a full HAWK AA System")) + texts = {} + assembleHawk(makeHeli(nil)) + assert.is_true(saidContaining("UH-1H successfully deployed a full HAWK AA System")) + end) + + it("a rearmed system names the player, or the type", function() + nearHawkGroup() + m:_rearm(makeHeli("Zip"), { crateName = "launcher" }, {}, hawk) + assert.is_true(saidContaining("Zip successfully rearmed a full HAWK AA System")) + texts = {} + nearHawkGroup() + m:_rearm(makeHeli(nil), { crateName = "launcher" }, {}, hawk) + assert.is_true(saidContaining("UH-1H successfully rearmed a full HAWK AA System")) + end) + + it("a repaired system names the player, or the type", function() + nearHawkGroup() + m:_repair(makeHeli("Zip"), { crateName = "repair" }, hawk) + assert.is_true(saidContaining("Zip successfully repaired a full HAWK AA System")) + texts = {} + nearHawkGroup() + m:_repair(makeHeli(nil), { crateName = "repair" }, hawk) + assert.is_true(saidContaining("UH-1H successfully repaired a full HAWK AA System")) + end) + + it("leaves the event payloads unchanged: heli is still the unit", function() + local heli = makeHeli("Zip") + nearHawkGroup() + m:_repair(heli, { crateName = "repair" }, hawk) + assert.equals(heli, events["OnAASystemRepaired"].heli) + end) + + end) + +end) diff --git a/tests/ci/unit/zone_manager_spec.lua b/tests/ci/unit/zone_manager_spec.lua index f7c95683..a08241df 100644 --- a/tests/ci/unit/zone_manager_spec.lua +++ b/tests/ci/unit/zone_manager_spec.lua @@ -796,3 +796,74 @@ describe("CTLDZoneManager _validateZoneNames startup report (STARTUP-REPORT-UNIF end) end) + +-- ───────────────────────────────────────────────────────────── +-- Issue #323: `(data.active ~= nil) and data.active or true` never let `false` through. +describe("zone active flag at load (#323)", function() + + local _origGs, _origGetZone + + local function loadLegacy(troopZones, wpZones) + local zm = setmetatable({ _troopZones = {}, _logisticZones = {} }, CTLDZoneManager) + ctld.gs = function(k) + if k == "troopZones" then return troopZones end + if k == "wpZones" then return wpZones end + if k == "logisticUnits" then return {} end + return _origGs(k) + end + zm:_loadLegacyZones() + return zm + end + + before_each(function() + _origGs = ctld.gs + _origGetZone = trigger.misc.getZone + trigger.misc.getZone = function(_) + return { point = { x = 0, y = 0, z = 0 }, radius = 100 } + end + end) + + after_each(function() + ctld.gs = _origGs + trigger.misc.getZone = _origGetZone + end) + + it("a troopZones entry marked \"no\" loads inactive, and activate() opens it", function() + local zm = loadLegacy({ { "pickzone1", "blue", -1, "no", 2 } }, {}) + local z = zm._troopZones["pickzone1"] + assert.is_false(z.active) + z:activate() + assert.is_true(z.active) + end) + + it("a wpZones entry marked \"no\" loads inactive, and activate() opens it", function() + local zm = loadLegacy({}, { { "wpzone1", "none", "no", 2 } }) + local z = zm._troopZones["wpzone1"] + assert.is_false(z.active) + z:activate() + assert.is_true(z.active) + end) + + it("entries marked \"yes\" still load active", function() + local zm = loadLegacy({ { "pickzone2", "blue", -1, "yes", 2 } }, { { "wpzone2", "none", "yes", 2 } }) + assert.is_true(zm._troopZones["pickzone2"].active) + assert.is_true(zm._troopZones["wpzone2"].active) + end) + + it("a troop zone built without an active field is active", function() + local z = CTLDTroopZone:new({ dcsName = "Z", zoneName = "Z", coalition = 2, + center = { x = 0, y = 0, z = 0 }, radius = 10 }) + assert.is_true(z.active) + end) + + it("a logistic zone keeps active = false, and stays active when absent or true", function() + local base = { name = "L", coalition = 2, center = { x = 0, y = 0, z = 0 }, radius = 10 } + local off = CTLDLogisticZone:new({ name = "L0", coalition = 2, center = base.center, radius = 10, active = false }) + local on = CTLDLogisticZone:new({ name = "L1", coalition = 2, center = base.center, radius = 10, active = true }) + local def = CTLDLogisticZone:new(base) + assert.is_false(off.active) + assert.is_true(on.active) + assert.is_true(def.active) + end) + +end) diff --git a/tests/dcs/noPlayer/scenario_vmct_review_findings.lua b/tests/dcs/noPlayer/scenario_vmct_review_findings.lua new file mode 100644 index 00000000..30f33403 --- /dev/null +++ b/tests/dcs/noPlayer/scenario_vmct_review_findings.lua @@ -0,0 +1,265 @@ +---@diagnostic disable +-- @tier: auto-check +-- ============================================================================= +-- VRF — FIX-VMCT-REVIEW-FINDINGS live check (ticket 06). +-- +-- 1. #322 parachute : a blue Standard Group and a blue Mortar Squad parachuted from a mock transport land +-- with their template's types, in order (not "Soldier AK"); the mortars keep their servants. +-- 2. #324 repair : "HAWK Repair" requested through the real Request Equipment menu callback, in a +-- temporary logistic zone, brings its crate out (no "Request failed"). +-- 3. #325 AA names : two HAWK systems spawned in the same second both exist, under two group names. +-- +-- The transport is a MOCK 3 km from the first BLUE player, so nothing is created next to a live aircraft. +-- Everything created is cleaned up at the end (groups, crates, the temporary zone, the mock's menu). +-- +-- Result: _SCN_VRF_RESULT ("[VRF] PASS n/n" | "[VRF] FAIL ..." | "[VRF] ABORT ...") +-- ============================================================================= + +if not ctld or not ctld.utils then + _SCN_VRF_RESULT = "[VRF] ABORT: CTLD not initialized" + return _SCN_VRF_RESULT +end +if _SCN_VRF_RUNNING then return _SCN_VRF_RESULT or "[VRF] RUNNING" end +_SCN_VRF_RUNNING = true +_SCN_VRF_RESULT = "[VRF] STARTED" + +do +local TAG = "[VRF]" +local MOCK = "VRF_mock_transport" +local GROUP_ID = 9999998 +local BLUE = coalition.side.BLUE +local LGZ = "VRF_temp_logistics" +local passed, failed, reasons = 0, 0, {} + +local function log(fmt, ...) ctld.utils.log("INFO", "%s " .. fmt, TAG, ...) end +local function check(id, ok, msg) + if ok then passed = passed + 1; log("PASS %s", id) + else failed = failed + 1; reasons[#reasons + 1] = id .. ": " .. msg; log("FAIL %s — %s", id, msg) end +end + +local cm = CTLDCrateManager.getInstance() +local tm = CTLDTroopManager.getInstance() +local aam = CTLDCrateAssemblyManager.getInstance() +local zm = CTLDZoneManager.getInstance() +local ed = EventDispatcher.getInstance() + +local player = coalition.getPlayers(BLUE)[1] +if not player then + _SCN_VRF_RUNNING = false + _SCN_VRF_RESULT = "[VRF] ABORT: no BLUE player" + return _SCN_VRF_RESULT +end + +-- Site: 3 km from the player. The mock flies 250 m above it for the parachute, then lands for the request. +local pp = player:getPoint() +local S = { x = pp.x, z = pp.z + 3000 } +S.y = land.getHeight({ x = S.x, y = S.z }) +local pt = { x = S.x, y = S.y + 250, z = S.z } +local airborne = true + +local mock = { + getName = function() return MOCK end, + isExist = function() return true end, + getCoalition = function() return BLUE end, + getCountry = function() return country.id.USA end, + getTypeName = function() return "UH-1H" end, + getPlayerName = function() return nil end, + getPoint = function() return pt end, + getVelocity = function() return { x = 0, y = 0, z = 0 } end, + getGroup = function() return { getID = function() return GROUP_ID end, getName = function() return "VRF_mock_group" end } end, + inAir = function() return airborne end, + getDesc = function() return { box = { min = { x = -8.86, y = -1.63, z = -1.59 }, max = { x = 3.95, y = 1.59, z = 1.56 } } } end, + getPosition = function() + return { p = pt, x = { x = 1, y = 0, z = 0 }, y = { x = 0, y = 1, z = 0 }, z = { x = 0, y = 0, z = 1 } } + end, +} +local origGetByName = Unit.getByName +Unit.getByName = function(n) if n == MOCK then return mock end return origGetByName(n) end +local origInAir = ctld.utils.inAir +ctld.utils.inAir = function(u) if u == mock then return airborne end return origInAir(u) end + +local landed, subs = {}, {} +local function onLanded(p) landed[#landed + 1] = p end +ed:subscribe("OnTroopsParachuteLanded", onLanded) +subs[#subs + 1] = { name = "OnTroopsParachuteLanded", cb = onLanded } + +local aaGroups = {} + +local function finish() + for _, s in ipairs(subs) do ed:unsubscribe(s.name, s.cb) end + for _, c in pairs(cm.crates) do + if c.spawnedBy == MOCK or (c.position and math.abs(c.position.x - S.x) < 600 and math.abs(c.position.z - S.z) < 600) then + cm:destroyCrate(c.crateName) + end + end + for _, g in ipairs(coalition.getGroups(BLUE, Group.Category.GROUND) or {}) do + local u = g:getUnit(1) + if u then + local p = u:getPoint() + if math.abs(p.x - S.x) < 600 and math.abs(p.z - S.z) < 600 then + aam._completeSystems[g:getName()] = nil + g:destroy() + end + end + end + for _, n in ipairs(aaGroups) do aam._completeSystems[n] = nil end + zm._logisticZones[LGZ] = nil + pcall(function() ctld.MenuManager:getInstance():teardownGroup(GROUP_ID) end) + tm._inTransit[MOCK] = nil + Unit.getByName = origGetByName + ctld.utils.inAir = origInAir + _SCN_VRF_RUNNING = false + if failed == 0 then + _SCN_VRF_RESULT = string.format("%s PASS %d/%d", TAG, passed, passed) + else + _SCN_VRF_RESULT = string.format("%s FAIL %d/%d: %s", TAG, failed, passed + failed, table.concat(reasons, " | ")) + end + trigger.action.outText(_SCN_VRF_RESULT, 15) + log("%s", _SCN_VRF_RESULT) +end + +local function step(fn, delay) + timer.scheduleFunction(function() + local ok, err = pcall(fn) + if not ok then + failed = failed + 1 + reasons[#reasons + 1] = "error: " .. tostring(err) + log("ERROR in step: %s", tostring(err)) + finish() + end + end, nil, timer.getTime() + (delay or 2)) +end + +-- ── helpers ────────────────────────────────────────────────────────────────── +local function template(name) + for _, t in ipairs(tm._templates or {}) do if t.name == name then return t end end +end + +local function expectedTypes(tmpl) + local out = {} + for _, u in ipairs(CTLDObjectRegistry._db[tmpl._dbKey].units) do + out[#out + 1] = type(u.unitType) == "function" and u.unitType(BLUE) or u.unitType + end + return out +end + +local function load(tmpl) + local troopGroup = CTLDTroopGroup:new({ + templateKey = tmpl._dbKey, templateName = tmpl.name, unitTotal = tmpl.total, + weight = 100 * tmpl.total, coalitionId = BLUE, countryId = country.id.USA, + state = CTLDTroopGroup.STATE.TRZ_LOADED, _aliveUnits = {}, _jtacUnits = {}, + specificParams = tmpl.specificParams or {}, + }) + tm._inTransit[MOCK] = tm._inTransit[MOCK] or {} + table.insert(tm._inTransit[MOCK], troopGroup) +end + +local function spawnedTypes(groupName) + local g = Group.getByName(groupName) + if not g then return nil end + local out = {} + for _, u in ipairs(g:getUnits() or {}) do out[#out + 1] = u:getTypeName() end + return out +end + +local function sameList(a, b) + if not a or not b or #a ~= #b then return false end + for i = 1, #a do if a[i] ~= b[i] then return false end end + return true +end + +-- ── 1. #322 parachute ──────────────────────────────────────────────────────── +local std, mortar = template("Standard Group"), template("Mortar Squad") +check("1.0 templates found", std ~= nil and mortar ~= nil, "Standard Group / Mortar Squad not in the templates") +local wantStd, wantMortar = expectedTypes(std), expectedTypes(mortar) +log("expected Standard Group: %s", table.concat(wantStd, ", ")) +log("expected Mortar Squad: %s", table.concat(wantMortar, ", ")) +load(std) +load(mortar) +local playerObj = { unitName = MOCK, groupId = GROUP_ID, groupName = "VRF_mock_group", coalition = BLUE } +tm:parachuteTroops(mock, playerObj) +tm:parachuteTroops(mock, playerObj) + +local waited = 0 +local function afterLanding() + if #landed < 2 and waited < 120 then + waited = waited + 5 + step(afterLanding, 5) + return + end + check("1.1 both groups landed", #landed == 2, #landed .. " landing(s) after " .. waited .. " s") + for _, p in ipairs(landed) do + local gname = p.spawnedGroup and p.spawnedGroup:getName() + local got = gname and spawnedTypes(gname) + local want = p.troops.templateName == "Standard Group" and wantStd or wantMortar + log("landed %s (%s): %s", tostring(p.troops.templateName), tostring(gname), got and table.concat(got, ", ") or "nil") + check("1.2 " .. p.troops.templateName .. " lands with its template's types", sameList(want, got), + "got " .. (got and table.concat(got, ", ") or "nil")) + end + + -- ── 2. #324 HAWK Repair through the real menu callback ────────────────── + airborne = false + pt = { x = S.x, y = S.y, z = S.z } + zm._logisticZones[LGZ] = CTLDLogisticZone:new({ + name = LGZ, coalition = BLUE, center = { x = S.x, y = S.y, z = S.z }, radius = 300, active = true, + }) + CTLDPlayerManager.getInstance():buildMenu({ + unitName = MOCK, groupId = GROUP_ID, groupName = "VRF_mock_group", coalition = BLUE, + typeName = "UH-1H", isTransport = true, canCarryVehicles = false, + }) + local menu = ctld.MenuManager:getInstance():getMenuByGroupId(GROUP_ID) + local function find(node) + if node.type == "command" then + local a = node.anyArgument + if type(a) == "table" and type(a.desc) == "string" and a.desc:find("HAWK Repair", 1, true) == 1 + and a.zoneName == LGZ then return node end + return nil + end + for _, c in ipairs(node.children or {}) do local f = find(c); if f then return f end end + end + local root = menu and menu:_getNode({ ctld.tr("CTLD"), ctld.tr("Request Equipment") }) + local cmd = root and find(root) + check("2.0 Request Equipment lists HAWK Repair in the temporary zone", cmd ~= nil, "no such menu entry") + if cmd then + local before = {} + for n in pairs(cm.crates) do before[n] = true end + cmd.functionToCall(cmd.anyArgument) + local newCrate + for n, c in pairs(cm.crates) do if not before[n] then newCrate = c end end + check("2.1 a HAWK Repair crate was brought out", newCrate ~= nil and newCrate.descriptor + and newCrate.descriptor._repairFor == "HAWK AA System", + "new crate: " .. tostring(newCrate and newCrate.descriptor and newCrate.descriptor.desc)) + step(function() + local s = newCrate and StaticObject.getByName(newCrate.crateName) + check("2.2 the crate is a DCS static", s ~= nil and s:isExist(), "no DCS static for the crate") + + -- ── 3. #325 two HAWKs in the same second ───────────────────────── + local before3 = {} + for n in pairs(aam._completeSystems) do before3[n] = true end + local t0 = timer.getAbsTime() + local ok1 = aam:spawnSystemAt("HAWK AA System", { x = S.x + 150, y = S.y, z = S.z + 150 }, BLUE, country.id.USA) + local ok2 = aam:spawnSystemAt("HAWK AA System", { x = S.x - 150, y = S.y, z = S.z - 150 }, BLUE, country.id.USA) + check("3.0 both spawns accepted in the same second", ok1 and ok2 and math.floor(timer.getAbsTime()) == math.floor(t0), + "ok1=" .. tostring(ok1) .. " ok2=" .. tostring(ok2)) + for n in pairs(aam._completeSystems) do if not before3[n] then aaGroups[#aaGroups + 1] = n end end + log("AA groups: %s", table.concat(aaGroups, ", ")) + step(function() + check("3.1 two distinct group names", #aaGroups == 2 and aaGroups[1] ~= aaGroups[2], + #aaGroups .. " new system(s)") + local alive = 0 + for _, n in ipairs(aaGroups) do + local g = Group.getByName(n) + if g and g:isExist() and #(g:getUnits() or {}) > 0 then alive = alive + 1 end + end + check("3.2 both systems exist in the world", alive == 2, alive .. " of 2 alive") + finish() + end) + end) + else + finish() + end +end +step(afterLanding, 5) + +return _SCN_VRF_RESULT +end diff --git a/tests/dcs/pilotActive/scenario_fatcow_spike.lua b/tests/dcs/pilotActive/scenario_fatcow_spike.lua index dc7b4484..a5fcd6d0 100644 --- a/tests/dcs/pilotActive/scenario_fatcow_spike.lua +++ b/tests/dcs/pilotActive/scenario_fatcow_spike.lua @@ -8,7 +8,7 @@ -- Embedded in missions/Test_FatCow_Spike.miz (mission start trigger), or injected -- over dcs-bridge in any mission with a player helicopter. -- --- Questions (see .backlog/FEAT-FAT-COW/tickets/01-spike-runtime-farp.md): +-- Questions (see .backlog/archive/FEAT-FAT-COW.md, ticket 01-spike-runtime-farp): -- (a) does a FARP spawned mid-mission refuel/rearm a player already in game? -- (b) is a finite warehouse stock respected, and seen identically by the server -- and by a client (rearm window)?