docs: record development CMS audit and seed

This commit is contained in:
2026-09-27 13:07:58 +03:30
parent 9954fbcc0d
commit 6f7a30bc0d
2 changed files with 40 additions and 5 deletions

View File

@@ -0,0 +1,35 @@
# Bundle 1 — development database audit
Audited 2026-09-27 against the configured local PostgreSQL development database, `guilan_ace_local` (`127.0.0.1:5432`). This is the development database the owner authorized in place of staging. No staging or production database was accessed.
## Migration and data state
All content migrations are applied: `0001_initial`, `0002_alter_siteidentity_options`, `0003_content_groups`, `0004_direct_edit_content`, and `0005_seed_current_website_copy`.
Before running the mock-content command, the current editable tables contained one site record, one Home record, one About record, two listing records, and nine About items. There were no image references or missing media files. Django admin change history contained two changes for Home and none for Site, About, Events, or Blog.
The legacy revision tables were empty: zero SiteIdentity, SiteRevision, EditorialPage, PageRevision, PageSection, MediaAsset, or PublicationAudit rows. Their model definitions, database tables, and historical permission records remain from the applied migration history; no migration or table cleanup was performed.
## Permission state
The database has one staff account, which is also the only superuser. The `content_editor` and `content_publisher` groups each have zero members. No user has a direct content-model permission assignment. The two legacy groups contain standard content-model change permissions plus old workflow permission records; they grant access to no account in this database.
This is an environment-specific snapshot. Staff account assignments in staging or production remain part of the release audit.
## Mock-content command
The owner approved mock copy and empty optional images for initial content. The command was first reviewed with:
```sh
python manage.py seed_mock_content --dry-run --database default
```
The dry run proposed replacing Site, About, Events, and Blog, and skipped Home because it has Django admin change history. The command was then run against the same development database:
```sh
python manage.py seed_mock_content --database default
```
It updated those four records, preserved Home, and replaced the untouched About items with six mock items. A read-only follow-up query confirmed the expected mock records, both listing titles and SEO titles, six About items, no image references, and the preserved Home row with its two admin changes. The command did not modify any migration.
The owner has reviewed and approved the mock content and the development database result. Production initialization remains subject to the release gate.

View File

@@ -21,15 +21,15 @@ Checkpoint C was approved by the owner on 2026-09-27 after reviewing [the schema
- [x] **T06 — Add site identity and page schema (M; deps: T05).** Files: B new content app models/migration/tests. Acceptance: one site identity, stable page slugs, ordered typed sections, image/alt and SEO fields exist with uniqueness/validation; migrations are additive. Verify: migration test and `python manage.py check` on a test database. - [x] **T06 — Add site identity and page schema (M; deps: T05).** Files: B new content app models/migration/tests. Acceptance: one site identity, stable page slugs, ordered typed sections, image/alt and SEO fields exist with uniqueness/validation; migrations are additive. Verify: migration test and `python manage.py check` on a test database.
- [x] **T07 — Validate fields and media handling (M; deps: T06).** Files: B content validators/tests. Acceptance: URLs, section payloads, image type/size, alt text, and unsafe markup are constrained; absent optional media renders safely. Verify: invalid/oversize/malicious inputs rejected in focused tests. - [x] **T07 — Validate fields and media handling (M; deps: T06).** Files: B content validators/tests. Acceptance: URLs, section payloads, image type/size, alt text, and unsafe markup are constrained; absent optional media renders safely. Verify: invalid/oversize/malicious inputs rejected in focused tests.
- [x] **Checkpoint C (deps: T06–T07).** Schema and validation reviewed before permissions/API work. Approved by the owner on 2026-09-27. - [x] **Checkpoint C (deps: T06–T07).** Schema and validation reviewed before permissions/API work. Approved by the owner on 2026-09-27.
- [ ] **T08 — Audit current CMS data and permissions (S; deps: T06–T07).** Files: B migration/data audit, D environment record. Repository review found migrations `0001`–`0005`; `0004` carries prior content-editor access to standard model change permissions. Deployment files describe PostgreSQL and Django media volumes but do not record applied migrations, existing content/media rows, or actual group/user assignments for target environments. The environment-specific audit and database-copy check remain open; no deployment database was accessed. Complete this before applying the migrations to a target environment. - [x] **T08 — Audit current CMS data and permissions (S; deps: T06–T07).** Completed against the owner-authorized local development PostgreSQL database on 2026-09-27; see [database audit](bundle1-development-db-audit.md). Content migrations `0001`–`0005` are applied; the five current page/site records exist, with no media references. Home has two admin changes; the other content records do not. One staff account exists and is the only superuser; the legacy editor/publisher groups have no members and no users have direct content permissions. The old revision tables contain no rows. Staging was not needed or accessed; production permissions remain a release-gate audit.
- [x] **T09 — Simplify content schema and use native Unfold forms (M; deps: T08).** Files: B content models/migrations/admin/forms/tests. Acceptance: one editable record per fixed page and shared site identity; explicit text/image/alt/SEO fields; direct Save; standard Django model change permissions; no arbitrary page creation, custom admin templates, draft/revision/approval workflow, or delete action. Verified: backend suite passed 248 tests; Django and migration checks passed; owner reviewed and approved the Unfold admin on 2026-09-27. Implementation is approved; the unresolved T08 audit remains a deployment gate. - [x] **T09 — Simplify content schema and use native Unfold forms (M; deps: T08).** Files: B content models/migrations/admin/forms/tests. Acceptance: one editable record per fixed page and shared site identity; explicit text/image/alt/SEO fields; direct Save; standard Django model change permissions; no arbitrary page creation, custom admin templates, draft/revision/approval workflow, or delete action. Verified: backend suite passed 248 tests; Django and migration checks passed; owner reviewed and approved the Unfold admin on 2026-09-27. The development database audit is complete; production access remains a release gate.
- [x] **Checkpoint D (deps: T09).** Owner approved the direct-save Unfold forms and permissions on 2026-09-27. The old draft/publish review is superseded. - [x] **Checkpoint D (deps: T09).** Owner approved the direct-save Unfold forms and permissions on 2026-09-27. The old draft/publish review is superseded.
- [x] **T10 — Expose current-content read API (M; deps: T09).** Files: B content Ninja router/schemas/tests, `config/api.py`; contract: backend [content API v1 note](../../guilan-ace-backend/docs/content-api-v1.md). Acceptance: shared site record and four fixed pages expose current content and SEO, with explicit missing/unknown behavior and no revision/status/preview fields. Verified: anonymous read, save-then-read, missing content, and cache behavior; backend suite passed 255 tests and Django checks passed. Owner approved the API checkpoint on 2026-09-27. - [x] **T10 — Expose current-content read API (M; deps: T09).** Files: B content Ninja router/schemas/tests, `config/api.py`; contract: backend [content API v1 note](../../guilan-ace-backend/docs/content-api-v1.md). Acceptance: shared site record and four fixed pages expose current content and SEO, with explicit missing/unknown behavior and no revision/status/preview fields. Verified: anonymous read, save-then-read, missing content, and cache behavior; backend suite passed 255 tests and Django checks passed. Owner approved the API checkpoint on 2026-09-27.
- [x] **Checkpoint E (deps: T10).** The current-content API shape was checked and approved by the owner on 2026-09-27. No private preview API is planned. - [x] **Checkpoint E (deps: T10).** The current-content API shape was checked and approved by the owner on 2026-09-27. No private preview API is planned.
- [x] **T12 — Review starting content and media (M; deps: T01, T09).** Files: D source review, B initial content data. Owner reviewed the source content and approved blank CMS image fields, then directed that mock copy be used until staff save content. No current-site claims or media are in the mock content. - [x] **T12 — Review starting content and media (M; deps: T01, T09).** Files: D source review, B initial content data. Owner reviewed the source content and approved blank CMS image fields, then directed that mock copy be used until staff save content. No current-site claims or media are in the mock content.
- [ ] **T13 — Initialize fixed content records safely (S; deps: T12).** Files: B management command/tests; do not change existing migrations. Implemented as `python manage.py seed_mock_content`, with `--dry-run` and `--database` options. It replaces current migration copy only for records without a Django admin change entry, preserves admin-edited records, and supplies mock About items. Three focused command tests passed. The command has not been run against an environment database; T08 audit and dry-run review are required first. - [x] **T13 — Initialize fixed content records safely (S; deps: T12).** Files: B management command/tests; do not change existing migrations. Implemented as `python manage.py seed_mock_content`, with `--dry-run` and `--database` options. Three focused command tests passed. On the owner-authorized development database, the dry run proposed four untouched records and skipped Home because of two admin changes; execution updated Site, About, Events, and Blog, preserved Home, and created six mock About items. See [database audit](bundle1-development-db-audit.md). No migration was changed.
- [ ] **Checkpoint F (deps: T12–T13).** Starting public content and images are reviewed before frontend cutover. - [x] **Checkpoint F (deps: T12–T13).** Owner reviewed and approved the mock starting content and blank optional image fields; the development database seed result is recorded in [database audit](bundle1-development-db-audit.md).
- [ ] **T14 — Add frontend CMS adapter and cutover flag (M; deps: T10).** Files: F `src/lib/content-cms.ts`, `.env.sample`. Acceptance: current content can be fetched server-side with typed mock fallback; blank CMS fields and request failures use mock copy; the flag defaults off; `no-store` fetches expose the latest admin save. The adapter returns mock values rather than caller-provided legacy copy; page rendering is still legacy until later tasks connect it. - [x] **T14 — Add frontend CMS adapter and cutover flag (M; deps: T10).** Files: F `src/lib/content-cms.ts`, `.env.sample`. Acceptance: current content can be fetched server-side with typed mock fallback; blank CMS fields and request failures use mock copy; the flag defaults off; `no-store` fetches expose the latest admin save. The adapter returns mock values rather than caller-provided legacy copy. Frontend lint and production build passed; pages remain on legacy rendering until later tasks connect them.
## 2. Home/About and shared public shell (9–12 person-days) ## 2. Home/About and shared public shell (9–12 person-days)