From 8feb93da78b90f59098f4b53470eee1b906a8219 Mon Sep 17 00:00:00 2001 From: Andriy Oblivantsev Date: Fri, 14 Aug 2026 10:58:12 +0100 Subject: [PATCH] ci: recall@5 SoT is Zig bin/brain/eval.go. GitHub Actions rebuilds the repo corpus and runs the Go eval gate instead of Python bin/kb/eval. Audit self is a hard fail (Gitea #19). --- .github/workflows/ci.yml | 11 ++++++++--- PLAN.md | 8 ++++---- bin/tools/test_bin_layout.py | 9 +++++++++ docs/roadmap.md | 13 ++++++++----- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 040fdaa..94b8ae7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,18 @@ jobs: run: go test ./internal/brain/rank -count=1 - name: facts/audit self (lexicon consistency, no network) - run: | - ./bin/facts/audit self 2>/dev/null || echo "audit: not yet implemented; gate skipped" + run: ./bin/facts/audit self - - name: CGO via Zig (compile brain/search) + - name: CGO via Zig (compile brain/search + eval) run: | chmod +x bin/cgo/zig bin/cgo/zcc bin/cgo/zc++ bin/cgo/zig go build -tags system_ladybug -o /tmp/brain-search ./bin/brain/search.go + bin/cgo/zig go build -tags 'system_ladybug,brain_eval' -o /tmp/brain-eval ./bin/brain/eval.go + + - name: recall@5 SoT (Zig bin/brain/eval.go) + run: | + uv run python bin/kb/index --rebuild --json + /tmp/brain-eval --json release: name: Release (semver) diff --git a/PLAN.md b/PLAN.md index b9338e2..a271d9e 100644 --- a/PLAN.md +++ b/PLAN.md @@ -144,8 +144,8 @@ Common props on every node/edge: `root`, `confidence`, `evidence[]`, `how`, 2. `go test ./internal/brain/rank` (cgo-free ranking + flag parser) 3. python -m unittest discover -s bin/tools (includes published-docs SoT) 4. `bin/facts/audit self` (lexicon internal consistency; `bin/facts/audit.go` is the D14 wrapper) -5. `bin/kb/eval` (recall@5 ≥ 0.95). Local SoT is `bin/brain/eval.go` via Zig CGO. - CI SoT switch: [#19](https://git.produktor.io/eSlider/2dph/issues/19). +5. `bin/brain/eval.go` via Zig (recall@5 ≥ 0.95). Python `bin/kb/eval` is an + explicit fallback, not the CI SoT. 6. `bin/cgo/zig go build -tags system_ladybug` (compile search with zig cc; fetches pinned zig+libs). Feedback loop: every commit → PR → CI → green/gate → merge. Same discipline as @@ -164,7 +164,7 @@ Feedback loop: every commit → PR → CI → green/gate → merge. Same discipl ## Gap to v1 (epic #16) -Remaining: CI eval SoT. Board: +Remaining: none for epic #16 (v1). Board: [epic #16](https://git.produktor.io/eSlider/2dph/issues/16), milestone [v1 detective brain](https://git.produktor.io/eSlider/2dph/milestone/12). Narrative: [docs/roadmap.md](docs/roadmap.md). @@ -175,6 +175,6 @@ Narrative: [docs/roadmap.md](docs/roadmap.md). | 2 | [#17](https://git.produktor.io/eSlider/2dph/issues/17) | **in** — `--hop N` walks `FROM_FILE` → `HAS_VERSION` → `AUTHORED` (max 3). | | 3 | [#18](https://git.produktor.io/eSlider/2dph/issues/18) | **in** — `--with-facts` / `--facts-json` land `root=facts`; `--with-chats` indexes `var/chats/md`. WhatsApp sync is out of v1. | | 4 | [#15](https://git.produktor.io/eSlider/2dph/issues/15) | **in** — lever/loop documented (`search` → `get` → `audit`). | -| 5 | [#19](https://git.produktor.io/eSlider/2dph/issues/19) | GitHub CI recall still runs Python `bin/kb/eval`. | +| 5 | [#19](https://git.produktor.io/eSlider/2dph/issues/19) | **in** — CI recall SoT is `bin/brain/eval.go` via Zig. Python `bin/kb/eval` stays as an explicit fallback. | Does **not** block epic close: [#6](https://git.produktor.io/eSlider/2dph/issues/6) OCR, OQ1, OQ3, OQ4. \ No newline at end of file diff --git a/bin/tools/test_bin_layout.py b/bin/tools/test_bin_layout.py index 88691b0..382934c 100644 --- a/bin/tools/test_bin_layout.py +++ b/bin/tools/test_bin_layout.py @@ -207,3 +207,12 @@ class BinLayoutTest(unittest.TestCase): search = (ROOT / "bin" / "kb" / "search").read_text() self.assertIn("bin/cgo/zig", search) self.assertNotIn("command -v gcc", search) + + def test_ci_recall_sot_is_zig_brain_eval(self) -> None: + ci = (ROOT / ".github" / "workflows" / "ci.yml").read_text() + self.assertIn("bin/brain/eval.go", ci) + self.assertIn("system_ladybug,brain_eval", ci) + self.assertIn("/tmp/brain-eval", ci) + self.assertNotIn("bin/kb/eval", ci) + self.assertNotIn("gate skipped", ci) + self.assertIn("./bin/facts/audit self", ci) diff --git a/docs/roadmap.md b/docs/roadmap.md index c4eced3..314d341 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -26,11 +26,18 @@ Compose `api` (no CPython) / `index` (Python write). Issues #1–#5, #7–#13. [#15](https://git.produktor.io/eSlider/2dph/issues/15) lever/loop. [#14](https://git.produktor.io/eSlider/2dph/issues/14) `bin/brain/add.go` / `POST /ingest` (Python `kblib.add_leafs`; no Go upsert port). +[#17](https://git.produktor.io/eSlider/2dph/issues/17) `--hop N` walks +FROM_FILE / HAS_VERSION / AUTHORED. [#18](https://git.produktor.io/eSlider/2dph/issues/18) `--with-facts` / `--with-chats` on rebuild (WhatsApp out of v1). +[#19](https://git.produktor.io/eSlider/2dph/issues/19) CI recall SoT = +`bin/brain/eval.go` via Zig. ## Blockers +None for epic #16. v2: [#6](https://git.produktor.io/eSlider/2dph/issues/6) OCR, +OQ1 contradiction resolution, OQ3 duckdb-md, OQ4 YAML-first leafs. + ``` question │ @@ -42,9 +49,6 @@ question └─ facts+chats corpus ← in ``` -1. **[#19](https://git.produktor.io/eSlider/2dph/issues/19) CI eval** — - recall SoT should be `bin/brain/eval.go` via Zig, not Python `bin/kb/eval`. - ## Not v1 [#6](https://git.produktor.io/eSlider/2dph/issues/6) OCR (OQ2), OQ1 @@ -52,5 +56,4 @@ contradiction resolution, OQ3 duckdb-md export, OQ4 YAML-first leafs. ## Close epic #16 when -- MCP tool order is documented and still gated by tests -- CI recall SoT is `bin/brain/eval.go` via Zig +Children #14, #15, #17, #18, #19 are closed. MCP tool order stays gated by tests.