Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 56 additions & 0 deletions .ascii-to-svg-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "1.0.0",
"lastSync": "2026-11-05T19:40:31Z",
"diagrams": [
{
"id": "three-outputs",
"sourceFile": "README.md",
"sourceLine": 42,
"svgFile": "assets/diagrams/three-outputs.svg",
"asciiHash": "sha256:7082517f21d167c59b50d6abde2576e45af1403eedab8492e11877477d84b88f",
"svgHash": "sha256:2dadf13f32f4e295fac5349ce47ed1e74fc1a571a22f906de647e78c2887b7d3",
"diagramType": "flowchart",
"lastConverted": "2026-11-05T19:08:23Z"
},
{
"id": "stations",
"sourceFile": "README.md",
"sourceLine": 70,
"svgFile": "assets/diagrams/stations.svg",
"asciiHash": "sha256:dd9281870048657b723ef94cc813dff8205f3c9ae78976946726b6120fe1a581",
"svgHash": "sha256:295f1246180abfa142db95e9064df861b1447d33fb7cb6107a7c4906cc2877d8",
"diagramType": "architecture",
"lastConverted": "2026-11-05T19:08:23Z"
},
{
"id": "quality-gate",
"sourceFile": "README.md",
"sourceLine": 105,
"svgFile": "assets/diagrams/quality-gate.svg",
"asciiHash": "sha256:5ff394c8fac5028bd000d6bc2c9d3049f2f46cd42d836b76f456e0e0701f1d38",
"svgHash": "sha256:aa9cf10d6b700ba38f87d528b88ca0aa32c80792a05540eb72a64d18a9e316ec",
"diagramType": "flowchart",
"lastConverted": "2026-11-05T19:08:23Z"
},
{
"id": "learning-loop",
"sourceFile": "README.md",
"sourceLine": 136,
"svgFile": "assets/diagrams/learning-loop.svg",
"asciiHash": "sha256:345b491348a7383ef598b0f8ee7422fb536314b89eee21f365bfaba4755ede7f",
"svgHash": "sha256:8a6e6b453f4b94bfa87d3ecde1ede90f54ffd9cdcfbc27e399216c4c3348d2b8",
"diagramType": "flowchart",
"lastConverted": "2026-11-05T19:08:23Z"
},
{
"id": "two-doors",
"sourceFile": "README.md",
"sourceLine": 162,
"svgFile": "assets/diagrams/two-doors.svg",
"asciiHash": "sha256:22445671b2e3f554eefc3a6bd8fd1a49ad2c83fd5c7f036831774edc70ac8b51",
"svgHash": "sha256:858bb7f307f752ece197c6730e906476fed3e942145201b723d1eca6157d7109",
"diagramType": "architecture",
"lastConverted": "2026-11-05T19:08:23Z"
}
]
}
54 changes: 18 additions & 36 deletions .github/workflows/build-explainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ name: Build Explainer
# keys (repo secrets), deploy it to its own Netlify site, and write progress back to a status
# gist that the website polls. Triggered by the /build Netlify function.
#
# ARCHITECTURE (2026-07-04 rebuild — see project memory "hosted-agentic-architecture", approved
# 2026-06-30 but never actually wired until now): this invokes bin/agentic-runner.mjs, which runs
# the real explainmyrepo SKILL as a headless Claude Code agent — the brain decides, tools/*.mjs do
# the mechanics — instead of the old deterministic orchestrator.mjs pipeline. GitHub Actions is
# still the right HOST for this (ADR-033, agent-harness-generator: triggered, autonomous, no human
# at the keyboard); what changed is that it now runs the AGENT, which adapts per-repo, instead of a
# fixed script that broke on off-mold repos (empty dep-graphs, oversized monorepos).
# ARCHITECTURE: bin/agentic-runner.mjs runs the explainmyrepo SKILL as a headless Claude Code agent (the brain
# decides, tools/*.mjs do the mechanics); GitHub Actions is only the host. The local door is src/orchestrator.mjs.
#
# RAILS: timeout-minutes is COMPUTED from budget_min (a pre-flight repo-size signal from build.js)
# instead of one fixed ceiling for every repo · serialized concurrency (no cost fan-out) · the
Expand Down Expand Up @@ -57,19 +52,16 @@ jobs:
runs-on: ubuntu-latest
# The agent enforces its OWN budget (budget_min) internally and exits cleanly well before this
# outer ceiling would ever need to fire — this is just the backstop. timeout_min is budget_min +
# a fixed overhead buffer, computed in build.js (plain JS), not here: GitHub Actions expressions
# don't support arithmetic on inputs the way `fromJSON(x) + 10` implies — learned this the hard
# way, it rejects the whole dispatch at parse time, which a YAML-structure check doesn't catch
# since it's an expression-syntax error, not a YAML one.
# a fixed overhead buffer computed in build.js (Actions expressions cannot add to an input).
timeout-minutes: ${{ fromJSON(inputs.timeout_min || '30') }}
steps:
- name: Checkout the explainer tool
uses: actions/checkout@v4
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
node-version: 22

- name: Validate input (abuse guard)
env:
Expand All @@ -79,34 +71,29 @@ jobs:
REPO: ${{ github.event.inputs.target_repo }}
run: |
echo "target: $REPO"
if ! printf '%s' "$REPO" | grep -qE '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$'; then
if ! printf '%s' "$REPO" | grep -qE '^[A-Za-z0-9_][A-Za-z0-9_.-]*/[A-Za-z0-9_][A-Za-z0-9_.-]*$'; then
echo "::error::invalid repo format (expected owner/name): $REPO"; exit 1
fi

- name: Install dependencies
run: |
npm ci || npm install
# Belt-and-suspenders: guarantee the 3 runtime deps are present (CI 'npm ci' was leaving
# playwright unresolved -> quality-grade failed). EXACT pinned versions + --no-save so this
# cannot drift to a newer/compromised patch or rewrite the committed lockfile (no supply-
# chain bypass; these match package-lock.json).
npm install --no-save playwright@1.61.1 @xenova/transformers@2.17.2 @ruvector/rvf@0.2.2
# The lockfile is the single source of truth for runtime deps (playwright, @xenova/transformers,
# @ruvector/rvf, sharp); no ad-hoc --no-save installs that could drift from it.
npm ci
npx playwright install --with-deps chromium
# System tools the pipeline shells out to (scanned from tools/*.mjs), not all preinstalled
# on the runner: ImageMagick (magick/convert/identify — favicon, social card), xmllint
# (libxml2-utils — diagram SVG validation), dot (graphviz — diagram layout), zip (AI pack).
# (libxml2-utils — diagram SVG validation), zip (AI pack).
# Fonts help text render in generated imagery.
sudo apt-get update && sudo apt-get install -y imagemagick libxml2-utils graphviz zip fonts-liberation fonts-dejavu-core
sudo apt-get update && sudo apt-get install -y imagemagick libxml2-utils zip fonts-liberation fonts-dejavu-core
# The agentic kernel itself (bin/agentic-runner.mjs spawns this headless) — pinned exact
# version, same rationale as the runtime deps above: no supply-chain drift on a bare runner.
npm install -g @anthropic-ai/claude-code@2.1.201
claude --version

# 2026-07-16 HF outage (build 79f135b3): a CloudFront outage made the mandatory embedding
# model undownloadable and the agent burned its whole budget discovering it. Cache the
# 33 MB model between runs so KB builds are offline-first; the warm step downloads it only
# when the cache is cold and VALIDATES it with one real embedding. Warm failure is a soft
# warning: the runner's own embedding preflight is the honest gate and alerts in seconds.
# Cache the embedding model between runs so KB builds are offline-first (an HF outage once burned a whole
# agent budget); the warm step downloads only when cold and validates with one real embedding. A warm
# failure is a soft warning: the runner's embedding preflight is the honest gate.
- name: Restore embedding model cache (offline-first KB)
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
Expand All @@ -122,9 +109,7 @@ jobs:
# failure alert) — the runner builds a SEPARATE, much narrower allowlist for the spawned
# agent process itself (see bin/agentic-runner.mjs), which never sees GH/SMTP creds.
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# Failover lane only (2026-07-19): engaged by the runner's preflight EXCLUSIVELY when the
# primary key is usage-limited — same executor model via OpenRouter's Anthropic Skin.
# Empty when the secret is unset: the lane stays inert and behavior is unchanged.
# Failover lane only: the runner's preflight uses it when the primary key is usage-limited.
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand Down Expand Up @@ -164,11 +149,8 @@ jobs:
exit 1
fi

# A failed run's assembled work is NOT garbage (learned 2026-07-15: autonomous-wealth-builder
# built a complete grounded site, stalled at B5 56/58, and the runner's _temp dir evaporated
# with the job — the whole spend was lost when a 10-minute operator cure could have finished
# it). Preserve the curable core (site + build.json + graded assets; NOT the repo clone, NOT
# logs) so the operator can download, fix, re-grade, and deploy without a rebuild.
# A failed run's assembled work is not garbage: keep the curable core (site + build.json + graded assets;
# not the clone, not logs) so an operator can fix, re-grade and deploy without a rebuild.
- name: Preserve curable build on failure
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# The test gate — ONE definition, used two ways: on every pull request and push to main (so a red suite
# cannot merge unnoticed), and called by release.yml before it will publish anything.
#
# 2026-10-06: the tests used to run ONLY when a release tag was pushed. Ten commits merged on Sep 20 with
# two tests newly red and nobody knew — and the release job had by then been failing for three months
# for a different reason (the sharp step below), so there was no signal at all.
# Why: the tests used to run ONLY when a release tag was pushed, so a red suite could merge unnoticed.

name: CI

Expand All @@ -26,18 +24,18 @@ jobs:
with:
node-version: 22

# --ignore-scripts: dependency install hooks never run in CI (supply-chain posture) ...
# --ignore-scripts: dependency install hooks never run in CI (supply-chain posture).
- run: npm ci --ignore-scripts

# ... with ONE deliberate exception. @xenova/transformers carries its own nested `sharp`, whose native
# binary is fetched by its install script. Skipped, importing the package throws and the 9 kb-delta
# end-to-end tests fail — which blocked every release since July. Rebuilding ONLY sharp restores the
# one binary that needs it. Reproduced and verified in a clean v0.9.0 checkout (185 tests, 0 failing).
- run: npm rebuild sharp
# The ask-service has its own manifest (it deploys as a separate Netlify site); its tests import it.
- run: npm ci --ignore-scripts --prefix ask-service

# The diagram tests spawn make-diagrams, which shells out to graphviz's `dot` and `xmllint` — present
# locally and in build-explainer.yml but not on a bare runner. Their absence failed the v0.4.0 release's
# test job (execSync ENOENT) with a green suite locally; system deps here must mirror what the tools invoke.
- run: sudo apt-get update && sudo apt-get install -y graphviz libxml2-utils
# The diagram tests spawn make-diagrams, which shells out to `xmllint` to validate every SVG. A bare
# runner does not have it; system deps here must mirror what the tools invoke (nothing calls `dot`).
# imagemagick: make-social-card renders the share card with it; without it the card-legibility tests SKIP.
- run: sudo apt-get update && sudo apt-get install -y libxml2-utils imagemagick

- run: npm test

# End-to-end suite (real embeddings + RVF stores in a temp dir; downloads the small bge model on a fresh runner).
- run: npm run test:e2e
47 changes: 0 additions & 47 deletions .github/workflows/deploy-preserved-goodies.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
docs/.env

# deps & build
node_modules
node_modules/
**/node_modules/
.vercel/

# cloned upstream repos (not ours)
.targets/
Expand All @@ -27,6 +27,7 @@ ruvector.db
# local agent DB + model cache + per-run build outputs (all regenerable, not source)
agentdb.rvf
agentdb.rvf.lock
agentdb.rvf.idmap.json
kb/models-cache/
explainer-builds/

Expand All @@ -50,3 +51,6 @@ explainer-builds/

# pasted screenshots — one showed a complete npm token on 2026-10-06; never source
.docs/

# generated explainer builds at the repo root (the ruv-explainer-* hand-built generation was removed; builds live on Netlify)
/ruv-explainer-*/
Loading
Loading