adopt-n1x-structure

Public task · Field Engineering

← Field Engineering

Move a single Next.js app under app/ onto the N1x generator's layout: six plugins in sync, the app in web/ and db/ on the managed glue, notes in context/, and migration history carried over so existing databases are not re-migrated.

Version
Category
Engineering
Model configurations
1
Attempts
8
Public trials
164 passed
Median runtime
18m 10s

Instruction

We want this repo moved onto the N1x project structure. The N1x generator is checked out beside the repo, at `../n1x`; its README and plugin docs are the instructions. There will be lots of small discrepancies between what we have now and the layout the framework wants. The framework should own everything it is meant to own, and our app-specific stuff drops in around it. The way I'd think about it: set the existing code aside, run N1x to generate the scaffolding, drop the app's pieces into the places N1x expects, and wherever something is meant to be framework-owned, resolve the discrepancy in the framework's favour.

Specifically:

- Declare the project in an `n1x.yaml` with the `web`, `web-db`, `web-auth`, `web-posthog`, `db` and `context` plugins, and let `n1x apply` own what it generates.
- Move the app's pages, API routes, features, components, public assets and SQL migrations into their N1x locations, and the `.base` project notes into the context workspace. When you're done, `app/` and `.base/` should be gone.
- Framework glue (auth, theme, the API route wrapper, the HTTP client, the migration runner) should be N1x's managed versions, not copies of our old ones.
- `n1x diff` should report the project in sync, and the app should still lint, build and serve its thermal and power pages and APIs.

The dev and production databases already have every existing migration applied by the current runner. Once we're on the new layout, running the project's migrations against those databases must not apply any of them again.

## Environment

PostgreSQL on localhost:5432 and the local database endpoint the app's
driver uses are running when you start, and the dev env files point at the
dev database. There is no network: npm installs only from its cache, which
holds the packages N1x's `web/` app and the app's current dependencies
resolve to.

Public trials

Results by model

Model · harnessMean rewardRange± SEAttempts
Frontier model ACursor CLI50.0%0% – 100%18.9 pp8