1 From 3c226f3e4b54161a923d57884252bf92c9cc3437 Mon Sep 17 00:00:00 20012 From: gl0w <gl0w@world>3 Date: Tue, 8 Sep 2026 04:44:46 +01004 Subject: [PATCH] dogfood: bootstrap docs to wiki + local CI (#2)5 6 ---7 .forge/ci/steps/01_test.sh | 5 +++++8 .forge/ci/steps/02_budget.sh | 20 ++++++++++++++++++++9 .forge/ci/steps/03_release.sh | 5 +++++10 AGENTS.md => .forge/wiki/docs/AGENTS.md | 6 +++---11 OUTLINE.md => .forge/wiki/docs/OUTLINE.md | 012 PLAN.md => .forge/wiki/docs/PLAN.md | 4 ++--13 {tests => .forge/wiki/docs}/audit.md | 014 {docs => .forge/wiki/docs}/build-log.md | 015 8 files changed, 35 insertions(+), 5 deletions(-)16 create mode 100755 .forge/ci/steps/01_test.sh17 create mode 100755 .forge/ci/steps/02_budget.sh18 create mode 100755 .forge/ci/steps/03_release.sh19 rename AGENTS.md => .forge/wiki/docs/AGENTS.md (95%)20 rename OUTLINE.md => .forge/wiki/docs/OUTLINE.md (100%)21 rename PLAN.md => .forge/wiki/docs/PLAN.md (99%)22 rename {tests => .forge/wiki/docs}/audit.md (100%)23 rename {docs => .forge/wiki/docs}/build-log.md (100%)24 25 diff --git a/.forge/ci/steps/01_test.sh b/.forge/ci/steps/01_test.sh26 new file mode 10075527 index 0000000..ee824a528 --- /dev/null29 +++ b/.forge/ci/steps/01_test.sh30 @@ -0,0 +1,5 @@31 +#!/bin/sh32 +# 01_test: workspace tests must pass (55 tests).33 +set -e34 +export CARGO_BUILD_JOBS=235 +cargo test --workspace --locked36 diff --git a/.forge/ci/steps/02_budget.sh b/.forge/ci/steps/02_budget.sh37 new file mode 10075538 index 0000000..ad9afec39 --- /dev/null40 +++ b/.forge/ci/steps/02_budget.sh41 @@ -0,0 +1,20 @@42 +#!/bin/sh43 +# 02_budget: byte-count hard budgets (PLAN M2).44 +# root help <=300B/12 lines; --skill <=900B/30 lines; each <cmd> -h <=250B/8 lines.45 +set -e46 +export CARGO_BUILD_JOBS=247 +fail() { echo "budget fail: $1" >&2; exit 1; }48 +check() {49 + name="$1"; bytes="$2"; lines="$3"; maxb="$4"; maxl="$5"50 + if [ "$bytes" -gt "$maxb" ]; then fail "$name ${bytes}B > ${maxb}B"; fi51 + if [ "$lines" -gt "$maxl" ]; then fail "$name ${lines} lines > ${maxl}"; fi52 +}53 +bytes=$(f0rge | wc -c); lines=$(f0rge | wc -l)54 +check "root help" "$bytes" "$lines" 300 1255 +bytes=$(f0rge --skill | wc -c); lines=$(f0rge --skill | wc -l)56 +check "--skill" "$bytes" "$lines" 900 3057 +for sub in issue pr task label milestone ci wiki release merge init skill; do58 + bytes=$(f0rge "$sub" -h | wc -c); lines=$(f0rge "$sub" -h | wc -l)59 + check "$sub -h" "$bytes" "$lines" 250 860 +done61 +echo "budgets ok"62 diff --git a/.forge/ci/steps/03_release.sh b/.forge/ci/steps/03_release.sh63 new file mode 10075564 index 0000000..9ef77b565 --- /dev/null66 +++ b/.forge/ci/steps/03_release.sh67 @@ -0,0 +1,5 @@68 +#!/bin/sh69 +# 03_release: release build must succeed.70 +set -e71 +export CARGO_BUILD_JOBS=272 +cargo build --locked --release73 diff --git a/AGENTS.md b/.forge/wiki/docs/AGENTS.md74 similarity index 95%75 rename from AGENTS.md76 rename to .forge/wiki/docs/AGENTS.md77 index bcb7090..91e4de1 10064478 --- a/AGENTS.md79 +++ b/.forge/wiki/docs/AGENTS.md80 @@ -15,7 +15,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on).81 1. `AGENTS.md` — this file82 2. `OUTLINE.md` — the what/why; read once before any work83 3. `PLAN.md` — the how/when; find your chunk, obey its contract exactly84 -4. `spec/` — frozen schema (exists after M0); the only source of truth for formats85 +4. `spec/` at repo root — frozen schema (exists after M0); the only source of truth for formats86 87 ## Philosophies (non-negotiable)88 89 @@ -49,7 +49,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on).90 PR folder (`diff` + `.forge/prs/<uuid>/`), CI green before merge.91 - Claim one chunk from PLAN.md; do exactly its scope (Inputs → Outputs →92 Interfaces → Definition of done). Never expand scope mid-chunk.93 -- Log one line per chunk in `docs/build-log.md`: `chunk | sha | verdict`.94 +- Log one line per chunk in `build-log.md` (co-located in `.forge/wiki/docs/`): `chunk | sha | verdict`.95 - When a change smells like design, file an issue — don't improvise into96 code. Design changes go to OUTLINE.md first, then PLAN.md, then code.97 98 @@ -70,7 +70,7 @@ dogfoods: building f0rge is the first f0rge project (from PLAN M3 on).99 - Errors: one line on stderr + exit code (0 ok / 1 runtime / 2 usage).100 No panics on hostile input. No stack traces. No paths beyond the101 offending file name.102 -- Output: `--json` compact, fixed field order documented in spec/; empty103 +- Output: `--json` compact, fixed field order documented in repo-root `spec/`; empty104 result is `[]` or `{}`, never prose. Human mode is a thin aligned view105 of the same data. Hard budgets: PLAN.md §M2 table — `f0rge` ≤ 12 lines,106 `-h` ≤ 8 lines, `--skill` ≤ 30 lines, errors 1 line.107 diff --git a/OUTLINE.md b/.forge/wiki/docs/OUTLINE.md108 similarity index 100%109 rename from OUTLINE.md110 rename to .forge/wiki/docs/OUTLINE.md111 diff --git a/PLAN.md b/.forge/wiki/docs/PLAN.md112 similarity index 99%113 rename from PLAN.md114 rename to .forge/wiki/docs/PLAN.md115 index 9fa0640..1876cf3 100644116 --- a/PLAN.md117 +++ b/.forge/wiki/docs/PLAN.md118 @@ -71,7 +71,7 @@ Both crates `#![forbid(unsafe_code)]`.119 ## 2. Milestones and their dependency graph120 121 ```122 -M0 schema v1 frozen (spec/) — blocks everything123 +M0 schema v1 frozen (repo-root spec/) — blocks everything124 M1 core storage + derived indexes — blocks all entity commands125 M2 CLI skeleton + token budgets — blocks polish; parallel w/ M3126 M3 entity commands: issues, prs, labels, milestones, tasks127 @@ -343,7 +343,7 @@ hashes documented.128 129 1. A chunk lists **Inputs / Outputs / Interfaces / Definition of done**.130 Claim one, build it, run its acceptance tests, record the result in131 - `docs/build-log.md` (one line per chunk: chunk, sha, verdict).132 + `build-log.md` (co-located in `.forge/wiki/docs/`) (one line per chunk: chunk, sha, verdict).133 2. Monorepo, single trunk: work happens in worktrees; merges onto main134 are the same ritual as the product itself — this repo eats its own135 dogfood from M3 onward.136 diff --git a/tests/audit.md b/.forge/wiki/docs/audit.md137 similarity index 100%138 rename from tests/audit.md139 rename to .forge/wiki/docs/audit.md140 diff --git a/docs/build-log.md b/.forge/wiki/docs/build-log.md141 similarity index 100%142 rename from docs/build-log.md143 rename to .forge/wiki/docs/build-log.md144 -- 145 2.47.3146