feat(ledgerr-mcp): PRD-10 financial pipeline + MCP gaps #24 #25 #26#89
Merged
Conversation
- Add target/, target-windows/, _b00t_/ runtime dirs, .b00t/datums/*.toml - Add .gap*-review.md / .gap*-verdict.md bouncer artifact patterns - Commit .claude/settings.json: project-level read-only tool allowlist (codebase-memory MCP, cargo query tools, rustup queries) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… wiring Specifies the three load-bearing gaps to close: - PdfIngestOp: reqif-opa-mcp subprocess → classify_waterfall → workbook - WorkbookWriter: ClassificationOutcome rows, mutation history, Excel validation - LedgrrAgtGateway wired into ledgerr-mcp gate.rs dispatch Plus: Cedar/AGT gate replacing OpaGateOp stub, notify watcher for hot-reload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Arc<LedgrrAgtGateway> field to gate actor to enable
ring-based policy enforcement and arc-kit-au provenance tracking.
- Wrap each tool dispatch with gw.check_tool_call(agent_id, tool_name, input_json)?
- Map PolicyDecision::Deny → ToolError::PolicyDenied(reason)
- Map RateLimited → ToolError::RateLimited { retry_after_secs }
- After successful dispatch, emit arc-kit-au provenance edge with ExecutedBy type
Ring enforcement implemented per PRD-10 AC 226-230:
- ingest_pdf: Standard (agents denied at Sandboxed)
- classify_transaction: Standard (agents denied at Sandboxed)
- edit_rhai_rule: Admin (agents denied at Standard/Restricted)
- commit_workbook: Standard (no GateMessage variant yet)
- promote_agent: Admin (no GateMessage variant yet)
Added 5 integration tests for governance behavior verification.
All tests pass (35/35).
Related PRD-10: lines 74-97 (AGT governance wiring)
…tection - Add PipelineWatcher struct with rule_dir, ingest_dir, registry, ingest_tx - Implement spawn() method using notify crate for filesystem monitoring - On .rhai ModifyKind::Data changes: reload RuleRegistry within 600ms - On .pdf create events: send path to ingest channel within 600ms - Debounce: 500ms default, configurable - Add comprehensive tests for all acceptance criteria: * Rule reload timing (AC 237) * PDF create detection (AC 238) * Metadata-only change ignored (AC 239) - Add filetime dev-dependency for metadata touch tests Closes Gap 5: notify watcher for rule hot-reload
…iter, PdfIngestOp, CedarGateOp, notify watcher
Agent-Logs-Url: https://github.com/PromptExecution/ledgrrr/sessions/e328de4e-0ed2-442f-bc13-43b0e8a23c4a Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PromptExecution/ledgrrr/sessions/e328de4e-0ed2-442f-bc13-43b0e8a23c4a Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PromptExecution/ledgrrr/sessions/e328de4e-0ed2-442f-bc13-43b0e8a23c4a Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
… queue (#24 #25 #26) Close three MCP exposure gaps identified in phase6_mcp_exposure_gaps: **Issue #26 — query_transactions** - Paginated, filterable, sortable transaction query over classification state - Filters: account_id, date_range, amount_range (Decimal strings), category, source_ref, description_contains - Sort by date/amount/description + asc/desc; pagination with 1000-item cap - Amount filter boundary validated as ToolError::InvalidInput on bad parse; stored tx amounts fall back to Decimal::ZERO (invariant, not user input) **Issue #25 — batch_classify, bulk_resolve_flags, apply_mapping_bulk** - Stateless BatchExecutor (batch_executor.rs) — testable without full service init - Per-call BatchMode: AllOrNothing | ContinueOnError - FlagResolution enum: Approve | Reject | Escalate | Dismiss | Defer - apply_mapping_bulk: exact → substring → prefix priority matching order - Per-item BatchItemResult with audit entries on every successful operation **Issue #24 — fetch_work_queue** - Unified QueueItem[] aggregator across flags, audit log, and stub types - QueueItemType: Flag | Ambiguity | Blocker | DocumentIssue | ManualChange - Lock-then-drop pattern: classification lock released before event log acquired - Provenance field on every item (TaxTool | EventLog | Classification | DocumentRegistry) - Updated_after / status / item_type filters + created_at-desc sort + pagination **Fixes (warnings → zero)** - apply_transaction_filters/sort: removed unsafe unwrap on Decimal::from_str - Removed dead code: ambiguity_to_queue_item, now_timestamp_iso8601, emit_provenance_edge - Fixed unused confidence variable, removed unused imports - Wired missing ReviewArgs::FetchQueue dispatch arm and PUBLISHED_TOOLS entry - Deleted .backup and test artifact files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
Member
|
@copilot critically review in good faith the changes; fix minor issues; propose solutions for larger issues |
…vior Agent-Logs-Url: https://github.com/PromptExecution/ledgrrr/sessions/3a8fa5a5-7a06-4409-ab1d-55a6751c62a4 Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PromptExecution/ledgrrr/sessions/3a8fa5a5-7a06-4409-ab1d-55a6751c62a4 Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Contributor
Addressed in 48ff684 (plus 117a8c0): fixed the CI-blocking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
query_transactions: paginated, filterable, sortable transaction query with Decimal-safe amount range filterbatch_classify,bulk_resolve_flags,apply_mapping_bulk: bulk review ops with per-item audit trail and AllOrNothing/ContinueOnError modesfetch_work_queue: unified work queue aggregating flags, manual changes, and stub types (Ambiguity/Blocker/DocumentIssue) with provenance trackingunwraponDecimal::from_strin financial paths, wired missingReviewArgs::FetchQueuedispatch arm andPUBLISHED_TOOLSentrySafety notes
amount_rangefilter bounds (user input) →ToolError::InvalidInputon bad parseunwrap_or(Decimal::ZERO)(internal invariant, not user input)fetch_work_queueuses lock-then-drop pattern — never holds classification + event locks simultaneouslyTest plan
cargo check -p ledgerr-mcp— zero warnings, zero errorstests/query_transactions_tests.rs— filter, sort, pagination, MCP advertisetests/batch_operations.rs— classify, resolve flags, apply mapping bulktests/unified_queue.rs— all types, filter by type/status, pagination, ordering, provenance, manual change ref🤖 Generated with Claude Code