Skip to content

About

Portfolio site for kulpinski.tech — Next.js, TypeScript, static. Includes the build-time gate that verifies every published claim against its source.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

kulpinski.tech — Technical Dossier

A high-performance, single-page technical dossier built with Next.js 16.2.2 App Router. Designed to demonstrate architectural depth through the medium of the site itself — the implementation is the portfolio.

Scope note: this repository is a statically rendered site — six prerendered routes, their Open Graph images, and one route handler, /feed.xml, which is declared force-static and so is written to a file at build time rather than run on a server. It contains no API routes and no serverless functions — the only server-side work is React Server Component rendering, Shiki highlighting at build time, and next/og image generation. Earlier revisions of this file described production serverless patterns that are not in this tree; that claim is withdrawn.

Architecture Overview

Rendering Strategy

This project applies a strict React Server Component (RSC) default policy. Every component is a Server Component unless it explicitly requires browser APIs, DOM interaction, or animation.

Component Type Reason
page.tsx RSC Pure layout composition
essays/[slug]/page.tsx RSC generateStaticParams, one per essay
essay-body.tsx RSC Renders an essay from its blocks
essay-card.tsx RSC Static data rendering
layout.tsx RSC Metadata, fonts, JSON-LD
case-study-card.tsx RSC Static data rendering
code-block.tsx Async RSC Shiki server-side highlighting
opengraph-image.tsx Async RSC ImageResponse OG generation
provenance-note.tsx RSC Reads evidence.lock.json
interface-card.tsx RSC Static data rendering
method-note.tsx RSC Static data rendering
telemetry-terminal.tsx RSC Static markup, CSS-staggered
mermaid-diagram.tsx Client mermaid.run() requires DOM
command-menu.tsx Client Keyboard events, useState
fade-in.tsx Client Framer Motion scroll-reveal

Key Architectural Decisions

Zero-JS Syntax Highlighting: CodeBlock uses shiki v4's codeToHtml() inside an async RSC. All syntax highlighting is resolved at build/request time on the server. Zero JavaScript is shipped to the client for this feature.

React Portal for Lightboxes: MermaidDiagram uses createPortal(…, document.body) to render the diagram lightbox outside the parent stacking context. A mounted state guard prevents SSR hydration mismatches.

Isolated Client Boundaries: MermaidDiagramLoader exists as a dedicated client component solely to hold the ssr: false dynamic import, which is not permitted in an RSC file. This keeps CaseStudyCard (the parent) a pure RSC, avoiding unnecessary client bundle inflation.

Memory Safety Protocol: All useEffect hooks using setTimeout collect IDs via useRef and clear them in the cleanup function. This prevents phantom state updates and memory leaks, including under React StrictMode's double-invoke behavior.

Custom Hooks: Shared browser-side logic is abstracted into reusable hooks in src/hooks/:

  • useScrollLock(isOpen) — prevents body scroll while a modal is open
  • useMediaQuery(query) — reactive media query matching, built on useSyncExternalStore
  • useFocusTrap(ref, active) — confines Tab within a dialog. Deliberately does not restore focus: only the caller knows when "open" happened, and autoFocus has already moved activeElement by the time an effect runs

Design System

Tailwind CSS v4 with a strict @theme token system defined in globals.css. All colors and fonts are defined once and referenced semantically. The rule is enforced rather than merely stated: no colour literal appears in any code path under src/, with one declared exception (src/lib/palette.ts). Hex values do appear in comments, recording the contrast measurements that settled a decision — a measurement you cannot reproduce is not worth having written down.

Palette and surface treatment are adopted from the exec-mk8 identity. Committed single-theme — color-scheme: light is declared, not merely painted, so browser chrome does not render dark furniture on a light page.

Color palette

Token Value Role
--color-base #f4efe6 page ground, under a layered radial gradient to #e9dfd0
--color-page-shade #e9dfd0 gradient stop, ::selection
--color-surface #fffbf4 card surfaces
--color-surface-warm #e9dfd0 recessed surfaces, schematic trigger
--color-surface-dark #e9dfd0 the skewed case-study band
--color-inset / --color-inset-deep #2f2923 / #17120e dark band gradient stops (.band-dark)
--color-text #191512 primary ink
--color-muted #756b61 secondary ink
--color-accent #a67642 decorative only — ~3.5:1 on the ground
--color-accent-ink #80572e the text accent — ~5.5:1
--color-detail-on-dark #d8ab65 the only accent legible on dark bands
--color-focus #9b6a2e 3px ring, 4px offset

The two accent roles are deliberately separate and must not be merged; #a67642 fails AA as body-size text on parchment and is confined to borders, rules, focus and large display type.

Retint or frame. Anything whose colour can be changed is retinted to the ground — chrome, Mermaid diagrams. Anything that is deliberately a technical instrument (the terminal, the code block) is framed in a .band-dark inset. The code surface is pinned to the flat deep stop rather than the band gradient: the measurement that settled it was vitesse-dark's keyword green at 5.22:1 on #17120e against 3.93:1 on #2f2923, so the gradient would have regressed syntax contrast below AA.

Typography — three roles: Georgia for display headings (a system face, so no webfont and no silent fallback), Geist for body and UI, Geist_Mono for technical, data and label contexts.

Texture — the identity's linen grain is reproduced with an inline feTurbulence data URI (~0.4 KB, no request) rather than the source's 2.73 MB raster tile. A future CSP must allow img-src … data: or it silently disappears.

Colour literals in TypeScript — permitted in src/lib/palette.ts only. Mermaid resolves themeVariables before the SVG exists, and next/og (Satori) renders in a Node context with no document; neither can read CSS custom properties, so both import from that single module.

Case studies

Each study is four parts in a fixed order — constraint, decision, cost, evidence — and the order is the argument. The previous shape was title / headline / description / badges / metric, which is a brochure: it had nowhere to put a trade-off and nowhere to put a source. A card that can only report wins reports only wins.

decision.ref carries the real identifier from that project's own ledger (DDI-001, ADR-0004, Sprint 6.6), so the text reads as quoted from a record rather than composed for a website. Every figure carries the thing that produces it. Where a study can be checked from outside, it links; where it cannot, it says so.

Verification surface

The page opens on three quotes — one each from an LLM concierge, a data pipeline and a firmware witness — that share no runtime, no language and no deployment target, and one discipline. Below them, three case studies, four shipped interfaces and a method section publish the rest: figures, a SQL excerpt, a replayed run, and the runtime lines.

Every one of them is checked, and the build fails if one stops matching.

npm run verify         # against the sources
npm run verify:write   # ... and refresh evidence.lock.json
npm run build          # prebuild runs the offline gate first

The problem, and the split that solves it

Four of the five source repositories are private and exist on one machine. npm run build has to keep working on a deploy host where none of them do. So the check is two halves, and only one needs the sources:

Structural — runs everywhere, including on the deploy host. Every claim rendered by src/lib/content.ts must be registered in scripts/verify-claims.mjs, every registration must correspond to a claim the page still makes, and every one must be covered by a matching entry in evidence.lock.json. Publish a number without registering it, or edit one without re-verifying, and the build fails before next build starts.

Content — runs only where the sources are. Quotes must be present word for word; extracted figures must equal what the recipe derives. It writes the manifest on an explicit --write and never otherwise: a gate that regenerates its own evidence whenever it happens to be able to is a gate that certifies whatever it finds, and on the author's machine it could never fail.

Because verification and the deploy are separated in time, vercel.json pins the build command to npm run build. If the deploy invoked next build directly, prebuild would never fire and the gate would be decorative.

Three kinds of claim, and the page says which is which

Kind Count What it means
extract 15 A committed recipe derives the value from the source and equality is asserted.
attest 48 A named file must contain given fragments, verbatim after normalisation. Whether they establish the published figure is a human judgement.
live 1 Every outbound URL on the page, fetched. One claim covering all of them, so adding a link cannot skip the check.
stated 3 Nothing to check, and saying so is the only honest option. The bio is one: no repository can verify a career.

For every attest claim the verifier also records whether the published value appears in the matched source as a whole token, or whether the link rests on a reading. The page renders that four-way split from the manifest rather than stating it. Token boundaries matter: a plain substring test scores the figure "2 outputs" as directly sourced because the source says GPIO2.

The test compares a normalised source against an un-normalised published value, so a quotation containing curly quotation marks records as a reading even where it is present word for word. That is the wrong label in the safe direction — it understates the check rather than flattering it — and it is left alone deliberately: correcting it would move existing claims from one published tier to another, which is a change to what the page says about work that has not itself changed.

A claim's must fragments may be a function of the page's own content rather than a literal list. That distinction is load-bearing. When the run verdict's fragments were written out by hand beside the check, editing the page from 73 to 74 left the gate green — the check was comparing the registry's copy of the claim against the source, and the page was not involved. Fragments derived from content.ts cannot drift that way.

Headings, and the gate that keeps them honest

Section headings are nouns, and none carries a count. A count in a heading is a hand-maintained claim, and those drifted once already — withdrawing one system forced heading edits in eight places. The verifier enforces this structurally: a digit or a number-word in SECTION_LABELS fails the build. Titles of works are deliberately exempt, or "The gate caught me four times" could not exist.

The essays

Three, at /essays. Two are findings from the systems above; the third is about this page, and is the only one whose sources a reader can open.

They are data, not MDX, and that is a gate decision rather than a taste one. A quotation the verifier cannot read is a quotation that can drift, so an essay is a list of typed blocks and every quote block is a registered claim checked against the file it came from — ten of them across the three essays.

Writing them surfaced one sharp edge in the normaliser. Markdown emphasis is stripped but // is not, so a quotation lifted from a JavaScript line comment can never match its source. Block comments and prose are fine. The registry comment says so, because the next person to try it will hit the same wall.

Routing is one [slug] route with generateStaticParams and dynamicParams = false, so every essay prerenders and an unknown slug is a static 404 rather than an on-demand render. Each essay carries its own title, description and OG card; without the last of those, sharing an essay would show the home page's name. The sitemap is generated from the same array the routes are.

There is no global header. Each essay links back, and the palette lists them.

Internal links are checked too. The outbound check fetches external URLs; a mistyped /essays/… was previously unchecked and would have shipped as a 404 on a page whose whole claim is that assertions track something real. Literal internal hrefs in src/ are now asserted against the routes that actually build.

The memorial, and the archive that stands in for a repository

/vladimir publishes my father's engineering record: the voltage stabiliser he built for the far end of a low-voltage line, and the fifteen years he spent arguing that a distribution network cannot be trusted to report on itself. He died in August 2019.

It is held to this page's standard rather than to the standard of a eulogy. Every Serbian sentence quoted there is attested against text extracted from his own documents, in a folder that takes a source repository's place — vladimir-archive, keyed like the others, never committed, because it carries letters and names belonging to third parties. The content lives in src/lib/memorial.ts, and verify-claims.mjs appends one claim per quotation rather than listing them by hand, so a sentence cannot reach that page without a registration and a registration cannot outlive the sentence it checks.

Three mechanisms exist only there, and each is a consequence of the material:

A quotation is stored as its parts. Four of his sentences are not contiguous in any file. All four are printed across two columns of the same conference PDF, where text from the neighbouring column — a stray DTS, a line of the English abstract — lands in the middle of the Serbian sentence. So a quotation is an array of the runs in which it actually occurs; the page renders parts.join(" ") and the gate checks each run. The rendered sentence is derived from the checked text rather than stored beside it, which is the drift R-06 hit when fragments were hand-written next to the check.

A quotation is transliterated, not retyped. Two of the 2005 documents are written in the font hack Serbian offices used before Unicode: the bytes on disk read ne}e mo}i where he typed neće moći, and the fonts that once drew them correctly are in the same archive, dated 1991. The gate has to check the bytes; a reader must not be shown them. Storing a decoded copy of the sentence beside the raw one would be exactly the drift parts exists to prevent, so instead the page renders fromYuscii(parts.join(" ")) — the rendered sentence stays derived from the checked one, through a table in src/lib/yuscii.ts read off his own files rather than off a specification. The transform's output is inside the claim digest, so editing that table invalidates the manifest exactly as editing a quotation would; a mutation test confirms it. A structural check hunts for source-encoding bytes surviving into rendered text, which catches both ways this can go wrong: a pre-Unicode source nobody marked, and a table with a hole in it. Its first version hunted for q, w and x too and failed the build on four honest quotations — "WITHOUT", "GWh" — so the check now distinguishes punctuation that can only be this encoding from letters that are letters everywhere else.

Where a public copy exists, it is linked. Every quotation on that page is checked against a file in an archive nobody else holds, which is the weakest thing about it: a reader has to take the gate's word for the check. Four of the quotations come from a paper whose published version sits on the conference's own server, so those four carry a sourceUrl and render it as a link. The URL is defined once in src/lib/memorial.ts and registered in publishedUrls(), so it is fetched by the same live claim as every other outbound link here and a rotted one fails the build. That does not raise the claim's tier in the manifest — the gate still checks the archive copy — but it is the only evidence on the page a reader can open without me, which is worth more than a tier.

A scan is not quoted as if it were text. Four of the documents survive only as images with no text layer — two ministry letters, the minutes of a meeting with the public prosecutor's office, and the provincial secretariat's letter. The one sentence quoted from them is registered stated, because the only thing a transcription of mine could be checked against is a transcription of mine. The scan is published beside it and the caption says so. His street address is blacked out of the last of them; the name and the city are left as written.

The English under each quotation is my translation and is checked by nothing. The page says that where a reader can see it, not in a comment. Translations are inside the claim digest even so: editing one invalidates the manifest, or the unchecked half of that page could be rewritten after the checked half passed.

The method section, and why it quotes one entry

Ten agent lanes run in parallel across one codebase. The failure mode that matters there is not bad code — it is an agent quietly reinterpreting its own success criterion, so a sprint reports green against a bar it moved on the way past.

The section names three artefacts rather than three virtues, and each is counted rather than asserted: 10 worktrees (nine linked plus the main tree, read from .git/worktrees), 8 standing rules (top-level bullets under one heading in AGENTS.md), 19 ledger entries (14 settled decisions and 5 still open, in one append-only file). Every decision.ref on the case studies above is an identifier from one of those ledgers.

Then it quotes DDI-014 verbatim, and that entry is the point of the section. It records an exit criterion being loosened after the data came back — clause 3 went from "zero rejection-class failures" to "no row whose visitor-facing answer was discarded" — and then names who did it and why: "the owner made that call explicitly rather than the agent quietly reinterpreting its own criterion."

A rule that has never cost anything is a preference. The reason this entry is on the page and the eight rules are summarised is that a process claim backed by a rule is worth very little, and a process claim backed by a record of the rule being exercised against the author's own convenience is a different kind of statement. The same entry accepts two failing rows rather than repairing them, and gives its reasoning for each.

Both quotes in the section are checked with fragments read off the page itself, so the published text and the checked text cannot drift into two different things.

The four interfaces, and the link check

Four projects taken 0→1 and deployed: a cycle-aware training app, a real-time trading interface, a landing page, and a member portal. Their repositories are private like everything else here; their deployments are not, which makes them the only work on the page a stranger can operate rather than read about.

They are on this page because they run the same discipline as the systems, not because they are a second skill. The trading interface carries a sequence id and a gap count so it can report the ticks it missed instead of drawing a continuous line through the hole. IronSilk's router resolves every profile failure — missing row, network error, RLS misconfiguration — to the safest landing page rather than the one that loops. That is the property list's "it never looked" and vrata's "attempted to transmit, not received", in a browser.

Each publishes one decision, and the decision has to be findable in the repository that implements it. Where a decision claims something is handled in two places — as KRUG's does, for prefers-reduced-motion in both the script and the stylesheet — the check reads both files. One of them passing is the exact bug the sentence describes.

Every outbound URL is fetched during verification, as a single claim covering all of them, so adding a link cannot skip the check and a 404 fails the build. It runs only where there is a network: the offline gate asserts the manifest recorded a pass and when. A link can rot after that, and the page says so rather than implying the check is continuous.

One entry carries a caveat. Infinity Fitness is nineteen pages, a service worker, role gating and a hand-written bilingual layer — a complete product with real users — and the code underneath is early. The card says that. A page that grades its own work has to be able to say "complete, not exemplary" in the same voice it uses for everything else.

The trace replay

The terminal replays six turns from r22-loopback-run-18b, a qualification run against live staging that DDI-014 names when it closes S4. Every value in the box is copied from that run's loopback-trace.jsonl and the upstream telemetry event paired to it by requestId, and the verifier checks each field against both files. The run's header is checked against its own report, and the date beside it is checked against the ledger entry that accepted it — the artefacts carry four content digests and no timestamp, so that date is when the run was accepted, not when it ran.

The strongest check in the file verifies an absence. Two of the six turns publish 0 provider calls, and for those the verifier asserts that no upstream telemetry event exists — because no model was called, so there is nothing upstream to have recorded. That is the published type providerCallCount: 0 | 1 holding in production, evidenced by two independent files agreeing: across the whole run, 69 turns produced an upstream event and 7 produced none.

The model's replies are deliberately not shown. This is a record of decisions, and the decisions are the part worth publishing; a reply would also carry a second person's name, which is not this site's to publish.

The terminal is a Server Component. The reveal is a CSS animation with a per-row delay rather than a setTimeout schedule, which puts every value in the static HTML instead of after hydration, and makes prefers-reduced-motion actually work — CSS cannot cancel a timer, so the previous implementation animated for visitors who had asked it not to.

What the manifest is, and is not

evidence.lock.json is a receipt, not a proof. It records that on a given date, on a machine that had the sources, each published claim was checked and matched. It cannot show the check was honest — whoever can write the manifest can write a false one. It is the trust model of a signed receipt, not of a proof.

Its job is narrower and worth doing: it makes accidental drift impossible to ship. Every defect found while scoping this was accidental — a figure citing AGENTS.md when the numbers were in CONTEXT.md; a figure counting ten files in a directory and calling them collectors when two were helpers and the project's own handover says nine sources; one test suite published as 536 in one place and 409 in another, both true, different units, neither saying so.

Normalisation, stated so it cannot quietly become permissive

Runs of whitespace collapse to one space; markdown emphasis markers are removed; curly quotes fold to straight. Nothing else. Every word, every mark of punctuation, every dash and backtick must still match. This exists because a plain grep for two of the four quotes returned nothing during scoping — the source text wraps mid-phrase, so the quotes were right and the check was wrong.

The gate was mutation-tested in both directions before being trusted, thirteen cases: an edited figure, a one-word paraphrase, a deleted manifest entry, an unregistered claim, and the sources absent. A gate that has never failed is not known to work.

A source that is absent is reported SKIPPED and exits 1 — never VERIFIED. The script cannot produce a false pass on a machine without the private repositories.

The paths to those repositories live in scripts/evidence.local.json, which is gitignored; the committed script carries repository keys only. Copy scripts/evidence.local.example.json to set it up.

Only one of the four has a public destination. The concierge is live, so its verification is not a file — it is an invitation to go and try to make the system break its own promise. The other three name their source and say plainly that the repository is private. A fabricated link would be worse than no link on a page that argues claims should track evidence, and the layout says so: the verifiable claim takes the full-width lead cell and carries its enforcement code; the three that rest on trust sit below at equal weight.

SEO & Structured Data

  • Person JSON-LD schema injected in layout.tsx using schema-dts types for compile-time validation
  • Dynamic OG image generated via next/og ImageResponse with server-side logo embedding
  • metadataBase configured for correct absolute URL resolution

Security headers

Configured in next.config.ts via async headers(): a Content-Security-Policy, Permissions-Policy, X-Frame-Options: SAMEORIGIN, X-Content-Type-Options: nosniff, Referrer-Policy: origin-when-cross-origin, and X-Powered-By suppressed via poweredByHeader: false. Strict-Transport-Security is supplied by Vercel (max-age=63072000) and is not set here.

What the CSP does, stated precisely. It blocks scripts, styles, images, fonts and fetches from any origin not named in the policy; blocks plugin embedding (object-src 'none'); blocks base-tag injection (base-uri 'self'); stops a form posting to a foreign host (form-action 'self'); and restricts framing (frame-ancestors 'self').

What it does not do: stop injected inline script. script-src carries 'unsafe-inline', and that is a measured decision rather than an oversight:

  • The page renders 165 elements with a style attribute — 90 from Mermaid's SVG output, 41 from Shiki's inline token colours, the rest Framer Motion transforms. A nonce does not apply to a style attribute, so style-src cannot avoid 'unsafe-inline' on this stack regardless of what script-src does.
  • A nonce-based script-src requires middleware.ts, which forces dynamic rendering. This page prerenders fully static, and the surface a nonce protects does not exist here: no user input, no forms, no rendered query parameters, no user-generated content.

A stricter policy is possible the moment this site accepts input. Until then, calling this configuration hardened beyond what it is would be the kind of claim the rest of this document is written to avoid.

Tech Stack

Layer Technology
Framework Next.js 16.2.2 (App Router)
Language TypeScript 5 (strict mode)
Styling Tailwind CSS v4
Animation Framer Motion 12
Diagrams Mermaid 11
Syntax Highlighting Shiki 4
Command Palette cmdk 1
Icons Lucide React
Structured Data schema-dts 2
Analytics Umami Cloud (cloud.umami.is)

Development

npm install
npm run dev

Open http://localhost:3000.

Build & Type Check

npm run build       # Production build — prebuild runs the offline claim gate first
npx tsc --noEmit    # Type check without emit
npm run lint        # ESLint (Next.js core web vitals + TypeScript rules)
npm run verify      # Every claim against its source; needs the private repositories

Deployment

Deployed on Vercel. The metadataBase in layout.tsx is set to https://kulpinski.tech, and vercel.json pins the build command to npm run build so the claim gate runs there too.

About

Portfolio site for kulpinski.tech — Next.js, TypeScript, static. Includes the build-time gate that verifies every published claim against its source.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages