No description
T3 audit follow-ups Q3.2 (declared consumers), Q4.6 (zombie fact
cleanup on capture), Q4.7 (aura convergence semantics locked in).
Q3.2 — Load-time consumer integrity check:
- EffectPrimitive gains optional seedsAttrs + seedsAttrsFor fields
declaring which ChessAttrKey facts a primitive writes during
apply(). Every T3 primitive now annotates its seeds:
* Static (single attr always written): reflect-damage,
absorb-damage-with-attribute (the two control facts),
add-aura, add-direction, set-capture-flag, modify-movement-
range, override-promotion, block-move-type, on-turn-start,
on-capture, on-damaged, conditional.
* Dynamic (attr is a param): seed-attribute, add-to-attribute,
multiply-attribute, absorb-damage-with-attribute (also
dynamic via params.attr for the charge-holding attribute).
- new primitives/manifest.ts:
* getStaticPrimitiveSeedManifest() union of all static
seedsAttrs, cached after first call.
* collectDynamicSeedsInTree(nodes) walks a primitive tree
collecting both static and dynamic seeds, used by the
zombie-cleanup path with the in-engine CustomModifierRegistry.
* registerAttrConsumer(attr) + getRegisteredConsumers() for
engine subsystems to declare 'I read this attr'.
* assertSeedConsumerIntegrity() asserts every declared seed
has a registered consumer; throws loudly with the full list
of unsatisfied attrs.
- Consumer registrations:
* apply.ts: damage pipeline + movegen filter + trigger
dispatchers register AbsorbDamage*, ReflectDamagePercent,
BlockedMoveTypes, DamageResistance, CaptureFlags,
DirectionAdditions, On*Hooks, ConditionalHooks, AuraSpec.
* effective-attr.ts: HpBonus, RangeBonus, AuraContributions.
* rules/promotion.ts: PromotionOverride.
- Integrity check fires once lazily in ChessEngine constructor;
engine boot throws if a primitive declares a seed that no
subsystem reads. Silent-inert primitives are now impossible.
Q4.6 — Zombie fact cleanup:
- engine.dealDamage default-kill path + piece-hp's onDamage kill
path both extend their retract-on-death loop to include
getEngineSeedManifest(customModifiers). Captures now fully
clean up primitive-seeded attrs (HpBonus, AuraSpec,
ReflectDamagePercent, trigger hooks, user-authored dynamic
targets) in addition to the preset-declared core attrs.
Q4.7 — Aura convergence:
- New test in auras.test.ts 'mutual auras converge in a single
pass' locks in the declarative semantics: mutual auras each see
the OTHER piece's contribution against a positional snapshot,
producing commutative deltas in one compute pass. Second
compute pass is idempotent (no cascade/loop). Decision
documented for downstream 'aura of aura' consumers.
5 new manifest.test.ts scenarios + 1 aura convergence test.
1394 → 1399 unit tests green.
|
||
|---|---|---|
| .github/workflows | ||
| .sisyphus | ||
| docs | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| eslint.config.js | ||
| lefthook.yml | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.workspace.ts | ||
@paratype
A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.
Packages
packages/rete— Rete II engine corepackages/chess— Browser chess demo (React + Vite)packages/server— Authoritative Bun WebSocket server
Docs
- SPEC.md — Engine specification
- PHASES.md — Development phases & perf budgets
- RULES.md — Chess rule presets
- PROTOCOL.md — WebSocket message protocol
Getting Started
bun install && bun run check