MARK GARASLEGAL AI & SOFTWARE

Legal ↔ Technical / Architecture map

Stablecoin Regulatory Evidence Engine

Follow a regulatory passage through interpretation review and deterministic control tests. A separate financial-close workflow has its own evidence and export checks.

Workflow SVG ↓Project case study ↗

Current workflow review / 31 October 2026

All 1,606 repository tests passed on 31 October 2026, including the workbench, filing and export paths. An explicitly historical synthetic replay matched all eight scenario expectations and verified its event chain. It made no model calls and involved no professional review; ordinary current-date acceptance still refuses the expired source review.

Read the updated case study ↗Current verification record ↓
The map below describes its original snapshot. The note above covers later fixes and checks; older results below still belong to the earlier version.

01 / Workflow

How the work moves through the system.

Read from left to right. Open a step to see why it matters, how it works, and where to find the code.

Process or decisionEvidence or data exchange

01Documents & context

implemented

Pin the source and its status

The workbench saves passage IDs, dates, jurisdiction and source status. An interpretation can cite that text without presenting a proposed rule as final law.

Legal ↔ Technical
Legal purpose

Authority status, scope and currentness require review.

How it works

Typed source bundles and versioned immutable records.

  • cee/workbench/models.py:35Source
  • cee/workbench/service.py:131import_sources
implemented

Describe the operating question

Operations supplies a public or synthetic business context. The workbench checks the task, assumptions and questions so counsel can see which facts and choices the proposed test relies on.

Legal ↔ Technical
Legal purpose

A factual assumption is not a legal rule.

How it works

Closed Context schema and domain control contracts.

  • cee/workbench/models.py:81Context
  • cee/workbench/catalog.py:78prompt_context

02Application & processing

implemented

Prepare a contestable proposal

An optional model operating within defined limits, or an explicit manual worksheet, drafts source-linked claims and test cases. A reviewer can challenge the interpretation before execution.

Legal ↔ Technical
Legal purpose

Exact quotations do not establish correct legal meaning.

How it works

Structured Proposal schema, zero-tool model request and quote/control validation.

  • cee/workbench/service.py:333prepare
  • cee/workbench/provider.py:45OpenAITransport
  • cee/workbench/service.py:23SYSTEM =
implemented

Run the conditional tests

Deterministic controls run every supplied scenario for the current accepted revision. Missing facts and out-of-scope conditions remain visible beside expected and actual results.

Legal ↔ Technical
Legal purpose

A scenario result is conditional on the represented legal reading and facts.

How it works

Typed facts, Decimal/time/calendar calculations and persisted run bindings.

  • cee/workbench/service.py:497run_tests
  • cee/workbench/controls.py:434calculate
implemented

Prepare the separate financial evidence

Separate close commands process the supplied finance records. Deterministic streams reconcile supply and reserves, check supported limits and service rules, and prepare evidence for supported reporting fields.

Legal ↔ Technical
Legal purpose

Financial arithmetic and a supported subset do not establish complete regulatory compliance.

How it works

Versioned source feeds, deterministic stream engines, evidence graph and blocker dossier.

  • cee/cli.py:206run_month
  • cee/evidence/filing_assurance.py:297build_filing_assurance

03Review & decisions

implemented

Review the exact revision

Counsel reviews claims, exceptions and expected test results. Authenticated review and acceptance are separate records tied to the current proposal, sources and control implementation.

Legal ↔ Technical
Legal purpose

A role preview or research-session Yes is not canonical professional approval.

How it works

Role authorization, substantive checklist, revision hashes and source-age gate.

  • cee/workbench/service.py:451review_proposal
  • cee/workbench/service.py:256_active
  • cee/review/identity.py:451require_current_role
implemented

Satisfy the packet gates

Authorized reviewers must resolve evidence and source-change blockers first. A credentialed exporter can then request a sealed packet whose manifest identifies the exporter, authority context and included files.

Legal ↔ Technical
Legal purpose

Workbench reports alone do not satisfy the separate packet gates.

How it works

Role checks, current reviews, stale-evidence refusal, hashes and standalone verifier.

  • cee/cli.py:424run_export
  • cee/export/packet.py:179build_packet
  • tools/verify_packet.py:195verify_packet

04Records & handoff

implemented

Inspect and verify saved work

An authenticated reader can inspect the saved report and verify its records and calculations. This does not call a model, accept stale sources or change review state.

Legal ↔ Technical
Legal purpose

Historical inspection does not renew authority currentness.

How it works

New read-only saved-case verification and fingerprint-aware deterministic replay.

  • cee/workbench/service.py:606verify_saved_case
  • cee/workbench/report.py:7render_html
  • cee/workbench/ui/app.js:284if(name==='verify-case')
implemented

Leave consequential action with people

Counsel, officers and independent reviewers inspect the materials within their own responsibilities. Any actual payment, certification or regulatory submission happens outside this repository.

Legal ↔ Technical
Legal purpose

Internal preparation and simulated approvals do not grant external authority.

How it works

No payment or submission connector; teaching transcripts remain simulated.

  • README.md:12No automatic licensing
  • cee/demo/workflow.py:12SIMULATION_NOTICE
Read the connections as a list
  • Pin the source and its status ⇢ Describe the operating questionVersioned passages
  • Describe the operating question → Prepare a contestable proposalPrepare proposal
  • Prepare a contestable proposal → Review the exact revisionChallenge and revise
  • Review the exact revision → Run the conditional testsAccept exact revision
  • Run the conditional tests ⇢ Inspect and verify saved workRetain linked results
  • Pin the source and its status ⇢ Prepare the separate financial evidenceSeparate authority library
  • Prepare the separate financial evidence → Satisfy the packet gatesResolve canonical blockers
  • Satisfy the packet gates → Leave consequential action with peopleScoped reliance decision
  • Inspect and verify saved work → Leave consequential action with peopleResearch inspection only

02 / Implementation traces

Follow an action into the code.

10 grouped traces. The model and retrieval entries show which integrations run, which use local rules, and which are only configured.

implemented

Workbench catalog, examples, import-sources and intake

Set a bounded legal-operational question and preserve source status.

Interface / command
cee/workbench/cli.py:add_parser; ui/intake-ui.js
Call
workbench catalog|examples|import-sources; POST /api/action preview_intake
Service / backend
catalog.py; intake.py:assess_request; service.py:import_sources
Rules & validation
Two fixed core domains; closed public/synthetic Context and source bundles; preserve passage IDs and proposal/current-rule purpose.
Model / provider
none
Prompt
none
Retrieval / sources
Pinned supplied/bundled passage JSON; no automatic web retrieval in core workbench preparation.
Persistence
wb_sources records in append-only versioned_record; manual example JSON
Review & permissions
Authenticated source import; source-scope and currentness remain human responsibilities.
Output
Source bundle, context and intake scope response.
  • cee/workbench/cli.py:27add_parser
  • cee/workbench/intake.py:70assess_request
  • cee/workbench/service.py:131import_sources
config dependent

Prepare and revise: manual or live AI

Propose a source-linked legal reading and operational test plan for review.

Interface / command
ui/app.js; workbench/cli.py:prepare/revise
Call
POST /api/action prepare|revise; workbench prepare [--manual]|revise
Service / backend
service.py:prepare / save_proposal / validation; llmprop/client.py:call_llm; provider.py:OpenAITransport
Rules & validation
Zero-tool structured schema, bounded context/response, no paid retry or redirects, exact citation checks and supported-control constraints; revisions require fresh review.
Model / provider
RUNTIME-CONFIGURED via --model / OPENAI_MODEL; default gpt-6-astra in workbench/provider.py. Manual path calls no model.
Prompt
cee/workbench/service.py:SYSTEM and PROMPT_VERSION; catalog.prompt_context; cee/llmprop/client.py envelope
Retrieval / sources
Supplied source bundle only; no web search or vector index in this path.
Persistence
wb_call, wb_call_result and wb_proposal immutable versions with model/prompt metadata
Review & permissions
Authenticated preparer; no proposal acceptance from model output.
Output
Versioned contestable claims, assumptions, citations and typed synthetic tests.
  • cee/workbench/service.py:23SYSTEM =
  • cee/workbench/service.py:333prepare
  • cee/workbench/service.py:163validation
  • cee/workbench/provider.py:13DEFAULT_MODEL =
implemented

Authenticated review, accept and reject

Make claim-level review and acceptance a separate, version-bound decision.

Interface / command
ui/app.js review dialog; workbench review CLI
Call
POST /api/action review; workbench review --decision reviewed|accept|reject
Service / backend
service.py:review_proposal / _review_complete / _active; review/states.py:transition
Rules & validation
Read current stored role, check substantive assessments/checklist, prevent skipped review and reject stale source/control/proposal versions; 30-day checked_on gate remains active.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
wb_decision and review-state events; identities and role versions
Review & permissions
Credentialed counsel/reviewer authority according to current stored role; acceptance does not certify broad compliance.
Output
Bound decision record and preserved rationale.
  • cee/workbench/service.py:451review_proposal
  • cee/workbench/service.py:256_active
  • cee/review/states.py:231transition
  • cee/review/identity.py:451require_current_role
implemented

Run accepted tests, reports and saved-case verification

Calculate represented scenarios, then inspect or replay the saved result without granting new approval.

Interface / command
ui/app.js Operations/Evidence; workbench show|run|verify|worksheet
Call
POST /api/action run|verify_case; GET /api/case|report; workbench run|show|verify
Service / backend
service.py:run_tests / inspect_proposal / verify_saved_case; controls.py:calculate; report.py:render_html
Rules & validation
Typed deterministic controls use explicit business calendars, Decimal amounts and unknown/out-of-scope states; verification checks local chain/content/run links and compares saved results only under the same control fingerprint.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
wb_run, wb_proposal, wb_sources, wb_decision and append-only event chain
Review & permissions
Execution requires current acceptance; verification requires read permission and leaves state unchanged.
Output
Conditional scenario results, source-linked HTML/JSON reports and new verification result.
  • cee/workbench/service.py:497run_tests
  • cee/workbench/service.py:606verify_saved_case
  • cee/workbench/controls.py:434calculate
  • cee/workbench/report.py:7render_html
implemented

Browser examples and hypothesis comparison lab

Explore alternative readings while keeping an amendment or assumption visibly experimental.

Interface / command
ui/lab.js; ui/intake-state.js
Call
POST /api/action preview_calculate|preview_compare|preview_intake
Service / backend
controls.py:calculate; experiments.py:compare; intake.py:assess_request
Rules & validation
Browser preview state never creates canonical approval; comparison applies explicit included hypothesis choices to the same synthetic scenarios.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
Browser memory/local draft state; no wb_decision or sealed packet
Review & permissions
Illustrative participants; no authenticated professional review is implied.
Output
Comparisons, test requests and downloadable experimental reports.
  • cee/workbench/experiments.py:326compare
  • cee/workbench/web.py:264if op == "preview_calculate"
  • cee/workbench/ui/lab.js:3labIncluded
config dependent

Live research-session collaboration

Generate and compare a bounded research experiment while separating its illustrative decision from canonical legal acceptance.

Interface / command
ui/research.js
Call
POST /api/action research_generate|research_decide|research_run|research_feedback|research_disconnect
Service / backend
regulatory_session.py:ResearchSession; regulatory_engine.py:build_request / validate_draft / evaluate; session_model.py:SessionModel
Rules & validation
Topic/source allowlist, closed draft schema, finite call budget, session expiry, exact revision fingerprint and Yes-before-run constraint; professional_review remains false.
Model / provider
RUNTIME-CONFIGURED signed-in Codex default when --live-codex explicitly enables the ephemeral adapter; no fixed model identifier in SessionModel.
Prompt
cee/workbench/regulatory_engine.py:build_request
Retrieval / sources
Curated regulatory_library topic sources; web search disabled in the Codex subprocess.
Persistence
Server memory only; separate from canonical SQLite workbench records
Review & permissions
Explicit live session enablement; research Yes is illustrative, not authenticated counsel approval.
Output
Research draft, synthetic experiment comparison, feedback and history.
  • cee/workbench/regulatory_session.py:30ResearchSession
  • cee/workbench/regulatory_engine.py:236build_request
  • cee/workbench/session_model.py:22SessionModel
  • cee/workbench/regulatory_session.py:144"professional_review": False
config dependent

Authority ingestion, change-scan and staleness-report

Detect represented source changes without silently changing legal status or approval.

Interface / command
cee CLI authority/cadence commands
Call
cee ingest-authorities|change-scan|staleness-report|check-cadence
Service / backend
authority/ingestion/scan.py; authority/staleness.py; CLI _run_authority_scan
Rules & validation
Configured official-source fetching, byte hash comparison and change flags propagate to dependent requirements/controls/evidence; legal status is not inferred from a fetched document.
Model / provider
none
Prompt
none
Retrieval / sources
Configured authority/ingestion/sources.yaml endpoints through bounded ingestion fetch transport.
Persistence
Sources, versioned authority/requirement/evidence records, source-change flags and event log
Review & permissions
Operator invokes network scan; counsel must dispose interpretive/source changes.
Output
Change report, stale dependencies and blocking cadence evidence.
  • cee/cli.py:1013_run_authority_scan
  • cee/authority/ingestion/scan.py:134change_scan
  • cee/authority/staleness.py:243propagate_staleness
implemented

Financial ingest, daily/weekly/monthly close and supported-field filing dossier

Prepare repeatable financial and reporting evidence from represented records.

Interface / command
cee CLI init|ingest|run-day|run-week|run-month|filing-assurance
Call
local CLI calls
Service / backend
cli.py:ingest_directory / run_day / run_month; streams/*; evidence/filing_assurance.py
Rules & validation
Reconcile supply and reserves, evaluate represented reserve limits, contractual SLA and interest tracing, compare supported PS01/PS02 fields and refuse invalid/missing period evidence.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
SQLite source, versioned_record, evidence graph and event chain; on-demand JSON dossier
Review & permissions
Finance supplies authorized records and assumptions; counsel owns authority/applicability; official_submission_ready remains false.
Output
Scoped finance results, blocker dossier and readiness evidence.
  • cee/cli.py:143ingest_directory
  • cee/cli.py:206run_month
  • cee/evidence/filing_assurance.py:297build_filing_assurance
  • cee/streams/recon.py:171run_daily_recon
implemented

Canonical review, export, verify-chain and finalization drill

Seal a scoped packet only after independent canonical evidence and review gates pass.

Interface / command
cee CLI review|export|verify-chain|drill-finalization; tools/verify_packet.py
Call
local authenticated export and standalone verifier
Service / backend
cli.py:run_export; export/packet.py:build_packet; review/identity.py; tools/verify_packet.py
Rules & validation
Verify current exporter role, required interpretive reviews, source-change clearance, evidence and gate state; bind authority-context artifact and file hashes, then independently recheck bytes, chain and arithmetic.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
Sealed output folder, manifest, authority context, event-chain slice and document/spreadsheet artifacts
Review & permissions
Credentialed authorized exporter; officer, counsel and independent reviewer retain downstream decision rights.
Output
Verifiable internal evidence packet, never a submitted regulatory report.
  • cee/cli.py:424run_export
  • cee/export/packet.py:179build_packet
  • tools/verify_packet.py:195verify_packet
  • cee/review/identity.py:376verify_identity
unknown

Operating-room demos, repayment research, synthetic generator and static dashboard

Keep teaching, repayment arithmetic and ancillary research views visible as separate surfaces.

Interface / command
cee/demo/*.py and generated HTML; repayment/cli.py; synth/cli.py; tools/dashboard.py
Call
python -m cee.demo.operating_room_render; cee repayment replay|compare; python -m cee.synth.cli; tools/dashboard.py
Service / backend
demo/workflow.py; repayment/service.py; synth/cli.py; tools/dashboard.py
Rules & validation
Demo choices create illustrative transcripts; repayment commands calculate proposals over synthetic scenarios and never pay anyone; dashboard is a local report. Core public entry points were inventoried, but every ancillary branch was not fully retraced.
Model / provider
none
Prompt
none
Retrieval / sources
none
Persistence
Synthetic in-memory/browser state or explicitly selected local research outputs
Review & permissions
Simulated approval is not canonical approval; repayment output retains legal_review none.
Output
Teaching catalogs, scenario comparisons, synthetic feeds and static dashboard.
  • cee/demo/workflow.py:12SIMULATION_NOTICE
  • cee/repayment/cli.py:29add_parser
  • cee/synth/cli.py:17build_parser
  • tools/dashboard.py:28main
Which parts of the app are mapped

Core workbench, canonical close/authority/export commands and research-session UI traced by surface group. Separate teaching, repayment and auxiliary generation/reporting commands are inventoried with explicit partial depth.

12 mapped3 partial0 unmapped
  • Workbench catalog/examples/source importimplemented

    Typed two-domain core and source passage records.

  • Core prepare/reviseimplemented

    Manual and configurable live-AI preparation.

  • Canonical review/accept/rejectimplemented

    Authenticated substantive review and revision gates.

  • Accepted deterministic runimplemented

    Bound scenario calculations with explicit currentness.

  • Saved cases/show/worksheet/reportimplemented

    Revision history and source-linked reports.

  • New saved-case verificationimplemented

    CLI and Evidence-view HTTP action; read-only replay.

  • Preview intake/hypothesis laboratoryimplemented

    Synthetic browser experiments and comparisons.

  • Live research-session collaborationimplemented

    Ephemeral transport/session and illustrative decision boundary.

  • Authority source monitoringimplemented

    Ingest, changes and stale dependencies.

  • Financial ingest and period runsimplemented

    Daily/weekly/monthly streams and supported-field dossier.

  • Canonical review/export/finalization/chain verificationimplemented

    Separate sealed-packet gate path and standalone verifier.

  • Local authentication/session controlsimplemented

    Host/origin/CSRF, current role and credential verification.

  • Operating-room teaching pagesunknown

    Catalog and simulation boundary inspected; all 13 teaching phases not individually traced.

  • Repayment researchunknown

    Replay/compare CLI inventoried and boundary inspected; every ledger/policy branch not retraced.

  • Synthetic generation and static dashboardunknown

    Entry points inventoried; auxiliary output transformations not fully audited.

03 / Review and permissions

What needs to happen before the next step?

implemented

Source age remains a live gate

Acceptance/execution checks source and control versions and rejects a checked_on date outside the allowed window. The October baseline failures are preserved rather than relabeled as fresh source verification.

Code references
  • cee/workbench/service.py:256_active
implemented

Only typed, versioned tests execute

Accepted claims, facts and expectations bind to one proposal/source/control version; unsupported interpretations cannot silently run under a different fixed calculation.

Code references
  • cee/workbench/service.py:163validation
  • cee/workbench/service.py:497run_tests
config dependent

Provider egress is bounded

The core provider sends a structured zero-tool request to its fixed Responses endpoint with no redirect or automatic paid retry. Live research uses an explicit ephemeral session adapter with disabled tool/web capabilities.

Code references
  • cee/workbench/provider.py:45OpenAITransport
  • cee/workbench/session_model.py:78settings =
implemented

Current local roles govern saved decisions

Argon2-backed credential verification and current-role checks protect canonical review/export; preview role selection does not create an authenticated identity.

Code references
  • cee/review/identity.py:376verify_identity
  • cee/workbench/service.py:79authorize
  • cee/workbench/web.py:151guarded
implemented

Saved-case verification does not approve

The new action checks local record bindings, chain and compatible calculation replay; it returns stale/currentness information and does not append a run or review.

Code references
  • cee/workbench/service.py:606verify_saved_case
  • tests/workbench/test_saved_case_verification.py:18test_verify_proposed_case_has_no_saved_runs_and_does_not_change_state
implemented

Packet gate stays separate

Canonical packet creation rechecks required review, source flags, evidence, gate states and exporter authority; a workbench research report is not this sealed packet.

Code references
  • cee/export/packet.py:179build_packet
  • cee/cli.py:424run_export

04 / Completion work

What changed in this snapshot.

Implemented change

Saved-case verification and replay

Added verify_saved_case, a credentialed workbench verify CLI command, an authenticated verify_case action and an Evidence-view button. It checks content bindings, the event chain, review/run links and deterministic results under the same control fingerprint. Old control versions are reported without replay; currentness warnings remain visible.

A saved case could be inspected or rerun only through execution gates; users needed a way to check its integrity and retained calculations without obtaining fresh approval, paying for a model or pretending expired sources were current.

Options considered
  • Refresh bundled legal sources automatically and reopen accepted tests.
  • Add read-only verification/replay for existing saved cases.
  • Persist the ephemeral research-session experiment into the canonical approval database.
Files changed
  • cee/workbench/service.py
  • cee/workbench/cli.py
  • cee/workbench/web.py
  • cee/workbench/ui/app.js
  • tests/workbench/test_saved_case_verification.py
  • README.md

Validation

passed./.venv/bin/python -m pytest tests/workbench/test_saved_case_verification.py -q -o addopts=''

7 passed: proposed/no-runs, two-domain stored result replay, mismatch detection, control-version-change abstention, actual CLI dispatch, read-only behavior, reader permission and unauthenticated refusal. Historical fixture dates are explicitly frozen for creating accepted synthetic runs; current-date source-expiry refusal is preserved.

passed./.venv/bin/python -m pytest tests/workbench/test_saved_case_verification.py tests/workbench/test_controls.py tests/workbench/test_provider.py -q

108 tests passed in the saved-case (5 at that point), deterministic control and bounded-provider subset, confirmed against collection count. Two later added verification tests also passed in the final 7-test verification run. See regulatory-targeted-tests.log.

passed./.venv/bin/python -m ruff check cee/workbench/service.py cee/workbench/cli.py cee/workbench/web.py tests/workbench/test_saved_case_verification.py

Configured targeted lint passed; Node syntax check of ui/app.js passed.

failed./.venv/bin/python -m pytest tests/workbench/test_workflow.py tests/workbench/test_web.py -q

Baseline before this change: 22 existing tests failed because bundled source-review dates exceed the 30-day runtime currentness window in October. These were not fixed by weakening or relabeling the gate.

Scope of the tool

  • Proposed authority and hypothetical business rules remain distinguishable from operative law; no current-law conclusion is made by this map.
  • PASS and FAIL describe the selected conditional check, not an issuer-wide compliance determination, filing approval or regulator permission.
  • Workbench research reports, saved authenticated decisions and sealed financial evidence packets are distinct products with different gates.
  • Public or synthetic workbench inputs only; no production issuer, holder or customer records were examined.
  • No payment execution, regulatory submission, licensing decision or autonomous professional advice connector is implemented.

Unfinished work and gaps in the map

  • Existing source-review dates are stale at the current runtime date. New current-date acceptance/run is correctly blocked until an actual recheck/import; this task did not verify or refresh law.
  • Core workbench source bundles and canonical financial-close authority libraries are separate paths; this map does not invent a direct handoff from a workbench acceptance to packet export.
  • Core live-model legal accuracy, professional review performance, real issuer adoption and time savings remain unmeasured.
  • Research-session decisions explicitly say professional_review false and remain in memory; they are not canonical legal approvals.
  • Local hashes and append-only SQLite triggers are not an external signature or protection against a machine owner replacing an entire consistent store.
  • Ancillary repayment, synthetic generation, dashboard and teaching branches are inventoried with partial depth rather than included in a complete-coverage claim.
  • The source set requires genuine professional rechecking/import before new current-date acceptance or execution; source dates were not refreshed.
  • A whole consistent store replacement is not prevented by local hashes.
  • Editing service.py changes the accepted-control fingerprint, so previously saved cases can be integrity-checked but report control-version change instead of replaying under different semantics.
Implementation snapshot

These maps explain the software, its sources, and who reviews the results. Local and synthetic tests do not establish legal accuracy or readiness for production. The technical traces identify configured integrations and unfinished paths.