这里是 Phase 2 的入口:把 Hermes、本地 Markdown 和项目文档转成可筛选候选,再由你一键导入知识卡。
默认扫描 Hermes 知识系统和项目 docs,只导入摘要与来源路径,不复制长文全文。
# Trading Ops SQLite SSOT Local daily-operation records live in `.data/trading-ops.sqlite`. The scripts do not call paid APIs, broker APIs, wallets, or order execution endpoints. They accept manual JSON and safe seed data only. ## Commands Outputs: - SQLite SSOT: `.data/trading-ops.sqlite` - Review JSON: `.data/daily-reviews/YYYY-MM-DD.json` - Review Markdown: `.data/daily-reviews/YYYY-MM-DD.md` ## Record Format `market` must be `a_share`, `crypto`, or `polymarket`. `recordType` must be `watch`, `plan`, `paper_trade`, `trade`, `event`, or `review`. `status` must be `observed`, `planned`, `executed`, `cancelled`, or `reviewed`. Use `source` to identify the adapter or manual process. Keep secrets, account IDs, wallet addresses, and paid vendor payloads out of input files.
# Local knowledge backend runbook The SQLite database is the searchable single source of truth. Markdown, JSON, and text files are authoring inputs; API requests never scan them directly. Indexing redacts common secrets, emails, IP addresses, phone numbers, and monetary amounts before content is written to SQLite. ## Build and inspect the index Run from the repository root: The default database is `.data/knowledge.db`. Override locations with `KNOWLEDGE_ROOT` and `KNOWLEDGE_DB`. Reindexing is transactional, hash-based, idempotent, and removes records whose source files were deleted. ## Run the API Indexing and search use only the Python standard library. The HTTP layer uses FastAPI when installed: Set `KNOWLEDGE_REINDEX_API_KEY` to a locally generated random value before starting the server. The server binds to `127.0.0.1:8000` by default; `KNOWLEDGE_HOST` and `KNOWLEDGE_PORT` override this. Endpoints are `GET /health`, `GET /stats`, `GET /search?q=止损&limit=10`, `GET /document?id=1`, and `POST /reindex`. Reindex requires the key in the `X-API-Key` header. Never commit the key or put it in a URL. Terminate TLS and add network authentication before exposing the API outside a trusted
# SingClaw Knowledge Platform v1 Status: Proposed Owner: Knowledge Platform Last updated: 2026-07-29 Decision: ADR-001 ## 1. Executive summary `/knowledge` is a static file showcase, not a dependable knowledge system. The repo contains useful content and partial implementations, but no authoritative ingestion pipeline, searchable system of record, unified authorization, or traceable publication workflow. Knowledge is split across files under `knowledge/`, a hand-built `search-index.json`, a standalone FastAPI process that scans Markdown at request time, a hard-coded JSON RAG file read by Next.js, and Supabase/JSON knowledge-game records that model learning activity rather than retrievable source truth. V1 introduces one serving authority: SQLite with FTS5. Content is ingested into immutable revisions, classified and redacted before retrieval, chunked deterministically, and promoted explicitly. Internal search/dashboard and public chat use the same policy-filtered retrieval service. Files remain inputs and archival evidence, not a query-time database. SQLite fits the current single PM2 instance and existing `better-sqlite3` dependency. It is a deliberate v1 boundary, not a distribut
# ADR-001: SQLite FTS5 as the Knowledge Serving SSOT Status: Proposed Date: 2026-07-29 Decision owners: Principal Architecture, Knowledge Platform Related design: Knowledge Platform v1 ## Context SingClaw has incompatible representations of knowledge: files and a manually curated `knowledge/search-index.json`; a Python process scanning Markdown into memory; a Next.js endpoint reading a separate absolute JSON RAG artifact; Supabase `knowledge_sources`/`wiki_cards` for learning state; and local user/chat SQLite databases that do not own corpus content. Static placement effectively publishes content while visibility labels are unenforced. Freshness is manual, the JSON index is malformed, and chat exposes a default API key in server and browser code. There is no atomic ingest/redact/publish operation or stable citation identity. V1 needs a local-first, inexpensive, transactional, rebuildable serving authority supporting mixed Chinese/English lexical retrieval and the current single-instance PM2 deployment. Redaction must precede indexing and model egress. “SSOT” means authority for normalized, redacted, versioned, publication-controlled knowledge used by search/RAG. Files remain author
# SingClaw OpenClaw Project-Group Task Ledger Generated at: 2026-06-14T14:31:32.397Z Merge policy: read-only archive: source records are indexed here but not mutated This ledger consolidates local OpenClaw, Neon, cron, Windows scheduler, memory, and report evidence into the SingClaw project group. Source systems are indexed read-only and were not mutated by the import. ## Counts | Metric | Count | | --- | ---: | | Total entries | 263 | | Blocked | 51 | | Needs Triage | 42 | | Operational Watch | 3 | | Archived Done | 167 | ## Source Inputs - OpenClaw runs SQLite: `C:\openclaw-state\tasks\runs.sqlite` - OpenClaw cron jobs: `C:\openclaw-state\cron\jobs.json` - Neon operational tables: `C:\openclaw-workspace\tmp\neon.active.url (read only, value redacted)` - Reports: `C:\openclaw-workspace\reports` - Memory: `C:\openclaw-workspace\memory` ## Blocked / Retry First | Status | Priority | Area | Source | Title | Source Owner | Next Action | | --- | --- | --- | --- | --- | --- | --- | | Blocked | P0 | collab-control | neon_task_queue:T-035 | 2026-06-06 每日 Agent 议题交流未达标:Maxink 未 ACK watchdog 课题 | maxink | Review task status during project-group triage. | | Blocked | P0 | singclaw-town | neo
# PRD: app.singclaw.xyz — C端每日交易学习与复盘 App - Owner: H Sing - Execution supervisor: Maxink - Implementation agent: Codex - Repo: `Parsons791400458/singclaw-dynamic` - Local path: `C:\Users\宇宙无敌小仙女本仙\Documents\Singclaw\singclaw-dynamic` - Domain: `https://app.singclaw.xyz` - Created: 2026-06-18 - Status: Draft v0.1 for sprint execution ## 1. Product Positioning `app.singclaw.xyz` should evolve from an internal/enterprise-like operations console into a consumer-facing daily trading learning companion. The app is not a “guaranteed profit signal terminal”. It should help small-fund users build a repeatable trading process: 1. Understand today’s market context. 2. Identify opportunity and risk in plain language. 3. Convert curiosity into a risk-first plan. 4. Practice through paper trade / preflight checklist. 5. Review behavior and mistakes over time. ## 2. Target Users ### Primary v1 user Retail crypto learners with roughly `1,000–10,000 USDT` trading capital who want: - a daily market briefing; - structured opportunity/risk explanation; - a low-friction trading plan template; - learning missions and review reminders; - less impulsive decision-making. ### User psychology Users may say t
# SingClaw App Reframe ## Goal Move `app.singclaw.xyz` from an enterprise/internal operations console to a consumer daily trading learning product. ## Product Shape SingClaw should feel like a daily desk for an individual user: - Learn: explain current market context in plain language. - Interact: let users inspect watchlists, signals, and reports. - Practice: turn ideas into paper trades before real trades. - Remember: store user profiles, preferences, journals, and review history in Supabase. - Improve: make the daily loop visible: brief, decision, paper trade, review. ## Locked Product Inputs Updated: 2026-05-28, Asia/Shanghai. - First target users: people with capital to trade but no mature trading system yet. - Target capital range: 1,000-10,000 USDT. - First market rollout: crypto first, then A-shares, then US stocks. - First product promise: help users spend 10 minutes a day understanding market opportunities, risk reminders, learning/review tasks, instrument calendars, and expected impact. - Most important loop: daily learning and trading review tasks. - Tone: gamified missions, not a dry institutional terminal. - Pricing for v1: free. - Data boundary: not a blocker for now
# Codex Supervision Protocol — app.singclaw.xyz Owner: Maxink supervising Codex for H Sing. ## Operating Rule Codex works one sprint at a time. It must not jump ahead, push, deploy, delete large files, rewrite history, rotate secrets, or touch production infrastructure unless Maxink explicitly instructs after H Sing approval. ## Required Codex Output Per Sprint 1. Situation: what repo/app state it found. 2. Action: exact files changed or inspected. 3. Evidence: lint/build/test/smoke result. 4. Risk: blockers, secrets, deployment uncertainty. 5. Next: recommended next sprint instruction. ## Hard Constraints - No `git push`. - No production deploy. - No PM2/server restart. - No secret printing. - No destructive cleanup. - Do not write runtime data into `public/`. - Keep changes small and reviewable. ## Current Sprint Queue - Sprint 0: Baseline audit and release slicing. - Sprint 1: Stabilize local build and auth/data foundation. - Sprint 2: Daily Trading Desk MVP. - Sprint 3: Reports and market brief loop. - Sprint 4: Knowledge mission / game loop. - Sprint 5: Production readiness package.
# Sprint 0 Baseline Audit — app.singclaw.xyz - Supervisor: Maxink - Implementation agent attempted: Codex CLI session `019ed735-c99b-7182-aead-d49940e24385` - Repo: `Parsons791400458/singclaw-dynamic` - Local path: `C:\Users\宇宙无敌小仙女本仙\Documents\Singclaw\singclaw-dynamic` - Date: 2026-06-18 - Scope: audit only; no push; no deployment; no production/server changes. ## 1. Situation The app has evolved beyond the older cron/report dashboard into a larger consumer-facing trading/knowledge product shape. The local working tree contains many uncommitted changes: auth migration, dashboard rebuild, Supabase storage, trading plan APIs, knowledge-game routes, sprint/PRD docs, and deployment/env cleanup. The repository currently builds successfully locally, but it is not release-ready because the working tree is large, production deployment status is unproven, and many user-facing Chinese strings appear mojibake/encoding-corrupted in source output. ## 2. Current Git Working Tree Summary Current branch: `master`. Latest committed baseline observed earlier: `ee978a4 🤖 NPDP周复盘自动部署 W20: 首页重构/登录注册优化/Navbar重构/Supabase移除/Bn-Alpha更新 2026-05-14 10:04 CST`. `git status --short` shows: Interpretation: -
# Sprint 1 Stabilization Log Date: 2026-06-18 Task: Stabilize local build/auth/data foundation for `app.singclaw.xyz` Scope lock: no push, no deploy, no PM2 restart, no production touches, no secrets printed. ## 1) Situation Sprint 0 audit context was valid and showed visible copy issues and incomplete auth-demo consistency risk. This pass focused on core local-facing stabilization surfaces only: - navbar + auth pages/auth shell copy pathing - auth/demo routing behavior - API/dashboard auth gating consistency - README/env setup clarity ## 2) Action and files changed - Added `src/lib/clerk-config.ts` - Centralized Clerk env validation helpers: - `isClerkPublishableConfigured()` - `isClerkFullyConfigured()` - Treats example placeholder keys as not-configured. - Updated `src/components/Navbar.tsx` - Switched Clerk gating to shared publishable-key helper. - Updated `src/app/layout.tsx` - Wrapped app in ClerkProvider only when publishable Clerk config is valid. - Updated `src/app/api/trading-plans/route.ts` - Replaced inline env checks with shared Clerk full-config helper. - Updated `src/app/dashboard/page.tsx` - Replaced inline env checks with shared Clerk full-config helper. - Updated
# Sprint 2: Daily Trading Desk MVP ## 鐩爣 瀹屾垚 `/dashboard` 鐨?C 绔棩鍐呬氦鏄撳伐浣滃彴棣栦釜鍙敤鐗堟湰锛圫print 2锛夛紝涓嶆墿灞?reports / knowledge-game锛屼笉鏂板鏀惰垂鍔熻兘锛屼笉鎺ュ叆澶栭儴 API锛屼笉瑙︾鐢熶骇涓庨儴缃层€? ## 鍙樻洿鏂囦欢 - `src/components/TradingMissionDesk.tsx` - 閲嶆瀯闈㈡澘缁撴瀯锛氭満浼?/ 椋庨櫓 / 浠诲姟鍒嗗尯锛屽舰鎴愭洿娓呮櫚鐨勬棩鍐呬氦鏄撳喅绛栬矾寰勩€? - 琛ラ綈璁″垝琛ㄥ崟鐨勫垱寤轰笌淇濆瓨娴佺▼锛堝惈淇濆瓨鐘舵€併€佹彁浜ゆ枃妗堛€侀敊璇彁绀猴級銆? - 澧炲姞鈥滄渶杩戣鍒掆€濆垪琛ㄧ殑鐘舵€佸垎灞傦細 - 鍔犺浇鎬? - 绌烘€? - 澶辫触鎬? - 鎴愬姛鎬侊紙鍚椂闂翠笌鍏抽敭瀛楁锛? - 澧炲己椋庨櫓棰勭畻璇存槑鏂囨锛堟€婚绠椼€佸彲鐢ㄩ绠椼€佸垎灞傛槑缁嗭級銆? - 瀹屽杽绌虹櫧涓庤竟鐣屾枃妗堬紝缁熶竴涓枃琛ㄨ揪骞朵紭鍖栧彲璇绘€с€?- `src/lib/trading-desk.ts` - 娓呯悊鍜岃ˉ榻愮ず渚嬩氦鏄撳競鍦?鏈轰細/椋庨櫓/涓讳换鍔?鏃ュ巻涓庢暟鎹簮鍐呭銆? - 缁熶竴瀛楁鍊硷紝淇濊瘉鐘舵€佸瓧娈典笌灞曠ず閫昏緫涓€鑷达紝鎻愬崌鏃ユ姤鍐呭绋冲畾鎬с€?- `docs/sprints/sprint-2-daily-trading-desk-mvp.md`锛堟湰鏂囷級 ## 鎵ц闄愬埗涓庣害鏉? - 淇濈暀 Sprint 1 鐨?Auth / Demo 鍩虹鑳藉姏锛屼笉鏀瑰姩璁よ瘉鎺ュ叆閫昏緫銆?- 鏈慨鏀?`reports`銆乣knowledge-game` 鍙婂叾鐩稿叧渚濊禆銆?- 鏈坊鍔犳柊浠樿垂閾捐矾銆佸閮?API 闆嗘垚鎴栧悗绔柊鑳藉姏銆?- 鏈墽琛岄儴缃层€丳M2 閲嶅惎銆佺瀵嗚鍙栨墦鍗般€佺敓浜х幆澧冩搷浣溿€? ## 楠岃瘉涓庣粨鏋? - `cmd /c npm run lint` - 缁撴灉锛氶€氳繃锛堟棤閿欒/鍛婅锛?- `cmd /c npm run build` - 缁撴灉锛氶€氳繃锛堟瀯寤烘垚鍔燂級 ## 鎵嬪伐 smoke checklist ### A) Demo 妯″紡 1. 鎵撳紑 `/dashboard`锛岀‘璁ゅ湪鏈湴婕旂ず涓婁笅鏂囦笅鑳芥甯歌繘鍏ラ〉闈笖鏃犳潈闄愰樆鏂€?2. 鍦ㄢ€滀粖鏃ユ満浼?/ 浠婃棩椋庨櫓 / 浠婃棩浠诲姟鈥濆尯鍩熺‘璁や俊鎭寜妯″潡灞曠ず涓旀爣棰樸€侀噾棰濅笌涓枃鎻忚堪鍙銆?3. 鏂板缓璁″垝锛氬~鍐欏唴瀹瑰悗鐐瑰嚮淇濆瓨锛岃瀵熸寜閽姸鎬佷笌鍙嶉鏂囨鏄惁鍙悊瑙d笖涓嶆姤閿欍€?4. 鍒锋柊鍚庣‘璁も€滄
# Codex Sprint 3 Instruction — Trading Plan Execution Loop + Risk Guardrails You are optimizing `app.singclaw.xyz` in the local repo only. Repository root: `C:\Users\宇宙无敌小仙女本仙\Documents\Singclaw\singclaw-dynamic` ## Hard boundaries Do NOT: - push, deploy, restart PM2, touch production, or change DNS/server settings - print, copy, or modify secrets from `.env.local` or any real env file - add payment / subscription / external market API integration - expand reports, knowledge-game, unrelated pages, or unrelated refactors - delete existing user-facing Sprint 1 auth/demo-mode foundation - use PowerShell direct `npm`; use `cmd /c npm run lint` and `cmd /c npm run build` ## Must read first Read these files before editing: - `docs/prd-app-singclaw-c-user-trading-companion.md` - `docs/sprints/codex-supervision-protocol.md` - `docs/sprints/sprint-0-baseline-audit.md` - `docs/sprints/sprint-1-stabilization.md` - `docs/sprints/sprint-2-daily-trading-desk-mvp.md` - `src/components/TradingMissionDesk.tsx` - `src/lib/trading-desk.ts` - `src/app/api/trading-plans/route.ts` ## Sprint 3 goal Implement the smallest useful C-user loop after Sprint 2: > A user can save a daily trading plan, see a cle
# Sprint 3: 执行状态循环 + 风险守门 日期:2026-06-18 ## 本次变更文件 - `src/components/TradingMissionDesk.tsx` - `src/lib/trading-desk.ts` - `src/lib/trading-plans-store.ts` - `src/app/api/trading-plans/route.ts` - `supabase/migrations/20260618000000_trade_plan_status.sql` - `docs/sprints/sprint-3-execution-risk-loop.md` ## 执行状态行为说明 - 在交易计划表单中新增 `执行状态` 选择项: - `draft`(草稿) - `planned`(已计划) - `executed`(已执行) - `cancelled`(已取消) - 表单保存时会一并提交 `status`,并在本地草稿与列表中持久化。 - 最近计划列表现在显示状态标签,并支持简单筛选(全部 / 草稿 / 已计划 / 已执行 / 已取消)。 - 兼容历史数据:当后端返回的计划缺少状态时,前端与后端默认展示为 `planned`。 ## 风险校验规则(保存前) - 缺失字段仍会阻止保存: - 标的为空 - 账户规模 ≤ 0 - 风险百分比 ≤ 0 - 机会说明为空 - 核心风险为空 - 失效条件为空 - 风险百分比 > 2: - 页面会显示“激进计划,需确认”的风险状态; - 出现显式勾选框 `我确认当前计划为高风险...`; - 勾选前按钮不可点击; - 勾选后可保存。 - 页面实时展示风险预算(USDT)和风险状态(可执行 / 可执行(已确认) / 不可执行),满足“教育型提示”要求。 ## 数据源真实性改动 - 将 `src/lib/trading-desk.ts` 中的数据源状态从 `connected` 改为: - `manual`(手工填充) - `simulated`(模拟预演) - `reference-only`(参考素材) - 在仪表盘头部 `数据状态` 卡片中新增展示,明确说明当前为“手工/模拟/参考”口径,不展示 Binance / OKX / Coinglass / CMC 为 `connected`。 - 新增 migration:`supabase/migrations/20260618000000_trade_plan_status.sql` 为 `trade_plans` 增加 `status` 列并约束; - API 存储层同时兼容“无新列的旧库”,通过回退查询/写入策略保持兼容。 ## 验证结果 - `cmd /c npm run lint`:通过 - `cmd /c npm ru
# Codex Sprint 4 Instruction — Dashboard Copy Cleanup + Execution Review Prompt You are optimizing `app.singclaw.xyz` in the local repo only. Repository root: `C:\Users\宇宙无敌小仙女本仙\Documents\Singclaw\singclaw-dynamic` ## Hard boundaries Do NOT: - push, deploy, restart PM2, touch production, or change DNS/server settings - print, copy, or modify secrets from `.env.local` or any real env file - add payment / subscription / external market API integration - expand reports, knowledge-game, unrelated pages, or unrelated refactors - apply Supabase migrations or touch a live database - delete Sprint 1 auth/demo-mode foundation - break Sprint 2/3 dashboard behavior - use PowerShell direct `npm`; use `cmd /c npm run lint` and `cmd /c npm run build` ## Must read first Read these files before editing: - `docs/prd-app-singclaw-c-user-trading-companion.md` - `docs/sprints/codex-supervision-protocol.md` - `docs/sprints/sprint-2-daily-trading-desk-mvp.md` - `docs/sprints/sprint-3-execution-risk-loop.md` - `src/components/TradingMissionDesk.tsx` - `src/lib/trading-desk.ts` - `src/lib/trading-plans-store.ts` - `src/app/api/trading-plans/route.ts` ## Sprint 4 goal Make `/dashboard` more demo-ready and