FE-579: Greenfield/brownfield first-screen + exploration#44
Conversation
FE-579 Greenfield/brownfield first-screen + exploration
First screen routes between greenfield (blank concept) and brownfield (existing codebase). Project records store |
🤖 Augment PR SummarySummary: Implements greenfield vs brownfield project creation and first-turn codebase exploration, plus a docs sync + handoff snapshot. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| const closeability = getCurrentWorkflowState(db, projectId).phases[phase].closeability; | ||
| const tools = getInterviewerTools(db, turnId, phase, projectId, options); | ||
| const isBrownfield = options?.mode === 'brownfield' && options.cwd; | ||
| const instructions = isBrownfield ? getBrownfieldScopePrompt(options.cwd!) : getSystemPrompt(phase); |
There was a problem hiding this comment.
src/server/interview.ts:220 — createInterviewerAgent switches to getBrownfieldScopePrompt based only on mode/cwd, so brownfield projects will use a scope-specific prompt even when phase is design/requirements/criteria (prompt + tool behavior may be incorrect for those phases).
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| ...(canProposePhaseClosure(phase, closeability) | ||
| ? { propose_phase_closure: createProposePhaseClosureTool(db, turnId, phase, projectId) } | ||
| : {}), | ||
| ...(options?.mode === 'brownfield' && options.cwd ? createCoreTools(options.cwd) : {}), |
There was a problem hiding this comment.
src/server/interview.ts:207 — createCoreTools() currently includes write_file/edit_file (and bash), so brownfield interviewer mode enables repo mutation capabilities in addition to exploration, which is broader than the exploration-oriented toolset described in docs/design/BROWNFIELD_EXPLORATION.md.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| export const createProjectRequestSchema = z.object({ | ||
| name: z.string().trim().min(1), | ||
| mode: projectModeSchema.optional(), | ||
| cwd: z.string().optional(), |
There was a problem hiding this comment.
src/shared/api-types.ts:77 — createProjectRequestSchema allows a client-supplied cwd, but the server derives cwd from launcher context and ignores request cwd, so the shared API contract is misleading and may invite incorrect usage by other clients.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| await waitFor(() => { | ||
| expect(fetchMock).toHaveBeenCalledWith( | ||
| '/api/projects', | ||
| expect.objectContaining({ |
There was a problem hiding this comment.
src/client/routes/ProjectList.test.tsx:112 — This greenfield creation test no longer asserts the POST request body (e.g., that it includes the project name/mode), so a regression in payload construction could still pass while navigation is mocked.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| @@ -0,0 +1,95 @@ | |||
| # Handoff — 2026-04-12 | |||
There was a problem hiding this comment.
HANDOFF.md:1 — Process: this PR title doesn’t follow the required {issue-id}: {Linear issue title...} convention (e.g. FE-534: ...) per (Rule: AGENTS.md).
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Sync: updated dependency graph (14 done), parallelism notes (14a next), coverage table (6 file count corrections + api-types.test.ts), added BrunchProject to lexicon. Handoff: captures session state for resumption. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion Project creation now routes between greenfield (blank concept) and brownfield (existing codebase). Brownfield interviewer gets core tools, an exploration-first system prompt, and a higher step budget (12 vs 4). Server derives cwd from launcher context, not from the client. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Four structural findings from the brownfield mode review integrated into the existing type-deduplication refactor plan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… streams Verified all assertions from the original plan against the actual codebase. Restructured 11 sequential commits into prereq → 4 parallel streams → cleanup for concurrent agent execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Export reviewStatusSchema, impactSchema, edgeRelationSchema, and re-export WorkflowPhase from shared/api-types.ts. These named exports enable parallel consumer streams to collapse their local literal unions onto shared imports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…racts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WorkflowPhaseStatus, ReadinessBand, ReviewStatus, and ProjectMode in db.ts now import from shared/api-types.ts and re-export for downstream compatibility. No behavior change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 4 parallel streams landed. Remaining client-side ReviewStatus literals in knowledge-card.tsx and EntitySidebar.tsx are legitimate local view-model types, not contract duplications. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4c04af8 to
4aa052c
Compare

chore: ln-sync + ln-handoff after slices 17a and 14
Sync: updated dependency graph (14 done), parallelism notes (14a next),
coverage table (6 file count corrections + api-types.test.ts), added
BrunchProject to lexicon.
Handoff: captures session state for resumption.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
feat: greenfield/brownfield first-screen routing and codebase exploration
Project creation now routes between greenfield (blank concept) and
brownfield (existing codebase). Brownfield interviewer gets core tools,
an exploration-first system prompt, and a higher step budget (12 vs 4).
Server derives cwd from launcher context, not from the client.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
chore: ln-review findings from slice 14a appended to REFACTOR.md
Four structural findings from the brownfield mode review integrated
into the existing type-deduplication refactor plan.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
chore: rewrite REFACTOR.md with verified duplication map and parallel streams
Verified all assertions from the original plan against the actual
codebase. Restructured 11 sequential commits into prereq → 4 parallel
streams → cleanup for concurrent agent execution.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
refactor: stabilize shared primitive exports for type deduplication
Export reviewStatusSchema, impactSchema, edgeRelationSchema, and
re-export WorkflowPhase from shared/api-types.ts. These named
exports enable parallel consumer streams to collapse their local
literal unions onto shared imports.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
refactor: collapse client phase primitives onto shared imports
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
refactor: narrow fixture manifest types to shared contracts
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
refactor: collapse interview mode and mutation types onto shared contracts
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
refactor: collapse server workflow primitives onto shared imports
WorkflowPhaseStatus, ReadinessBand, ReviewStatus, and ProjectMode in
db.ts now import from shared/api-types.ts and re-export for downstream
compatibility. No behavior change.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
chore: delete REFACTOR.md — type deduplication complete
All 4 parallel streams landed. Remaining client-side ReviewStatus
literals in knowledge-card.tsx and EntitySidebar.tsx are legitimate
local view-model types, not contract duplications.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com