You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,6 +291,11 @@ Treat this as a standing operational gate, not a one-time migration task.
291
291
- Legacy `l3dg3rr_*` and proxy tool names remain compatibility aliases only and should not be reintroduced into the advertised catalog.
292
292
- 2026-04-21: Xero is now part of the advertised MCP catalog as `ledgerr_xero`, making the default published surface 8 top-level `ledgerr_*` tools.
293
293
- Keep generated docs and AGENTS guidance aligned to `crates/ledgerr-mcp/src/contract.rs`; older references to a 7-tool surface are stale.
294
+
- 2026-05-03: Negative/error-path testing added for the docgen pipeline.
295
+
-`crates/mdbook-rhai-mermaid/src/parser.rs` has 7 malformed-input tests in `#[cfg(test) mod tests]` that verify the parser never panics and gracefully degrades on misspelled keywords, missing arrows, empty targets, double arrows, and very long labels.
296
+
-`just docgen-check-negative` creates a temp `book/src/broken.md` with invalid cross-references, builds the book, verifies the broken links are present in the HTML output (confirming mdBook does not fail on broken links at build time), and cleans up.
297
+
-`just docgen-check` now also asserts that `book/book/iso-pipeline-objects.html` has at least 5 mermaid blocks.
298
+
- Run parser negative tests with: `cargo test -p mdbook-rhai-mermaid -- malformed`
294
299
- Documentation hierarchy should lead with operator capabilities first, then application structure, then visualization internals.
295
300
- Use Z3 for hard satisfiability/proof obligations and Kasuari for soft plausibility/layout constraints.
296
301
-`ledger-core` keeps native Z3 behind the `legal-z3` feature because default local builds may not have `libz3` installed.
@@ -406,7 +411,14 @@ Treat this as a standing operational gate, not a one-time migration task.
406
411
-**Z-layer stack consistency**: The 6-layer Z stack (Document→Pipeline→Constraint→Legal→FormalProof→Attestation) and the 21+ `HasVisualization` impls can be validated across all layers without needing a real ledger dataset — S2+S7 cover the full impl surface via `--test iso_lint` and `--test-threads=1`.
407
412
-**Cross-stage composition coverage**: The `ConstraintSolver` trait (KasuariSolver in pipeline.rs), `LayoutSolver` (visualize.rs), and `LegalSolver` (legal.rs, Z3-gated) are independent solver engines that share `Issue`, `MetaCtx`, and `CommitGate` types — wrkflw stages independently validate each while the summary signals overall contract consistency.
408
413
-**Docgen as integration test**: S5 (mdBook build) indirectly tests the `mdbook-rhai-mermaid` preprocessor, which uses the same `parser::Graph` types exported as a library (lib.rs) — proving the parser works both as an mdBook plugin and as a standalone library for b00t synergy_viz.
409
-
-**What's NOT tested**: McpProviderRegistry initialization, Xero live API calls, crash recovery/idempotency, concurrency groups, service containers, negative testing with malformed inputs, and cross-stage artifact sharing.
414
+
-**What's NOT tested**: McpProviderRegistry initialization, Xero live API calls, crash recovery/idempotency, concurrency groups, service containers, and cross-stage artifact sharing.
415
+
- 2026-05-03: Crash recovery audit (Gap 6).
416
+
-**Crash recovery exists.**`TurboLedgerService` persists restart-visible state as a JSON sidecar (`{workbook}.l3dg3rr.state.json`) next to the manifest workbook path. The sidecar bundles: ingest idempotency state, transaction row cache, audit log, lifecycle event history, and HSM checkpoint.
417
+
-**Atomic write pattern**: `persist_state_to_path` writes to a temp file then `rename()`s to the final path — a crash during write leaves the previous valid sidecar intact.
418
+
-**Fail-closed on corruption**: `load_persisted_state` rejects unparseable or version-mismatched sidecars (fails closed instead of silently resetting).
419
+
-**Test coverage**: `crates/ledgerr-mcp/tests/restart_persistence.rs` has 3 tests covering ingest+classify+flags+audit sidecar survival, event history+replay after reload, and HSM checkpoint persistence across `from_manifest_str` boundaries.
420
+
-**Not covered**: Crash during classification/tool execution (sidecar write is post-hoc, not transactionally atomic with the mutation). No crash-in-the-middle fuzzing. No concurrent-writer protection (single-user assumption). No WAL/journal replay for the sidecar itself.
421
+
-**Idempotency layer**: Blake3 content-hash IDs make `ingest_statement_rows` idempotent at the core level regardless of sidecar state — re-ingesting the same rows after a lost sidecar produces the same tx_ids with `inserted_count: 0`.
410
422
- 2026-04-24: README/product framing is bookkeeping-first with visual workflow graph as the organizing model.
411
423
- Describe `l3dg3rr` as a strongly typed, ontologically linked graph of scriptable visual-first workflows for supervised AI/LLM ETL into CPA-auditable bookkeeping artifacts.
PATH="$$HOME/.cargo/bin:$$PATH" $$HOME/.cargo/bin/mdbook build book
487
+
@echo "Verifying broken link appears in output (mdBook doesn't fail at build time)..."
488
+
@grep -q 'href="./nonexistent.html"' book/book/broken.html && echo "✓ confirmed: nonexistent.html link present in output"|| { echo "error: expected broken link not found"; rm -f book/src/broken.md; exit 1; }
489
+
@grep -q 'href="../nonexistent/deep.html"' book/book/broken.html && echo "✓ confirmed: deep broken link present in output"|| { echo "error: expected deep broken link not found"; rm -f book/src/broken.md; exit 1; }
490
+
@grep -q 'href="./intro.html"' book/book/broken.html && echo "✓ confirmed: valid link also present"|| { echo "error: valid link missing"; rm -f book/src/broken.md; exit 1; }
491
+
@echo "Cleaning up temp test file..."
492
+
rm -f book/src/broken.md
493
+
rm -rf book/book/broken.html
494
+
@echo "✓ docgen-check-negative passed — mdBook does not fail on broken links"
495
+
496
+
# Run the McpProvider smoke test (compile-and-construct, no external binaries needed)
497
+
test-mcp-providers:
498
+
cargo test -p ledgerr-mcp --test mcp_provider_smoke 2>&1 | tail -20
499
+
470
500
# ─── wrkflw: local CI pipeline runner ──────────────────────────────────────
471
501
472
502
# Run the wrkflw-local-docgen workflow locally using emulation mode (no Docker).
0 commit comments