Files
riotpiao.com/app/api/ci-status/route.ts
T
rockandpoimen 4640935993
CI / CI (push) Successful in 5m52s
feat: recruiter-scannable cards + Poimen Memory deep dive page (#14)
## Summary

   Rewrite all portfolio cards for 6-second HR scannability and add a dedicated Poimen Memory deep dive page.

   ## Changes

   ### Timeline Cards (all 6 rewritten)
   - **Poimen (Ποιμήν)** — NEW card. Graph-RAG memory + Temporal workflow pillars
   - **riotpiao.com** — 5 sections: Infrastructure, GitOps, Security, Observability, AI/ML
   - **RBC** — State migration (500+ files, zero corruption), drift detection (3wk → <24hr), 3× velocity
   - **AWS** — Distributed-Map ownership (57+ regions, sub-100ms P99), Redrive Execution launch
   - **Titus** — 97.8% accuracy, 28% P99 improvement, 5× deployment speed
   - **NAV Canada** — ATC weather briefing (ReactJS), Django, SonarQube

   ### Project Cards
   - Reorder: **Poimen Orchestration → Memory → Homelab** → RBC → AWS
   - Homelab: production-grade framing, "Explore the Architecture →"
   - Poimen: etymology intro ("shepherd"), connected narrative across cards
   - All cards use `dangerouslySetInnerHTML` for **bold** framework names

   ### Poimen Memory Page (`/poimen/memory`)
   - Hero: "Teaching the Shepherd to Remember"
   - 🏗️ Architecture diagram — Rust microservice, actix-web, Authentik JWT, pgvector
   - 🔄 Dataflow diagram — episode → entity/fact extraction → temporal graph
   -  Sequence diagram — async ingest lifecycle (202 accepted, background LLM pipeline)
   - Three-tier retrieval cards: signature match (50ms), graph-boosted hybrid, Obsidian fallback
   - Technology stack grid (Rust, pgvector, Ollama, TEI, Authentik, K8s)

   ### CI & Build Fixes
   - API allowlist updated for `riotpiao-poimen/` org repos
   - Commit SHA: `NEXT_PUBLIC_COMMIT_SHA` in Dockerfile + `--build-arg` in CI workflow
   - ExperienceTimeline CI badges wired for Poimen + Homelab repos

   ## Files Changed
   - `lib/translations.json` — all card content (EN + ZH)
   - `app/page.tsx` — project order, deepDive links, ciRepos mapping
   - `app/poimen/memory/page.tsx` — NEW deep dive page
   - `components/ExperienceTimeline.tsx` — Poimen card, HTML rendering, CI badges
   - `app/api/ci-status/route.ts` — allowlist for riotpiao-poimen org
   - `Dockerfile` + `.gitea/workflows/build-push.yml` — SHA fix
   - `public/poimen-memory/` — 3 archify diagrams (architecture, dataflow, sequence)

---------

Co-authored-by:  poimen <[email protected]>
Reviewed-on: #14
2026-09-09 23:29:14 +00:00

72 lines
1.9 KiB
TypeScript

import { NextRequest, NextResponse } from 'next/server'
const FORGEJO_URL = 'https://forgejo.riotpiao.com'
const DEFAULT_REPO = 'rock/riotpiao.com'
const ALLOWED_REPOS = [
'rock/riotpiao.com',
'riotpiao-poimen/homelab',
'riotpiao-poimen/homelab-frontend',
'riotpiao-poimen/poimen',
'riotpiao-poimen/poimen-memory',
'riotpiao-poimen/poimen-workflows',
'riotpiao-poimen/kmsvc-manage',
]
export async function GET(request: NextRequest) {
const repo = request.nextUrl.searchParams.get('repo') || DEFAULT_REPO
if (!ALLOWED_REPOS.includes(repo)) {
return NextResponse.json({ error: 'Repo not allowed' }, { status: 403 })
}
const token = process.env.FORGEJO_TOKEN
if (!token) {
return NextResponse.json(
{ error: 'FORGEJO_TOKEN not configured' },
{ status: 500 }
)
}
try {
const response = await fetch(
`${FORGEJO_URL}/api/v1/repos/${repo}/actions/runs?limit=1`,
{
headers: {
Authorization: `token ${token}`,
Accept: 'application/json',
},
cache: 'no-store',
}
)
if (!response.ok) {
throw new Error(`Forgejo API error: ${response.status}`)
}
const data = await response.json()
const latestRun = data.workflow_runs?.[0]
if (!latestRun) {
return NextResponse.json({
status: 'unknown',
message: 'No runs found',
})
}
return NextResponse.json({
status: latestRun.status,
conclusion: latestRun.conclusion,
sha: latestRun.head_sha,
title: latestRun.display_title || latestRun.head_branch,
branch: latestRun.head_branch,
url: latestRun.html_url,
updatedAt: latestRun.completed_at || latestRun.started_at,
})
} catch (error) {
console.error('CI status fetch error:', error)
return NextResponse.json(
{ error: 'Failed to fetch CI status', status: 'error' },
{ status: 500 }
)
}
}