Skip to content

[codex] Add indicator cache invalidation#63

Merged
sdcoffey merged 9 commits into
codex/fix-trendline-panicfrom
codex/add-cache-invalidation
May 29, 2026
Merged

[codex] Add indicator cache invalidation#63
sdcoffey merged 9 commits into
codex/fix-trendline-panicfrom
codex/add-cache-invalidation

Conversation

@sdcoffey

@sdcoffey sdcoffey commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a public CacheResetter interface and ResetCacheFrom helper
  • implement cache invalidation for EMA-backed indicators
  • add regression coverage for recalculating after mutable series data changes

Related issues

Addresses #53.

Validation

  • GOCACHE=/private/tmp/techan-gocache mise x go@1.26.3 -- go test ./...

Stacked on #62.

@sdcoffey sdcoffey marked this pull request as ready for review May 29, 2026 15:28
@sdcoffey

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebfe0d10f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cached_indicator.go Outdated
Comment on lines +24 to +25
if !ok {
return false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset all built-in cached indicators

When callers use this new helper with NewMMAIndicator(...), it returns false here even though modifiedMovingAverageIndicator has a resultCache and uses returnIfCached/cacheResult, so changing an underlying candle leaves previously calculated MMA values stale with no invalidation path short of rebuilding the indicator. Since resetResultCache already accepts the shared cachedIndicator interface, the helper should also handle cached indicators that don't add their own CacheResetter method.

Useful? React with 👍 / 👎.

@sdcoffey sdcoffey force-pushed the codex/fix-trendline-panic branch from 0cde7f9 to 376ccd8 Compare May 29, 2026 15:42
@sdcoffey sdcoffey force-pushed the codex/add-cache-invalidation branch from ebfe0d1 to 21d5174 Compare May 29, 2026 15:42
sdcoffey added 3 commits May 29, 2026 08:44
[codex] Make indicator test helper vet-safe
[codex] Document indicator warm-up behavior
@sdcoffey sdcoffey merged commit 2dddbe7 into codex/fix-trendline-panic May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant