@icjhd/cj-script-compiler
v2.0.0
Published
技能脚本合同快照与二进制写出工具核心
Downloads
91
Readme
@icjhd/cj-script-compiler
技能脚本编译器核心。
当前第一轮包含:
- L1/L2/L3/L4 合同快照初版
- v2
OperationSpec基线字段表的静态快照 - Operation 字段覆盖统计
- 最小
ACT0 action slot + CALL_OP/CALL_GROUP + RETURN二进制写出 - tracked
assets/generated/registry.snapshot.json - tracked
assets/generated/operation-field-coverage.json - tracked
assets/fixtures/minimal-call-op.golden.json
该包是纯 TypeScript 库,不包含 Node CLI。CLI 应放在编辑器工具层或构建脚本中调用该库。
2026-06-25 P3 formula adapter update
- Added a conservative
compileFormulaFxto expression-bytecode adapter for static numeric formulas. ROLL_JUMP_IF_FALSEcan now useprobabilityFormula, currently limited to number literals plus+ - * /and unary-.- Added
minimal-formula-chance.golden.jsonto verify formula source0.1 + 0.15compiles toFXC0/XPR0/XCD0and evaluates to0.25000000.
2026-06-25 P3 context formula adapter update
- Formula variables
caster.<key>,target.<key>, andconst.<key>now compile toLOAD_CONTEXT_FX. - Added
minimal-context-formula.golden.jsonforcaster.ap * 0.01 - target.def * 0.05, evaluated with fixture context to0.25000000. eval-fxaccepts an optional context JSON file for dynamic expression smoke checks.
2026-06-25 P3 formula function adapter update
compileFormulaFxadapter now lowersmin(a,b),max(a,b), andclamp(x,lo,hi)to expression VM opcodes.- Added
minimal-function-formula.golden.jsoncoveringMIN_FX,MAX_FX,CLAMP_FX, andconstcontext reads. - Still unsupported in this slice:
%,abs,floor,ceil,round,sqrt,pow, andrand.
2026-06-25 P3 rounding function adapter update
compileFormulaFxadapter now lowers%,abs(x),floor(x),ceil(x), andround(x).- Added
minimal-rounding-formula.golden.jsonto verify fixed-point modulo and rounding semantics. - Still unsupported in this slice:
sqrt,pow, andrand.
2026-06-25 P3 bool comparison adapter update
- Added structured
JUMP_IF_FALSEsource support withleftFormula,comparator, andrightFormula. - Comparators lower to BOOL expression bytecode:
EQ,NE,LT,LTE,GT, andGTE. - Added
minimal-bool-jump.golden.jsonandeval-boolCLI coverage.
2026-06-25 P3 minimal Expression VM update
- Chance expressions now compile into
FXC0constants andXCD0instruction programs instead of direct ppm-only records. ROLL_JUMP_IF_FALSE probabilityPpmemitsPUSH_FX_CONST+RETURN_FXexpression bytecode.- Golden tests validate
eval-fxoutput for the chance fixture.
2026-06-25 P2 ABI skeleton update
COD0writer now emits 16-byteopcode/a/b/cinstruction records.- The writer emits required empty section skeletons for
FXC0,XCD0,SEL0,L1C0,L2D0,L3E0,L4G0,DSP0, andLIM0. ROLL_JUMP_IF_FALSEsource instructions now require an explicitrollScopeId.
2026-06-25 binary update
- Added
XPR0const-ppm expression records to the writer output. - Added
ROLL_JUMP_IF_FALSEsource instruction support. - Added tracked
assets/fixtures/minimal-chance.golden.json.
