docs: create milestone v1.3 roadmap (3 phases, 16 requirements)

This commit is contained in:
Chandler Copeland
2026-04-06 12:05:21 -06:00
parent 05d531a929
commit caf9acf0c2
3 changed files with 106 additions and 18 deletions

View File

@@ -2,16 +2,16 @@
gsd_state_version: 1.0
milestone: v1.3
milestone_name: Document Templates
status: defining requirements
stopped_at: Milestone v1.3 started — Document Templates
status: roadmap defined
stopped_at: v1.3 roadmap created — Phases 18-20 defined, ready for plan-phase 18
last_updated: "2026-04-06T00:00:00.000Z"
last_activity: 2026-04-06
progress:
total_phases: 19
total_phases: 22
completed_phases: 18
total_plans: 58
completed_plans: 57
percent: 100
percent: 82
---
# Project State
@@ -24,10 +24,10 @@ See: .planning/PROJECT.md (updated 2026-04-03)
## Current Position
Phase: 17 (docker-deployment) — EXECUTING
Plan: 2 of 2
Status: Phase complete — ready for verification
Last activity: 2026-04-03
Phase: 18 (template-schema-and-crud-api) — NOT STARTED
Plan: 0 of TBD
Status: Roadmap defined — awaiting plan-phase 18
Last activity: 2026-04-06
## Note on v1.1
@@ -44,14 +44,25 @@ v1.2 (Multi-Signer and Deployment Hardening) roadmap is defined. Four phases pla
Start v1.2 after Phase 13 Plan 04 completes: `/gsd:plan-phase 14`
## Note on v1.3
v1.3 (Document Templates) roadmap created 2026-04-06. Three phases planned:
- Phase 18: Template Schema and CRUD API — `document_templates` table (Drizzle migration), GET/POST/PATCH/DELETE API routes, soft-delete pattern
- Phase 19: Template Editor UI — FieldPlacer `onPersist` abstraction, template editor page, AI auto-place via `/api/templates/[id]/ai-prepare`, signer role label support, save
- Phase 20: Apply Template and Portal Nav — "Start from template" in AddDocumentModal, field snapshot with fresh UUIDs, role-to-email mapping, text hint quick-fill, Templates nav + list page
Start v1.3 with: `/gsd:plan-phase 18`
## Accumulated Context
### Roadmap Evolution
- Phase 11.1 inserted after Phase 11: Agent and Client Initials (URGENT)
- v1.2 roadmap created 2026-04-03: Phases 14-17 (Multi-Signer + Docker Deployment)
- v1.3 roadmap created 2026-04-06: Phases 18-20 (Document Templates)
Progress: [█████████████] 100% (13/13 phases complete — v1.1 scope)
Progress: [████████████░░░] 82% (18/22 phases complete — counting v1.3 scope)
## Performance Metrics
@@ -189,6 +200,17 @@ Recent decisions affecting v1.1 work:
- [v1.2 Research]: Neon connection pool set to max:5 — prevents connection exhaustion on free tier
- [v1.2 Research]: @vercel/blob is a dead dependency — remove before Phase 17 to prevent accidental use in Docker deployment
### v1.3 Pre-decisions (from research)
- [v1.3 Research]: `document_templates` is a separate table from `form_templates` — form_templates is read-only seeded catalog; document_templates is agent-authored field layouts; FK from new to old
- [v1.3 Research]: Template fields carry signer role labels ("Buyer", "Seller") in the signerEmail slot — the apply operation enforces a complete role-to-email map before DB INSERT; email format validation must not run during template editing
- [v1.3 Research]: Field ID collision prevention is mandatory — stamp fresh crypto.randomUUID() on every field at apply time; template field IDs must never appear in documents
- [v1.3 Research]: `hint` vs `textFillData` distinction — hint is a placeholder label stored in template; textFillData holds values burned into PDFs; never store hints in textFillData
- [v1.3 Research]: Soft-delete only (`archivedAt` column) — no hard deletes; list API filters `archivedAt IS NULL`; documents.formTemplateId is lineage metadata only, no ON DELETE CASCADE
- [v1.3 Research]: FieldPlacer `onPersist` callback is a non-breaking addition — existing document consumers pass no prop, behavior unchanged; template editor passes the callback to save to document_templates
- [v1.3 Research]: `updatedAt` must be set explicitly in update queries — no DB trigger; follows existing pattern in all current tables
- [v1.3 Research]: Single non-agent signer role auto-maps to assigned client email — reduces friction for solo-agent single-signer templates; agent can override
### Pending Todos
None yet.
@@ -197,9 +219,10 @@ None yet.
- [Phase 12 - CARRY FORWARD]: Deployment target confirmed as Docker (Phase 17 addresses this) — write-to-disk preview pattern is valid for self-hosted container
- [Phase 13]: AI coordinate accuracy on real Utah forms is untested — integration test with full 20-page Utah REPC required before Phase 13 ships
- [Phase 19 - PRE-DECISION NEEDED]: Confirm whether FieldPlacer has any `z.string().email()` or similar validation on `signerEmail` before Phase 19 begins — if so, introduce `mode: "template" | "document"` prop alongside `onPersist`
## Session Continuity
Last session: 2026-04-03T22:58:03.579Z
Stopped at: Completed 17-02-PLAN.md — Dockerfile, docker-compose.yml, .dockerignore, .env.production.example, DEPLOYMENT.md
Last session: 2026-04-06T00:00:00.000Z
Stopped at: v1.3 roadmap created — Phases 18-20 defined; ROADMAP.md, STATE.md, REQUIREMENTS.md updated
Resume file: None