Commit Graph

38 Commits

Author SHA1 Message Date
shitratgit[bot] 4e7d6ec353 fix(web): remove undeployable local dependencies 2026-07-29 22:24:12 -07:00
Joel Hooks 42d5c4a61f feat(convex): custody transferred to joelclaw-api — apps/web is now a client
convex/ (schema, functions, deploy role for :3210) moved to
joelclaw-api; apps/web consumes generated api/types via link:.
sessions schema is a deliberate temporary v.union (auth + call
telemetry shapes) — separation chartered. All four readback checks
pass: deploy clean, tsc clean, no old-path refs, live read works.
Worker-authored, steering-verified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 09:25:54 -07:00
Joel Hooks cafdf2b45e feat(memory): Phase 3 — PDS App Password auth (code-complete; verify pending infra)
Replaces the dev-bearer table with PDS-backed App Password authentication
per ADR-0243 Rule 20, scoped to single-user (Joel only) for now.

packages/system-bus/src/lib/pds.ts
  + pdsCreateAppPassword — calls com.atproto.server.createAppPassword on
    the caller's session; returns { name, password, did, handle }
  + pdsRevokeAppPassword — revokes by name
  + pdsValidateAppPassword — one-shot validation via createSession; used
    at register time only, NOT per-request (hash lookup is cheaper +
    safer, and doesn't create server-side session state at PDS)

packages/memory/src/schemas/machines.ts — NEW Typesense schema for
  machines_dev collection: id, user_id, did, handle, machine_name,
  app_password_name, app_password_sha256, created_at, last_seen_at,
  revoked_at

apps/web/lib/memory-auth.ts — NEW auth middleware
  authenticateMemoryRequest(req) → MemoryIdentity | null
  Hot path: sha256(bearer) → Typesense machines_dev lookup →
    { user_id, machine_id, did, source: "app-password" }
  No PDS roundtrip per request. App Password validity is established
  at register time; the hash is the identity key thereafter.
  Dev-bearer fallback retained during transition (MEMORY_DEV_BEARER_TOKENS
  env var); effectively disappears when that var is empty in prod.
  Phase 3.5 TODO: users_dev collection (DID→user_id map is hardcoded for
  now).

apps/web/app/api/runs/*/route.ts — all 6 handlers now call
  authenticateMemoryRequest instead of the inline DEV_BEARER_TOKENS
  table + local authenticate() helper. Rule 4 privacy filtering is
  unchanged (still keyed on auth.user_id from the middleware).

scripts/joelclaw-machine-register.ts — NEW provisioning CLI
  Flow: load cached PDS session from ~/.joelclaw/pds-session.json →
  call com.atproto.server.createAppPassword → sha256(plaintext) →
  upsert machines_dev row → back up old auth.json → write new
  auth.json (0600) with the plaintext bearer. Ready to register Panda
  once the infra is back.

Verification status (pending Typesense reachability):
  [x] pds.ts compiles; curl-tested createAppPassword directly against
      PDS (returned valid password)
  [x] Bun fetch works against PDS directly (ruled out fetch-lib bugs)
  [x] All route handlers typecheck + biome clean
  [x] Auth middleware compiles
  [ ] End-to-end: register panda → POST /api/runs with new bearer →
      Run indexes → search returns it — BLOCKED on Colima SSH tunnel
      which is flapping (ssh 192.168.64.2:22 timing out; matches the
      2026-04-17 healer-suicide-loop memory note)

When infra comes back:
  TYPESENSE_API_KEY=<...> joelclaw-machine-register --name panda --user joel
  then POST /api/runs with the new bearer to confirm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 20:12:04 -07:00
Joel Hooks f11d7e9084 chore: auto-commit from o11y triage 2026-03-10 09:15:39 -07:00
Joel Hooks aae6ab0c8c Degrade apps/web Convex static generation when env is missing, seed placeholder slug params for Cache Components, and no-op client Convex providers during prerender 2026-03-10 09:15:07 -07:00
Joel Hooks 26c7614233 Sanitize Convex env reads and keep dynamic slug helper routes out of static build collection so Vercel production builds pass 2026-03-09 13:36:49 -07:00
Joel Hooks 5d56dac230 Guard apps/web search top-hit access, route convex-content through canonical readers, and pass resourceId into the registry review FAB so apps/web/tsconfig compiles clean again 2026-03-08 20:49:22 -07:00
Joel Hooks 53207f60ca Add short ADR route aliases, resolve them to canonical Convex slugs, and redirect legacy full-slug ADR URLs 2026-03-07 21:55:25 -08:00
Joel Hooks 9ce664c877 fix: getPost() supports all content types, not just article
Sequentially tries article/tutorial/essay/note resourceId prefixes.
Removes article-only type guard. Uses matched resourceId in diagnostics.
2026-03-02 10:52:41 -08:00
Joel Hooks 0e1a4ba629 fix: query all content types in getAllPosts/getPostSlugs
getAllPosts() and getPostSlugs() were hardcoded to type='article'.
Now queries article, tutorial, essay, note via Promise.all and merges.
2026-03-02 10:46:16 -08:00
Joel Hooks e20d5a96a7 refactor(web): centralize copy prompt template 2026-03-01 16:34:38 -08:00
Joel Hooks ad943aac16 feat: register ContainmentBreach in MDX components 2026-03-01 12:30:23 -08:00
Joel Hooks ab69c6f172 fix: revert image crop — use natural aspect ratio with width/height for CLS 2026-03-01 11:53:29 -08:00
Joel Hooks afd050a722 fix: getPost cacheLife 'max' → 'minutes' so tag revalidation actually works 2026-03-01 11:52:17 -08:00
Joel Hooks 228834c21d fix: lock MDX image aspect ratio to prevent CLS 2026-03-01 11:50:36 -08:00
Joel Hooks 8805397dbb fix: move notFound() outside 'use cache' boundary
notFound() is a runtime API that requires workUnitAsyncStorage context.
Calling it inside 'use cache' causes InvariantError during prerendering.

CachedArticleContent now returns null when post not found, and the
caller (StaticArticleShell) handles notFound() in request context.
Also uses cacheLife('minutes') so new articles appear without deploy.
2026-03-01 10:48:03 -08:00
Joel Hooks 4619e71e2d fix: use cacheLife('minutes') for getPost to enable deploy-free publishing
getPost() now caches for minutes instead of max, so new articles
appear within minutes of Convex upsert. Explicit tag revalidation
makes them appear instantly. 404 check moved outside cache boundary
in [slug]/page.tsx so stale null results don't block new content.
2026-03-01 10:43:57 -08:00
Joel Hooks a1d3d5bd36 fix: move 404 check outside cache boundary for deploy-free publishing
getPost() no longer uses 'use cache' — null results were cached
indefinitely, blocking new articles until a redeploy.

Now: getPost() fetches from Convex on every request (uncached).
CachedArticleContent receives post as prop, caches only MDX rendering.
New articles appear immediately after Convex upsert + tag revalidation.
2026-03-01 10:35:57 -08:00
Joel Hooks 94f210001e fix: upsertContent treats soft-deleted records as fresh inserts
Soft-deleted records (deletedAt set) were matching the hash guard
and returning 'skipped', preventing re-sync after removal.
Now skips hash guard for soft-deleted records so they get restored.
2026-03-01 07:34:17 -08:00
Joel Hooks 87f2779e3b Fix duplicate ADR entries and canonical sync filter 2026-03-01 07:30:44 -08:00
Joel Hooks 8248fa59c5 fix: strip frontmatter from Convex content at read + write layers
- posts.ts: strip leading frontmatter/metadata before rendering
- content-review.ts: normalize content on fetch/persist to prevent
  future writes from reintroducing raw frontmatter
- seed-articles.ts: defensive strip on seed path

Fixes frontmatter metadata rendering as visible article body text.
2026-02-28 12:23:43 -08:00
Joel Hooks 4deaf73474 feat(ADR-0168): Vault→Convex direct pipeline, remove repo content
Phase 2 of ADR-0168 (Convex-canonical content lifecycle):

- Rewrite content-sync: Vault→Convex direct, no file copy/git commit/push
- Add content-verify function: diffs Vault sources vs Convex records
- Add content/seed.requested and content/verify.requested events
- Add joelclaw content seed/verify CLI commands
- Fix post frontmatter: store type, tags, source, channel, duration, updated
- Update Convex postFieldsValidator to accept full frontmatter
- Remove 175 ADR .md files and 22 post .mdx files from apps/web/content/
- Remove filesystem fallback from adrs.ts and posts.ts (Convex-only reads)
- Add .gitignore + README to apps/web/content/ skeleton
- Reseed Convex with complete frontmatter (175 ADRs, 21 posts)
2026-02-28 11:21:56 -08:00
Joel Hooks 2a45583a72 fix: ADR pages 500 when Convex date field is empty
parseAdrFields returned null when date was falsy, causing 500.
Now extracts date from markdown body (**Date**: YYYY-MM-DD) and
falls back to 'Unknown'. Date is no longer a hard requirement.
2026-02-28 11:11:19 -08:00
Joel Hooks 02c35a8022 fix: escape MDX angle brackets at render time for ADR pages
Adds escapeMdxAngleBrackets() utility that preserves code fences,
inline code, and valid HTML tags while escaping comparison operators
like < 0.5, >50%, <5MB that break MDX compilation.

Fixes 500 errors on ADR-0163, 0164, 0165, 0169 and any future ADRs
with raw angle brackets in Convex-sourced content.
2026-02-28 11:08:07 -08:00
Joel Hooks 5deb2eebc9 feat(content): migrate adr/discovery reads to convex 2026-02-28 10:36:57 -08:00
Joel Hooks ec33ac1235 web: harden article rendering + source diagnostics 2026-02-28 06:37:17 -08:00
Joel Hooks e0e1b0d257 delete: remove dogfooding discovery — exposes sensitive materials
Removed discovery note that referenced internal egghead infrastructure,
private Loom recording, and internal PR details.
2026-02-27 21:47:17 -08:00
Joel Hooks a5914ece57 feat: joelclaw webhook provider for Inngest event proxy
- /webhooks/joelclaw with HMAC-SHA256 signature verification
- Forwards events to self-hosted Inngest at localhost:8288
- Submit route signs requests with x-joelclaw-signature
- Removed duplicate /webhooks/inngest-event endpoint
- Added post:slug cacheTag for revalidation (FBP-4)
2026-02-27 16:45:11 -08:00
Joel Hooks 8881242236 chore: biome auto-fix import ordering across repo 2026-02-27 14:55:43 -08:00
Joel Hooks 923381353e feat(CFP-2): Read articles from Convex instead of filesystem
Codex implement step completed — tsc clean, build passes.
Committed manually because codex didn't commit (prompt strengthened).
Also: stronger commit requirement in story-pipeline implement prompt.
2026-02-27 09:49:47 -08:00
Joel Hooks 1077942d50 revert(CFP-2): restore filesystem article reads — async Convex breaks PPR prerender
CFP-2 made getPost/getAllPosts async for Convex reads, but Next.js 16
with PPR rejects uncached async data access outside <Suspense>.
ALL article pages failed prerender with 'Uncached data was accessed
outside of <Suspense>'.

CFP-2 and CFP-3 need to land together — Convex reads require
'use cache' boundaries first.
2026-02-27 09:21:43 -08:00
Joel Hooks 561b636f52 fix(story-pipeline): retries: 2 for transient SDK failures (ADR-0156)
retries: 0 made worker restarts fatal — Inngest couldn't retry
the step on the new worker. With retries: 2, the 1s restart window
is covered by Inngest's built-in retry backoff.

ADR-0156 rewritten: blue/green port swap > drain-then-restart.
Inngest is step-level stateless — we don't need to wait for runs,
just for the current in-flight step.
2026-02-27 09:19:32 -08:00
Joel Hooks c82474bf47 OG images from post frontmatter: image field → openGraph + twitter cards
- Added image? to PostMeta
- [slug]/page.tsx wires image into og:image and twitter:image
- MineClaw post with hero image + OG
2026-02-27 07:28:36 -08:00
Joel Hooks 6cc7e43cd7 fix(adrs): add shipped/deferred/in_progress to VALID_STATUSES + sync vault statuses
VALID_STATUSES only had 6 entries — shipped, deferred, in_progress,
researching, withdrawn were all normalizing to 'proposed'. Now matches
status-config.ts. Also synced 0142→deferred, 0145→deferred,
0146→shipped, 0147→shipped from Vault.
2026-02-25 19:18:02 -08:00
Joel Hooks 8689504d2c feat: add granola meeting intelligence skill
Documents granola CLI (MCP-backed via mcporter), commands, rate limit
gotchas, pipeline integration, and Inngest function references.
2026-02-24 11:57:27 -08:00
Joel Hooks e7f36114c5 web: stabilize cache components build and route dynamic islands 2026-02-22 13:59:37 -08:00
Joel Hooks 6bff2cc455 feat(adr-review): ADR-0106 — inline paragraph comment system
- Convex adrComments table + 7 mutations/queries
- rehype-paragraph-ids plugin (content-hash anchoring)
- Review UI: comment drawer, review sheet, FAB, auth gate
- shadcn init (Tailwind v4) + registry.json
- Submit review API route (fires Inngest event)
- @/* path alias for imports
2026-02-22 10:38:59 -08:00
Joel Hooks 016dccc295 redesign: cool finds index — full titles, readable descriptions, compact cards
- Titles wrap fully instead of truncating
- Relevance text shows complete (no line-clamp)
- Date shown as relative time (2d ago) above title, not stealing width
- Single type badge (repo/article/video) replaces full tag list
- Source URL removed from index (shown on detail page)
- Tighter card spacing for better scan density
- Re-removed duplicate self-hosting discovery (also from Vault source)
2026-02-22 08:07:35 -08:00