From 2901dfeef20f37768787947aabebf4d92aaddbe4 Mon Sep 17 00:00:00 2001 From: levonn-dev Date: Wed, 24 Jun 2026 00:58:49 -0400 Subject: [PATCH 1/2] feat(buffs): final clean up of self buffs --- README.md | 12 +- api/openapi.yaml | 2 +- calc-sidecar/src/backends/rocalc/index.ts | 8 + calc-sidecar/src/backends/stub/index.ts | 5 + calc-sidecar/src/types.ts | 8 + .../test/shim/buff-binding-parity.test.ts | 57 +++ calc-sidecar/test/shim/contract.test.ts | 1 + cmd/build-catalog/main.go | 8 +- internal/api/oapi/oapi.gen.go | 114 +++--- internal/api/score_test.go | 2 +- internal/catalog/buffs_test.go | 28 +- internal/catalog/catalog.go | 6 +- internal/catalog/data/class_innate_buffs.yaml | 6 +- internal/catalog/data/skill_buffs.yaml | 345 +++++++++--------- internal/data/buffs.go | 6 +- internal/data/sources/hercules/mobs.go | 8 +- internal/data/sources/hercules/selfbuff.go | 2 +- internal/data/sources/hercules/skill_tree.go | 4 +- internal/domain/build.go | 2 +- internal/domain/server.go | 12 +- internal/domain/trajectory.go | 2 +- internal/llm/tools/champion_buffs_e2e_test.go | 2 +- internal/llm/tools/clown_buffs_e2e_test.go | 2 +- .../llm/tools/gunslinger_buffs_e2e_test.go | 2 +- internal/llm/tools/list_class_skills.go | 4 +- .../llm/tools/lord_knight_buffs_e2e_test.go | 4 +- internal/llm/tools/paladin_buffs_e2e_test.go | 2 +- internal/llm/tools/score_build.go | 6 +- internal/llm/tools/score_build_test.go | 2 +- internal/llm/tools/stalker_buffs_e2e_test.go | 2 +- internal/llm/tools/submit_trajectory_test.go | 14 +- .../llm/tools/whitesmith_buffs_e2e_test.go | 2 +- internal/orchestrator/orchestrator.go | 6 +- internal/scoring/buff_binding_parity_test.go | 51 --- internal/scoring/buffs_e2e_test.go | 4 +- internal/scoring/gates/defaults.go | 2 +- internal/scoring/gates/hit.go | 2 +- internal/scoring/types.go | 18 +- 38 files changed, 392 insertions(+), 371 deletions(-) create mode 100644 calc-sidecar/test/shim/buff-binding-parity.test.ts delete mode 100644 internal/scoring/buff_binding_parity_test.go diff --git a/README.md b/README.md index 48d0807..028fde0 100644 --- a/README.md +++ b/README.md @@ -432,11 +432,17 @@ happy-path LLM loop. Not yet done, roughly in priority order: +- [x] Add self-buffs to calc +- [ ] Add self-buffs to scoring +- [ ] Include skill usage/damage in calc and scoring +- [ ] Vector search over saved trajectories' reasoning text. Today's `get_similar_past_builds` uses class+scenario + lookup. +- [ ] Add RAG with injecting get_similar_past_builds into initial system prompt - [ ] Postgres migration for the build library. SQLite pins the API to `replicas: 1` and `strategy: Recreate`; HPA / PDB are excluded from the Helm chart until this lands. - [ ] General prompt tuning - less tokens, more progress. -- [ ] More server profiles beyond UARO. Drop a YAML, no code change. - [ ] More golden fixtures beyond Taekwon Kid. The shim handles all 45 supported classes already +- [ ] Golden fixtures for Full Support builds - [ ] Renewal mode end-to-end. The API rejects `mode: "renewal"` at the boundary today; the data layer is already mode-aware. The calc adapter hasn't been validated for renewal. - [ ] Rotation simulator with SP economy. Today's scoring uses single-skill DPS + sustained auto-attack as a proxy. @@ -445,8 +451,8 @@ Not yet done, roughly in priority order: - [ ] Real time-to-level scoring at leveling checkpoints. Currently the leveling target is attached as a proxy for "can you farm here" - [ ] Genetic / beam-search optimizer over gear combinations. Today the LLM proposes; deterministic scoring ranks. -- [ ] Vector search over saved trajectories' reasoning text. Today's `get_similar_past_builds` uses class+scenario - lookup. - [ ] Custom dungeons (containers) in `ServerProfile`. Custom mobs are wired; containers are not. +- [ ] Model custom skill changes from server profile into calc +- [ ] Model custom equipment changes from server profile into calc Bug reports, missing card effects, server-profile additions, and additional calc backends are all welcome via PR. diff --git a/api/openapi.yaml b/api/openapi.yaml index 04d2362..3f7b8c4 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -427,7 +427,7 @@ components: combat: { $ref: "#/components/schemas/CombatResults" } calc_version: type: string - description: engine snapshot stamp (e.g. "rocalc-2026-04-06") + description: engine snapshot stamp (backend name + data snapshot date) # --- /generate request + response --- diff --git a/calc-sidecar/src/backends/rocalc/index.ts b/calc-sidecar/src/backends/rocalc/index.ts index b084ab8..52f7482 100644 --- a/calc-sidecar/src/backends/rocalc/index.ts +++ b/calc-sidecar/src/backends/rocalc/index.ts @@ -1854,6 +1854,13 @@ export function createShim(): ShimSession { win.calc(); } + // supportedBuffs (ShimSession contract): the buff names this backend can + // bind, independent of class. The shim-contract parity test asserts the Go + // overlay is a subset of this, so it never reaches into BUFF_BINDINGS itself. + function supportedBuffs(): readonly string[] { + return Object.keys(BUFF_BINDINGS); + } + const session: ShimSession = { setStats, setLevel, @@ -1861,6 +1868,7 @@ export function createShim(): ShimSession { equip, setSkills, setBuffs, + supportedBuffs, setEnemy, setEnemyInline, readDerivedStats, diff --git a/calc-sidecar/src/backends/stub/index.ts b/calc-sidecar/src/backends/stub/index.ts index 9f3f970..35460de 100644 --- a/calc-sidecar/src/backends/stub/index.ts +++ b/calc-sidecar/src/backends/stub/index.ts @@ -95,6 +95,11 @@ export function createShim(): ShimSession { setBuffs(_buffs: Buff[]): void { // stub: deterministic fiction, buffs don't alter output }, + supportedBuffs(): readonly string[] | null { + // The stub accepts any buff name (no enforcement), so buff-binding parity + // is vacuous for it; null signals "not enforced" to callers. + return null; + }, setEnemy(id) { state.enemy = id; state.enemyInline = null; diff --git a/calc-sidecar/src/types.ts b/calc-sidecar/src/types.ts index eab1a37..06dc06d 100644 --- a/calc-sidecar/src/types.ts +++ b/calc-sidecar/src/types.ts @@ -180,6 +180,14 @@ export interface ShimSession { * setSkills/equip and before any read. */ setBuffs(buffs: Buff[]): void; + /** The set of self-buff names this backend recognizes (has a binding for), + * independent of the active class. The shim-contract parity test uses this to + * assert every declarable buff (the Go-side catalog overlay) is bindable, + * without reaching into backend internals. Returns null for backends that do + * not enforce buff names -- they accept any name, so the parity check is + * vacuous for them (e.g. the stub). */ + supportedBuffs(): readonly string[] | null; + /** Set the combat-sim target. mobId is engine-specific (rocalc currently * uses its m_Monster index; a mob iRO mapping pass will let this take iRO * mob ids the same way equip does for items). */ diff --git a/calc-sidecar/test/shim/buff-binding-parity.test.ts b/calc-sidecar/test/shim/buff-binding-parity.test.ts new file mode 100644 index 0000000..fe746b4 --- /dev/null +++ b/calc-sidecar/test/shim/buff-binding-parity.test.ts @@ -0,0 +1,57 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { createShim } from "../../src/shim.ts"; + +// Parity guard: every self-buff the Go side can declare (the catalog overlays) +// must have a binding in the active calc backend, else the buff silently does +// nothing and surfaces only at score time. This references ONLY the shim +// contract (ShimSession.supportedBuffs) -- never a backend's internal binding +// table -- so it stays correct across backends. Backends that do not enforce +// buff names (supportedBuffs() === null, e.g. the stub) make the check vacuous. + +// The overlays live in the Go catalog tree; they are the shared source of truth +// for buff names across the Go/sidecar boundary. class_innate_buffs.yaml carries +// class-mechanic buffs (e.g. Super Novice no_death_bonus) that also flow through +// setBuffs and therefore need a binding too. +const OVERLAY_DIR = join(import.meta.dirname, "../../../internal/catalog/data"); +const OVERLAYS = ["skill_buffs.yaml", "class_innate_buffs.yaml"]; + +// Buff names are the lowercase_snake value of a `name:` key inside a self_buff +// or class-innate entry. Scanned without a YAML-parser dependency: per line, +// drop any `#` comment, then match `name:`. The leading [\s{,] excludes +// `aegis_name:` (the char before "name:" there is "_"), and the lowercase-only +// value class excludes the uppercase aegis names. +function overlayBuffNames(): string[] { + const names = new Set(); + for (const file of OVERLAYS) { + const text = readFileSync(join(OVERLAY_DIR, file), "utf8"); + for (const raw of text.split("\n")) { + const hash = raw.indexOf("#"); + const line = hash === -1 ? raw : raw.slice(0, hash); + const m = line.match(/[\s{,]name:\s*([a-z][a-z0-9_]*)/); + if (m) names.add(m[1]); + } + } + return [...names]; +} + +test("every overlay buff name has a binding in the active backend", () => { + const names = overlayBuffNames(); + assert.ok( + names.length > 0, + "overlay scan found no buff names; check the regex/paths", + ); + + const supported = createShim().supportedBuffs(); + if (supported === null) return; // backend does not enforce buff names (stub) + + const supportedSet = new Set(supported); + const missing = names.filter((n) => !supportedSet.has(n)); + assert.deepEqual( + missing, + [], + `overlay buff(s) with no binding in the active backend: ${missing.join(", ")}`, + ); +}); diff --git a/calc-sidecar/test/shim/contract.test.ts b/calc-sidecar/test/shim/contract.test.ts index 2e0ead1..5b28b25 100644 --- a/calc-sidecar/test/shim/contract.test.ts +++ b/calc-sidecar/test/shim/contract.test.ts @@ -18,6 +18,7 @@ test("createShim returns an object with all required methods", () => { "equip", "setSkills", "setBuffs", + "supportedBuffs", "setEnemy", "setEnemyInline", "readDerivedStats", diff --git a/cmd/build-catalog/main.go b/cmd/build-catalog/main.go index f39c8ba..5a7c145 100644 --- a/cmd/build-catalog/main.go +++ b/cmd/build-catalog/main.go @@ -1,8 +1,8 @@ // build-catalog is a run-only refresh tool, not a deployable binary. It // reads emulator data and writes a single catalog.json that the runtime // API embeds into its binary at compile time. Source is selectable: -// Hercules (default) or rAthena. Same pattern as build-rocalc-mapping -// → mapping.json. +// Hercules (default) or rAthena. Same run-only-refresh pattern as the other +// one-shot data tools. // // Invoke via `go run ./cmd/build-catalog` (or `task catalog`); this // tool intentionally has no `task build:catalog` target. Running it @@ -148,7 +148,7 @@ func main() { // Layer the hand-authored self-buff overlay onto skill records. Lives at // internal/catalog/data/skill_buffs.yaml; see that file's comment block for - // the editing rules and the spec reference. + // the editing rules. skillBuffsAbs := resolvePath(repoRoot, skillBuffsPath) skillBuffs, err := loadSkillBuffs(skillBuffsAbs) if err != nil { @@ -747,7 +747,7 @@ func loadJobMaxLevels(herculesPath, repoRoot string) ([]data.JobMaxLevels, error // allocated (inherited) for a class but which the class cannot actually USE. A // Soul Linker / Star Gladiator was a TaeKwon Kid, so the flattened tree carries // every TK skill, but only a usable subset remains. Taekwon Ranker (TK_MISSION) -// is TaeKwon-Kid-only (rocalc models it solely in m_JobBuff[41]); without this it +// is TaeKwon-Kid-only (the calc engine applies it only for TaeKwon Kid); without this it // would wrongly surface as a self-buff for both 2nd classes. Keyed by shim-style // class name -> set of aegis names to drop. var usabilityExclusions = map[string]map[string]bool{ diff --git a/internal/api/oapi/oapi.gen.go b/internal/api/oapi/oapi.gen.go index 21872a8..158471b 100644 --- a/internal/api/oapi/oapi.gen.go +++ b/internal/api/oapi/oapi.gen.go @@ -483,7 +483,7 @@ type ScoreRequestBody struct { // ScoreResponse defines model for ScoreResponse. type ScoreResponse struct { - // CalcVersion engine snapshot stamp (e.g. "rocalc-2026-04-06") + // CalcVersion engine snapshot stamp (backend name + data snapshot date) CalcVersion string `json:"calc_version"` Combat *CombatResults `json:"combat,omitempty"` Derived DerivedStats `json:"derived"` @@ -1317,62 +1317,62 @@ func (sh *strictHandler) Score(w http.ResponseWriter, r *http.Request) { // const string: with thousands of chunks the chained `+` fold is several // times slower for the Go compiler than parsing a slice literal. var swaggerSpec = []string{ - "zFvtbhs31r6Vg3lf4LXRkaw4SdHXxv5IUrcN6jSGlaJYVIFBDY80jDnkhOTIVgPvz72AvcS9kgU/5kMa", - "jiWnibf5E42G5Dk8PB/Pcyh/SjJZlFKgMDo5+ZToLMeCuI8vicYLXrnPpZIlKsPQPc2JRvu/WZeYnCRM", - "GFyiSu7SpAzjt9/cpYnCjxVTSJOT3/0CYfT7tB4t5x8wM3aZlxXjtC8340S7DxR1plhpmBTJSaJzVowy", - "KYwimQE3CAQpEA5miZArluEsSWGWGILXN1JcXTNqvxiPx4dJI1wbxcTSCrd6lgUKYyX9r8JFcpL8z1Fr", - "pqNgo6OzeuAbUtqJHFfId006d4Pu0qSQFPt7kYKvYZaUCkcKBd4QPkuAacgqpVAYvgZdlaVUBmmSJiiq", - "wtqzMzyxlvaf3kc2p1GtUHWOqPPKEO8D96k/dYPu0sQwv0ytwryiSzROOuFMG5Y5/eiSFBjRZMshvOlq", - "HQZdYloVBVHrezyjt6tMITFIr4g7zoVUhf2UUGJwZFiBMQ/YOJLImkti8Eq3utxnsB+JwVrtuzRhNLpi", - "yclamzXH+MkMHdq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NQxAG3U4eR7dJ317Prb1qO2aK6ByOXfcJSiJYdriRHZyj", + "AOl1LGctgfJdjxhxvJAZ4UBtbMsy9KgrxZPTJDemPD0+5nZALrU5/Xb87Ti5f3//vwAAAP//", } // decodeSpec returns the embedded OpenAPI spec as raw JSON bytes, diff --git a/internal/api/score_test.go b/internal/api/score_test.go index 4e83d60..ed52832 100644 --- a/internal/api/score_test.go +++ b/internal/api/score_test.go @@ -31,7 +31,7 @@ func fakeSidecar(t *testing.T, status int, respBody string) (string, *[]byte) { return srv.URL, &captured } -const validDerivedJSON = `{"derived":{"hit":2,"flee":2,"cri":1,"atk":{"base":1,"plus":0},"matk":{"min":1,"max":1},"def":{"hard":0,"soft":1},"mdef":{"hard":0,"soft":1},"aspd":150.3,"maxHp":40,"maxSp":11,"statPointsRemaining":48},"calc_version":"rocalc-test"}` +const validDerivedJSON = `{"derived":{"hit":2,"flee":2,"cri":1,"atk":{"base":1,"plus":0},"matk":{"min":1,"max":1},"def":{"hard":0,"soft":1},"mdef":{"hard":0,"soft":1},"aspd":150.3,"maxHp":40,"maxSp":11,"statPointsRemaining":48},"calc_version":"calc-test"}` // scoreServer mounts a Server with the given scoring URL onto a fresh // mux. Returns the mux as an http.Handler so tests can drive it via diff --git a/internal/catalog/buffs_test.go b/internal/catalog/buffs_test.go index df6889d..ab8644b 100644 --- a/internal/catalog/buffs_test.go +++ b/internal/catalog/buffs_test.go @@ -39,11 +39,10 @@ func TestClassBuffs_Taekwon(t *testing.T) { // TestMildWindOrder pins the element unlock order for Mild Wind (TK_SEVENWIND) // read from the catalog. This is the SOURCE OF TRUTH for the unlock sequence; -// the sidecar's MILD_WIND_ORDER const in -// calc-sidecar/src/backends/rocalc/index.ts is a defense-in-depth mirror of -// exactly this list. If either diverges, the behavioral tests in -// calc-sidecar/test/backends/rocalc/buffs.test.ts (sidecar side) or this test -// (catalog side) will fail. Changing this order is a coordinated two-file edit. +// the sidecar's MILD_WIND_ORDER const (in the active calc backend) mirrors +// this list as defense-in-depth. If either diverges, the sidecar-side +// behavioral tests or this test (catalog side) will fail. Changing this +// order is a coordinated two-file edit. func TestMildWindOrder(t *testing.T) { c, err := Load() if err != nil { @@ -69,7 +68,7 @@ func TestMildWindOrder(t *testing.T) { // Canonical order: index (1-based) == required Mild Wind level. // earth=1, wind=2, water=3, fire=4, ghost=5, shadow=6, holy=7. - // Mirrors MILD_WIND_ORDER in calc-sidecar/src/backends/rocalc/index.ts. + // Mirrors MILD_WIND_ORDER in the active calc backend. want := []string{"earth", "wind", "water", "fire", "ghost", "shadow", "holy"} got := mildWind.SelfBuff.Endow.Elements if len(got) != len(want) { @@ -488,7 +487,7 @@ func TestClassBuffs_Champion(t *testing.T) { } } -// Monk and Champion share an identical rocalc job-buff bank, so Monk surfaces the +// Monk and Champion share an identical calc-engine job-buff bank, so Monk surfaces the // same 8 buffs (no trans-only gating). Pins that these buffs are not Champion-gated. func TestClassBuffs_Monk(t *testing.T) { c, err := Load() @@ -558,7 +557,7 @@ func TestClassBuffs_Paladin(t *testing.T) { } } -// Crusader and Paladin share an identical rocalc job-buff bank, so Crusader +// Crusader and Paladin share an identical calc-engine job-buff bank, so Crusader // surfaces the same 11 buffs (no trans-only gating). Pins that the two new CR_ // buffs are not Paladin-gated. func TestClassBuffs_Crusader(t *testing.T) { @@ -657,8 +656,9 @@ func TestClassBuffs_Gunslinger(t *testing.T) { t.Errorf("buff %q: kind %q, want %q", name, got[name], kind) } } - // Regression lock: Gunslinger's bank is exactly these 8 (m_JobBuff[45] minus 537 - // ALL_INCCARRY). It is an Expanded class with no trans split and no inherited + // Regression lock: Gunslinger's bank is exactly these 8 (the calc engine's + // job-buff bank, minus the ALL_INCCARRY carry-weight entry). It is an Expanded + // class with no trans split and no inherited // buffs, so this set must not change unless a GS skill is added or removed // deliberately. if len(buffs) != 8 { @@ -880,7 +880,7 @@ func TestClassBuffs_Ninja(t *testing.T) { // SL-specific kaina (the only scored SL buff, +maxSp), and shares the 4 inert // TaeKwon skills (tumbling/peaceful_break/happy_break/kihop) with TK and SG. // taekwon_ranker is TaeKwon-Kid-only (usability exclusion in cmd/build-catalog), -// so it must NOT surface here. The Soul Link / Ka / Es skills are not in rocalc's bank. +// so it must NOT surface here. The Soul Link / Ka / Es skills are not in the calc engine's bank. func TestClassBuffs_SoulLinker(t *testing.T) { c, err := Load() if err != nil { @@ -988,8 +988,8 @@ func TestClassBuffs_Wizard_ExcludesHighWizardOnly(t *testing.T) { } } -// Alchemist (base) and Creator (trans) have identical rocalc banks -// (m_JobBuff[19] == m_JobBuff[33] == [537,59,68,241]), so both expose the same +// Alchemist (base) and Creator (trans) have identical calc-engine banks +// (the base and trans banks are byte-identical), so both expose the same // two buffs: axe_mastery (new) + crazy_uproar (inherited via the Merchant tree). // 537/59 (carry-weight) are excluded. No trans split -- this asserts both keys. func TestClassBuffs_Alchemist(t *testing.T) { @@ -1028,7 +1028,7 @@ func TestClassBuffs_Alchemist(t *testing.T) { } // Super Novice (Expanded) inherits 16 first-class buffs across all six trees. -// All 16 gate (catalog tree) and drive (rocalc m_JobBuff[20] / class-generic +// All 16 gate (catalog tree) and drive (the calc engine's job-buff bank / class-generic // support+debuf banks). no_death_bonus is NOT here -- it is an innate buff (see // TestClassInnateBuffs_SuperNovice). func TestClassBuffs_SuperNovice(t *testing.T) { diff --git a/internal/catalog/catalog.go b/internal/catalog/catalog.go index 8ddeb16..88237e6 100644 --- a/internal/catalog/catalog.go +++ b/internal/catalog/catalog.go @@ -91,8 +91,8 @@ func Load() (*Catalog, error) { mobs: make(map[int]data.Mob, len(f.Mobs)), skills: make(map[int]data.Skill, len(f.Skills)), } - // First-seen wins on id collision (matches build-rocalc-mapping's - // policy and protects against stray duplicate-id rows in the source). + // First-seen wins on id collision (protects against stray duplicate-id + // rows in the source). for _, it := range f.Items { if _, exists := c.items[it.ID]; exists { continue @@ -267,7 +267,7 @@ type ClassSkillRequirement struct { } // ClassSkill is one entry from a class's skill tree joined against the -// per-skill metadata in m_Skill. Catalog-side projection used by both +// per-skill metadata in the catalog. Catalog-side projection used by both // the orchestrator's user-prompt block and the list_class_skills tool; // each caller projects further to its own consumer-specific shape. type ClassSkill struct { diff --git a/internal/catalog/data/class_innate_buffs.yaml b/internal/catalog/data/class_innate_buffs.yaml index 69cd328..5bf109f 100644 --- a/internal/catalog/data/class_innate_buffs.yaml +++ b/internal/catalog/data/class_innate_buffs.yaml @@ -7,10 +7,8 @@ # skill_buffs.yaml. Not inherited through the tree (class-specific). classes: super_novice: - # No-Death Bonus (rocalc "No-Death Bonus", id 309): +10 to ALL stats, flat. + # No-Death Bonus: +10 to ALL stats, flat. # The Super Novice guardian-angel bonus, earned by reaching base-level # milestones without dying. Opt-in: the LLM declares it when modeling the # no-death endgame state. - - name: no_death_bonus - kind: stat_buff - persistence: permanent + - { name: no_death_bonus, kind: stat_buff, persistence: permanent } diff --git a/internal/catalog/data/skill_buffs.yaml b/internal/catalog/data/skill_buffs.yaml index 4fa38ba..cb2e57f 100644 --- a/internal/catalog/data/skill_buffs.yaml +++ b/internal/catalog/data/skill_buffs.yaml @@ -1,7 +1,7 @@ # Hand-authored self-buff metadata. Merged onto skill records (by aegis_name) # at catalog build time by cmd/build-catalog. Co-located with the skill the -# buff comes from. Semantic only: no rocalc ids (the sidecar binding maps -# name -> engine controls). See docs/superpowers/specs/2026-06-01-rocalc-self-buffs-design.md. +# buff comes from. Semantic only: no calc-engine ids (the sidecar binding maps +# name -> engine controls). # # kind: weapon_endow | stat_buff | status | debuff | land (data.AllBuffKinds) # persistence: permanent | transient (data.AllPersistence) @@ -16,22 +16,16 @@ skills: endow: # This list is the SOURCE OF TRUTH for Mild Wind's element unlock order. # Index (1-based) == required skill level: earth=1, wind=2, ..., holy=7. - # The calc sidecar's MILD_WIND_ORDER const in - # calc-sidecar/src/backends/rocalc/index.ts mirrors this order + # The calc sidecar's MILD_WIND_ORDER const in the active backend's + # index.ts mirrors this order # (defense-in-depth; the sidecar cannot read the catalog). # Keep the two in sync: any reorder here must be reflected there, # and TestMildWindOrder in internal/catalog/buffs_test.go pins this list. elements: [earth, wind, water, fire, ghost, shadow, holy] - aegis_name: TK_RUN # Sprint, id 411 (Spurt status: +STR/ATK, 150s) - self_buff: - name: spurt - kind: stat_buff - persistence: transient + self_buff: { name: spurt, kind: stat_buff, persistence: transient } - aegis_name: TK_MISSION # Taekwon Mission, id 493 -- ranker anchor - self_buff: - name: taekwon_ranker - kind: status - persistence: permanent + self_buff: { name: taekwon_ranker, kind: status, persistence: permanent } # --- High Priest (and inherited Acolyte/Priest) self-buffs --- # Player support buffs -> sidecar support_slot driver (A2_Skill* bank). @@ -68,28 +62,28 @@ skills: # --- Scholar (Professor / Sage) self-buffs --- # Elemental weapon endows -> existing weapon_endow driver (A_Weapon_element). # Single-element each (like Aspersio); resolveBuffs forces the matching element. - - aegis_name: SA_FLAMELAUNCHER # Flame Launcher (Endow Blaze), rocalc 280, max 5 + - aegis_name: SA_FLAMELAUNCHER # Flame Launcher (Endow Blaze), max 5 self_buff: name: flame_launcher kind: weapon_endow persistence: transient endow: elements: [fire] - - aegis_name: SA_FROSTWEAPON # Frost Weapon (Endow Tsunami), rocalc 281, max 5 + - aegis_name: SA_FROSTWEAPON # Frost Weapon (Endow Tsunami), max 5 self_buff: name: frost_weapon kind: weapon_endow persistence: transient endow: elements: [water] - - aegis_name: SA_LIGHTNINGLOADER # Lightning Loader (Endow Tornado), rocalc 282, max 5 + - aegis_name: SA_LIGHTNINGLOADER # Lightning Loader (Endow Tornado), max 5 self_buff: name: lightning_loader kind: weapon_endow persistence: transient endow: elements: [wind] - - aegis_name: SA_SEISMICWEAPON # Seismic Weapon (Endow Quake), rocalc 283, max 5 + - aegis_name: SA_SEISMICWEAPON # Seismic Weapon (Endow Quake), max 5 self_buff: name: seismic_weapon kind: weapon_endow @@ -109,324 +103,319 @@ skills: self_buff: { name: mind_breaker, kind: debuff, persistence: transient } - aegis_name: PF_SPIDERWEB # Spider Web (Fiber Lock), max 1; B_debuf17 checkbox; +fire dmg, flee down self_buff: { name: spider_web, kind: debuff, persistence: transient } - # A_skill passives / self-cast -> existing skill_slot driver (rocalc ids; allocation - # alone drops them due to iRO<->rocalc id divergence). - - aegis_name: MG_ENERGYCOAT # Energy Coat, rocalc 58, max 1; cuts incoming physical + # A_skill passives / self-cast -> existing skill_slot driver (the engine's bank + # ids diverge from Aegis ids; allocation alone drops them). + - aegis_name: MG_ENERGYCOAT # Energy Coat, max 1; cuts incoming physical self_buff: { name: energy_coat, kind: status, persistence: transient } - - aegis_name: SA_ADVANCEDBOOK # Study (Advanced Book), rocalc 224, max 10; +HIT/+ASPD with a book + - aegis_name: SA_ADVANCEDBOOK # Study (Advanced Book), max 10; +HIT/+ASPD with a book self_buff: { name: study, kind: stat_buff, persistence: permanent } - - aegis_name: SA_DRAGONOLOGY # Dragonology, rocalc 234, max 5; +MATK (derived-only in the auto-attack sim) + - aegis_name: SA_DRAGONOLOGY # Dragonology, max 5; +MATK (derived-only in the auto-attack sim) self_buff: { name: dragonology, kind: stat_buff, persistence: permanent } - - aegis_name: PF_MEMORIZE # Foresight (Memorize), rocalc 322, max 1; cast-time (not yet scored) + - aegis_name: PF_MEMORIZE # Foresight (Memorize), max 1; cast-time (not yet scored) self_buff: { name: foresight, kind: stat_buff, persistence: transient } - - aegis_name: PF_DOUBLECASTING # Double Casting, rocalc 441, max 5; bolt double (not yet scored) + - aegis_name: PF_DOUBLECASTING # Double Casting, max 5; bolt double (not yet scored) self_buff: { name: double_casting, kind: stat_buff, persistence: transient } # --- Assassin Cross (and inherited Thief / Assassin) self-buffs --- # All driven via existing seams: weapon_endow (Enchant Poison) and skill_slot - # (everything else). rocalc ids diverge from Aegis ids, so allocation alone - # drops these passives -- the skill_slot bindings carry the rocalc id. - - aegis_name: ASC_EDP # Enchant Deadly Poison, rocalc 266, max 5; big ATK multiplier (no element change in pre-renewal) + # (everything else). The engine's bank ids diverge from Aegis ids, so allocation + # alone drops these passives -- the skill_slot bindings carry the engine's bank id. + - aegis_name: ASC_EDP # Enchant Deadly Poison, max 5; big ATK multiplier (no element change in pre-renewal) self_buff: { name: enchant_deadly_poison, kind: stat_buff, persistence: transient } - - aegis_name: AS_ENCHANTPOISON # Enchant Poison, rocalc 85, max 10 -> poison weapon endow + - aegis_name: AS_ENCHANTPOISON # Enchant Poison, max 10 -> poison weapon endow self_buff: name: enchant_poison kind: weapon_endow persistence: transient endow: elements: [poison] - - aegis_name: ASC_KATAR # Advanced Katar Mastery, rocalc 262, max 5 + - aegis_name: ASC_KATAR # Advanced Katar Mastery, max 5 self_buff: { name: advanced_katar_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: AS_KATAR # Katar Mastery, rocalc 81, max 10 + - aegis_name: AS_KATAR # Katar Mastery, max 10 self_buff: { name: katar_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: AS_RIGHT # Right-Hand Mastery, rocalc 79, max 5 + - aegis_name: AS_RIGHT # Right-Hand Mastery, max 5 self_buff: { name: right_hand_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: AS_LEFT # Left-Hand Mastery, rocalc 80, max 5 + - aegis_name: AS_LEFT # Left-Hand Mastery, max 5 self_buff: { name: left_hand_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: TF_DOUBLE # Double Attack, rocalc 13, max 10 + - aegis_name: TF_DOUBLE # Double Attack, max 10 self_buff: { name: double_attack, kind: stat_buff, persistence: permanent } - - aegis_name: TF_MISS # Improve Dodge, rocalc 14, max 10 + - aegis_name: TF_MISS # Improve Dodge, max 10 self_buff: { name: improve_dodge, kind: stat_buff, persistence: permanent } - - aegis_name: AS_SONICACCEL # Sonic Acceleration, rocalc 381, max 1; enhances Sonic Blow only -- NOT scored in the auto-attack sim + - aegis_name: AS_SONICACCEL # Sonic Acceleration, max 1; enhances Sonic Blow only -- NOT scored in the auto-attack sim self_buff: { name: sonic_acceleration, kind: status, persistence: permanent } # --- Sniper (and inherited Archer / Hunter) self-buffs --- - # All driven via the existing skill_slot seam (m_JobBuff A_skill bank). rocalc - # ids diverge from Aegis ids, so allocation alone drops these -- the bindings - # carry the rocalc id. Owl's / Vulture's scale +1/level (up to +10). - - aegis_name: AC_OWL # Owl's Eye, rocalc 38, max 10; DEX +1/level (up to +10) + # All driven via the existing skill_slot seam (the calc engine's job-buff bank). + # The engine's bank ids diverge from Aegis ids, so allocation alone drops these -- + # the bindings carry the engine's bank id. Owl's / Vulture's scale +1/level (up to +10). + - aegis_name: AC_OWL # Owl's Eye, max 10; DEX +1/level (up to +10) self_buff: { name: owls_eye, kind: stat_buff, persistence: permanent } - - aegis_name: AC_VULTURE # Vulture's Eye, rocalc 39, max 10; HIT +1/level (up to +10) + bow range + - aegis_name: AC_VULTURE # Vulture's Eye, max 10; HIT +1/level (up to +10) + bow range self_buff: { name: vultures_eye, kind: stat_buff, persistence: permanent } - - aegis_name: AC_CONCENTRATION # Improve Concentration, rocalc 42, max 10; AGI & DEX % steroid + - aegis_name: AC_CONCENTRATION # Improve Concentration, max 10; AGI & DEX % steroid self_buff: { name: improve_concentration, kind: stat_buff, persistence: transient } - - aegis_name: HT_BEASTBANE # Beast Bane, rocalc 116, max 10; +ATK vs Brute/Insect race only + - aegis_name: HT_BEASTBANE # Beast Bane, max 10; +ATK vs Brute/Insect race only self_buff: { name: beast_bane, kind: stat_buff, persistence: permanent } - - aegis_name: HT_STEELCROW # Steel Crow, rocalc 119, max 10; +Blitz Beat damage -- auto-attack sim does not score Blitz Beat, so not reflected yet + - aegis_name: HT_STEELCROW # Steel Crow, max 10; +Blitz Beat damage -- auto-attack sim does not score Blitz Beat, so not reflected yet self_buff: { name: steel_crow, kind: status, persistence: permanent } - - aegis_name: SN_SIGHT # True Sight (catalog "Falcon Eyes"), rocalc 270, max 10; trans-only; all stats +5, +ATK/HIT/CRIT + - aegis_name: SN_SIGHT # True Sight (catalog "Falcon Eyes"), max 10; trans-only; all stats +5, +ATK/HIT/CRIT self_buff: { name: true_sight, kind: stat_buff, persistence: transient } - - aegis_name: SN_WINDWALK # Wind Walk (catalog "Wind Walker"), rocalc 273, max 10; trans-only; +flee, +move speed + - aegis_name: SN_WINDWALK # Wind Walk (catalog "Wind Walker"), max 10; trans-only; +flee, +move speed self_buff: { name: wind_walk, kind: stat_buff, persistence: transient } # --- Whitesmith (and inherited Merchant / Blacksmith) self-buffs --- - # Nine ride the existing skill_slot seam (m_JobBuff A_skill bank); rocalc ids - # diverge from Aegis ids, so the bindings carry the rocalc id. Weapon - # Perfection is not in the job bank -- rocalc models it as a supportive buff, - # so it rides support_slot (A2_Skill7 checkbox). rocalc deliberately omits - # Weapon Perfection from m_JobBuff[26] (skips its id 153). - - aegis_name: BS_OVERTHRUST # Over Thrust ("Power-Thrust"), rocalc 154, max 5; +%ATK + # Nine ride the existing skill_slot seam (the calc engine's job-buff bank); the + # engine's bank ids diverge from Aegis ids, so the bindings carry the engine's bank + # id. Weapon Perfection is not in the job bank -- the calc engine models it as a + # supportive buff, so it rides support_slot (A2_Skill7 checkbox). The calc engine + # deliberately omits Weapon Perfection from the job-buff bank (skips its id 153). + - aegis_name: BS_OVERTHRUST # Over Thrust ("Power-Thrust"), max 5; +%ATK self_buff: { name: over_thrust, kind: stat_buff, persistence: transient } - - aegis_name: WS_OVERTHRUSTMAX # Maximum Over Thrust (catalog "Maximum Power Thrust"), rocalc 327, max 5; Whitesmith-only; bigger +%ATK + - aegis_name: WS_OVERTHRUSTMAX # Maximum Over Thrust (catalog "Maximum Power Thrust"), max 5; Whitesmith-only; bigger +%ATK self_buff: { name: maximum_over_thrust, kind: stat_buff, persistence: transient } - - aegis_name: BS_MAXIMIZE # Maximize Power, rocalc 155, max 5; weapon damage always max roll + - aegis_name: BS_MAXIMIZE # Maximize Power, max 5; weapon damage always max roll self_buff: { name: maximize_power, kind: stat_buff, persistence: transient } - - aegis_name: BS_ADRENALINE # Adrenaline Rush, rocalc 152, max 5; +ASPD/+HIT for Axe & Mace + - aegis_name: BS_ADRENALINE # Adrenaline Rush, max 5; +ASPD/+HIT for Axe & Mace self_buff: { name: adrenaline_rush, kind: stat_buff, persistence: transient } - - aegis_name: BS_ADRENALINE2 # Advanced Adrenaline Rush, rocalc 389, max 1; +ASPD for all weapons + - aegis_name: BS_ADRENALINE2 # Advanced Adrenaline Rush, max 1; +ASPD for all weapons self_buff: { name: advanced_adrenaline_rush, kind: stat_buff, persistence: transient } - - aegis_name: BS_WEAPONRESEARCH # Weaponry Research, rocalc 148, max 10; +2 ATK & +2 HIT per level + - aegis_name: BS_WEAPONRESEARCH # Weaponry Research, max 10; +2 ATK & +2 HIT per level self_buff: { name: weaponry_research, kind: stat_buff, persistence: permanent } - - aegis_name: MC_LOUD # Crazy Uproar, rocalc 68, max 1; +5 STR (note: catalog id 155 != rocalc id 155 = Maximize) + - aegis_name: MC_LOUD # Crazy Uproar, max 1; +5 STR self_buff: { name: crazy_uproar, kind: stat_buff, persistence: transient } - - aegis_name: BS_HILTBINDING # Hilt Binding, rocalc 146, max 1; +1 ATK passive + - aegis_name: BS_HILTBINDING # Hilt Binding, max 1; +1 ATK passive self_buff: { name: hilt_binding, kind: stat_buff, persistence: permanent } - - aegis_name: BS_SKINTEMPER # Skin Tempering, rocalc 150, max 5; fire/neutral resist -- defensive, not scored by the auto-attack sim + - aegis_name: BS_SKINTEMPER # Skin Tempering, max 5; fire/neutral resist -- defensive, not scored by the auto-attack sim self_buff: { name: skin_tempering, kind: status, persistence: permanent } - aegis_name: BS_WEAPONPERFECT # Weapon Perfection, support bank A2_Skill7 checkbox, max 5; ignore weapon size penalty self_buff: { name: weapon_perfection, kind: stat_buff, persistence: transient } # --- Lord Knight (and inherited Swordman / Knight) self-buffs --- - # All 13 live in the rocalc job-buff bank (m_JobBuff[21]) and ride the - # skill_slot seam; rocalc ids diverge from Aegis ids, so the bindings carry the - # rocalc id. The four LK_ skills (Aura Blade, Concentration, Berserk, Parrying) - # are trans-only; the SM_/KN_ skills are inherited down the Swordman/Knight - # line. 537 (ALL_INCCARRY, universal carry-weight) is left unbound -- see the - # comment on the Lord Knight block in index.ts. - - aegis_name: SM_SWORD # Sword Mastery, rocalc 3, max 10; +ATK with 1H swords + # All 13 live in the calc engine's job-buff bank and ride the + # skill_slot seam; the engine's bank ids diverge from Aegis ids, so the bindings + # carry the engine's bank id. The four LK_ skills (Aura Blade, Concentration, + # Berserk, Parrying) are trans-only; the SM_/KN_ skills are inherited down the + # Swordman/Knight line. ALL_INCCARRY (universal carry-weight) is left unbound -- + # see the comment on the Lord Knight block in index.ts. + - aegis_name: SM_SWORD # Sword Mastery, max 10; +ATK with 1H swords self_buff: { name: sword_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: SM_TWOHAND # Two-Handed Sword Mastery, rocalc 4, max 10; +ATK with 2H swords + - aegis_name: SM_TWOHAND # Two-Handed Sword Mastery, max 10; +ATK with 2H swords self_buff: { name: two_handed_sword_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: KN_SPEARMASTERY # Spear Mastery, rocalc 69, max 10; +ATK with spears + - aegis_name: KN_SPEARMASTERY # Spear Mastery, max 10; +ATK with spears self_buff: { name: spear_mastery, kind: stat_buff, persistence: permanent } - - aegis_name: KN_TWOHANDQUICKEN # Twohand Quicken, rocalc 74, max 10; +ASPD with 2H swords + - aegis_name: KN_TWOHANDQUICKEN # Twohand Quicken, max 10; +ASPD with 2H swords self_buff: { name: twohand_quicken, kind: stat_buff, persistence: transient } - - aegis_name: KN_ONEHAND # Onehand Quicken, rocalc 386, max 1; +ASPD with 1H swords (Soul Link) + - aegis_name: KN_ONEHAND # Onehand Quicken, max 1; +ASPD with 1H swords (Soul Link) self_buff: { name: onehand_quicken, kind: stat_buff, persistence: transient } - - aegis_name: LK_AURABLADE # Aura Blade, rocalc 254, max 5; trans-only; +fixed added damage + - aegis_name: LK_AURABLADE # Aura Blade, max 5; trans-only; +fixed added damage self_buff: { name: aura_blade, kind: stat_buff, persistence: transient } - - aegis_name: LK_CONCENTRATION # Concentration (Spear Dynamo), rocalc 256, max 5; trans-only; +ATK/+HIT, -DEF/-flee + - aegis_name: LK_CONCENTRATION # Concentration (Spear Dynamo), max 5; trans-only; +ATK/+HIT, -DEF/-flee self_buff: { name: concentration, kind: stat_buff, persistence: transient } - - aegis_name: LK_BERSERK # Berserk (catalog "Frenzy"), rocalc 258, max 1; trans-only; +ATK/+ASPD, DEF->0 + - aegis_name: LK_BERSERK # Berserk (catalog "Frenzy"), max 1; trans-only; +ATK/+ASPD, DEF->0 self_buff: { name: berserk, kind: stat_buff, persistence: transient } - - aegis_name: SM_AUTOBERSERK # Auto Berserk, rocalc 12, max 1; rocalc applies a Provoke-like ATK boost + enemy DEF reduction through the combat sim + - aegis_name: SM_AUTOBERSERK # Auto Berserk, max 1; the calc engine applies a Provoke-like ATK boost + enemy DEF reduction through the combat sim self_buff: { name: auto_berserk, kind: stat_buff, persistence: permanent } - - aegis_name: SM_ENDURE # Endure, rocalc 9, max 10; knockback resist / +MDEF -- defensive, not scored by the auto-attack sim + - aegis_name: SM_ENDURE # Endure, max 10; knockback resist / +MDEF -- defensive, not scored by the auto-attack sim self_buff: { name: endure, kind: status, persistence: transient } - - aegis_name: SM_RECOVERY # Increase HP Recovery, rocalc 5, max 10; HP regen -- sustain, not scored by the auto-attack sim + - aegis_name: SM_RECOVERY # Increase HP Recovery, max 10; HP regen -- sustain, not scored by the auto-attack sim self_buff: { name: increase_hp_recovery, kind: status, persistence: permanent } - - aegis_name: KN_CAVALIERMASTERY # Cavalier Mastery, rocalc 78, max 5; mounted ASPD-penalty reduction -- inert unmounted + - aegis_name: KN_CAVALIERMASTERY # Cavalier Mastery, max 5; mounted ASPD-penalty reduction -- inert unmounted self_buff: { name: cavalier_mastery, kind: status, persistence: permanent } - - aegis_name: LK_PARRYING # Parrying, rocalc 255, max 10; trans-only; frontal physical block -- defensive + - aegis_name: LK_PARRYING # Parrying, max 10; trans-only; frontal physical block -- defensive self_buff: { name: parrying, kind: status, persistence: transient } # --- Champion (and inherited Monk / Acolyte) self-buffs --- - # All 8 live in the rocalc job-buff bank (m_JobBuff[29], identical to Monk's - # [15] -- no trans gating), driven via the skill_slot seam; rocalc ids diverge - # from Aegis ids, so the bindings carry the rocalc id. AL_DEMONBANE / AL_DP are - # Acolyte skills, so they also light up for the rest of the Acolyte tree - # (Priest / High Priest / Monk). Excluded from the bank: 537 (ALL_INCCARRY - # weight), 301 (rocalc triple-attack-delay counter), 362 (SG_FRIEND, a Star - # Gladiator skill Monk cannot learn) -- see the Champion block in index.ts. - - aegis_name: AL_DEMONBANE # Demon Bane, rocalc 24, max 10; +ATK vs Undead element / Demon race (scored via damage.ave vs those targets) + # All 8 live in the calc engine's job-buff bank (identical to Monk's -- + # no trans gating), driven via the skill_slot seam; the engine's bank ids diverge + # from Aegis ids, so the bindings carry the engine's bank id. AL_DEMONBANE / AL_DP + # are Acolyte skills, so they also light up for the rest of the Acolyte tree + # (Priest / High Priest / Monk). Excluded from the bank: ALL_INCCARRY weight, the + # triple-attack-delay counter, and SG_FRIEND (a Star Gladiator skill Monk cannot + # learn) -- see the Champion block in index.ts. + - aegis_name: AL_DEMONBANE # Demon Bane, max 10; +ATK vs Undead element / Demon race (scored via damage.ave vs those targets) self_buff: { name: demon_bane, kind: stat_buff, persistence: permanent } - - aegis_name: MO_IRONHAND # Iron Fists, rocalc 183, max 10; +damage with fist/knuckle weapons + - aegis_name: MO_IRONHAND # Iron Fists, max 10; +damage with fist/knuckle weapons self_buff: { name: iron_fists, kind: stat_buff, persistence: permanent } - - aegis_name: MO_TRIPLEATTACK # Raging Trifecta Blow (Triple Attack), rocalc 187, max 10; 3-hit proc, scored via damage.secondAve + - aegis_name: MO_TRIPLEATTACK # Raging Trifecta Blow (Triple Attack), max 10; 3-hit proc, scored via damage.secondAve self_buff: { name: triple_attack, kind: stat_buff, persistence: permanent } - - aegis_name: MO_DODGE # Dodge, rocalc 191, max 10; +flee (scored via readDerivedStats().flee) + - aegis_name: MO_DODGE # Dodge, max 10; +flee (scored via readDerivedStats().flee) self_buff: { name: dodge, kind: stat_buff, persistence: permanent } - - aegis_name: MO_EXPLOSIONSPIRITS # Fury (Critical Explosion), rocalc 195, max 5; +crit (scored via readDerivedStats().cri), active toggle + - aegis_name: MO_EXPLOSIONSPIRITS # Fury (Critical Explosion), max 5; +crit (scored via readDerivedStats().cri), active toggle self_buff: { name: fury, kind: stat_buff, persistence: transient } - - aegis_name: MO_SPIRITSRECOVERY # Spiritual Cadence (Spirits Recovery), rocalc 184, max 5; HP/SP regen -- sustain, not scored by the auto-attack sim + - aegis_name: MO_SPIRITSRECOVERY # Spiritual Cadence (Spirits Recovery), max 5; HP/SP regen -- sustain, not scored by the auto-attack sim self_buff: { name: spiritual_cadence, kind: status, persistence: permanent } - - aegis_name: AL_DP # Divine Protection, rocalc 23, max 10; +DEF/MDEF vs Undead/Demon -- defensive, not scored by the auto-attack sim + - aegis_name: AL_DP # Divine Protection, max 10; +DEF/MDEF vs Undead/Demon -- defensive, not scored by the auto-attack sim self_buff: { name: divine_protection, kind: status, persistence: permanent } - - aegis_name: MO_STEELBODY # Mental Strength (Steel Body), rocalc 196, max 5; DEF/MDEF->90% but -ASPD/-move -- defensive, may lower offense + - aegis_name: MO_STEELBODY # Mental Strength (Steel Body), max 5; DEF/MDEF->90% but -ASPD/-move -- defensive, may lower offense self_buff: { name: mental_strength, kind: status, persistence: transient } # --- Paladin (Crusader-rooted) self-buffs --- # Only Faith and Spear Quicken are new here; the other 9 entries in Paladin's bank - # (m_JobBuff[27], identical to Crusader's [13] -- no trans gating) are already bound + # (identical to Crusader's -- no trans gating) are already bound # via the Lord Knight (Sword / Two-Hand / Spear Mastery, Auto Berserk, Endure, # Increase HP Recovery, Cavalier Mastery) and Champion (Demon Bane, Divine # Protection) overlay rows. Both new skills are CR_ (Crusader-only root), so they # light up for Crusader and Paladin only. Spear Quicken's ASPD applies to two-handed - # spears only (correct rocalc behavior). See the Paladin block in index.ts. - - aegis_name: CR_TRUST # Faith, rocalc 156, max 10; +MaxHP / +Holy resist (scored via readDerivedStats().maxHp) + # spears only (correct behavior). See the Paladin block in index.ts. + - aegis_name: CR_TRUST # Faith, max 10; +MaxHP / +Holy resist (scored via readDerivedStats().maxHp) self_buff: { name: faith, kind: stat_buff, persistence: transient } - - aegis_name: CR_SPEARQUICKEN # Spear Quicken, rocalc 166, max 10; +ASPD with two-handed spears (scored via readDerivedStats().aspd) + - aegis_name: CR_SPEARQUICKEN # Spear Quicken, max 10; +ASPD with two-handed spears (scored via readDerivedStats().aspd) self_buff: { name: spear_quicken, kind: stat_buff, persistence: transient } # --- Stalker (Rogue line) self-buffs --- # Only Close Confine, Stealth (Chase Walk), and Counter Instinct (Reject Sword) are - # new here; the other 4 entries in Stalker's bank (m_JobBuff[28]) -- Double Attack / + # new here; the other 4 entries in Stalker's bank -- Double Attack / # Improve Dodge (Assassin Cross), Sword Mastery (Lord Knight), Vulture's Eye (Sniper) # -- are already bound. close_confine is a base Rogue skill (Rogue + Stalker); stealth - # and counter_instinct are Stalker trans-only. Excluded: 537 (weight), 301 (rocalc - # triple-attack-delay counter), 187 (Raging Trifecta Blow = MO_TRIPLEATTACK, + # and counter_instinct are Stalker trans-only. Excluded: weight, the + # triple-attack-delay counter, and Raging Trifecta Blow (MO_TRIPLEATTACK, # Plagiarism-only, not in the native tree). See the Stalker block in index.ts. - - aegis_name: RG_CLOSECONFINE # Close Confine, rocalc 383, max 1; locks user+target, +flee while active (scored via readDerivedStats().flee) + - aegis_name: RG_CLOSECONFINE # Close Confine, max 1; locks user+target, +flee while active (scored via readDerivedStats().flee) self_buff: { name: close_confine, kind: stat_buff, persistence: transient } - - aegis_name: ST_CHASEWALK # Stealth (Chase Walk), rocalc 286, max 5; +STR while stealthed -> +ATK (scored via readCombatResults().damage.ave) + - aegis_name: ST_CHASEWALK # Stealth (Chase Walk), max 5; +STR while stealthed -> +ATK (scored via readCombatResults().damage.ave) self_buff: { name: stealth, kind: stat_buff, persistence: transient } - - aegis_name: ST_REJECTSWORD # Counter Instinct (Reject Sword), rocalc 287, max 5; reflects physical from sword/dagger/2H-sword -- defensive, not scored by the auto-attack sim + - aegis_name: ST_REJECTSWORD # Counter Instinct (Reject Sword), max 5; reflects physical from sword/dagger/2H-sword -- defensive, not scored by the auto-attack sim self_buff: { name: counter_instinct, kind: status, persistence: transient } # --- Gunslinger self-buffs --- - # Expanded class: a single skill_slot bank (m_JobBuff[45]), no trans gating, and the + # Expanded class: a single skill_slot bank, no trans gating, and the # GS_ skills are gun-class-exclusive in pre-renewal (they also appear in renewal - # Rebellion / baby trees, out of scope). Nothing is inherited. Excluded: 537 - # (ALL_INCCARRY weight). Guns are already mapped (revolver / rifle / shotgun / + # Rebellion / baby trees, out of scope). Nothing is inherited. Excluded: + # ALL_INCCARRY weight. Guns are already mapped (revolver / rifle / shotgun / # gatling / grenade), so all 8 verify against a real gun (Gatling Fever needs a # W_GATLING like Drifter, not a grenade launcher). flip_the_coin moves damage.ave - # (rocalc models the coin-damage bonus). See the Gunslinger block in index.ts. - - aegis_name: GS_SINGLEACTION # Single Action, rocalc 425, max 10; +HIT/+ASPD with a gun (readDerivedStats().hit + .aspd) + # (the calc engine models the coin-damage bonus). See the Gunslinger block in index.ts. + - aegis_name: GS_SINGLEACTION # Single Action, max 10; +HIT/+ASPD with a gun (readDerivedStats().hit + .aspd) self_buff: { name: single_action, kind: stat_buff, persistence: transient } - - aegis_name: GS_SNAKEEYE # Snake Eye, rocalc 426, max 10; +HIT/+range with guns (readDerivedStats().hit) + - aegis_name: GS_SNAKEEYE # Snake Eye, max 10; +HIT/+range with guns (readDerivedStats().hit) self_buff: { name: snake_eye, kind: stat_buff, persistence: transient } - - aegis_name: GS_INCREASING # Increasing Accuracy, rocalc 422, max 1; +20 HIT/+4 DEX/+4 AGI (readDerivedStats().hit) + - aegis_name: GS_INCREASING # Increasing Accuracy, max 1; +20 HIT/+4 DEX/+4 AGI (readDerivedStats().hit) self_buff: { name: increasing_accuracy, kind: stat_buff, persistence: transient } - - aegis_name: GS_MADNESSCANCEL # Madness Canceller (Last Stand), rocalc 420, max 1; +100 ATK/+15% ASPD (readCombatResults().damage.ave) + - aegis_name: GS_MADNESSCANCEL # Madness Canceller (Last Stand), max 1; +100 ATK/+15% ASPD (readCombatResults().damage.ave) self_buff: { name: madness_canceller, kind: stat_buff, persistence: transient } - - aegis_name: GS_ADJUSTMENT # Adjustment (Gunslinger's Panic), rocalc 421, max 1; +30 FLEE, -HIT, -ranged dmg (readDerivedStats().flee) + - aegis_name: GS_ADJUSTMENT # Adjustment (Gunslinger's Panic), max 1; +30 FLEE, -HIT, -ranged dmg (readDerivedStats().flee) self_buff: { name: adjustment, kind: stat_buff, persistence: transient } - - aegis_name: GS_CHAINACTION # Chain Action, rocalc 427, max 10; chance of double damage on normal attacks (readCombatResults().damage.secondAve; confirmed scored in combat sim) + - aegis_name: GS_CHAINACTION # Chain Action, max 10; chance of double damage on normal attacks (readCombatResults().damage.secondAve; confirmed scored in combat sim) self_buff: { name: chain_action, kind: stat_buff, persistence: transient } - - aegis_name: GS_GATLINGFEVER # Gatling Fever, rocalc 433, max 10; +ASPD with a gatling (W_GATLING), -FLEE (readDerivedStats().aspd) + - aegis_name: GS_GATLINGFEVER # Gatling Fever, max 10; +ASPD with a gatling (W_GATLING), -FLEE (readDerivedStats().aspd) self_buff: { name: gatling_fever, kind: stat_buff, persistence: transient } - - aegis_name: GS_GLITTERING # Flip the Coin, rocalc 416, max 5; rocalc models the coin-damage bonus, scales with level (readCombatResults().damage.ave) + - aegis_name: GS_GLITTERING # Flip the Coin, max 5; the calc engine models the coin-damage bonus, scales with level (readCombatResults().damage.ave) self_buff: { name: flip_the_coin, kind: stat_buff, persistence: transient } # --- Clown / Gypsy performer passives --- # Musical Lesson (Bard/Clown) and Dancing Lesson (Dancer/Gypsy) boost the # performer's own weapon damage (Instrument / Whip respectively), so they are - # real self-buffs on the existing skill_slot seam (job bank m_JobBuff slot 4: - # rocalc 198 Bard, 206 Dancer). The Bard/Dancer SONGS are a separate control - # surface (the A3 bank) and do NOT affect the performer, so they get no row - # here -- see the music driver + bindings in index.ts. The 3 inherited Archer - # buffs (owls_eye/vultures_eye/improve_concentration) already gate+drive. - - aegis_name: BA_MUSICALLESSON # Musical Lesson, rocalc 198, max 10; +Instrument damage (readCombatResults().damage.ave, instrument-only) + # real self-buffs on the existing skill_slot seam (the calc engine's job-buff + # bank). The Bard/Dancer SONGS are a separate control surface (the music bank) + # and do NOT affect the performer, so they get no row here -- see the music + # driver + bindings in index.ts. The 3 inherited Archer buffs + # (owls_eye/vultures_eye/improve_concentration) already gate+drive. + - aegis_name: BA_MUSICALLESSON # Musical Lesson, max 10; +Instrument damage (readCombatResults().damage.ave, instrument-only) self_buff: { name: musical_lesson, kind: stat_buff, persistence: permanent } - - aegis_name: DC_DANCINGLESSON # Dancing Lesson, rocalc 206, max 10; +Whip damage (readCombatResults().damage.ave, whip-only) + - aegis_name: DC_DANCINGLESSON # Dancing Lesson, max 10; +Whip damage (readCombatResults().damage.ave, whip-only) self_buff: { name: dancing_lesson, kind: stat_buff, persistence: permanent } # --- Star Gladiator self-buffs --- - # 13th class (rocalc job id 42, m_JobBuff[42] = [537,363,340,341,329,379,338, - # 342,380,352,353,354,355,356,357,367,361,364,365]). Pure-data: every buff uses + # 13th class. Pure-data: every buff uses # the skill_slot driver. SG_ skills are Star Gladiator-exclusive in pre-renewal, # so no blast radius; 3 TK buffs (mild_wind / spurt / taekwon_ranker) are already - # inherited and need no row. Excluded: 537 (ALL_INCCARRY weight), SG_MIRACLE - # (not learnable -- no tree anchor), SG_*_WARM (absent from rocalc's bank). The - # three Wrath skills are enemy size+maxHP gated inside rocalc (Solar=Small, + # inherited and need no row. Excluded: ALL_INCCARRY weight, SG_MIRACLE + # (not learnable -- no tree anchor), SG_*_WARM (absent from the engine's bank). The + # three Wrath skills are enemy size+maxHP gated inside the calc engine (Solar=Small, # Lunar=Medium maxHP>=6000, Stellar=Large maxHP>=20000); solar_protection is - # defensive (lowers incoming damage). rocalc collapses the 3 Bless skills into one - # bank slot (367), anchored here to SG_SUN_BLESS. See the Star Gladiator block in - # index.ts; verified deltas in the 2026-06-22 spec. - - aegis_name: SG_SUN_ANGER # Solar Wrath, rocalc 352, max 3; +damage vs Small monsters (readCombatResults().damage.ave) + # defensive (lowers incoming damage). The calc engine collapses the 3 Bless skills + # into one bank slot, anchored here to SG_SUN_BLESS. See the Star Gladiator block in + # index.ts. + - aegis_name: SG_SUN_ANGER # Solar Wrath, max 3; +damage vs Small monsters (readCombatResults().damage.ave) self_buff: { name: sls_solar_wrath, kind: stat_buff, persistence: transient } - - aegis_name: SG_MOON_ANGER # Lunar Wrath, rocalc 353, max 3; +damage vs Medium maxHP>=6000 (readCombatResults().damage.ave) + - aegis_name: SG_MOON_ANGER # Lunar Wrath, max 3; +damage vs Medium maxHP>=6000 (readCombatResults().damage.ave) self_buff: { name: sls_lunar_wrath, kind: stat_buff, persistence: transient } - - aegis_name: SG_STAR_ANGER # Stellar Wrath, rocalc 354, max 3; +damage vs Large maxHP>=20000 (readCombatResults().damage.ave) + - aegis_name: SG_STAR_ANGER # Stellar Wrath, max 3; +damage vs Large maxHP>=20000 (readCombatResults().damage.ave) self_buff: { name: sls_stellar_wrath, kind: stat_buff, persistence: transient } - - aegis_name: SG_SUN_COMFORT # Solar Protection, rocalc 355, max 4; +VIT-def, lowers incoming (readCombatResults().incoming.ave) + - aegis_name: SG_SUN_COMFORT # Solar Protection, max 4; +VIT-def, lowers incoming (readCombatResults().incoming.ave) self_buff: { name: sls_solar_protection, kind: stat_buff, persistence: transient } - - aegis_name: SG_MOON_COMFORT # Lunar Protection, rocalc 356, max 4; +FLEE (readDerivedStats().flee) + - aegis_name: SG_MOON_COMFORT # Lunar Protection, max 4; +FLEE (readDerivedStats().flee) self_buff: { name: sls_lunar_protection, kind: stat_buff, persistence: transient } - - aegis_name: SG_STAR_COMFORT # Stellar Protection, rocalc 357, max 4; +ASPD (readDerivedStats().aspd) + - aegis_name: SG_STAR_COMFORT # Stellar Protection, max 4; +ASPD (readDerivedStats().aspd) self_buff: { name: sls_stellar_protection, kind: stat_buff, persistence: transient } - - aegis_name: SG_FUSION # Union, rocalc 364, max 1; +damage / "increases most things" (readCombatResults().damage.ave) + - aegis_name: SG_FUSION # Union, max 1; +damage / "increases most things" (readCombatResults().damage.ave) self_buff: { name: sls_union, kind: stat_buff, persistence: transient } - - aegis_name: SG_DEVIL # Demon, rocalc 361, max 10; intended +ASPD but broken in rocalc -- wired-but-inert + - aegis_name: SG_DEVIL # Demon, max 10; intended +ASPD but broken in the calc engine -- wired-but-inert self_buff: { name: sls_demon, kind: status, persistence: permanent } - - aegis_name: SG_KNOWLEDGE # Knowledge (rocalc "Courier"), rocalc 363, max 10; carry-weight only -- wired-but-inert + - aegis_name: SG_KNOWLEDGE # Knowledge (a.k.a. "Courier"), max 10; carry-weight only -- wired-but-inert self_buff: { name: sls_knowledge, kind: status, persistence: permanent } - - aegis_name: SG_SUN_BLESS # Blessings, rocalc 367, max 5; rocalc collapses the 3 Bless skills to one slot; exp-rate only -- wired-but-inert + - aegis_name: SG_SUN_BLESS # Blessings, max 5; the calc engine collapses the 3 Bless skills to one slot; exp-rate only -- wired-but-inert # persistence transient (vs the passive demon/knowledge above): Blessing is a timed self-cast, not an always-on passive. Documentary only -- the scorer does not read persistence. self_buff: { name: sls_blessing, kind: status, persistence: transient } # --- Ninja self-buffs --- - # 14th class (rocalc job id 44, m_JobBuff[44] = [537, 406, 393, 404]). Pure-data: + # 14th class. Pure-data: # every buff uses the skill_slot driver. Ninja is an Expanded class -- no rebirth # (no trans-gating) and no shared tree (no inherited buffs), so ClassBuffs[ninja] - # is exactly these 3. Excluded: 537 (ALL_INCCARRY weight). Bank rocalc ids diverge - # from Aegis ids, so the sidecar bindings carry the rocalc id (see the Ninja block - # in index.ts). Only ninja_aura is scored (raises STR/INT -> ATK/MATK -> + # is exactly these 3. Excluded: ALL_INCCARRY weight. The engine's bank ids diverge + # from Aegis ids, so the sidecar bindings carry the engine's bank id (see the Ninja + # block in index.ts). Only ninja_aura is scored (raises STR/INT -> ATK/MATK -> # damage.ave); ninja_mastery (SP recovery) and throwing_mastery (throw-skill # damage) move no field the auto-attack sim reads, so they are wired-but-inert per - # the bind-every-control directive. Cicada Skin Shed / Mirror Image are in rocalc's - # m_Skill table but NOT in the bank, so they have no control surface and are ignored. - # Verified deltas in docs/superpowers/specs/2026-06-22-ninja-self-buffs-design.md. - - aegis_name: NJ_NEN # Ninja Aura ("Soul"), rocalc 404, max 5; +STR/INT -> +damage (readCombatResults().damage.ave) + # the bind-every-control directive. Cicada Skin Shed / Mirror Image are in the + # engine's skill table but NOT in the bank, so they have no control surface and are ignored. + - aegis_name: NJ_NEN # Ninja Aura ("Soul"), max 5; +STR/INT -> +damage (readCombatResults().damage.ave) self_buff: { name: ninja_aura, kind: stat_buff, persistence: transient } - - aegis_name: NJ_NINPOU # Ninja Mastery ("Spirit of the Blade" / Ninpou Training), rocalc 406, max 10; SP recovery only -- wired-but-inert + - aegis_name: NJ_NINPOU # Ninja Mastery ("Spirit of the Blade" / Ninpou Training), max 10; SP recovery only -- wired-but-inert self_buff: { name: ninja_mastery, kind: status, persistence: permanent } - - aegis_name: NJ_TOBIDOUGU # Throwing Mastery ("Shuriken Training"), rocalc 393, max 10; throw-skill damage only -- wired-but-inert + - aegis_name: NJ_TOBIDOUGU # Throwing Mastery ("Shuriken Training"), max 10; throw-skill damage only -- wired-but-inert self_buff: { name: throwing_mastery, kind: status, persistence: permanent } # --- Alchemist / Creator self-buffs --- - # 15th class (rocalc job ids 19 alchemist / 33 creator; m_JobBuff[19] == - # m_JobBuff[33] == [537,59,68,241], identical -> no trans gating, like + # 15th class (alchemist / creator banks are identical -> no trans gating, like # Champion=Monk). Pure-data: skill_slot only. Only Axe Mastery is new here; - # crazy_uproar (MC_LOUD, rocalc 68) already gates in via the Merchant tree (see + # crazy_uproar (MC_LOUD) already gates in via the Merchant tree (see # the Whitesmith block) and needs no row -- the catalog test asserts it. Excluded: - # 537 (Enlarge Weight Limit R, universal carry-weight) and 59 (Enlarge Weight - # Limit / MC_INCCARRY, Merchant carry-weight -- also excluded in Whitesmith's - # bank). Axe Mastery is axe-gated in rocalc (+ATK with axes only; non-axe weapons - # see no change) and the bonus is combat-sim mastery ATK -- it moves + # Enlarge Weight Limit R (universal carry-weight) and Enlarge Weight Limit / + # MC_INCCARRY (Merchant carry-weight -- also excluded in Whitesmith's + # bank). Axe Mastery is axe-gated in the calc engine (+ATK with axes only; non-axe + # weapons see no change) and the bonus is combat-sim mastery ATK -- it moves # readCombatResults().damage.ave, not derived atk.base, like Sword Mastery. - # Verified deltas in docs/superpowers/specs/2026-06-22-alchemist-creator-self-buffs-design.md. - - aegis_name: AM_AXEMASTERY # Axe Mastery, rocalc 241, cat 226, max 10; +ATK with axes (readCombatResults().damage.ave, axe-only) + - aegis_name: AM_AXEMASTERY # Axe Mastery, cat 226, max 10; +ATK with axes (readCombatResults().damage.ave, axe-only) self_buff: { name: axe_mastery, kind: stat_buff, persistence: permanent } # --- Soul Linker self-buffs --- - # 16th class (rocalc job id 43, m_JobBuff[43] = [537,340,341,329,338,342,380,372, - # 379]). Pure-data: skill_slot only. Expanded class on the TaeKwon branch; it + # 16th class. Pure-data: skill_slot only. Expanded class on the TaeKwon branch; it # inherits mild_wind/spurt (already mapped). Kaina (SL_KAINA) is the one # SL-specific buff and the only one scored: it raises maxSp (readDerivedStats(). # maxSp / Go Derived.MaxSP), +30/level, a sustain/defense-side stat_buff like # Paladin faith->maxHp. The 4 TaeKwon skills below (Tumbling/Peaceful Break/Happy - # Break/Kihop) are SHARED across the TaeKwon branch (m_JobBuff[41]/[42]/[43]), so + # Break/Kihop) are SHARED across the TaeKwon branch's job-buff banks, so # these rows also surface for TaeKwon Kid and Star Gladiator (count-locks 7 and 16). # All 4 are inert across the scored field set (broad-field probe) -- bound per # bind-every-control. taekwon_ranker (TK_MISSION) is NOT here: it is TaeKwon-Kid-only # and is removed from the SL/SG trees by usabilityExclusions in cmd/build-catalog. - # Excluded: 537 (carry-weight) and 380 (Kihop party-count sub-param). The Soul Link - # / Ka / Es skills are NOT in rocalc's bank, so they have no control surface and are - # ignored. Verified deltas in docs/superpowers/specs/2026-06-22-soul-linker-self-buffs-design.md. - - aegis_name: SL_KAINA # Kaina, rocalc 372, cat 466, max 7; +maxSp (readDerivedStats().maxSp / Go Derived.MaxSP) + # Excluded: carry-weight and the Kihop party-count sub-param. The Soul Link + # / Ka / Es skills are NOT in the engine's bank, so they have no control surface and + # are ignored. + - aegis_name: SL_KAINA # Kaina, cat 466, max 7; +maxSp (readDerivedStats().maxSp / Go Derived.MaxSP) self_buff: { name: kaina, kind: stat_buff, persistence: permanent } - - aegis_name: TK_DODGE # Tumbling (Break Fall), rocalc 338, cat 420, max 1; dodge -- wired-but-inert + - aegis_name: TK_DODGE # Tumbling (Break Fall), cat 420, max 1; dodge -- wired-but-inert self_buff: { name: tumbling, kind: status, persistence: permanent } - - aegis_name: TK_HPTIME # Peaceful Break, rocalc 340, cat 422, max 10; HP rest -- wired-but-inert + - aegis_name: TK_HPTIME # Peaceful Break, cat 422, max 10; HP rest -- wired-but-inert self_buff: { name: peaceful_break, kind: status, persistence: permanent } - - aegis_name: TK_SPTIME # Happy Break, rocalc 341, cat 423, max 10; SP rest -- wired-but-inert + - aegis_name: TK_SPTIME # Happy Break, cat 423, max 10; SP rest -- wired-but-inert self_buff: { name: happy_break, kind: status, persistence: permanent } - - aegis_name: TK_POWER # Kihop (Fighting Chant), rocalc 342, cat 424, max 5; party ATK -- wired-but-inert + - aegis_name: TK_POWER # Kihop (Fighting Chant), cat 424, max 5; party ATK -- wired-but-inert self_buff: { name: kihop, kind: status, persistence: transient } # --- High Wizard self-buffs (Mage -> Wizard -> High Wizard) --- - # rocalc job bank m_JobBuff[25] = [537,45,58,274,276]. Pure-data, skill_slot only. - # energy_coat (MG_ENERGYCOAT, rocalc 58) is already mapped (Scholar / Mage tree) and + # All ride the calc engine's job-buff bank. Pure-data, skill_slot only. + # energy_coat (MG_ENERGYCOAT) is already mapped (Scholar / Mage tree) and # needs no row. soul_drain + mystical_amplification are HW_ (High Wizard trans-only # root) -> high_wizard only. increase_sp_recovery is MG_ (Mage root) -> lights up the - # whole Mage tree (intentional, like demon_bane -> Acolyte tree). rocalc ids diverge - # from Aegis/catalog ids, so the sidecar bindings carry the rocalc id. Excluded: 537 - # (ALL_INCCARRY, universal carry-weight). Quagmire (WZ_QUAGMIRE) is modeled in - # rocalc's A8 enemy-ailment bank (not the B_debuf seam) -> deferred (new seam). - - aegis_name: HW_SOULDRAIN # Soul Drain, rocalc 274, cat 364, max 10; HW-only; +maxSp (readDerivedStats().maxSp / Go Derived.MaxSP) + # whole Mage tree (intentional, like demon_bane -> Acolyte tree). The engine's bank + # ids diverge from Aegis/catalog ids, so the sidecar bindings carry the engine's bank + # id. Excluded: ALL_INCCARRY (universal carry-weight). Quagmire (WZ_QUAGMIRE) is + # modeled in the engine's enemy-ailment bank (not the B_debuf seam) -> deferred (new seam). + - aegis_name: HW_SOULDRAIN # Soul Drain, cat 364, max 10; HW-only; +maxSp (readDerivedStats().maxSp / Go Derived.MaxSP) self_buff: { name: soul_drain, kind: stat_buff, persistence: permanent } - - aegis_name: HW_MAGICPOWER # Mystical Amplification (Amplify Magic Power), rocalc 276, cat 366, max 10; HW-only; +derived MATK (readDerivedStats().matk; not gate-scored in the auto-attack sim, like dragonology) + - aegis_name: HW_MAGICPOWER # Mystical Amplification (Amplify Magic Power), cat 366, max 10; HW-only; +derived MATK (readDerivedStats().matk; not gate-scored in the auto-attack sim, like dragonology) self_buff: { name: mystical_amplification, kind: stat_buff, persistence: transient } - - aegis_name: MG_SRECOVERY # Increase SP Recovery, rocalc 45, cat 9, max 10; Mage tree; SP-regen rate only -- wired-but-inert (does not move maxSp, unlike soul_drain) + - aegis_name: MG_SRECOVERY # Increase SP Recovery, cat 9, max 10; Mage tree; SP-regen rate only -- wired-but-inert (does not move maxSp, unlike soul_drain) self_buff: { name: increase_sp_recovery, kind: status, persistence: permanent } diff --git a/internal/data/buffs.go b/internal/data/buffs.go index 2e73a79..bba212c 100644 --- a/internal/data/buffs.go +++ b/internal/data/buffs.go @@ -10,7 +10,7 @@ const ( // Semantic kinds. weapon_endow forces a weapon element (Mild Wind); // stat_buff is a level-select stat state (Spurt, and most class buffs); // status is a permanent character status (Taekwon Ranker). Kind drives - // validation + LLM presentation, NOT rocalc wiring (the sidecar binding + // validation + LLM presentation, NOT calc-engine wiring (the sidecar binding // table does that). BuffKindWeaponEndow = "weapon_endow" BuffKindStatBuff = "stat_buff" @@ -37,8 +37,8 @@ var AllPersistence = []string{PersistencePermanent, PersistenceTransient} // AllElements is the weapon-element set a weapon_endow buff may name. Order // is irrelevant here (the per-buff endow order, which encodes level gating, -// lives in the overlay's endow.elements list). "neutral" maps to rocalc's -// "(unchanged)" control value; there is no force-neutral option. +// lives in the overlay's endow.elements list). "neutral" maps to the calc +// engine's "(unchanged)" control value; there is no force-neutral option. var AllElements = []string{ "neutral", "water", "earth", "fire", "wind", "poison", "holy", "shadow", "ghost", "undead", diff --git a/internal/data/sources/hercules/mobs.go b/internal/data/sources/hercules/mobs.go index ecf8a96..ea602fd 100644 --- a/internal/data/sources/hercules/mobs.go +++ b/internal/data/sources/hercules/mobs.go @@ -6,12 +6,12 @@ import ( ) // Mob is one row of Hercules's mob_db.conf, decoded into a typed struct. -// Field set covers identity + the combat stats rocalc's calc needs to +// Field set covers identity + the combat stats the calc engine needs to // score a build against this enemy: HP, Attack range, Def / Mdef, Race, // Element (with level), Size. These also back the inline-stats path; -// when a server profile carries a custom mob the rocalc snapshot doesn't +// when a server profile carries a custom mob the calc snapshot doesn't // know about, the orchestrator passes the same fields directly to the -// shim, bypassing the m_Monster lookup. +// shim, bypassing the mob lookup. // // Hercules's mob_db has many more fields (Stats sub-object, Drops, MvP // drops, AI mode flags, attack delay). They're parsed by ParseFile but @@ -26,7 +26,7 @@ type Mob struct { Hp int `json:"hp,omitempty" yaml:"hp,omitempty"` // Combat stats. AtkMin / AtkMax mirror Hercules's `Attack: [min, max]` - // pair; rocalc treats mob attack as a range; both values matter. + // pair; the calc engine treats mob attack as a range; both values matter. AtkMin int `json:"atk_min,omitempty" yaml:"atk_min,omitempty"` AtkMax int `json:"atk_max,omitempty" yaml:"atk_max,omitempty"` Def int `json:"def,omitempty" yaml:"def,omitempty"` diff --git a/internal/data/sources/hercules/selfbuff.go b/internal/data/sources/hercules/selfbuff.go index 080e776..fab81f6 100644 --- a/internal/data/sources/hercules/selfbuff.go +++ b/internal/data/sources/hercules/selfbuff.go @@ -7,7 +7,7 @@ package hercules // data) because data.Skill = hercules.Skill aliases this struct's owner; // defining SelfBuff here and aliasing it into data avoids an import cycle. // -// Carries semantic facts only (no rocalc ids): the sidecar's rocalc binding +// Carries semantic facts only (no engine ids): the sidecar's binding // table translates Name -> engine controls behind the shim boundary. type SelfBuff struct { Name string `json:"name" yaml:"name"` // semantic key: "mild_wind", "spurt", "taekwon_ranker" diff --git a/internal/data/sources/hercules/skill_tree.go b/internal/data/sources/hercules/skill_tree.go index dffe78d..a112742 100644 --- a/internal/data/sources/hercules/skill_tree.go +++ b/internal/data/sources/hercules/skill_tree.go @@ -13,7 +13,7 @@ import ( // class and runtime callers don't redo the recursion. // // Skills here are the player's allocatable tree; different from the -// rocalc m_JobBuff list (which is the calc's runtime buff lookup, not +// calc engine's job-buff bank (the calc's runtime buff lookup, not // the skill tree). type ClassSkillTree struct { Name string `json:"name"` @@ -26,7 +26,7 @@ type ClassSkillTree struct { // allocated before this skill can be learned. Requires maps aegis name // → required level; empty for skills with no prerequisites. // -// rocalc silently skips skills whose prerequisites are not met rather +// the calc engine silently skips skills whose prerequisites are not met rather // than returning an error, so the LLM must verify prereqs itself. // Carrying them here lets the orchestrator surface them in the user // prompt so the LLM doesn't have to rediscover the dependency. diff --git a/internal/domain/build.go b/internal/domain/build.go index 26158a8..39bffb8 100644 --- a/internal/domain/build.go +++ b/internal/domain/build.go @@ -103,7 +103,7 @@ func (b *Build) Validate() error { // // profile, when non-nil, swaps Scenario.Target into an inline-stats blob // if the id matches a CustomMobs entry; stock targets pass through as -// the iRO id for rocalc lookup. Pass nil profile to disable overlay +// the iRO id for calc lookup. Pass nil profile to disable overlay // resolution (treat every target as a stock id). func (b *Build) ToScoreRequest(s *Scenario, profile *ServerProfile) *scoring.ScoreRequest { req := &scoring.ScoreRequest{} diff --git a/internal/domain/server.go b/internal/domain/server.go index 85b67bd..6a7d382 100644 --- a/internal/domain/server.go +++ b/internal/domain/server.go @@ -72,7 +72,7 @@ type ServerProfile struct { // // Inline-stats scoring path: when score_build / canonical scoring see // an enemy ID that's in this list, the orchestrator passes the full - // stats blob to the calc shim (bypassing rocalc's m_Monster lookup, + // stats blob to the calc shim (bypassing the shim's mob lookup, // which doesn't know about server-custom mobs). CustomMobs []data.Mob `yaml:"custom_mobs,omitempty" json:"custom_mobs,omitempty"` @@ -250,7 +250,7 @@ type Rates struct { // Caps holds level / stat / mechanic limits relevant to build construction. // Zero is treated as "not specified"; the renderer only emits non-zero -// fields. ASPD is float because rocalc reports fractional values. +// fields. ASPD is float because the calc engine reports fractional values. type Caps struct { MaxBaseLevel int `yaml:"max_base_level,omitempty" json:"max_base_level,omitempty"` MaxJobLevel int `yaml:"max_job_level,omitempty" json:"max_job_level,omitempty"` @@ -264,7 +264,7 @@ type Caps struct { // ClassChange is a flat list of rule strings for one class. Class is the // shim's class-name key (e.g. "taekwon_kid"), so the orchestrator and the -// CLASS_TO_ROCALC_ID table agree on identifiers. +// shim's class-id table agree on identifiers. type ClassChange struct { Class string `yaml:"class" json:"class"` Summary string `yaml:"summary,omitempty" json:"summary,omitempty"` @@ -297,7 +297,7 @@ type ItemChange struct { // GearGrant captures a server-specific equip-restriction relaxation: a set // of classes that gain access to a list of items they otherwise couldn't // wear. UARO's "Extended classes can equip Trans-only gear" is the -// motivating case. Class keys should match the shim's CLASS_TO_ROCALC_ID +// motivating case. Class keys should match the shim's class-id // names so the renderer can filter by the request's class. type GearGrant struct { Classes []string `yaml:"classes" json:"classes"` @@ -324,7 +324,7 @@ type Ruleset struct { // CustomMob returns the overlay entry for an iRO mob id, or nil if the // server doesn't define or re-stat this mob. Used by the orchestrator's // inline-stats path to detect "this enemy id needs an inline blob, not a -// rocalc m_Monster lookup", and by the lookup_monster tool to prefer +// calc-engine mob lookup", and by the lookup_monster tool to prefer // the overlay before falling through to the base catalog. func (p *ServerProfile) CustomMob(iroID int) *Mob { for i := range p.CustomMobs { @@ -363,7 +363,7 @@ type Mob = data.Mob // mob id under the active profile. If the profile defines mobID as a // custom mob (server overlay), returns inline stats with no enemy id // (the calc shim's setEnemyInline path). Otherwise returns the bare iRO -// id for the rocalc m_Monster lookup. Returns (nil, nil) when mobID is +// id for the calc-engine mob lookup. Returns (nil, nil) when mobID is // 0; no scenario target. // // Both return values mirror the mutually-exclusive shape of diff --git a/internal/domain/trajectory.go b/internal/domain/trajectory.go index 43fe32b..f05b111 100644 --- a/internal/domain/trajectory.go +++ b/internal/domain/trajectory.go @@ -210,7 +210,7 @@ func validateSkillAlloc(a SkillAlloc) error { // the calc shim expects. LevelingTarget; when set and non-zero; supplies // the combat-sim target; profile, when non-nil, swaps custom-mob targets // into the inline-stats path so the shim doesn't try to look them up in -// rocalc's m_Monster table. Mirrors Build.ToScoreRequest's elision +// the calc's mob table. Mirrors Build.ToScoreRequest's elision // pattern so zero-valued fields don't clobber the shim's reset baseline. func (s *Snapshot) ToScoreRequest(profile *ServerProfile) *scoring.ScoreRequest { req := &scoring.ScoreRequest{} diff --git a/internal/llm/tools/champion_buffs_e2e_test.go b/internal/llm/tools/champion_buffs_e2e_test.go index fd7414c..bd820c1 100644 --- a/internal/llm/tools/champion_buffs_e2e_test.go +++ b/internal/llm/tools/champion_buffs_e2e_test.go @@ -16,7 +16,7 @@ import ( // // Both builds equip a Knuckle (iRO 1807 Fist) and allocate the anchor skills; the // base declares NO active buffs, the buffed declares the three. Allocation alone -// does not apply a buff (the job bank is keyed by rocalc id, not the Aegis id +// does not apply a buff (the job bank is keyed by the engine's bank id, not the Aegis id // setSkills uses), so the base scores unbuffed. Iron Fists drives the damage.ave // increase; Triple Attack / Fury exercise the multi-buff path (their effects land // in secondAve / crit, which this test does not assert). diff --git a/internal/llm/tools/clown_buffs_e2e_test.go b/internal/llm/tools/clown_buffs_e2e_test.go index c324070..a952b55 100644 --- a/internal/llm/tools/clown_buffs_e2e_test.go +++ b/internal/llm/tools/clown_buffs_e2e_test.go @@ -13,7 +13,7 @@ import ( // sidecar driver, calc) and raise Combat.Damage.Ave: Musical Lesson with an // Instrument (Clown + Violin 1901), Dancing Lesson with a Whip (Gypsy + Rope 1950). // The base allocates the anchor skill but declares no active buff, so it scores -// unbuffed (the job bank is keyed by rocalc id, not the Aegis id). Skipped under -short. +// unbuffed (the job bank is keyed by the engine's bank id, not the Aegis id). Skipped under -short. func TestIntegration_ClownGypsyLessons_RaiseScoredOffense(t *testing.T) { if testing.Short() { t.Skip("integration: needs running sidecar") diff --git a/internal/llm/tools/gunslinger_buffs_e2e_test.go b/internal/llm/tools/gunslinger_buffs_e2e_test.go index 56a2dde..a2a936c 100644 --- a/internal/llm/tools/gunslinger_buffs_e2e_test.go +++ b/internal/llm/tools/gunslinger_buffs_e2e_test.go @@ -17,7 +17,7 @@ import ( // hp_buffs_e2e_test.go). Skipped under -short. // // The base allocates the anchor skills but declares NO active buffs; allocation alone -// does not apply a buff (the job bank is keyed by rocalc id, not the Aegis id), so the +// does not apply a buff (the job bank is keyed by the engine's bank id, not the Aegis id), so the // base scores unbuffed. func TestIntegration_GunslingerBuffs_RaiseScoredStats(t *testing.T) { if testing.Short() { diff --git a/internal/llm/tools/list_class_skills.go b/internal/llm/tools/list_class_skills.go index 210d11b..68add3a 100644 --- a/internal/llm/tools/list_class_skills.go +++ b/internal/llm/tools/list_class_skills.go @@ -24,7 +24,7 @@ type listClassSkillsTool struct { // NewListClassSkills constructs the list_class_skills tool. Source is // Hercules's skill_tree.conf (loaded into the catalog at build time, // inherits flattened); the player's allocatable skill tree. Different -// from rocalc's m_JobBuff (which is the calc's stat-effect-skill set +// from the calc engine's job-buff bank (the calc's stat-effect-skill set // and is the wrong list for allocation). func NewListClassSkills(cat *catalog.Catalog) Tool { if cat == nil { @@ -39,7 +39,7 @@ func (t *listClassSkillsTool) Definition() llm.Tool { Description: "Enumerate every skill the given class can allocate, with iRO id, aegis name, display name, max level, and cast/cooldown metadata. " + "Source: Hercules's skill_tree.conf with inherits flattened; Novice's skills appear under every class that inherits from it. " + "Fallback only: the user prompt already injects this class's full allocatable skill list (id, max level, element, attack type, cast/cooldown, prerequisites), so call this tool only when that injected block is absent; it is redundant when the block is present. " + - "Note: the calc engine (rocalc) silently drops skills it can't model (e.g. Taekwon kicks). Score numbers fall back to auto-attack-tier in those cases; that's expected behavior, not an error to fix by changing skill choice.", + "Note: the calc engine silently drops skills it can't model (e.g. Taekwon kicks). Score numbers fall back to auto-attack-tier in those cases; that's expected behavior, not an error to fix by changing skill choice.", InputSchema: json.RawMessage(listClassSkillsSchema), } } diff --git a/internal/llm/tools/lord_knight_buffs_e2e_test.go b/internal/llm/tools/lord_knight_buffs_e2e_test.go index c828e0f..7fdde1b 100644 --- a/internal/llm/tools/lord_knight_buffs_e2e_test.go +++ b/internal/llm/tools/lord_knight_buffs_e2e_test.go @@ -16,8 +16,8 @@ import ( // // Both builds equip a Two-Handed Sword (iRO 1163 Claymore) and allocate the // anchor skills; the base declares NO active buffs, the buffed declares the -// three. Allocation alone does not apply a buff (the job bank is keyed by rocalc -// id, not the Aegis id setSkills uses), so the base scores unbuffed and the +// three. Allocation alone does not apply a buff (the job bank is keyed by the +// engine's bank id, not the Aegis id setSkills uses), so the base scores unbuffed and the // increase isolates the buffs' contribution against a neutral target. func TestIntegration_LordKnightBuffs_RaiseScoredOffense(t *testing.T) { if testing.Short() { diff --git a/internal/llm/tools/paladin_buffs_e2e_test.go b/internal/llm/tools/paladin_buffs_e2e_test.go index caa8808..cb2d8c9 100644 --- a/internal/llm/tools/paladin_buffs_e2e_test.go +++ b/internal/llm/tools/paladin_buffs_e2e_test.go @@ -17,7 +17,7 @@ import ( // in hp_buffs_e2e_test.go). Skipped under -short. // // The base allocates the anchor skills but declares NO active buffs; allocation alone -// does not apply a buff (the job bank is keyed by rocalc id, not the Aegis id), so the +// does not apply a buff (the job bank is keyed by the engine's bank id, not the Aegis id), so the // base scores unbuffed. func TestIntegration_PaladinBuffs_RaiseDerivedStats(t *testing.T) { if testing.Short() { diff --git a/internal/llm/tools/score_build.go b/internal/llm/tools/score_build.go index 94420ce..02d0c1a 100644 --- a/internal/llm/tools/score_build.go +++ b/internal/llm/tools/score_build.go @@ -55,7 +55,7 @@ const buildObjectSchema = `{ "type": "object", "required": ["id", "level"], "properties": { - "id": {"type": "integer", "description": "iRO skill id (Gravity-canonical; same in iRO/Hercules/rAthena/rocalc)."}, + "id": {"type": "integer", "description": "iRO skill id (Gravity-canonical; same in iRO/Hercules/rAthena)."}, "level": {"type": "integer", "description": "Skill level, 1..max (max from list_class_skills)."} } } @@ -209,8 +209,8 @@ var errBuildInvalid = errors.New("invalid build") // scored identically whichever tool the model reaches for. // // The active server profile, if present, swaps custom-mob targets into the -// inline-stats path so the calc shim doesn't look them up in rocalc's -// m_Monster table; nil profile means no overlay. ToScoreRequest can't see +// inline-stats path so the calc shim doesn't look them up in its own +// mob table; nil profile means no overlay. ToScoreRequest can't see // scoreBuildBuild.Skills (domain.Build has no Skills field), so skills are // set on the request explicitly after conversion. // diff --git a/internal/llm/tools/score_build_test.go b/internal/llm/tools/score_build_test.go index c93ec92..0ff12d9 100644 --- a/internal/llm/tools/score_build_test.go +++ b/internal/llm/tools/score_build_test.go @@ -86,7 +86,7 @@ func TestScoreBuild_AppliesResolvedBuffs(t *testing.T) { var gotBody []byte srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { gotBody, _ = io.ReadAll(r.Body) - _, _ = w.Write([]byte(`{"derived":{"maxHp":900,"statPointsRemaining":3},"calc_version":"rocalc-test"}`)) + _, _ = w.Write([]byte(`{"derived":{"maxHp":900,"statPointsRemaining":3},"calc_version":"calc-test"}`)) })) defer srv.Close() diff --git a/internal/llm/tools/stalker_buffs_e2e_test.go b/internal/llm/tools/stalker_buffs_e2e_test.go index 857130a..ca7a32a 100644 --- a/internal/llm/tools/stalker_buffs_e2e_test.go +++ b/internal/llm/tools/stalker_buffs_e2e_test.go @@ -16,7 +16,7 @@ import ( // hp_buffs_e2e_test.go). Skipped under -short. // // The base allocates the anchor skills but declares NO active buffs; allocation alone -// does not apply a buff (the job bank is keyed by rocalc id, not the Aegis id), so the +// does not apply a buff (the job bank is keyed by the engine's bank id, not the Aegis id), so the // base scores unbuffed. func TestIntegration_StalkerBuffs_RaiseScoredStats(t *testing.T) { if testing.Short() { diff --git a/internal/llm/tools/submit_trajectory_test.go b/internal/llm/tools/submit_trajectory_test.go index eff2f36..2d0989a 100644 --- a/internal/llm/tools/submit_trajectory_test.go +++ b/internal/llm/tools/submit_trajectory_test.go @@ -36,7 +36,7 @@ func passingSnapshot() domain.Snapshot { func TestSubmit_AcceptsWhenGatesPass(t *testing.T) { var cat *catalog.Catalog // nil; tests don't exercise the resolved-names echo path - sc := &fakeScoringClient{resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "rocalc-test"}} + sc := &fakeScoringClient{resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "calc-test"}} accepted := false var savedTraj domain.Trajectory @@ -328,7 +328,7 @@ func TestSubmit_SuccessAckReportsPerCheckpointBudget(t *testing.T) { var cat *catalog.Catalog sc := &fakeScoringClient{resp: &scoring.ScoreResponse{ Derived: scoring.DerivedStats{MaxHP: 5000, StatPointsRemaining: 12}, - CalcVersion: "rocalc-test", + CalcVersion: "calc-test", }} tool := NewSubmitTrajectory(SubmitTrajectoryDeps{ Catalog: cat, @@ -447,7 +447,7 @@ func TestSubmit_BadBuffOnAlternativeDropsAlt(t *testing.T) { } sc := &fakeScoringClient{resp: &scoring.ScoreResponse{ - Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "rocalc-test", + Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "calc-test", }} accepted := false var acceptedPrimary domain.Trajectory @@ -540,7 +540,7 @@ func (f *failOnCallScoringClient) Score(_ context.Context, _ *scoring.ScoreReque // not be recorded as one bad alternative. func TestSubmit_InfraErrorOnAlternativePropagates(t *testing.T) { sc := &failOnCallScoringClient{ - resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "rocalc-test"}, + resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "calc-test"}, failAt: 2, // call 1 = primary (clean), call 2 = alternative (5xx) failErr: &scoring.Error{Status: 503, Message: "sidecar restarting"}, } @@ -565,7 +565,7 @@ func TestSubmit_InfraErrorOnAlternativePropagates(t *testing.T) { // succeeds, exactly like a bad buff name does. func TestSubmit_ClientErrorOnAlternativeDrops(t *testing.T) { sc := &failOnCallScoringClient{ - resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "rocalc-test"}, + resp: &scoring.ScoreResponse{Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "calc-test"}, failAt: 2, // alternative's scoring call returns a 4xx failErr: &scoring.Error{Status: 400, Message: "unmapped item id 99999"}, } @@ -604,7 +604,7 @@ func TestSubmit_BadBuffOnPrimaryErrors(t *testing.T) { } sc := &fakeScoringClient{resp: &scoring.ScoreResponse{ - Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "rocalc-test", + Derived: scoring.DerivedStats{MaxHP: 5000}, CalcVersion: "calc-test", }} accepted := false tool := NewSubmitTrajectory(SubmitTrajectoryDeps{ @@ -702,7 +702,7 @@ func TestFormatActiveBuffs(t *testing.T) { func TestBuildCheckpointReports_BuffSummary(t *testing.T) { sc := scoring.ScoreResponse{ Derived: scoring.DerivedStats{StatPointsRemaining: 0}, - CalcVersion: "rocalc-test", + CalcVersion: "calc-test", } t.Run("snapshot with buffs includes buff line", func(t *testing.T) { diff --git a/internal/llm/tools/whitesmith_buffs_e2e_test.go b/internal/llm/tools/whitesmith_buffs_e2e_test.go index 402d131..1c28ebc 100644 --- a/internal/llm/tools/whitesmith_buffs_e2e_test.go +++ b/internal/llm/tools/whitesmith_buffs_e2e_test.go @@ -16,7 +16,7 @@ import ( // // Both builds equip a Two-Handed Axe (iRO 1360) and allocate the anchor skills; // the base build declares NO active buffs, the buffed build declares the three. -// Allocation alone does not apply a buff (the job bank is keyed by rocalc id, +// Allocation alone does not apply a buff (the job bank is keyed by the engine's bank id, // not the Aegis id setSkills uses), so the base build scores unbuffed and the // increase isolates the buffs' contribution against a neutral target. func TestIntegration_WhitesmithBuffs_RaiseScoredOffense(t *testing.T) { diff --git a/internal/orchestrator/orchestrator.go b/internal/orchestrator/orchestrator.go index 09d19a5..5b556a9 100644 --- a/internal/orchestrator/orchestrator.go +++ b/internal/orchestrator/orchestrator.go @@ -337,7 +337,7 @@ func (o *Orchestrator) Generate(ctx context.Context, req GenerateRequest) (*Gene reg := o.registry.WithTool(submitTool) // Fetch the class's allocatable skill list from the catalog so we can - // inject it into the user prompt. The sidecar's m_JobBuff is the + // inject it into the user prompt. The sidecar's job-buff bank is the // source of truth for what score_build will accept; without this the // LLM brute-forces lookup_skill against random iRO ids until it // finds the class's skills (observed: 50+ tool calls in the loop). @@ -602,11 +602,11 @@ func validateRequest(req GenerateRequest) error { // with inherits flattened). This is the player's true skill tree; what // the player can put points into. // -// The sidecar's rocalc m_JobBuff is a *different* concept (the calc's +// The sidecar's job-buff bank is a *different* concept (the calc's // stat-effect-skill set, populated with cross-class buffs like Bragi or // Lex Aeterna affecting the player) and is the wrong list to show the // LLM for allocation. The sidecar's setSkills silently skips skills not -// in m_JobBuff, so the LLM allocating from skill_tree.conf no longer +// in its job-buff bank, so the LLM allocating from skill_tree.conf no longer // fails canonical scoring; the calc just produces auto-attack-tier // numbers when no calc-recognized skills allocated. // diff --git a/internal/scoring/buff_binding_parity_test.go b/internal/scoring/buff_binding_parity_test.go deleted file mode 100644 index 548b9d4..0000000 --- a/internal/scoring/buff_binding_parity_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package scoring - -import ( - "os" - "path/filepath" - "runtime" - "strings" - "testing" - - "gopkg.in/yaml.v3" -) - -// Every self_buff name in skill_buffs.yaml must have a BUFF_BINDINGS entry in -// the rocalc backend, else a declared buff fails only at score time. This guard -// fails the build instead. Text-level check (no JS execution): asserts each -// "name:" appears as a binding key in index.ts. -func TestBuffNamesHaveSidecarBindings(t *testing.T) { - _, thisFile, _, _ := runtime.Caller(0) - root := filepath.Join(filepath.Dir(thisFile), "..", "..") - yamlPath := filepath.Join(root, "internal/catalog/data/skill_buffs.yaml") - idxPath := filepath.Join(root, "calc-sidecar/src/backends/rocalc/index.ts") - - raw, err := os.ReadFile(yamlPath) - if err != nil { - t.Fatalf("read overlay: %v", err) - } - var f struct { - Skills []struct { - SelfBuff struct { - Name string `yaml:"name"` - } `yaml:"self_buff"` - } `yaml:"skills"` - } - if err := yaml.Unmarshal(raw, &f); err != nil { - t.Fatalf("parse overlay: %v", err) - } - idx, err := os.ReadFile(idxPath) - if err != nil { - t.Fatalf("read index.ts: %v", err) - } - src := string(idx) - for _, s := range f.Skills { - name := s.SelfBuff.Name - if name == "" { - continue - } - if !strings.Contains(src, name+":") { - t.Errorf("buff %q has no BUFF_BINDINGS entry in index.ts", name) - } - } -} diff --git a/internal/scoring/buffs_e2e_test.go b/internal/scoring/buffs_e2e_test.go index 7ac9c56..9efd83c 100644 --- a/internal/scoring/buffs_e2e_test.go +++ b/internal/scoring/buffs_e2e_test.go @@ -7,11 +7,11 @@ import ( ) // TestBuffs_E2E proves that ScoreRequest.Buffs flows through the Go client into -// the rocalc sidecar over HTTP and produces buffed numbers. A Taekwon Kid +// the calc sidecar over HTTP and produces buffed numbers. A Taekwon Kid // scored WITH taekwon_ranker active must have >= 2.5x the maxHp of the same // build scored WITHOUT it (ranker grants 3x HP; 2.5x is a safe floor). // -// This is an integration test: it spawns a real rocalc sidecar subprocess and +// This is an integration test: it spawns a real calc sidecar subprocess and // hits it over HTTP. It is skipped under -short. func TestBuffs_E2E(t *testing.T) { if testing.Short() { diff --git a/internal/scoring/gates/defaults.go b/internal/scoring/gates/defaults.go index 41e702f..3542030 100644 --- a/internal/scoring/gates/defaults.go +++ b/internal/scoring/gates/defaults.go @@ -5,7 +5,7 @@ import "github.com/levonn-dev/ro-builder/internal/domain" // classGateAliases maps emulator-flavored class-name spellings to the // canonical key used inside the gates package's lookup maps. The // orchestrator hands snapshots whose Class is one of the -// CLASS_TO_ROCALC_ID names (lowercase-with-underscore), but the same +// shim's class-id names (lowercase-with-underscore), but the same // concept ships under different aliases across Hercules/rAthena dumps // and prompt-tuning data (e.g. "magician" vs "mage"). Mapping here // keeps the per-gate maps free of duplicate entries. diff --git a/internal/scoring/gates/hit.go b/internal/scoring/gates/hit.go index 71f86cb..462190f 100644 --- a/internal/scoring/gates/hit.go +++ b/internal/scoring/gates/hit.go @@ -17,7 +17,7 @@ import "fmt" // professor): magic damage doesn't roll HIT vs FLEE. // // Keys mirror Snapshot.Class values (canonical lowercase-with-underscore -// names from CLASS_TO_ROCALC_ID). Emulator-flavored aliases (magician, +// names from the shim's class-id table). Emulator-flavored aliases (magician, // high_magician, scholar) collapse to the canonical key via // normalizeClassForGates before lookup, so the map carries one row per // concept. diff --git a/internal/scoring/types.go b/internal/scoring/types.go index cfbbab2..4f6275b 100644 --- a/internal/scoring/types.go +++ b/internal/scoring/types.go @@ -167,10 +167,10 @@ type ScoreRequest struct { Buffs []Buff `json:"buffs,omitempty"` Equipment map[SlotKey]EquipSpec `json:"equipment,omitempty"` // Enemy and EnemyInline are mutually exclusive; set one or neither. - // Enemy is an iRO mob id translated through rocalc's mapping; the - // shim looks the mob up in m_Monster. EnemyInline supplies the stats + // Enemy is an iRO mob id translated through the calc's id mapping; the + // shim looks the mob up in its mob table. EnemyInline supplies the stats // directly, used for server-overlay custom mobs that aren't in the - // rocalc snapshot. The sidecar rejects requests with both set. + // calc snapshot. The sidecar rejects requests with both set. Enemy *int `json:"enemy,omitempty"` EnemyInline *EnemyStats `json:"enemy_inline,omitempty"` } @@ -201,7 +201,7 @@ type EnemyStats struct { // SkillAlloc is one entry in a build's skill allocation: the iRO skill id // and the level the player has invested. Skill IDs are Gravity-canonical, -// so iRO and rocalc agree without translation. Per-skill max-level lives +// so iRO and the calc engine agree without translation. Per-skill max-level lives // in the skill catalog and isn't enforced at this layer; the shim // surfaces "skill not in this class's tree" as a 4xx-classifiable error. type SkillAlloc struct { @@ -221,13 +221,13 @@ type Buff struct { } // ScoreResponse is the POST /score success body. Combat is non-nil iff the -// request set Enemy. CalcVersion is the engine snapshot stamp ("rocalc- -// 2026-04-06"); the build library persists it so stale saved trajectories -// are detectable after the calc snapshot changes. +// request set Enemy. CalcVersion is the engine snapshot stamp (backend name +// + data snapshot date); the build library persists it so stale saved +// trajectories are detectable after the calc snapshot changes. // // Uncertainty carries caveats the LLM and the build library should weigh -// when reasoning over these numbers; for the rocalc backend it surfaces -// rocalc's documented known issues (left-hand crit damage, Soul Breaker +// when reasoning over these numbers; for the active calc backend it surfaces +// that backend's documented known issues (left-hand crit damage, Soul Breaker // approximations, inline-mob level scaling) so approximate values aren't // treated as ground truth. TraceID is a backend-defined opaque id, used // to tie a saved trajectory back to the exact calc invocation in logs. From 75f3f5a0436fd6423d314dd87b7457e5de5314c4 Mon Sep 17 00:00:00 2001 From: levonn-dev Date: Wed, 24 Jun 2026 11:33:23 -0400 Subject: [PATCH 2/2] fix: work around node bug 53238 --- calc-sidecar/src/backends/registry.ts | 36 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/calc-sidecar/src/backends/registry.ts b/calc-sidecar/src/backends/registry.ts index 9e79cb4..d2790a7 100644 --- a/calc-sidecar/src/backends/registry.ts +++ b/calc-sidecar/src/backends/registry.ts @@ -1,15 +1,29 @@ // Backend registry. Each backend exports createShim and CALC_VERSION // (the ShimSession factory + version stamp); the registry table maps a -// short name to a dynamic-import factory and the env var CALC_BACKEND -// selects which one is active. +// short name to its module specifier and the env var CALC_BACKEND selects +// which one is active. // -// Dynamic import() is load-bearing: when CALC_BACKEND=stub, the rocalc -// module is never imported and never tries to read vendor/. This is -// what lets CI run against the stub on a checkout with an empty vendor. +// Selective loading is load-bearing: when CALC_BACKEND=stub, the rocalc +// module is never loaded and never tries to read vendor/. This is what lets +// CI run against the stub on a checkout with an empty vendor. +// +// We load the selected backend with a SYNCHRONOUS require() rather than a +// dynamic import(), specifically so this module, and therefore a worker +// thread's entire module graph, contains NO top-level await. A worker whose +// module graph is async can abort the process with a V8 fatal ("Check failed: +// (location_) != nullptr", in AsyncModuleExecutionFulfilled) when it is +// terminated, or calls process.exit(), while that async graph is still +// evaluating. Those are unfixed, TLA-specific upstream Node bugs +// (nodejs/node#53238, #43182). ShimPool spawns short-lived workers and +// terminates them eagerly, so the window was hit intermittently, only under +// the fast stub backend, where one pool's teardown overlaps the next pool's +// spawn. require() keeps the selective-load property AND keeps createShim +// synchronous, while making this module's evaluation fully synchronous. // // Adding a backend: drop a dir under .//, export createShim and // CALC_VERSION, add one entry to BACKENDS below. +import { createRequire } from "node:module"; import type { ShimSession } from "../types.ts"; type BackendModule = { @@ -17,19 +31,19 @@ type BackendModule = { CALC_VERSION: string; }; -const BACKENDS: Record Promise> = { - rocalc: () => import("./rocalc/index.ts"), - stub: () => import("./stub/index.ts"), +const BACKENDS: Record = { + rocalc: "./rocalc/index.ts", + stub: "./stub/index.ts", }; const name = process.env.CALC_BACKEND ?? "rocalc"; -const factory = BACKENDS[name]; -if (!factory) { +const spec = BACKENDS[name]; +if (!spec) { throw new Error( `unknown CALC_BACKEND: ${name} (valid: ${Object.keys(BACKENDS).join(", ")})`, ); } -const backend = await factory(); +const backend = createRequire(import.meta.url)(spec) as BackendModule; export const createShim = backend.createShim; export const CALC_VERSION = backend.CALC_VERSION;