an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
ci: stop pushing to protected main, remove wall-sync
chaitanyagiri6c6200ad296c
diff --git a/.github/workflows/blog.yml b/.github/workflows/blog.ymlindex 08054934..6cb41bb8 100644--- a/.github/workflows/blog.yml+++ b/.github/workflows/blog.yml@@ -1,26 +1,44 @@name: Build blog-# Rebuilds the Eleventy blog into docs/blog whenever the blog source changes,-# and commits the generated output. The site itself is served by the existing-# GitHub Pages "deploy from branch" setup (docs/ + CNAME) — this workflow only-# regenerates the static files under docs/blog, it does NOT change Pages config.+# Checks that the built blog in docs/blog matches its source in blog/. The site+# itself is served by the existing GitHub Pages "deploy from branch" setup+# (docs/ + CNAME), so whatever docs/blog holds on main is what is live.#-# Trigger is scoped to blog/** so the commit it makes (under docs/blog) never-# re-triggers the workflow. Safe to run manually via workflow_dispatch.+# This workflow used to rebuild after a merge and push the output to main. main+# requires status checks, and a push from Actions cannot satisfy them, so that+# push was rejected (GH006) and new posts never went live. The build now ships+# inside the pull request: run `cd blog && npm ci && npm run build` and commit+# docs/blog and docs/sitemap.xml together with the source change. This job+# rebuilds from scratch and fails when the committed output differs. Two builds+# of the same tree produce identical files, so a failure means stale output.+#+# On push to main it runs the same check, so a merge that leaves the live blog+# stale shows up as a red run instead of passing silently. It never pushes.on:+ pull_request:+ branches: [main]+ paths:+ - "blog/**"+ - "docs/blog/**"+ - "docs/sitemap.xml"+ - ".github/workflows/blog.yml"push:branches: [main]paths:- "blog/**"+ - "docs/blog/**"+ - "docs/sitemap.xml"- ".github/workflows/blog.yml"workflow_dispatch:permissions:- contents: write+ contents: readjobs:build:+ # Named so it can never be mistaken for CI's required "Build" check.+ name: Built blog is currentruns-on: ubuntu-lateststeps:- uses: actions/checkout@v4@@ -35,16 +53,13 @@ jobs:npm cinpm run build- - name: Commit regenerated blog+ - name: Committed output matches the buildrun: |- git config user.name "github-actions[bot]"- git config user.email "github-actions[bot]@users.noreply.github.com"# docs/blog = the built site; docs/sitemap.xml = root sitemap the# build regenerates (owned by this build, per the Kevin handoff).if [ -n "$(git status --porcelain docs/blog docs/sitemap.xml)" ]; then- git add docs/blog docs/sitemap.xml- git commit -m "chore(blog): rebuild static output [skip ci]"- git push- else- echo "No blog changes to commit."+ git status --short docs/blog docs/sitemap.xml | head -50+ echo "::error title=Built blog is out of date::Run 'cd blog && npm ci && npm run build' and commit docs/blog and docs/sitemap.xml in this pull request."+ exit 1fi+ echo "docs/blog matches a fresh build."diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.ymlindex 29f4c004..77efc1e9 100644--- a/.github/workflows/contributors.yml+++ b/.github/workflows/contributors.yml@@ -5,6 +5,12 @@ name: Update contributors# themselves rather than from commit metadata, because GitHub's own contributors# graph keys on the commit author email and silently drops anyone whose git# email is not attached to their GitHub account.+#+# main requires status checks, so a push from Actions is rejected (GH006). A+# changed list goes to the bot/contributors branch and one pull request, which+# later runs refresh in place. Pull requests opened by Actions do not trigger+# other workflows, so the required checks never report on it: a maintainer+# reviews the diff and merges it as admin.on:pull_request_target:types: [closed]@@ -15,6 +21,7 @@ on:permissions:contents: write+ pull-requests: writeconcurrency:group: contributors@@ -39,15 +46,33 @@ jobs:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}run: node scripts/generate-contributors.mjs- - name: Commit if it changed+ - name: Open or refresh the contributors pull request+ env:+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ BRANCH: bot/contributorsrun: |set -euo pipefailif git diff --quiet -- CONTRIBUTORS.md; then- echo "No change."+ echo "CONTRIBUTORS.md on main is current."+ exit 0+ fi+ # Nothing to push when the branch already carries this exact list.+ if git fetch --quiet --depth 1 origin "$BRANCH" 2>/dev/null \+ && git diff --quiet FETCH_HEAD -- CONTRIBUTORS.md; then+ echo "$BRANCH already has this list."+ else+ git config user.name "github-actions[bot]"+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"+ git checkout -B "$BRANCH"+ git add CONTRIBUTORS.md+ git commit -m "docs: update contributors"+ git push --force origin "$BRANCH"+ fi+ if [ -n "$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty')" ]; then+ echo "The pull request on $BRANCH is open and current."exit 0fi- git config user.name "github-actions[bot]"- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"- git add CONTRIBUTORS.md- git commit -m "docs: update contributors [skip ci]"- git push+ gh pr create --base main --head "$BRANCH" \+ --title "docs: update contributors" \+ --label no-visual-change \+ --body "Regenerated by the Update contributors workflow from merged pull requests. Pull requests opened by GitHub Actions do not trigger other workflows, so the required checks will not report here. Review the diff, then merge as admin."diff --git a/.github/workflows/wall-sync.yml b/.github/workflows/wall-sync.ymldeleted file mode 100644index a8b6ecbd..00000000--- a/.github/workflows/wall-sync.yml+++ /dev/null@@ -1,46 +0,0 @@-# Founders' Wall sync — rebuilds docs/wall-data.json from Razorpay truth.-# Additions open a PR for founder review; refund/dispute removals commit directly.-# Requires repo Actions secrets: RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET.-name: wall-sync--on:- schedule:- # HOURLY (was every 30 min). ONE CADENCE across the whole metrics stack —- # the local dashboard runner is hourly too, and the two must not drift apart.- #- # :50 is chosen so this lands just BEFORE the dashboard's hourly pass at :07,- # not after it. The dashboard reports wall_published / wall_pending by- # comparing Razorpay truth against the published wall, so it should read a- # wall that was reconciled minutes ago rather than most of an hour ago.- # Off :00 on purpose: GitHub's scheduled-workflow queue is busiest there and- # starts get delayed most.- #- # Additions still wait on a review PR, so wall_pending legitimately stays- # non-zero until the founder merges — that is the gate working, not drift.- - cron: "50 * * * *"- workflow_dispatch: {}--concurrency:- group: wall-sync- cancel-in-progress: false--permissions:- contents: write- pull-requests: write--jobs:- sync:- runs-on: ubuntu-latest- steps:- - uses: actions/checkout@v4- with:- fetch-depth: 0- - uses: actions/setup-node@v4- with:- node-version: 20- - name: Sync wall from Razorpay- env:- RAZORPAY_KEY_ID: ${{ secrets.RAZORPAY_KEY_ID }}- RAZORPAY_KEY_SECRET: ${{ secrets.RAZORPAY_KEY_SECRET }}- GH_TOKEN: ${{ github.token }}- run: node scripts/wall-sync.mjsdiff --git a/scripts/wall-sync.mjs b/scripts/wall-sync.mjsdeleted file mode 100644index 28b44d1f..00000000--- a/scripts/wall-sync.mjs+++ /dev/null@@ -1,244 +0,0 @@-#!/usr/bin/env node-// scripts/wall-sync.mjs — keep docs/wall-data.json in sync with Razorpay truth.-//-// Runs from .github/workflows/wall-sync.yml on a schedule. Read-only against-// Razorpay. The wall list is REBUILT from the API every run (never append-only):-// a refunded or disputed payment drops off automatically on the next run.-//-// - membership comes from the API (captured, not refunded, not disputed)-// - names/dates of entries ALREADY on the wall are preserved verbatim —-// manual curation always wins; this script never rewrites a published name-// - new supporters are added with the name they asked to have engraved,-// unless the name fails the gates below, in which case the entry is held-// out and listed in the PR body for a human decision. We never substitute-// a name we invented.-// - REMOVALS are committed directly (leaving a refunded payer up is the bug)-// - ADDITIONS open/refresh a PR on the stable branch wall/additions-// - any Razorpay error aborts the run with no changes (fail-closed)-//-// Env: RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET (Actions secrets), GH_TOKEN (for gh),-// DRY_RUN=1 to print the plan and touch nothing.--import { readFileSync, writeFileSync, mkdtempSync } from "node:fs";-import { execFileSync } from "node:child_process";-import { tmpdir } from "node:os";-import path from "node:path";--const WALL_FILE = "docs/wall-data.json";-const API = "https://api.razorpay.com";-const DRY = process.env.DRY_RUN === "1";-const PR_BRANCH = "wall/additions";--// Same scope filter as the dashboard collector: the engraving-notes key is the-// discriminator for wall payments; the date guards against the much larger body-// of legacy records that predates the wall.-// Epoch is Aug 13 UTC because the first wall payment is 2026-08-13T19:xx UTC-// (= Aug 14 IST, the wall's listed date).-const MD_EPOCH = Math.floor(Date.parse("2026-08-13T00:00:00Z") / 1000);-const ENGRAVE_KEY = "name_(as_you_want_it_engraved)";-const FOUNDER_EMAIL = "[email protected]"; // self-test payments held for confirmation-const MAX_NAME_LEN = 40;--function auth() {- const id = process.env.RAZORPAY_KEY_ID, secret = process.env.RAZORPAY_KEY_SECRET;- if (!id || !secret) throw new Error("RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET missing from env");- return "Basic " + Buffer.from(`${id}:${secret}`).toString("base64");-}--async function get(pathname, params = {}) {- const url = new URL(pathname, API);- for (const [k, v] of Object.entries(params)) url.searchParams.set(k, String(v));- const res = await fetch(url, { headers: { Authorization: auth() } });- if (!res.ok) {- const body = (await res.text()).slice(0, 200);- const err = new Error(`GET ${pathname} -> HTTP ${res.status}: ${body}`);- err.status = res.status;- throw err;- }- return res.json();-}--async function paginate(pathname, params = {}) {- const items = [];- for (let skip = 0; ; skip += 100) {- const page = await get(pathname, { ...params, count: 100, skip });- const batch = page.items ?? [];- items.push(...batch);- if (batch.length < 100) break;- }- return items;-}--// Reasons a name can't be auto-published. Structural checks only — the PR-// review is the real gate for anything a regex can't judge.-function nameGate(payment) {- const raw = String(payment.notes?.[ENGRAVE_KEY] ?? "");- const name = raw.trim().replace(/\s+/g, " ");- if (!name) return { held: "empty name" };- if (name.length > MAX_NAME_LEN) return { held: `name longer than ${MAX_NAME_LEN} chars` };- if (/https?:\/\/|www\.|[a-z0-9-]+\.[a-z]{2,}(\/|$)/i.test(name)) return { held: "looks like a URL/domain" };- if (!/\p{L}/u.test(name)) return { held: "no letters in name" };- // eslint-disable-next-line no-control-regex- if (/[\x00-\x1f\x7f]/.test(name)) return { held: "control characters in name" };- if ((payment.email ?? "").toLowerCase() === FOUNDER_EMAIL)- return { held: "paid from the founder's own email — confirm it's meant for the wall" };- return { name };-}--function sh(cmd, args, opts = {}) {- return execFileSync(cmd, args, { encoding: "utf8", stdio: ["ignore", "pipe", "inherit"], ...opts }).trim();-}--// One supporter per line, matching the file's existing hand-written style.-// This is not cosmetic: JSON.stringify(list, null, 2) explodes every entry to-// five lines, so adding ONE name produced a 119-line diff and the review PR —-// the whole point of the addition gate — became unreadable. One line in, one-// line of diff.-function serializeWall(entries) {- if (!entries.length) return "[]\n";- const row = (e) =>- ` { "name": ${JSON.stringify(e.name)}, "date": ${JSON.stringify(e.date)}, "payment_id": ${JSON.stringify(e.payment_id)} }`;- return `[\n${entries.map(row).join(",\n")}\n]\n`;-}--// What has already hit the remote when something later blows up. The catch-// below reports this instead of claiming "no changes made" — a removal push-// and a branch push both happen BEFORE the PR step that failed today.-const landed = [];--async function main() {- // 1. Truth from Razorpay (fail-closed: any throw aborts before any write).- const payments = (await paginate("/v1/payments", { from: MD_EPOCH }))- .filter((p) => p.created_at >= MD_EPOCH && p.notes && Object.hasOwn(p.notes, ENGRAVE_KEY));-- let disputedIds = new Set();- try {- const disputes = await paginate("/v1/disputes");- disputedIds = new Set(disputes.filter((d) => d.status !== "won").map((d) => d.payment_id));- } catch (err) {- // Disputes endpoint may not be enabled on this account; that must not- // brick the pipeline. Auth/server errors still abort.- if (err.status !== 400 && err.status !== 404) throw err;- console.error(`note: disputes endpoint unavailable (HTTP ${err.status}); proceeding without dispute checks`);- }-- const eligible = payments.filter(- (p) => p.status === "captured" && (p.amount_refunded ?? 0) === 0 && !p.refund_status && !disputedIds.has(p.id),- );- const eligibleById = new Map(eligible.map((p) => [p.id, p]));-- // 2. Current wall.- const wall = JSON.parse(readFileSync(WALL_FILE, "utf8"));- const wallIds = new Set(wall.map((e) => e.payment_id));-- // 3. Membership diff. Existing entries keep their curated name/date.- const kept = wall.filter((e) => eligibleById.has(e.payment_id));- const removals = wall.filter((e) => !eligibleById.has(e.payment_id));- const additions = [];- const heldOut = [];- for (const p of eligible) {- if (wallIds.has(p.id)) continue;- const gate = nameGate(p);- if (gate.held) heldOut.push({ payment_id: p.id, reason: gate.held });- else additions.push({ name: gate.name, date: new Date(p.created_at * 1000).toISOString().slice(0, 10), payment_id: p.id });- }-- const at = (id) => eligibleById.get(id)?.created_at ?? 0;- const sortByPayment = (list) => list.sort((a, b) => at(a.payment_id) - at(b.payment_id));-- console.log(JSON.stringify({- eligible: eligible.length, on_wall: wall.length, kept: kept.length,- removals: removals.map((e) => e.payment_id), additions: additions.length, held_out: heldOut,- }));-- if (DRY) {- console.log("DRY_RUN=1 — plan only, nothing written.");- if (additions.length) console.log("would add:", additions.map((a) => `${a.name} (${a.payment_id})`).join("; "));- return;- }- if (!removals.length && !additions.length && !heldOut.length) {- console.log("wall is in sync; nothing to do");- return;- }-- sh("git", ["config", "user.name", "wall-sync"]);- sh("git", ["config", "user.email", "[email protected]"]);- const baseBranch = sh("git", ["rev-parse", "--abbrev-ref", "HEAD"]);-- // 4. Removals: straight to the default branch. Speed is safety here.- if (removals.length) {- const afterRemoval = sortByPayment([...kept]);- writeFileSync(WALL_FILE, serializeWall(afterRemoval));- sh("git", ["add", WALL_FILE]);- sh("git", ["commit", "-m", `wall: remove ${removals.length} refunded/disputed plaque(s)\n\n${removals.map((e) => e.payment_id).join("\n")}`]);- sh("git", ["push", "origin", `HEAD:${baseBranch}`]);- landed.push(`removed ${removals.length} entr(ies), pushed to ${baseBranch}`);- console.log(`removed ${removals.length} entr(ies) and pushed to ${baseBranch}`);- }-- // 5. Additions (and/or held-outs needing a decision): a rolling PR.- if (additions.length || heldOut.length) {- const prList = sortByPayment([...kept, ...additions]);- sh("git", ["checkout", "-B", PR_BRANCH]);- writeFileSync(WALL_FILE, serializeWall(prList));- sh("git", ["add", WALL_FILE]);- const title = `wall: ${additions.length} new Founding Supporter(s)`;- sh("git", ["commit", "--allow-empty", "-m", title]);- sh("git", ["push", "-f", "origin", PR_BRANCH]);- landed.push(`pushed branch ${PR_BRANCH} with ${additions.length} addition(s)`);-- const bodyFile = path.join(mkdtempSync(path.join(tmpdir(), "wall-")), "pr-body.md");- const body = [- "Automated wall sync — review the names, then merge to publish.",- "",- ...(additions.length ? ["## Additions", "", "| engraved name | date | payment |", "|---|---|---|",- ...additions.map((a) => `| ${a.name} | ${a.date} | ${a.payment_id} |`), ""] : []),- ...(heldOut.length ? ["## Held out — needs your decision (not in the JSON)", "",- ...heldOut.map((h) => `- \`${h.payment_id}\` — ${h.reason}`), "",- "To publish a held-out supporter, add them to `docs/wall-data.json` in this PR by hand; the sync preserves manual entries.", ""] : []),- "Removals (refunds/disputes) are committed directly by the sync, not via this PR.",- ].join("\n");- writeFileSync(bodyFile, body);-- const existing = sh("gh", ["pr", "list", "--head", PR_BRANCH, "--state", "open", "--json", "number", "--jq", ".[0].number // empty"]);- if (existing) {- sh("gh", ["pr", "edit", existing, "--title", title, "--body-file", bodyFile]);- console.log(`updated PR #${existing}`);- } else {- try {- sh("gh", ["pr", "create", "--base", baseBranch, "--head", PR_BRANCH, "--title", title, "--body-file", bodyFile]);- console.log("opened wall additions PR");- landed.push("opened wall additions PR");- } catch (err) {- // The repo setting "Allow GitHub Actions to create and approve pull- // requests" is OFF by default, and NO workflow `permissions:` block can- // override it. The branch is already pushed and correct, so say exactly- // that and hand over a one-click link rather than dying anonymously.- if (!/not permitted to create or approve pull requests/i.test(String(err.message ?? err))) throw err;- const repo = process.env.GITHUB_REPOSITORY ?? "";- const url = repo ? `https://github.com/${repo}/compare/${baseBranch}...${PR_BRANCH}?expand=1` : "(set GITHUB_REPOSITORY for a link)";- throw new Error(- `branch ${PR_BRANCH} is pushed and ready, but this repo forbids Actions from opening PRs.\n` +- ` Fix once: Settings -> Actions -> General -> Workflow permissions ->\n` +- ` tick "Allow GitHub Actions to create and approve pull requests"\n` +- ` Or open it by hand now: ${url}`,- );- }- }- sh("git", ["checkout", baseBranch]);- }-}--main().catch((err) => {- console.error(`wall-sync failed: ${err.message ?? err}`);- // Never claim "no changes made" without checking. Removals go straight to the- // default branch and the additions branch is pushed before the PR is opened,- // so a late failure can leave real state behind on the remote.- if (landed.length) {- console.error("changes that DID land before the failure:");- for (const step of landed) console.error(` - ${step}`);- } else {- console.error("no changes were made.");- }- process.exit(1);-});