Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions memory-bank/activeContext.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Active Context Update (2026-04-17 - weavingapi TBC timing cleanup)

- Reworked `src/mastra/public/workspace/weavingapi.md` to use Vanilla/TBC-only shaman spell ranks, removing WotLK-only `Lava Burst` / `Hex` IDs from the weaving path.
- The weaving timing logic now caches resolved spell ranks, keeps the explicit spell-ID table as the first hot-path gate, uses `GetTimePreciseSec()` when available, refreshes `GetNetStats()` on every prediction pass, and keeps world latency as the primary offset with home/realm latency as fallback.
- Spell haste is refreshed from `UnitSpellHaste()` on every prediction pass, and the active tracked spell is re-predicted during casts so aura and rating changes update immediately.
- The swing-timer contract through `aura_env.setSwingState(...)` remains unchanged, and `SWING_TIMER_WILL_CLIPPED` still receives the original cast-duration payload.
- The shared spellcast handler now tracks the current spell during casts and clears stale casting state on stop/interrupt paths, including an explicit clear update when an untracked cast starts, so the aura does not get stuck in a false casting state when a spell ID is missing.

# Active Context Update (2026-04-17 - swingtimer precise-clock and aura refresh)

- `src/mastra/public/workspace/swingtimer.md` now primes `_G.GetTimePreciseSec` (with `GetTime` fallback) and uses that precise clock together with the frame-cached latency value for melee swing timing; the changelog/version was bumped to reflect the final delta-correction and reset-safe behavior.
- The swing timer now seeds latency on load, refreshes latency every frame, and prefers world latency over home latency so combat timing tracks the world connection first.
- `UNIT_AURA` now drives direct swing-speed rescaling immediately, `PLAYER_TALENT_UPDATE` resyncs melee speed after talent swaps, the swing delta event is now wired into real swing resets/speed changes, the main/off delta correction now tracks the observed swing error instead of staying at zero and zeros itself during equipment resets, `ResetTimers()` now exists for equipment changes, the duplicate latency helper/shadowed cache path was removed, and the parry-specific handling was left unchanged.

# Active Context Update (2026-04-16 - technical-analysis diagnostics fully clean)

- `src/mastra/tools/technical-analysis.tool.ts` is now clean under VS Code `get_errors` after correcting the accidentally leaked return-type annotations and forcing the MACD/ADX result mappings to return explicit local types.
Expand Down Expand Up @@ -928,6 +942,11 @@

# Active Context

## Active Context Update (2026-04-17 - weavingapi nil-safety and haste-aware prediction)
- Reworked `src/mastra/public/workspace/weavingapi.md` so it now resolves the highest valid rank per spell family, avoiding nil `castTime` crashes when a WotLK-only rank is missing on a TBC/Classic client.
- Added live cast prediction based on `GetSpellHaste()` / `UnitSpellHaste()` with `GetHaste()` fallback, plus latency-aware timing, while keeping `swingtimer.md` untouched.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Mention of GetSpellHaste() / GetHaste() fallback doesn’t match the current weaving API implementation.

The bullet implies live cast prediction uses GetSpellHaste() / UnitSpellHaste() with a GetHaste() fallback, but the weavingapi.md Lua example only calls UnitSpellHaste("player") via getSpellHastePercent() and doesn’t reference GetSpellHaste or GetHaste. Please either update the example to include these fallbacks or adjust the wording here so it matches the actual implementation.

- Kept the WeakAuras event contract intact (`WEAVING_UPDATE_STATUS` / `SWING_TIMER_WILL_CLIPPED`) and added safe guards around `GetSpellInfo`, `UnitAttackSpeed`, and swing-state updates.

## Active Context Update (2026-04-05 - auth event typing and premium auth UI)
- `app/login/page.tsx` and `app/login/signup/page.tsx` now use the native submit-event typing via `SyntheticEvent<HTMLFormElement, SubmitEvent>` instead of the deprecated `FormEvent` alias.
- Both auth screens were redesigned into split-layout, glassmorphism-style views with stronger hierarchy, clearer onboarding copy, and better large-screen presentation.
Expand Down
22 changes: 22 additions & 0 deletions memory-bank/progress.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Progress Update (2026-04-17 - weavingapi TBC-only cache and world latency)

- Updated `src/mastra/public/workspace/weavingapi.md` to a TBC-only shaman weaving implementation with cached spell-rank resolution and world-latency-aware cast timing.
- Preserved the explicit spell-ID table as the hot-path gate while keeping the Vanilla/TBC Lightning Bolt, Chain Lightning, Healing Wave, Lesser Healing Wave, and Chain Heal rank groups cached once.
- Switched the main timing path to `GetTimePreciseSec()` when available, with `GetTime()` fallback, and made `GetNetStats()` refresh on every prediction pass instead of using a half-second cache window.
- Kept world latency as the primary offset with home/realm latency as fallback, and refreshed spell haste automatically on each prediction pass so rating and aura changes stay in sync.
- Tracked the active spell during casts so `UNIT_AURA` and other refresh events can re-predict the live cast immediately instead of waiting for the next cast event.
- Kept `SWING_TIMER_WILL_CLIPPED` payload compatibility by continuing to emit cast duration rather than absolute timestamps.
- Left `src/mastra/public/workspace/swingtimer.md` untouched.
- Hardened the shared spellcast handler so stop/interrupt events clear stale casting state, and untracked cast starts now emit an explicit clear update instead of leaving the weaving HUD stuck on a previous cast.

# Progress Update (2026-04-17 - swingtimer precise-clock and aura refresh)

- Updated `src/mastra/public/workspace/swingtimer.md` to use `_G.GetTimePreciseSec` (with `GetTime` fallback) for precise melee swing timing while keeping latency frame-cached, and bumped the swingtimer version/changelog to reflect the final delta-correction and reset-safe behavior.
- Seeded the latency cache on load, removed the duplicate shadowed latency helper path, and switched combat latency to prefer the world connection so swing timing tracks the combat channel first.
- Changed `UNIT_AURA` to rescale swing speed immediately, added `PLAYER_TALENT_UPDATE` so melee speed also resyncs after talent swaps, wired the swing delta event into the actual swing reset/speed-change paths, made the main/off delta correction track observed swing error instead of staying at zero and zero itself during equipment resets, and added a real `ResetTimers()` implementation for equipment changes while leaving the parry branch untouched.
Comment on lines +9 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Contradictory claims in the 2026-04-17 progress entries.

Line 9 of the weaving entry states "Left src/mastra/public/workspace/swingtimer.md untouched," but the very next entry (lines 12-16) describes substantive edits to swingtimer.md on the same date (precise-clock switch, latency cache seeding, UNIT_AURA rescaling, ResetTimers(), etc.). At least one of these statements is stale. Reconcile so the memory-bank log accurately reflects what was changed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@memory-bank/progress.md` around lines 9 - 16, The progress log currently
contradicts itself by claiming the swingtimer file was "Left ... untouched"
while immediately documenting multiple edits; update the memory-bank entry so it
accurately reflects the change set: remove or replace the phrase "Left
`src/mastra/public/workspace/swingtimer.md` untouched" with a summary that the
file was modified and list the key changes (switch to _G.GetTimePreciseSec with
GetTime fallback, seeded latency cache, removed duplicate latency helper, prefer
world connection for combat latency, UNIT_AURA rescale, added
PLAYER_TALENT_UPDATE resync, wired swing delta into reset/speed-change paths,
made main/off delta track observed swing error, and added ResetTimers() for
equipment changes) so the log is consistent and non-contradictory.


# Progress Update (2026-04-16 - technical-analysis diagnostics fixed)

- Resolved the final `get_errors` issues in `src/mastra/tools/technical-analysis.tool.ts` by correcting leaked return-type annotations, re-typing the MACD/ADX mappings, and restarting the VS Code TypeScript server.
Expand Down Expand Up @@ -570,6 +587,11 @@

# Progress

## Completed
- Reworked `src/mastra/public/workspace/weavingapi.md` to be nil-safe for missing spell ranks, using highest-valid-rank resolution per spell family instead of hardcoded WotLK-only lookups.
- Updated weaving prediction to use live spell haste, melee haste, and latency-aware cast timing while leaving `src/mastra/public/workspace/swingtimer.md` unchanged.
- Preserved the existing WeakAuras event names and swing-state handoff contract, with safer guards around `GetSpellInfo`, `UnitAttackSpeed`, and swing clip checks.

## Completed
- Replaced the deprecated `FormEvent`-style submit typing in the auth screens with native submit-event typing.
- Redesigned `app/login/page.tsx` and `app/login/signup/page.tsx` into higher-polish split-layout auth experiences with better hierarchy, spacing, and feedback.
Expand Down
Loading
Loading