Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2525aa8
docs: package CASHNET phase 3 repository
subhammohanty092-netizen Aug 29, 2026
51d9cee
feat: add bounded transaction graph tracing
subhammohanty092-netizen Aug 29, 2026
3fb8b9c
docs: record phase 4 validation and phase 5 plan
subhammohanty092-netizen Aug 29, 2026
73bdaf5
docs: clarify phase 4 publication state
subhammohanty092-netizen Aug 29, 2026
d9be77a
docs: correct validation test count
subhammohanty092-netizen Aug 29, 2026
3225be0
feat: add address intelligence and vasp attribution
subhammohanty092-netizen Aug 29, 2026
ae56776
docs: align phase 5 status
subhammohanty092-netizen Aug 29, 2026
754200c
feat: harden phase 5 review and evaluation
subhammohanty092-netizen Aug 29, 2026
7e48c7e
chore: checkpoint phase5 diagnostics
subhammohanty092-netizen Aug 30, 2026
f082208
fix: finalize phase5 validation and hardening
subhammohanty092-netizen Aug 31, 2026
9d16235
docs: update Esplora to LIVE_VALIDATED — 25 real Bitcoin transactions…
subhammohanty092-netizen Aug 31, 2026
99cf868
fix: live-validate all 3 blockchain providers
subhammohanty092-netizen Aug 31, 2026
a12f309
docs: all 3 providers LIVE_VALIDATED — provider blockers fully resolved
subhammohanty092-netizen Aug 31, 2026
1f52e27
docs: Phase 5 final gap audit — code-level repository classifications
subhammohanty092-netizen Aug 31, 2026
ec29442
docs: Phase 5 CLOSED/RELEASED — scope closure complete
subhammohanty092-netizen Aug 31, 2026
4239f0e
docs: Phase 6.0 architecture baseline — 7 documents
subhammohanty092-netizen Aug 31, 2026
813ca05
feat: Phase 6.1 multi-chain providers (BNB Chain, Polygon, Solana)
subhammohanty092-netizen Aug 31, 2026
f250605
feat: Phase 6.2 AML risk intelligence engine
subhammohanty092-netizen Aug 31, 2026
fe11821
feat: Phase 6.3 advanced graph + Phase 6.4 DeFi/MEV + Phase 6.5 evalu…
subhammohanty092-netizen Aug 31, 2026
132bf23
feat: Phase 6.6 production hardening + Phase 6 test suite
subhammohanty092-netizen Aug 31, 2026
86dc1a3
fix: Phase 6 release-readiness defects found during audit
subhammohanty092-netizen Aug 31, 2026
ef564b2
fix: wire phase6 persistence and analysis APIs
subhammohanty092-netizen Aug 31, 2026
6e7fb5f
fix: harden phase6 authentication and runtime
subhammohanty092-netizen Aug 31, 2026
74c374e
docs: record phase6 corrective readiness
subhammohanty092-netizen Aug 31, 2026
30cc681
fix: harden phase6 runtime boundaries
subhammohanty092-netizen Sep 1, 2026
d4c8ef6
feat: publish phase6 analysis API contracts
subhammohanty092-netizen Sep 1, 2026
71f3940
docs: record phase6 validation boundaries
subhammohanty092-netizen Sep 1, 2026
73d8a2e
docs: clarify phase6 validation decision
subhammohanty092-netizen Sep 1, 2026
6f31e7a
fix: preserve phase6 provenance and approval controls
subhammohanty092-netizen Sep 1, 2026
4b8f960
docs: record phase6 authenticated runtime evidence
subhammohanty092-netizen Sep 1, 2026
9cd34b0
fix: harden rate limit proxy handling
subhammohanty092-netizen Sep 1, 2026
c1a03f5
docs: distinguish historical provider validation
subhammohanty092-netizen Sep 1, 2026
445cd65
docs: record phase6 database-backed runtime validation
subhammohanty092-netizen Sep 1, 2026
db712b3
test: add phase6 postgres validation runner
subhammohanty092-netizen Sep 1, 2026
cc6c202
fix: invoke phase6 postgres validator safely on windows
subhammohanty092-netizen Sep 1, 2026
5a4cc88
fix: resolve psql path as scalar on windows
subhammohanty092-netizen Sep 1, 2026
8289e8e
fix: complete phase6 forensic report validation
subhammohanty092-netizen Sep 1, 2026
12df5e2
fix: harden phase6 validation drills
subhammohanty092-netizen Sep 1, 2026
d45f453
fix: complete phase6 validation hardening
subhammohanty092-netizen Sep 1, 2026
c1011d3
fix(phase6): Resolve SQL injections and parameter mismatches in Phase…
subhammohanty092-netizen Sep 1, 2026
fd35bee
chore: finalize phase6 validation state
subhammohanty092-netizen Sep 2, 2026
9379a97
chore: remove local validation artifacts
subhammohanty092-netizen Sep 2, 2026
4654534
fix: harden phase6 deployment boundaries
subhammohanty092-netizen Sep 3, 2026
4da6b0c
fix: harden phase6 supabase deployment
subhammohanty092-netizen Sep 4, 2026
788e6b1
Phase 6: Migrate BNB to NodeReal MegaNode, Polygon to Blockscout, rem…
Sharique-Raza Sep 6, 2026
fa0ae30
fix(ci): run lint recursively with if-present in validate job
Copilot Sep 6, 2026
90c178b
Merge upstream/main selectively (preserve Phase 6 production state)
subhammohanty092-netizen Sep 6, 2026
dfa0b54
Current development update
subhammohanty092-netizen Sep 8, 2026
794e4af
chore: complete Priority 0 Runtime Verification Audit
subhammohanty092-netizen Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions $file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$content
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
**/node_modules
dist
**/dist
.test-dist
**/.test-dist
.env
107 changes: 59 additions & 48 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,56 +1,67 @@
# Synthetic mode is the default and requires no external credentials.
DATABASE_URL=
SUPABASE_URL=
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
BLOCKCHAIR_API_KEY=
ETHERSCAN_API_KEY=
KAFKA_BROKER_URL=
ELASTICSEARCH_URL=
ELASTICSEARCH_API_KEY=
JWT_SECRET=
CASHNET_DATA_MODE=synthetic


# ============================================================================
# CashNet Deployment Configuration
# ============================================================================

# API Server
PORT=3000
NODE_ENV=production
LOG_LEVEL=info
# CASHNET Environment Configuration
# Copy to .env and fill in values. Never commit .env or credentials.

# --- Required Supabase PostgreSQL connections ---
# Runtime: use the least-privilege CASHNET login. For a persistent API on an
# IPv4-only network, obtain Supavisor *session* pooler URL from Supabase
# Connect (port 5432). Use the direct URL only where IPv6 (or the Supabase
# IPv4 add-on) is available. Always retain sslmode=verify-full.
DATABASE_URL=postgresql://cashnet.YOUR_PROJECT_REF:YOUR_RUNTIME_PASSWORD@YOUR_SUPABASE_POOLER_HOST:5432/postgres?sslmode=verify-full
# Migrations, backup and restore: use the privileged direct connection from
# Supabase Connect (or the documented session pooler fallback when direct IPv6
# is unavailable). This URL is never supplied to the API container.
CASHNET_MIGRATION_DATABASE_URL=postgresql://postgres:YOUR_MIGRATION_PASSWORD@db.YOUR_PROJECT_REF.supabase.co:5432/postgres?sslmode=verify-full
# Migration authentication failures (PostgreSQL 28P01) must be corrected in
# the Supabase secret manager; CASHNET never falls back to DATABASE_URL.
# Download the project CA PEM in Supabase Dashboard > Database > SSL
# Configuration. Store it outside the repository, with restrictive file ACLs.
# CASHNET always validates this CA and the Supabase hostname; it never accepts
# self-signed certificates or disables TLS verification.
CASHNET_SUPABASE_CA_CERT_PATH=C:\secure-path\supabase-ca.pem
PORT=5000

# Model Service (Python Flask)
PYTHON_SERVICE_URL=http://localhost:5000
MODELS_DIR=./models
# --- Data mode ---
# synthetic (default): deterministic fixtures, no database required
# authorized: real PostgreSQL-backed persistence
CASHNET_DATA_MODE=authorized

# Security & PII Masking
ENABLE_PII_MASKING=true
LOG_MASKED_FIELDS=false
# --- Development authentication (never enable in production) ---
CASHNET_DEV_AUTH_ENABLED=true

# JWT/Auth Token Configuration
JWT_EXPIRY_HOURS=24
REFRESH_TOKEN_EXPIRY_DAYS=7
# --- Production authentication / browser origins ---
# CASHNET_JWT_ISSUERS=https://issuer.example
# CASHNET_JWT_AUDIENCE=cashnet-api
# CASHNET_JWKS_URI=https://issuer.example/.well-known/jwks.json
# CASHNET_CORS_ALLOWED_ORIGINS=https://investigator.example
# CASHNET_RATE_LIMIT_MAX_REQUESTS=120

# CORS Configuration
CORS_ORIGIN=http://localhost:3000,https://yourdomain.com
# --- Runtime ---
NODE_ENV=development
LOG_LEVEL=info

# Frontend Configuration
REACT_APP_API_URL=http://localhost:3000/api
REACT_APP_MODELS_URL=http://localhost:5000
REACT_APP_ENVIRONMENT=development
# Production deployment requirements (set only in the production secret/runtime
# configuration; do not copy the development values above):
# NODE_ENV=production
# CASHNET_DEV_AUTH_ENABLED=false

# Monitoring & Logging
SENTRY_DSN=
DATADOG_API_KEY=
LOG_TO_FILE=false
# --- Provider credentials (required for authorized collection) ---
# ETHERSCAN_API_KEY=
# ETHERSCAN_CHAIN_ID=1
# BITCOIN_ESPLORA_BASE_URL=
# TRONGRID_API_KEY=
# TRONGRID_BASE_URL=https://api.trongrid.io
# BSCSCAN_API_KEY=
# POLYGONSCAN_API_KEY=
# SOLANA_RPC_URL=https://approved-rpc.example
# SOLANA_API_KEY=

# Feature Flags
FEATURE_MODEL_PREDICTIONS=true
FEATURE_PII_MASKING=true
FEATURE_LEGAL_HOLD=true
FEATURE_AUDIT_TRAIL=true
# --- Provider tuning ---
# CASHNET_PROVIDER_TIMEOUT_MS=10000
# CASHNET_PROVIDER_MAX_RETRIES=2

# Deployment Target (render/heroku/aws/gcp)
DEPLOYMENT_TARGET=render
# --- Approved address-label dataset (Phase 5 intelligence) ---
# CASHNET_LABEL_DATASET_APPROVED=true
# CASHNET_LABEL_DATASET_PATH=
# CASHNET_LABEL_DATASET_NAME=
# CASHNET_LABEL_DATASET_VERSION=
# CASHNET_LABEL_DATASET_LICENSE=
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Report a reproducible defect without sensitive data
labels: bug
---

## Summary

## Safe reproduction

## Expected behavior

## Actual behavior

## Environment

Do not include credentials, private keys, seed phrases, or real case data.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Phase-scoped feature request
about: Propose an approved, bounded improvement
labels: enhancement
---

## Problem

## Proposed phase and scope

## Architecture, provenance, and security impact

## Acceptance criteria

Do not propose provider credentials, real personal data, or unsupported attribution as issue content.
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Summary

Describe the change and the phase it belongs to.

## Safety and data provenance

- [ ] Legacy `/api/*` synthetic workflow remains unchanged, or the reason is documented.
- [ ] No credentials, private keys, seed phrases, sensitive case data, or generated build artifacts are included.
- [ ] Provider/dataset facts retain source and confidence semantics where applicable.
- [ ] No unreviewed attribution or identity claim was introduced.

## Verification

- [ ] `pnpm run typecheck`
- [ ] `pnpm -r --if-present run test`
- [ ] `pnpm --filter @workspace/api-spec run codegen` (if contract changed)
- [ ] `pnpm --filter @workspace/api-server run build`
- [ ] `git diff --check`
133 changes: 133 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: CASHNET CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
validate:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: cashnet_test
POSTGRES_USER: cashnet
POSTGRES_PASSWORD: test_password
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U cashnet"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 11.19.0

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm -r --if-present run lint

- name: Typecheck
run: pnpm run typecheck

- name: Test
run: pnpm -r --if-present run test
env:
DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
# Disposable CI-only PostgreSQL compatibility service; production
# deployments use Supabase URLs injected by their secret manager.
CASHNET_MIGRATION_DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
CASHNET_DATABASE_TEST_MODE: disposable-postgres
NODE_ENV: test

- name: Generate and validate OpenAPI clients
run: pnpm --filter @workspace/api-spec run codegen

- name: Build
run: pnpm --filter @workspace/api-server run build

# This is deliberately the same baseline-plus-ledger runner used by
# CASHNET deployments. Do not replace it with a loop over SQL files.
- name: Migrate clean PostgreSQL database
run: pnpm --filter @workspace/db run migrate
env:
DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
CASHNET_MIGRATION_DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
CASHNET_DATABASE_TEST_MODE: disposable-postgres
NODE_ENV: test

- name: Prove migration idempotency
run: pnpm --filter @workspace/db run migrate
env:
DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
CASHNET_MIGRATION_DATABASE_URL: postgres://cashnet:test_password@localhost:5432/cashnet_test
CASHNET_DATABASE_TEST_MODE: disposable-postgres
NODE_ENV: test

- name: Git check
run: git diff --check

security:
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 11.19.0

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

# High and critical vulnerabilities are release blockers. Low/moderate
# advisory noise is deliberately outside this mandatory gate.
- name: Dependency audit (high/critical policy)
run: pnpm audit --audit-level=high

- name: Reject hardcoded secrets
run: |
# Unit fixtures intentionally use inert strings such as "configured";
# scan deployable source, not test data.
if git grep -nI -E '(API[_-]?KEY|SECRET|PASSWORD|TOKEN)[[:space:]]*[:=][[:space:]]*"[^"[:space:]]{10,}"' -- Dockerfile docker-compose.yml .github artifacts lib scripts ':(exclude)*.test.ts'; then
echo "Potential hardcoded secret detected. Use server environment configuration instead."
exit 1
fi

container:
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v4

- name: Build container
run: docker build -t cashnet:ci .

- name: Container scan
uses: aquasecurity/trivy-action@master
with:
image-ref: cashnet:ci
format: table
severity: CRITICAL,HIGH
exit-code: '1'
33 changes: 19 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ out-tsc

# dependencies
node_modules
.test-dist

# IDEs and editors
/.idea
Expand Down Expand Up @@ -47,18 +48,22 @@ Thumbs.db
# Replit
.cache/
.local/
.venv/
# Downloaded external datasets (regenerated by notebooks at runtime)
**/DATA/external/
**/data/external/
generic
docs
data
*.pyc
.kiro

!data/
!data/reference/
!data/reference/banks.json
node.log
py.log
# CASHNET local configuration and read-only reference checkouts
.env
.env.*
!.env.example
references/
opencode.json

# Local/runtime artifacts
.pnpm-store/
server_log.txt
.debug/


# Local/runtime artifacts
.pnpm-store/
server_log.txt
.debug/

Loading