Skip to content

FE-843: Toolchain profile expansion — TS runtimes + live profile selection#198

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

FE-843: Toolchain profile expansion — TS runtimes + live profile selection#198
kostandinang wants to merge 4 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

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 selectionbrunch 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.

🤖 Generated with Claude Code

kostandinang commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@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

Low Risk
Orchestrator/planning and CLI surface changes with broad test coverage; strict unknown-profile errors improve misconfiguration visibility rather than introducing security or data risks.

Overview
Expands cook toolchain profiles beyond bun/brunch and makes profile selection actually drive planning and execution.

Registry: project-profile.ts is refactored to a data-driven registry (PROFILE_DATAcompileProfile → unchanged Toolchain API). New profiles: node-vitest, node-test, node-jest, deno, each with path templates, test argv, and agent-facing testConventions (including scaffold/install hints where needed). parseProfileId and UnknownProfileError validate CLI/YAML ids; resolveToolchain no longer silently maps unknown ids to bun — absent profile stays lenient, unknown throws.

Selection at plan time: brunch plan gains --profile=<id> (wired through plan-runner and server CLI). emitPlanFromSnapshot resolves profile once with precedence --profile ≫ snapshot profile ≫ architect-classified ≫ bun, stamps plan.profile on success and fallback paths, and derives verification targets from the resolved toolchain.

Architect: Optional profile on the architect draft schema (enum of PROFILE_IDS or null); prompt instructs stack classification from spec prose only. Invalid/hallucinated profiles fail schema parse and trigger the existing deterministic fallback.

Docs/tests: memory/PLAN.md records FE-843 branch-complete; unit tests cover registry invariants, selection precedence, CLI parsing, and architect profile behavior.

Reviewed by Cursor Bugbot for commit 8837e9b. 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.

kostandinang and others added 4 commits June 15, 2026 12:57
…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>
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