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

@@ -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] **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.
- [ ] **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] **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] **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. 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] **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] **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.
- [ ] **Checkpoint F (deps: T12–T13).** Starting public content and images are reviewed before frontend cutover.
- [ ] **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] **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.
- [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).
- [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)