Skip to content

Commit ef819ea

Browse files
elasticdotventuresClaude Sonnet (coordinator)claude
authored
[codex] validate GitHub Pages docs payload in CI (#96)
* fix(ci): validate pages docs payload * feat(docs): wire mdbook-admonish preprocessor for mdbook 0.5 compatibility - Add [preprocessor.admonish] to book/book.toml via mdbook-admonish install - Refresh mdbook-admonish.css to v1.20.0 assets - Install mdbook-admonish from padamson/mdbook-admonish@feat/mdbook-0.5-compat (tommilligan/mdbook-admonish#235) in CI and docs workflows — released v1.20.0 was built against mdbook 0.4.x and fails on 0.5's null config fields - Add admonish presence check and install instructions to Justfile docgen recipe - Add smoke-test admonish blocks (note/warning/tip) to book/src/intro.md TODO: pin to a released version once #235 merges upstream Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ci): rename MDBOOK_* env vars to TOOL_ prefix to avoid mdbook config injection mdbook 0.5 reads MDBOOK_* env vars as config key overrides (strips prefix, lowercases, replaces _ with -). MDBOOK_MERMAID_VERSION was being injected as the unknown config key `mermaid-version`, causing `ERROR invalid key` on every docs build. MDBOOK_VERSION had the same risk with `version`. Renaming to TOOL_MDBOOK_VERSION / TOOL_MDBOOK_MERMAID_VERSION avoids the prefix match entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(docker): add kani-proofs to planner and builder COPY stages cargo chef prepare failed because kani-proofs was a workspace member but was not copied into the Docker context before the planner stage ran. Adds COPY to both planner (before cargo chef prepare) and builder. Adds wrkflw-ci-build.yml workflow and `just build` recipe to prove the fix locally without Docker: runs cargo chef prepare + ledgerr-mcp build via wrkflw emulation mode, asserting kani-proofs appears in the recipe. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(release): remove unknown cog field ignore_fixup_commits Field was rejected by cocogitto at runtime, blocking cog bump. Removed; merge-commit skipping is handled by ignore_merge_commits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ci): resolve workflow validation failures on every push Two workflows were failing GitHub's parse-time validation on every push: - publish.yml: secrets context is not available during job-level `if:` evaluation. Moved CRATES_IO_TOKEN/PYPI_API_TOKEN to job-level env vars and gated each step with `if: ${{ env.TOKEN != '' }}` instead. - wrkflw-docgen.yml: `runner.temp` is a job-execution context, not available in workflow-level `env:` blocks. Replaced with `/tmp/sccache` (always correct in emulation mode where wrkflw runs on the host). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet (coordinator) <coordinator@promptexecution.com.au> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 994b34c commit ef819ea

12 files changed

Lines changed: 196 additions & 42 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ permissions:
99
contents: write
1010
security-events: write
1111

12+
env:
13+
TOOL_MDBOOK_VERSION: "0.5.0"
14+
TOOL_MDBOOK_MERMAID_VERSION: "0.17.0"
15+
1216
jobs:
1317
test-and-build:
1418
runs-on: ubuntu-latest
@@ -116,8 +120,7 @@ jobs:
116120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117121

118122
docs-check:
119-
needs: test-and-build
120-
if: github.event_name == 'pull_request'
123+
name: Validate GitHub Pages docs build
121124
runs-on: ubuntu-latest
122125
steps:
123126
- name: Checkout
@@ -132,20 +135,17 @@ jobs:
132135
- name: Install just
133136
run: cargo install just --locked
134137

135-
- name: Setup mdBook
136-
uses: jontze/action-mdbook@v3
137-
with:
138-
token: ${{ secrets.GITHUB_TOKEN }}
139-
use-mermaid: true
140-
141-
- name: Install mdbook binaries
142-
run: cargo install mdbook mdbook-mermaid --locked
138+
- name: Install mdBook toolchain
139+
run: |
140+
cargo install mdbook --version "$TOOL_MDBOOK_VERSION" --locked
141+
cargo install mdbook-mermaid --version "$TOOL_MDBOOK_MERMAID_VERSION" --locked
143142
144143
- name: Install mdbook-admonish
145-
run: cargo install mdbook-admonish --locked
144+
# TODO: pin to a released version once tommilligan/mdbook-admonish#235 merges
145+
run: cargo install --git https://github.com/padamson/mdbook-admonish.git --branch feat/mdbook-0.5-compat mdbook-admonish
146146

147147
- name: Install mdbook-rhai-mermaid
148148
run: cargo install --path crates/mdbook-rhai-mermaid
149149

150-
- name: Validate docs
151-
run: just docgen-check
150+
- name: Validate GitHub Pages docs payload
151+
run: just docgen-pages-check

.github/workflows/docs.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: write
1111

12+
env:
13+
TOOL_MDBOOK_VERSION: "0.5.0"
14+
TOOL_MDBOOK_MERMAID_VERSION: "0.17.0"
15+
1216
jobs:
1317
deploy:
1418
runs-on: ubuntu-latest
@@ -19,26 +23,26 @@ jobs:
1923
- name: Install Rust
2024
uses: dtolnay/rust-toolchain@stable
2125

26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
2229
- name: Install just
2330
run: cargo install just --locked
2431

25-
- name: Setup mdBook
26-
uses: jontze/action-mdbook@v3
27-
with:
28-
token: ${{ secrets.GITHUB_TOKEN }}
29-
use-mermaid: true
30-
31-
- name: Install mdbook binaries
32-
run: cargo install mdbook mdbook-mermaid --locked
32+
- name: Install mdBook toolchain
33+
run: |
34+
cargo install mdbook --version "$TOOL_MDBOOK_VERSION" --locked
35+
cargo install mdbook-mermaid --version "$TOOL_MDBOOK_MERMAID_VERSION" --locked
3336
3437
- name: Install mdbook-admonish
35-
run: cargo install mdbook-admonish --locked
38+
# TODO: pin to a released version once tommilligan/mdbook-admonish#235 merges
39+
run: cargo install --git https://github.com/padamson/mdbook-admonish.git --branch feat/mdbook-0.5-compat mdbook-admonish
3640

3741
- name: Install mdbook-rhai-mermaid
3842
run: cargo install --path crates/mdbook-rhai-mermaid
3943

40-
- name: Build docs
41-
run: just docgen
44+
- name: Validate GitHub Pages docs payload
45+
run: just docgen-pages-check
4246

4347
- name: Deploy to GitHub Pages
4448
uses: peaceiris/actions-gh-pages@v3

.github/workflows/publish.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,47 +53,54 @@ jobs:
5353
publish-crates:
5454
runs-on: ubuntu-latest
5555
needs: publish-ghcr
56-
if: ${{ secrets.CRATES_IO_TOKEN != '' }}
56+
env:
57+
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
5758
steps:
5859
- name: Checkout
60+
if: ${{ env.CRATES_IO_TOKEN != '' }}
5961
uses: actions/checkout@v4
6062

6163
- name: Install Rust
64+
if: ${{ env.CRATES_IO_TOKEN != '' }}
6265
uses: dtolnay/rust-toolchain@stable
6366

6467
- name: Publish ledger-core
68+
if: ${{ env.CRATES_IO_TOKEN != '' }}
6569
run: cargo publish -p ledger-core --token "${CRATES_IO_TOKEN}"
66-
env:
67-
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
6870

6971
- name: Wait for crates.io index propagation
72+
if: ${{ env.CRATES_IO_TOKEN != '' }}
7073
run: sleep 20
7174

7275
- name: Publish ledgerr-mcp
76+
if: ${{ env.CRATES_IO_TOKEN != '' }}
7377
run: cargo publish -p ledgerr-mcp --token "${CRATES_IO_TOKEN}"
74-
env:
75-
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
7678

7779
publish-pypi:
7880
runs-on: ubuntu-latest
7981
needs: publish-ghcr
80-
if: ${{ secrets.PYPI_API_TOKEN != '' }}
82+
env:
83+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
8184
steps:
8285
- name: Checkout
86+
if: ${{ env.PYPI_API_TOKEN != '' }}
8387
uses: actions/checkout@v4
8488

8589
- name: Set up Python
90+
if: ${{ env.PYPI_API_TOKEN != '' }}
8691
uses: actions/setup-python@v5
8792
with:
8893
python-version: "3.11"
8994

9095
- name: Build Python package
96+
if: ${{ env.PYPI_API_TOKEN != '' }}
9197
working-directory: plugins/l3dg3rr-plugin-create/python
9298
run: |
9399
python -m pip install --upgrade pip build
94100
python -m build
95101
96102
- name: Publish to PyPI
103+
if: ${{ env.PYPI_API_TOKEN != '' }}
97104
uses: pypa/gh-action-pypi-publish@release/v1
98105
with:
99106
packages-dir: plugins/l3dg3rr-plugin-create/python/dist/
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# wrkflw-ci-build: local CI build verification (emulation mode, no Docker required)
2+
# Run with: wrkflw run .github/workflows/wrkflw-ci-build.yml
3+
# Or via: just build
4+
#
5+
# Proves that:
6+
# 1. cargo chef prepare succeeds (the planner step that failed without kani-proofs)
7+
# 2. cargo build -p ledgerr-mcp compiles cleanly
8+
#
9+
# Requires: Rust toolchain on host (cargo-chef installed automatically if missing)
10+
name: wrkflw-ci-build
11+
12+
on:
13+
workflow_dispatch:
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
RUST_BACKTRACE: "1"
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
jobs:
24+
planner-smoke:
25+
name: "Planner smoke (cargo chef prepare)"
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Install cargo-chef
31+
run: |
32+
if ! command -v cargo-chef >/dev/null 2>&1; then
33+
cargo install cargo-chef --locked
34+
fi
35+
36+
- name: Run cargo chef prepare
37+
run: |
38+
cargo chef prepare --recipe-path /tmp/recipe.json
39+
echo "=== recipe.json written ($(wc -c < /tmp/recipe.json) bytes) ==="
40+
python3 -c "
41+
import json, sys
42+
d = json.load(open('/tmp/recipe.json'))
43+
members = [m['relative_path'] for m in d['skeleton']['manifests']]
44+
print('workspace members in recipe:', len(members))
45+
for m in members:
46+
print(' ', m)
47+
assert any('kani-proofs' in m for m in members), 'kani-proofs missing from recipe!'
48+
print('PASS: kani-proofs present in cargo chef recipe')
49+
"
50+
51+
build-mcp:
52+
name: "Build ledgerr-mcp"
53+
needs: [planner-smoke]
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Build ledgerr-mcp
59+
run: cargo build -p ledgerr-mcp --bin ledgerr-mcp-server

.github/workflows/wrkflw-docgen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
# (wrkflw secure-emulation runs as host processes — no sandboxing of the daemon).
2424
# If sccache is not installed, RUSTC_WRAPPER is silently ignored by cargo.
2525
RUSTC_WRAPPER: sccache
26-
SCCACHE_DIR: ${{ runner.temp || '/tmp' }}/sccache
26+
SCCACHE_DIR: /tmp/sccache
2727
CARGO_TERM_COLOR: always
2828
RUST_BACKTRACE: "1"
2929

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ FROM chef AS planner
1818
COPY Cargo.toml Cargo.lock ./
1919
COPY crates ./crates
2020
COPY xtask ./xtask
21+
COPY kani-proofs ./kani-proofs
2122
RUN cargo chef prepare --recipe-path recipe.json
2223

2324
# ── build ─────────────────────────────────────────────────────────────────────
@@ -28,6 +29,7 @@ RUN cargo chef cook --release --recipe-path recipe.json
2829
COPY Cargo.toml Cargo.lock ./
2930
COPY crates ./crates
3031
COPY xtask ./xtask
32+
COPY kani-proofs ./kani-proofs
3133
COPY docs ./docs
3234
COPY rules ./rules
3335
COPY scripts ./scripts

Justfile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,12 @@ stats:
433433

434434
# Build mdbook documentation locally
435435
# Requires: cargo install mdbook mdbook-mermaid && cargo install --path crates/mdbook-rhai-mermaid
436+
# mdbook-admonish: cargo install --git https://github.com/padamson/mdbook-admonish.git --branch feat/mdbook-0.5-compat mdbook-admonish
437+
# TODO: switch to a released version once tommilligan/mdbook-admonish#235 merges
436438
docgen:
437439
@if [ ! -x ~/.cargo/bin/mdbook ]; then echo "error: mdbook not found — run: cargo install mdbook mdbook-mermaid"; exit 1; fi
438440
@if [ ! -x ~/.cargo/bin/mdbook-mermaid ]; then echo "error: mdbook-mermaid not found — run: cargo install mdbook-mermaid"; exit 1; fi
441+
@if [ ! -x ~/.cargo/bin/mdbook-admonish ]; then echo "error: mdbook-admonish not found — see comment above docgen recipe in Justfile"; exit 1; fi
439442
@if [ ! -x ~/.cargo/bin/mdbook-rhai-mermaid ]; then cargo install --path crates/mdbook-rhai-mermaid --quiet; fi
440443
PATH="$HOME/.cargo/bin:$PATH" ~/.cargo/bin/mdbook build book
441444
@echo "Docs built in book/book/ — serve with: npx serve book/book"
@@ -475,9 +478,19 @@ docgen-check:
475478
@echo "Running live-editor unit tests..."
476479
@node --test book/theme/rhai-live-core.test.js
477480
@echo "Checking iso-pipeline-objects.html has at least 5 mermaid blocks..."
478-
@count=$$(grep -c 'class="mermaid"' book/book/iso-pipeline-objects.html); echo "Found $$count mermaid blocks in iso-pipeline-objects.html"; if [ "$$count" -lt 5 ]; then echo "error: expected at least 5 mermaid blocks, found $$count"; exit 1; fi; echo "✓ iso-pipeline-objects.html has $$count mermaid blocks (>= 5)"
481+
@count=$(grep -c 'class="mermaid"' book/book/iso-pipeline-objects.html || true); echo "Found $count mermaid blocks in iso-pipeline-objects.html"; if [ "$count" -lt 5 ]; then echo "error: expected at least 5 mermaid blocks, found $count"; exit 1; fi; echo "✓ iso-pipeline-objects.html has $count mermaid blocks, expected at least 5"
479482
@echo "All documentation diagrams validated!"
480483

484+
# Verify the exact mdBook output directory published to GitHub Pages.
485+
docgen-pages-check:
486+
just docgen-check
487+
@test -f book/book/index.html || { echo "error: GitHub Pages publish payload missing book/book/index.html"; exit 1; }
488+
@compgen -G 'book/book/theme/rhai-live-core*.js' >/dev/null || { echo "error: GitHub Pages publish payload missing live editor core asset"; exit 1; }
489+
@compgen -G 'book/book/theme/rhai-live-*.js' >/dev/null || { echo "error: GitHub Pages publish payload missing live editor asset"; exit 1; }
490+
@compgen -G 'book/book/mdbook-admonish*.css' >/dev/null || { echo "error: GitHub Pages publish payload missing admonish CSS"; exit 1; }
491+
@grep -q 'l3dg3rr Ledger Documentation' book/book/index.html || { echo "error: GitHub Pages index does not look like the hosted docs"; exit 1; }
492+
@echo "✓ GitHub Pages docs payload validated at book/book/"
493+
481494
# Negative test: verify broken cross-references are present in output (mdBook
482495
# does not fail on broken links at build time — this confirms the behavior)
483496
docgen-check-negative:
@@ -505,6 +518,16 @@ docgen-check-negative:
505518
test-mcp-providers:
506519
cargo test -p ledgerr-mcp --test mcp_provider_smoke 2>&1 | tail -20
507520

521+
# ─── build: local CI build via wrkflw ──────────────────────────────────────
522+
523+
# Prove the Dockerfile planner fix: runs cargo chef prepare + ledgerr-mcp build
524+
# via wrkflw emulation mode (no Docker required).
525+
build emulation="emulation":
526+
@if ! command -v wrkflw >/dev/null 2>&1; then echo "error: wrkflw not found — run: cargo install wrkflw"; exit 1; fi
527+
@echo "=== wrkflw: CI build verification ==="
528+
wrkflw run --runtime {{emulation}} .github/workflows/wrkflw-ci-build.yml
529+
@echo "=== build complete ==="
530+
508531
# ─── wrkflw: local CI pipeline runner ──────────────────────────────────────
509532

510533
# Run the wrkflw-local-docgen workflow locally using emulation mode (no Docker).

book/book.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ language = "en"
44
src = "src"
55
title = "l3dg3rr Ledger Documentation"
66

7-
[preprocessor.admonish]
8-
command = "mdbook-admonish"
9-
assets_version = "3.1.0" # do not edit: managed by `mdbook-admonish install`
10-
117
[preprocessor.rhai-mermaid]
128
command = "mdbook-rhai-mermaid"
139
before = ["mermaid"]
1410

1511
[preprocessor.mermaid]
1612
optional = true
17-
after = ["rhai-mermaid", "admonish"]
13+
after = ["rhai-mermaid"]
14+
15+
[preprocessor.admonish]
16+
command = "mdbook-admonish"
17+
assets_version = "3.1.0" # do not edit: managed by `mdbook-admonish install`
1818

1919
[output.html]
2020
edit-url-template = "https://github.com/PromptExecution/l3dg3rr/edit/main/book/src/{path}#L{line}"

book/src/intro.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Introduction
22

3-
```admonish info
4-
**l3dg3rr** is designed for US expats who need to reconcile complex financial histories across multiple jurisdictions (US, AU, UK) without compromising privacy.
5-
```
3+
<div class="admonition info">
4+
<div class="admonition-title">Info</div>
5+
<p><strong>l3dg3rr</strong> is designed for US expats who need to reconcile complex financial histories across multiple jurisdictions (US, AU, UK) without compromising privacy.</p>
6+
</div>
67

78
`l3dg3rr` is a local-first financial document intelligence system
89
for retroactive U.S. expat tax preparation. It ingests raw statements, classifies transactions with editable rules, verifies hard constraints, and exports an accountant-usable Excel workbook with audit history.
@@ -53,3 +54,16 @@ The visualization chapters document the live mdBook diagram system. They are imp
5354
- [Workbook & Audit](./workbook-audit.md)
5455
- [Theory of Operation](./theory.md)
5556
- [Graph Data Model](./graph.md)
57+
58+
<!-- mdbook-admonish smoke-test: remove once verified rendering works -->
59+
```admonish note title="Local-first by design"
60+
All processing runs on your machine — no private financial data leaves the host.
61+
```
62+
63+
```admonish warning
64+
PDF ingestion rewrites the workbook in-place. Back up `tax-ledger.xlsx` before running a full re-ingest.
65+
```
66+
67+
```admonish tip title="CPA handoff"
68+
Export the workbook after every classification pass so your accountant always has the latest reconciled state.
69+
```

0 commit comments

Comments
 (0)