anti-gambling-trader-tw
免費開源的投資反詐、交易統計與自動化交易程式工具:預設 PaperBroker,提供 14 種券商/交易所選項;交易紀錄分析在本機執行。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
A youth credit copilot that takes real, permissioned agentic action to protect a first-time cardholder's credit score — before the statement cuts, not after. Proof-of-concept for the Oolka AI PM case study: it feels like a real fintech app, but every external system (bank, bureau, issuer) is mocked.檢視完整 README ↗A youth credit copilot that takes real, permissioned agentic action to protect a first-time cardholder's credit score — before the statement cuts, not after. Proof-of-concept for the Oolka AI PM case study: it feels like a real fintech app, but every external system (bank, bureau, issuer) is mocked.
First-time cardholders believe "I pay my bill in full, so my score is safe." It's false. Bureaus snapshot the card balance on the statement generation date, not after payment — so someone who spends heavily and pays in full a week later is still reported at high utilisation, quietly costing 20–40 points. Almost nobody knows this. It's preventable by an agent that acts before the statement date.
npm install
npm run dev
Open http://localhost:3000. No API key, no database, no configuration required — the LLM layer degrades to a deterministic templated explanation, chat degrades to grounded canned answers, and state lives in memory (there's a "Reset the demo scenario" button under Activity).
Two seeded scenarios (switch in Settings):
Use the model for what it's good at (language, empathy, explanation) and rules for what it must never get wrong (financial math, thresholds, actions). That boundary is the product design.
| Layer | File | Owns |
|---|---|---|
| 1 — Rules engine | lib/rulesEngine.ts + lib/tools.ts | Every number. Utilisation, the paydown-to-30% amount, affordability vs. the safety buffer, severity tiers, timing, the directional score-impact band, the prioritised multi-obligation plan. Deterministic TypeScript — the LLM never does arithmetic. |
| 2 — Language | lib/llm.ts + lib/chatAgent.ts | Words and orchestration only. Explains pre-formatted facts, and in chat decides which tools to call — but is given no numbers and may only repeat figures a tool returned. A post-generation guard rejects anything else. |
| 3 — Policy gate | lib/policy.ts | When NOT to act. Consent, safety buffer, autonomy caps, missing-signal checks — run before any action executes (paydowns, limit increases, autopay). Chat gets its own gates: scope screening and the tool-number verifier. Every denial is logged. |
The harm-aware recommendation this produces: getting under 30% needs ₹31,200, but George only has ₹38,000 with ₹15,000 needed for essentials. A naive agent would tell him to pay money he doesn't have. This one moves ₹23,000 now and schedules ₹8,200 for Oct 22, with his due amount.
Hard invariant: zero un-consented actions. Verifiable in lib/policy.ts — every action route passes through checkPolicy() and there is no other code path that moves money. Saying "pay it down" in chat produces a proposal button that routes through the consent screen — chat cannot execute.
The "Ask" tab is a tool-using agent, not a free-text generator:
lib/tools.ts (getUtilisation, simulatePaydown, projectScoreImpact, getStatementTiming, getObligations, loanEligibilitySignal, buildPlan, proposeAction) and repeat the results verbatim.verifyChatAnswer() in lib/policy.ts rejects any answer containing a figure no tool returned this turn (one corrective retry, then a grounded canned fallback).The second per-action autonomy dial: pays the statement amount on the due date only while the safety cushion holds — if paying in full would breach it, it pays the safe part and alerts about the rest, never overdrawing quietly. Arming always requires explicit consent; execution honours ask-first vs autonomous. Since the demo clock is frozen, a "fast-forward to the due date" button plays the payment out through the same policy gate and lands the same legible log entry.
Set LLM_PROVIDER in .env.local (see .env.example):
| Provider | Setup | Notes |
|---|---|---|
| (unset) | none | Deterministic templated explanation. The app never blocks on a model. |
ollama | Install Ollama, ollama pull llama3.2 | Recommended default. Local open model: keyless, offline, free. |
hf | HF_API_TOKEN | Hugging Face Inference API (default meta-llama/Llama-3.3-70B-Instruct). The easy way to get a live open model on a Vercel deploy. |
frontier | ANTHROPIC_API_KEY or OPENAI_API_KEY | Frontier API, for comparison. |
All providers sit behind one interface (explain(facts, kind)) — swapping is one env var. Any failure or timeout silently falls back to the template. The UI shows a small provenance badge ("words from…") so you can see which source produced the copy.
Why open-model-first for production: this workload is high-volume, short-form, vernacular explanation — exactly what a small self-hosted open model does well. At scale, per-call frontier pricing dominates unit economics; and the payloads contain financial PII, where RBI data-localisation expectations make keeping inference in-country and in-house the safer default. A frontier API remains a fallback for rare hard cases only.
On wide screens, a side rail narrates the architecture live: the numbers the rules engine computed, where the words came from (including the last chat answer's tool chain), and the checks the last action passed or failed.
GET /api/state — full snapshot (POST resets the demo)POST /api/guardian/evaluate — rules engine: detection, amounts, severity, impact bandPOST /api/guardian/explain — LLM layer ({ kind: "alert" | "recommendation" | "action-summary" | "out-of-scope" })POST /api/chat — grounded chat: { messages } → answer + tool trace + optional consent-gated action proposalPOST /api/actions/paydown — mocked bank debit; policy-gatedPOST /api/actions/limit-increase — mocked issuer request; policy-gatedPOST /api/actions/autopay — { intent: "arm" | "simulate-due-date" }; policy-gatedPATCH /api/settings — autonomy dials, auto-move cap, demo scenarioGET /api/llm-status — deployment diagnostics (?probe=1 makes one live provider call)External calls are mocked with simulated latency and deterministic outcomes.
Phase-2 integrations live behind lib/connectors/, each with the same contract as the LLM layer: env-selected, graceful mock fallback, provenance surfaced in the UI.
BANK_PROVIDER, default aa-sim) — a self-hosted Account Aggregator simulator that mirrors the Setu Bridge consent contract: consent session → the aggregator's hosted consent screen (its own surface, not the Guardian's) → grant → FI data fetch, with a deterministic 6-month synthetic deposit payload. Onboarding's "Link HDFC savings" runs this flow for real; the linked card shows "via Account Aggregator (simulator) · consent on record". Why a simulator: the real Setu AA sandbox signup is geo-fenced to India (and production AA requires an FIU licence); the app-side flow is identical, so real keys are an env swap. Direct CIBIL access, for anyone unregulated, is legally impossible (CICRA specified-user regime) — the seam shows where it would plug in.PAY_PROVIDER=razorpay + RAZORPAY_KEY_ID/RAZORPAY_KEY_SECRET) — every executed move creates a test-mode Razorpay Order, and the action log shows the order_… receipt chip (openable in the Razorpay test dashboard). The connector refuses live keys (rzp_live_…) on principle. Without keys, receipts are simulated and labelled as such.Standard Next.js — deploys to Vercel free tier as-is (vercel or import the repo). State is in-memory per serverless instance, which is fine for a demo; the reset button reseeds after cold starts. Optionally set LLM_PROVIDER=hf + HF_API_TOKEN (or frontier + a key) in the project's environment variables for live explanations.
One flow only (the Utilisation Guardian). Autopay and disputes appear as disabled stubs for context. No auth, no real integrations, no database — prototype polish over breadth.