CLA AI Hub
Intelligence Architecture
Decision Operating System · v233 · April 2026
0. System Definition
It does not surface data.
It does not generate generic insights.
It detects risk, structures decisions, explains evidence, orchestrates action, and learns from outcomes.
Every output in the system is governed, traceable, and continuously improving.
1. Architecture Overview
The system operates across six core intelligence layers, extended by four operational layers, each designed to operate independently, degrade gracefully, and contribute to a unified decision flow.
End-to-end flow
| Layer | Role | Nature | Latency |
|---|---|---|---|
| L1 | Sense reality | Rule-based | Real-time |
| L2 | Detect patterns | Statistical | ~1s |
| L3 | Connect the firm | Rule-based | Real-time |
| L4 | Reason | AI (Claude) | ~2s (cached) |
| L5 | Structure decisions | System logic | ~200ms |
| L6 | Govern trust | Metadata | N/A |
| L7 | Simulate decisions | AI + Rule-based | ~3s |
| L8 | Price decisions | Rule-based | ~200ms |
| L9 | Escalate automatically | Rule-based | Cron (daily) |
| L10 | Calibrate confidence | Statistical | Weekly |
2. Layer 1 — Live Data Aggregation
The system continuously reads across all practice tools and constructs a single firm-wide state model. Immediate visibility into overdue work, blocked workflows, review queues, and active execution.
3. Layer 2 — Predictive Patterns
Analyzes 30-day behavioral history to detect day-of-week workflows, tool usage sequences, and session continuation patterns. Enables personalized workflow anticipation, context-aware shortcuts, and behavioral continuity.
4. Layer 3 — Cross-Practice Detection
The only layer that sees all practices simultaneously. Detects when a client appears across multiple practices with issues, aggregates risk at client level, and creates coordination context.
5. Layer 4 — AI Intelligence
Uses Claude to prioritize signals, generate explanations, recommend actions, and detect anomalies. Produces one Next Best Move, 3-4 high-signal insights, anomaly detection, and narrative synthesis across all practices.
6. Layer 5 — Decision Operating System
This is the core system. It transforms signals → decisions → actions → outcomes → learning.
| Object | Role |
|---|---|
| Signal | Detected pattern or anomaly |
| Decision Case | Structured situation requiring action |
| Evidence | Facts and inferences supporting the case |
| Recommendation | Sequenced action plan |
| Action | User execution record |
| Outcome | Result and resolution |
| Learning | Compounded intelligence |
7. Layer 6 — Trust Architecture
Every output is governed by evidence traceability, confidence scoring, fact vs inference separation, source attribution, timestamping, and a full audit trail.
7b. Layer 7 — Counterfactual Simulation
Generates 3 scenarios per case (recommended, delay, escalate) with success probability, resolution time, and cost estimates. Economic factor library includes ANAF penalties, delay costs, and client tier baselines.
7c. Layer 8 — Economic Impact Engine
Per case: penalty risk, revenue exposure, delay cost per day. Aggregated across the firm as total economic exposure. Drives priority scoring and partner-level visibility.
7d. Layer 9 — Autonomous Escalation
Cases exceeding time thresholds auto-escalate: CRITICAL 4h, HIGH 24h, MEDIUM 72h, LOW 7 days. Records AUTO_ESCALATE action, updates case status, creates audit trail. Runs daily at 06:20 UTC.
7e. Layer 10 — Confidence Calibration
Compares predicted outcomes vs actual results. Builds calibration curves. Computes model trust scores. Identifies which signals are reliable and which are noise. Feeds back into signal weighting.
8. Decision Flow
The system operates as a closed loop:
Data → Signal → Case → Action → Outcome → Learning → Better Signal
This creates compounding intelligence, improving recommendations, and institutional memory.
Extended loop (Wave 2-4)
Case → Scenario Simulation → Economic Pricing → Decision
↓
Action → Outcome
↓
Learning → Calibration → Better Signal
↓
(No action?) → Auto-Escalation
The system does not reset. It learns continuously.
9. Priority Score Engine
Every decision is ranked using a multi-factor scoring model. This defines urgency and drives triage.
| Score | Lane | Meaning |
|---|---|---|
| ≥ 80 | Decide Now | Requires judgment now |
| 60–79 | Fix Today | Urgent execution |
| 40–59 | Watch | Emerging risk |
| < 40 | Learn | Systemic pattern |
The score converts complexity into clarity.
10. Data Pipeline
Practice data ingested
↓
Signals generated
↓
Decision cases created
↓
Intelligence assembled
↓
User acts
↓
Outcomes recorded
↓
Learning updated
This ensures: no black boxes, no orphan insights, no lost decisions.
11. System Doctrine
No recommendation without evidence.
No action without ownership.
No case without outcome learning.
And critically:
No fake data. No hardcoding.
No AI output without traceability.
No UI element without system backing.
Every visible insight must trace to:
event → signal → case → evidence → action → outcome
Pending Work & Trust Layer
No pending item without change marker. Users see what's NEW, ESCALATED, OVERDUE, or STILL PENDING.
No blocked item in the actionable lane. Separate what's stuck from what can be acted on.
No insight without trust metadata. Source, confidence, owner, and detection timestamp on every item.
12. Strategic Positioning
This architecture establishes CLA AI Hub as:
Not a dashboard. Not an analytics tool. Not a workflow manager.
A firm-wide decision infrastructure layer.
It sits above systems of record and systems of execution, and governs: risk detection, decision structuring, action orchestration, and institutional learning.
13. Final Definition
14. System Surfaces
| Surface | URL | Purpose |
|---|---|---|
| Hub Homepage | / | Role-aware triage + next best move + signals |
| Decision Queue | /decision-queue/ | All cases ranked by priority score |
| Case Detail | /case-view/ | Evidence + recommendations + outcome tracking |
| Case Room | /case-room/ | Cross-practice client coordination |
| Learnings | /learnings/ | Decision memory + compounding insights |
| Reporting Hub | /reporting-hub/ | Firm-wide control room |
| Activity Monitor | /activity/ | Usage + adoption intelligence |
| This Document | /docs/ | Architecture reference |
| Daily Pulse | /pulse/ | Morning decision briefing with health score + triage |
| Decision Graph | /case-view/ (Network tab) | Relational context: connected signals, clients, practices |
| Escalation Engine | /api/auto-escalate | Auto-escalation enforcement (cron) |
| Confidence Dashboard | /api/confidence-calibration | Signal fitness + prediction accuracy |
| Controlling | /controlling/ | Financial controlling + reporting |
| Audit Planner | /planner/ | Engagement management + daily log |
| Deadline Calendar | /calendar/ | Tax, VAT, payroll filing deadlines |
| Feedback Hub | /feedback/ | Bug reports + feature suggestions |
| Tutorials | /tutorials/ | Interactive getting-started guides |
| Knowledge Base | /knowledge/ | Practice knowledge articles |
| Permissions Console | /access/ | User roles + access management |
15. Roadmap
| Phase | What | Status |
|---|---|---|
| Phase 1 | Decision Case object + evidence + priority score + triage lanes | ✅ Complete |
| Phase 2 | Case detail view + recommendation sequences (/case-view/) | ✅ Complete |
| Phase 3 | Cross-practice case room (/case-room/) | ✅ Complete |
| Phase 4 | Decision memory + learnings (/learnings/) | ✅ Complete |
| Phase 5 | Automated cron — daily signals + cases (Vercel Cron) | ✅ Complete |
| Wave 1 | Counterfactual simulation + economic impact engine | ✅ Complete |
| Wave 2 | Decision graph + system health score + confidence calibration | ✅ Complete |
| Wave 3 | Autonomous escalation + daily pulse + graph network context | ✅ Complete |
| Wave 4 | Pending work aggregator + micro-actions + priority reasoning + change markers | ✅ Complete |
| Phase 6 | ANAF + Outlook Calendar + Power BI integrations | ⏳ Waiting on IT |
16. Shared Module Ecosystem
Eighteen client-side modules in /shared/. Each is a drop-in capability any tool can import via a single <script> tag. This is the layer that lets us add features across the fleet with one commit instead of thirty.
| Module | Public API | Role |
|---|---|---|
tools-manifest.js | ClaTools.all / byGroup / byId / byPath | Single source of truth for the tool inventory. Every listing surface reads from here. |
user-filter.js | ClaUserFilter.isRealUser / excludeSelfAndBots | Canonical "skip current user + service accounts" filter for every adoption view. |
data-freshness.js | ClaFreshness.read / write / badge | Unified cla_sync_ts_* convention — every dashboard reports the same "synced X ago". |
loading-safety.js | ClaLoading.guard(id, ms, fallback) | Safety timeout so shimmer skeletons never hang forever if an API dies silently. |
client-360.js | ClaClient360.lookup / mount / factSentence | Cross-tool client search across every practice cache + recent email mentions + past briefs. |
client-actions-bar.js | ClaClientActions.mount | "Pick client → Brief / Email / Draft / 360°" widget for practice-management tools. |
mode-cards.js | ClaModes.render(host, MODES) | Standardised mode selector with scaffold-insertion into the destination textarea. |
history-panel.js | ClaHistory.save / load / renderPanel | Per-tool history with filter-by-field support. |
output-actions.js | ClaOutput.copy / sendToModule / pushToOutlook / downloadText / downloadHtml / mountActionBar | Every AI-output surface gets the same Copy / →module / Outlook / .doc gestures. |
dual-ref.js | ClaDualRef.render / excelObjective / excelRisk | Canonical-ID ↔ source-reference bridge (e.g. ISQM QO-C2-3a vs Excel "3a"). |
pii-guard.js | ClaPiiGuard.scan / promptIfNeeded | Pre-flight Romanian PII detection (CNP, IBAN, card, mobile) with Redact / Send-as-is / Cancel modal. |
paste-intent.js | ClaPasteIntent.classify / attach | Six classifiers (contract / financial table / regulation / CV / email / meeting notes) that nudge to specialised tools. |
last-session.js | ClaLastSession.mount | "Continue: <title> — 14h ago" resume bar for any tool that keeps history. |
regulatory-ribbon.js | ClaRegulatoryRibbon.mount({practices}) | Practice-filtered curated Romanian regulatory updates. Feed edited in /api/regulatory-feed.js. |
activity-counter.js | ClaActivity.log / autotrack / aggregateThisWeek / renderHomeCard | Per-client tool-chain telemetry — infrastructure for the Global Workforce Decision Dataset pattern. |
cross-sell.js | ClaCrossSell.analyse / forClient / renderHomeCard | Clients below peer median practice count + most-plausible gap. |
friday-report.js | ClaFridayReport.mount | Fri 14:00 → Sat 10:00 hero card that aggregates the week into a Cowork draft prompt. |
learnings.js | ClaLearnings.get / topToolsOrdered / isEmerging / rankAmong | Client reader for /api/learnings — the daily adaptation signal. |
17. Cross-Tool Handoff Mesh
The Hub is not a menu. It is a mesh. Every tool knows how to pass a client, a draft, an action, a decision into the next tool without a copy-paste. Two conventions carry the traffic:
17.1 The ?client=<name> URL protocol
Any link that navigates to a tool and carries a ?client= parameter lands with that client pre-filled. Receiving pages hydrate from URLSearchParams on load and trigger whatever downstream behaviour needs the name (Client 360 refresh, prior-brief lookup, placeholder update, etc.).
Currently hydrated: /briefing/, /command/, /drafter/. The pattern is one four-line block per page — any tool can adopt it.
17.2 The cla_output_handoff localStorage payload
When a tool wants to pass generated content (not just a name), it writes a structured payload to localStorage.cla_output_handoff and redirects. The destination reads and clears the payload on load.
| Field | Meaning |
|---|---|
kind | draft / reply / actions / risks / brief / memo / formula / metric / feedback |
payload | Text or JSON-serialised content the destination will process |
meta | Optional context — client name, subject, source action |
from | Originating path |
ts | Write timestamp |
17.3 Kind → destination routing
Encoded in ClaOutput.ROUTES:
| kind | Destination | Typical producer |
|---|---|---|
| draft | /drafter/ | Email triage "Draft reply" action, Cowork reply |
| reply | /command/ | Meeting follow-up draft, Cowork message |
| actions | /planner/ | Meeting decisions, email action extraction |
| risks | /feedback/ | Email risk flags, audit observations |
| brief | /briefing/ | Post-meeting briefing generation |
| memo | /cowork/ | Excel analysis → memo drafting, Friday report draft |
| formula | /excel/ | Calculator result → spreadsheet |
| metric | /controlling/ | Financial metric promotion |
| feedback | /feedback/ | Any "this could be better" surface |
18. Anticipatory Layer
Behaviours that surface content the partner will need, before they think to ask. Ten mechanisms currently live — each one either saves a click or saves a memory.
| Behaviour | Trigger | Source data |
|---|---|---|
| Up Next Today | Partner opens homepage | All practice caches (cla_*_mgmt, cla_audit_planner_v2) + cla_meeting_reminders |
| Prior brief suggestion | Partner types a known client in Briefing | cla_briefing_history (<90d) |
| Cross-sell radar | Partner opens homepage | Practice caches, firm median computed on-the-fly |
| Regulatory ribbon | Partner opens a practice tool | /api/regulatory-feed filtered by tool's practice tag |
| Post-meeting reminder | Meeting Intelligence produces output | Writes to cla_meeting_reminders → consumed by Up Next |
| PII guardrail | Before any AI call in Command / Cowork | Client-side regex on the textarea content |
| Smart-paste intent | Paste event on an AI input | Six pattern classifiers |
| Last-session resume | Partner opens a tool with history | Tool's own history store (<48h) |
| Friday partner report | Fri 14:00 – Sat 10:00 | Activity counter + briefing history + command history |
| Cross-tool activity counter | Partner opens homepage | cla_tool_activity rolling 7-day window |
19. Self-Improvement Loop
The Hub observes its own use daily and adapts. One loop, four phases:
OBSERVE AGGREGATE DISTRIBUTE ADAPT ───────── ───────── ────────── ───── login-track → /api/learnings → /shared/learnings.js → tools reorder tool-data (7-day window) (30-min sessionCache) defaults, cla_tool_activity JSON snapshot surface rank, cla_sync_ts_* mode priority feedback-hub
19.1 Contract — /api/learnings
Returns a JSON snapshot that any tool can consume. Shape is append-only — consumers can ignore fields they don't know about.
{
ok: true,
generated_at: ISO,
window_days: 7,
tools: { <tool_id>: { visits, unique_users, last_used_at, percentile } },
firm: { active_today, active_week, tool_count_used },
top_tools: [ { id, visits, unique_users, last_used_at } ],
quick_prompts: { top_picked: [...], least_picked: [...] }, // future
friction: [], // future
regulatory_pending: N
}
19.2 Current consumers
/manual/— Section 3 (tool inventory) and Section 6 (firm metrics) both render fromClaLearnings.get().- Planned — homepage Quick Actions reorder by usage rank, Briefing mode order by pick frequency, Cowork quick-start reorder, emerging-tool callouts.
19.3 Design boundaries
- No schema migration on the hot path. The learnings API aggregates on-demand from the stores that already exist. If a new signal is needed, we add it to an existing store first, then compute it in the aggregator.
- Cached 30 min client-side, 30 min at edge. Two partners in the same hour share one query. The loop prioritises stability over instant reactivity — we want the Hub to adapt to this week's firm pattern, not to the last five minutes.
- Adaptation is additive. The learnings signal is used to sort and surface, never to hide — a tool that scored zero this week still appears in every index, because "nobody used it" is data, not a reason to make it invisible.
Back to Hub · Partner Manual · Evolution roadmap