No description
Find a file
Joey Yakimowich-Payne da436d5650
docs(chess): document 7 new trigger primitives + target/event context (T27)
Extends RULES.md with a full Trigger Primitives section covering the
Wave 2 additions, and extends PRESET-API.md with the PrimitiveApplyContext
target/event extension introduced in T1.

RULES.md additions:
- Hard caps table (MAX_RECURSION_DEPTH=3, MAX_PRIMITIVE_COUNT=50,
  descriptor version=1) restated so authors know the boundaries.
- Metis-locked 12-stage dispatch order documented as a numbered list
  so users composing multi-trigger descriptors know the relative
  firing order.
- Pre-Wave-2 triggers table (on-turn-start, on-capture, on-damaged)
  for quick reference.
- Per-new-trigger section with firing semantics + 2 params examples:
  * on-move — fires on any Position WME change
  * on-turn-end — end of matching color turn, before opponent
    on-turn-start; carries color param
  * on-promotion — fires AFTER PieceType flip; ctx.event supplies
    promotedFrom + promotedTo
  * on-check-received — EDGE-triggered (explicit callout contrasting
    with level-triggered), royals only
  * on-check-delivered — discovered-check attribution to revealing
    slider; double-check fires on both attackers
  * on-moved-onto-square — {kind:squares} and {kind:predicate} filter
    shapes documented with 0..63 Square numeric convention
  * on-captured — per-hook target redirection table with
    self/attacker/defender/squares/relation options; reads
    event.attackerId + event.defenderId

PRESET-API.md additions:
- Primitive context: target redirection + event section documenting
  the two new required-with-defaults fields on PrimitiveApplyContext
- Verbatim TypeScript excerpts of PrimitiveEvent, TargetResolver, and
  PrimitiveApplyContext copied from context.ts/types.ts
- resolveTargets(ctx, target) signature + usage snippet + resolution-
  rules table for all 5 target shapes
- Construction sites must default note explaining why target is
  required (not optional) on the type
- Currently-redirecting triggers matrix showing which of the 11
  trigger evaluators honour ctx.target and which populate ctx.event

Note: the plan brief said 4 existing + 7 new = 11 triggers, but only
3 pre-Wave-2 trigger primitives exist in the source tree
(on-turn-start, on-capture, on-damaged). Docs reflect the actual
3 + 7 = 10.

Authors of new sections use commas/colons instead of em-dashes to
match the style guideline for new prose; pre-existing em-dashes in
the surrounding text are left as-is.
2026-04-21 18:59:54 -06:00
.github/workflows chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
.sisyphus docs: add T24 QA notes 2026-04-21 18:38:50 -06:00
docs feat(ui): AttrCombobox declare vs. consume semantics 2026-04-21 13:07:27 -06:00
packages docs(chess): document 7 new trigger primitives + target/event context (T27) 2026-04-21 18:59:54 -06:00
scripts feat(rete): add replay engine + state-hash determinism verifier (P3.3) 2026-04-16 15:25:13 -06:00
.gitignore chore(sisyphus): Rule Variants Final Verification Wave — all reviewers APPROVE 2026-04-21 10:15:18 -06:00
eslint.config.js feat(engine): damage-resistance modifier descriptor 2026-04-18 22:22:31 -06:00
lefthook.yml chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
LICENSE chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
package.json feat(rete): add replay engine + state-hash determinism verifier (P3.3) 2026-04-16 15:25:13 -06:00
playwright.config.ts fix(rete): inject clock into EventLog; use tsc for DTS; fix cycle.test.ts private access; add Playwright worker limit 2026-04-16 18:25:49 -06:00
README.md chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
tsconfig.base.json chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
tsconfig.json chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
vitest.workspace.ts chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00

@paratype

A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.

Packages

Docs

Getting Started

bun install && bun run check