Skip to content

docs(prd): PRD 0007 — batteries-included Profullstack sites for Moshpit names - #264

Merged
ralyodio merged 1 commit into
mainfrom
feat/prd-0007-profullstack
Aug 3, 2026
Merged

docs(prd): PRD 0007 — batteries-included Profullstack sites for Moshpit names#264
ralyodio merged 1 commit into
mainfrom
feat/prd-0007-profullstack

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.

Document only. No implementation code in this PR.

Why

moshcode template install can 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 install copies files only — never executes template code
site init trusted Moshcode source, explicit per-step approval

All 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/client speaks to either a local SQLite file or hosted Turso, so the same data layer works both ways and auto mode 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:

  • the plain Moshpit origin — public, read-only, no sessions or bearer tokens;
  • a separate CA-valid AUTH_ORIGIN — the only origin that issues authenticated sessions.

Enforced server-side, not hidden in the frontend.

Notes for review

  • Filed as 0007. The draft carried id 0005, which is already the hosted-resolver PRD; nextId() confirms 0007.
  • Index regenerated via 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.
  • Rollout is staged in 5 phases; phases 1–4 are explicitly not blocked on the automatic apps.moshcode.sh hostname allocation in phase 5.
  • Release is gated on confirming CoinPay's canonical OAuth endpoint set and ID-token verification method — the docs currently surface different paths on different pages (Risks Validate moshscript max loop count #1).

Verification

  • prd.test.mjs — 14/14 pass
  • prd-index-cell.test.mjs — 14/14 pass
  • listPrds() parses 0007 correctly; nextId() now returns 0008

tui-prd-errors.test.mjs has 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

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>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

vu1nz Security Review

NOT RUNANTHROPIC_API_KEY was not found in the ENV_FILE secret, so no review was performed. This is not a clean result; this diff was not examined.

Add ANTHROPIC_API_KEY=… to the repository's ENV_FILE secret to enable the review.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

87 finding(s)

HIGH/CRITICAL: 50 | MEDIUM: 37

Severity Rule Location
HIGH manifest-typosquat apps/pwa/package.json:19
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH secret-generic-credential apps/pwa/test/apikey-bearer-scheme.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/apikey-mask.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/apikey-reveal.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/approvals-context.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-credits.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-notify.test.mjs:26
HIGH secret-generic-credential apps/pwa/test/approvals-resolve-race.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/auth-page-error.test.mjs:36
HIGH secret-generic-credential apps/pwa/test/cli-device-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/cli-pages-balance.test.mjs:32
HIGH secret-generic-credential apps/pwa/test/cli-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/credits-pack.test.mjs:51
HIGH secret-generic-credential apps/pwa/test/credits-webhook-event-match.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/credits-webhook.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:101
HIGH secret-generic-credential apps/pwa/test/logout-csrf.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-api-key.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-bulk-claim.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-claim-full-name.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-crawlable.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-ending-page.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-pins.test.mjs:22
HIGH secret-generic-credential apps/pwa/test/moshpit-pit-page.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/moshpit-records-page.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-records.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-registry.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/moshpit-related-endings.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-sales.test.mjs:16
HIGH secret-generic-credential apps/pwa/test/moshpit-search.test.mjs:74
HIGH secret-generic-credential apps/pwa/test/moshpit-terms.test.mjs:19
HIGH secret-generic-credential apps/pwa/test/moshpit-tlds-pagination.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/passkey-register-duplicate.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/sessions-output-seq.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/sessions-paste.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/sessions-stream-replay.test.mjs:34
HIGH secret-generic-credential apps/pwa/test/sessions.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/signature.test.mjs:6
HIGH secret-generic-credential test/auth.test.mjs:13
HIGH secret-generic-credential test/auth.test.mjs:63
HIGH secret-generic-credential test/console-cookie-malformed.test.mjs:15
HIGH secret-generic-credential test/console.test.mjs:12
HIGH secret-generic-credential test/mirror.test.mjs:37
HIGH secret-generic-credential test/mirror.test.mjs:77

…and 37 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio marked this pull request as ready for review August 3, 2026 13:56
@ralyodio
ralyodio merged commit a3beaa1 into main Aug 3, 2026
5 checks passed
@ralyodio
ralyodio deleted the feat/prd-0007-profullstack branch August 3, 2026 13:57
@ralyodio ralyodio mentioned this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant