2.4 KiB
2.4 KiB
Modifier Profiles T3 — Learnings
[2026-04-19 17:14] Task: T3
- Added
packages/chess/src/modifiers/custom/types.tswith brandedCustomModifierIdandasCustomModifierIdhelper that mirrorsasEntityIdtrust-boundary wording/style frompackages/rete/src/schema.ts. - Added
CustomModifierDescriptorwith literal discriminators (type: "data",version: 1,uiForm: "primitive-composer",source: "custom") and a forward-design JSDoc note for future"scripted"descriptors in T4. - Divergence from ideal import shape:
EffectPrimitiveNodeis a local fallback interface incustom/types.tsbecausepackages/chess/src/modifiers/primitives/types.tsis not yet committed in this branch state. Included TODO to swap to../primitives/types.jsimport immediately when T2 lands. - Added
packages/chess/src/modifiers/custom/index.tsas a focused barrel with explicit Wave 3 scope boundary comment. - Added
packages/chess/src/modifiers/custom/types.test.tswith four scenarios: branded helper runtime/type round-trip, descriptor structure assignment, readonlytargetAttrstyping, readonlyprimitivestyping.
[2026-04-19 17:13] Task: T2
- Added
packages/chess/src/modifiers/primitives/types.tswith T3 primitive core contracts:PrimitiveKindunion with exactly 15 ADR-2 primitive ids.EffectPrimitive<Params>descriptor shape (paramsSchema: ZodType<Params>,apply(ctx, params): void, optionalmaxDepth, optionalchildPrimitives).EffectPrimitiveNoderuntime node shape (kind,params).PrimitiveApplyContext(engine,session,pieceId,depth,descriptor).- Forward-declared
CustomModifierDescriptorplaceholder interface to avoid circular dependency with future../custom/types.ts.
- Added
packages/chess/src/modifiers/primitives/registry.ts+ singleton export.- Mirrored
MODIFIER_REGISTRYclass shape exactly: privateMap, duplicate guard throw,register/get/list/has, generic register call-site support.
- Mirrored
- Added
packages/chess/src/modifiers/primitives/index.tsbarrel with explicit Wave-2 side-effect-registration stub comment. - Added
packages/chess/src/modifiers/primitives/registry.test.tswith 6 scenarios: round-trip get, duplicate throw, list order stability,has()accuracy, unknown kind miss, and generic type preservation at register call site.
[2026-04-19 17:28] Wave 2 batch B
- Added
absorb-damage-with-attributeprimitive + tests.