Skip to content

FE-579: Greenfield/brownfield first-screen + exploration#44

Merged
lunelson merged 10 commits into
mainfrom
ln/fe-579-codebase-exploration
Apr 12, 2026
Merged

FE-579: Greenfield/brownfield first-screen + exploration#44
lunelson merged 10 commits into
mainfrom
ln/fe-579-codebase-exploration

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

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

@linear
Copy link
Copy Markdown

linear Bot commented Apr 12, 2026

FE-579 Greenfield/brownfield first-screen + exploration

First screen routes between greenfield (blank concept) and brownfield (existing codebase). Project records store mode and cwd. Brownfield adds core tools to interviewer, brownfield system prompt variant instructs explore-then-interview on first turn. Observer extracts from that turn as usual

@lunelson lunelson marked this pull request as ready for review April 12, 2026 15:59
Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 12, 2026

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

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 12, 2026

🤖 Augment PR Summary

Summary: Implements greenfield vs brownfield project creation and first-turn codebase exploration, plus a docs sync + handoff snapshot.

Changes:

  • Adds DB migration + schema fields on project for mode (greenfield/brownfield) and cwd.
  • Extends shared API contracts to include mode/cwd, plus exports shared primitives (impact, edge relation, review status, workflow phase).
  • Replaces prompt-based project naming with a dialog flow that collects name then mode selection.
  • Updates server app creation to accept options and derive brownfield cwd from launcher/server context rather than the client.
  • Configures the interviewer to use a brownfield exploration-first system prompt, adds core tools in brownfield mode, and increases the brownfield step budget (12 vs 4).
  • Adds/updates tests across server + client to cover new mode/cwd plumbing and brownfield configuration.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/interview.ts
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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/server/interview.ts
...(canProposePhaseClosure(phase, closeability)
? { propose_phase_closure: createProposePhaseClosureTool(db, turnId, phase, projectId) }
: {}),
...(options?.mode === 'brownfield' && options.cwd ? createCoreTools(options.cwd) : {}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/shared/api-types.ts
export const createProjectRequestSchema = z.object({
name: z.string().trim().min(1),
mode: projectModeSchema.optional(),
cwd: z.string().optional(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(
'/api/projects',
expect.objectContaining({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread HANDOFF.md
@@ -0,0 +1,95 @@
# Handoff — 2026-04-12
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lunelson lunelson changed the title chore: ln-sync + ln-handoff after slices 17a and 14 FE-579: Greenfield/brownfield first-screen + exploration Apr 12, 2026
Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 12, 2026

Merge activity

  • Apr 12, 5:03 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 12, 5:08 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 12, 5:09 PM UTC: @lunelson merged this pull request with Graphite.

@lunelson lunelson changed the base branch from ln/fe-545-storage-and-distro to graphite-base/44 April 12, 2026 17:06
@lunelson lunelson changed the base branch from graphite-base/44 to main April 12, 2026 17:07
lunelson and others added 10 commits April 12, 2026 17:08
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>
@lunelson lunelson force-pushed the ln/fe-579-codebase-exploration branch from 4c04af8 to 4aa052c Compare April 12, 2026 17:08
@lunelson lunelson merged commit ded3c20 into main Apr 12, 2026
2 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