caelum0x 3246420cb1 docs(ritgram): finalize architecture task pool after RIT-1..4 (RIT-OPS)
Update docs/architecture/TASK-POOL.md with the final state of all four
items from /tmp/arch-scan-RIT.json: RIT-1 (dead module deletion) through
RIT-4 (npm scope check), including the webhook retry/backoff/history
feature gap and the RIT-2 docs-copy literals intentionally left for a
follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 01:15:51 +03:00

79 lines
4.6 KiB
Markdown

# Rithub / Ritgram architecture task pool
Source: adversarially-verified architecture scan `/tmp/arch-scan-RIT.json` (2026-11-28).
Scope: apps/ritgram (+ apps/gitea, apps/rit, apps/rithub, packages/rithub-cli).
All four items below were approved by lead decision and done in one worktree
(`/private/tmp/rit-arch-wt`, branch `arch/rit-2026-11-28`); RIT-1 was the only
one originally marked `needsDecision=false` — RIT-2/3/4 were scope additions.
## RIT-1 — dead duplicate modules in Ritgram backend (DONE, RIT-OPS)
Deleted 23 zero-caller files (OAuth/rate-limit/webhook duplicates + 17 more
dead services/middleware) plus 5 orphaned unit tests that imported them.
Kept the live implementations: `oauthService.ts`, `rateLimiter.ts`,
`webhookService.ts`, `forge/webhook/detect.ts`. tsc --noEmit: 0 errors
before and after. jest tests/unit: same 6 pre-existing failing suites
before/after (unrelated githubImportPreviewLimiter route-wiring issue, not
caused by this change); 30 failing / 768 passing before, 30 failing / 616
passing after (minus the 152 tests that lived only in the deleted files).
**Feature gap found, not silently dropped:** the deleted
`webhookDeliveryService.ts` had a more complete design than the live
`webhookService.ts` — `scheduleDelivery`, `attemptDelivery` (with retry
scheduling), `retryFailedDeliveries`, `getDeliveryHistory`, `testWebhook`.
The live outbound-webhook path (`webhookService.ts` +
`controllers/webhookController.ts`) today does one-shot delivery only: no
retry/backoff on failure, no delivery history exposed to users. Worth
porting retry+history into the live service as a real feature, not just
code to discard.
## RIT-2 — no single source of truth for the product domain/URL (DONE, RIT-OPS)
Added `apps/ritgram/web/lib/site-config.ts` as the one module. It exposes
two intentionally-separate real domains (merging them would have broken
the "Sign in with Rithub" OAuth redirect):
- `RITGRAM_SITE_URL` (this app, `ritgram.rithub.dev`) — reads
`NEXT_PUBLIC_SITE_URL` as a fallback input, same as before.
- `RITHUB_ENGINE_URL` (the Rithub engine, `rithub.dev`) — reads
`NEXT_PUBLIC_GITEA_BASE_URL` as a fallback input, same as before.
- Derived `RITGRAM_SITE_HOST`/`RITGRAM_SUPPORT_EMAIL`/`RITGRAM_LEGAL_EMAIL`.
Verified live domains by curl (follow redirects, check body) before
picking values: `rithub.dev` and `ritgram.rithub.dev` both answer 200 with
real HTML; `app.ritgram.rithub.dev` (hardcoded in the install-page copy)
doesn't resolve at all (curl: 000) — fixed to the real host. Updated
layout/sitemap/robots/badge-route, login+register OAuth buttons,
terms/about contact emails, install-page copy, settings/account's local
`RITHUB_DEFAULT_BASE_URL` const. tsc --noEmit (apps/ritgram/web): 0 errors
before and after.
Left as-is (same correct value, not a functional bug, out of this pass's
scope): ~15 docs/marketing pages (`app/docs/rithub-vs-*`,
`app/docs/import-from-github`, embed pages, etc.) still hardcode the
literal `rithub.dev` in prose and git-command code samples shown to
users. Converting those to template interpolation is mechanical but
touches a lot of copy for no functional gain — worth a follow-up if the
owner wants full literal-free coverage.
## RIT-3 — dormant Rust forge sitting live-looking in apps/ (DONE, RIT-OPS)
Moved `apps/rit` and `apps/rithub` (kept, not deleted, per owner's
never-delete rule) to `archive/rust-forge-not-deployed/{rit,rithub}`.
Fixed one real breakage from the move: `rithub-server`'s
`egress-guard = { path = "../../../rago/crates/egress-guard" }` reached a
sibling app (`apps/rago`) two directory levels up; the extra nesting from
the move broke it, now `../../../../../apps/rago/crates/egress-guard`.
`rit = { path = "../rit" }` needed no change (both moved as siblings).
Verified: `cargo check` succeeds for both the archived `rit` crate and the
full archived `rithub` workspace (6 crates incl. the fixed egress-guard
cross-reference). Updated the archive-pointer note at the top of both
ARCHITECTURE.md files and the two READMEs (root `README.md`,
`apps/gitea/README.md`) that listed the old `apps/` paths.
## RIT-4 — Rithub CLI published under a dead brand's npm scope (DONE-CHECK, RIT-BRD)
Checked this machine for an npm token able to publish a Rithub-owned
scope: `npm whoami` → `recoder.xyz` (the dead brand itself); `~/.npmrc`
has exactly one token, for that same account. No Rithub-owned npm
scope/token exists on this machine. No publish was performed (per
instruction). Logged an owner-only step in
`plans/OWNER-NOTES-2026-11-19-saved-2026-11-24.md` (Owner-only table):
create an npm org/scope for Rithub, mint its token, then deprecate (never
unpublish) `@recoder.xyz/rithub` pointing at the new package name.