S201 Handoff Prompt
Context and instructions for the next agent continuing platform code generation work
S201 Handoff Prompt — Validating & Hardening Platform Code Generation
Who You Are
You are continuing work on GoGrab Space's Generate → Edit → Deploy pipeline. Session 200 connected the frontend to the backend infrastructure and fixed critical generation bugs. Your job is to validate the fixes work end-to-end and harden the remaining rough edges.
What Was Built in S200 (5 Commits)
| Commit | What | Key Files |
|---|---|---|
| S200.1 | Frontend wiring — VfsSyncService GitLab loading, auto-commit, SSE reconnect, MR URL | libs/libs-structural/vitto-studio/.../vfs-sync.service.ts, libs/libs-ai/vitto-chat/.../vitto-chat-engine.service.ts |
| S200.2 | Deploy pipeline + code quality + chat integration | APIs/backend-vitto-api/.../studio-deploy.controller.ts, APIs/backend-vitto-api/.../auto-correction.service.ts, APIs/backend-vitto-api/.../context-assembly.service.ts |
| S200.3 | MongoDB schema fix — empty content in task messages | APIs/backend-ai-api/.../sessions.schema.ts |
| S200.4 | Generation pipeline fixes — GitLab 403 fallback, scaffold templates, parallel execution, progress UX | APIs/backend-vitto-api/.../module-gen-phase.executor.ts, APIs/backend-vitto-api/.../execute.phase.ts, APIs/backend-vitto-api/.../universe-git.service.ts |
| S200.5 | Module path aliases include category — @module/{category}/{slug} | APIs/backend-vitto-api/.../module-gen-phase.executor.ts, APIs/backend-vitto-api/.../app-shell-generator.service.ts |
The Full Plan
Read: docs/english/Plans/perfecting-platform-code-gen.plan.md
Phases 1-4 are implemented. Phase 5 (Production Hardening) remains.
Your Priority: Validate & Fix
Priority 1: Verify Generation End-to-End
The S200 fixes need validation with a real generation run. Key things to verify:
- Category assignment — Are modules getting meaningful categories (layout, analytics, etc.) or still defaulting to structural?
- GitLab repo creation — Does the personal namespace fallback work? Check for any repo path issues.
- Scaffold templates — Do generated form/list/detail components compile? Check for:
crud.onSubmit()notform.submit()crud.isFieldInvalid('name')notisFieldInvalid('name')crud.form()notform.formGroup()
- Path aliases — Are they
@module/{category}/{slug}format? - package.json — Does each module get one?
- Parallel execution — Are modules batched? Check logs for "PARALLEL: Executing batch of N modules"
- modules.map error — Should be gone. Verify tool handler gets actual module array.
Priority 2: Studio Visualization
Vitto Studio's file tree should show generated modules. If it doesn't:
- Check that
VfsSyncService.setRepoContext()is being called - Check that
refreshAllModulesFromRepo()gets data from GitLab - The
StudioGenerationListenerServiceuses mode-awarerefreshModule()/refreshAllModules()
Priority 3: Production Hardening (Phase 5)
From the plan:
- 5.1 MongoDB event persistence for SSE (replace in-memory ReplaySubject)
- 5.2 Local dev mode (
SAVE_GENERATED_LOCALLY=true+ file watcher) - 5.3 NX module registration (yarn paths:merge after generation)
- 5.4 Post-generation chat summary
- 5.5 Pipeline visualization polish
- 5.6 Multi-tenant isolation verification
- 5.7 Rollback capability
Key Architecture Context
- GitLab is the source of truth for all generated code
- Module aliases:
@module/{category}/{slug}(NEVER without category) - Categories inferred from names: dashboard→layout, auth→auth, analytics→analytics, chat→communication
- Parallel generation:
PARALLEL_MODULE_GEN_BATCH=3env var (default) - Scaffold fallback: After 2 failed LLM fix attempts, scaffold guarantees valid code
- Platform output:
platforms/{spaceSlug}/{platformSlug}/for app shells,modules/{category}/{slug}/for modules
Critical Conventions (from S200)
session.result.executeResult.modulesMUST be an array, never a count- Scaffold templates must use
crud.*prefix (useCrudForm/useCrudList return objects) - GitLab
initializeRepofalls back to personal namespace on 403 normalizeDecomposeResult→inferModuleCategory()maps names to categories- Every module needs
package.jsonwith name@module/{category}/{slug} IntelligentMessageDoc.contentisrequired: false(task messages have empty content)
Existing Infrastructure
| Service | Port | What It Does |
|---|---|---|
VfsSyncService (frontend) |
— | Mode-aware: GitLab or disk, setRepoContext() controls mode |
StudioDeployController (backend-vitto-api) |
3003 | POST /studio/deploy — SSE-streaming deploy from GitLab |
UniverseGitService (backend-vitto-api) |
3003 | GitLab API with personal namespace fallback |
ExecutePhaseService (backend-vitto-api) |
3003 | Parallel module generation via dependency-aware batching |
AutoCorrectionService (backend-vitto-api) |
3003 | 42 rules, now enforces BaseEntity + BaseCrudApiService |
ContextAssemblyService (backend-vitto-api) |
3003 | Module instructions enrichment in system prompts |
What NOT to Do
- Do NOT manually edit generated module files. Fix the generator instead.
- Do NOT edit tsconfig.base.json for @module/* paths. Use
config/tsconfig-paths/modules/generated.paths.json+yarn paths:merge. - Do NOT hardcode ports. Use env vars from
.env.local. - Do NOT pass
--portto backend serve commands (causes WebSocket 400 errors). - Do NOT use Promises or async/await in Angular code. Use RxJS Observables exclusively.
- Do NOT use @module/{slug} without category. Always
@module/{category}/{slug}.
Commit Convention
[S201.N] type: description
Example: [S201.1] fix: verify generation produces compilable modules