docs(examples): add the CMS proof-of-concept dogfooding artifact
Some checks failed
CI / Rust — fmt, clippy, test (push) Failing after 39m53s
CI / Dashboard — check (push) Successful in 10m15s

A WordPress-inspired CMS whose entire backend is PiCloud Rhai scripts
deployed with pic apply, plus a SvelteKit frontend. Built to dogfood the
project tool, CLI, and SDK; exercises docs/kv/files/users, docs+queue+cron
+pubsub triggers, the transactional-outbox notification chain, a docs
before-interceptor, set_if CAS, SSE, per-app CORS, env overlays, and a
durable Workflow (validate -> enrich || seo -> publish -> finalize) started
with workflow::start and polled with workflow::run_status, visualized live
with Svelte Flow.

FINDINGS.md / SECURITY.md capture every gap, surprise, and security issue
found (each tagged [PiCloud] vs [CMS]); the platform fixes for the
actionable ones ship in the preceding commit.

Also folds in the read-only `pic` allowlist entries added to
.claude/settings.json during the session (fewer-permission-prompts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-07-19 20:15:29 +02:00
parent 5682be366c
commit 813bc46640
68 changed files with 4623 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
// posts_scheduled_publish — cron TRIGGER (every minute). Flips due `scheduled`
// posts to `published`, which itself fires posts_on_publish -> notifications
// (a bounded trigger-fires-trigger chain).
let posts = docs::collection("posts");
let now = time::now();
let due = posts.find(#{
status: "scheduled",
publish_at: #{ "$lte": now },
"$limit": 100,
});
let n = 0;
for r in due {
let cur = r.data;
cur.status = "published";
posts.update(r.id, cur);
n += 1;
}
if n > 0 { log::info("cron published scheduled posts", #{ count: n }); }