524 Commits

Author SHA1 Message Date
af2c2fcd04 fix(ritgram): correct swapped follower/following back-relation field names
Account.followers/following and User.followers/following were labeled
backwards relative to what they actually return: the "followers" field
on each model was the back-relation for the FK column that makes *this*
row the follower (i.e. "who I follow"), and "following" was the
back-relation for the FK column that makes this row the target (i.e.
"who follows me") -- exactly inverted from their names.

Swap just the two field names on each model (relation tags, FK columns,
and the Follow model's own follower/following fields are untouched, so
this needs zero DB migration). This fixes every _count.select.followers/
following read across router.ts, social.ts, resolvers.ts, adminController,
searchController, popularController, socialGraphService,
trendingRankingService, fakeAccountDetectionService, etc. in one place --
all profile header counts, followers/following list pages, and REST/
tRPC/GraphQL responses were pulling the inverted number.

followService.ts and the tRPC getFollowers/getFollowing procedures
already bypass these relations (query Follow directly by followerUserId/
followingUserId), so they were already correct and are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-18 02:41:24 +03:00
74dc01549f fix(toolgate): drop Rally from landing/docs/llms marketing copy
Rally has 0 tools in the deployed catalog (hidden, no
SWITCHYARD_RALLY_TOKEN configured in prod) — the landing page, /docs.md
and /llms.txt still named it as an integrated "own product" in four
places (site.rs). Dropped "Rally" from all four so the copy matches what
is actually live: Scribase and Menivor.
2026-11-18 02:37:31 +03:00
27e5869a18 fix(ritgram): finish the follow FK fix everywhere -- socialController, tRPC (both routers), GraphQL, GitHub auto-follow sync
The already-shipped follow fix (userController.ts, commit 21acdbaa) only
covered one of five real call paths for the same Follow.followerId/
followingId-is-an-Account-FK-not-a-User-id bug:

- socialController.ts's parallel POST/DELETE /api/v1/social/follow/:userId
  (plus its getUserFollowers/getUserFollowing, which filtered the
  Account-keyed followingId/followerId columns with a User id and
  silently matched nothing).
- trpc/routers/social.ts's follow.followUser/unfollowUser/getFollowers/
  getFollowing (same write bug, same silently-wrong reads, plus
  getFollowers/getFollowing returned Account rows as if they were User
  rows -- different id space than every other User-facing endpoint).
- trpc/router.ts's own separate users.follow mutation and users.profile's
  isFollowing check (yet another independent copy of the same bug,
  found via a full grep sweep, not mentioned in the prior session's
  "not reachable" list).
- graphql/resolvers.ts's followUser mutation.
- services/githubSyncService.ts's syncAndAutoFollow -- wired to a real,
  reachable, authenticated route (POST /api/v1/github/social/sync-follows)
  that writes raw User ids into the Account-keyed FK columns via
  createMany; would FK-violate for any real user who links GitHub and
  has GitHub followers already on Ritgram. Fixed to resolve real Account
  rows for both sides before writing, same as the other paths.

None of socialController/trpc/graphql are called by the live Next.js web
client (re-confirmed via grep across apps/ritgram/web, same finding as
the prior session), so this was latent rather than user-visible -- but
they are reachable API routes with the same 500, and githubSyncService's
route specifically is both reachable and silently broken for any real
GitHub-linked user.

Added services/followService.ts as the single shared implementation
(followUser/unfollowUser/isFollowing/listFollowers/listFollowing) and
routed every one of the above call sites through it, including
userController.ts's already-shipped handlers -- so there is now exactly
one place this fix lives instead of five independent copies.

tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-18 02:19:02 +03:00
765a46c6c2 feat(rithub): visible Sign up/Sign in header CTAs + GitHub/Google/Apple OAuth wiring
Owner complaint: "rithub still has no google github apple auth and create
account options" -- the header only showed an icon-only Register control
(no visible text), so a first-time visitor had no obvious way to create
an account.

- head_navbar.tmpl / theme-rithub.css: the signed-out Register/Sign In
  controls now show real "Sign up"/"Sign in" text next to their icons
  (filled accent pill for Sign up, plain icon+text for Sign in), as an
  explicit exception to the icon-only nav chrome rule. Dropped the
  mismatched localized aria-label in favor of matching English text/title
  (the visible text is now the accessible name).
- Login ("Register now.") and sign-up ("Sign in now!") cross-links were
  already present and styled bold -- verified live, left as-is.
- docker-compose.yml: [oauth2_client] ENABLE_AUTO_REGISTRATION=true,
  ACCOUNT_LINKING=auto, so a first OAuth login creates/links the account
  directly, no second form.
- New apps/gitea/scripts/add-rithub-oauth-sources.sh: runs on
  railyard-box (no SSH hop), reads /etc/products/rithub-oauth.env
  (root-only, owner-filled) and calls `gitea admin auth add-oauth` for
  GitHub/Google/Apple (Apple's ES256 client-secret JWT minted from the
  .p8 key via python3+PyJWT, already present on the box). Safe to re-run;
  skips sources that already exist or have no credentials. Verified live
  as a no-op with an empty env file.
- rithub-oauth.env.example documents the exact env keys; a real (empty)
  copy was created at /etc/products/rithub-oauth.env on railyard-box for
  the owner to fill in.
- Kept the existing Mac-side add-oauth-sources.sh working (cross-
  referenced, not replaced).

Deployed to railyard-box (apps/gitea only, backed up custom/+app.ini/
compose first). Verified live: header shows Sign up/Sign in text
(desktop + mobile), real signup via a mail.tm disposable address +
captcha succeeded end to end (account created, welcomed, deleted after).
No provider enabled yet -- OAuth app creation in each provider console
is an owner-only step, documented in plans/railyard.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-18 02:06:00 +03:00
2a425b7e21 fix(toolgate): repoint Menivor adapters to the real /api/v1/jobs surface, drop menivor.tts.speak
Menivor's legacy /videos, /audio and /tasks/{id} routes are hidden under
MENIVOR_API_SURFACE=allowlist in production (confirmed live, 404 for every
caller). The real product surface is POST /api/v1/jobs + GET
/api/v1/jobs/{job_id}.

- menivor.video.render now POSTs /api/v1/jobs with layout fixed to
  captions_only, so it never needs a paid HeyGen avatar plan (every other
  layout is gated 402 sku_locked on the shared service account's free tier,
  confirmed live against api.menivor.com).
- menivor.video.status now polls GET /api/v1/jobs/{job_id}, the same id
  space render creates, and maps the new result_url field.
- menivor.tts.speak removed from the catalog (own.yaml + its capability
  entry): there is no standalone TTS job on /api/v1/jobs, and the separate
  POST /api/v1/media/audio gateway's flagship elevenlabs model can never
  take a caller voice_id (AudioBody has no such field — confirmed by
  reading app/domains/routing/providers/voice_gen.py), so it is a permanent
  elevenlabs requires a voice_id failure for every caller regardless of
  balance. The self-hosted tts/kokoro|chatterbox fallback's real
  availability is unverifiable from Toolgate; shipping it would be exactly
  the broken-tool-left-in-the-catalog outcome this fix exists to avoid.

Updated fixtures/contract tests for the new endpoints and response shape;
cargo test --workspace: 0 failures.
2026-11-18 01:46:51 +03:00
cd7626a381 fix(rithub): og:image -> monochrome card matching the new theme
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:45:34 +03:00
21acdbaa31 fix(ritgram): follow feature was 100% broken -- 0 Follow rows ever created in prod
followUser/getFollowers/getFollowing/getUser's isFollowing check all wrote
and read Follow.followerId/followingId as if they held User ids, but the
Prisma schema's FK for those two required columns actually targets
Account.id. Every real follow attempt threw
"Foreign key constraint violated: Follow_followerId_fkey" and 500'd
(confirmed live with a fresh mail.tm test account against caelum0x;
confirmed via `select count(*) from "Follow"` = 0 in production).

Every *other* consumer of this table (feed ranking, recommendations,
trending, activity feed, analytics, blocking, data export, muted words,
GitHub activity sync) already reads the schema's parallel
followerUserId/followingUserId columns, which are User-keyed and nullable
-- so even a hypothetical accidental FK match would still have been
invisible to the rest of the app.

Fix: followUser now resolves both sides' Accounts (same pattern already
used in createPost/addComment) to satisfy the required followerId/
followingId FK, and also writes followerUserId/followingUserId so the row
is visible to every User-keyed reader. getFollowers/getFollowing/getUser
switched to query the followerUserId_followingUserId compound unique key
instead. Added the missing `DELETE /api/v1/users/:id/follow` route +
unfollowUser handler -- the web client's userService.unfollow() has always
called DELETE, which 404'd (no such route existed; follow was only ever a
POST toggle).

Not touched, flagged instead: socialController.ts's parallel
`/api/v1/social/follow/:userId` (POST/DELETE) and the tRPC (`/trpc`) and
GraphQL follow mutations have the exact same followerId/followingId-as-
User-id bug. None of them are called by the live Next.js web client
(confirmed via grep across apps/ritgram/web) so they're not part of the
live product surface, but they are reachable API routes with the same
latent 500 -- worth a dedicated follow-up pass.

tsc --noEmit clean.
2026-11-18 00:59:52 +03:00
470b6e74e2 fix(rithub): Rithub-named base theme, monochrome pagination + open-with icons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:48:47 +03:00
ad95d5c1f6 fix(ritgram): comment-escape bug, delete-account 500, missing post-edit route
- createCommentValidator had the same .escape() bug already fixed in
  createPostValidator (0ec2f661) for post content: HTML-entity-escaped
  literal "/" in comment URLs. Comment renderers (CommentThread.tsx via
  linkifyText, RealTimeComments.tsx via plain JSX) never use
  dangerouslySetInnerHTML, so React's own escaping is the real XSS guard;
  removed .escape() to stop mangling comment URLs.
- DELETE /api/v1/auth/account 500s when the request has no
  Content-Type: application/json body (req.body is undefined, not {},
  so destructuring `password` off it throws). Guard with `req.body || {}`.
- The post-edit UI (/posts/:id/edit, linked from every post's own detail
  page) called `PUT /api/v1/posts/:id`, which never existed on the
  backend (404) -- a real public-facing stub. Added updatePostValidator,
  postController.updatePost (content/hashtags/repositoryId, regenerates
  link previews, replaces hashtag links) and the route, reusing the same
  requireOwnershipOrRole('Post') middleware deletePost already uses.

tsc --noEmit clean.
2026-11-18 00:46:32 +03:00
cea412982e fix(toolgate): narrow http allowlist for SearXNG + Menivor x-api-key auth
web.search.searxng called the internal products-net SearXNG host over plain
http and the egress client's https-only policy blocked it ("only https is
allowed: http://"). EgressConfig gets a new http_hosts: exact host:port
entries (never a wildcard) derived only from SWITCHYARD_SEARXNG_URL when it
is http -- those hosts, and only those, are also exempted from the
private/internal-address block (the whole point of allowing http for an
internal Docker-network service name). Every other host keeps the existing
SSRF policy unchanged: https only, no private IPs, no other internal hosts.
4 new egress tests cover the scoping (own host only, not via allow_hosts,
not via IP literal).

Separately, Toolgate's native Menivor adapter sent the platform credential
as `Authorization: Bearer <token>`, but Menivor's resolve_principal only
accepts a raw key via `x-api-key` (Bearer is Clerk-JWT-only there) -- a
protocol mismatch that made every menivor.* call 401 regardless of token
validity (confirmed live: the same real service-account key gets 401 via
Bearer, 200 against GET /api/v1/jobs via x-api-key). Added with_api_key()
(send the credential verbatim, no prefix) and switched menivor_render/
menivor_status/menivor_tts to it; left Scribase/Rally on with_bearer
unchanged. Catalog's menivor provider credential placement corrected to
match (x-api-key, no prefix) for documentation accuracy.

cargo test --workspace: 0 failures.
2026-11-18 00:39:44 +03:00
0e2645fc90 feat(rithub): monochrome Apple glass theme (no blue), readable dark mode, ink logo, new screenshots, OAuth source script
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:38:31 +03:00
0ec2f66158 fix(ritgram): stop escaping post-content slashes, linkify URLs, fix profile Posts-tab 404
- postValidator: drop .escape() from createPost's content rule (was turning
  every literal "/" in a URL into &#x2F;, so link detection and link previews
  silently never fired on any post containing a link). React already escapes
  rendered text; PostCard never uses dangerouslySetInnerHTML for post content.
- compose/edit live-preview panes DO use dangerouslySetInnerHTML for their
  markdown preview and relied on the backend .escape() as their only XSS
  guard -- added an explicit &/</> escape before any markdown transform so
  removing .escape() doesn't open that up.
- linkify.tsx: linkifyText only matched @mention/#hashtag; added a URL pass
  (same regex as extractUrls.ts) so bare https:// URLs render as a real
  <a target="_blank">, with mention/hashtag matching skipping any range a URL
  already claimed.
- Profile Posts tab called a route that doesn't exist
  (GET /users/:username/posts, 404 on every profile). Added real
  username/userId filtering to postController.getPosts (it previously ignored
  both query params entirely) and pointed both frontend callers
  (profileApi.ts's fetchUserPosts, ProfileTabs.tsx's dead-code twin) at
  GET /v1/posts?username=. Switched ProfileTabs' infinite-scroll fetcher from
  a cursor param the backend never returned to real page-based pagination.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:04:58 +03:00
0b4d55ec75 fix(gitea): scope migrations.ALLOWED_DOMAINS to GitHub (close SSRF gap in /repo/migrate)
The [migrations] section was absent from docker-compose.yml entirely,
which Gitea treats as ALLOWED_DOMAINS="" == every http(s) host allowed
via the one-click "Import from GitHub" form (/repo/migrate) -- a real
SSRF surface (internal railyard-box services, cloud metadata, etc.)
nobody had scoped down.

Deployed + verified live, twice: first pass used literal "github.com"
only and broke real imports (Gitea's GitHub migrator also dials
api.github.com/codeload.github.com, which don't match an exact
string); fixed with glob wildcards
(github.com,*.github.com,*.githubusercontent.com). Re-verified via
the real API: github.com/octocat/Hello-World migrates successfully
(3 commits, 3 branches, real content, not just an empty repo row),
gitlab.com is now rejected 422 "You can not import from disallowed
hosts" before any outbound fetch. Test repos created during
verification were deleted after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 22:16:31 +03:00
dda14f9ac4 fix(rithub): add Terms/Privacy links to both footers, wire legal pages
Rithub has real signups/logins (i_like_gitea/_csrf session cookies) and
had zero legal pages -- plans/legal/rithub/{terms,privacy}.html are now
served at rithub.dev/terms and /privacy via a Caddy static handle added
ahead of Gitea's own reverse_proxy catch-all (box-only static files
under /srv/railyard-legal/rithub/, not part of this repo). Added both
links to the desktop 12-link SEO footer (rithub-footer-links-full) and
to the 390px short footer (rithub-footer-links-short), swapping out
"Is GitHub down?" there to hold the mobile list at 6 links -- that page
stays reachable from the desktop footer and the sitemap.

Verified live: /terms and /privacy both 200 text/html with correct
titles; footer links resolve and navigate correctly at 390px and 1280px;
/, /explore/repos, /user/login and a repo page still 200 after the
Gitea container restart needed to pick up the new custom/templates
footer.tmpl (Gitea caches templates in RUN_MODE=prod).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 22:02:05 +03:00
72ea087250 fix(rithub): real mobile-footer-hidden-behind-tab-bar bug, not just theory
The a0b4c089 fix added body{padding-bottom} to reserve room for the new
fixed tab bar, but that's a no-op on any page taller than one screen:
body's own box is pinned to exactly 100dvh (flex-column shell,
border-box), so the padding never grows it; real content overflows past
that pinned box via a flex child's default min-height:auto, landing the
footer in the *overflow* region where body's padding has zero effect.
Confirmed live (getBoundingClientRect + forced reflow): adding the same
padding directly to .rithub-footer-links (a normal block box, not
pinned) adds a real 56px gap instead. Verified on the 3 real pages this
matters for (home, explore, a ~21000px-tall repo file list) -- footer
text now sits fully above the tab bar at the bottom scroll position,
confirmed via live screenshots at 390px. Desktop (1280px) unchanged:
tab bar and the extra padding are both display:none/0px above 640px.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 21:54:37 +03:00
17712c12b7 fix(rithub,ritgram): clean mobile footer + wire real Ritgram OG card
- Rithub: desktop keeps the 12-link SEO footer unchanged; <=640px now
  shows a short 5-link footer (Explore, Sign up, Move from GitHub,
  Rithub vs GitHub, Is GitHub down?) instead of the full keyword list,
  which read as spam stacked above the mobile tab bar. All 5 links
  verified 200. SEO guides stay crawlable via sitemap-seo.xml.
- Mobile bottom tab bar was already fixed-position with safe-area
  padding and body bottom-padding (shipped in a0b4c089) -- verified
  still correct live at 390px, nothing to change there.
- Ritgram: wired the real uploaded OG card
  (https://assets.scribase.com/cards/ritgram-og-1200x630-1117b.png,
  verified 200 image/png 1200x630) into root layout.tsx's openGraph +
  twitter metadata, replacing the placeholder blue-"R" dynamic
  app/opengraph-image.tsx route (deleted) and the dead /og-image.png
  reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 21:40:49 +03:00
5f61a81547 sync(rithub): pull products-8c's box-only de-Gitea-branding edits into the repo
products-8c edited the DEPLOYED custom dir on railyard-box directly
(plans/railyard.md, "## 2026-11-17 (8c): Rithub — all visible 'Gitea'
removed...", commit 4458096 in the products meta-repo) instead of going
through this checkout: head_navbar.tmpl help links now point at the
real move-from-github guide instead of docs.gitea.com, robots.txt/12
SEO guides reworded away from "built on Gitea", and a new
templates/swagger/ui.tmpl + public/assets/api/swagger.rithub.v1.json
rebrand /api/swagger as "Rithub API". Pulled all of it from the live
box (rsync box -> repo) before layering this session's icon/OG/nav
work on top, per their own handoff note ("sync these files from the
box back into apps/gitea/custom in the repo before the next custom-dir
deploy, or they will be reverted").

app.ini's [ui] REACTIONS/CUSTOM_EMOJIS=rithub (also part of their box
edit) is box-only config with no repo file to sync -- confirmed still
live after this session's 2 container recreates, nothing to do there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 21:24:12 +03:00
c86eee80c6 fix(rithub): add real logo.png/favicon.png overrides (were serving stock Gitea mascot)
The brand mark revision 3 commit (a0b4c089) updated favicon.svg/logo.svg
but never added logo.png/favicon.png -- Gitea has no on-the-fly SVG to
PNG rasterizer, it just falls through to its own bindata default mascot
bitmap for any custom/public/img/*.png path that doesn't exist on disk.
Verified live after the first deploy: /assets/img/logo.png (the PWA
manifest's only PNG icon, claimed 512x512) and the alternate-icon
favicon.png were both still the stock Gitea mascot despite the SVGs
being correct. Added real 512x512 logo.png and 32x32 favicon.png
rendered from the same vector (gtm/brand-icons-2026-11-17/rithub/).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 21:19:14 +03:00
a0b4c089e1 fix(rithub): ship brand mark revision 3 + Material Symbols tab icons + new mobile tab bar
Wires in the approved rithub brand assets from
gtm/brand-icons-2026-11-17/rithub/: the two-offset-block mark (replacing
the revision-2 three-node branch graph that blurred into a blob at 16px
and echoed Yammer's icon formula) as favicon.svg/logo.svg, plus
apple-touch-icon-180/icon-192/icon-512(-maskable) static assets and new
<link> tags for them (head.tmpl override, none existed upstream).

Repo tabs (Code/Issues/Pull requests/Actions/Releases/Wiki/Settings) now
use self-hosted Material Symbols Rounded SVGs -- outline inactive
(#6E6E73), filled+accent active (#0071E3) -- instead of Gitea's stock
octicons; Issues uses "error" (circle-exclamation) rather than
"bug_report", which read identically to the Settings gear at 18-24px.
New icon-only mobile bottom tab bar (<=640px: Home/Explore/
Notifications/Profile), same outline/filled pattern, injected via the
custom/footer.tmpl hook with client-side active-state detection.

Default og:image/twitter:image swapped to the new mark's OG card
(assets.scribase.com/cards/rithub-og-1200x630-1117b.png, uploaded to
R2 this pass) with og:image:alt added; the move-from-github SEO page
gets its own per-page OG card (previously had none).

Verified locally: spun up gitea/gitea:1.23 with these custom/ files
bind-mounted (GITEA_CUSTOM=/data/gitea/custom, real sqlite DB, not the
install wizard) -- home/explore/login/signup all 200, 0 template
panics in server logs, new favicon/apple-touch-icon/OG/tabbar markup
all present in rendered HTML. repo/header.tmpl {{ }} action count
matches upstream exactly minus the 7 swapped icon calls, confirming
the substitution didn't disturb template structure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 21:15:36 +03:00
f722e309cd fix(ritgram): narrow Rithub Sign-In OAuth scope to read:user
Ritgram's "Continue with Rithub" authorize-URL builder never sent a
&scope= param, so Gitea's consent screen warned new signups it would
"access and write to all your account information, including private
repos and organisations" for what's meant to be a lightweight SSO
button — a real trust/conversion hit on the primary signup CTA.
Pinned by an earlier same-day session (plans/railyard.md) to the
exact two lines; apps/ritgram was off-limits then, free now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 20:27:43 +03:00
bcf64336e5 fix(toolgate): real example inputs for the 14 tools whose docs showed placeholder values
catalog.md and llms-full.txt showed {"ticker":"example"} for company.sec.filings,
which answers 422 provider_rejected_input. Every tool now has a manifest example.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 19:45:39 +03:00
29bbbaed83 fix(gitea): lead the Rithub app footer with the brand name, not "built on Gitea"
Every real Rithub app page (repos/issues/explore/etc) led its footer with
"built on Gitea (MIT)" and no "Rithub" prefix at all, unlike the 12 static
SEO landing pages which already correctly lead with "Rithub — code hosting,
built on open-source Gitea (MIT)". Flagged in plans/pm/railyard.md backlog
#5 as explicitly rejected from the PH launch gallery for undermining the
"Rithub, not Gitea" positioning. Matched the SEO pages' already-correct
phrasing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 19:44:49 +03:00
f6682cc7af fix(insights): skip QA/automation browsers in the page tag, add a localStorage opt-out
navigator.webdriver is true for real, headed Chrome driven via CDP/
Playwright (the gstack/browse QA-testing tooling used to dogfood live
sites), which carries an ordinary Chrome UA and so passed the server-side
bot filter's UA regex uncaught -- every site on this tag (menivor.com
included) was counting that traffic as real visitors. /s.js now skips
sending anything, and never defines window.railyard, when
navigator.webdriver is true or localStorage railyard_opt_out=1 is set.
All 67 existing insights-edge tests still pass unmodified; the 3 KB gzip
tag budget still holds. Not deployed this session (insights.ereboslab.com
is under the standing ereboslab deploy freeze) -- noted in
docs/FIRST-PARTY-SITES.md, along with the fact that traffic numbers quoted
for any site in that table before today may include QA/dogfooding hits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:07:01 +03:00
beeb4a388e fix(gitea): canonical tags, robots.txt sitemap, Insights QA filter, GitHub-status page
Rithub-only (apps/gitea) slice of the traffic-7e-rithub audit fixes.
Ritgram-side items stay blocked — apps/ritgram is claimed by another
session this round.

- Fix all 12 SEO landing pages' canonical tags to self-reference
  rithub.dev instead of the redirecting legacy git.ereboslab.com
  domain (audit found 10 stale, not the 9 originally listed).
- Add apps/gitea/custom/public/robots.txt with Sitemap: lines for
  both the Gitea-generated and hand-built SEO sitemaps; previously
  only served Gitea's content-signal boilerplate with no Sitemap/
  User-agent rules at all.
- Add a before-send filter to the Insights beacon (header.tmpl +
  all 12 static SEO pages) that drops page-view events from
  navigator.webdriver/headless UAs or a documented localStorage
  opt-out, so our own QA/crawl passes stop inflating this site's
  numbers. Uses the tracker's existing data-before-send hook, no
  change to the shared insights/insights-edge packages used by the
  rest of the portfolio.
- New is-github-down.html: live GitHub status fetched client-side
  from githubstatus.com's public API (CORS-open), plus a real
  git --mirror migration path for when it's down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:32:39 +03:00
aa848c66d0 fix(ritgram): Apple-design unslop pass + Rithub OAuth2 sign-in + critical login-redirect-loop fix
Apple design (plans/gtm/APPLE-DESIGN-RULES-2026-11-17.md): rewrote theme
tokens in globals.css/tailwind.config.js to neutral black/white + one
accent (#0071E3), replacing the GitHub-dark blue+green dual-accent theme;
mechanically swept every raw inline hex/rgba literal across app/components
that bypassed the CSS vars (506 hex + 326 rgb(a) replacements) since most
of the app hardcoded colors rather than using tokens; removed all emoji,
decorative gradients (Tailwind bg-gradient-to-* and raw linear/radial-
gradient() in inline styles), confetti, and glow/blur decorative orbs;
converted Navbar/Navigation to icon-only with aria-label+title. Finished
two stopped agents' in-progress work: deleted the fake AnimatedStats/
LiveActivity/ProjectShowcase/Testimonials auth-panel components and
cleaned up the emoji-laden feature list in (auth)/layout.tsx. Removed
remaining fabricated stats (topics/topics/[slug] posts-per-week/
contributors/followers) per the no-fake-numbers rule.

Rithub sign-in: added "Continue with Rithub" as an icon-only OAuth2
button (RithubMark component) on login/register, hidden "Continue with
GitHub" when GITHUB_CLIENT_ID is unset (confirmed unset in prod). Backend:
authenticateWithGitea in oauthService.ts exchanges the Gitea OAuth2 code,
resolves identity via the existing ForgeConnection table (no schema
migration needed), issues the same JWT/session as GitHub/Google login.
OAuth2 app created live on rithub.dev via its REST API as admin user
caelum0x; client id/secret stored in railyard-box's compose file (env
files don't ship to the runtime image, so the actual wiring lives in
docker-compose.yml, not backend/.env) and in ~/products/.env.

Critical bug found and fixed while verifying: services/api.ts's global
401 interceptor redirected every anonymous visitor to /login a couple
seconds after ANY page load -- including /login and /register themselves
-- because the AuthBootstrap's background GET /auth/me (expected to 401
for signed-out visitors) was treated the same as a real session-expiry
401, triggering a refresh attempt, another 401, and a hard
window.location.href redirect, which re-ran AuthBootstrap and repeated.
Fixed by excluding /auth/me and /auth/refresh from that redirect path.
Verified live with a fresh, cookie-less browser: previously looped
/register -> /login forever; now stable after 6s.

Also fixed: production CORS/API origin mismatch -- the frontend was
built with NEXT_PUBLIC_API_URL pointing at ritgram.ereboslab.com while
served from ritgram.rithub.dev, so every API call (login, register, etc.)
was blocked by CORS; rebuilt with rithub.dev as canonical and CORS_ORIGIN
allowing both domains.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 17:33:41 +03:00
77c25f007e fix(gitea): real meta description/og/twitter copy + sitemap domain for Rithub PH launch
rithub.dev was serving Gitea's stock "Git with a cup of tea" boilerplate in
<meta name="description">, og:description and twitter:description on every
non-repo page -- exactly what PH/Google/X/LinkedIn link previews show on
launch day. Fixed via the official app.ini [ui.meta] AUTHOR/DESCRIPTION/
KEYWORDS keys (set.UI.Meta in modules/setting/ui.go), wired through
docker-compose.yml's GITEA__ui_0x2E_meta__* env vars (dotted section names
need hex-escaping: "." -> "_0x2E_", confirmed against Gitea's own
config_env_test.go). og:title/og:image/og:url were already correct from an
earlier pass. Also fixed 10 sitemap-seo.xml entries still pointing at the
retired git.ereboslab.com domain instead of rithub.dev.

Deployed to railyard-box:/srv/railyard-gitea (recreate gitea container only,
other 32 containers on the box untouched). Live-verified: homepage and a
real repo page (caelum0x/settlekit) both show zero "cup of tea" strings;
sitemap-seo.xml has zero stale-domain entries.
2026-11-17 17:30:03 +03:00
e5dafe826b fix(security): stop leaking email/password-hash/2FA-secret/github-token from Ritgram APIs
Three unauthenticated/cross-user PII leaks found and fixed before PH launch:
- GET /api/v1/accounts/:username (fully public, no auth middleware) returned
  the full User row including bcrypt password hash, twoFactorSecret and
  githubAccessToken via an unscoped `user: true` Prisma include.
- GET /api/v1/users/:username leaked any user's real email to unauthenticated
  callers; email is now only attached when viewing your own profile.
- GET /api/v1/auth/me returned the caller's own password hash/2FA
  secret/github token in the response body.
- POST /api/v1/stories/:id/reply (storyReactionsController) returned the
  story owner's full User row to any other authenticated replier.
- POST /api/switch/account could return a shared account's full User row
  (incl. secrets) to any repo manager/org member switching into it.

Also:
- backend/src/index.ts: app.set('trust proxy', 1) — every rate limiter keys
  on req.ip, which without this always resolved to Caddy's internal IP, so
  limits were shared across all visitors combined instead of per-visitor.
- web/middleware.ts: /explore added to publicPaths for the PH launch (its
  page component has no client-side auth redirect, unlike /feed and
  /trending which hardcode router.push('/login') and were left alone).
- web/components/StoriesRing.tsx: fixed a double-prefixed, nonexistent
  /api/v1/stories/feed call to the real /stories endpoint.
2026-11-17 17:27:11 +03:00
72db2f212f feat(insights-edge): wire ritgram.rithub.dev into the edge injector for first-party analytics
Rithub was already migrated to rithub.dev and apps/ritgram was claimed by a
parallel session, so ritgram.rithub.dev gets its tag at the edge instead of
in its own layout: new route + SITE_KEYS entry (ry_site_ritgram_478d21ff41dc)
on the shared railyard-insights-inject Worker. Deployed and live-verified: a
real synthetic pageview for this host lands in product_analytics.pa.events.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 16:29:52 +03:00
783fd088da feat(rithub): add Rithub vs GitHub + Move-from-GitHub-in-5-minutes SEO pages
Two new static assets/seo pages (ported from gtm/rithub-compare-2026-11-17/),
linked from the footer alongside the existing 10, added to sitemap-seo.xml.
Deployed live to railyard-box, IndexNow pinged (202). Skipped
ritgram-vs-gitgram.html per plan (Gitgram is Ritgram's own pre-rename name,
not a real competitor).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 16:19:55 +03:00
6fa9d47cd3 fix(toolgate): catalog.md/llms-full.txt now carry real per-tool curl examples
The real, reproduced bug (found by the toolgate-mcp-listing pass earlier
today, documented but not fixed because the repo was claimed): /catalog.md
and /llms-full.txt -- the exact markdown surface llms.txt tells agents to
read first -- only ever listed Tool/Provider/Effect/Price, no parameter
names, while /catalog (HTML) already rendered a real example-derived curl
snippet per tool. An agent guessing a field name from the capability id
(domain.dns.lookup -> "domain") gets a verified-live 422 ("name" is the
real field) on a syntactically reasonable first try, only discoverable via
a second round-trip to GET /v1/tools/{id}.

catalog_markdown() now emits the same curl_snippet()/example_input() both
renderers already shared for HTML, so catalog.md and llms-full.txt (which
concatenates catalog_markdown's output) can never drift from /catalog
again. No change to catalog_page::html() or any pricing/schema data.

Verified: `cargo check -p switchyard-server` clean; live post-deploy check
in plans/railyard.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 15:55:21 +03:00
f1e320fe75 fix(toolgate): dedupe docs' 422 so first-call confusion has a real reason
docs.md/llms.txt said 422 means a schema error, but the live server also
returns 422 no_provider for a syntactically-valid call to an own_product
tool (rally.*, menivor.*) whose platform credential isn't connected on
this deployment -- verified live: POST /v1/tools/rally.company.enrich/call
with the catalog's own documented example body ({"domain":"stripe.com"})
422s with no_provider, same for menivor.video.status despite being priced
free in the catalog. catalog.md/llms-full.txt themselves have no wrong
field names (checked every example against each tool's real input_schema
live; all match) -- the real first-call trap is that an agent following
/catalog top-to-bottom hits a correctly-shaped but platform-credential-
gated call before reaching a free one. Docs now say so explicitly and
point at knowledge.wikipedia.summary/relay.chat.complete as the reliable
first call, and name GET /v1/tools/{id}'s routing.skipped as where the
real reason always shows.

Root cause (SWITCHYARD_RALLY_TOKEN/SWITCHYARD_MENIVOR_TOKEN platform
credentials not configured on toolgate.scribase.com) is a real infra gap,
not a docs bug -- out of scope here, logged in plans/railyard.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 15:39:39 +03:00
8d8fc695e9 fix(rithub): Apple-design unslop — new hero home, #0071E3 theme, icon-only nav
Owner: "UIs are AI slop, too colorful, use Apple design" / "no emojis no
writings on components apple design clean simple" (plans/gtm/APPLE-DESIGN-RULES-2026-11-17.md).

- home.tmpl: full replacement of the stock Gitea homepage (dropped the
  Go/Docker/Raspberry Pi marketing blurbs and "(by Railyard)" subtitle) with
  an apple.com-style hero: one headline, one subline, two icon-only buttons
  (create account, import from GitHub via service_type=2) and a real repo
  page screenshot.
- theme-rithub.css: neutral surfaces (#fff/#f5f5f7, #1d1d1f/#6e6e73 text)
  plus a single accent #0071e3 replacing Gitea's default blue/green, system
  font stack, no gradients. Functional colors (issue/PR labels, diffs,
  alerts) are untouched on purpose.
- head_navbar.tmpl + explore/navbar.tmpl: icon-only top nav and explore
  tabs (Issues/PRs/Milestones/Explore/Help/Register/Sign In/Repositories/
  Users/Organizations/Code) — each link keeps its text as an aria-label
  plus a native title tooltip instead of visible copy.
- docker-compose.yml: APP_NAME "Rithub" (was "Rithub (by Railyard)"),
  SHOW_FOOTER_POWERED_BY/VERSION/TEMPLATE_LOAD_TIME off (drops the stock
  "Powered by Gitea / Page: Xms" line); custom footer.tmpl trimmed to the
  MIT/Gitea credit + SEO links, no inline styles.
- railyard-brand.css superseded (left in place, no longer linked).

Deployed to railyard-box (/srv/railyard-gitea), backed up .env +
docker-compose.yml + custom/ to backups/pre-apple-design-2026-11-17/ first,
verified live on rithub.dev: /, /explore/repos, /user/login, /user/sign_up
and a real repo page all 200, no gradient/emoji/green left in rendered
HTML, screenshots at 1440/390 in plans/railyard.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 15:37:37 +03:00
600712e8ad feat(ritgram): cut Ritgram references over to ritgram.rithub.dev, add /docs/rit
Owner bought rithub.dev 2026-11-17; Rithub/Ritgram/Rit/gitgram-ai are all part
of it now. Replaces every ritgram.ereboslab.com / git.ereboslab.com reference
across Ritgram's pages/docs/sitemap/robots/og-tags with ritgram.rithub.dev /
rithub.dev, and adds NEXT_PUBLIC_SITE_URL fallback accordingly. New honest
/docs/rit page explains Rit (Rust git library, kept in this monorepo) is not
the production forge engine (that's go-gitea/gitea), added to the sitemap.

Old hosts (git.ereboslab.com, ritgram.ereboslab.com) now 301 to the new
domain at the Caddy layer (box-side change, not in this commit) except
/api/*, git smart-HTTP, and the Actions runner API, so existing
clones/pushes/CI/mobile keep working unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 15:19:42 +03:00
2222a45cc3 feat(ritgram): add IndexNow key file + ping script
ritgram.ereboslab.com had no IndexNow key file live, unlike ereboslab.com
and sibling properties, so changed-URL pings for this host were
previously impossible. Serves the shared ereboslab.com IndexNow key from
this app's own public/ (baked into the Next.js build) and adds a ping
script modeled on menivor/ereboslab's existing ones.
2026-11-17 15:00:02 +03:00
797a4ddd66 fix(gitea): give git.ereboslab.com a real 1200x630 OG card + twitter:card
Homepage og:image pointed at the 512x512 app icon (/assets/img/logo.png),
so link previews on Slack/X/LinkedIn/iMessage showed a tiny cropped icon
instead of a real preview card -- no twitter:card tag existed at all.

Overrides only the upstream default (non-repo, non-profile) branch of
go-gitea/gitea v1.23.8's templates/base/head_opengraph.tmpl via Gitea's
documented custom/templates override mechanism -- repo/profile/issue/diff
branches are left byte-identical to upstream. New card is a code-made
(PIL, no AI image model) 1200x630 PNG hosted on R2:
assets.scribase.com/cards/rithub-og-1200x630-1117.png. Deployed live on
railyard-box via a container restart (template-only change, no image
build) and verified: og:image/og:image:width/height, twitter:card
summary_large_image, twitter:image all present and correct on the live
homepage and /explore/repos; the new image returns 200 at exactly
1200x630; repo/profile pages untouched by construction.
2026-11-17 14:50:22 +03:00
5e194cb449 fix(ritgram): remove last fabricated vanity stat from auth layout
The homepage fix for fake "10,000+ developers" stats (9a566b20) missed
the same copy in the shared (auth) layout shown on every login/register
page. Swap it for honest copy before deploy verification.
2026-11-17 14:32:10 +03:00
80f9b82328 fix(ritgram): un-gate signup from broken GitHub OAuth, wire the real import-from-GitHub value step into onboarding, surface it from the empty feed, and index an orphan SEO page
Live-verified GITHUB_CLIENT_ID is unset on the ritgram-backend container in
production, so /onboarding/welcome's "Continue" button — gated on
`githubConnected` — was a 100% dead end for every real signup: the only
working escape was "Skip for now" straight to an empty feed with no path to
the actual value prop (moving a repo onto Rithub). Fixes:

- welcome: un-gate Continue from GitHub OAuth; make the connect card
  explicitly optional, since the no-OAuth username-based import is the real
  "move your code" path, not this broken connect button.
- New /onboarding/first-repo step (follow -> here -> feed, TOTAL_STEPS 3->4):
  primary CTA into the already-built no-OAuth /import-from-github flow,
  secondary CTA to create a repo straight on Rithub, skip to feed.
- /feed empty state: add an "Import from GitHub" CTA alongside the
  people-only "Discover"/"Trending" buttons that were there before.
- /register: honor ?next=<path> after signup (same-site paths only) so the
  link already used by /import-from-github's "create an account first, then
  come back here" actually returns the user to it instead of always
  dropping them into onboarding.
- /docs/github-account-suspended: a complete page sitting uncommitted and
  unlinked (curl-verified 404 live); added to sitemap.ts and cross-linked
  from /docs/rithub-vs-github.

Not deployed this pass (local commit only, per task instructions); disk on
railyard-box was 82%/9.0GB free as of the prior cleanup pass, so headroom
exists for the next deploy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 14:30:25 +03:00
9a566b20a3 fix(ritgram): remove fabricated vanity stats from homepage
Hero badge claimed "Join 10,000+ developers" and the stats section
claimed 10K+ developers / 50K+ posts / 25K+ repos / 100+ countries —
none of that is real on a near-zero-signup product. Replaced with
honest, verifiable differentiators (self-hosted on Rithub, one-form
GitHub import, no lock-in, free to start). No deploy this pass:
railyard-box is at 90% / 5.1GB free with nothing safely prunable
(docker builder/image/container prune all returned 0B) — matches the
same tight-disk threshold that caused a build to hit 100% earlier
today per this file's own history, so the deploy is held per the
"abort if disk is tight" rule rather than risking the box.
2026-11-17 14:07:22 +03:00
937fc003ac fix(rithub): open self-registration with image captcha; add vs-GitLab/Codeberg pages
Rithub (Gitea) had GITEA_DISABLE_REGISTRATION=true left over on the box, a
leftover from before the SSO-OIDC path was closed out. It silently blocked
every "Move from GitHub" signup regardless of what the marketing pages said.
Enabled registration with the built-in image captcha (no SMTP available for
email-confirm) and documented the real anti-spam tradeoff in a comment.

Also: new Rithub-vs-GitLab and Rithub-vs-Codeberg comparison pages, a fix
for sitemap.ts silently excluding every /docs/* route, an import-from-github
rewrite that leads with the native one-form migration tool instead of the
git-CLI mirror, and a corrected homepage line ("one click" -> "one form").

Verified end to end: real account registered, real public GitHub repo
migrated via the native tool, both cleaned up after. Live-verified post
deploy via curl + a real headless-Chrome hydration check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 05:06:42 +03:00
331831b833 fix(ritgram): twitter:image still 404s after the domain fix -- it points at a file that doesn't exist
The original bug report's twitter:image item is only half-fixed by the
Gitgram->Ritgram domain rebrand: the domain is now correct
(ritgram.ereboslab.com, not the dead gitgram.app), but the path itself,
/og-image.png, was never a real file in public/ -- only a file-convention
app/opengraph-image.tsx route exists. Next.js auto-fills og:image from that
convention (confirmed live: og:image correctly resolves to
/opengraph-image?<hash>, 200), but it does NOT also auto-fill twitter:image
from it once an explicit twitter.images array is present -- so twitter:image
kept pointing at the nonexistent path and 404ed, confirmed live via curl.

Fix: drop the explicit twitter.images array so Next.js falls back to the
same opengraph-image route for Twitter cards too, same as it already does
for og:image.

tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 04:09:00 +03:00
9f3f3f4248 fix(ritgram): the real fix for fake-200 routes -- delete root app/loading.tsx, not generateMetadata
Previous commit's generateMetadata-based notFound() fix did not actually
work, confirmed live: curl on a brand-new, never-requested /[owner] path
still returned HTTP 200 after that deploy, but this time the response body
contained `<template data-dgst="NEXT_NOT_FOUND">` -- hard proof Next.js did
resolve the 404 internally, generateMetadata's notFound() included, just
after the 200-status loading-skeleton shell had already started streaming
to the client. Status codes are committed with the first flushed byte;
nothing thrown later (including from generateMetadata) can change them
once a Suspense fallback shell has gone out.

Actual root cause: app/loading.tsx at the app root creates an implicit
Suspense boundary around every route with no more specific loading.tsx of
its own, including /[owner] and /[owner]/[name]. Next streams that
boundary's fallback (the feed-skeleton UI) as an instant 200 before the
async Server Component below it -- and its notFound() call -- resolves.

Fix: delete app/loading.tsx. Checked the blast radius first: feed/
messages/search/settings each already have their own scoped loading.tsx
(Next uses the nearest one, so they're unaffected); every other top-level
route (home, pricing, terms, privacy-policy, explore, discover, trending,
about, docs, import-from-github) is either a 'use client' component that
renders immediately or a server component with no slow data fetch (about
has neither), so none of them actually needed the global skeleton. Left
the generateMetadata additions from the previous commit in place -- they
are correct, harmless, deduped by Next's per-request fetch memoization,
and get the 404 <head> title right if some future loading.tsx narrows
back onto either route.

tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 04:02:30 +03:00
2e96008944 fix(ritgram): real 404 status still didn't work after the first fix -- root loading.tsx defeats page-level notFound()
Found live, right after deploying the backend cacheMiddleware fix and the
page-level notFound() fix: a brand-new, never-requested /[owner] path
(confirmed via a timestamp-unique path, ruling out any cache) still
returned HTTP 200 with the loading-skeleton HTML body, even though curl
against the backend API directly for the same username correctly returned
404. Same for /[owner]/[name] with a made-up repo name under a real owner.

Root cause: app/loading.tsx exists at the app root and has no more specific
loading.tsx overriding it for either of these two routes, so Next.js wraps
both in an implicit Suspense boundary and streams the loading-skeleton
shell with HTTP 200 immediately -- before the async Server Component (and
its notFound() call) has resolved. Once that shell starts streaming, the
response status is locked at 200 no matter what the deferred page body
later throws. This is a known Next.js App Router gotcha, not specific to
this codebase.

Fix: add a `generateMetadata` export to both pages that performs the same
existence check and calls notFound(). generateMetadata runs before any
part of the route streams (it has to -- it fills in <head>), so it is not
subject to the loading.tsx/Suspense deferral; calling notFound() there sets
a real 404 status for the whole response. The underlying fetch is memoized
per-request by Next.js, so this does not add a second network round trip.
Left app/loading.tsx itself untouched (deleting it would remove the
loading skeleton for every other top-level page that doesn't have its own
loading.tsx, which is a real UX regression for a fix this surgical didn't
need).

tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 03:52:15 +03:00
1aa8761ded fix(ritgram): cacheMiddleware replayed cached error responses as HTTP 200
Real root cause of the "unknown routes return a fake 200 instead of 404"
bug: it was never purely a frontend issue. cacheMiddleware (src/middleware/
cache.ts) wraps res.json on a cache miss and unconditionally cache.set()s
whatever gets written -- including a 404 ApiError's body -- then on the next
request for the same key replays it via a bare `res.json(cached)`, which
defaults to HTTP 200 since no res.status() call precedes it. Confirmed live
against ritgram.ereboslab.com: GET /api/v1/users/:id for a made-up username
returned a correct 404 on the DB-miss request, then 200 with the identical
"user_not_found" body on the next request within the 300s TTL -- and this
route (/api/v1/users/:id) backs the [owner]/page.tsx profile route, so any
nonexistent username/path served a fake 200 to crawlers once cached.

Fix: cache {status, data} together, skip caching any response with
statusCode >= 400 (errors shouldn't be cached regardless -- a user created
moments after a 404 was cached would stay invisible for the rest of the
TTL), and replay the cached status code on a hit instead of defaulting to
200. Affects 6 routes on this one middleware: /users/:id (+its repositories/
followers/following/tagged-posts) and /users/search.

tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 03:37:48 +03:00
7ffd5c0df3 feat(analytics): add Railyard Insights beacon to Rithub (git.ereboslab.com)
Registers git.ereboslab.com as a first-party Railyard Insights site
(self-serve API, site key s_FLXojc0pSLRIIJ6ndYp0p-li). Ships the
cookieless beacon tag in Gitea's custom/templates/custom/header.tmpl
(covers every app page) and in all 10 static SEO pages under
custom/public/assets/seo/, which are served directly as static assets
and bypass the Gitea template system. Deployed to railyard-box (surgical
file copy, not the full --delete rsync, to avoid touching the box's own
.env secrets), gitea container restarted to pick up the template change.
Verified live via curl across the app and the SEO pages, plus a real
recorded visit. Ritgram untouched (owned by a different in-flight pass).
2026-11-17 03:30:42 +03:00
6ee7ff4033 fix(ritgram): rebrand Gitgram->Ritgram everywhere user-visible, fix OG/sitemap base URL, real 404s
- sitemap.xml, robots.txt, og:url, og:image, twitter:image, metadataBase all
  resolve from NEXT_PUBLIC_SITE_URL with a https://ritgram.ereboslab.com
  default instead of the dead gitgram.app (NXDOMAIN).
- Page titles, OG copy, PWA manifest, offline.html, service-worker push
  notification title: Gitgram -> Ritgram. Left internal SW cache-name/tag
  strings (gitgram-static-, gitgram-sync, etc.) alone as low-risk code
  identifiers.
- /[owner]/page.tsx (top-level profile route) converted to an async Server
  Component that calls fetchProfile() + notFound() before any HTML streams,
  so a GET on any nonexistent username now returns a real 404 instead of a
  200 loading-shell (the same pattern [owner]/[name]/page.tsx already used
  one level down).
- apps/ritgram/backend: matching Gitgram->Ritgram string rename sweep across
  controllers/services/config comments and defaults (EMAIL_FROM,
  AITM_API_URL description, etc.) — no behavior change.
- apps/ritgram/mobile: matching user-visible string rename sweep.

tsc --noEmit clean on both web and backend.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 03:20:08 +03:00
6d221169e8 feat(ritgram): Move from GitHub — no-OAuth repo import via Gitea migrate API
GitHub OAuth app approval is blocked, so this ships the next-best onboarding
path: paste a GitHub username (public repos, no token) or an optional
fine-grained read token (private repos), tick repos, and Rithub mirrors each
one with Gitea's built-in /repos/migrate, streamed as live per-repo progress
over SSE, landing on the new Ritgram profile when done.

- GiteaForgeAdapter.migrateRepo(): calls the real Gitea migrate API, treats
  409 as "already there", and self-heals a false failure (proxy timeout or
  a post-clone step erroring after the repo already landed — both observed
  live against git.ereboslab.com) by re-checking existence with backoff
  before reporting a real failure.
- New public POST /api/v1/github-import/preview and auth'd
  POST /api/v1/github-import/start (requires an existing Rithub/Gitea
  connection); the GitHub token, when provided, is used once in-memory for
  that request and is never stored or logged. Both routes are rate limited.
- New /import-from-github page (public route) with username/token form,
  a tickable repo list, and a live per-repo progress list fed by SSE.

Verified end to end against the live git.ereboslab.com instance: created a
disposable Gitea test account, ran preview + start through the real HTTP
routes against real octocat.github.com repos, confirmed migrated repos
landing on Gitea, then deleted the test repos, the test Gitea account, and
the matching Ritgram test user + DB rows. Found and noted a real, unrelated
blocker: railyard-box is at 99% disk (for reference, this backend's dev/db
config lives in apps/ritgram/backend/.env, pointed at the project's Neon
dev DB; no change needed here).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 02:49:02 +03:00
fbfb76fec5 feat(rithub): add 6 more SEO pages (GitLab/Bitbucket alternatives, free private hosting, CI runners, flagged-account checklist, migration checklist)
10 Rithub SEO pages live total now. Each verified against the real
git.ereboslab.com instance (14 real repos, Gitea 1.23.8, registration
disabled/invite-only, CI runner proven queued->running->success in prior
entries). All 10 pages cross-link each other in their footers; sitewide
footer.tmpl extended to list all 10; sitemap-seo.xml extended to 10 URLs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 02:14:35 +03:00
71fd1cbdfc feat(ritgram): add Rithub vs GitHub comparison page with signup CTA
Honest fact-checked comparison (account control, price, migration speed,
social feed) at /docs/rithub-vs-github, linking to /register. Fills the gap
flagged in the 2026-11-17 growth pass: the existing /docs/import-from-github
page covers migration steps but no page framed the head-to-head comparison
with a direct signup CTA.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 01:43:06 +03:00
11877eb2e2 fix(relay-semantic-cache): lower max_temperature default to 0.5
Found while verifying the previous commit's fix doesn't miss siblings:
three of Menivor's own backend features route through this same gateway
with the identical vulnerable shape (single `user` message, no `system`
message, static instructions dominating a short variable section) at
temperatures the 0.7 default left unprotected --
app/domains/appaudit/rewrite.py (0.6), app/domains/applisting/hookscript.py
and app/domains/adclone/relay_writer.py (0.7, exactly at the old boundary).

Lowered the default to 0.5: every confirmed real caller that sets a
non-zero temperature today does so at 0.6+ specifically for sampling
variety, so 0.5 now covers all of them. No caller found anywhere in the
portfolio relies on caching in the 0.5-0.7 band, so this is pure
additional coverage, not a tradeoff -- confirmed low-temperature/no-temperature
consumers (CalDesk at 0.2, Kamiko's persona chat and Bidstage's structured
extraction, both of which omit temperature) are unaffected either way.

Extended the regression test to assert both newly-covered real
temperatures (0.6, 0.7) also bypass the cache, not just the headline 0.9
case. 22/22 tests still pass.
2026-11-17 01:29:23 +03:00
b7c0838d9d fix(relay-semantic-cache): skip caching for explicit high-temperature calls
Live bug (Menivor /tools free generators, all of hooks/script/hashtags/
titles/captions/ideas/reel): every visitor got an earlier, unrelated
visitor's cached answer for their own topic. Root cause is a second,
distinct instance of the same class of bug the Oct 29 system-prompt fix
(dfe50215) addressed for Kamiko: Menivor sends one `user` message that
mixes a long static instruction block with the short, varying topic, at
`temperature: 0.9` for creative variety. There is no `system` message to
exclude, so the whole blob is embedded and the static instructions
dominate the vector -- two unrelated topics for the same tool cosine-match
at 0.96-0.98, past the default 0.95 threshold.

Reproduced live against relay.ereboslab.com with Menivor's real production
key: a houseplant-subscription hooks request returned `x-relay-cache: hit`
(similarity 0.9919) on its very first call, and a completely unrelated
dog-leash request then hit the *same* cached houseplant answer verbatim
(similarity 0.9539).

Fix: a request with an explicit `temperature` above a new
`max_temperature` tunable (default 0.7, env override
RELAY_SEMANTIC_CACHE_MAX_TEMPERATURE) is never looked up or stored --
the caller already signaled it wants non-repeatable output. Requests with
no `temperature` at all, or a low one, are unaffected: every low-temperature
consumer found across the portfolio (CalDesk/Bidstage at 0.6-0.7, Kamiko's
persona chat) keeps caching exactly as before.

crates/relay-semantic-cache: 22/22 unit tests pass, incl. a new
regression test reproducing the Menivor shape (single user message, no
system prompt, two unrelated topics at temperature 0.9) and asserting
both miss the cache and reach the inner layer. cargo check/test clean;
cargo clippy has 2 pre-existing failures in untouched files (setup.rs,
embed.rs), confirmed present on main before this change, not introduced
by it.
2026-11-17 01:20:57 +03:00