14 Commits
Author SHA1 Message Date
Radu RaiceaandGitHub 11466c625e feat(llma): support prompt versions in prompts sdk (#454)
* feat(llma): support prompt versions in prompts sdk

* fix(llma): enforce clear_cache version requires name
2026-03-06 10:29:07 +01:00
github-actions[bot] ef5e1356ef chore: Release v7.9.7 2026-03-05 22:09:29 +00:00
a99c7d73b1 Add warning log for local flag evaluation cold start (#452)
* Add warning log when local flag evaluation called before flags loaded

When feature_enabled() is called with only_evaluate_locally=True before
flag definitions are fetched, the SDK silently returns None. This adds a
warning log so users can diagnose the issue immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move cold start warning to only fire for only_evaluate_locally=True

The warning was in _locally_evaluate_flag which runs for all flag
evaluations, including those that fall back to server-side evaluation.
Move it to the caller where only_evaluate_locally is known, so it only
fires when the caller explicitly opted out of the server fallback.

* Narrow cold start warning to only fire when flags were never fetched

Use `is None` instead of `not` to avoid firing when flags are loaded
but empty (401, 402, no personal_api_key), which already have their
own specific error logs.

* add changeset

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 13:36:05 -08:00
b206669bf6 fix(llma): use distinct_id from outer context if not provided (#449)
* fix(llma): use distinct_id from outer context if not provided

* fix(llma): distinct_id from context is now explicitly passed to capture method

* fix(llma): fix $process_person_profile with outer context distinct_id, add tests

- Fix personless check to consider outer context distinct_id (not just the
  explicit param), so events from users who set distinct_id via outer context
  are not incorrectly marked as personless.
- Fix typo: "district_id" -> "distinct_id" in comments.
- Add test coverage for distinct_id resolution: no id (personless), explicit
  param, outer context, and explicit overriding outer context.

* chore: add sampo changeset for distinct_id context fix

* style: ruff format

---------

Co-authored-by: Andrew Maguire <andrewm4894@gmail.com>
2026-03-05 15:11:40 +00:00
github-actions[bot] 16e180231f chore: Release v7.9.6 2026-03-02 21:28:45 +00:00
8d83315b67 refactor: add PROPERTY_OPERATORS constant for match_property (#448)
* feat: add semver targeting support to local flag evaluation

Implement 9 semver comparison operators (semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard) for feature flag local evaluation. Uses regex-based parsing that matches the server-side sortableSemver behavior to handle v-prefix, whitespace, pre-release suffixes, and non-standard version formats.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix: guard against ReDoS in semver regex parsing

Add input length limit before regex search to prevent polynomial
backtracking on adversarial input (CodeQL py/polynomial-redos).

* fix: replace regex with string parsing to resolve ReDoS warning

Replace SEMVER_EXTRACT_RE regex with simple string splitting to
eliminate nested quantifiers that CodeQL flagged as polynomial-redos.

* refactor: inline semver operator tuple to match existing patterns

* refactor: add PROPERTY_OPERATORS constant for match_property

Extract all operator strings into a single source-of-truth tuple and
validate against it early in match_property, replacing the fallthrough
at the end of the function.

* refactor: split PROPERTY_OPERATORS into composable sub-groups

Break the flat tuple into category-specific tuples (EQUALITY_OPERATORS,
STRING_OPERATORS, etc.) that compose into PROPERTY_OPERATORS via
concatenation. The semver dispatch code now references
SEMVER_OPERATORS and SEMVER_COMPARISON_OPERATORS instead of
repeating the full operator lists inline.

* fix: add unreachable fallthrough to satisfy mypy return check

* add release

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-02 21:12:09 +00:00
github-actions[bot] 1e1e566fa5 chore: Release v7.9.5 2026-03-02 20:53:53 +00:00
830244bd40 feat: add semver targeting support to local flag evaluation (#447)
* feat: add semver targeting support to local flag evaluation

Implement 9 semver comparison operators (semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard) for feature flag local evaluation. Uses regex-based parsing that matches the server-side sortableSemver behavior to handle v-prefix, whitespace, pre-release suffixes, and non-standard version formats.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix: guard against ReDoS in semver regex parsing

Add input length limit before regex search to prevent polynomial
backtracking on adversarial input (CodeQL py/polynomial-redos).

* fix: replace regex with string parsing to resolve ReDoS warning

Replace SEMVER_EXTRACT_RE regex with simple string splitting to
eliminate nested quantifiers that CodeQL flagged as polynomial-redos.

* refactor: inline semver operator tuple to match existing patterns

* add changeset

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-02 20:52:37 +00:00
github-actions[bot] 60001f1829 chore: Release v7.9.4 2026-02-25 15:28:29 +00:00
Carlos MarchalandGitHub a68a6a6d04 fix: revert manual release and add sampo changeset for ai_tokens_source (#445) 2026-02-25 16:25:53 +01:00
github-actions[bot] d45c04646e chore: Release v7.9.3 2026-02-18 22:20:09 +00:00
Rafael AudibertandGitHub 9f9553a420 Small fixes for python publishing (#441)
* fix: Avoid setting dynamic version

Version is now fixed because of sampo, so we can get rid of this

* feat: add changeset

* docs: Add new RELEASING section to README
2026-02-18 22:17:26 +00:00
github-actions[bot] 16bc87b646 chore: Release v7.9.2 2026-02-18 22:05:00 +00:00
Rafael AudibertandGitHub f1dc4d7391 chore: Migrate releases to sampo (#398)
* chore: Migrate releases to `sampo`

This is much closer to what we have in `posthog-js`, let's see if it's a good thing!

There's still a lot to do before deploying this:
- updating CI
- updating README with instructions

* Add sampo changeset

* chore: Update  to relase Python via Slack + sampo

* Update release.yml

* fix: Use pyproject.toml version as source of truth
2026-02-18 19:02:19 -03:00