Reference implementation for the Phoenix Architecture. Work in progress. aicoding.leaflet.pub/
ai coding crazy
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: nullable FK fields in Zod schemas — systemic prompt rule

Web UI sends null for project_id when no project selected, but Zod
schema only had .optional() (accepts undefined, rejects null).
Added architecture prompt rule: nullable FK fields MUST use
.nullable().optional() to accept both null and undefined.

+2 -1
examples/todo-app/data/app.db-shm

This is a binary file and will not be displayed.

examples/todo-app/data/app.db-wal

This is a binary file and will not be displayed.

+1 -1
examples/todo-app/src/generated/todos/tasks.ts
··· 34 34 const parsed = new Date(date); 35 35 return !isNaN(parsed.getTime()) && parsed.getFullYear() > 1900 && parsed.getFullYear() < 3000; 36 36 }, 'Invalid due date').optional(), 37 - project_id: z.number().int().optional(), 37 + project_id: z.number().int().nullable().optional(), 38 38 }); 39 39 40 40 const UpdateTaskSchema = z.object({
+1
src/architectures/sqlite-web-api.ts
··· 143 143 - ALWAYS use snake_case for JSON response keys: category_name, created_at — NEVER categoryname or createdat. 144 144 - Include \`created_at TEXT NOT NULL DEFAULT (datetime('now'))\` for timestamps. 145 145 - Foreign key columns must match the referenced table: \`category_id INTEGER REFERENCES categories(id)\` 146 + - Nullable foreign key fields in Zod schemas MUST use \`.nullable().optional()\` — both null and undefined mean "no reference". Example: \`project_id: z.number().int().nullable().optional()\` 146 147 147 148 ### Stats / aggregate endpoints 148 149 - If the spec describes a stats or aggregate endpoint, implement it as a route on the same router.