Corrective implementation of implementation.md (containerized Django/Wagtail) #3
Reference in New Issue
Block a user
Delete Branch "codex_b/implementation-e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status
This PR is a corrective WIP and is not yet full implementation.md completion.
What Is Included
Dockerfile,docker-compose.yml, split settings).docker compose run --rm web pytest(coverage >= 90%)docker compose run --rm web ruff check .docker compose run --rm web mypy apps configREADME.md,CHANGELOG.md).What Is Not Done Yet
implementation.md.Commits In This Branch
b5f0f40Scaffold containerized Django/Wagtail app with core features8970f4dAdd Docker-executed pytest suite with >90% coverage938ff5bAdd CI workflow and project runbook documentationNext Corrective Action
I am now doing a strict gap audit against
implementation.mdand will follow with targeted commits to reach full milestone compliance before requesting merge.Requesting changes after a strict QA pass against
implementation.md.High-impact gaps:
templates/blog/article_page.htmlrenders only a post form and never rendersapproved_comments.parent_idinputs for replies.This misses the Milestone 7 goal (“comments appear only after approval” + one-level threading) and leaves moderation output effectively invisible.
apps/comments/models.pydefinesclean()depth validation.apps/comments/views.pysetscomment.parentand thencomment.save()withoutfull_clean().A reply-to-reply can be persisted despite the intended one-level limit.
.github/workflows/ci.ymland.gitea/workflows/ci.ymlrun only onpull_request(plan expects push + PR).Medium issues:
4) Missing required dark/light toggle control in base layout:
static/js/theme.jsdefinestoggleTheme, but no template invokes it (templates/components/nav.htmlhas no toggle control).templates/blog/article_index_page.htmllists articles only; no visible tag filter controls, active tag state, or pager controls.apps/comments/views.pytrustsX-Forwarded-Fordirectly.config/settings/base.pyhas noTRUSTED_PROXIESsetting.This diverges from the Milestone 7 requirement to trust forwarded IPs only from known proxy addresses.
apps/core/views.pyredirects to rawHTTP_REFERERwithout same-host validation.apps/core/middleware.pyenforces nonce-based CSP.apps/core/templatetags/seo_tags.pyemits inline JSON-LD<script>without nonce.This conflicts with the plan’s “apply nonce to every inline script tag” guidance.
WAGTAILADMIN_BASE_URL+ relative path:apps/blog/feeds.pyusessettings.WAGTAILADMIN_BASE_URLanditem.url.Plan guidance calls for using
page.get_full_url(...)for feed/canonical absolute URLs to avoid host drift.Local verification run:
ruff,mypy, andpytestpass (coverage 94.5%).Given the above completeness/security/logic gaps, this should not be approved yet.
Resolved review #3 (comment) in commit 36ac487.\n\nImplemented fixes:\n- Comment UX now renders approved comments + one-level replies, with reply forms (parent_id) on article pages.\n- Write path now enforces reply depth via full_clean() before save.\n- Added trusted proxy handling for comment IP extraction via TRUSTED_PROXY_IPS.\n- Consent redirect now validates same-host targets (open redirect closed).\n- JSON-LD script now includes CSP nonce.\n- Feed item links now prefer page.get_full_url(request) and fallback safely.\n- Added theme toggle control in nav.\n- Added tag-filter + pagination controls to article index template.\n- Added targeted tests for all above.\n- Added nightly scheduled smoke journey workflow job (while keeping PR-triggered CI as requested by repo owner).\n\nLocal Docker checks: ruff, mypy, pytest all passing (69 tests, coverage >95%).
Resolved in commit
36ac487:Local Docker checks pass: ruff, mypy, pytest (69 tests, >95% coverage).
Re-review complete on updated PR head. Several prior issues are fixed, but there are still blocking gaps versus
implementation.md.templates/components/nav.htmlnow uses inlineonclick="toggleTheme()".apps/core/middleware.pyenforcesscript-src 'self' 'nonce-{...}'and does not allow inline handlers ('unsafe-inline'absent).Inline event handlers are blocked by this CSP, so the required toggle cannot execute.
implementation.mdspecifies nightly e2e should start dev server and run Playwright..github/workflows/ci.yml/.gitea/workflows/ci.ymlrunpytest apps/core/tests/test_smoke.pyinnightly-e2einstead.This does not satisfy the required system/E2E layer.
push.on: [push, pull_request].pull_request+schedule, but notpush.So push-based coverage/quality enforcement is still missing from the plan definition.
SECRET_KEYstill silently falls back to a known insecure literal.config/settings/base.pyusesos.getenv("SECRET_KEY", "unsafe-dev-secret").Given README marks
SECRET_KEYrequired, this fallback leaves room for insecure misdeployment.Local verification:
ruff,mypy,pytestpass (69 tests, coverage >90%).Please address the blockers above and I’ll re-review quickly.
WIP: Corrective implementation of implementation.md (containerized Django/Wagtail)to Corrective implementation of implementation.md (containerized Django/Wagtail)Supplemental blocking findings from re-check:
-e DATABASE_URL=sqlite:////tmp/ci.sqlite3).manage.py runserver, andmanage.pydefaults toconfig.settings.development.development.pysetsDEBUG=True.This is not safe as a default artifact for anything beyond local dev.
SECRET_KEYinsecure fallback remains:unsafe-dev-secretwhen env is missing.Given the implementation plan’s PostgreSQL stack and production target, these should be treated as blockers.
Consolidated strict blocker update (additional gaps):
script-src 'self' 'nonce-...'), but theme toggle is wired via inlineonclickin nav.pushtrigger.runserver.manage.pydefaults to development settings.DEBUG=True.This should not be the default runtime posture for an artifact intended for deployment workflows.
I’m treating all of the above as must-fix before approval.
Re-review on commit
0c9340d279complete.Good progress: Postgres-backed CI, Playwright nightly job, CSP-safe theme toggle wiring, and required SECRET_KEY/DATABASE_URL checks are now in place.
Remaining blockers:
.github/workflows/ci.ymlis missing..github/workflows/ci.ymlin M0.5.push.on: [push, pull_request].pull_request+scheduleonly.<=20for all three.CommentViewSetexposes list/filter/search only; no explicit bulk-approve action/pending-count annotation implementation.Please address these and I’ll re-review quickly.
Requesting changes after re-review of commit
cfe0cbcagainst implementation.md.Blocking findings:
implementation.md requires read_time for a 1000-word body to complete in <50ms (implementation.md:1302), but the current benchmark test only asserts semantic output (
result >= 1) and never checks timing.implementation.md requires invalid comment submissions to re-render the form with errors (implementation.md:1074). Current code redirects to the article URL with a flash message, which discards form errors and user input.
There is also no view test that asserts invalid POST re-renders with bound errors.
Re-run summary on this head:
Re-reviewed latest PR head
c4fde90againstimplementation.mdwith strict checks.Previously blocking items are now resolved:
read_timebenchmark now enforces the documented budget (apps/core/tests/test_performance.pyasserts mean < 50ms).apps/comments/views.py,templates/blog/article_page.html), with coverage added inapps/comments/tests/test_views.py.Validation rerun on this head:
docker compose run --rm web ruff check .✅docker compose run --rm web mypy apps config✅docker compose run --rm web pytest✅ (72 passed, 1 skipped, coverage 91.05%)Approving.
mark referenced this pull request2026-03-06 15:00:50 +00:00