Files
summercms/.planning/phases/15-journal-plugin/15-VALIDATION.md
Jakub Zych 7307b36baa test(15-04): add fail-closed Phase 15 gate and ASVS L1 review
scripts/check-phase15.sh --all refuses skip/no-tests/race/dirty PHP pin; the review closes T-15-01..15 and T-15-SC with executed TestNames.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-06 19:22:19 +02:00

94 lines
6.5 KiB
Markdown

---
phase: "15"
slug: "journal-plugin"
status: validated
nyquist_compliant: true
wave_0_complete: true
created: "2026-10-06"
validated: "2026-10-06"
---
# Phase 15 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | Go `testing` + testcontainers-go v0.44.0 (Postgres) |
| **Config file** | none — `go test ./...` |
| **Quick run command** | `go test ./... -short -count=1` in `sm-journal-plugin` + host `go test ./... -short -count=1` |
| **Full suite command** | `go test ./... -count=1` in `sm-journal-plugin` and `sm-grzybyfunkcjonalne-app`; `bash scripts/check-phase15.sh --all` |
| **Estimated runtime** | ~60 seconds (short); ~2 minutes with Postgres + race on last plan |
---
## Sampling Rate
- **After every task commit:** Run `go test ./... -short -count=1` in the repo that changed
- **After every plan wave:** Run `go vet ./...` and `go test ./... -count=1` in that repo
- **Before `$gsd-verify-work`:** Plugin + host suites must be green
- **Max feedback latency:** 60 seconds (short)
---
## Per-Task Verification Map
| Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
| 15-W0-01 | 01 | 0 | D-01 | T-15-05 | Tables `golem15_journal_posts\|categories\|tags` after migrate | integration | `go test ./updates -run TestJournalTables -count=1` | ✅ `updates/postgres_test.go` | ✅ green |
| 15-W0-02 | 02 | 0 | D-10 | T-15-06 | Post Translatable list + MorphName PHP string | unit | `go test ./models -run TestTranslatable -count=1` | ✅ `models/translatable_test.go` | ✅ green |
| 15-W0-03 | 02 | 0 | D-11 | — | `type: mlmarkdown` compiles on posts form | unit | `go test ./... -run TestPostsFormCompiles -count=1` | ✅ `posts_admin_smoke_test.go` | ✅ green |
| 15-W0-04 | 03 | 0 | D-12 | T-15-11 | Gate off → zero search HTTP on Post save | unit | `go test ./... -run TestSearchGateOff -count=1` | ✅ `search_test.go` | ✅ green |
| 15-W0-05 | 02 | 0 | D-13 | — | Commands registered `journal:export-posts` / `journal:import-posts` | unit | `go test ./... -run TestJournalCommands -count=1` | ✅ `plugin_test.go` | ✅ green |
| 15-W0-06 | 03 | 0 | D-14 | — | GET `/_journal/api/v1/posts` anonymous 200 | integration | `go test ./... -run TestJournalPublicList -count=1` | ✅ `journal_public_list_smoke_test.go` | ✅ green |
| 15-W0-07 | 03 | 0 | D-15 | T-15-01 | POST posts without Bearer 401 `Authentication required` | integration | `go test ./... -run TestJournalWriteUnauthenticated -count=1` | ✅ `journal_api_writes_test.go` | ✅ green |
| 15-W0-08 | 03 | 0 | D-17 | T-15-12 | Buckets named `journal-public-api` and `journal-api` Max 120 | unit | `go test ./... -run TestJournalBuckets -count=1` | ✅ `plugin_test.go` | ✅ green |
| 15-W0-09 | 01 | 0 | D-17 | — | Host CORS includes `_journal/api/*` | unit | host `go test ./... -run TestCORS -count=1` | ✅ host `boot_test.go` | ✅ green |
| 15-W0-10 | 01 | 0 | D-19 | — | Host Activate 3 plugins including `golem15.journal` | smoke | host `go test ./... -run TestBootUserTranslateJournal -count=1` | ✅ host `boot_test.go` | ✅ green |
| 15-W0-11 | 04 | 0 | JOURNAL-005 | T-15-02 | Draft show 404 to stranger | integration | `go test ./... -run TestJournal005DraftShow -count=1` | ✅ `journal_api_writes_test.go` | ✅ green |
| 15-W0-12 | 04 | 0 | JOURNAL-006 | T-15-03 | Media upload 403 without `access_posts`; path prefix | integration | `go test ./... -run TestJournal006MediaUpload -count=1` | ✅ `journal_api_task3_test.go` | ✅ green |
| 15-W0-13 | 04 | 0 | JOURNAL-001/002 | T-15-04 | Tag/Category fillable | unit | `go test ./models -run TestFillable -count=1` | ✅ `models/fillable_test.go` | ✅ green |
| 15-W0-14 | 04 | 0 | D-14 | — | GET categories/tags `{data}` lists; RSS 2.0 | integration | `go test ./... -run 'TestJournalPublicCategories|TestJournalPublicTags|TestJournalRSS' -count=1` | ✅ `journal_api_writes_test.go`, `journal_api_task3_test.go` | ✅ green |
| 15-W0-15 | 04 | 0 | D-15 | T-15-01 | Featured-image POST/DELETE 401 | integration | `go test ./... -run TestJournalFeaturedImageUnauthenticated -count=1` | ✅ `journal_api_writes_test.go` | ✅ green |
| 15-W0-16 | 04 | 0 | JOURNAL-003/004 | T-15-08 | FormatHTML rejects unsafe tags | unit | `go test ./classes -run TestFormatHTMLRejectsUnsafeHTML -count=1` | ✅ `classes/format_html_test.go` | ✅ green |
| 15-W0-17 | 04 | 0 | D-04 | T-15-05 | Migrate, rollback, remigrate | integration | `go test ./updates -run TestJournalMigrationsRollbackAndRemigrate -count=1` | ✅ `updates/migrations_test.go` | ✅ green |
| 15-W0-18 | 04 | 0 | D-07/D-16 | T-15-14 | Phase gate fail-closed | other | `bash scripts/check-phase15.sh --all` | ✅ `scripts/check-phase15.sh` | ✅ green |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
---
## Wave 0 Requirements
- [x] `sm-journal-plugin` module and all test files listed above
- [x] Host boot_test updated for three plugins + CORS
- [x] Plugin Postgres harness (copy translate/user TestMain / testcontainers)
- [x] No new test framework install
- [x] PHPUnit XSS template tests deferred to Phase 16; FormatHTML unsafe-tag tests substitute this phase
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions | Status |
|----------|-------------|------------|-------------------|--------|
| Gitea remotes exist | D-18, D-22 | Requires network + credentials already used | Confirm `git ls-remote git@git.golem15.com:golem15/sm-journal-plugin.git` and the proof-host remote | ⬜ end-of-phase |
| Posts/Categories/Tags admin in the proof-host SPA | D-19, SC-1 | Needs running host + admin login | Boot `sm-grzybyfunkcjonalne-app`; sign in as an administrator holding `golem15.journal.*`; open Journal nav; list/create/edit a post with `mlmarkdown` | ⬜ end-of-phase UAT |
---
## Validation Sign-Off
- [x] All tasks have `<automated>` verify or Wave 0 dependencies
- [x] Sampling continuity: no 3 consecutive tasks without automated verify
- [x] Wave 0 covers all MISSING references
- [x] No watch-mode flags
- [x] Feedback latency < 60s (short)
- [x] `nyquist_compliant: true` set in frontmatter
**Approval:** validated 2026-10-06 (executor 15-04). Human UAT for Journal SPA remains end-of-phase. Gate `--all` is the last automated row and must print `Phase 15 gate passed`.