Repository source: docs/plans/php_reply_implementation_three_slice_outline_v1.md
PHP Reply Implementation Three-Slice Outline V1
This document outlines a clean three-slice plan for implementing replies in the PHP forum rewrite.
Goal
Implement replies in a way that progresses from canonical correctness to user-facing reads to production-safe behavior.
Slice 1: Canonical + Write
Focus:
define the reply record shape
validate replies correctly
add the basic write path
Checklist:
define reply semantics in
docs/specs/canonical_post_record_v1.mdrequire
Post-ID,Board-Tags,Thread-ID, andParent-IDfor repliesensure replies do not carry root-only metadata
update
src/ForumRewrite/Canonical/PostRecordParser.phpadd reply creation to
src/ForumRewrite/Write/LocalWriteService.phpvalidate that
parent_idbelongs to the target threadadd
POST /api/create_replyhandling insrc/ForumRewrite/Application.phpadd parser and write smoke coverage
Expected outcome:
the app can accept a valid reply write request
canonical reply files are written correctly
invalid thread/parent combinations are rejected
Slice 2: Read + Render
Focus:
make replies visible in the read model and UI
Checklist:
index replies into the
postsread model insrc/ForumRewrite/ReadModel/ReadModelBuilder.phpensure thread pages load root post plus replies in stable order
ensure post permalink reads work for replies
add compose reply route and form in
src/ForumRewrite/Application.phprender replies on thread pages
add local app smoke coverage for reply reads and compose reply UI
Expected outcome:
reply content appears on thread pages
reply permalinks resolve
users can access a reply form and submit a reply through the PHP UI
Slice 3: Production Hardening
Focus:
make reply writes production-safe and operationally correct
Checklist:
commit reply writes to git in the canonical repository
refresh the read model immediately after successful reply writes
invalidate affected thread/post/public HTML artifacts
include author identity linkage if browser identity flow exists
ensure stale-marker behavior works if post-commit refresh fails
ensure locking covers reply writes and rebuild interactions
add write smoke tests for success, git failure, and refresh-failure cases
Expected outcome:
reply writes are immediately visible
failure modes are deterministic
concurrent write/rebuild behavior remains coherent
the reply flow fits the same production contract as thread creation
Summary
This three-slice approach separates:
canonical/write correctness
read/render visibility
production-safe orchestration
That keeps the work reviewable while still reaching a deployment-ready reply implementation.