Skip to content

fix(agents): review fixes — declared framework identity, strict flow key, pure variants_from#239

Merged
gewenyu99 merged 3 commits into
experiment/orchestratorfrom
posthog-code/agents-review-fixes
Jul 15, 2026
Merged

fix(agents): review fixes — declared framework identity, strict flow key, pure variants_from#239
gewenyu99 merged 3 commits into
experiment/orchestratorfrom
posthog-code/agents-review-fixes

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Follow-ups from the review of #181, targeting its branch. Pairs with PostHog/wizard#907: the group/framework/default menu fields added here are what that PR's exact-lookup variant resolver consumes (replacing the wizard's FRAMEWORK_VARIANT_ALIASES table and startsWith guessing), so the two should land on their experiment branches together before the next joint run.

What changed

Menu-declared framework identity. Each integration variant now declares framework: <detection id> (the id the wizard's detector emits — rails, react-router, …) and, where a family has several variants, exactly one default: true. variants_from copies both across to the step-skills, and skill-menu.json entries gain group (hyphenated skill-id prefix), framework, and default. Consumers resolve a bare skill id + framework to a menu id by exact match; context-mill owns which variant serves which framework, so renames here can't silently strand a wizard-side alias table.

Defaults chosen (parity with the current resolution order, flag anything you'd flip): nextjs-app-router, nuxt-3-6, react-react-router-6, react-tanstack-router-code-based, react-native, astro-hybrid. Variants with no wizard detection id (react-vite, php, elixir, go, flutter) carry no framework and stay reachable by full id only.

flow: is required. The build previously validated the key only when present, but consumers filter prompts by it — a forgotten flow: built green here and silently vanished from the runtime registry. assertFlowMatches now rejects a missing key with the folder's expected value in the message.

resolveVariantsFrom is pure. It returns a resolved copy instead of mutating the config in place. The _variantsResolved marker is gone — it existed to dodge the "declare either variants or variants_from, not both" validation on re-expansion, which is the tell that the mutation was the problem. The validation means what it says again, and repeated expansion is naturally stable (pinned by a new test).

Testing

  • npm test — 14 files, 121 tests green (new: framework/default borrowing, input-config non-mutation, flow-key rejection via buildAgents).
  • npm run buildskill-menu.json emits 155 framework-tagged entries and 30 family defaults across the integration group and the four borrowed step-skill groups; agent-menu.json shape unchanged.

Created with PostHog Code

…key, pure variants_from

Follow-ups from the review of #181:

- skill-menu.json entries now carry `group` (hyphenated skill-id prefix),
  `framework` (the detection id a variant serves), and `default` (the
  variant a bare framework id resolves to when a family has several).
  Declared in the integration group's variant matrix and copied across by
  `variants_from`, so consumers resolve variants by exact match instead of
  reverse-engineering ids with alias tables and prefix guessing. Pairs with
  the wizard-side resolver change (PostHog/wizard PR on
  experiment/orchestrator-pi-runtask).
- agent prompts must declare `flow:` — the build now rejects a missing key
  instead of only a contradicting one, since consumers filter prompts by it
  and a missing key built green here but silently dropped the prompt from
  the runtime registry.
- `resolveVariantsFrom` is pure: it returns a resolved copy instead of
  mutating the config in place, which removes the `_variantsResolved`
  marker that existed to dodge the "variants or variants_from, not both"
  validation on re-expansion.

Generated-By: PostHog Code
Task-Id: fafc230d-6f14-4e4d-9462-0e7f18a1eec1
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

Generated-By: PostHog Code
Task-Id: fafc230d-6f14-4e4d-9462-0e7f18a1eec1
…plify)

Generated-By: PostHog Code
Task-Id: fafc230d-6f14-4e4d-9462-0e7f18a1eec1
@gewenyu99
gewenyu99 marked this pull request as ready for review July 15, 2026 17:42
@gewenyu99
gewenyu99 requested a review from a team as a code owner July 15, 2026 17:42
@gewenyu99
gewenyu99 merged commit ccb54bd into experiment/orchestrator Jul 15, 2026
7 checks passed
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