From 6b2fcf578072e202858d0314fcafbf25889e3b6d Mon Sep 17 00:00:00 2001 From: ngqile Date: Thu, 26 Nov 2026 19:10:56 +0800 Subject: [PATCH] docs: archive add-repo-foundation-local-stack Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/local-dev-stack/spec.md | 0 .../tasks.md | 0 openspec/specs/local-dev-stack/spec.md | 80 +++++++++++++++++++ 6 files changed, 80 insertions(+) rename openspec/changes/{add-repo-foundation-local-stack => archive/2026-11-26-add-repo-foundation-local-stack}/.openspec.yaml (100%) rename openspec/changes/{add-repo-foundation-local-stack => archive/2026-11-26-add-repo-foundation-local-stack}/design.md (100%) rename openspec/changes/{add-repo-foundation-local-stack => archive/2026-11-26-add-repo-foundation-local-stack}/proposal.md (100%) rename openspec/changes/{add-repo-foundation-local-stack => archive/2026-11-26-add-repo-foundation-local-stack}/specs/local-dev-stack/spec.md (100%) rename openspec/changes/{add-repo-foundation-local-stack => archive/2026-11-26-add-repo-foundation-local-stack}/tasks.md (100%) create mode 100644 openspec/specs/local-dev-stack/spec.md diff --git a/openspec/changes/add-repo-foundation-local-stack/.openspec.yaml b/openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/.openspec.yaml similarity index 100% rename from openspec/changes/add-repo-foundation-local-stack/.openspec.yaml rename to openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/.openspec.yaml diff --git a/openspec/changes/add-repo-foundation-local-stack/design.md b/openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/design.md similarity index 100% rename from openspec/changes/add-repo-foundation-local-stack/design.md rename to openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/design.md diff --git a/openspec/changes/add-repo-foundation-local-stack/proposal.md b/openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/proposal.md similarity index 100% rename from openspec/changes/add-repo-foundation-local-stack/proposal.md rename to openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/proposal.md diff --git a/openspec/changes/add-repo-foundation-local-stack/specs/local-dev-stack/spec.md b/openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/specs/local-dev-stack/spec.md similarity index 100% rename from openspec/changes/add-repo-foundation-local-stack/specs/local-dev-stack/spec.md rename to openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/specs/local-dev-stack/spec.md diff --git a/openspec/changes/add-repo-foundation-local-stack/tasks.md b/openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/tasks.md similarity index 100% rename from openspec/changes/add-repo-foundation-local-stack/tasks.md rename to openspec/changes/archive/2026-11-26-add-repo-foundation-local-stack/tasks.md diff --git a/openspec/specs/local-dev-stack/spec.md b/openspec/specs/local-dev-stack/spec.md new file mode 100644 index 0000000..cc888e1 --- /dev/null +++ b/openspec/specs/local-dev-stack/spec.md @@ -0,0 +1,80 @@ +# local-dev-stack Specification + +## Purpose + +Lets a developer build, start, seed and check the whole Co-Lite backend on their own machine, with no shared environment. + +## Requirements + +### Requirement: Single build for all backend modules + +The repository SHALL build and test every kept backend module with one Maven command run from the repository root. + +#### Scenario: Root build succeeds + +- **GIVEN** a fresh clone with JDK 21 and Maven installed +- **WHEN** the developer runs `mvn -T 1C verify` at the repository root +- **THEN** every kept module compiles and its tests pass + +### Requirement: Isolated core library version + +The Co-Lite core library MUST be published under a version distinct from every other Solvway project on the same machine. + +#### Scenario: Local install does not overwrite other projects + +- **GIVEN** Tastefully's `tastefully-v1` core library is in the local Maven repository +- **WHEN** the developer installs Co-Lite's core library +- **THEN** it is stored as version `colite-v1` +- **AND** the `tastefully-v1` artifact is unchanged + +### Requirement: One command starts the local stack + +The repository SHALL start MySQL, Redis, the Pub/Sub emulator and every kept backend service locally with one documented command. + +#### Scenario: Stack starts healthy + +- **WHEN** the developer runs the documented start command +- **THEN** every service container reaches a running, healthy state +- **AND** no service logs a startup failure about a missing topic, subscription, schema or dropped service + +### Requirement: Local database is seeded on first start + +The local stack SHALL create the kept service schemas, their reference data, one company and one admin user on first start of an empty database. + +#### Scenario: Empty database is seeded + +- **GIVEN** the local MySQL volume is empty +- **WHEN** the stack starts +- **THEN** the schemas `service-system`, `service-counter`, `service-member`, `service-log` and `service-email` exist with their tables +- **AND** one company and one admin user exist + +#### Scenario: Seed contains no customer data + +- **WHEN** the seed files are committed +- **THEN** they contain table definitions and reference rows only, with no Tastefully member, attendance, order or user rows + +### Requirement: Local stack can be reset + +The repository SHALL provide a documented command that deletes local data and reseeds from scratch. + +#### Scenario: Reset restores the seeded state + +- **GIVEN** the developer has changed data in the local database +- **WHEN** they run the documented reset command and start the stack again +- **THEN** the database holds only the seeded data + +### Requirement: End-to-end smoke check + +The repository SHALL include a smoke check that logs in as the seeded admin through the gateway, reads from services-counter through the gateway, and calls a public mobile-api endpoint, confirming each succeeds against MySQL. + +#### Scenario: Smoke check passes on a healthy stack + +- **GIVEN** the stack is running and seeded +- **WHEN** the developer runs the smoke check +- **THEN** it exits with status 0 and prints HTTP status 200 for each call + +#### Scenario: Smoke check fails loudly + +- **GIVEN** services-counter is stopped +- **WHEN** the developer runs the smoke check +- **THEN** it exits with a non-zero status and names the failing call -- 2.54.1