Skip to content

trunk-merge/pr-120691/800b90a2-2046-4753-a786-d70c06fbd2ea - #123121

Closed
trunk-io[bot] wants to merge 14 commits into
masterfrom
trunk-merge/pr-120691/800b90a2-2046-4753-a786-d70c06fbd2ea
Closed

trunk-io[bot] wants to merge 14 commits into
masterfrom
trunk-merge/pr-120691/800b90a2-2046-4753-a786-d70c06fbd2ea

Conversation

@trunk-io

@trunk-io trunk-io Bot commented Oct 25, 2026

Copy link
Copy Markdown
Trunk Merge Pull Request Banner

This pull request was created and is being managed by Trunk Merge.

This pull request is based on the master branch at SHA 3dcce7bc74903c4593e2382b18937e3bafad00dd.

See more details here.

When CI completes, this pull request will be closed automatically.

Pull Requests Being Tested

This pull request is testing the changes from pull request 120691.

haacked and others added 14 commits October 23, 2026 14:04
MCP tools that return a flag's release conditions add a condition_id to each one: the flag read, create, update, delete, and rollout tools, my-flags, and the experiment tools that return the linked flag. update-feature-flag accepts condition_id on each condition, removes it before the PATCH, and its description tells agents to send it back unchanged and leave it off a new condition. The flag eval scorer ignores condition_id when it compares written filters.

Claude-Session: https://claude.ai/code/session_016Awscf6jzRL847o3w729PS
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: a group property whose sent or stored index differs from the group type its source aggregates on keeps that index, so the API rejects the stored shape instead of the merge changing which group the filter reads
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: typed group properties that repeat the source's filters no longer move the set to their group type
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: a stored group property with no group_type_index follows its set, because the evaluator reads it on the set's group type
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: a person-aggregated source's group property keeps its index when the set moves to a group type
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: when the stored filters on a key sit on different group types and the agent sends no index, the property stays as the agent sent it, so an untyped echo fails the API's type check under every enforcement setting
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: the matched-set calls pass each set's own aggregation
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: groupTypeIndexFor maps each stored index through one rule before picking a typing, so a filter on the source's group type and one without an index agree
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: the stored-set list for the echo check comes from one place and includes the source at any aggregation
- services/mcp/tests/unit/preserve-group-targeting.test.ts: the legacy table drops its constant expected column
- services/mcp/src/tools/featureFlags/updateFeatureFlagHooks.ts: the API's group_property_type_index_mismatch rejection gains a recovery step that tells the agent to ask the user which group type the condition should target instead of changing either index itself
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: without condition_id, a set keeps a group type its source holds only when it repeats the source's filters and no other stored set has them, so a deletion or a swap no longer moves another condition's older group type onto a filter
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: mergeProperty takes the property's source as one object, and groupTypeIndexFor names its keep rule
- services/mcp/tests/unit/preserve-group-targeting.test.ts: rows for a deletion and a swap without condition_id, a retarget of a key stored on two group types, and an index the agent sends on another group type
- services/mcp/tests/unit/update-feature-flag-preserving-groups.test.ts: the describe block covers every rejected property error
- services/mcp/src/tools/featureFlags/preserveGroupTargeting.ts: typeSetProperties builds one PropertySource, groupTypeIndexFor uses one index closure, and matchSetsByPositionAndContent computes each filter signature once
- services/mcp/tests/unit/preserve-group-targeting.test.ts: drop the swap row, which takes the deletion row's path, and derive the sent property from the fixture
On a flag whose group-aggregated condition holds a group property on
another group type, a payload without condition_id is refused unless each
condition repeats the filters of the stored condition at its index and no
other stored condition has the same filters. A group_type_index the agent
sends stays unless it equals its source's aggregation.
A stacked follow-up PR adds it to the experiment tools.
@trunk-io

trunk-io Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Author

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@trunk-io trunk-io Bot closed this Oct 25, 2026
@trunk-io
trunk-io Bot deleted the trunk-merge/pr-120691/800b90a2-2046-4753-a786-d70c06fbd2ea branch October 25, 2026 03:13
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