mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 07:59:11 +01:00
feat/parallel-implement
12
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
95c40a9cd8 |
refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now share one name. 638 files, ~3,000 mentions: UI copy, config, env keys (FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs, articles, the deploy workflow other repos reuse, and nine file names. - Three article slugs carried the old name and had been shared; permanent redirects keep those links alive (next.config.ts). - test-no-retired-name.sh now also forbids the old product name across the whole repo, so the rename cannot creep back through templates and examples. - ASSISTANT_STACK collapses the product and the assistant into one entry, because they are now the same name. Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki` database and role, loki.orangecat.ch (old host 308s to it; /api, /widget, /embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases. The Resend sending domain stays fleetcrown.orangecat.ch until the new domain is verified in DNS. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
3aca20d9a5 |
feat(site-template): a site ships the moment its CI proves main green (#635)
After the sweep auto-merges an agent's PR on a site, nothing starts Deploy: the merge uses GITHUB_TOKEN (no push event) and the CI it re-arms is itself a dispatch, whose workflow_run GitHub suppresses. kaffeeklappe-sep11 sat an hour on 2026-09-11 with the change merged, CI green, and the box serving the previous release; the sweep's reconciler is the safety net, up to ten minutes late and, when its cron does not fire, not at all. ci.yml gets the ship job bitbaum/fleetcrown's own ci.yml has: on a workflow_dispatch run of CI on main, dispatch deploy.yml. A dispatch is not a push, so it is exempt from the no-cascade rule. Only for workflow_dispatch — a real push chains through workflow_run by itself. Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
53033203ae |
fix(site-template): CI defaults .nvmrc when a site has none; register refreshes stale sidecars (#629)
* fix(site-template): CI defaults .nvmrc when a site has none; register refreshes stale sidecars Sites scaffolded before the starter shipped .nvmrc have none, and actions/setup-node fails on a missing version file — the first seeded CI run on kaffeeklappe-sep11 (PR #3, 2026-09-11) failed there. ci.yml now writes a default .nvmrc (22) when the repo has none; a committed one wins. register-site.sh also refreshes ci.yml/auto-merge.yml on the remote when the site-template's content has moved on, so an existing site does not keep last week's CI forever. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * style(site-template): prettier formatting for the .nvmrc default step Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
2d539019fb |
feat(cold-start): a new site merges its own green PRs, and the loop needs no human click (#612)
The last two manual steps on brief → repo → live site → feedback → live change were the operator merging the agent's PRs on a site repo that had no CI and no auto-merge. Now: - scripts/site-template ships auto-merge.yml (the fleet sweep, no PAT required) beside ci.yml; ci.yml tolerates a starter without a lint script. - register-site.sh seeds ci.yml and auto-merge.yml from site-template with the deploy shim, through the host's gh login when the caller's token may not write workflows, and announces when they are not on the remote. - The feedback Implement prompt counts a green PR handed to auto-merge as shipped: agents were honestly writing status: working because they may not merge, so the run never closed and the inbox read "Working now" until the reaper stamped it partial an hour later. - The starter carries app/icon.svg (no favicon 404) and .nvmrc (ci.yml's setup-node reads it). - Add lands on the new project page; the Projects list also sorts a project created within a day first. The list folded a just-added project below 25 rows. - register-site.sh compares durable and main registers by slug, so plan/price edits on main no longer keep the durable checkout from fast-forwarding. - test-site-template.sh: a here-string was attached to the wrong command and the test hung on any open stdin. Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
71762e4649 |
fix(cold-start): register lands deploy.yml; scaffold installs/builds/serves (#585)
* fix(register): a site registered from the box gets its shim, its port, and its builder Walked the cold start on production after #569 (velokiosk-sep10). The repo was seeded; then four defects on the register-and-run path: - The OAuth grant had no workflow scope, so GitHub refused to write .github/workflows/deploy.yml and register-site.sh carried on saying the remote may already have it. The grant now requests workflow; the script falls back to the host's own gh login for the shim and fails when the file is not on the remote. - box() named no SSH identity; ubuntu's only key is the CI deploy key, so the box refused itself. box() passes DEPLOY_KEY_PATH when readable. - The durable register was behind main and handed out a port main had already given away. Ports and conflicts are read from both registers, the durable checkout is fast-forwarded when all its rows are on main, and every new row goes to main as a PR. - A dirPath under the box clone root was routed to the operator's laptop because it was present; that runner cannot clone on demand and reported "inject did not stick". projectChannelLock returns cloud for box-rooted workspaces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(scaffold): a new site that actually installs, builds and serves Diplodoctor was scaffolded on 2026-09-10, provisioned completely — repo, systemd unit, Caddy vhost, register entry — and served 502. Its session diagnosed it and fixed it IN THE DIPLODOCTOR REPOSITORY. The template was left exactly as it was, so the next site would have rediscovered the same three faults from scratch. This is that fix moved to where it belongs. The template was never internally consistent about its package manager. It shipped no lockfile at all, yet its CI ran `npm ci`, which REQUIRES package-lock.json — so a freshly scaffolded site's CI could not pass on its first commit, or any commit. Meanwhile the box deploys with `pnpm run build`. Two managers, one repo, and the half that ran in production was not the half CI described. Everything here converges on pnpm, which is what actually ships. pnpm-workspace.yaml NEW. `allowBuilds: sharp, unrs-resolver`. pnpm 11 refuses to run a dependency's build script unless it is approved and EXITS NON-ZERO when one is not, so without this a fresh clone cannot install and the deploy dies before the build. It must not go in package.json's `pnpm` field: pnpm 11 no longer reads that field and ignores it with a warning, which makes the setting look present while doing nothing. .nvmrc 20 -> 22. pnpm 11 imports node:sqlite, absent before Node 22.13. Harmless while CI used npm; fatal the moment it uses pnpm. ci.yml npm -> pnpm throughout, and the Next cache key now hashes pnpm-lock.yaml instead of package-lock.json — a file that never existed here, and hashFiles() returns an empty string for a missing path, so the key was constant and the cache could never invalidate. package.json `verify` uses pnpm; `packageManager` pins pnpm@11.25.0 so a stray `npm i` cannot mint a second lockfile. Two things this also fixes that were not in diplodoctor's repair. **The scaffold now resolves a lockfile into the first commit.** Without one the repository is born unbuildable in two places at once: CI's `pnpm install --frozen-lockfile` refuses to invent a lockfile, and the box resolves versions afresh on every release, so the site that was verified is not the site that ships. `--lockfile-only` keeps this to a few seconds and unpacks no node_modules. **next 16.2.4 -> 16.3.4.** The template was minting every new site with a CRITICAL unauthenticated RCE — GHSA-2xp9-vwfh-vxw4, the Next image-optimization hole, patched at >=16.3.3. orangecat was patched for this today; the scaffold would have kept issuing fresh vulnerable sites afterwards. **And the port race, which nearly shipped an hour ago.** Ports are allocated from `apps.conf` in a LOCAL checkout, and this studio runs five to ten agent sessions at once, each in its own worktree. A stale copy reports a stale highest port. A dry run in one such checkout offered 4024 for a new site while origin already had diplodoctor on 4024 and heidi on 4025 — two sites, one port, caught by hand one command before it would have shipped. The script now fetches and REFUSES when its register differs from origin/main, naming the pull that fixes it, rather than guessing a number another session already took. Verified: `bash -n` clean; a dry run against an up-to-date register allocates 4026 and the staleness guard passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY * chore(register): causius on 4026 — the first site the fixed scaffold built causius.orangecat.ch is live: systemd active, HTTP 200, its own certificate, on the first deploy. Diplodoctor needed two follow-up pull requests to reach that same state yesterday; this one needed none, because the template was repaired before it was used rather than after. Registered as `product` / `validating` — ours, and not yet claiming to be a live client engagement, so the client-ledger gate is satisfied without inventing terms for something that has no customer. Port 4026 came from a register that the new staleness guard had just verified against origin. The stale local copy this was first attempted from offered 4024, which diplodoctor already holds. Deliberately NOT bought: causius.com and causius.ch are unregistered and stay that way for now, by George's call. The site therefore lives at its free orangecat.ch address, which is exactly the ladder /domains sells — start free, move to your own domain later, keep every link alive. Dogfooding it means the first customer of that offer is us. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY * fix(scaffold): site-template CI floor test expects pnpm The scaffold now installs with `pnpm install --frozen-lockfile` (#583 onto main). The floor test still demanded `npm ci`, so verify would fail every run after the template switch even though the template itself is correct. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
40f80e5118 |
fix(cold-start): idempotent register + cross-owner deploy secrets (#554)
Register site must succeed when apps.conf already has the slug (compatible repo path): re-ensure deploy.yml, secret, and sync-infra, print live URL, and let registerProjectSiteCd write liveUrl — do not refuse as already exists. Prefer the /opt release copy of register-site.sh so a stale durable checkout cannot keep refusing after Deploy. Pass HETZNER_SSH_PRIVATE_KEY explicitly in deploy shims; secrets: inherit fails for catomean/* → bitbaum/fleetcrown and left dogfood Deploy dead on arrival. Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
f0ee08c40a |
fix(scaffold): the template every new site is built from was building cold (#532)
scripts/site-template/.github/workflows/ci.yml is the THIRD copy of the golden CI floor. The other two live in fleet/templates/ci/ (ci-npm.yml, ci-pnpm.yml). On 2026-09-07 a fleet sweep measured 14 of 32 repos recompiling Next from scratch on every CI run, fixed all 14, and added the .next/cache step to both fleet templates so new repos would start warm. It missed this one — which is the copy the scaffold ACTUALLY uses. Every site created from new-site.sh in between started cold by construction, and the fix meant to prevent exactly that landed in two files nobody scaffolds from. Fixing it a third time is not the point. scripts/hetzner/test-site-template.sh asserts the floor the scaffold must emit: restores .next/cache via actions/cache keyed on the lockfile, installs with `npm ci`, type-checks, lints, builds, runs on pull_request and not only push, and declares a concurrency group. Wired into `test:ops`. Mutation-proven against the real defect rather than a synthetic one: the cache step was removed to reproduce the pre-fix template exactly, three assertions fired and named what was missing, and the step was restored. The test also checks its own cache predicate against a fixture with no cache, because a checker whose patterns stopped matching passes exactly as quietly as a correct template. It deliberately does NOT strip comments. This file's comments name the very constructs it checks for, so a comment-blind scan would pass on a template whose only mention of .next/cache is prose explaining its absence. Each check looks for the active YAML construct — `path: .next/cache`, `uses: actions/cache@` — not the bare word. Note where this sits relative to fleet's cicd-hygiene-audit.sh: that ratchet measures repos that already exist, so a template defect reaches it once per repo, forever, and only after each repo is created. A template is upstream of the ratchet; this is the upstream half. Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
caa0e41c3b |
chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes singleQuote=false was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * style: format with prettier (1062 files) Mechanical. No behaviour change. This SHA is listed in .git-blame-ignore-revs so `git blame` skips it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore: teach git blame to skip the reformat Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(lint): reattach two guards the reformat detached Both effects were one-liners, so a trailing eslint-disable-line covered the setState call: useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ... prettier expanded the block. The comment stayed on the closing line while the call moved above it, so the guard protected nothing and the rule its author had deliberately silenced failed the build. This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line variant. Both come from the same fact: an eslint directive binds to a line number, so reformatting can silently unbind it, which makes 'mechanical, no behaviour change' false for any bulk reformat. * chore(desktop): bump the runner version the reformat requires desktop-release-drift enforces that anything built into Fleet Runner which differs from the last released tag must carry a version ahead of that tag — main read 0.8.15 and fleet-runner-v0.8.15 already shipped. A whole-repo reformat changes bytes under desktop/, so the gate fires. The alternative was adding desktop/ to .prettierignore, which would buy a quiet PR by carving a permanent hole in the formatter's coverage — the precise shape of silent drift this test was written to catch. Bumping is what the rule asks for and costs one patch release whose only content is whitespace. * chore: merge main and re-format A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR runs no checks at all while reporting nothing. Conflicts resolved to main, which is correct because this branch changes formatting and nothing else. * chore: leave desktop/ out of this reformat desktop-release-drift is right to refuse this. Everything under desktop/ is built into Fleet Runner, so changing it means shipping: bump the version AND add a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed Fleet Runner and wants to know what changed'. For a whitespace-only build the honest answer is 'nothing', so that release should not exist — and I should not write release notes claiming otherwise. I had bumped to 0.8.16 to get the gate green. That was the wrong direction: publishing a build to three OS runners to keep a formatting PR quiet. Reverted. desktop/ is excluded in .prettierignore with the reasoning recorded there, to be formatted alongside the next real runner change, where the bump and the notes are true anyway. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
4d1c9f1fe7 |
chore: migrate the fleet to the bitbaum org (#415)
* chore(ci): GitHub owner catomean -> bitbaum * docs(hetzner): update _box-env.sh comments for the completed org migration The GH_OWNER/WORKFLOW_OWNER comments described a future state (repos moving to bitbaum while fleetcrown stayed personal) that sweep-gh-owner.sh just made true, then obsolete: fleetcrown itself is in bitbaum now too. Comments describing a plan that already happened are worse than no comment — they send the next reader looking for a divergence that isn't there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN * chore(desktop): release 0.8.15 — the org-migration owner literals Same shape as 0.8.14: desktop/ carries two literal owner references (issue link, updater feed owner) that a fleet-wide rename touches, and desktop-release-drift.ts correctly refuses to let that ship without a version bump — a repo whose desktop app silently points at a dead update feed is worse than one that fails the gate. This should be the last time it's an account name: the org is the stable home from here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN --------- Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
45938e60cf |
fix(ci): unbreak the gates — dependency graph, agent-core drift, desktop release (#400)
* refactor(infra): studio constants get one home, and the rename gets a command Fair criticism: I spent the day arguing for SSOT and then wrote new-site.sh with its own copies of GH_OWNER, BASE_DOMAIN and DEV_ROOT, and hardcoded 'maonakamoto' again in provision-widget.ts. Worse, the pattern already existed — _box-env.sh is literally labelled 'SSOT' for the box address. I did not extend it, I duplicated around it. _box-env.sh now owns GH_OWNER, SITES_BASE_DOMAIN and DEV_ROOT alongside the box address, and new-site.sh and provision-widget.ts read them instead of carrying their own. The 41 workflow files are a different case and worth being precise about: GitHub Actions requires a LITERAL owner/repo in and will not accept a variable, so that duplication cannot be removed. But a duplication you cannot remove is one you have to OWN — leaving it as 'remember to edit 41 files' is exactly the shape of step that gets skipped, the same shape as the git repository Camille never got. So sweep-gh-owner.sh is committed: one command, dry-runnable, optionally self-committing. Dry run against the fleet: 24 repos, all detected correctly. Renaming to an org is now plus one line in _box-env.sh. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(infra): split WORKFLOW_OWNER from GH_OWNER before they diverge Same bug as the last commit, one layer down. The site template hardcoded maonakamoto/fleetcrown in its deploy.yml uses: line, derived from nothing — so every new site would bake in a literal that follows neither an account rename nor a move to an org. And GH_OWNER was quietly doing two jobs: where new site repos are CREATED, and where fleetcrown LIVES. They look identical today and are about to diverge — sites go to an org while fleetcrown stays on the personal account. One name for two values is how a rename half-works. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore(ci): GitHub owner maonakamoto -> catomean * chore(infra): owner is catomean Account renamed maonakamoto -> catomean. sweep-gh-owner.sh swept 24 repos and the SSOT now agrees; 32 local remotes repointed. This is the commit the sweep script exists for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore(ci): GitHub owner maonakamoto -> catomean * chore(ci): GitHub owner maonakamoto -> catomean * fix(desktop): cut 0.8.14 — the owner rename touched desktop code My owner sweep changed two files in desktop/ (an update URL and a package reference) without bumping the version. That is precisely the failure #370 existed to prevent: desktop code that changes without a release ships to the server and to no machine at all, silently. The gate caught it, four commits after it was written. Working as intended, and worth saying plainly — I was the one it caught. GitHub redirects repository URLs after a rename, but only until somebody claims the freed name. An auto-updater should not depend on a redirect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(ci): the gate fails on your diff, not on your laptop Three things in this hook blocked pushes for reasons unrelated to the change being pushed, and together they are why --no-verify became reflex here. I passed it eight times in one day and blamed the hook; the hook was reporting real problems with misleading attribution. 1. STALE INSTALL. An unresolvable dependency surfaced as 'Cannot find module' — indistinguishable from a type error in your code. Now a precondition that fails first, loudly, naming npm ci. A day was spent on this exact confusion. 2. AGENT-CORE DRIFT. Drift arises either because you changed canonical without syncing, or because somebody changed the mirror in the other repo. Only the first is yours. It now checks whether this branch touched src/lib/agent/core/ and warns instead of blocking when it did not. 3. SCHEMA DRIFT. The guard already skipped an unreachable database but not a reachable stale one, so a local scratch DB missing someone else's columns blocked pushes touching no schema. Now scoped: if the branch changes schema a mismatch is yours and blocks; otherwise it reports and continues. The pattern is taken from desktop-release-drift, which self-scopes to files changed since the last release and is the only check here that has never blocked an unrelated push. It caught me correctly today, four commits after it was written. Where scope cannot be established the checks still fail closed — a gate that cannot establish innocence should not grant it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(ci): resolve the default branch, never assume main The diff-scoping added in the previous commit compares against origin/main. 28 repos here use main — but aoz-housing, dotfiles and sbb-lost-found use master, and six had no origin/HEAD set at all. On those, merge-base fails, the scoping falls through to 'cannot tell', and every check treats every change as in-scope. The gate I had just fixed would have gone back to blocking unrelated pushes on a fifth of the fleet, for a reason nobody would have connected to a branch name. default_branch() now lives in lib.sh and resolves in order: the remote's own origin/HEAD, then whichever of main/master exists, then fail. Never a guess. The pre-push hook and agent-core-drift both use it. Also ran 'origin/HEAD' is unchanged and points to 'main' on the six repos missing origin/HEAD. 32 of 33 now resolve; wild-spirit has no remote at all, which is a separate finding and the same shape as camille this morning. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(scaffold): every new site is born with CI ci-gate.sh cannot tell 'CI green' from 'no CI configured' — both exit 0. So a scaffolded site without a workflow deployed every push unverified while looking identical to one that passed. Substrata shipped to production that way for a day. The template now emits ci.yml alongside deploy.yml: npm ci, type-check, lint, build — the same bundle verify runs locally. Plus eslint.config.mjs, because ESLint 9 without a flat config exits non-zero on a migration notice and a new site's FIRST CI run would be red for reasons unrelated to its code. A red first run teaches people to ignore the light. Config copied from the fleet's working Next 16 apps, not invented. postcss.config.mjs assigns before exporting — the anonymous default export is a lint warning, and a scaffold should not emit its own warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(ci): no deployed app ships without CI, ratcheted to zero ci-gate.sh exits 0 for 'CI green' AND for 'no CI configured'. Absence is indistinguishable from success, so an app with no workflow deploys every push unverified while looking exactly like one that passed. Nothing reported it, because nothing was looking. The audit found two: camille-boulangerie, and sink — which is sinktattoo.com, a real client's site. sink turned out to be a FALSE POSITIVE, and that is the more useful finding: apps.conf pointed at /home/g/dev/s-ink, a path that does not exist, so the gate reasoned about an absent repository and reported the wrong fault. It sent me to add a workflow to a repo that already had one. The register was the bug. So the gate now distinguishes a stale register entry from a missing workflow and fails loudly on the former — a gate that lies about what to fix is worse than no gate. apps.conf repointed at /home/g/dev/aslan-tattoo. Camille genuinely had none and now does. Baseline is 0: a new deployed app without CI is a build failure. Tested in all four directions — over baseline fails, at baseline passes, under baseline passes and prompts, stale path fails. The first version could never fail at all: it set HERE before sourcing lib.sh, which overwrites HERE, so BASELINE_FILE pointed at a missing file and silently fell back to the current count. Found by testing the gate rather than trusting it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(scaffold): template ships .nvmrc Every new site now pins Node once, and both CI and the deploy read it. Without it the deploy warns and the two pipelines pick a version independently — the kind of difference that surfaces as 'green in CI, broken on the box'. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(hetzner): scaffold sets the deploy key itself, from one configured path new-site.sh printed `gh secret set ...` and called that operator hygiene. What it actually produced was substrata live in production deploying only from a laptop, because a printed instruction is a step that gets skipped. The key is piped from DEPLOY_KEY_PATH straight into `gh secret set` — never read into a variable, a log, or an agent's context — so the safety argument that motivated the manual step is kept while the step disappears. Per-repo on purpose: GitHub Free does not expose org-level secrets to PRIVATE repositories, so an org secret alone would silently cover only part of the fleet. DEPLOY_KEY_PATH joins the other constants in _box-env.sh so there is one path, not one per script. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN * fix(ci): make the deploy-ready gate judge the diff, not the workstation The gate inspected the sibling checkouts under DEV_ROOT and nothing else. All 15 are cloned on the workstation, so it printed "all 15 deployed apps have CI"; CI clones this repo only, so the same commit printed fifteen missing repos and exited 1 — red on a diff that touched none of them. Third instance of one class: a gate judging state outside the commit. Its real cost is not the red run, it is that everyone learns the gate is noise and reaches for --no-verify. Split into the two halves that were tangled: REGISTER INTEGRITY — apps.conf lives in this repo, so it is in the diff, so CI must judge it. Now actually checked: field count, unique names, unique numeric ports. Previously nothing validated the register at all. FLEET INSPECTION — needs the checkouts. Where none exist it is announced as NOT RUN and exits 0. Announced, because "no output" and "all clear" looking identical is the bug this file was written to fix. Where some exist, a bad path is still drift and still fails. test:deploy-ready-gate locks it shut from both sides: a malformed register must fail even with no checkouts present, and a bare environment must never claim the fleet passed. Added to verify, so CI runs it in exactly the environment that used to break it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN --------- Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: t <t@t.t> |
||
|
|
d66788a135 |
refactor(infra): studio constants get one home, and the rename gets a command (#399)
* refactor(infra): studio constants get one home, and the rename gets a command Fair criticism: I spent the day arguing for SSOT and then wrote new-site.sh with its own copies of GH_OWNER, BASE_DOMAIN and DEV_ROOT, and hardcoded 'maonakamoto' again in provision-widget.ts. Worse, the pattern already existed — _box-env.sh is literally labelled 'SSOT' for the box address. I did not extend it, I duplicated around it. _box-env.sh now owns GH_OWNER, SITES_BASE_DOMAIN and DEV_ROOT alongside the box address, and new-site.sh and provision-widget.ts read them instead of carrying their own. The 41 workflow files are a different case and worth being precise about: GitHub Actions requires a LITERAL owner/repo in and will not accept a variable, so that duplication cannot be removed. But a duplication you cannot remove is one you have to OWN — leaving it as 'remember to edit 41 files' is exactly the shape of step that gets skipped, the same shape as the git repository Camille never got. So sweep-gh-owner.sh is committed: one command, dry-runnable, optionally self-committing. Dry run against the fleet: 24 repos, all detected correctly. Renaming to an org is now plus one line in _box-env.sh. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(infra): split WORKFLOW_OWNER from GH_OWNER before they diverge Same bug as the last commit, one layer down. The site template hardcoded maonakamoto/fleetcrown in its deploy.yml uses: line, derived from nothing — so every new site would bake in a literal that follows neither an account rename nor a move to an org. And GH_OWNER was quietly doing two jobs: where new site repos are CREATED, and where fleetcrown LIVES. They look identical today and are about to diverge — sites go to an org while fleetcrown stays on the personal account. One name for two values is how a rename half-works. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
84706fb9c1 |
feat(infra): the site scaffold — register, new-site.sh, widget provisioning (#395)
#394 auto-merged on its first commit, so the rest of this work landed on a branch that was already closed. This is that remainder, rebuilt on main. **apps.conf becomes the register.** It knew port, domain, repo and database; it did not know who anything belongs to or whether they pay, so "what am I owed this month" was unanswerable and the answers lived as prose in bitbaum Status lines — "first client in progress", "city relationship unverified", "one real clinic". Six fields added: owner, kind, status, plan, price, since. plan and price are '-' everywhere on purpose; the gaps are the point. lib.sh needed its parser widened first — `read -r ... DB` lets bash's last variable swallow every extra field, so appending columns would have silently turned DB into "petvity|bitbaum|product|live|-|-". A 6-field line still parses exactly as before. **new-site.sh** does repo → register → box → deploy in one command. Substrata took nine manual steps today; Camille took the same route a week ago and skipped two of them — creating the repository and registering it — then ran in production for eight days with no version control, which made the studio's central claim untestable for the site built to demonstrate it. Those two steps have no visible payoff on the day, which is exactly why a machine should do them. Guards, because a slug becomes a DNS label, a certificate subject, a directory and a systemd unit: non-DNS-safe slugs, slugs already registered, hostnames already served, and reserved names — infrastructure like supabase, and impersonation like security, where a valid certificate on our own domain is a phish rather than a website. Ports come from the register, not ss -ltnp: a port free on the box but claimed here belongs to something not currently running. **provision-widget.ts** creates the FleetCrown project and mints a token bound to that site's origin. The widget is why this is not a dev shop — the owner points at their own page and an agent changes it — so it is provisioned at birth rather than later. Idempotent and deliberately non-rotating: rotating would silently invalidate a snippet already live on a customer's site. Non-fatal in the scaffold, because a missing widget is a minute's work while a half-finished scaffold is a mess. **The template ships tokens that say in the file that leaving them unchanged is a bug.** Twenty-four identical sites would destroy the thing being sold. Verified: guards refuse five bad inputs, dry-run allocates the next port and prints every step, template installs and builds static pages clean, and the widget provisioner was proved against the live database by giving Substrata its project and token — now serving in production. Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |