From 3c226f3e4b54161a923d57884252bf92c9cc3437 Mon Sep 17 00:00:00 2001 From: gl0w Date: Tue, 8 Sep 2026 04:44:46 +0100 Subject: [PATCH] dogfood: bootstrap docs to wiki + local CI (#2) --- .forge/ci/steps/01_test.sh | 5 +++++ .forge/ci/steps/02_budget.sh | 20 ++++++++++++++++++++ .forge/ci/steps/03_release.sh | 5 +++++ AGENTS.md => .forge/wiki/docs/AGENTS.md | 6 +++--- OUTLINE.md => .forge/wiki/docs/OUTLINE.md | 0 PLAN.md => .forge/wiki/docs/PLAN.md | 4 ++-- {tests => .forge/wiki/docs}/audit.md | 0 {docs => .forge/wiki/docs}/build-log.md | 0 8 files changed, 35 insertions(+), 5 deletions(-) create mode 100755 .forge/ci/steps/01_test.sh create mode 100755 .forge/ci/steps/02_budget.sh create mode 100755 .forge/ci/steps/03_release.sh rename AGENTS.md => .forge/wiki/docs/AGENTS.md (95%) rename OUTLINE.md => .forge/wiki/docs/OUTLINE.md (100%) rename PLAN.md => .forge/wiki/docs/PLAN.md (99%) rename {tests => .forge/wiki/docs}/audit.md (100%) rename {docs => .forge/wiki/docs}/build-log.md (100%) diff --git a/.forge/ci/steps/01_test.sh b/.forge/ci/steps/01_test.sh new file mode 100755 index 0000000..ee824a5 --- /dev/null +++ b/.forge/ci/steps/01_test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# 01_test: workspace tests must pass (55 tests). +set -e +export CARGO_BUILD_JOBS=2 +cargo test --workspace --locked diff --git a/.forge/ci/steps/02_budget.sh b/.forge/ci/steps/02_budget.sh new file mode 100755 index 0000000..ad9afec --- /dev/null +++ b/.forge/ci/steps/02_budget.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# 02_budget: byte-count hard budgets (PLAN M2). +# root help <=300B/12 lines; --skill <=900B/30 lines; each -h <=250B/8 lines. +set -e +export CARGO_BUILD_JOBS=2 +fail() { echo "budget fail: $1" >&2; exit 1; } +check() { + name="$1"; bytes="$2"; lines="$3"; maxb="$4"; maxl="$5" + if [ "$bytes" -gt "$maxb" ]; then fail "$name ${bytes}B > ${maxb}B"; fi + if [ "$lines" -gt "$maxl" ]; then fail "$name ${lines} lines > ${maxl}"; fi +} +bytes=$(f0rge | wc -c); lines=$(f0rge | wc -l) +check "root help" "$bytes" "$lines" 300 12 +bytes=$(f0rge --skill | wc -c); lines=$(f0rge --skill | wc -l) +check "--skill" "$bytes" "$lines" 900 30 +for sub in issue pr task label milestone ci wiki release merge init skill; do + bytes=$(f0rge "$sub" -h | wc -c); lines=$(f0rge "$sub" -h | wc -l) + check "$sub -h" "$bytes" "$lines" 250 8 +done +echo "budgets ok" diff --git a/.forge/ci/steps/03_release.sh b/.forge/ci/steps/03_release.sh new file mode 100755 index 0000000..9ef77b5 --- /dev/null +++ b/.forge/ci/steps/03_release.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# 03_release: release build must succeed. +set -e +export CARGO_BUILD_JOBS=2 +cargo build --locked --release diff --git a/AGENTS.md b/.forge/wiki/docs/AGENTS.md similarity index 95% rename from AGENTS.md rename to .forge/wiki/docs/AGENTS.md index bcb7090..91e4de1 100644 --- a/AGENTS.md +++ b/.forge/wiki/docs/AGENTS.md @@ -15,7 +15,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on). 1. `AGENTS.md` — this file 2. `OUTLINE.md` — the what/why; read once before any work 3. `PLAN.md` — the how/when; find your chunk, obey its contract exactly -4. `spec/` — frozen schema (exists after M0); the only source of truth for formats +4. `spec/` at repo root — frozen schema (exists after M0); the only source of truth for formats ## Philosophies (non-negotiable) @@ -49,7 +49,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on). PR folder (`diff` + `.forge/prs//`), CI green before merge. - Claim one chunk from PLAN.md; do exactly its scope (Inputs → Outputs → Interfaces → Definition of done). Never expand scope mid-chunk. -- Log one line per chunk in `docs/build-log.md`: `chunk | sha | verdict`. +- Log one line per chunk in `build-log.md` (co-located in `.forge/wiki/docs/`): `chunk | sha | verdict`. - When a change smells like design, file an issue — don't improvise into code. Design changes go to OUTLINE.md first, then PLAN.md, then code. @@ -70,7 +70,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on). - Errors: one line on stderr + exit code (0 ok / 1 runtime / 2 usage). No panics on hostile input. No stack traces. No paths beyond the offending file name. -- Output: `--json` compact, fixed field order documented in spec/; empty +- Output: `--json` compact, fixed field order documented in repo-root `spec/`; empty result is `[]` or `{}`, never prose. Human mode is a thin aligned view of the same data. Hard budgets: PLAN.md §M2 table — `f0rge` ≤ 12 lines, `-h` ≤ 8 lines, `--skill` ≤ 30 lines, errors 1 line. diff --git a/OUTLINE.md b/.forge/wiki/docs/OUTLINE.md similarity index 100% rename from OUTLINE.md rename to .forge/wiki/docs/OUTLINE.md diff --git a/PLAN.md b/.forge/wiki/docs/PLAN.md similarity index 99% rename from PLAN.md rename to .forge/wiki/docs/PLAN.md index 9fa0640..1876cf3 100644 --- a/PLAN.md +++ b/.forge/wiki/docs/PLAN.md @@ -71,7 +71,7 @@ Both crates `#![forbid(unsafe_code)]`. ## 2. Milestones and their dependency graph ``` -M0 schema v1 frozen (spec/) — blocks everything +M0 schema v1 frozen (repo-root spec/) — blocks everything M1 core storage + derived indexes — blocks all entity commands M2 CLI skeleton + token budgets — blocks polish; parallel w/ M3 M3 entity commands: issues, prs, labels, milestones, tasks @@ -343,7 +343,7 @@ hashes documented. 1. A chunk lists **Inputs / Outputs / Interfaces / Definition of done**. Claim one, build it, run its acceptance tests, record the result in - `docs/build-log.md` (one line per chunk: chunk, sha, verdict). + `build-log.md` (co-located in `.forge/wiki/docs/`) (one line per chunk: chunk, sha, verdict). 2. Monorepo, single trunk: work happens in worktrees; merges onto main are the same ritual as the product itself — this repo eats its own dogfood from M3 onward. diff --git a/tests/audit.md b/.forge/wiki/docs/audit.md similarity index 100% rename from tests/audit.md rename to .forge/wiki/docs/audit.md diff --git a/docs/build-log.md b/.forge/wiki/docs/build-log.md similarity index 100% rename from docs/build-log.md rename to .forge/wiki/docs/build-log.md -- 2.47.3