Daily Accounting on the Substrate¶
Maintained by: chat-MC1 with corrections from Brandon and AM
Summary¶
Daily steady-state bookkeeping runs continuously on the substrate as a third substrate-native agent (alongside substrate-monitor and amp-discovery). Same pattern: harness-gated dispatch, audit-logged, MM-notify on exceptions, dashboard surfaces — but scoped to financial state across the 7 ATG-family entities.
Independent of the rest of the framework. Doesn't depend on AMP auction work, AI Comm Platform, OM cutover, or anything else. Parallel substrate workload that ships and runs on its own track. Brandon's directive 2026-05-25 ~19:40 PT: "get the daily bookkeeping and accounting tasks (not the cleanup project) working off the substrate; this stuff is independent of the rest of the process."
Cleanup project remains separate. AM owns both workstreams but they're operationally distinct: cleanup = historical-books-fix (project, finite); daily = steady-state recurring bookkeeping (ongoing, continuous).
What's already built (existing infrastructure leveraged)¶
| Component | Path | State |
|---|---|---|
| QB bridge | D:\Projects\qb-bridge-nightly\ |
Live; pulls QB data nightly from SEQ-QBHOST |
| QB warehouse | D:\var\qb-warehouse\{atg,seq,det,...}.duckdb |
Per-entity DuckDB files (P&L, A/R, Trial Balance) |
| Finance API | pm-dashboard-api /api/biz/finance/* |
Some endpoints live (sync); others stubbed |
| Dashboard B | Financial dashboard rendered by WDM | Phase 1 shipped per IT's 5/22 / SE-App's 5/23 work |
| AM-knowledge | D:\Projects\qb-bridge\accounting-manager-knowledge\ |
AM's institutional KB (post-QBCA merger 5/24) |
| Substrate harness | Live since 5/23 | Bedrock gates ready to fire on accounting actions |
What the daily-accounting agent does¶
Continuous-process agent following the substrate-monitor pattern. Cycles every 4 hours during business hours (configurable to every-morning-only).
Each cycle dispatches one or more accounting tools through the harness:
| Tool | Reversibility | Cadence | Output |
|---|---|---|---|
daily_cash_position |
PURE | Every cycle | Cash across all entities + A/R total + A/P total + floor plan util |
ar_aging_summary |
PURE | Daily | A/R aged buckets per entity; flag accounts >60 days |
ap_aging_summary |
PURE | Daily | A/P aged buckets per entity; flag bills due in next 7 days |
truck_cost_in_per_lot |
PURE | Daily | Compute per-truck cost-in (acquisition + transport + materials + labor allocated) |
intercompany_balance_check |
PURE | Daily | Reconcile SEQ↔STE↔CTP↔SP intercompany positions |
floor_plan_utilization |
PURE | Daily | NextGear $2.5M line utilization + per-truck flooring status |
sales_tax_accrual |
PURE | Daily | Multi-state sales tax accrual (AZ + others) |
flag_categorization_needed |
PURE | Daily | Identify uncategorized transactions; surface to AM/Brandon for manual review |
daily_pnl_mini_report |
PURE | Daily | Per-entity P&L delta vs prior period |
All Phase 1 tools are PURE (read-only on the world). Writes only happen to:
- agent_audit_log (Supabase) — every dispatch
- Local snapshot JSON for dashboard rendering
- MM #handoffs / #principal channels on exceptions
What this is NOT¶
- NOT auto-posting transactions to QuickBooks. That's bedrock-#3 (irreversible external action). When AI would categorize/post a transaction, it goes HOLD_FOR_REVIEW; Brandon/AM approves; THEN the posting fires through a separate gated tool (Phase 2 scope, not Phase 1).
- NOT the cleanup project. Cleanup is AM's historical-books-fix workstream; this is steady-state daily ops.
- NOT auto-invoicing or auto-paying. Customer invoices + vendor bill payments are EXTERNAL_IRREVERSIBLE; HOLD_FOR_REVIEW always until Phase 2+ specific authorization.
- NOT replacing AM's judgment. AM still owns reconciliation calls, categorization standards, audit prep. The agent surfaces state + flags exceptions; AM resolves.
Bedrock alignment¶
- #1 (Aggregate harm cap): zero monetary impact in Phase 1 (read-only). Phase 2 (gated transaction posting) declares per-transaction impact_cents.
- #2 (No harm to customers): customer-facing impact deferred to Phase 2+ (auto-invoicing scope).
- #3 (Reversibility): Phase 1 is PURE. Phase 2 gated postings are EXTERNAL_IRREVERSIBLE → HOLD_FOR_REVIEW.
- #4 (Truthfulness): agent surfaces numbers as computed; flags any uncertainty (e.g., balance-sheet reconciliation gap discovered today).
- #5 (Scope): agent stays in accounting lane; doesn't decide product strategy or customer comms.
- #6 (Source preservation): QB data is preserved verbatim; agent reads warehouse extracts but never alters QB itself.
- #7 (Continuity): all state in agent_audit_log + per-cycle snapshot JSON; restart-safe.
Phasing¶
Phase 1 — Read-only daily summaries (ships TODAY)¶
daily_cash_positiontool dispatched through harness every 4 hours- DuckDB warehouse reads via existing qb-bridge-nightly pipeline
- MM #handoffs post on exceptions (e.g., cash position < threshold; A/R aging slipping; floor plan util > 75%)
- Snapshot JSON at
/accounting/metrics.jsonfor future dashboard - nssm service:
claude-accounting-daily(install.ps1 ready for IT formalization)
Phase 2 — A/R + A/P aging + intercompany reconciliation (next 1-2 weeks)¶
- Adds
ar_aging_summary,ap_aging_summary,intercompany_balance_check - Sales tax accrual computed but not posted
- AM ratification gate for categorization standards before any HOLD_FOR_REVIEW transaction posting
Phase 3 — HOLD_FOR_REVIEW transaction categorization (3-4 weeks)¶
- AI categorizes uncategorized transactions → HOLD_FOR_REVIEW
- AM/Brandon approves via dashboard
- Approved category → gated
post_categorization_to_qbtool with EXTERNAL_REVERSIBLE reversibility (QB categorization is reversible within the same period) - Per-transaction audit trail
Phase 4 — Invoice + bill workflows (later; requires Brandon-explicit ratification per workflow)¶
- AI drafts customer invoices → HOLD_FOR_REVIEW
- AI flags vendor bills approaching due → notification only (payment is Brandon-action)
- Sales tax filings — assist only, never auto-file
Roles + lanes¶
| Role | Owns | Frequency |
|---|---|---|
| Brandon Tomkins | Principal-judgment on categorization standards, reconciliation calls, exception escalations | As needed |
| AM (Accounting Manager) | Operational steward; reviews agent exceptions; sets categorization rules; coordinates with QB Assistant for cleanup workstream | Daily session |
| claude-mc1-code | Authored substrate agent v0.1 starting draft (today) | One-shot author |
| SE-App | qb-bridge ongoing; per-entity P&L + A/R + trial balance pipeline; finance API extension | Per ad-hoc |
| WDM | /accounting/ dashboard view (or extend Dashboard B); per-entity cash position cards |
Per ship |
| OM | KPI scoreboard integration; flag exceptions in EOD digest | Daily |
Open questions (chat-MC1 strategic ratification)¶
- MM channel for accounting alerts. Use
#handoffs(current) or stand up#accounting? Recommendation:#handoffsfor Brandon-attention items,#accounting(new) for AM-attention routine flow. Brandon ratifies. - Categorization rules canonical location. Currently in AM's institutional knowledge + scattered QB memos. Centralize in
D:/claude_www/projects/accounting_manager/categorization-rules.mdso the agent can read-and-apply consistently. AM authors. - Floor plan utilization threshold. Current util ~3%; alert threshold? Recommendation: alert at 60% util (well-below the 80% NextGear concern line). Brandon ratifies.
- Per-truck cost-in tracking source-of-truth. AM's current method vs the substrate agent's computed value — when they diverge, whose number wins? Brandon-judgment; suggest AM-method-wins until inventory tracker reconciliation closes.
Strategic context¶
- Cleanup project (separate workstream): AM owns; historical books fix
- Daily steady-state: this doc + the substrate agent
- Cash flow feeds tamarack-capital.md capitalization tracking
- Per-entity P&L underlies atg-operations.md financial-position section
- Eventually informs framework-as-product.md "this works for any small business" hypothesis
- Substrate observability via ai-organization.md
Brandon's corrections¶
- [pending]
Version history¶
- v0.1 (2026-05-25): Initial scoping per Brandon's "get daily bookkeeping on substrate (independent of cleanup)" directive; MC1-Code authored as standalone Tier 4 cross-arm initiative; substrate agent shipped same day