Repository source: docs/plans/php_account_bootstrap_post_auto_creation_slices_v1.md
PHP Account Bootstrap Post Auto-Creation Slices V1
This document describes the implementation slices for replacing the placeholder bootstrap_post_id field with automatic bootstrap-post creation during account setup.
Implementation status:
core implementation now exists in the repo
account creation can auto-create a hidden bootstrap post when no
bootstrap_post_idis suppliedlow-level manual fallback with explicit
bootstrap_post_idstill exists
Goal
When a user creates an account, the system should automatically create a canonical bootstrap post and then link the new identity to that post.
The user should not need to know or choose a bootstrap_post_id.
Current State
The current implementation is technically correct but still bridge-like from a product perspective.
What already works:
the browser can prompt for a username during key generation
that username is embedded into the OpenPGP user ID
the backend derives the username from the submitted public key
identity/profile bootstrap succeeds with that username
What was too technical in the earlier bridge state:
the account flow depended on
bootstrap_post_idthe current page exposed that field directly to the user
the default value was a retained technical placeholder rather than a meaningful user-facing concept
Chosen product decision:
automatically created bootstrap posts should be hidden by default from normal board and activity views
So this plan is not about making username bootstrap possible. That already exists. The implemented direction is to remove the exposed bootstrap-post plumbing from the normal account-creation experience while preserving a low-level manual fallback.
Why This Exists
The earlier bridge version of the account flow exposed a technical field:
bootstrap_post_id
That field worked for the retained technical slice, but it was still a placeholder-style mechanism because it defaulted to a test/demo post such as root-001.
In slice terms, the current state is:
valid
working
intentionally not the final product shape
The long-term improvement is:
create a real bootstrap post at account-creation time
use that new post as the canonical bootstrap anchor
remove the need for the user to supply the bootstrap post manually
Slice 1: Define Bootstrap Post Contract
Focus:
define what an automatically created bootstrap post is
make the canonical rules explicit before changing the write path
Checklist:
document the bootstrap-post shape in the relevant spec/docs
decide the board tags for bootstrap posts
decide whether bootstrap posts live in a dedicated thread or as standalone roots
define the default subject/body shape for the bootstrap post
define how bootstrap posts are marked so they can be hidden by default from normal board/activity views
define what metadata is derived from the bootstrap post vs the identity record
document how this replaces the current manual
bootstrap_post_idrequirement in the normal account flow
Expected outcome:
the repo has a clear documented canonical contract for auto-created bootstrap posts
Slice 2: Server-Side Auto-Creation Flow
Focus:
change account creation so the server creates the bootstrap post automatically
Checklist:
add a write flow that:
creates a canonical bootstrap post
commits it or stages it together with identity creation as appropriate
links the identity to that new bootstrap post
update
src/ForumRewrite/Write/LocalWriteService.phpremove the requirement that the user submits
bootstrap_post_idfor the normal account-creation pathmake the account flow return the created bootstrap post ID in success output
decide whether the low-level
/api/link_identitycontract still acceptsbootstrap_post_idas an advanced/manual fallbackpreserve the existing username bootstrap behavior during this transition
Expected outcome:
account creation no longer depends on a placeholder post ID
every new identity gets a real bootstrap anchor created at creation time
bootstrap posts are created in a way that supports hidden-by-default read filtering
Slice 3: UI and API Contract Cleanup
Focus:
remove placeholder-style UX and align the page/API with the new server behavior
Checklist:
remove or hide the
bootstrap_post_idfield from the normal account page flowrename/clarify user-facing actions if needed
update account page copy so the user is not exposed to bootstrap mechanics
keep any advanced/manual controls only where technically necessary
update client-side JS if the browser flow should call the new account-creation contract directly
ensure the page still presents username bootstrap as the user-facing account creation step, not bootstrap-post management
Expected outcome:
the normal account flow feels intentional instead of test-slice-shaped
technical bootstrap internals no longer appear in the default UI
the default UI does not imply that bootstrap posts are normal user-authored content threads
Slice 4: Read-Model and Rendering Impact
Focus:
ensure the newly created bootstrap posts behave correctly in indexed reads
Checklist:
confirm the read model indexes bootstrap posts correctly
confirm identity/profile pages point to the new bootstrap post and thread
keep bootstrap posts hidden by default from normal board/activity views
add deterministic filtering in the read model and/or rendering path for normal content surfaces
decide whether there is any explicit technical/admin/debug view where bootstrap posts remain inspectable
verify counts and author linkage remain correct
confirm the profile still resolves the correct visible username that was already chosen during key generation
Expected outcome:
bootstrap posts are first-class canonical records
they do not create confusing read-surface regressions
account creation does not pollute normal public content listings
Slice 5: Production Hardening
Focus:
make the auto-bootstrap flow production-safe
Checklist:
ensure git commit handling works for the combined bootstrap-post + identity write flow
ensure read-model rebuild behavior stays deterministic
ensure static artifact invalidation covers any affected routes
ensure stale-marker behavior handles post-commit refresh failures
ensure locking covers the full account-creation flow
add smoke tests for success, git failure, and refresh failure
Expected outcome:
the auto-bootstrap account flow matches the rest of the production write contract
Recommended Order
define the bootstrap post contract
implement server-side auto-creation
clean up UI/API exposure
verify read-model/rendering behavior
harden and test the production flow
Summary
This plan replaces the earlier placeholder-style bootstrap_post_id approach with a real canonical bootstrap-post creation flow.
That makes account creation technically coherent and removes a current bridge artifact from the user-facing flow.
The important product point is:
username bootstrap already works
bootstrap-post selection should stop being a normal user concern