nativeapptemplate-agent 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +9 -7
- package/README.md +65 -21
- package/dist/agents/judge.d.ts +8 -0
- package/dist/agents/judge.d.ts.map +1 -1
- package/dist/agents/judge.js +100 -14
- package/dist/agents/judge.js.map +1 -1
- package/dist/agents/repair.d.ts +14 -0
- package/dist/agents/repair.d.ts.map +1 -0
- package/dist/agents/repair.js +103 -0
- package/dist/agents/repair.js.map +1 -0
- package/dist/agents/types.d.ts +34 -1
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/dispatch.d.ts +21 -2
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +250 -14
- package/dist/dispatch.js.map +1 -1
- package/dist/env-bridge.d.ts +17 -0
- package/dist/env-bridge.d.ts.map +1 -0
- package/dist/env-bridge.js +211 -0
- package/dist/env-bridge.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +83 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mobile.d.ts +30 -0
- package/dist/mobile.d.ts.map +1 -0
- package/dist/mobile.js +173 -0
- package/dist/mobile.js.map +1 -0
- package/dist/rails-lifecycle.d.ts +16 -0
- package/dist/rails-lifecycle.d.ts.map +1 -0
- package/dist/rails-lifecycle.js +184 -0
- package/dist/rails-lifecycle.js.map +1 -0
- package/dist/rename-overrides.d.ts +23 -0
- package/dist/rename-overrides.d.ts.map +1 -0
- package/dist/rename-overrides.js +58 -0
- package/dist/rename-overrides.js.map +1 -0
- package/dist/repair-loop.d.ts +25 -0
- package/dist/repair-loop.d.ts.map +1 -0
- package/dist/repair-loop.js +67 -0
- package/dist/repair-loop.js.map +1 -0
- package/dist/report/collect.d.ts +28 -0
- package/dist/report/collect.d.ts.map +1 -0
- package/dist/report/collect.js +117 -0
- package/dist/report/collect.js.map +1 -0
- package/dist/report/model.d.ts +49 -0
- package/dist/report/model.d.ts.map +1 -0
- package/dist/report/model.js +2 -0
- package/dist/report/model.js.map +1 -0
- package/dist/report/render.d.ts +3 -0
- package/dist/report/render.d.ts.map +1 -0
- package/dist/report/render.js +242 -0
- package/dist/report/render.js.map +1 -0
- package/dist/report/theme.d.ts +2 -0
- package/dist/report/theme.d.ts.map +1 -0
- package/dist/report/theme.js +115 -0
- package/dist/report/theme.js.map +1 -0
- package/dist/ruby.d.ts.map +1 -1
- package/dist/ruby.js +11 -2
- package/dist/ruby.js.map +1 -1
- package/dist/slug.d.ts +3 -0
- package/dist/slug.d.ts.map +1 -1
- package/dist/slug.js +30 -0
- package/dist/slug.js.map +1 -1
- package/dist/validation/capture.d.ts.map +1 -1
- package/dist/validation/capture.js +19 -2
- package/dist/validation/capture.js.map +1 -1
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +3 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/launch.d.ts +10 -0
- package/dist/validation/launch.d.ts.map +1 -1
- package/dist/validation/launch.js +103 -5
- package/dist/validation/launch.js.map +1 -1
- package/dist/validation/layer1.d.ts.map +1 -1
- package/dist/validation/layer1.js +12 -4
- package/dist/validation/layer1.js.map +1 -1
- package/dist/validation/scenarios/queue.d.ts +12 -0
- package/dist/validation/scenarios/queue.d.ts.map +1 -0
- package/dist/validation/scenarios/queue.js +204 -0
- package/dist/validation/scenarios/queue.js.map +1 -0
- package/dist/validation/stage2-judge.d.ts +21 -0
- package/dist/validation/stage2-judge.d.ts.map +1 -0
- package/dist/validation/stage2-judge.js +204 -0
- package/dist/validation/stage2-judge.js.map +1 -0
- package/dist/validation/stage2.d.ts +73 -0
- package/dist/validation/stage2.d.ts.map +1 -0
- package/dist/validation/stage2.js +313 -0
- package/dist/validation/stage2.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +17 -0
- package/dist/version.js.map +1 -0
- package/package.json +6 -3
- package/scripts/ruby/rename.rb +18 -8
package/CLAUDE.md
CHANGED
|
@@ -30,11 +30,13 @@ Project-wide Claude Code instructions. Keep this file short — it's loaded into
|
|
|
30
30
|
|
|
31
31
|
## Substrate (what the agent operates on)
|
|
32
32
|
|
|
33
|
-
The agent
|
|
33
|
+
The agent targets BOTH the paid and free (MIT-licensed) editions — the same code path handles both, validated end-to-end. **Test the paid edition first**: the free edition is a strict subset of paid (paid = free + multi-tenancy + invitations + role permissions + org switching), so anything that works on paid works on free, but not vice-versa. Catching paid-only regressions first avoids "free passes, paid breaks" surprises.
|
|
34
|
+
|
|
35
|
+
Env vars point at the paid edition by default. Pick which substrate to use by pointing them at the corresponding repos:
|
|
34
36
|
|
|
35
37
|
- `$NATIVEAPPTEMPLATE_API` — Rails 8.1 API repo (`nativeapptemplateapi`, single repo serves both editions; multi-tenancy + invitations are conditional features)
|
|
36
|
-
- `$NATIVEAPPTEMPLATE_IOS` — SwiftUI iOS repo.
|
|
37
|
-
- `$NATIVEAPPTEMPLATE_ANDROID` — Jetpack Compose Android repo.
|
|
38
|
+
- `$NATIVEAPPTEMPLATE_IOS` — SwiftUI iOS repo. Paid: `NativeAppTemplate` (Swift 23,003 LOC, adds org switching, invitations, role permissions). Free: `NativeAppTemplate-Free-iOS` (Swift 15,311 LOC).
|
|
39
|
+
- `$NATIVEAPPTEMPLATE_ANDROID` — Jetpack Compose Android repo. Paid: `NativeAppTemplate` (Kotlin 28,401 LOC). Free: `NativeAppTemplate-Free-Android` (Kotlin 19,521 LOC).
|
|
38
40
|
|
|
39
41
|
The renamer's substitution rules (Shop / Shopkeeper / ItemTag / NativeAppTemplate) apply identically to both editions. Paid-only concepts (Account, Member, Invitation) aren't in the rename plan, so paid features survive the generation intact. Both editions hit the same Rails OpenAPI server, so the reviewer's three-way diff works against either.
|
|
40
42
|
|
|
@@ -46,7 +48,7 @@ The renamer's substitution rules (Shop / Shopkeeper / ItemTag / NativeAppTemplat
|
|
|
46
48
|
- `Shopkeeper` → the authenticated user/owner of a Shop
|
|
47
49
|
- `ItemTag` (aka Number Tag) → a queue entry, attached to a Shop
|
|
48
50
|
- **ItemTag has TWO states: `Idled` ↔ `Completed`.** It's a toggle, not a three-state machine. If a user's spec wants three states (e.g. "in-service"), extend the machine rather than assume it.
|
|
49
|
-
- Free edition is single-organization (personal account is transparent). Paid
|
|
51
|
+
- Free edition is single-organization (personal account is transparent). Paid edition adds multi-tenancy, invitations, roles, org switching — all out of scope for the rename pipeline (paid-only concepts aren't in the rename plan), but the agent still operates against paid substrates by default since paid is a superset of free.
|
|
50
52
|
|
|
51
53
|
## Repository state
|
|
52
54
|
|
|
@@ -89,7 +91,7 @@ Three clean operations on the substrate (details in `docs/SPEC.md` section 4):
|
|
|
89
91
|
|
|
90
92
|
## Guardrails
|
|
91
93
|
|
|
92
|
-
- **Self-repair loop hard-capped at 5 iterations** per generated project. On exceed, surface residuals and exit.
|
|
94
|
+
- **Self-repair loop hard-capped at 5 iterations** per generated project, opt-in via `NATIVEAPPTEMPLATE_REPAIR` (targets Layer 1/2 only; Layer 3 + reviewer are surfaced, not auto-repaired). On exceed, surface residuals and exit. Code: `src/repair-loop.ts` + `src/agents/repair.ts`.
|
|
93
95
|
- Known-cryptic failure modes: Jetpack Compose compilation, Hilt DI. Slow down and verify rather than pattern-match on those.
|
|
94
96
|
- **Do not invent tests for the generated code.** The substrate already has tests; use them.
|
|
95
97
|
- **Never modify the substrate repos** — clone them fresh into `./out/<slug>/{rails,ios,android}` before editing.
|
|
@@ -132,6 +134,6 @@ Ships as:
|
|
|
132
134
|
|
|
133
135
|
- **Don't reimplement mobile UI automation.** Use mobile-mcp. The hackathon is not about inventing device automation.
|
|
134
136
|
- **Don't extend scope beyond the queue / simple-CRUD-SaaS family** during the hackathon week. See `docs/SPEC.md` section 9 for the full non-goals list.
|
|
135
|
-
- **
|
|
137
|
+
- **Test the paid edition first.** Free is a strict subset of paid, so running paid first catches regressions that wouldn't surface against free alone. The OSS reproducibility story (judges/contributors with no paid license) lives in the free edition — once paid is green, point env vars at the free repos and re-run for the public demo.
|
|
136
138
|
- **Don't skip the validation layers to save time.** They are the demo story. A run that green-builds without passing Layer 3 is a failed run.
|
|
137
|
-
- **Don't edit, commit, push, or run `git clean` / `rm` inside `$NATIVEAPPTEMPLATE_API`, `$NATIVEAPPTEMPLATE_IOS`, or `$NATIVEAPPTEMPLATE_ANDROID`.** Those are the developer's working copies of the
|
|
139
|
+
- **Don't edit, commit, push, or run `git clean` / `rm` inside `$NATIVEAPPTEMPLATE_API`, `$NATIVEAPPTEMPLATE_IOS`, or `$NATIVEAPPTEMPLATE_ANDROID`.** Those are the developer's working copies of the substrate (paid by default; possibly free), shared with other projects on the same machine. Copy them into `./out/<slug>/` first; change nothing in place. If unsure whether a command is safe, ask.
|
package/README.md
CHANGED
|
@@ -8,7 +8,16 @@ A Claude Code agent that turns a natural-language spec — something as informal
|
|
|
8
8
|
|
|
9
9
|
Coherent across all three, in under an hour.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
[](https://www.npmjs.com/package/nativeapptemplate-agent)
|
|
12
|
+
[](https://github.com/nativeapptemplate/nativeapptemplate-agent/actions/workflows/ci.yml)
|
|
13
|
+
[](./LICENSE)
|
|
14
|
+
[](https://nodejs.org/)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practices"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> **Status: v0.1.2 stable.** First built during [Built with Opus 4.7: a Claude Code Hackathon](https://cerebralvalley.ai/e/built-with-4-7-hackathon) (April 21–27, 2026); shipped to npm post-hackathon. Verified end-to-end on the three demo specs below from a fresh `/tmp/` cwd. Stage 2 (scripted-CRUD walk-through via `mobile-mcp` against a live Rails server) and paid-edition parity validation landed post-launch. Active development continues — see the [roadmap](./ROADMAP.md) for what's next.
|
|
12
21
|
|
|
13
22
|
---
|
|
14
23
|
|
|
@@ -35,10 +44,14 @@ It will:
|
|
|
35
44
|
3. **Rename the skeleton** — `Shop → Clinic`, `Shopkeeper → Vet`, etc. — consistently across Ruby migrations, Swift models, Kotlin data classes, policies, tests, and localized copy.
|
|
36
45
|
4. **Adapt or replace the domain module** — keep `ItemTag` for walk-in queue variants; strip and insert a new resource for non-queue SaaS.
|
|
37
46
|
5. **Drive the build green** — `bin/rails test`, `xcodebuild test`, `./gradlew test` must all pass before the agent exits.
|
|
38
|
-
6. **Validate the output** across three layers (structural, runtime, semantic). Details in [`docs/SPEC.md`](./docs/SPEC.md) section 6.
|
|
47
|
+
6. **Validate the output** across three layers (structural, runtime, semantic) and write a self-contained HTML + JSON [validation report](#validation-report). Details in [`docs/SPEC.md`](./docs/SPEC.md) section 6.
|
|
39
48
|
|
|
40
49
|
## Demo
|
|
41
50
|
|
|
51
|
+
https://github.com/user-attachments/assets/bd1ed091-93d8-45d7-b502-c21720218484
|
|
52
|
+
|
|
53
|
+
90-second end-to-end run: spec → renamed Rails API + iOS app + Android app, all three platforms validated. Also on [YouTube](https://youtu.be/z08ueZX-02I) for full-screen viewing.
|
|
54
|
+
|
|
42
55
|
Three demo specs, both adapt and replace paths, all four validation layers green end-to-end:
|
|
43
56
|
|
|
44
57
|
| Spec | Domain entity (post-rename) | Path | Result |
|
|
@@ -47,16 +60,9 @@ Three demo specs, both adapt and replace paths, all four validation layers green
|
|
|
47
60
|
| `"a restaurant waitlist for casual dining"` | `Shop → Restaurant`, `Shopkeeper → Host` | adapt | Layer 1 3/3 · Layer 2 3/3 · Layer 3 2/2 · Reviewer PASS |
|
|
48
61
|
| `"a personal task tracker with due dates"` | `ItemTag → Todo` (replaces queue entry entirely) | replace | Layer 1 3/3 · Layer 2 3/3 · Layer 3 2/2 · Reviewer PASS |
|
|
49
62
|
|
|
50
|
-
Layer 2 ran in build mode — real `xcodebuild build` and `./gradlew assembleDebug`, full app builds installed on iPhone 17 simulator and Android emulator. Layer 3 captured the home-screen via `xcrun simctl io booted screenshot` / `adb exec-out screencap` and judged against the rubric using Opus 4.7 vision (median of 3 samples per criterion).
|
|
51
|
-
|
|
52
|
-
The agent works on either the **free (MIT) edition** or the **paid edition** without code changes — the same pipeline handles both substrates; multi-tenant features (org switching, invitations, role permissions) survive the rename pipeline when targeting paid.
|
|
63
|
+
Layer 2 ran in build mode — real `xcodebuild build` and `./gradlew assembleDebug`, full app builds installed on iPhone 17 simulator and Android emulator. Layer 3 captured the home-screen via `xcrun simctl io booted screenshot` / `adb exec-out screencap` and judged against the rubric using Opus 4.7 vision (median of 3 samples per criterion). With `NATIVEAPPTEMPLATE_VISUAL=2`, Layer 2 additionally drives a scripted-CRUD walk-through via `mobile-mcp` against a live Rails server — Welcome → Sign Up → email-confirm via `bin/rails runner` → Sign In → drill into the auto-seeded sample — and Layer 3 then judges the post-walk screenshot against a domain-content rubric.
|
|
53
64
|
|
|
54
|
-
|
|
55
|
-
<tr>
|
|
56
|
-
<td align="center"><img src="docs/images/demo-ios-vet-clinic-queue.png" width="300"><br><sub>iOS — Vet Clinic Queue welcome screen</sub></td>
|
|
57
|
-
<td align="center"><img src="docs/images/demo-android-vet-clinic-queue.png" width="300"><br><sub>Android — Vet Clinic Queue welcome screen</sub></td>
|
|
58
|
-
</tr>
|
|
59
|
-
</table>
|
|
65
|
+
The agent works on either the **free (MIT) edition** or the **paid edition** without code changes — the same pipeline handles both substrates; multi-tenant features (org switching, invitations, role permissions) survive the rename pipeline when targeting paid. The agent tests paid first because free is a strict subset of paid; running paid first catches regressions that wouldn't surface against free alone.
|
|
60
66
|
|
|
61
67
|
Both screenshots are real captures from the booted iOS Simulator and Android emulator post-`./gradlew assembleDebug` / `xcodebuild build`, after the agent installed and launched the generated app.
|
|
62
68
|
|
|
@@ -89,12 +95,10 @@ The agent operates on the free, MIT-licensed edition of NativeAppTemplate — th
|
|
|
89
95
|
|
|
90
96
|
Combined ~42.5k LOC. Extracted from [MyTurnTag Creator](https://myturntag.com), a walk-in queue-management SaaS live on both app stores since 2024.
|
|
91
97
|
|
|
92
|
-
## Usage
|
|
93
|
-
|
|
94
|
-
> **Not yet functional — hackathon build in progress.** The interface below is the target; `npx` won't work until v0.1 ships at the end of hackathon week.
|
|
98
|
+
## Usage
|
|
95
99
|
|
|
96
100
|
```bash
|
|
97
|
-
# Standalone CLI
|
|
101
|
+
# Standalone CLI
|
|
98
102
|
npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practices"
|
|
99
103
|
|
|
100
104
|
# Stretch specs the agent is also designed to handle
|
|
@@ -103,9 +107,11 @@ npx nativeapptemplate-agent "a personal task tracker with due dates"
|
|
|
103
107
|
|
|
104
108
|
# Generated output appears under ./out/<slug>/
|
|
105
109
|
tree ./out/clinic-queue/
|
|
106
|
-
# ├── rails/
|
|
107
|
-
# ├── ios/
|
|
108
|
-
#
|
|
110
|
+
# ├── rails/ ← Rails 8.1 API, git-initialized, buildable
|
|
111
|
+
# ├── ios/ ← SwiftUI iOS project, buildable
|
|
112
|
+
# ├── android/ ← Jetpack Compose Android project, buildable
|
|
113
|
+
# ├── report.json ← machine-readable validation result
|
|
114
|
+
# └── validation-report.html ← self-contained visual report (open in a browser)
|
|
109
115
|
```
|
|
110
116
|
|
|
111
117
|
The agent will also be available as a Claude Code plugin.
|
|
@@ -132,6 +138,10 @@ The agent will also be available as a Claude Code plugin.
|
|
|
132
138
|
### Optional flags
|
|
133
139
|
|
|
134
140
|
- `NATIVEAPPTEMPLATE_VISUAL=1` — opts the run into Stage 1 visual judging (Layer 3). When set, Layer 2 runs in **build mode** instead of fast mode (full `xcodebuild build` + `./gradlew assembleDebug`), then for each platform the agent installs the app on the booted sim/emulator, captures the home screen, and judges it with Opus 4.7 vision against `DEFAULT_STAGE1_RUBRIC`. Adds 60-180s per platform depending on cold-build time. Requires a sim/emulator booted for each platform you want judged. Off by default — `npm run dev` keeps the existing fast path.
|
|
141
|
+
- `NATIVEAPPTEMPLATE_VISUAL=2` — implies `=1` and additionally runs **Stage 2**: the agent boots the generated Rails app under `mise exec -- bin/dev` (after `bundle install` + `bin/rails db:prepare` + `bin/rails db:seed_fu`), waits for it to listen, then drives the iOS sim and Android emulator through the parameterized queue scenario (Sign Up → email-confirm via `bin/rails runner` → Sign In → drill into auto-seeded sample). Layer 3 then judges the last captured screenshot against `DEFAULT_STAGE2_RUBRIC` (domain content + no substrate-token leak). Adds 2–4 minutes per platform on top of `=1`. Requires both sims/emulators booted and the substrate's `mise` toolchain installed for `bin/dev`.
|
|
142
|
+
- `NATIVEAPPTEMPLATE_REPAIR` — opts into the bounded self-repair loop. Set `on` (or a positive integer N, hard-capped at 5) to enable. When the first validation pass fails on a **code-repairable** layer — Layer 1 leftover substrate tokens or Layer 2 build/compile errors — the agent runs a Claude Agent SDK repair pass scoped to the failing generated project (Read/Edit/Bash inside `out/<slug>/<platform>/` only), re-validates that platform, and repeats up to the cap. Each attempt is recorded in the validation report's self-repair table. Layer 3 (vision) and contract-reviewer misses are surfaced but not auto-repaired (a Layer 3 miss is usually environmental, not a source bug). Off by default; when the loop can't close the failures the agent still exits non-zero.
|
|
143
|
+
- `NATIVEAPPTEMPLATE_BRIDGE=off` — skip writing to `~/.gradle/gradle.properties`. The agent normally mirrors `NATIVEAPPTEMPLATE_API_*` (HOST/PORT/SCHEME) into renamed-product variants (`<PRODUCT>_API_*`) at run time so the generated Android app picks them up via `gradle.properties` and the iOS sim launch picks them up via `SIMCTL_CHILD_*`. Set this to disable the file write (process.env injection still runs for child-spawn paths).
|
|
144
|
+
- `NATIVEAPPTEMPLATE_BRIDGE_DRY_RUN=1` — log what would be written to `~/.gradle/gradle.properties` instead of writing. Useful before granting the bridge write access to your user-global gradle.
|
|
135
145
|
- `NATIVEAPPTEMPLATE_AGENT_ANTHROPIC_KEY` — dedicated workspace key, see [Security](#security).
|
|
136
146
|
- `ANDROID_SERIAL` — when more than one Android device/emulator is attached (e.g. a physical device plus a running emulator), `adb` standard practice is to set `ANDROID_SERIAL=<serial>` to disambiguate. The agent honors this transparently because it runs `adb` directly. Run `adb devices` to list serials. Visual-judge runs with multiple Android targets attached will error with `more than one device/emulator` if this isn't set.
|
|
137
147
|
|
|
@@ -142,11 +152,45 @@ The agent resolves `adb` to a known-good binary in this priority order: `$ANDROI
|
|
|
142
152
|
The agent doesn't just generate code and exit — it validates the output.
|
|
143
153
|
|
|
144
154
|
1. **Structural.** `ripgrep` for leftover domain tokens; OpenAPI contract parity check between Rails, iOS networking, and Android repository layers. A silent rename inconsistency fails the run before any tests execute.
|
|
145
|
-
2. **Runtime.**
|
|
155
|
+
2. **Runtime.** Verify the generated Rails app boots (`bin/rails runner 'puts OK'`); type-check or build the iOS and Android apps. With `NATIVEAPPTEMPLATE_VISUAL=1`, escalate to a full build (`xcodebuild build` + `./gradlew assembleDebug`) and install on the booted sim/emulator. With `=2`, additionally boot the live Rails server and drive a scripted CRUD walk-through via [`mobile-next/mobile-mcp`](https://github.com/mobile-next/mobile-mcp). Any 4xx/5xx or unhandled client error fails the run.
|
|
146
156
|
3. **Semantic.** Opus 4.7 as judge — scores whether the generated code and rendered UI actually express the intended domain. Vision judges read simulator/emulator screenshots directly.
|
|
147
157
|
|
|
148
158
|
See [`docs/SPEC.md`](./docs/SPEC.md) for the full design.
|
|
149
159
|
|
|
160
|
+
## Validation report
|
|
161
|
+
|
|
162
|
+
Every run writes a report of the validation results to the output directory:
|
|
163
|
+
|
|
164
|
+
[](./docs/images/validation-report.png)
|
|
165
|
+
|
|
166
|
+
*Example report from a free-edition run of `"a walk-in queue for small veterinary clinics"` — all three layers green. Click to view full size; the real artifact is a live, self-contained HTML file you open in a browser.*
|
|
167
|
+
|
|
168
|
+
- **`out/<slug>/validation-report.html`** — a self-contained HTML report (screenshots base64-embedded, no external assets, no JavaScript) you can open in a browser, attach to a PR, or drop into a demo. It shows the overall verdict, a platform×layer matrix, Layer 1 leftover-token findings, Layer 2 build commands + `stderr`, Layer 3 home-screen screenshots with the vision judge's per-criterion rationales (plus the Stage 2 filmstrip when `NATIVEAPPTEMPLATE_VISUAL=2`), the reviewer's contract diff, and the domain rename plan.
|
|
169
|
+
- **`out/<slug>/report.json`** — the same data, machine-readable, for CI gating or programmatic use. The full schema lives in [`docs/validation-report.md`](./docs/validation-report.md).
|
|
170
|
+
|
|
171
|
+
The CLI **exits non-zero when validation fails**, so a shell `&&` chain or CI step catches it:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npx nativeapptemplate-agent "a walk-in clinic queue" && echo "validation passed"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Naming flags:
|
|
178
|
+
|
|
179
|
+
| Flag | Default | Effect |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| `--project-name="Vet Clinic"` | planner's pick | Name the project. Accepts a human name (`"Vet Clinic"`), PascalCase (`VetClinic`), or kebab (`vet-clinic`); from it the agent derives the Pascal project name (`NativeAppTemplate → VetClinic` across all three platforms), the slug/output dir (`out/vet-clinic/`), the DB prefix + env-bridge token, and the display name. Invalid (no derivable slug) is reported and skipped. |
|
|
182
|
+
| `--rename From=To` | planner's pick | Override one of the planner's domain rename targets (repeatable). `From` is a substrate token (`Shop`, `Shopkeeper`, `ItemTag`); the planner fills in everything else. An override that matches no planned rename is reported and skipped. Example: `--rename Shopkeeper=Vet --rename Shop=Clinic` |
|
|
183
|
+
|
|
184
|
+
Report flags:
|
|
185
|
+
|
|
186
|
+
| Flag | Default | Effect |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `--no-report` | — | Skip writing the report |
|
|
189
|
+
| `--report-format=html\|json\|both` | `both` | Which artifact(s) to write |
|
|
190
|
+
| `--report-embed=true\|false` | `true` | Embed screenshots as `data:` URIs (single portable file) vs. copy to `report-assets/` |
|
|
191
|
+
| `--report-open` | — | Open the HTML in your browser when the run finishes (macOS) |
|
|
192
|
+
| `--exit-zero` | — | Always exit 0, even on validation failure (e.g. when you only want the report) |
|
|
193
|
+
|
|
150
194
|
## Security
|
|
151
195
|
|
|
152
196
|
`ANTHROPIC_API_KEY` is the only sensitive secret the agent needs.
|
|
@@ -172,9 +216,9 @@ The agent strips `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `NATIVEAPPTEMP
|
|
|
172
216
|
|
|
173
217
|
## Contributing
|
|
174
218
|
|
|
175
|
-
|
|
219
|
+
Issues and PRs welcome. The repository is stable now (v0.1.x) — no more hackathon-pace rewrites. A `CONTRIBUTING.md` with detailed guidelines will land alongside v0.2.
|
|
176
220
|
|
|
177
|
-
|
|
221
|
+
For now, the simplest path is: open an issue describing what you're trying to do, and we'll figure out the right shape together before code lands. Bug reports with reproducible commands (and the `/tmp/<dir>/tmp/trace/` log) are especially welcome.
|
|
178
222
|
|
|
179
223
|
## License
|
|
180
224
|
|
package/dist/agents/judge.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export type VisualJudgeConfig = {
|
|
|
16
16
|
screenshotDir?: string;
|
|
17
17
|
rubric?: readonly Layer3Criterion[];
|
|
18
18
|
spec?: string;
|
|
19
|
+
stage2?: {
|
|
20
|
+
primaryResourceName: string;
|
|
21
|
+
fullName: string;
|
|
22
|
+
email: string;
|
|
23
|
+
password: string;
|
|
24
|
+
railsOutDir: string;
|
|
25
|
+
rubric?: readonly Layer3Criterion[];
|
|
26
|
+
};
|
|
19
27
|
};
|
|
20
28
|
export declare function runJudge(input: JudgeInput): Promise<JudgeResult>;
|
|
21
29
|
//# sourceMappingURL=judge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../src/agents/judge.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../src/agents/judge.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,UAAU,EAAqB,MAAM,yBAAyB,CAAC;AAIxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAGX,cAAc,EAGd,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAWF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACP,mBAAmB,EAAE,MAAM,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;KACrC,CAAC;CACH,CAAC;AAQF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAkEtE"}
|
package/dist/agents/judge.js
CHANGED
|
@@ -4,6 +4,8 @@ import { isStub } from "../stub.js";
|
|
|
4
4
|
import { runLayer1 } from "../validation/layer1.js";
|
|
5
5
|
import { runLayer2 } from "../validation/layer2.js";
|
|
6
6
|
import { runStage1Visual } from "../validation/stage1.js";
|
|
7
|
+
import { runStage2Visual } from "../validation/stage2-judge.js";
|
|
8
|
+
import { buildQueueScenario } from "../validation/scenarios/queue.js";
|
|
7
9
|
export async function runJudge(input) {
|
|
8
10
|
if (isStub("judge"))
|
|
9
11
|
return runStubJudge();
|
|
@@ -16,32 +18,54 @@ export async function runJudge(input) {
|
|
|
16
18
|
evaluate(input.android, layer2Mode),
|
|
17
19
|
]);
|
|
18
20
|
for (const r of reports) {
|
|
19
|
-
const l1 = r.
|
|
20
|
-
const l2 = r.
|
|
21
|
-
trace("judge", `${r.platform}: Layer 1 ${l1} · Layer 2 ${l2} [${r.
|
|
21
|
+
const l1 = r.layer1.pass ? "PASS" : `FAIL (${r.layer1.findings.length} leftover tokens)`;
|
|
22
|
+
const l2 = r.layer2.pass ? `PASS (${(r.layer2.durationMs / 1000).toFixed(1)}s)` : "FAIL";
|
|
23
|
+
trace("judge", `${r.platform}: Layer 1 ${l1} · Layer 2 ${l2} [${r.layer2.command}]`);
|
|
22
24
|
}
|
|
23
25
|
let visualReport;
|
|
24
26
|
let layer3Summary = "Layer 3 skipped";
|
|
25
27
|
if (input.visual && (input.visual.iosDir || input.visual.androidDir)) {
|
|
26
28
|
visualReport = await runVisualPhase(input.visual, input.domain);
|
|
29
|
+
if (input.visual.stage2) {
|
|
30
|
+
visualReport = await runStage2Phase(visualReport, input.visual, input.domain);
|
|
31
|
+
}
|
|
27
32
|
layer3Summary = formatLayer3Summary(visualReport);
|
|
28
33
|
}
|
|
29
34
|
else {
|
|
30
35
|
trace("judge", "Layer 3 (semantic, Opus 4.7 vision judge) — visual config not provided; skipped");
|
|
31
36
|
}
|
|
32
|
-
const layer1Layer2Pass = reports.every((r) => r.
|
|
37
|
+
const layer1Layer2Pass = reports.every((r) => r.layer1.pass && r.layer2.pass);
|
|
33
38
|
const visualPass = visualReport
|
|
34
39
|
? Object.values(visualReport).every((r) => Boolean(r) && r.pass)
|
|
35
40
|
: true;
|
|
36
41
|
const reviewerPass = input.reviewer.contractParity === "pass";
|
|
37
42
|
const overallPass = layer1Layer2Pass && visualPass && reviewerPass;
|
|
38
|
-
const l1Total = reports.filter((r) => r.
|
|
39
|
-
const l2Total = reports.filter((r) => r.
|
|
43
|
+
const l1Total = reports.filter((r) => r.layer1.pass).length;
|
|
44
|
+
const l2Total = reports.filter((r) => r.layer2.pass).length;
|
|
40
45
|
const reviewerSummary = reviewerPass ? "reviewer PASS" : "reviewer FAIL";
|
|
46
|
+
const platforms = reports.map((r) => {
|
|
47
|
+
const layer3 = r.platform === "ios" ? visualReport?.ios
|
|
48
|
+
: r.platform === "android" ? visualReport?.android
|
|
49
|
+
: undefined;
|
|
50
|
+
return {
|
|
51
|
+
platform: r.platform,
|
|
52
|
+
layer1: { pass: r.layer1.pass, findings: r.layer1.findings },
|
|
53
|
+
layer2: {
|
|
54
|
+
pass: r.layer2.pass,
|
|
55
|
+
command: r.layer2.command,
|
|
56
|
+
mode: layer2Mode,
|
|
57
|
+
exitCode: r.layer2.exitCode,
|
|
58
|
+
durationMs: r.layer2.durationMs,
|
|
59
|
+
...(r.layer2.stderrTail !== undefined ? { stderrTail: r.layer2.stderrTail } : {}),
|
|
60
|
+
},
|
|
61
|
+
...(layer3 !== undefined ? { layer3 } : {}),
|
|
62
|
+
};
|
|
63
|
+
});
|
|
41
64
|
return {
|
|
42
65
|
overallPass,
|
|
43
66
|
summary: `Layer 1 ${l1Total}/3 pass · Layer 2 ${l2Total}/3 pass · ${layer3Summary} · ${reviewerSummary}`,
|
|
44
67
|
...(visualReport ? { visual: visualReport } : {}),
|
|
68
|
+
platforms,
|
|
45
69
|
};
|
|
46
70
|
}
|
|
47
71
|
async function runVisualPhase(config, domain) {
|
|
@@ -70,6 +94,75 @@ async function runVisualPhase(config, domain) {
|
|
|
70
94
|
}
|
|
71
95
|
return report;
|
|
72
96
|
}
|
|
97
|
+
async function runStage2Phase(base, config, domain) {
|
|
98
|
+
if (!config.stage2)
|
|
99
|
+
return base;
|
|
100
|
+
// Per-platform scenarios with platform-suffixed emails so iOS and
|
|
101
|
+
// Android signups don't collide on "email already taken" — both
|
|
102
|
+
// run against the same shared Rails DB.
|
|
103
|
+
const baseInputs = {
|
|
104
|
+
fullName: config.stage2.fullName,
|
|
105
|
+
password: config.stage2.password,
|
|
106
|
+
primaryResourceName: config.stage2.primaryResourceName,
|
|
107
|
+
railsOutDir: config.stage2.railsOutDir,
|
|
108
|
+
};
|
|
109
|
+
const splitEmail = config.stage2.email.split("@");
|
|
110
|
+
const emailLocal = splitEmail[0] ?? "stage2";
|
|
111
|
+
const emailDomain = splitEmail[1] ?? "example.com";
|
|
112
|
+
const iosScenario = buildQueueScenario(domain, { ...baseInputs, email: `${emailLocal}+ios@${emailDomain}` }, "ios");
|
|
113
|
+
const androidScenario = buildQueueScenario(domain, { ...baseInputs, email: `${emailLocal}+android@${emailDomain}` }, "android");
|
|
114
|
+
// Only walk Stage 2 on platforms whose Stage 1 already passed — a
|
|
115
|
+
// failed launch means there's no live app to drive.
|
|
116
|
+
const wantIos = config.iosDir !== undefined && base.ios?.pass === true;
|
|
117
|
+
const wantAndroid = config.androidDir !== undefined && base.android?.pass === true;
|
|
118
|
+
if (!wantIos && !wantAndroid) {
|
|
119
|
+
trace("judge", "Stage 2 — skipped (no Stage 1 PASS to build on)");
|
|
120
|
+
return base;
|
|
121
|
+
}
|
|
122
|
+
const platforms = [wantIos && "ios", wantAndroid && "android"].filter(Boolean).join(" + ");
|
|
123
|
+
trace("judge", `Stage 2 — scripted-CRUD walk via mobile-mcp on ${platforms}`);
|
|
124
|
+
const merged = { ...base };
|
|
125
|
+
// Guard the whole Stage 2 walk: mobile-mcp runs in a child process, and if
|
|
126
|
+
// it exits mid-walk the SDK rejects with `McpError: Connection closed`. That
|
|
127
|
+
// must degrade to a recorded Stage 2 failure — not an unhandled throw that
|
|
128
|
+
// aborts dispatch before the report is written.
|
|
129
|
+
try {
|
|
130
|
+
const stage2 = await runStage2Visual({
|
|
131
|
+
spec: config.spec ?? domain.displayName,
|
|
132
|
+
...(wantIos ? { iosScenario } : {}),
|
|
133
|
+
...(wantAndroid ? { androidScenario } : {}),
|
|
134
|
+
...(config.stage2.rubric !== undefined ? { rubric: config.stage2.rubric } : {}),
|
|
135
|
+
...(config.screenshotDir !== undefined ? { screenshotDir: config.screenshotDir } : {}),
|
|
136
|
+
});
|
|
137
|
+
if (stage2.ios && merged.ios) {
|
|
138
|
+
merged.ios = mergeStage2(merged.ios, stage2.ios);
|
|
139
|
+
trace("judge", `Stage 2 ios: ${stage2.ios.pass ? "PASS" : "FAIL"}` + (stage2.ios.error ? ` — ${stage2.ios.error}` : ""));
|
|
140
|
+
}
|
|
141
|
+
if (stage2.android && merged.android) {
|
|
142
|
+
merged.android = mergeStage2(merged.android, stage2.android);
|
|
143
|
+
trace("judge", `Stage 2 android: ${stage2.android.pass ? "PASS" : "FAIL"}` + (stage2.android.error ? ` — ${stage2.android.error}` : ""));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
148
|
+
trace("judge", `Stage 2 — aborted: ${message}; recorded as Stage 2 failure so the run still produces a report`);
|
|
149
|
+
if (wantIos && merged.ios)
|
|
150
|
+
merged.ios = mergeStage2(merged.ios, stage2Failure(iosScenario.name, message));
|
|
151
|
+
if (wantAndroid && merged.android)
|
|
152
|
+
merged.android = mergeStage2(merged.android, stage2Failure(androidScenario.name, message));
|
|
153
|
+
}
|
|
154
|
+
return merged;
|
|
155
|
+
}
|
|
156
|
+
function stage2Failure(scenarioName, error) {
|
|
157
|
+
return { pass: false, scenarioName, stepCount: 0, stepsPassed: 0, screenshots: [], error };
|
|
158
|
+
}
|
|
159
|
+
function mergeStage2(base, stage2) {
|
|
160
|
+
return {
|
|
161
|
+
...base,
|
|
162
|
+
pass: base.pass && stage2.pass,
|
|
163
|
+
stage2,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
73
166
|
function toPlatformReport(result) {
|
|
74
167
|
const report = { pass: result.ok };
|
|
75
168
|
if (result.screenshotPath !== undefined)
|
|
@@ -107,13 +200,6 @@ async function evaluate(worker, layer2Mode) {
|
|
|
107
200
|
runLayer1({ projectDir: outDir, forbiddenTokens: worker.renamedFrom }),
|
|
108
201
|
runLayer2({ platform: worker.platform, outDir, mode: layer2Mode }),
|
|
109
202
|
]);
|
|
110
|
-
return {
|
|
111
|
-
platform: worker.platform,
|
|
112
|
-
layer1Pass: layer1.pass,
|
|
113
|
-
layer1Findings: layer1.findings.length,
|
|
114
|
-
layer2Pass: layer2.pass,
|
|
115
|
-
layer2Command: layer2.command,
|
|
116
|
-
layer2DurationMs: layer2.durationMs,
|
|
117
|
-
};
|
|
203
|
+
return { platform: worker.platform, layer1, layer2 };
|
|
118
204
|
}
|
|
119
205
|
//# sourceMappingURL=judge.js.map
|
package/dist/agents/judge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"judge.js","sourceRoot":"","sources":["../../src/agents/judge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAmB,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA0C1D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAiB;IAC9C,IAAI,MAAM,CAAC,OAAO,CAAC;QAAE,OAAO,YAAY,EAAE,CAAC;IAE3C,MAAM,UAAU,GAAe,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC;IAC1D,KAAK,CAAC,OAAO,EAAE,qDAAqD,CAAC,CAAC;IACtE,KAAK,CAAC,OAAO,EAAE,qBAAqB,UAAU,qCAAqC,CAAC,CAAC;IAErF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE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MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzC,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;QACtE,SAAS,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;KACnE,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DomainSpec, Platform } from "./types.js";
|
|
2
|
+
export type RepairLayer = "layer1" | "layer2";
|
|
3
|
+
export type RepairTarget = {
|
|
4
|
+
platform: Platform;
|
|
5
|
+
outDir: string;
|
|
6
|
+
layer: RepairLayer;
|
|
7
|
+
detail: string;
|
|
8
|
+
forbiddenTokens?: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
export type RepairOutcome = {
|
|
11
|
+
action: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function runRepair(target: RepairTarget, domain: DomainSpec): Promise<RepairOutcome>;
|
|
14
|
+
//# sourceMappingURL=repair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../src/agents/repair.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQvD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,QAAQ,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAEf,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAI1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAKF,wBAAsB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAkDhG"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import { trace } from "../trace.js";
|
|
3
|
+
import { isStub } from "../stub.js";
|
|
4
|
+
const MODEL = "claude-opus-4-7";
|
|
5
|
+
// One repair pass over a single failing platform. Drives the Claude Agent
|
|
6
|
+
// SDK's agentic loop (Read/Edit/Bash) scoped to the generated project, then
|
|
7
|
+
// returns a summary. The caller re-validates and records resolved/unresolved.
|
|
8
|
+
export async function runRepair(target, domain) {
|
|
9
|
+
if (isStub("repair"))
|
|
10
|
+
return runStubRepair(target);
|
|
11
|
+
const apiKey = process.env["NATIVEAPPTEMPLATE_AGENT_ANTHROPIC_KEY"] ?? process.env["ANTHROPIC_API_KEY"];
|
|
12
|
+
if (!apiKey) {
|
|
13
|
+
return { action: "skipped — no Anthropic API key in env" };
|
|
14
|
+
}
|
|
15
|
+
trace("repair", `${target.platform}/${target.layer}: invoking repair agent in ${target.outDir}`);
|
|
16
|
+
// Layer 2 may need to re-run the compiler to confirm; Layer 1 is a pure
|
|
17
|
+
// source edit, so it gets no shell.
|
|
18
|
+
const allowedTools = target.layer === "layer2"
|
|
19
|
+
? ["Read", "Edit", "Grep", "Glob", "Bash"]
|
|
20
|
+
: ["Read", "Edit", "Grep", "Glob"];
|
|
21
|
+
const response = query({
|
|
22
|
+
prompt: buildPrompt(target, domain),
|
|
23
|
+
options: {
|
|
24
|
+
cwd: target.outDir,
|
|
25
|
+
model: MODEL,
|
|
26
|
+
systemPrompt: SYSTEM_PROMPT,
|
|
27
|
+
allowedTools,
|
|
28
|
+
permissionMode: "bypassPermissions",
|
|
29
|
+
allowDangerouslySkipPermissions: true,
|
|
30
|
+
maxTurns: target.layer === "layer2" ? 40 : 20,
|
|
31
|
+
// Hermetic: don't inherit the developer's ~/.claude settings, project
|
|
32
|
+
// CLAUDE.md, or custom agents — the repair agent runs only with the
|
|
33
|
+
// system prompt below.
|
|
34
|
+
settingSources: [],
|
|
35
|
+
env: { ...stringEnv(process.env), ANTHROPIC_API_KEY: apiKey },
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
let action = `attempted ${target.layer} fix`;
|
|
39
|
+
let turns = 0;
|
|
40
|
+
for await (const message of response) {
|
|
41
|
+
if (message.type === "result") {
|
|
42
|
+
turns = message.num_turns;
|
|
43
|
+
if (message.subtype === "success" && !message.is_error) {
|
|
44
|
+
action = firstLine(message.result) || action;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
action = `repair agent did not converge (${message.subtype})`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
trace("repair", `${target.platform}/${target.layer}: ${turns} turns — ${action}`);
|
|
52
|
+
return { action };
|
|
53
|
+
}
|
|
54
|
+
const SYSTEM_PROMPT = `You are a repair agent for a generated three-platform SaaS project (Rails 8.1 API, SwiftUI iOS, Jetpack Compose Android). A generated project failed one validation layer; your job is to make the smallest correct edit that fixes it. You operate ONLY inside the current working directory (one generated platform project) — never touch any other path.
|
|
55
|
+
|
|
56
|
+
Two failure classes:
|
|
57
|
+
- Layer 1 (structural): leftover substrate tokens (e.g. Shop, Shopkeeper, ItemTag, NativeAppTemplate and derived forms) survived the rename. Replace each remaining occurrence with its renamed equivalent, consistently, preserving case style (PascalCase→PascalCase, snake_case→snake_case). Do not rename anything that is NOT a substrate token. Do not introduce a token that collides with a language/framework reserved word.
|
|
58
|
+
- Layer 2 (runtime): the project failed to build/compile. Read the compiler error, find the root cause, and fix it with a minimal, idiomatic change.
|
|
59
|
+
|
|
60
|
+
Known-cryptic failure modes — slow down and verify rather than pattern-match:
|
|
61
|
+
- Jetpack Compose compilation errors (often a missing import, a @Composable context mismatch, or a type-inference failure).
|
|
62
|
+
- Hilt dependency-injection errors (missing @Inject / @Provides / module binding, or a scope mismatch).
|
|
63
|
+
|
|
64
|
+
Make targeted edits; do not refactor unrelated code, add dependencies, or rewrite files wholesale. When done, reply with ONE concise sentence describing exactly what you changed.`;
|
|
65
|
+
function buildPrompt(target, domain) {
|
|
66
|
+
const renamePlan = domain.renamePlan.map((r) => `${r.from} → ${r.to}`).join(", ");
|
|
67
|
+
if (target.layer === "layer1") {
|
|
68
|
+
const forbidden = (target.forbiddenTokens ?? []).join(", ");
|
|
69
|
+
return `This generated ${target.platform} project still contains leftover substrate tokens that must not appear. Forbidden tokens: ${forbidden || "(see findings)"}. The intended renames are: ${renamePlan}.
|
|
70
|
+
|
|
71
|
+
Leftover findings (token · file:line · excerpt):
|
|
72
|
+
${target.detail}
|
|
73
|
+
|
|
74
|
+
Replace every leftover occurrence with its renamed equivalent, then confirm none remain.`;
|
|
75
|
+
}
|
|
76
|
+
return `This generated ${target.platform} project failed to build. The intended domain renames were: ${renamePlan}.
|
|
77
|
+
|
|
78
|
+
Compiler error (stderr tail):
|
|
79
|
+
${target.detail}
|
|
80
|
+
|
|
81
|
+
Diagnose and fix the root cause with a minimal edit. If you have a shell available, you may re-run the build to confirm, but keep it bounded.`;
|
|
82
|
+
}
|
|
83
|
+
// process.env is Record<string, string | undefined>; the SDK env option
|
|
84
|
+
// wants string values only. Drop undefined entries.
|
|
85
|
+
function stringEnv(env) {
|
|
86
|
+
const out = {};
|
|
87
|
+
for (const [k, v] of Object.entries(env)) {
|
|
88
|
+
if (typeof v === "string")
|
|
89
|
+
out[k] = v;
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function firstLine(text) {
|
|
94
|
+
const line = text.trim().split("\n")[0] ?? "";
|
|
95
|
+
return line.length > 200 ? `${line.slice(0, 197)}…` : line;
|
|
96
|
+
}
|
|
97
|
+
const delay = (ms) => new Promise((r) => { setTimeout(r, ms); });
|
|
98
|
+
async function runStubRepair(target) {
|
|
99
|
+
trace("repair", `(stub mode) ${target.platform}/${target.layer}`);
|
|
100
|
+
await delay(50);
|
|
101
|
+
return { action: `stub repair: no-op for ${target.platform} ${target.layer}` };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=repair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../src/agents/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,KAAK,GAAG,iBAAiB,CAAC;AA4BhC,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAoB,EAAE,MAAkB;IACtE,IAAI,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,8BAA8B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAEjG,wEAAwE;IACxE,oCAAoC;IACpC,MAAM,YAAY,GAChB,MAAM,CAAC,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1C,CAAC,CAAC,CAAC,MAAM,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IAC9C,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAExF,KAAK,UAAU,aAAa,CAAC,MAAoB;IAC/C,KAAK,CAAC,QAAQ,EAAE,eAAe,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAClE,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,0BAA0B,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;AACjF,CAAC"}
|
package/dist/agents/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Layer1Finding } from "../validation/layer1.js";
|
|
1
2
|
export type DomainSpec = {
|
|
2
3
|
slug: string;
|
|
3
4
|
displayName: string;
|
|
@@ -21,7 +22,7 @@ export type RenamePair = {
|
|
|
21
22
|
to: string;
|
|
22
23
|
};
|
|
23
24
|
export type Platform = "rails" | "ios" | "android";
|
|
24
|
-
export type AgentName = "planner" | Platform | "reviewer" | "judge";
|
|
25
|
+
export type AgentName = "planner" | Platform | "reviewer" | "judge" | "dispatch" | "repair";
|
|
25
26
|
export type WorkerResult = {
|
|
26
27
|
platform: Platform;
|
|
27
28
|
outDir: string;
|
|
@@ -36,6 +37,23 @@ export type JudgeResult = {
|
|
|
36
37
|
overallPass: boolean;
|
|
37
38
|
summary: string;
|
|
38
39
|
visual?: VisualJudgeReport;
|
|
40
|
+
platforms?: readonly PlatformDetail[];
|
|
41
|
+
};
|
|
42
|
+
export type PlatformDetail = {
|
|
43
|
+
platform: Platform;
|
|
44
|
+
layer1: {
|
|
45
|
+
pass: boolean;
|
|
46
|
+
findings: readonly Layer1Finding[];
|
|
47
|
+
};
|
|
48
|
+
layer2: {
|
|
49
|
+
pass: boolean;
|
|
50
|
+
command: string;
|
|
51
|
+
mode: "fast" | "build";
|
|
52
|
+
exitCode: number | null;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
stderrTail?: string;
|
|
55
|
+
};
|
|
56
|
+
layer3?: VisualJudgePlatformReport;
|
|
39
57
|
};
|
|
40
58
|
export type VisualJudgeReport = {
|
|
41
59
|
ios?: VisualJudgePlatformReport;
|
|
@@ -50,5 +68,20 @@ export type VisualJudgePlatformReport = {
|
|
|
50
68
|
rationale: string;
|
|
51
69
|
}[];
|
|
52
70
|
error?: string;
|
|
71
|
+
stage2?: Stage2PlatformReport;
|
|
72
|
+
};
|
|
73
|
+
export type Stage2PlatformReport = {
|
|
74
|
+
pass: boolean;
|
|
75
|
+
scenarioName: string;
|
|
76
|
+
stepCount: number;
|
|
77
|
+
stepsPassed: number;
|
|
78
|
+
screenshots: readonly string[];
|
|
79
|
+
representativeScreenshot?: string;
|
|
80
|
+
layer3Scores?: readonly {
|
|
81
|
+
criterionId: string;
|
|
82
|
+
pass: boolean;
|
|
83
|
+
rationale: string;
|
|
84
|
+
}[];
|
|
85
|
+
error?: string;
|
|
53
86
|
};
|
|
54
87
|
//# sourceMappingURL=types.d.ts.map
|