diff --git a/openspec/changes/project-crud-sync/.openspec.yaml b/openspec/changes/archive/2026-06-22-project-crud-sync/.openspec.yaml similarity index 100% rename from openspec/changes/project-crud-sync/.openspec.yaml rename to openspec/changes/archive/2026-06-22-project-crud-sync/.openspec.yaml diff --git a/openspec/changes/project-crud-sync/design.md b/openspec/changes/archive/2026-06-22-project-crud-sync/design.md similarity index 100% rename from openspec/changes/project-crud-sync/design.md rename to openspec/changes/archive/2026-06-22-project-crud-sync/design.md diff --git a/openspec/changes/project-crud-sync/proposal.md b/openspec/changes/archive/2026-06-22-project-crud-sync/proposal.md similarity index 100% rename from openspec/changes/project-crud-sync/proposal.md rename to openspec/changes/archive/2026-06-22-project-crud-sync/proposal.md diff --git a/openspec/changes/project-crud-sync/specs/project-full-lifecycle/spec.md b/openspec/changes/archive/2026-06-22-project-crud-sync/specs/project-full-lifecycle/spec.md similarity index 100% rename from openspec/changes/project-crud-sync/specs/project-full-lifecycle/spec.md rename to openspec/changes/archive/2026-06-22-project-crud-sync/specs/project-full-lifecycle/spec.md diff --git a/openspec/changes/project-crud-sync/tasks.md b/openspec/changes/archive/2026-06-22-project-crud-sync/tasks.md similarity index 100% rename from openspec/changes/project-crud-sync/tasks.md rename to openspec/changes/archive/2026-06-22-project-crud-sync/tasks.md diff --git a/openspec/specs/project-full-lifecycle/spec.md b/openspec/specs/project-full-lifecycle/spec.md new file mode 100644 index 0000000..20def74 --- /dev/null +++ b/openspec/specs/project-full-lifecycle/spec.md @@ -0,0 +1,32 @@ +## Purpose + +TBD — Project full-lifecycle management covers the creation, persistence, retrieval, update, and deletion of `Project` resources across the stack (schema → database → API → web). + +## Requirements + +### Requirement: Project Lifecycle Management (CRUD) + +The system SHALL provide full CRUD functionality for the `Project` resource, managed by a central service layer. All operations must be atomic and transactionally consistent across API and Web paths. This includes validation on creation (name uniqueness). + +#### Scenario: Successful Project Creation + +- **WHEN** valid payload {name, ownerId, templateType} is submitted to POST /projects +- **THEN** a unique Project resource record is created with status 'ACTIVE', and all related metadata are initialized correctly. + +### Requirement: Schema Migration Enforcement + +The system SHALL enforce database schema changes via versioned migrations (e.g., using an established ORM migration tool). The deployment process MUST fail if the current schema does not match the expected state defined by the latest migration script. + +#### Scenario: Applying New Schema + +- **WHEN** deploying a change requiring a new column (`last_updated`) on `projects` table +- **THEN** the deployment pipeline runs the required migration, adding the column without breaking existing application runtime logic (e.g., providing a default value or nullability). + +### Requirement: Optional Data Seeding + +The system SHALL support optional data seeding scripts for development and testing environments. These scripts MUST be idempotent to allow multiple safe executions. + +#### Scenario: Running Seed Scripts + +- **WHEN** running the setup script `pnpm run db:seed` in a test environment with existing data +- **THEN** any record matching seed criteria (e.g., default user) is updated rather than duplicated, and the script logs successful updates/inserts.