Scan your whole stack
From OX Research Newsroom
Are you using @civ-clone/core-unit?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.33
@civ-clone/core-unit was last scanned on 24 Nov 2026 at version 0.1.33. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.33 LATEST | 24 Nov 2026 | No rules fired |
| 0.1.32 | 15 Nov 2026 | No rules fired |
| 0.1.31 | 12 Nov 2026 | No rules fired |
| 0.1.30 | 12 Nov 2026 | Not shown |
| 0.1.29 | 24 Oct 2026 | Not shown |
Findings for v0.1.33. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.33; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Contains the core models relating to Units.
The primary model, Unit, stores related state objects (Player, City, Tile, Yields, Actions) and
convenience methods for accessing and modifying these.
A key component of a Unit is its ability to perform Actions. This package includes a DelayedAction class which can
easily wrap any Actions that take time to be carried out (BuildIrrigation, Fortify, etc.).
There's also a UnitRegistry which can be used to retrieve Units by City, Player or Tile.
Various base Yields are included to represent the values of the Unit.
A UnitTrait is something a unit type can do or is, other than its domain: ignoring zones of control, founding
cities, carrying aircraft. The trait classes themselves live in their own base-unit-trait-* packages. A game declares
which of its unit classes have which traits with UnitTraits rules, so the same class can differ between games and a
RuleSet can switch a single trait:
ruleRegistry.register(
...unitTraits('civ1-unit:unit/trait', Diplomat, IgnoresZoneOfControl, NonCombatant),
...unitTraits('civ1-unit:unit/trait', Carrier, new Carries(Air))
);
Rules then ask unit.hasTrait(NonCombatant) (from the unit's own RuleRegistry), or, for a class such as a build
item, hasTrait(Diplomat, NonCombatant, ruleRegistry). traitsOf returns the traits themselves, with their parameters,
traitCriterion(Trait) is a ready-made Criterion, and unitAction accepts trait classes alongside unit classes. The
answers are kept per class and registry until a UnitTraits rule is registered, removed or switched.
So a trait declaration must depend on the class alone: never on game state, which it isn't asked about again, and never
on traits (a declaration that asks about the class being resolved throws UnitTraitCycleError). Don't subclass
UnitTraits: registering a subclass's rule doesn't clear the registry's cache for UnitTraits. traitsOf lists every
declaration, so a trait declared on both a parent and a leaf class appears twice for the leaf.
npm run bench logs what a lookup costs against instanceof.
Traits belong to the class, so they are never saved and never sent to a client. A unit's own state (veteran, fortified)
stays a UnitImprovement.
When this package is included in your build of civ-clone, it will automatically provide the AdditionalData key
units for City, Player and Tileobjects as a convenience method.
Includes the following Rules:
Action for controlling which Actions are available to the Unit.Activate triggers actions when a Unit is Unit.activated.Busy for tracking if DelayedActions are complete.CannotSupportUnit triggered when a City cannot support a Unit for whatever reason.CombatResolver fights a battle (see "Combat" below).Created when Units are created.Damaged when a Unit survives a battle with damage.Defeated " " defeated (and destroyed).DefenderRank scores the units on an attacked square to choose its defender.Destroyed " " destroyed.Moved " " moved.MovementCost which controls the cost of moving the Unit.UnitTraits declares which UnitTraits a unit class has (see above).ValidateMove to confirm if the Action was successful or not.Visibility for applying the results of the Units Visibility Yield to the PlayerWorld.WorkRate for how fast a Unit gets through a DelayedAction (2 halves the turns, rounded up).Yield controls the various Yields applicable for the Unit (Attack, Defence, Firepower, HitPoints,
Movement, Visibility).None of these rules has to be registered: a game that registers none fights as before, with a single roll and units that are either whole or destroyed.
HitPoints and Firepower are Yields like Attack. unit.hitPoints() is [remaining, maximum], and
unit.damage()/unit.setDamage(n) hold what the unit has taken (setDamage refuses a non-finite n with a
RangeError). A unit only has a _damage property while it is
damaged, so it isn't saved for an undamaged unit. It isn't one of the unit's keys either: send it to a client through
AdditionalData if it should see it.CombatResolver ([attacker, defender, attack, defence, power, randomNumberGenerator] → CombatResult) decides a
battle in place of the single roll. The attack applies the winner's damage, processes Defeated for the loser and
Damaged for a winner that took damage.DefenderRank ([attacker, candidate, attack, defence] → a score) chooses the defender in place of the highest
defence.WorkRate ([unit] → a rate) shortens a DelayedAction to ceil(turns / rate) turns.Each of the three uses the first answer that isn't undefined. A rule declines through its Criterion, not by
returning undefined: every rule whose criteria match still runs, so only one should match (a second resolver would
fight the battle again). A resolver must name the attacker and defender as winner and loser and leave the winner alive
(damage below its HitPoints); Attack throws otherwise.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.