FE-871: brunch toolchain detection — detect + plan-emitter wiring#214
Draft
kostandinang wants to merge 4 commits into
Draft
FE-871: brunch toolchain detection — detect + plan-emitter wiring#214kostandinang wants to merge 4 commits into
kostandinang wants to merge 4 commits into
Conversation
Add detectProfile(repoDir): a pure, evidence-first detector that maps a real
repo's manifests/lockfiles to a registry ProfileId — the brownfield front of
the FE-843 selection chain. Bun lockfile → bun; deno config/lock → deno;
package.json vitest/jest/none → node-vitest/node-jest/node-test (lockfile
evidence wins over package.json deps).
Fails loudly instead of defaulting: known-but-unsupported stacks (Python via
pyproject.toml/setup.py, Go via go.mod) and unrecognized dirs return
{detected:false, reason} with an actionable message and the valid profile
list — a wrong-but-silent toolchain produces unrunnable tests, the failure
this closes. A malformed package.json is treated as a Node project (node-test).
Pure detector only; wiring into the plan-emitter chain + the greenfield no-op
and greenfield-protecting check are slice 2.
Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a
Co-authored-by: Amp <amp@ampcode.com>
Insert brunch-detect as the brownfield front of the FE-843 selection chain via resolveEmittedProfile: flag >> detected (brownfield) >> spec >> architect-classified >> bun. A loud detection failure throws rather than silently defaulting to bun (falling through to an explicit spec/architect choice first). Greenfield (or brownfield without a repoDir) keeps the unchanged chain. Thread repoDir from the CLI launch cwd through runPlan into emitPlanFromSnapshot; expose an injectable detect seam for hermetic emitter tests. Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a Co-authored-by: Amp <amp@ampcode.com>
This was referenced Jun 15, 2026
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
… verification Fold the agent-native action vs harness-owned verification distinction into both frontier definitions: the value is the independent, deterministic, unshortcuttable check (the FE-800 orphan problem is unsolvable by agent self-report — same read-only discipline as evaluate-done at pi-actions.ts:70), not the boot/wiring action, which is agent-native via bash. Boot mechanics may lean on agent bash rather than a bespoke per-stack boot engine. Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a Co-authored-by: Amp <amp@ampcode.com>
…nches Review fix (oracle-confirmed): detectProfile silently resolved ambiguous evidence by check-order — a package.json declaring both vitest and jest picked vitest, violating the fail-loud-not-silent-default invariant (acceptance #4). It now returns a loud {detected:false} reason and defers to --profile. Also trims the pyproject.toml/setup.py/go.mod special-casing (+ the 'unsupported' helper): those only renamed an error the catch-all already produces actionably, which is the 'language-detection framework' the design explicitly rejects. Any repo with no JS/TS evidence now falls to one actionable catch-all. Behavior for non-JS repos is unchanged (still a loud, actionable failure); only the per-stack naming is gone. PLAN.md brunch-detect definition updated to match. Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stacks on FE-867. Second Arc-1 frontier — closes the
brunch detectgap FE-843 deferred. Slices 1 + 2 both land here.What?
Resolve a real repo's toolchain to a registry
ProfileIdat plan time, and use it as the brownfield front of the FE-843 chain.detectProfile,project-detect.ts): pure, evidence-first — the cheap "which lockfile/manifest is present" check, not a language-detection engine. Bun lockfile →bun; deno config →deno;package.jsondeps → vitest/jest/none →node-vitest/node-jest/node-test. One clear supported signal resolves; anything else fails loud ({detected:false, reason}), never a silent default; maps only to registry ids.resolveEmittedProfile,plan-emitter.ts):detectedbecomes the brownfield front of the chain —repoDirthreads CLI cwd →runPlan→emitPlanFromSnapshot; injectabledetectseam keeps tests hermetic. A loud failure throws rather than silently falling to bun. Greenfield (norepoDir) keeps the unchanged FE-843 chain.Why?
Per-slice verification runs one target at a time, and that command is runner-specific (
bun testvsnpx vitest runvsnpx jestvsdeno test). The toolchain must be known at plan time — the deterministic runner reads the stampedplan.profilewith no agent in the loop, so a wrong default runs the wrong command with no diagnostic. For an existing repo the manifest is the authoritative source; every other source is a guess or a manual step.D160-K-clean: profile-id resolution is an input to authoring, not architect host-introspection — no amendment needed.
Review fixes (this revision)
package.jsondeclaring bothvitestandjestsilently picked vitest, violating the fail-loud-not-silent-default invariant (acceptance Dolt #4). It now returns a loud{detected:false}reason and defers to--profile.pyproject.toml/setup.py/go.modspecial-cases (+ theunsupportedhelper): they only renamed an error the catch-all already produces actionably — the "language-detection framework" the design explicitly rejects. Non-JS repos still fail loudly via one actionable catch-all; only the per-stack naming is gone.Co-authored-by: Amp amp@ampcode.com
🤖 Generated with Claude Code