Skip to content

FE-843: Expand cook toolchain profiles, selected at plan time#198

Open
kostandinang wants to merge 5 commits into
ka/fe-841-pi-sdk-embedfrom
ka/fe-843-toolchain-profiles
Open

FE-843: Expand cook toolchain profiles, selected at plan time#198
kostandinang wants to merge 5 commits into
ka/fe-841-pi-sdk-embedfrom
ka/fe-843-toolchain-profiles

Conversation

@kostandinang

@kostandinang kostandinang commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Stack Context

Stacks on FE-841 (#194). Expands the FE-829 toolchain contract so brunch cook can build on more technologies than bun, and so the profile selection path actually works.

What?

  • Data-driven profile registry (project-profile.ts) -- profiles are data literals (path templates + argv template + conventions prose) compiled into the unchanged Toolchain interface. Adds node-vitest, node-test, node-jest, deno alongside bun/brunch; registry invariants pinned enumerably over every entry. Adding a runtime = one data entry.
  • Live + strict selection -- brunch plan --profile=<id> (validated); the emitter resolves the chain once (--profile flag >> spec profile >> architect-classified >> bun) and stamps the resolved id into plan.yaml on both the authored and fallback paths, so cook always reads the profile the emitter used (I130-K). resolveToolchain now throws UnknownProfileError on a typo'd id instead of silently running bun; absent stays lenient for hand-authored fixtures.
  • Architect classifies the stack from spec prose -- optional profile enum on the architectPlan schema (null when the spec is silent); a hallucinated id fails schema parse and rides the existing deterministic fallback. No host introspection (D160-K intact).

Why?

Before this branch both implemented profiles were TypeScript and the selection path was dead -- nothing populated snapshot.profile, so every cook run silently resolved to bun, and a typo'd profile id silently defaulted rather than erroring. Adding profiles without live selection changes nothing at runtime; live selection without strictness hides real misconfiguration.

Deliberately not included (recorded in PLAN as follow-ons): a harness install verb (the cook agent scaffolds + installs per A98), fail/infra test-outcome split, brownfield drift-check at cook open, brunch detect. Outer-loop validation outstanding: a greenfield cook smoke with --profile=node-vitest as the conventions-prose oracle.

kostandinang commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kostandinang kostandinang changed the title FE-843: Frontier setup — toolchain-profile-expansion plan entry + 3-card queue FE-843: Toolchain profile expansion — TS runtimes + live profile selection Jun 10, 2026
@kostandinang kostandinang marked this pull request as ready for review June 15, 2026 11:12
@cursor

cursor Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes plan emission defaults and cook runtime toolchain resolution; misconfigured profiles now fail loudly instead of silently using bun, which is intentional but affects brownfield plans with typos in profile fields.

Overview
FE-843 expands cook toolchain profiles and makes profile selection actually work end-to-end.

Profiles in project-profile.ts are now data literals compiled into the existing Toolchain interface, with new ids node-vitest, node-test, node-jest, and deno (plus bun / brunch). brunch plan --profile=<id> validates via parseProfileId and threads through runPlan into emitPlanFromSnapshot. The emitter resolves the profile once with precedence --profile ≫ snapshot.profile ≫ architect-classified ≫ bun, stamps it on plan.yaml on both success and architect fallback paths, and derives verification targets from that toolchain.

Strict resolution: unknown profile ids now throw UnknownProfileError at cook/plan time; absent profile still defaults to bun for hand-authored fixtures. The build architect gains an optional profile field in its schema and prompt (spec prose only, D160-K); invalid LLM values fail parse and trigger the existing deterministic fallback.

Tests cover registry invariants, selection precedence, CLI parsing, and architect profile behavior. memory/PLAN.md records the frontier as branch-complete.

Reviewed by Cursor Bugbot for commit 8557ba7. Bugbot is set up for automated code reviews on this repo. Configure here.

@kostandinang

Copy link
Copy Markdown
Contributor Author

Follow-on work tracked in FE-864 — Orchestrator enhancements: brownfield feature delivery from spec. This branch's deferred items (structured spec-profile field, outstanding --profile=node-vitest greenfield cook smoke, install-verb / fail-infra split / brownfield drift-check / brunch detect) will be evolved there.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b84fbda. Configure here.

Comment thread src/orchestrator/src/project-profile.ts
@kostandinang kostandinang force-pushed the ka/fe-843-toolchain-profiles branch from b84fbda to e4e3afe Compare June 16, 2026 23:55
kostandinang and others added 5 commits June 17, 2026 09:36
…ard queue

Co-authored-by: Claude <noreply@anthropic.com>
…t/deno profiles

Profiles are now data literals (path templates + argv template + conventions
prose) compiled into the unchanged Toolchain interface — adding a runtime is
one data entry. Registry invariants pinned enumerably across all profiles.

Co-authored-by: Claude <noreply@anthropic.com>
…d into plan.yaml

brunch plan gains --profile=<id> (validated via parseProfileId); the emitter
resolves the chain once and stamps the id on both the authored and fallback
plans, so cook always reads the profile the emitter used. resolveToolchain
now throws UnknownProfileError on a typo'd id instead of silently running
bun; absent stays lenient for hand-authored fixtures.

Co-authored-by: Claude <noreply@anthropic.com>
architectPlan's schema gains an optional profile enum (registry ids,
null when the spec is silent); the emitter chain becomes flag ≫ spec
profile ≫ architect-classified ≫ bun. A hallucinated profile fails the
schema parse and rides the existing deterministic fallback. D160-K
intact — classification reads projected spec prose only.

Queue exhausted: CARDS.md retired; PLAN frontier marked branch-complete.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kostandinang kostandinang force-pushed the ka/fe-843-toolchain-profiles branch from e4e3afe to 8557ba7 Compare June 17, 2026 08:51
@kostandinang kostandinang changed the title FE-843: Toolchain profile expansion — TS runtimes + live profile selection FE-843: Expand cook toolchain profiles, selected at plan time Jun 17, 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