docs(prd): PRD 0007 — batteries-included Profullstack sites for Moshpit names - #264
Merged
Conversation
Files the OpenPRD proposal for `moshcode site init <name>`: a trusted, in-source initializer that turns a claimed Moshpit name into a working full-stack application, alongside a new bundled `profullstack` template. The design keeps the existing security boundary intact — `template install` stays copy-only and never executes template code, while all provisioning (Turso, CoinPay, systemd, web server) lives in trusted Moshcode source behind explicit approval. Generated stack: Bun + SolidStart with one set of TSX routes reused for SSR and hydrated SPA navigation, `@libsql/client` against local SQLite or hosted Turso, a versioned `/api/v1`, CoinPay OAuth/OIDC with PKCE, hashed sessions and scoped API tokens, a blog with RSS, and a default-on queue/release auto-blog that makes no paid AI calls. Because Moshpit names sit outside the public DNS root and the gateway strips cookies and `Authorization`, the app serves two logical origins: the plain Moshpit origin is public and read-only, and a separate CA-valid `AUTH_ORIGIN` is the only one that issues sessions. Filed as 0007 (the pasted draft carried 0005, already taken by the hosted resolver PRD). Index regenerated with `regenerateIndex()`, which also picked up existing drift: 0005 and 0006 were missing from the table and 0004 had since moved to Accepted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security ReviewNOT RUN — Add |
ThreatCrush Security Scan87 finding(s) HIGH/CRITICAL: 50 | MEDIUM: 37
…and 37 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Files the OpenPRD proposal for
moshcode site init <name>— a trusted, in-source initializer that turns a claimed Moshpit name into a working full-stack application, alongside a new bundledprofullstacktemplate.Document only. No implementation code in this PR.
Why
moshcode template installcan copy a hosting template, but a copied template isn't an application. A developer still has to wire a framework, SSR, routing, an API, a database, auth, migrations, a blog, RSS, scheduling, deploy units, and secrets by hand.The security boundary stays put
template installsite initAll provisioning (Turso, CoinPay, systemd, web server) lives in trusted source behind explicit approval — never in a
postinstall, shell hook, or executable manifest.Generated stack
Bun + SolidStart, with one set of TSX routes reused for SSR and hydrated SPA navigation — no duplicate client/server component trees.
@libsql/clientspeaks to either a local SQLite file or hosted Turso, so the same data layer works both ways andautomode falls back to local SQLite whenever Turso is unavailable. Plus a versioned/api/v1, CoinPay OAuth/OIDC with S256 PKCE, hashed sessions, scoped API tokens, a blog with RSS, and a default-on queue/release auto-blog that makes no paid AI calls.The two-origin constraint
Moshpit names sit outside the public DNS root, and the public gateway strips cookies and
Authorization. So the app serves two logical origins from one process:AUTH_ORIGIN— the only origin that issues authenticated sessions.Enforced server-side, not hidden in the frontend.
Notes for review
0005, which is already the hosted-resolver PRD;nextId()confirms 0007.regenerateIndex()rather than hand-editing. It also picked up pre-existing drift: 0005 and 0006 were missing from the table entirely, and 0004 had since moved to Accepted.apps.moshcode.shhostname allocation in phase 5.Verification
prd.test.mjs— 14/14 passprd-index-cell.test.mjs— 14/14 passlistPrds()parses 0007 correctly;nextId()now returns 0008tui-prd-errors.test.mjshas one test that hangs on a pending promise, but it does so identically with these changes stashed — pre-existing and unrelated.🤖 Generated with Claude Code