@chrischall/warapp-mcp 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +99 -6
  4. package/dist/analysis/accept-surrender.js +20 -2
  5. package/dist/analysis/calibrate.js +1 -0
  6. package/dist/analysis/card-support.js +175 -16
  7. package/dist/analysis/card-threats.js +68 -3
  8. package/dist/analysis/chat-advice.js +182 -0
  9. package/dist/analysis/chat-blocks.js +106 -0
  10. package/dist/analysis/chat-intent.js +559 -0
  11. package/dist/analysis/chat-read.js +159 -0
  12. package/dist/analysis/decision-replay.js +279 -0
  13. package/dist/analysis/decision-truth.js +146 -0
  14. package/dist/analysis/finished-game.js +62 -3
  15. package/dist/analysis/game-lessons.js +12 -6
  16. package/dist/analysis/opponent-profile.js +46 -3
  17. package/dist/analysis/opponents.js +245 -19
  18. package/dist/analysis/outlook.js +323 -17
  19. package/dist/analysis/plan/after-leftover.js +4 -1
  20. package/dist/analysis/plan/captures.js +4 -3
  21. package/dist/analysis/plan/estimates.js +70 -6
  22. package/dist/analysis/plan/guard-off.js +2 -1
  23. package/dist/analysis/plan/holds.js +79 -6
  24. package/dist/analysis/plan/leftover.js +145 -5
  25. package/dist/analysis/plan/relations.js +115 -2
  26. package/dist/analysis/plan/shared.js +201 -11
  27. package/dist/analysis/plan/stand-still.js +2 -2
  28. package/dist/analysis/plan/stockpile.js +104 -0
  29. package/dist/analysis/plan/strike.js +34 -7
  30. package/dist/analysis/plan/targets.js +168 -53
  31. package/dist/analysis/plan/threats.js +108 -5
  32. package/dist/analysis/plan/transfers.js +11 -0
  33. package/dist/analysis/plan/two-move.js +70 -0
  34. package/dist/analysis/plan/vacated.js +124 -2
  35. package/dist/analysis/planner.js +302 -42
  36. package/dist/analysis/since-last.js +18 -5
  37. package/dist/board.js +36 -2
  38. package/dist/build-id.js +106 -0
  39. package/dist/bundle.js +14943 -10146
  40. package/dist/chat-automation.js +22 -0
  41. package/dist/client.js +14 -0
  42. package/dist/decision-log.js +1093 -0
  43. package/dist/finished-store.js +5 -1
  44. package/dist/lessons-store.js +322 -21
  45. package/dist/open-games.js +36 -16
  46. package/dist/outlook-log.js +42 -1
  47. package/dist/protocol/methods.js +4 -2
  48. package/dist/review-export.js +198 -0
  49. package/dist/state-bundle.js +62 -3
  50. package/dist/state-cli.js +5 -3
  51. package/dist/strategy/notes.js +56 -0
  52. package/dist/tools/accept-surrender.js +23 -9
  53. package/dist/tools/award.js +5 -1
  54. package/dist/tools/card-advice.js +77 -23
  55. package/dist/tools/card-support-advice.js +36 -7
  56. package/dist/tools/chat-advice.js +330 -0
  57. package/dist/tools/chat-inbox.js +15 -4
  58. package/dist/tools/chat.js +41 -11
  59. package/dist/tools/check-plan.js +14 -2
  60. package/dist/tools/decision-capture.js +459 -0
  61. package/dist/tools/end-of-game.js +146 -18
  62. package/dist/tools/game-kind.js +92 -0
  63. package/dist/tools/how-lost.js +7 -2
  64. package/dist/tools/index.js +3 -0
  65. package/dist/tools/join-game.js +10 -4
  66. package/dist/tools/live-context.js +6 -0
  67. package/dist/tools/live.js +10 -1
  68. package/dist/tools/map-curves.js +73 -0
  69. package/dist/tools/notifications.js +4 -3
  70. package/dist/tools/opponents.js +2 -0
  71. package/dist/tools/past-games.js +74 -8
  72. package/dist/tools/picks.js +49 -10
  73. package/dist/tools/profile-hook.js +62 -3
  74. package/dist/tools/profile-opponents.js +2 -0
  75. package/dist/tools/push.js +2 -2
  76. package/dist/tools/relations.js +2 -0
  77. package/dist/tools/scout.js +16 -2
  78. package/dist/tools/state.js +6 -1
  79. package/dist/tools/strategy.js +3 -3
  80. package/dist/tools/stress-opponents.js +2 -0
  81. package/dist/tools/surrender-pending.js +10 -1
  82. package/dist/tools/surrender.js +18 -3
  83. package/dist/tools/turn.js +313 -18
  84. package/dist/tools/where.js +3 -1
  85. package/dist/version.js +1 -1
  86. package/manifest.json +23 -2
  87. package/mint.yaml +23 -0
  88. package/package.json +1 -1
  89. package/server.json +20 -2
  90. package/skills/warapp-mcp/SKILL.md +42 -8
@@ -83,6 +83,27 @@
83
83
  // LOW_COVERAGE, or none measured, under fog is thin evidence, and the basis says "even" is then not safe.
84
84
  // Reporting only: the state never reads it.
85
85
  //
86
+ // #436 (owner decision of 2026-11-20): the outlook follows both incomes and their trend. Each turn reads my
87
+ // side's income against the strongest opponent side's income (`income`): its range under fog — `low` the
88
+ // income the tracker reads (its visible income at least), `high` the most the likely high lets it earn a turn
89
+ // while its frontier read is thin (else `low`) — and its ESTIMATE, the tracked figure divided by the
90
+ // estimate ÷ truth past games measured in its coverage band (`calibration`, from lessons.json, a band with
91
+ // at least MIN_CALIBRATION_SAMPLES), never below its visible income; uncalibrated, the tracked figure. Its
92
+ // lean: `unknown` when the range spans both thresholds (mine ÷ high at most INCOME_BEHIND_RATIO and mine ÷
93
+ // low at least INCOME_AHEAD_RATIO), `behind` / `ahead` when the whole range, else the estimate, is past one,
94
+ // else `even` — unless each side's income, moved one more turn at its change per turn over the turns judged
95
+ // (`trend`), crosses a threshold the ratio is already heading to (`byTrend`). No lead is claimed at low
96
+ // coverage (any opponent's evidence thin, #304): an `ahead` lean reads `unknown`, and a win on the likely
97
+ // high alone is not read (`noLeadClaim`); a win on the bound still is. #454: the state keeps its four values
98
+ // (winning, losing, even, stalemate — the tool contract); a lean (`ahead`, `behind` or `unknown`) beside an
99
+ // `even` state rides in the additive `lean` field, per turn and on the outlook, and every internal reader of the
100
+ // finer reading uses {@link readingOf}; the planner acts on winning and losing only (#201). `pace` is the income line: both incomes and
101
+ // their change per turn over the turns judged. `surrenderLine` is ADVICE ONLY (the server never acts on it):
102
+ // crossed when my income stayed under INCOME_BEHIND_RATIO × the strongest's estimate for SURRENDER_TURNS
103
+ // consecutive turns and no bonus in reach closes the gap (`bonusesInReach`: a positive bonus I do not hold
104
+ // whose every missing member borders my land and whose visible defenders are fewer than my armies beside them
105
+ // plus my income; it closes the gap when my income plus its value reaches the line).
106
+ //
86
107
  // OUTLOOK_RATIO (2.4×) is borrowed from a published bot's "lost" rule and has never been measured
87
108
  // for war.app: the outlook is a basis for a decision, not a verdict. The planner acts on it in one
88
109
  // way only (#201): once winning or losing, its payback tests count the turns the game has left.
@@ -99,6 +120,7 @@ import { BEHIND_RATIO, STRENGTH_INCOME_TURNS } from './profile.js';
99
120
  import { FORECAST_TURNS, forecastBorder, mainFront } from './exchange.js';
100
121
  import { specialUnitStrength } from './combat.js';
101
122
  import { coverageText, LOW_COVERAGE } from './plan/shared.js';
123
+ import { coverageBucket } from './game-lessons.js';
102
124
  /** Turns a state must hold before it is reported. */
103
125
  export const OUTLOOK_TURNS = 3;
104
126
  /** Winning at this strength ratio or more, losing at its inverse or less (borrowed, unmeasured). */
@@ -121,6 +143,30 @@ export const LIKELY_LOSING_RATIO = 1 / (OUTLOOK_RATIO * LIKELY_INCOME_MARGIN);
121
143
  export function peerPace(p) {
122
144
  return Math.max(p.floor ?? 0, Math.min(p.ceiling, Math.max(p.base, LIKELY_INCOME_MARGIN * Math.max(p.mine, p.peers))));
123
145
  }
146
+ const STATES = new Set(['winning', 'losing', 'even', 'stalemate']);
147
+ const LEANS = new Set(['ahead', 'behind', 'unknown']);
148
+ /** #454: the finer reading of a state and its lean (`null`: no state). */
149
+ export function readingOf(o) {
150
+ return o.lean ?? o.state;
151
+ }
152
+ /**
153
+ * #454: a reading split back into the contract's state and the additive lean. #453 wrote the lean as the state
154
+ * for a few hours (outlook log, decision log, finished records): `ahead`, `behind` and `unknown` read as `even`
155
+ * — exact, since a lean only ever replaced an even state — with that lean. An unrecognised value reads `null`.
156
+ */
157
+ export function splitReading(r) {
158
+ if (typeof r === 'string' && LEANS.has(r))
159
+ return { state: 'even', lean: r };
160
+ return { state: typeof r === 'string' && STATES.has(r) ? r : null };
161
+ }
162
+ /** #436: behind on incomes at this share of the strongest opponent's or less — the owner's surrender line (two-thirds). */
163
+ export const INCOME_BEHIND_RATIO = 2 / 3;
164
+ /** #436: ahead on incomes at this multiple of the strongest opponent's or more (the line's inverse). */
165
+ export const INCOME_AHEAD_RATIO = 1.5;
166
+ /** #436: consecutive turns under the line before the surrender line is crossed (owner). */
167
+ export const SURRENDER_TURNS = 3;
168
+ /** #436: the samples a coverage band needs before its estimate ÷ truth calibrates an estimate (unmeasured). */
169
+ export const MIN_CALIBRATION_SAMPLES = 5;
124
170
  const round2 = (n) => Math.round(n * 100) / 100;
125
171
  /** The armies the special units on a territory fight as (commanders), as the planner counts them. */
126
172
  const unitsOn = (b, id) => specialUnitStrength(b.territories.find((t) => t.territoryId === id)?.specialUnits);
@@ -341,14 +387,15 @@ export function gameOutlook(input) {
341
387
  const seen = { armies: a, income };
342
388
  const none = { likely: undefined, source: undefined, why: undefined };
343
389
  if (open)
344
- return { playerId, low, high: low, seen, ...none };
390
+ return { playerId, low, high: low, seen, paceIncome: income, capIncome: income, ...none };
391
+ // #436: the most it could earn this turn (never below what it visibly earns): no income estimate exceeds it.
392
+ const cap = Math.max(income, turnCap(turn, playerId));
345
393
  if (start === null || likelyStart === null || cardsBound === undefined)
346
- return { playerId, low, high: null, seen, ...none };
394
+ return { playerId, low, high: null, seen, paceIncome: cap, capIncome: cap, ...none };
347
395
  // Each turn's could-earn cap: from that turn's board when I have it, else the ceiling.
348
396
  let received = start;
349
397
  for (let t = 1; t <= turn; t++)
350
398
  received += turnCap(t, playerId);
351
- const cap = Math.max(income, turnCap(turn, playerId));
352
399
  // Cards: what the clock lets it have played by now, and over the next k turns.
353
400
  const now = cardsBound ? cardArmiesBy(cardsBound, turn) : 0;
354
401
  const ahead = cardsBound ? cardArmiesBy(cardsBound, turn + k) - now : 0;
@@ -378,7 +425,9 @@ export function gameOutlook(input) {
378
425
  for (let t = last.turn + 1; t <= turn; t++)
379
426
  since += Math.min(turnCap(t, playerId), paceAt(t));
380
427
  const likely = Math.max(a, likelyReceived + now, since) + k * Math.max(income, last?.income ?? 0, Math.min(cap, pace)) + ahead;
381
- return { playerId, low, high, seen, likely: Math.min(high, Math.max(low, likely)), source, why };
428
+ // #436: the most it likely earns a turn, as the likely high counts it.
429
+ const paceIncome = Math.max(income, last?.income ?? 0, Math.min(cap, pace));
430
+ return { playerId, low, high, seen, paceIncome, capIncome: cap, likely: Math.min(high, Math.max(low, likely)), source, why };
382
431
  });
383
432
  // PLAN-TEAMS C3: an enemy team is one side, its figures summed; elsewhere a side is a player.
384
433
  const teamOf = (p) => {
@@ -567,6 +616,96 @@ export function gameOutlook(input) {
567
616
  opponents: evidenceRows,
568
617
  thin: evidenceRows.some((r) => r.thin),
569
618
  };
619
+ // #436: each opponent's income range and estimate, summed per side; the strongest side by estimate.
620
+ const calibrationFor = (share) => {
621
+ const c = input.calibration?.[coverageBucket(share)];
622
+ return c && c.n >= MIN_CALIBRATION_SAMPLES && c.geoMean > 0 ? c.geoMean : undefined;
623
+ };
624
+ const incomeSides = new Map();
625
+ for (const r of rows) {
626
+ const tr = trackedOf(r.playerId);
627
+ const row = evidenceRows.find((x) => x.playerId === r.playerId);
628
+ const low = row.income;
629
+ const factor = tr?.income != null ? calibrationFor(tr.coverage?.share ?? null) : undefined;
630
+ // The calibrated estimate and the top of the range never pass what it could earn this turn (`capIncome`, the
631
+ // bound `paceIncome` keeps to): dividing a low-coverage reading by ~0.3 must not read an income it cannot reach.
632
+ const capped = (n) => Math.min(Math.max(r.capIncome, low), n);
633
+ const estimate = open ? low : factor !== undefined ? capped(Math.max(r.seen.income, Math.round(tr.income / factor))) : low;
634
+ const high = open ? low : capped(Math.max(estimate, low, row.thin ? r.paceIncome : low));
635
+ const t = teamOf(r.playerId);
636
+ const key = t === undefined ? `p${r.playerId}` : `t${t}`;
637
+ const side = incomeSides.get(key);
638
+ if (!side)
639
+ incomeSides.set(key, {
640
+ playerId: r.playerId,
641
+ ...(t !== undefined ? { team: t, players: [r.playerId] } : {}),
642
+ low: Math.min(low, estimate),
643
+ high,
644
+ estimate,
645
+ calibrated: factor !== undefined,
646
+ });
647
+ else {
648
+ side.low += Math.min(low, estimate);
649
+ side.high += high;
650
+ side.estimate += estimate;
651
+ side.calibrated ||= factor !== undefined;
652
+ side.players.push(r.playerId);
653
+ }
654
+ }
655
+ const theirs = [...incomeSides.values()].sort((a, b) => b.estimate - a.estimate || b.high - a.high || a.playerId - b.playerId)[0];
656
+ const income = theirs
657
+ ? {
658
+ mine: myNow,
659
+ theirs: {
660
+ playerId: theirs.playerId,
661
+ ...(theirs.team !== undefined ? { team: theirs.team, players: theirs.players } : {}),
662
+ low: theirs.low,
663
+ high: theirs.high,
664
+ estimate: theirs.estimate,
665
+ },
666
+ ratio: {
667
+ low: theirs.high > 0 ? round2(myNow / theirs.high) : null,
668
+ high: theirs.low > 0 ? round2(myNow / theirs.low) : null,
669
+ estimate: theirs.estimate > 0 ? round2(myNow / theirs.estimate) : null,
670
+ },
671
+ calibrated: theirs.calibrated,
672
+ lean: 'even',
673
+ }
674
+ : undefined;
675
+ // #436: the bonuses I could complete next turn (the latest turn only: the surrender line reads them).
676
+ const bonusesInReach = [];
677
+ if (turn === run.at(-1)) {
678
+ const side = new Set([me, ...mates]);
679
+ const ownerOfT = (id) => ownerById.get(id);
680
+ const isMine = (id) => {
681
+ const o = ownerOfT(id);
682
+ return o?.kind === 'player' && side.has(o.playerId);
683
+ };
684
+ for (const bonus of [...g.bonusById.values()].sort((a, b) => a.id - b.id)) {
685
+ if (bonus.value <= 0)
686
+ continue;
687
+ const ts = bonusTerritories(g, bonus.id);
688
+ const missing = ts.filter((t) => !isMine(t));
689
+ if (!ts.length || !missing.length)
690
+ continue;
691
+ const beside = new Set();
692
+ let reachable = true;
693
+ for (const t of missing) {
694
+ const mineNext = neighborsOf(g, t).filter(isMine);
695
+ if (!mineNext.length)
696
+ reachable = false;
697
+ for (const n of mineNext)
698
+ beside.add(n);
699
+ }
700
+ if (!reachable)
701
+ continue;
702
+ const defenders = missing.reduce((n, t) => n + (armiesById.get(t) ?? 0) + unitsOn(board, t), 0);
703
+ const attackers = [...beside].reduce((n, t) => n + (armiesById.get(t) ?? 0), 0) + myNow;
704
+ if (defenders < attackers)
705
+ bonusesInReach.push({ bonus: bonus.id, value: bonus.value, defenders });
706
+ }
707
+ bonusesInReach.sort((a, b) => b.value - a.value || a.bonus - b.bonus);
708
+ }
570
709
  // #368: the bonuses my side held in full on the board before and does not now.
571
710
  const bonusesLost = prev
572
711
  ? (() => {
@@ -591,7 +730,11 @@ export function gameOutlook(input) {
591
730
  return lost;
592
731
  })()
593
732
  : [];
594
- const state = bound || estimated
733
+ // #436: no lead is claimed at low coverage — a win on the likely high alone needs evidence that is not thin.
734
+ const claimWin = estimated && !evidence.thin;
735
+ if (income && estimated && !claimWin)
736
+ income.noLeadClaim = true;
737
+ const state = bound || claimWin
595
738
  ? 'winning'
596
739
  : lostOnBound || lostOnEstimate
597
740
  ? 'losing'
@@ -609,19 +752,103 @@ export function gameOutlook(input) {
609
752
  changed,
610
753
  ...(forecast ? { front: forecast } : {}),
611
754
  state,
612
- ...(estimated || lostOnEstimate ? { estimated: true } : {}),
755
+ ...(claimWin || lostOnEstimate ? { estimated: true } : {}),
613
756
  ...(lowLikely ? { lowLikely: { myIncome: myNow, mostTracked: mostTracked(), groundDown, losing: lostOnEstimate } } : {}),
614
757
  evidence,
615
758
  ...(bonusesLost.length ? { bonusesLost } : {}),
759
+ ...(income ? { income } : {}),
760
+ ...(bonusesInReach.length ? { bonusesInReach } : {}),
616
761
  };
617
762
  });
763
+ // #436: each turn's income lean, with each side's change per turn over the turns judged up to it; it
764
+ // replaces an `even` state (winning, losing and stalemate keep their own tests).
765
+ // Calibration deepens a deficit the tracked figure shows, never creates one: a behind lean on the
766
+ // calibrated estimate (or its trend), and a turn under the surrender line, need my income under the
767
+ // tracked figure (the range's low) too. In-sample, on 10 lost games, past games' estimate ÷ truth alone put
768
+ // 5 of 25 truly-even turns past the surrender line; with this rule 1 (see CLAUDE.md, #436).
769
+ const trackedBehind = (inc) => inc.mine < inc.theirs.low;
770
+ const first = turns[0];
771
+ for (const t of turns) {
772
+ const inc = t.income;
773
+ if (!inc)
774
+ continue;
775
+ if (first && first !== t && first.income) {
776
+ const span = t.turn - first.turn;
777
+ inc.trend = { mine: round2((inc.mine - first.income.mine) / span), theirs: round2((inc.theirs.estimate - first.income.theirs.estimate) / span) };
778
+ }
779
+ const r = inc.ratio;
780
+ const spans = r.low !== null && r.low <= INCOME_BEHIND_RATIO && (r.high === null || r.high >= INCOME_AHEAD_RATIO);
781
+ let lean;
782
+ if (spans)
783
+ lean = 'unknown';
784
+ else if (r.high !== null && r.high <= INCOME_BEHIND_RATIO)
785
+ lean = 'behind';
786
+ else if (r.low === null || r.low >= INCOME_AHEAD_RATIO)
787
+ lean = 'ahead';
788
+ else if (r.estimate !== null && r.estimate <= INCOME_BEHIND_RATIO) {
789
+ if (trackedBehind(inc))
790
+ lean = 'behind';
791
+ else {
792
+ lean = 'unknown';
793
+ inc.calibratedOnly = true;
794
+ }
795
+ }
796
+ else if (r.estimate === null || r.estimate >= INCOME_AHEAD_RATIO)
797
+ lean = 'ahead';
798
+ else {
799
+ lean = 'even';
800
+ // The trend: one more turn at each side's change per turn, toward a threshold the ratio is heading to.
801
+ if (inc.trend && r.estimate !== null) {
802
+ const mineNext = Math.max(0, inc.mine + inc.trend.mine);
803
+ const theirsNext = Math.max(0, inc.theirs.estimate + inc.trend.theirs);
804
+ const next = theirsNext > 0 ? mineNext / theirsNext : null;
805
+ if (next !== null && r.estimate < 1 && next <= INCOME_BEHIND_RATIO && trackedBehind(inc))
806
+ lean = 'behind';
807
+ else if ((next === null || next >= INCOME_AHEAD_RATIO) && r.estimate > 1)
808
+ lean = 'ahead';
809
+ if (lean !== 'even')
810
+ inc.byTrend = true;
811
+ }
812
+ }
813
+ if (lean === 'ahead' && t.evidence?.thin) {
814
+ lean = 'unknown';
815
+ inc.noLeadClaim = true;
816
+ delete inc.byTrend;
817
+ }
818
+ inc.lean = lean;
819
+ // #454: beside the even state, never in it.
820
+ if (t.state === 'even' && lean !== 'even')
821
+ t.lean = lean;
822
+ }
618
823
  const last = turns.at(-1);
824
+ // #436: an income lean moves from turn to turn; the turns that read even on strength are one run, so a
825
+ // lean that changes (even, behind, behind on a slide) does not reset the hold. The run reports its lean
826
+ // when every turn judged read it, else `even`.
827
+ const evenOnStrength = (t) => t.state === 'even';
828
+ /** #454: a turn's finer reading (its lean, else its state). */
829
+ const fine = (t) => t.lean ?? t.state;
830
+ const sameRun = (t) => (last && evenOnStrength(last) ? evenOnStrength(t) : t.state === last?.state);
619
831
  let heldTurns = 0;
620
- for (let i = turns.length - 1; i >= 0 && turns[i].state === last?.state; i--)
832
+ for (let i = turns.length - 1; i >= 0 && sameRun(turns[i]); i--)
621
833
  heldTurns++;
622
- const state = last && heldTurns >= OUTLOOK_TURNS ? last.state : null;
623
- // #368: even for OUTLOOK_TURNS turns running while a bonus of mine fell on each: leaning behind.
624
- const leaning = state === 'even' && turns.length >= OUTLOOK_TURNS && turns.every((t) => t.bonusesLost?.length)
834
+ const held = turns.slice(turns.length - heldTurns);
835
+ const fineState = !last || heldTurns < OUTLOOK_TURNS
836
+ ? null
837
+ : evenOnStrength(last)
838
+ ? held.every((t) => fine(t) === fine(last))
839
+ ? fine(last)
840
+ : 'even'
841
+ : last.state;
842
+ // #454: the contract's state, and the lean beside it.
843
+ const { state, lean } = splitReading(fineState);
844
+ // #368: even on strength for OUTLOOK_TURNS turns running while a bonus of mine fell on each: leaning
845
+ // behind. #436: whatever the income lean (the lean is the incomes; the slide is the board), unless the run
846
+ // already reads behind.
847
+ const leaning = state !== null &&
848
+ fineState !== 'behind' &&
849
+ turns.length >= OUTLOOK_TURNS &&
850
+ turns.every(evenOnStrength) &&
851
+ turns.every((t) => t.bonusesLost?.length)
625
852
  ? {
626
853
  toward: 'behind',
627
854
  turns: turns.length,
@@ -631,6 +858,54 @@ export function gameOutlook(input) {
631
858
  })),
632
859
  }
633
860
  : undefined;
861
+ // #436: the pace line, over the turns judged.
862
+ const lastIncome = last?.income;
863
+ const firstIncome = turns[0]?.income;
864
+ const pace = last && lastIncome && firstIncome && turns.length >= 2 && lastIncome.trend
865
+ ? {
866
+ from: turns[0].turn,
867
+ to: last.turn,
868
+ mine: { income: lastIncome.mine, perTurn: lastIncome.trend.mine },
869
+ theirs: {
870
+ playerId: lastIncome.theirs.playerId,
871
+ ...(lastIncome.theirs.team !== undefined ? { team: lastIncome.theirs.team } : {}),
872
+ income: lastIncome.theirs.estimate,
873
+ perTurn: lastIncome.trend.theirs,
874
+ },
875
+ }
876
+ : undefined;
877
+ // #436: the surrender line (advice only): my income under the line for SURRENDER_TURNS turns running.
878
+ const below = (t) => !!t.income && t.income.mine < INCOME_BEHIND_RATIO * t.income.theirs.estimate && trackedBehind(t.income);
879
+ let turnsBelow = 0;
880
+ for (let i = turns.length - 1; i >= 0 && below(turns[i]) && (i === turns.length - 1 || turns[i + 1].turn === turns[i].turn + 1); i--)
881
+ turnsBelow++;
882
+ let surrenderLine;
883
+ if (last && lastIncome && turnsBelow > 0) {
884
+ const line = round2(INCOME_BEHIND_RATIO * lastIncome.theirs.estimate);
885
+ const closer = (last.bonusesInReach ?? []).find((b) => lastIncome.mine + b.value >= line);
886
+ const crossed = turnsBelow >= SURRENDER_TURNS && !closer;
887
+ const who = lastIncome.theirs.team !== undefined ? `team ${lastIncome.theirs.team}` : `player ${lastIncome.theirs.playerId}`;
888
+ const est = `${who}'s ~${lastIncome.theirs.estimate} (${lastIncome.calibrated ? "calibrated on past games' estimate ÷ truth" : 'the tracked figure, uncalibrated'})`;
889
+ const mineText = `my ${teamGame ? "team's " : ''}income ${lastIncome.mine}`;
890
+ const advice = crossed
891
+ ? `Surrender line crossed (advice only; the server never acts on it): ${mineText} has stayed below two-thirds of ${est} for ${turnsBelow} turns running (the line is ${line}), and no bonus in reach closes the gap.`
892
+ : closer
893
+ ? `Under the surrender line for ${turnsBelow} turn${turnsBelow === 1 ? '' : 's'} (advice only): ${mineText} is below two-thirds of ${est} (the line is ${line}), but bonus ${closer.bonus} (+${closer.value}) is in reach and would close the gap.`
894
+ : `Under the surrender line for ${turnsBelow} of the ${SURRENDER_TURNS} turns it needs (advice only): ${mineText} is below two-thirds of ${est} (the line is ${line}).`;
895
+ surrenderLine = {
896
+ crossed,
897
+ turnsBelow,
898
+ needed: SURRENDER_TURNS,
899
+ myIncome: lastIncome.mine,
900
+ theirIncome: lastIncome.theirs.estimate,
901
+ playerId: lastIncome.theirs.playerId,
902
+ ...(lastIncome.theirs.team !== undefined ? { team: lastIncome.theirs.team } : {}),
903
+ line,
904
+ calibrated: lastIncome.calibrated,
905
+ ...(closer ? { closer } : {}),
906
+ advice,
907
+ };
908
+ }
634
909
  const measure = teamGame
635
910
  ? `Strength = armies + ${k} × income; an opponent's is a range under fog (low: what is in view; high: the most it could have received and earn). By team: my team's strength (mine and my teammates' still playing) against the strongest enemy team's, each the sum of its players'; summed, a teammate's transfers stay inside its team's high.`
636
911
  : `Strength = armies + ${k} × income; an opponent's is a range under fog (low: what is in view; high: the most it could have received and earn). Per player: my strength alone against the single strongest opponent, teams not summed.`;
@@ -658,15 +933,19 @@ export function gameOutlook(input) {
658
933
  : `each turn at most ${LIKELY_INCOME_MARGIN}× the income the tracker reads off my boards`;
659
934
  let est = '';
660
935
  if (l && (l.high !== s?.high || l.source === 'prior'))
661
- est = ` The likely high — an estimate, not a bound: ${rests} — is ${sideName(l)} at ${l.high}, ratio ${l.ratio}×${last.estimated ? `; ${last.state} rests on it` : ''}.`;
936
+ est = ` The likely high — an estimate, not a bound: ${rests} — is ${sideName(l)} at ${l.high}, ratio ${l.ratio}×${last.estimated ? `; ${fine(last)} rests on it` : ''}.`;
662
937
  if (l && l.high > 0 && last.state !== 'winning')
663
938
  est += ` ${cap(sideName(l))} blocks a win on the estimate: winning needs mine at ${OUTLOOK_RATIO}× its likely high (${round2(OUTLOOK_RATIO * l.high)}), and mine is ${last.mine}.`;
664
939
  reading =
665
940
  turns.length < OUTLOOK_TURNS
666
941
  ? `Only ${turns.length} turn${turns.length === 1 ? '' : 's'} of boards in a row (${OUTLOOK_TURNS} needed), so no state yet; ${figures}.`
667
- : state
668
- ? `${state[0].toUpperCase()}${state.slice(1)} for ${OUTLOOK_TURNS} turns running; ${figures}.`
669
- : `${last.state[0].toUpperCase()}${last.state.slice(1)} for ${heldTurns} of the ${OUTLOOK_TURNS} turns (${turns.map((t) => t.state).join(', ')}), so no state yet; ${figures}.`;
942
+ : evenOnStrength(last) && !held.every((t) => fine(t) === fine(last))
943
+ ? fineState
944
+ ? `Even on strength for ${OUTLOOK_TURNS} turns running, the incomes reading ${turns.map(fine).join(', ')}; ${figures}.`
945
+ : `Even on strength for ${heldTurns} of the ${OUTLOOK_TURNS} turns (${turns.map(fine).join(', ')}), so no state yet; ${figures}.`
946
+ : fineState
947
+ ? `${fineState[0].toUpperCase()}${fineState.slice(1)} for ${OUTLOOK_TURNS} turns running; ${figures}.`
948
+ : `${fine(last)[0].toUpperCase()}${fine(last).slice(1)} for ${heldTurns} of the ${OUTLOOK_TURNS} turns (${turns.map(fine).join(', ')}), so no state yet; ${figures}.`;
670
949
  // #304: the incomes compared and each opponent's frontier read, said beside the state, and thin
671
950
  // evidence named so that "even" does not read as safe.
672
951
  const ev = last.evidence;
@@ -682,9 +961,33 @@ export function gameOutlook(input) {
682
961
  .filter((r) => r.thin)
683
962
  .map((r) => `player ${r.playerId} (${r.coverage === null ? 'not measured' : `${Math.round(r.coverage * 100)}%`})`)
684
963
  .join(', ');
685
- reading += ` Thin evidence: the income of ${which} was read from under ${pct}% of its frontier, so "${last.state}" is not a safe reading: an opponent may be stronger than the fog shows.`;
964
+ reading += ` Thin evidence: the income of ${which} was read from under ${pct}% of its frontier, so "${fine(last)}" is not a safe reading: an opponent may be stronger than the fog shows.`;
686
965
  }
687
966
  reading += est;
967
+ // #436: the incomes, their range and lean, and the pace line.
968
+ const inc = last.income;
969
+ if (inc) {
970
+ const t = inc.theirs;
971
+ const whose = t.team !== undefined ? `team ${t.team}` : `player ${t.playerId}`;
972
+ const range = t.low === t.high ? `${t.estimate}` : `~${t.estimate} (range ${t.low}–${t.high})`;
973
+ const leanText = inc.lean === 'unknown'
974
+ ? inc.noLeadClaim
975
+ ? 'unknown: the evidence is thin, so no lead is claimed'
976
+ : inc.calibratedOnly
977
+ ? `unknown: only the calibrated estimate reads behind (mine under ${round2(INCOME_BEHIND_RATIO)}× of it), not the tracked ${t.low}, so it is not counted against the surrender line`
978
+ : `unknown: the range spans both thresholds (${round2(INCOME_BEHIND_RATIO)}× and ${INCOME_AHEAD_RATIO}×)`
979
+ : `${inc.lean}${inc.byTrend ? ' on the trend' : ''}`;
980
+ reading += ` On incomes: ${teamGame ? "my team's" : 'mine'} ${inc.mine} against the strongest, ${whose}, at ${range}${inc.calibrated ? ", calibrated on past games' estimate ÷ truth" : ''}: ${leanText}.`;
981
+ if (inc.noLeadClaim && inc.lean !== 'unknown')
982
+ reading += ' No lead is claimed on the likely high: the evidence is thin.';
983
+ }
984
+ if (pace) {
985
+ const sign = (n) => (n >= 0 ? `+${n}` : `${n}`);
986
+ const gap = pace.mine.perTurn > pace.theirs.perTurn ? 'my income gains on it' : pace.mine.perTurn < pace.theirs.perTurn ? 'its income gains on mine' : 'both move alike';
987
+ reading += ` Pace: my income ${pace.mine.income} (${sign(pace.mine.perTurn)}/turn over turns ${pace.from}–${pace.to}) against ${pace.theirs.team !== undefined ? `team ${pace.theirs.team}` : `player ${pace.theirs.playerId}`}'s ~${pace.theirs.income} (${sign(pace.theirs.perTurn)}/turn): ${gap}.`;
988
+ }
989
+ if (surrenderLine)
990
+ reading += ` ${surrenderLine.advice}`;
688
991
  // #228: a likely ratio far below parity, said with what it took (or lacked) to read losing.
689
992
  const low = last.lowLikely;
690
993
  if (low) {
@@ -703,8 +1006,8 @@ export function gameOutlook(input) {
703
1006
  reading += ` Leaning behind: even for ${leaning.turns} turns running while I lost bonuses on each (${leaning.lost.map((x) => `turn ${x.turn} +${x.value}`).join(', ')}): the strength ratio lags a slide the board already shows, so read "even" as falling behind.`;
704
1007
  // #228: the plan's profile standing is a different measure (incomes, then the armies in view).
705
1008
  const standing = input.standing;
706
- if ((last.state === 'even' || last.state === 'stalemate') && (standing === 'ahead' || standing === 'behind'))
707
- reading += ` The profile's standing reads ${standing} (my income against the strongest opponent's estimate, overruled by the armies in view); this outlook reads ${last.state} because neither the winning nor the losing threshold was met on strength (armies + ${k} × income, and the likely high), a stricter test for a decided game.`;
1009
+ if ((fine(last) === 'even' || fine(last) === 'stalemate') && (standing === 'ahead' || standing === 'behind'))
1010
+ reading += ` The profile's standing reads ${standing} (my income against the strongest opponent's estimate, overruled by the armies in view); this outlook reads ${fine(last)} because neither the winning nor the losing threshold was met on strength (armies + ${k} × income, and the likely high), a stricter test for a decided game.`;
708
1011
  // #218: the main front, said with what it assumes, so it reads with the plan's front outlook.
709
1012
  const fr = last.front;
710
1013
  if (fr) {
@@ -723,6 +1026,7 @@ export function gameOutlook(input) {
723
1026
  }
724
1027
  return {
725
1028
  state,
1029
+ ...(lean ? { lean } : {}),
726
1030
  heldTurns,
727
1031
  turns,
728
1032
  k,
@@ -730,5 +1034,7 @@ export function gameOutlook(input) {
730
1034
  basis: `${reading} ${measure} ${thresholdsText}`,
731
1035
  ...(last?.evidence ? { evidence: last.evidence } : {}),
732
1036
  ...(leaning ? { leaning } : {}),
1037
+ ...(pace ? { pace } : {}),
1038
+ ...(surrenderLine ? { surrenderLine } : {}),
733
1039
  };
734
1040
  }
@@ -26,13 +26,16 @@ export function plainEconomy(pc, tgt, id, gain) {
26
26
  /**
27
27
  * Pass 3's eligibility (#125): not a player's under `balanced` (but #281's empty enemy territory), and
28
28
  * not only a member of an uneconomic bonus (but #281's denial: what it denies the opponent beside it is
29
- * its worth, not my bonus).
29
+ * its worth, not my bonus; and #417's land a static seat left, outside a negative bonus: the breach force
30
+ * takes it while it is up for taking).
30
31
  */
31
32
  export function plainEligible(pc, tgt, id, enemy) {
32
33
  return (!(pc.balanced && enemy && !tgt.emptyEnemies.has(id)) &&
33
34
  (tgt.economicMember.has(id) ||
34
35
  !tgt.uneconomicMember.has(id) ||
35
36
  tgt.denials.has(id) ||
37
+ // #417, the breach force: land a static seat left is taken while it is up for taking.
38
+ (pc.vacated.has(id) && !tgt.negativeMember.has(id)) ||
36
39
  (pc.territoryShare(1) > 0 && !tgt.negativeMember.has(id))));
37
40
  }
38
41
  /**
@@ -516,8 +516,9 @@ export function captureHelper(pc, ps, pass, book, threats, hd, tgt, prev) {
516
516
  }
517
517
  return true;
518
518
  };
519
- if (reserve)
520
- rationale.push(`Hold a reserve of ${reserve} out of captures.`);
519
+ // #421: the strike share is said on its own line (planner.ts), not as the caller's reserve.
520
+ if (reserve - pc.strikeShare)
521
+ rationale.push(`Hold a reserve of ${reserve - pc.strikeShare} out of captures.`);
521
522
  // ---- 3a. combined (multi-source) captures (R4) ----
522
523
  /**
523
524
  * The cheapest combined capture of `t` (fewest sources) under exact 0%-luck,
@@ -1193,7 +1194,7 @@ export function bonusPasses(pc, ps, book, hd, tgt, prev) {
1193
1194
  if (stepping === null)
1194
1195
  continue;
1195
1196
  const worth = p.net === p.value ? `+${p.value}` : `+${p.value}, net +${p.net}`;
1196
- const reason = (stepping?.reason ?? `advances bonus ${bonusName(p.bonusId)} (${worth}, ${toFinish(p.cost, p.fogged, p.fogEach)})`) + leadNote(t);
1197
+ const reason = (stepping?.reason ?? `advances bonus ${bonusName(p.bonusId)} (${worth}, ${toFinish(p.cost, p)})`) + leadNote(t);
1197
1198
  // Only a lead step (#203) can be funded on a conceded source.
1198
1199
  const before = whole || !lead ? undefined : snapshot();
1199
1200
  const tried = before && new Map(leadTry);
@@ -5,6 +5,7 @@
5
5
  // rationale and warnings that state them. Pure: it reads the input and writes only
6
6
  // `state.warnings` / `state.rationale`.
7
7
  import { siegeFit, siegeOf } from './siege.js';
8
+ import { pileOf, strikeShareOf } from './stockpile.js';
8
9
  import { armiesForGold } from '../../commerce.js';
9
10
  import { holdsSeat } from '../../player-states.js';
10
11
  import { isTeamGame, teammatesOf } from '../../teams.js';
@@ -19,10 +20,11 @@ import { AHEAD_PRESSURE_FACTOR, captureCost, combatSettings, DECIDED_PAYBACK_MIN
19
20
  import { AHEAD_RATIO, BEHIND_RATIO, gameProfile } from '../profile.js';
20
21
  import { byNum } from './util.js';
21
22
  import { sanctionedIncome } from '../cards-in-effect.js';
22
- import { truceOf } from './relations.js';
23
+ import { skirtedNeutrals, truceOf } from './relations.js';
23
24
  import { teamFocusOf } from './team.js';
24
25
  import { neutralizeSeats, staticSeats } from '../static-seats.js';
25
26
  import { commanderPlace } from './commander.js';
27
+ import { fogVacated, VACATED_FOG_ARMIES } from './vacated.js';
26
28
  /**
27
29
  * The fog prior to apply (#119, {@link EnemyIncomePrior}): only when the game says the start was
28
30
  * symmetric (`symmetricStart`), with no teams — a 1v1 (one opponent), or (#226) a free-for-all, where
@@ -58,6 +60,8 @@ function fogPrior(board, me, ctx, myIncome, seats = new Map()) {
58
60
  ...(opponents > 1 || out.length ? { format: 'ffa', opponents } : {}),
59
61
  ...(out.length ? { out } : {}),
60
62
  ...(ctx.opening ? { opening: ctx.opening } : {}),
63
+ // #419: the past winners' pace, thin evidence's upper bound when above the prior.
64
+ ...(ctx.mapPace ? { winnerPace: ctx.mapPace } : {}),
61
65
  },
62
66
  };
63
67
  }
@@ -84,7 +88,9 @@ export function planEnemyEstimates(input) {
84
88
  const previousBoard = input.previousBoard ? neutralizeSeats(input.previousBoard, seats) : undefined;
85
89
  const tracks = input.tracks?.filter((t) => !seats.has(t.playerId));
86
90
  const capCut = input.incomeCap ? Math.max(0, Math.floor(input.incomeCap.uncapped - input.incomeCap.received)) : 0;
87
- const { prior, skipped } = fogPrior(board, input.me, ctx, input.income + capCut, seats);
91
+ const fog = fogPrior(board, input.me, ctx, input.income + capCut, seats);
92
+ const prior = statedScale(fog.prior, board, input.me, input.known ?? []);
93
+ const skipped = fog.skipped;
88
94
  const turn = input.turn ?? ctx.turn ?? null;
89
95
  const estimates = enemyDeployEstimates(input.graph, board, input.me, input.settings ?? {}, previousBoard, tracks, prior, {
90
96
  turn,
@@ -95,6 +101,22 @@ export function planEnemyEstimates(input) {
95
101
  const priced = applyKnown(applyArmyPrice(applySanctions(estimates, input.sanctions ?? []), input.settings?.armyCostMultiplier ?? 0), input.known ?? []);
96
102
  return { estimates: priced, prior, ...(skipped ? { priorSkipped: skipped } : {}) };
97
103
  }
104
+ /**
105
+ * #444: the incomes stated in chat (`known`) for players in view (not me) scale the prior of every other
106
+ * opponent when their mean is below my income: `EnemyIncomePrior.stated`. The prior unchanged otherwise.
107
+ */
108
+ function statedScale(prior, board, me, known) {
109
+ if (!prior || !known.length || prior.myIncome <= 0)
110
+ return prior;
111
+ const inView = new Set(board.territories.flatMap((t) => (t.owner.kind === 'player' ? [t.owner.playerId] : [])));
112
+ const players = known
113
+ .filter((k) => k.player !== me && inView.has(k.player))
114
+ .map((k) => ({ id: k.player, income: Math.max(0, Math.floor(k.income)) }));
115
+ if (!players.length)
116
+ return prior;
117
+ const ratio = players.reduce((n, x) => n + x.income, 0) / players.length / prior.myIncome;
118
+ return ratio < 1 ? { ...prior, stated: { players, mine: prior.myIncome, ratio } } : prior;
119
+ }
98
120
  /**
99
121
  * #368: each estimate whose player the user gave a known income for (what it said in chat, say): that
100
122
  * income replaces the estimate's, whatever its source; a Reinforcement card the clock adds stays on top.
@@ -321,9 +343,19 @@ function opponentsCtx(input) {
321
343
  const heldLand = new Set(held
322
344
  ? board.territories.flatMap((t) => t.owner.kind === 'player' && t.owner.playerId === held.target && !held.breakMembers.has(t.territoryId) ? [t.territoryId] : [])
323
345
  : []);
324
- const truceNow = held
346
+ const withSiege = held
325
347
  ? { ...truce, siegeHeld: (t) => heldLand.has(t), noTarget: (t) => truce.noTarget(t) || heldLand.has(t) }
326
348
  : truce;
349
+ // #441: the neutrals an avoided player is visibly collecting are no targets either; #457: nor a truce partner's.
350
+ const skirted = skirtedNeutrals({ ...input, board }, { foe, deployOf, settings: s, ...(truce.keptWith ? { truce: truce.keptWith } : {}) });
351
+ const truceNow = skirted.size
352
+ ? {
353
+ ...withSiege,
354
+ skirted,
355
+ avoided: (t) => skirted.has(t) || withSiege.avoided(t),
356
+ noTarget: (t) => skirted.has(t) || withSiege.noTarget(t),
357
+ }
358
+ : withSiege;
327
359
  /**
328
360
  * #201: the planning horizon. Once the outlook (#178) says the game is decided — winning or losing
329
361
  * for OUTLOOK_TURNS turns running — every payback test counts the turns the game has left instead
@@ -451,8 +483,11 @@ function boardCtx(input, o) {
451
483
  */
452
484
  const uncounted = (id) => (state.get(id)?.specialUnits ?? []).some((u) => u.kind !== 'commander');
453
485
  const uncountedKind = (id) => [...new Set((state.get(id)?.specialUnits ?? []).filter((u) => u.kind !== 'commander').map((u) => (u.kind === 'boss' ? 'a boss' : u.kind === 'custom' ? 'a custom unit' : 'a special unit')))].join(' and ');
454
- /** What a territory defends as now: its armies plus its special units. */
455
- const defenceAt = (id) => armiesOf(id) + unitsAt(id);
486
+ /**
487
+ * What a territory defends as now: its armies plus its special units. #417 (the breach force): land a
488
+ * static seat left whose armies the fog hides stands on {@link VACATED_FOG_ARMIES} at most.
489
+ */
490
+ const defenceAt = (id) => (fogVacated(input.vacated, state.get(id), id) ? VACATED_FOG_ARMIES : armiesOf(id)) + unitsAt(id);
456
491
  // ---- income change (#70): the one computation nextIncome, R3 and the negative-bonus rules use ----
457
492
  const bonusTs = new Map(g.map.bonuses.map((b) => [b.id, bonusTerritories(g, b.id)]));
458
493
  /** The bonuses each territory is in (superbonuses through their members included). */
@@ -733,7 +768,28 @@ function standingCtx(o, b) {
733
768
  export function planContext(input) {
734
769
  const o = opponentsCtx(input);
735
770
  const b = boardCtx(input, o);
736
- return { ...o, ...b, ...combatCtx(o, b), ...standingCtx(o, b) };
771
+ const c = combatCtx(o, b);
772
+ // #421 (owner decision, 2026-11-20): in contact on a flat income the strike share is held out of
773
+ // captures (the reserve holds back captures only, so holds keep their exact need first).
774
+ const contact = new Set();
775
+ for (const id of b.mine)
776
+ for (const n of neighborsOf(o.g, id)) {
777
+ const st = b.territories.get(n);
778
+ if (st?.owner.kind === 'player' && st.armies !== null && o.foe(st.owner.playerId))
779
+ contact.add(st.owner.playerId);
780
+ }
781
+ const pileArgs = {
782
+ territories: b.territories, mineSet: b.mineSet, unitsAt: b.unitsAt, foe: o.foe, income: o.income,
783
+ ...(o.incomeTrend ? { incomeTrend: o.incomeTrend } : {}), auto: o.auto, goal: o.goal, noSplit: c.noSplit,
784
+ };
785
+ const strikeShare = o.opts.strikeShare === false ? 0 : strikeShareOf({ ...pileArgs, format: o.profile.format, siege: o.siege?.target, contact });
786
+ const reserve = Math.min(o.income, o.reserve + strikeShare);
787
+ // #421: the pile itself, for the break and all-in spends.
788
+ const pile = pileOf(pileArgs);
789
+ return {
790
+ ...o, ...b, ...c, ...standingCtx(o, b), reserve, strikeShare: reserve - o.reserve,
791
+ ...(pile ? { pile: { my: pile.my, turns: pile.turns } } : {}),
792
+ };
737
793
  }
738
794
  /**
739
795
  * The rationale and warnings that state what the estimates phase decided: the goal and the profile
@@ -797,6 +853,14 @@ export function noteEstimates(ctx, state) {
797
853
  rationale.push('An opponent may hold a Bomb (#163): it halves one territory of mine next to it after the deploys and before any move, so every hold here is sized as if its stack were halved first (my commander unharmed), and the leftover goes to two stacks, not one, unless it concentrates for an attack.');
798
854
  if (s.multiAttack)
799
855
  rationale.push(`Multi-attack is on: the plan does not chain its own attacks from captured territories, but an enemy stack's chain — a capture, then the survivors on from it, through territories not mine — counts as a threat to the territory of mine, or the capture, it reaches (luck-free, at most ${CHAIN_MAX_STEPS} attacks deep).`);
856
+ // #441: a neutral skipped for an avoided player, beside my land (one the plan could reach this turn); #457: or a truce partner.
857
+ for (const [n, k] of ctx.truce.skirted ?? [])
858
+ if (neighborsOf(ctx.g, n).some((x) => ctx.mineSet.has(x))) {
859
+ const why = k.why === 'stack' ? `its only enemy neighbour is player ${k.player}` : `it sits in a bonus player ${k.player} visibly holds most of`;
860
+ rationale.push(k.truce
861
+ ? `Not taking ${ctx.label(n)}: ${why}, with whom a truce binds you, and taking it may read as a breach to player ${k.player} — raise it with player ${k.player} instead (it is taken only when it completes a bonus of mine) (#457).`
862
+ : `Not taking ${ctx.label(n)}: ${why}, whom the plan avoids, and its capture would not hold next turn, so taking it would only provoke that player (#441).`);
863
+ }
800
864
  if (noSplit) {
801
865
  rationale.push('No-Split: each territory issues at most one attack or transfer this turn, and it sends the whole stack (every army there, this turn\'s deploys included, less the guard); a territory that would split keeps its first (best) order, and one that must hold issues none.');
802
866
  }