Oracle3
Oracle3: 예측시장 거래 엔진·MCP 서버
모든 임대 계약을 읽고 집주인 청구서를 대조해 오류 금액만 보류한다 사람이 승인하면 체인이 기록을 유지한다
Reads every lease, checks every landlord bill against it, and holds only the money that is wrong. A person approves; the chain keeps the record.
금융Python · TypeScriptGitHub @sarvesh172000온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Cal Hacks 13.0 — lease desk for multi-location businesses: ASC 842 schedules, rent payment reconciliation, and amendment-driven remeasurement
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Lease Desk fills the lease accountant's seat. A clinic group holds dozens of leases, each its own rulebook: escalations, CAM caps, proportionate shares, amendments that go to facilities and never reach accounting. Lease Desk reads each lease, builds the ASC 842 schedules, checks every landlord charge against what the lease actually says, holds only the money that is wrong, and when a bill doesn't match, goes looking in the mailbox for why.
It never pays and never signs off. A person approves, under role checks the database itself enforces, and every action, allowed or refused, is sealed to a hash-chained audit trail.
Try it live: lease-desk-ten.vercel.app · sign in as
[email protected], password demo (the controller) · open the July hold on LEASE-01.
CLINIC-01's lease was amended in June: three more years, lower rent. The amendment went to facilities and never reached accounting. In July the landlord billed the new rent, and the books kept running the old schedule.
This runs live in the app, from make demo-data, in four beats:
| Beat | What the system does | |
|---|---|---|
| 1 | The break | July base rent is billed $17,400.00; the schedule says $19,626.65. An under-bill is a signal, not a gift. The checker holds the −$2,226.65 and boxes the invoice line and the lease clause it rests on. |
| 2 | The search | Run investigation searches the mailbox (10 documents) and finds the countersigned amendment from the landlord's authorised representative, trust rank 1: "Base rent reduced to $17,400 per month effective July 1, 2026." A property manager's claim, a forged sender and an injection attempt are set aside. |
| 3 | The proof | The engine remeasures the lease under ASC 842: liability $559,665.35 → $1,002,921.05 (+$443,255.70), ROU asset +$443,255.70. |
| 4 | The entries | Four adjusting entries, balanced, proposed for the controller's sign-off. Nothing posts until a person approves. |
| Account | Debit | Credit |
|---|---|---|
| Lease liability | 443,255.70 | |
| ROU asset | 443,255.70 | |
| ROU asset | 4,624.74 | |
| Rent expense | 4,624.74 | |
| 447,880.44 | 447,880.44 |
The model's answers behind this are committed (data/reference/llm_cache), so the whole story replays with
no API key and no network, and backend/tests/platform/test_the_moment.py proves it on every push.
read ──► check ──► hold ──► a person approves ──► the gateway posts ──► the chain seals it
Claude code code controller / RM lease_gateway role audit_event, hashed
The model reads. The code calculates. Claude reads lease PDFs, scanned amendments and email threads and returns structured terms, each carrying the exact sentence it came from (checked against the page before any number reaches a schedule) and an explicit list of what it could not determine. Every schedule, balance and journal entry is ordinary arithmetic with a test suite, reproducible to the cent, identical on every run. A wrong extraction is a reviewable error, never a silently wrong balance sheet.
| Step | Who | What |
|---|---|---|
| Read | Claude (backend/app/agents, backend/app/llm) | Leases, amendments, bills, the mailbox. Structured outputs, per-claim citations, untrusted documents fenced. |
| Check | the checker (backend/app/agents/checker) | Every charge of the month against the schedule its lease implies: base rent, escalations, CAM, premises, duplicates. |
| Hold | the work layer | Only what it can prove wrong, with the invoice line and the clause boxed on the page. The rest pays. |
| Investigate | the investigation agent | Searches the mailbox for what explains a variance, ranks sources by trust (executed amendment first, payment history last), refuses what cannot modify a lease. |
| Approve | a person | Controller or regional manager, in their own region, never on their own answer. |
| Post | lease_gateway | The one database role that may write the journal, the outbox and the golden tables. |
| Seal | audit_event | Every event hashed to the one before it. Anyone can verify; an edit shows as a break. |
Five things the picture is drawn around:
audit_event table is SHA-256 chained and append-only; triggers refuse every update, the owner's included. SpacetimeDB only mirrors it, so other screens update without a refresh.Light is the default; dark is a toggle. 13 px minimum type, AA contrast on every surface, reduced motion shows every animation's final frame, and the whole path works offline on fixtures.
Measured against things we did not write: a generated company with planted errors and an answer key, a
held-out company from a seed never used in development, and adversarial documents. make eval,
25 Oct 2026, seed 20261023; the web app shows these figures with that date, and live ones when the API answers.
| Section | Result |
|---|---|
| Checking | 5 / 5 planted errors held, 0 false holds; $25,736.36 flagged, exactly the expected amount |
| Citations | 5 / 5 holds cite the lease clause that proves them |
Extraction (--extraction, with Claude) | 65 / 65 lease fields correct across the 5 leases, every one cited to its page |
| Investigation | The July variance settled to the amendment, confidence 100%; four entries, balanced; never posts alone |
| Safety | 3 / 3 unauthorized sources refused; instructions planted in documents are fenced, not followed |
| Held-out company | 18 clinics from an unseen seed, 4 / 4 invariants hold |
Limits (make prove-limits) | An agent tried to approve: refused by can(). A manager tried to approve her own answer: refused. An agent tried to post: Postgres refused. All three on the chain; verify_chain(): OK |
| Tests | 1,662 backend (1,000+ against a real Postgres 16) · 141 frontend · every one offline |
Real vs simulated. The company, its leases, invoices and mailbox are generated deterministically from a seed, so there is an answer key to score against. The ASC 842 engine, the database, the permissions, the agents and the model calls are real. Reference data is real: three SEC EDGAR lease exhibits with 33 hand-verified labels, and 184 BLS CPI observations for escalations.
frontend/docs/REHEARSAL.md walks the demo end to end with a headless browser
(frontend/scripts/rehearsal-walk.mjs): welcome → login → Today → money screen → investigation → Why? →
evidence pack → regional manager → uphold → disputes → audit → month run → leases → lease detail. Every
screen usable in 100–400 ms, 7.5 s of it the investigation's own replay, 0 console errors, no 4xx on the
path, cold loads under 400 ms. Repeated in light, reduced motion, offline on fixtures, and as each role.
The system runs as four database roles, and the limits are grants, not policy:
| Role | For | Cannot |
|---|---|---|
lease_agent | The worker and agents: reads records, writes ingestion, drafts and work | touch the ledger, the outbox or the golden tables |
lease_gateway | The only writer back to records: golden tables, the journal, the outbox, period status | act without a person's approval on record |
lease_api | Serves the UI: writes events and work items | write the ledger |
lease_reader | The auditor: read-only on everything | write anything |
Nobody, the owner included, can rewrite or delete audit_event. A regional manager cannot approve another
region's item, and nobody approves their own proposal. Refusals are recorded in the audit trail too.
make prove-roles has each role try a forbidden write and shows the database refusing.
| Where | What it does here | |
|---|---|---|
| Claude · Anthropic | backend/app/agents, backend/app/llm | Reads the documents. Structured outputs, per-claim citations, untrusted content fenced; answers cached and replayable |
| Fetch.ai / ASI:One | agents_fetch/ | Four uAgents on Agentverse: the whole desk inside an ASI:One chat, as yourself (one-time pairing code), under the same permissions as the web app |
| SpacetimeDB | spacetime/, backend/app/work/live.py | Every committed approval mirrored live, so other screens update with no refresh; agents publish each step. Postgres stays the system of record |
| Azure | docs/DEPLOY.md | The API, worker, Postgres and agents on Azure Container Apps |
| Postgres 16 | backend/app/db | Four roles with exact grants, the hash-chained audit_event, event-sourced work |
| Python 3.13 · FastAPI | backend/ | ASC 842 schedules, CAM pools, CPI, remeasurement, journal entries. Deterministic, with a test suite |
| Next.js 15 | frontend/ | Formats and asserts what the API says. Does no lease accounting of its own |
| Agent | Name | Address |
|---|---|---|
| Front desk | Northbay Lease Desk | agent1qg2tetdj6qf5wnf744mvvtz66rzfrmvqkx5dcejzpg78q3prt9aa58j2g0g |
| Rulebook | lease_desk_rulebook | agent1qtqqwygy3z7uc2ypu4qsc2dklqmuadvgy23mwpl54wqccl02sp3ag4pn3ud |
| Investigation | lease_desk_investigation | agent1q2mr89mwmdn0l8wj5t5uyzpd09fhfq8mvs037zf44wsvlt0znamqqkmg0l9 |
| Approvals | lease_desk_approvals | agent1qgfyhfmc2ngygsck8f3xllf9mqr7plc8dv82czjjn9f3gh4psjcrjczh4dg |
Setup, pairing and what to say: agents_fetch/README.md.
Prerequisites: Python 3.11+ (macOS ships 3.9, which ReportLab will not run on), Node 20+, Docker with Compose v2.
git clone https://github.com/sarvesh172000/lease-desk.git && cd lease-desk
python3.13 -m venv .venv && ./.venv/bin/pip install -r requirements.txt
docker compose up -d db # Postgres 16 on host port 5433
make demo # database, January and July, API :8000, web app :3000
Open http://localhost:3000, sign in as [email protected] (password demo, the
controller), and open the July hold on LEASE-01. Demo mode has a switcher for every role.
No API key is needed: the model's answers the demo uses are committed. With ANTHROPIC_API_KEY set,
anything not cached calls Claude.
make up migrate seed # Postgres, api and worker; schema and roles; the company
make prove-roles # each role tries a forbidden write; the database refuses
make prove-limits # three forbidden actions refused and on the chain
make test # the whole suite (database tests run when Postgres is up)
make eval # generate the world and score a run against the answer key
make lint # ruff on the scope in ruff.toml
make ci # lint, the suite with database tests required, the eval
Frontend: cd frontend && npm ci && npm run build && npm run lint && npm test. NEXT_PUBLIC_USE_FIXTURES=1
runs the web app offline on its fixtures; frontend/scripts/sync_fixture_docs.mjs keeps those fixtures in
line with a live desk.
Compose publishes Postgres on host port 5433 so it never collides with a local one. Every setting has a
default, so .env is optional (copy .env.example). Platform tests migrate a throwaway database and drop it;
CI loads ci/require_db.py, which turns any skipped database test into a failure. GitHub Actions runs lint,
the suite and the eval against Postgres 16, make migrate seed prove-roles on a fresh database, and the
frontend's lint, build and tests.
Operating lease under ASC 842, payments in advance:
liability₀ = PV of all payments at the IBR
rou₀ = liability₀ + prepaid − incentives
straight_line = total payments / term months
interestₜ = (liabilityₜ − paymentₜ) × (IBR / 12)
liabilityₜ₊₁ = liabilityₜ − paymentₜ + interestₜ
rou_amortₜ = straight_line − interestₜ
A modification that isn't a separate contract remeasures the liability at the revised payments and rate, with the difference booked against the ROU asset. Months already closed on the stale schedule get a rent-expense catch-up.
| Path | What's in it |
|---|---|
backend/app/ | FastAPI API, the work layer (states, transitions, gateway), agents, LLM layer, engine, jobs |
frontend/ | Next.js 15 web app: welcome, Today, the money screen, month run, leases, obligations, disputes, policies, audit trail |
agents_fetch/ | The Fetch.ai / ASI:One agents |
spacetime/ | The SpacetimeDB module for the live mirror and agent feed |
datagen/ | The generated company, its documents and the answer key |
eval/ | Scores a run against the answer key |
leasedesk/ | The original engine package (schedule, reconcile, remeasure) |
data/reference/ | SEC EDGAR exhibits, BLS CPI, and the committed model answers |
docs/ | Design · security review · plan · deploy · sponsors |
Built and tested: abstraction, the ASC 842 engine, checking, the investigation and remeasurement, approvals through the gateway, the hash-chained audit, policies, disputes, obligations, the web app, the ASI:One agents and the SpacetimeDB mirror.
Not yet: extraction scored on the real SEC exhibits (the schema needs optional fields first, so a lease that is silent on a term isn't forced to answer), finance-lease classification, and variable or percentage rent.
MIT. Built at Cal Hacks 13.0 by Sarvesh Waghmare and Jenil.