|
| 1 | +--- |
| 2 | +date_created: 2026-08-08 |
| 3 | +date_modified: 2026-08-08 |
| 4 | +title: "augment-it v3.2.0.0 — the refactor release: 466 lines lighter, a design system that can be seen, and a build that runs" |
| 5 | +lede: "Six days, 133 files, and the first refactor this codebase has ever had. Seventeen micro-frontend mount files became one, the design system stopped being arithmetic and became a page you can look at, and `pnpm build` works for the first time in the repo's history." |
| 6 | +publish: true |
| 7 | +authors: |
| 8 | + - Michael Staton |
| 9 | + - Steven Blake Casio |
| 10 | +augmented_with: |
| 11 | + - Claude Code on Claude Opus 5 |
| 12 | +release_version: "3.2.0.0" |
| 13 | +previous_version: "3.1.0.2" |
| 14 | +files_changed: |
| 15 | + - packages/federation/src/index.ts |
| 16 | + - packages/theme/theme.css |
| 17 | + - packages/theme/token-baseline.css |
| 18 | + - apps/docs-portal/src/App.svelte |
| 19 | + - scripts/design-drift.mjs |
| 20 | + - scripts/generate-token-baseline.mjs |
| 21 | + - services/record-surrealdb-resolver/src/nats-loop.ts |
| 22 | + - shell/src/DevelopersMenu.svelte |
| 23 | + - tsconfig.base.json |
| 24 | + - design-manifest.json |
| 25 | +tags: |
| 26 | + - Release |
| 27 | + - Augment-It |
| 28 | + - Refactor |
| 29 | + - Design-System |
| 30 | + - Module-Federation |
| 31 | + - Resilience |
| 32 | +--- |
| 33 | + |
| 34 | +# augment-it v3.2.0.0 — the refactor release |
| 35 | + |
| 36 | +- [Why Care?](#why-care) |
| 37 | +- [What's New?](#whats-new) |
| 38 | +- [How it works](#how-it-works) |
| 39 | +- [Under the hood](#under-the-hood) |
| 40 | +- [Upgrade notes](#upgrade-notes) |
| 41 | +- [The story behind this release](#the-story-behind-this-release) |
| 42 | +- [Thanks](#thanks) |
| 43 | + |
| 44 | +## Why Care? |
| 45 | + |
| 46 | +augment-it got built the way real products get built: seventeen micro-frontends and eleven services, one at a time, each correct on its own, none of them looking sideways at the last. That is the right way to move fast, and it accrues a specific kind of debt — not bugs, but **repetition with no home**. |
| 47 | + |
| 48 | +This release is the first time we stopped and paid some of it down. Not by guessing where the mess was, but by building a map of the codebase and then checking every candidate it surfaced against the actual files. |
| 49 | + |
| 50 | +The headline is that **466 lines net went away** while the app gained a design system, a resilience fix, and a root build command that runs. The more useful outcome is that we now know which of our assumptions about this codebase were wrong. |
| 51 | + |
| 52 | +## What's New? |
| 53 | + |
| 54 | +### Highlights |
| 55 | + |
| 56 | +- **The design system is real and visible** — 35 tokens, three modes, and a page that renders every one of them on every surface with live measured contrast. One click from the shell header, signed in or not. |
| 57 | +- **Seventeen mount files became one.** Eleven of them differed by exactly one line. |
| 58 | +- **`pnpm build` works** for the first time in this repository's history. |
| 59 | +- **A whole request channel can no longer be killed by one bad message** — the bug that made a client's research corpora appear to vanish. |
| 60 | +- **Design tokens now have a floor**, so a micro-frontend deployed ahead of the shell degrades to something legible instead of rendering invisible text. |
| 61 | + |
| 62 | +### Added |
| 63 | + |
| 64 | +- `@augment-it/federation` — the one copy of the mount glue every remote used to keep its own version of. |
| 65 | +- `apps/docs-portal` — the design system viewer, on `:3020` standalone and mounted in the shell as a federated remote. |
| 66 | +- A **Developers menu** in the shell header: the design system, which services this build points at, and one click to copy the full environment for a bug report. |
| 67 | +- `design-manifest.json` and `packages/theme/token-baseline.css` — both generated from the stylesheet, with `pnpm tokens:check` to fail CI if they drift. |
| 68 | +- `scripts/design-drift.mjs` — the enforcement engine that turns eleven design rules from prose into checks. |
| 69 | +- Regression tests for three failure modes the existing suite structurally could not reach. |
| 70 | + |
| 71 | +### Changed |
| 72 | + |
| 73 | +- The shell is the canonical injector of design tokens; members carry a floor rather than a copy of the theme. |
| 74 | +- App TypeScript configs converge on one shared base — three drifted variants became one, 20 lines to 4 per app. |
| 75 | +- The design system renders **outside the sign-in wall**. Brand guidelines are not client data. |
| 76 | + |
| 77 | +### Fixed |
| 78 | + |
| 79 | +- **`domain.list: timeout`** — one unanswerable message could take a NATS subject down for the lifetime of the process, silently, with nothing in the logs. |
| 80 | +- **The shell's typecheck had never passed.** A missing CSS shim, compounded by a config that would have ignored the shim anyway. |
| 81 | +- **The drift checker was blind.** A greedy regex meant every per-file design check inspected nothing and passed. Real failure count: 98, not 18. |
| 82 | +- Five accessibility fixes from Phase 1, including a light-mode focus ring that was invisible. |
| 83 | +- The one import cycle in the codebase. |
| 84 | + |
| 85 | +### Removed |
| 86 | + |
| 87 | +- **Turbo.** Not a dependency, never installed, and orchestrating a task graph with zero edges. |
| 88 | +- **React.** One config line, in a codebase where React is prohibited, with no `.tsx` files and no `react` dependency. |
| 89 | +- ~250 lines of verified dead code. |
| 90 | + |
| 91 | +## How it works |
| 92 | + |
| 93 | +### Sharing code without losing autonomy |
| 94 | + |
| 95 | +The instinct that sharing code costs a micro-frontend its independence is sound, and in this architecture it happens to be wrong — for a specific, checkable reason. The federation host declares no `shared` block, so a workspace import is **inlined into each remote's own bundle at build time**. |
| 96 | + |
| 97 | +> **Build-time import *is* the copy.** One source of truth in the repo, seventeen independent artifacts. |
| 98 | +
|
| 99 | +Every remote still boots with every other remote down. We verified it rather than asserted it: one app's built stylesheet is **byte-identical** before and after the change, same content hash. |
| 100 | + |
| 101 | +The real cost is not runtime coupling, it is **redeploy fan-out** — which yields the rule we now package by: split shared packages by *change frequency*, not by topic. |
| 102 | + |
| 103 | +### The token floor |
| 104 | + |
| 105 | +A micro-frontend deployed against a token the deployed shell does not have yet used to resolve to **nothing** — text inherits, backgrounds go transparent. Invisible locally, because your machine always has the latest theme. |
| 106 | + |
| 107 | +Every token is now registered with an initial value, so the worst case is a legible dark surface. Measured in a browser, three ways: |
| 108 | + |
| 109 | +``` |
| 110 | +healthy (shell + member) tokens resolve to the shell's values, all modes distinct |
| 111 | +degraded (member alone) #e8eaf0 on #13151b — 15.17:1 contrast |
| 112 | +counterfactual (no floor) rgb(0,0,0) on transparent ← the bug, reproduced |
| 113 | +``` |
| 114 | + |
| 115 | +The third line is why we trust the second. |
| 116 | + |
| 117 | +## Under the hood |
| 118 | + |
| 119 | +### What the map got wrong, and what it got right |
| 120 | + |
| 121 | +We built a knowledge graph over 490 source files — 4,330 nodes, 6,011 edges, for zero tokens, because code parses structurally. It pointed at the right places. It was not always right about them. |
| 122 | + |
| 123 | +**It was right** that eleven of seventeen mount files differed by one line, that ~250 lines were unreachable, and that there was exactly one import cycle. |
| 124 | + |
| 125 | +**It was wrong**, or at least incomplete, about two things worth remembering. Two components looked dead and were not — they are imported through package subpath exports that static analysis cannot follow. And it reported three functions sharing a name when there were five: god-node rankings show the top of a distribution, not a census. |
| 126 | + |
| 127 | +Everything deleted in this release was confirmed by hand afterwards. |
| 128 | + |
| 129 | +### The assumption that turned out to be backwards |
| 130 | + |
| 131 | +We expected the frontend to be full of copy-pasted CSS waiting to be deduplicated. Of **1,392 distinct selectors** across 5,434 lines, **1,386 are unique to a single app**. The six shared ones are keyframe stops and media queries. |
| 132 | + |
| 133 | +There is almost nothing to deduplicate. There are seventeen independently invented vocabularies that have never had to agree. That reframes the component library from consolidation into **greenfield extraction plus migration** — better to know before starting than after. |
| 134 | + |
| 135 | +### Checkers that weren't checking |
| 136 | + |
| 137 | +Two instruments in this release reported success because they failed to look, and both were caught only by someone asking "that number seems wrong." |
| 138 | + |
| 139 | +The design drift checker parsed its member list with a greedy regex, captured a trailing comma into every path, and so inspected zero files across all nineteen members. Its only visible symptom was a failure that looked like known outstanding work. |
| 140 | + |
| 141 | +The design system viewer, on first render, measured every colour mid-transition and reported the dark background as light grey. |
| 142 | + |
| 143 | +Neither was catchable by a build or a typecheck. Both were caught by rendering the thing and looking at it. |
| 144 | + |
| 145 | +## Upgrade notes |
| 146 | + |
| 147 | +**Root build command changed.** `turbo.json` is gone; root scripts use pnpm's own recursive runner. Nothing downstream breaks — every Dockerfile already bypassed turbo with direct `pnpm --filter` calls. |
| 148 | + |
| 149 | +```diff |
| 150 | +- "build": "turbo run build" # turbo was never installed; this always failed |
| 151 | ++ "build": "pnpm -r build" |
| 152 | +``` |
| 153 | + |
| 154 | +**New deploy variables** for the design system portal, both falling back to localhost until it has a hosted home: |
| 155 | + |
| 156 | +``` |
| 157 | +PUBLIC_DESIGN_SYSTEM_REMOTE # federated remoteEntry.js the shell mounts |
| 158 | +PUBLIC_DESIGN_PORTAL_URL # standalone page |
| 159 | +``` |
| 160 | + |
| 161 | +**If you have a dev server running**, restart it. Adding a workspace dependency does not reach a live rsbuild process, which holds its module-resolution graph from startup and will report `Can't resolve '@augment-it/federation'` until restarted. |
| 162 | + |
| 163 | +**Regenerate after touching the theme.** `packages/theme/theme.css` is now the source for two generated artifacts: |
| 164 | + |
| 165 | +```bash |
| 166 | +pnpm tokens:baseline # regenerate |
| 167 | +pnpm tokens:check # CI: fail if stale |
| 168 | +``` |
| 169 | + |
| 170 | +## The story behind this release |
| 171 | + |
| 172 | +This release started as a request to understand a codebase before refactoring it, and most of what it produced was corrections to things we believed. |
| 173 | + |
| 174 | +We believed the frontend was full of duplicate CSS. It has no duplicate CSS and a much harder problem. We believed the design system was blocked on a decision. It was blocked on a laptop. We believed drift was down to 18 findings; it was 98 and the checker was broken. We believed a client's corpora had failed to load; they had never been anything other than fine. |
| 175 | + |
| 176 | +The pattern across all of them: **every wrong belief was one someone could have held indefinitely without contradiction.** The corpora looked missing. The checker looked clean. The build looked like it worked because nobody ran the root command. Each was only dislodged by measuring the specific thing rather than the thing next to it. |
| 177 | + |
| 178 | +The other pattern, less comfortable: nearly everything completed in this release was verifiable mechanically. Builds, typechecks, tests, contrast ratios. The work that remains — a component library, an improved UI — needs someone to look at the product and have an opinion. That is not a coincidence, and no amount of tooling closes it. |
| 179 | + |
| 180 | +Which is the real reason the swatch page matters more than its size suggests. It is not much of a page. It is the first surface on which anyone can have an opinion about this design system, and until it existed there was nothing to have an opinion about. |
| 181 | + |
| 182 | +## Thanks |
| 183 | + |
| 184 | +**Steven Blake Casio** built Phase 0 and Phase 1 of the federated design system — the enforcement script, the colour tier, the contrast work that took light mode from 103 to 108 passing pairs, and the accessibility fixes that came with it. His handoff document is also the reason three of this release's findings were legible as findings rather than noise: it named the failure modes to watch for, including the one that caught his own checker. |
0 commit comments