Support four database engines in Flask React template

This commit is contained in:
rob
2026-11-17 19:52:08 +00:00
parent 444406d2fc
commit a00837178e
21 changed files with 131 additions and 41 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
# Current state
FORGE-F001, FORGE-F002, and FORGE-F007 were human accepted and are present on `codex`. F003 and F004 candidates are merged with external validation and acceptance pending. F006 has an independent Flask/React template package and generator candidate directly on `codex`; human acceptance and some generated-project checks remain pending. Explicit business/personal profile configuration is implemented. `bortstack-context`, `bortstack-contributor`, and `bortstack-design` packages are present; one skill directory remains reserved. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. No cross-template generator or active legacy-skill migration has been implemented. Captain reports successful external validation of local Penpot 2.18 Docker and integrated MCP, but this session has no Penpot connector/browser. Windows and JJ's hands-on workflow have not been tested. Decisions FORGE-001 through FORGE-009 remain accepted. Captain has authorised direct `codex` work until further notice.
FORGE-F001, FORGE-F002, and FORGE-F007 were human accepted and are present on `codex`. F003 and F004 candidates are merged with external validation and acceptance pending. F006 has an independent Flask/React template package and generator candidate directly on `codex`; human acceptance and Windows generation remain pending. F006 now supports SQLite, PostgreSQL, MySQL, and MariaDB, with generated migrations verified against all four in disposable Docker containers. Explicit business/personal profile configuration is implemented. `bortstack-context`, `bortstack-contributor`, and `bortstack-design` packages are present; one skill directory remains reserved. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. No cross-template generator or active legacy-skill migration has been implemented. Captain reports successful external validation of local Penpot 2.18 Docker and integrated MCP, but this session has no Penpot connector/browser. Windows and JJ's hands-on workflow have not been tested. Decisions FORGE-001 through FORGE-010 remain accepted. Captain has authorised direct `codex` work until further notice.
+4 -1
View File
@@ -1,6 +1,6 @@
# Architecture decisions
FORGE-001 through FORGE-005 were approved planning inputs on 2026-11-17 and are retained with subsequent approved details. FORGE-006 records the approved task identification policy. FORGE-007 supersedes only the PitchInvader pilot clause of FORGE-004; its design ownership and approval policy remain in force. FORGE-008 records Captain's temporary direct-`codex` workflow. FORGE-009 records the approved template migration defaults.
FORGE-001 through FORGE-005 were approved planning inputs on 2026-11-17 and are retained with subsequent approved details. FORGE-006 records the approved task identification policy. FORGE-007 supersedes only the PitchInvader pilot clause of FORGE-004; its design ownership and approval policy remain in force. FORGE-008 records Captain's temporary direct-`codex` workflow. FORGE-009 records the approved template migration defaults. FORGE-010 records the approved database set for the Flask/React template.
## FORGE-001 — Technology-Agnostic Project Bootstrap Architecture
Status: Accepted. Date: 2026-11-17. Rationale: project lifecycle must apply across stacks. Consequences: Core has no Flask, React, React Native, or other framework dependency; independently maintained templates own stack-specific behavior. Generated projects have no Forge runtime dependency. Supersedes: none.
@@ -28,3 +28,6 @@ Status: Accepted. Date: 2026-11-17. Rationale: Captain wants initial Forge tasks
## FORGE-009 — Optional Email and Hosting Foundations in Migrated Template
Status: Accepted. Date: 2026-11-17. Rationale: generated applications must remain useful without a GitHub account, a production host, or a Bortstack email identity. Consequences: FORGE-F006 preserves the template's email and hosting foundations as optional configuration, uses neutral project-specific defaults, and does not publish or deploy during generation. GitHub, Resend, Cloudflare, SWAG, and production setup require separate project choices; the original template repository remains unchanged. Supersedes: mandatory provider and immediate-deployment assumptions for the Forge migration only.
## FORGE-010 — Multi-Database Flask/React Template
Status: Accepted. Date: 2026-11-17. Rationale: Captain wants the generated application to support multiple database engines and selected SQLite, PostgreSQL, MySQL, and MariaDB for FORGE-F006. Consequences: local generation defaults to persistent SQLite; PostgreSQL, MySQL, and MariaDB are opt-in Compose overlays with their respective Python drivers and configuration examples. Validate generated migrations against all four engines. Database credentials belong in private project configuration, never in tracked production files. Supersedes: the inherited assumption that MySQL is the default generated database.
+3 -3
View File
@@ -2,10 +2,10 @@
Current work: FORGE-F006 migrated the tracked `flask-react-auth-base` source at `ff139bf5f28f4604b4a7108f4ee26608dea9924e` into Forge on `codex`, starting from `bc6b6d2`. The original source repository was read and remained clean/unchanged. F006 is Ready to Finalise for Captain review, not Complete. Direct `codex` work follows FORGE-008. No external application, provider, or production infrastructure was modified.
Implementation: `templates/flask-react/` now contains a descriptor, independent source payload, Python generator, fresh neutral context boilerplate, and optional GitHub workflow. Generated projects do not need GitHub, SWAG, Resend, a production host, or Forge at runtime. Email is disabled by default, branding is project-specific, and optional SWAG uses a separate Compose overlay. Existing `roborto-*` skills and Forge distribution tooling are untouched.
Implementation: `templates/flask-react/` now contains a descriptor, independent source payload, Python generator, fresh neutral context boilerplate, and optional GitHub workflow. Generated projects do not need GitHub, SWAG, Resend, a production host, or Forge at runtime. Email is disabled by default, branding is project-specific, and optional SWAG uses a separate Compose overlay. Under FORGE-010, the generated Compose base uses persistent SQLite; PostgreSQL, MySQL, and MariaDB have opt-in database overlays and example environment files. The API image includes psycopg and PyMySQL. Existing `roborto-*` skills and Forge distribution tooling are untouched.
Validation: Forge `python3 -m unittest discover -s tests -v` passed 15 tests and `python3 scripts/validate-skills.py` passed. A disposable `Orion Starter` generated at `/tmp/forge-f006-orion2` passed 14 backend tests in an ephemeral Docker container, SQLite migration upgrades, Compose configuration, and API/nginx image builds. A fresh `/tmp/forge-f006-orion3` passed base and optional SWAG-overlay Compose configuration, clean `npm ci`, 16 frontend tests, lint, and build in a Node container. A further disposable `/tmp/forge-f006-browser-trial` passed 23 Playwright checks with one intentional skip after Chromium OS libraries were installed in the ephemeral runner. Generator tests cover local-only mode, optional local Git, collision refusal, copied capabilities, neutral identity, and no active GitHub workflow. `git diff --check` passed.
Validation: Forge `python3 -m unittest discover -s tests -v` passed 15 tests and `python3 scripts/validate-skills.py` passed. A disposable `Orion Starter` generated at `/tmp/forge-f006-orion2` passed 14 backend tests in an ephemeral Docker container, SQLite migration upgrades, Compose configuration, and API/nginx image builds. A fresh `/tmp/forge-f006-orion3` passed base and optional SWAG-overlay Compose configuration, clean `npm ci`, 16 frontend tests, lint, and build in a Node container. A further disposable `/tmp/forge-f006-browser-trial` passed 23 Playwright checks with one intentional skip after Chromium OS libraries were installed in the ephemeral runner. A new `Matrix Trial` generation passed base and all database-overlay Compose configuration, API image build, and live Alembic upgrades on SQLite, PostgreSQL, MySQL, and MariaDB. Disposable database containers, networks, and volumes were removed. Generator tests cover local-only mode, optional local Git, collision refusal, copied capabilities, neutral identity, no active GitHub workflow, and the database overlays. `git diff --check` passed.
Limitations: Host Python lacked Flask, so a direct host test failed; an initial network-disabled pip install and API build also failed on dependency resolution. Container validation succeeded using available dependency/image cache and normal Docker networking. Host npm was absent, but a clean generated-project `npm ci` and subsequent checks passed inside Node Docker. `npm ci` reported 14 advisories in development dependencies (5 moderate, 7 high, 2 critical); `npm audit --omit=dev` reported zero production advisories. The first Playwright attempt failed because the minimal runner lacked Chromium libraries; after installing those libraries inside an ephemeral container, the suite passed. MySQL runtime tests, Windows generation, and live email/hosting remain unverified. The existing bootstrap workflow must stay available until Captain acceptance. Forge `testtask` remains blocked because Forge has no application runtime.
Limitations: Host Python lacked Flask, so a direct host test failed; an initial network-disabled pip install and API build also failed on dependency resolution. Container validation succeeded using available dependency/image cache and normal Docker networking. Host npm was absent, but a clean generated-project `npm ci` and subsequent checks passed inside Node Docker. `npm ci` reported 14 advisories in development dependencies (5 moderate, 7 high, 2 critical); `npm audit --omit=dev` reported zero production advisories. The first Playwright attempt failed because the minimal runner lacked Chromium libraries; after installing those libraries inside an ephemeral container, the suite passed. The full backend test suite has not been run separately on PostgreSQL, MySQL, or MariaDB; live migration checks passed on each. Windows generation and live email/hosting remain unverified. The existing bootstrap workflow must stay available until Captain acceptance. Forge `testtask` remains blocked because Forge has no application runtime.
Next action: Captain reviews and accepts F006 or requests changes. F005 may use the descriptor and generator after F006 acceptance. F003 and F004 still await their separate external validation and acceptance. No push or deployment has occurred.
+4 -2
View File
@@ -56,11 +56,13 @@ Status: Ready to Finalise (human acceptance pending). Priority: High. Dependenci
Migrate `flask-react-auth-base` into Forge's template architecture. Preserve Flask backend/authentication, React/Vite frontend, Docker configuration, database support, automated tests, and documentation. Remove mandatory GitHub and immediate production-deployment assumptions. Validate generated applications before retiring the existing bootstrap workflow. No additional framework templates yet.
Acceptance: a generated application passes relevant checks and retains the listed capabilities before the existing bootstrap is retired.
Acceptance: a generated application passes relevant checks and retains the listed capabilities before the existing bootstrap is retired. Explicitly support SQLite, PostgreSQL, MySQL, and MariaDB under FORGE-010.
Accepted migration boundary (2026-11-17): preserve email and hosting foundations as optional configuration with neutral project-specific defaults. Generation must work locally without GitHub or production infrastructure and must not publish or deploy. Keep the source `flask-react-auth-base` repository unchanged.
Implementation record (2026-11-17): Copied the tracked source at `ff139bf5f28f4604b4a7108f4ee26608dea9924e` into Forge's independent template package without changing the original repository. Added a descriptor and Python generator, fresh neutral project context, optional GitHub workflow and SWAG overlay, disabled email by default, and removed mandatory external-network and Roborto branding defaults. Generated projects passed 14 backend tests, 16 frontend tests, frontend lint/build, 23 Playwright checks (one intentional skip), SQLite migrations, Compose base/optional-overlay configuration, and API/nginx image builds. Forge's 15 tests and skill validation passed. A fresh generated frontend passed `npm ci`; the install reported 14 advisories in development dependencies, while `npm audit --omit=dev` reported zero production advisories. A clean host Python install, MySQL runtime test, and Windows generation remain unverified in this session; prior source-repository evidence does not substitute for those generated-project checks. Do not retire the existing bootstrap workflow or mark F006 Complete before human acceptance.
Implementation record (2026-11-17): Copied the tracked source at `ff139bf5f28f4604b4a7108f4ee26608dea9924e` into Forge's independent template package without changing the original repository. Added a descriptor and Python generator, fresh neutral project context, optional GitHub workflow and SWAG overlay, disabled email by default, and removed mandatory external-network and Roborto branding defaults. Generated projects passed 14 backend tests, 16 frontend tests, frontend lint/build, 23 Playwright checks (one intentional skip), SQLite migrations, Compose base/optional-overlay configuration, and API/nginx image builds. Forge's 15 tests and skill validation passed. A fresh generated frontend passed `npm ci`; the install reported 14 advisories in development dependencies, while `npm audit --omit=dev` reported zero production advisories. A clean host Python install and Windows generation remain unverified in this session; prior source-repository evidence does not substitute for those generated-project checks.
Database follow-up (2026-11-17): Under FORGE-010, generation now defaults to persistent SQLite in Docker, with separate PostgreSQL, MySQL, and MariaDB Compose overlays and example environment files. The API image includes psycopg and PyMySQL. A fresh generated `Matrix Trial` project passed Compose configuration for the base and all three overlays, API image build, and live Alembic upgrades against each of the four engines in disposable containers. All test containers, networks, and volumes were removed. Forge's 15 tests passed. This validates migration compatibility; the full backend test suite has not been repeated separately on all three server databases. Do not retire the existing bootstrap workflow or mark F006 Complete before human acceptance.
## FORGE-F007 — Implement Business/Personal Profiles
Status: Complete; human acceptance received 2026-11-17. Priority: Medium. Dependencies: FORGE-F002. Implemented directly on `codex` under FORGE-008 in commit `d3a88fd`.