diff --git a/README.md b/README.md index d2d52c253..53e3e50c8 100644 --- a/README.md +++ b/README.md @@ -1,631 +1,263 @@ -# Solar: AI Native Operating System +# Solar -> Token In → Token Out | 从计算本质重构的智能操作系统 +> **Autonomous Software Organization Runtime** +> 让用户当老板,让 AI 组织自己完成软件工程。 [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) -[![Agents](https://img.shields.io/badge/Agents-13-green.svg)](docs/agents.md) -[![Skills](https://img.shields.io/badge/Skills-38-blue.svg)](docs/skills.md) +[![Solar Core](https://img.shields.io/badge/Solar-Core-38bdf8.svg)](CLAUDE.md) +[![Solar Harness](https://img.shields.io/badge/Solar-Harness-8b5cf6.svg)](harness/) +[![AI Native](https://img.shields.io/badge/AI--Native-Execution%20Fabric-14b8a6.svg)](#solar-是什么) -## 当前范围:Solar = AI Native Core + Solar Harness + Unified Knowledge +Solar is an AI-native operating system prototype for long-running, evidence-driven software work. It is not a chatbot, not a prompt collection, and not a simple multi-agent demo. Solar treats natural language as the control surface, requirements as compilable artifacts, AI products as schedulable physical operators, and software delivery as evidence-gated DAG execution. -**Solar** 现在是一个 AI-native operating system 原型,不只是 Claude/Codex 的提示词集合。它由三层组成: +中文一句话:**Solar 把老板的一句话编译成一支 AI 组织的自主行动。** -- `core/`, `agents/`, `skills/`, `rules/`, `hooks/`: AI-native 工作流内核,提供 agent/persona、skill、规则、hook 和长期状态入口。 -- `harness/`: Solar Harness 控制面,负责 sprint 合约、DAG 调度、pane lease、builder/evaluator 派发、远端执行、benchmark 和经验沉淀。 -- `.solar/`, `codex-bridge/`, `scripts/`, `deploy/`, `docs/`: 部署契约、Codex 协同、导出、巡检、知识沉淀和产品化辅助工具。 - -运行态数据库、个人日志、密钥、WAL/SHM、pane 截图、本机私有轨迹和本地模型缓存不作为公开源码提交;安装器和 Harness 会在本机生成这些运行态资产。 - -## 技术架构 - -```mermaid -flowchart TB - User["Operator / Codex / Claude Code"] --> Intent["Intent & Contract Layer\nnatural language / PRD / sprint contract"] - - Intent --> Core["Solar Core\nagents / skills / rules / hooks / CLAUDE.md"] - Intent --> Harness["Solar Harness Control Plane\ncoordinator / autopilot / task queue / pane lease"] - - Harness --> Planner["Planner\nplan.md + task_graph.json"] - Planner --> Scheduler["DAG Scheduler\nready nodes / write-scope guard / capability matching"] - Scheduler --> Builders["Builder Workers\nmain panes + builder lab + remote workers"] - Scheduler --> Evaluator["Evaluator\nnode verdict / batch gate / parent gate"] - - Builders --> Artifacts["Sprint Artifacts\nhandoff / eval / reports / accepted outputs"] - Evaluator --> Artifacts - Artifacts --> Experience["Experience Memory\nsuccess/failure compression / reusable lessons"] - Experience --> Scheduler +--- - Harness --> Capability["Capability Plane\nskills inventory / intent match / runtime scorecards"] - Capability --> Scheduler - Capability --> Core +## Solar 是什么 - Harness --> DataAccess["Data Access Layer\nMirage VFS / QMD search / Solar DB / Obsidian vault"] - DataAccess --> DataProcessing["Data Processing\nMinerU / wiki-ingest / embeddings / provenance"] - DataProcessing --> Knowledge["Unified Knowledge\n_sources / Obsidian / QMD index / accepted artifacts"] - Knowledge --> Core - Knowledge --> Harness -``` - -## 部署架构 - -```mermaid -flowchart TB - Repo["GitHub Repo\nlisihao/Solar"] --> RepoHarness["Published Harness\n~/Solar/harness"] - Repo --> LocalInstall["Local install\n~/Solar + ~/.solar + ~/.claude"] - LocalInstall --> RuntimeHarness["Runtime Harness\n~/.solar/harness"] - RepoHarness --> RuntimeHarness - - subgraph LocalMachine["Local workstation"] - RuntimeHarness --> MainSession["tmux: solar-harness\nmain control screen"] - MainSession --> P0["pane 0\nPM / Codex handoff / owner intent"] - MainSession --> P1["pane 1\nPlanner / Architect\nplan.md + task_graph.json"] - MainSession --> P2["pane 2\nBuilder main\nimplementation"] - MainSession --> P3["pane 3\nEvaluator / bridge\nnode verdict + parent gate"] - - RuntimeHarness --> LabSession["tmux: solar-harness-lab\nparallel builder lab"] - LabSession --> L0["lab pane 0\nBuilder worker"] - LabSession --> L1["lab pane 1\nBuilder worker"] - LabSession --> L2["lab pane 2\nBuilder worker"] - LabSession --> L3["lab pane 3\nBuilder worker"] - - RuntimeHarness --> StatusUI["Status UI\nlocalhost dashboard / integrations / config"] - end - - RuntimeHarness --> RemoteDispatch["solar-remote-dispatch\nsync / dispatch / pull / doctor"] - - subgraph RemoteMachine["Remote Mac mini or worker host"] - RemoteDispatch --> RemoteHarness["Remote Solar Harness\n~/.solar/harness"] - RemoteHarness --> RemoteMain["remote tmux main screen\nPM / Planner / Builder / Evaluator"] - RemoteHarness --> RemoteLab["remote builder lab\nparallel verification / heavy jobs"] - RemoteHarness --> RemoteStatus["remote coord-status\nhealth / stale lock / panes"] - end - - RuntimeHarness --> Vault["Knowledge Vault\nObsidian + _raw + _sources"] - Vault --> QMD["QMD Index\nsemantic + lexical retrieval"] - Vault --> Backup["Optional Drive mirror\nbackup only, not primary runtime"] -``` +Solar 当前由三层组成: -## 合约库与调度架构 +| Layer | Directory | Role | +|---|---|---| +| **Solar Core** | `CLAUDE.md`, `agents/`, `skills/`, `rules/`, `hooks/`, `core/` | Claude/Codex-native workflow kernel: agents, skills, rules, hooks, persistent operating context. | +| **Solar Harness** | `harness/` | Requirement compiler, sprint control plane, DAG scheduler, worker lease, model fleet dispatch, evaluator, benchmark, and experience memory. | +| **Solar Knowledge** | `docs/`, `scripts/`, knowledge adapters, runtime-generated indices | Unified knowledge surface for docs, accepted artifacts, research evidence, and context maps. | -Solar Harness 的核心不是“人盯 pane”,而是文件化合约库 + coordinator + DAG scheduler。用户或 Codex 先把需求落成 sprint contract,Planner 再输出人看的 `plan.md` 和机器执行的 `task_graph.json`。Coordinator 只派发 ready node,pane lease 防止抢占,Evaluator 只对 node/batch/parent gate 给 verdict。 +Solar 的核心价值观: -```mermaid -flowchart LR - UserIntent["User intent\n一句话需求 / bug / integration request"] --> Contract["Contract Library\nharness/sprints/*.contract.md"] - Contract --> Status["Sprint Status\n*.status.json\nphase / handoff_to / round"] - Contract --> Planner["Planner output\n*.plan.md\n*.task_graph.json"] +- **Human as Boss, not Runtime Glue** — 用户只表达目标、边界、预算和偏好。 +- **AI manages AI** — Solar 负责需求澄清、任务分解、调度、打回、验收和汇报。 +- **AI develops AI** — Solar 可以构建 skills、capsules、MCP、evaluators、reports 和代码产物。 +- **AI optimizes AI** — Solar 通过 evidence、side-info、benchmarks、scorecards 和 Meta Harness 优化自己的策略。 +- **Evidence defines completion** — 没有 handoff、eval、test、artifact 或 deterministic gate,就不能宣称完成。 - Planner --> Graph["TaskGraph DAG\nnodes / depends_on / write_scope\nrequired_skills / required_capabilities"] - Graph --> Enrich["Capability Enrich\ninfer required_capabilities\nfrom contract + node text"] - Enrich --> Scheduler["Graph Scheduler\nready_nodes / batches / assign_workers"] +--- - Scheduler --> Queue["Task Queue\nrun/queue/*.jsonl\ngraph_node payloads"] - Scheduler --> Lease["Pane Lease\nrun/pane-leases\nexclusive ownership + TTL"] - Queue --> Coordinator["Coordinator / Autopilot\nwake target pane\nno manual Enter expected"] +## System Architecture - Coordinator --> BuilderDispatch["Builder dispatch\n*.Sx-dispatch.md"] - BuilderDispatch --> Builder["Builder pane\nimplements one node only"] - Builder --> Handoff["Node handoff\n*.Sx-handoff.md"] +![Solar system architecture](docs/assets/solar-system-architecture.svg) - Handoff --> EvalDispatch["Evaluator dispatch\n*.Sx-eval-dispatch.md"] - EvalDispatch --> Evaluator["Evaluator pane\nchecks acceptance + write scope"] - Evaluator --> NodeVerdict["Node verdict\n*.Sx-eval.md/json"] +Solar does not treat a model as the unit of execution. It treats an **AI-capable execution surface** as the unit of execution. - NodeVerdict --> Gate{"All deps passed?"} - Gate -- "yes" --> Scheduler - Gate -- "no" --> Blocked["Downstream remains blocked"] - Scheduler --> ParentGate["Parent ready check\nall nodes + required gates passed"] - ParentGate --> Final["Sprint passed / failed / superseded\naccepted artifacts exported"] -``` +That surface may be a Claude Code pane, a Codex instance, DeepSeek Reasonix, a browser session, Gemini/GPT Web, an API model, a local model, an MCP server, or a remote worker. Solar Harness wraps these surfaces as physical operators and schedules them through a single control plane. -### 调度规则 - -| 规则 | 作用 | -|------|------| -| `depends_on` | 上游 node 未 passed,下游不派发 | -| `write_scope` | 同批并行前检查写范围,重叠则拆批 | -| `required_capabilities` | 调度器按能力选择 worker,例如 browser、Ruflo、MarkItDown、ATLAS | -| `pane lease` | pane 被占用时排队,不直接抢 pane | -| `node verdict` | 每个 node 单独评审,不能直接把 parent sprint 标 passed | -| `parent_ready_check` | 只有所有 node 和 required gate passed,parent sprint 才能关闭 | - -### 本地和远端怎么协同 - -```mermaid -sequenceDiagram - participant U as User / Codex - participant L as Local Contract Library - participant LC as Local Coordinator - participant LB as Local Builders - participant RD as Remote Dispatch - participant RH as Remote Harness - participant RB as Remote Builders - participant E as Evaluator - - U->>L: write contract.md / status.json - L->>LC: coordinator detects handoff_to - LC->>L: planner writes plan.md + task_graph.json - LC->>LB: dispatch ready local DAG nodes - LC->>RD: optional dispatch remote-heavy or parity sprint - RD->>RH: rsync contract + artifacts, wake remote coordinator - RH->>RB: remote panes execute assigned work - RB->>RH: write handoff/eval/status artifacts - RD->>L: pull remote artifacts back - LB->>E: local node handoff for review - RH->>E: remote eval evidence pulled into local library - E->>L: node verdict / parent gate / final status -``` +--- -## 模块集成架构 - -```mermaid -flowchart TB - subgraph "Execution Plane" - Symphony["OpenAI Symphony Patterns\nWORKFLOW contract / hooks / events"] - DAG["TaskGraph DAG\nrequired_capabilities / write_scope / join gates"] - Remote["Remote Dispatch\nMac mini doctor / dispatch / pull"] - end - - subgraph "Knowledge Plane" - Obsidian["Obsidian Wiki\nhuman-readable vault"] - QMD["QMD\nsemantic index + retrieval"] - MinerU["MinerU\nPDF deep extraction"] - Mirage["Mirage\nunified virtual data access"] - end - - subgraph "Capability Plane" - Ruflo["Ruflo / Claude Flow\nsandbox runtime + MCP surface"] - Gstack["Gstack / Browser QA"] - Superpowers["Superpowers\nplanning / TDD / debugging"] - ATLAS["ATLAS\nstructured repair"] - Skills["Solar Skills\ninventory / doctor / inject"] - end - - Symphony --> DAG - DAG --> Remote - DAG --> Skills - Skills --> Ruflo - Skills --> Gstack - Skills --> Superpowers - Skills --> ATLAS - Mirage --> Obsidian - Mirage --> QMD - MinerU --> Obsidian - Obsidian --> QMD - QMD --> Skills +## Solar Harness: the Control Plane + +Solar Harness turns a user goal into a controlled software delivery flow: + +```text +Boss Intent + -> Executive Intent Contract + -> Sprint Contract / PRD + -> Plan + TaskGraph IR + -> Capability Annotation + -> Logical Operator DAG + -> Physical Operator Binding + -> Queue / Lease / Dispatch + -> Handoff / Eval / Node Verdict + -> Parent Gate + -> Accepted Artifact / Experience Memory ``` -## 功能特性 - -| 能力 | 状态 | 说明 | -|------|------|------| -| AI-native Core | ok | `agents/skills/rules/hooks/core` 可安装到 `~/.claude`,作为 Claude/Codex 工作流内核 | -| Solar Harness | ok | sprint contract、coordinator、task queue、pane lease、builder/evaluator 派发 | -| DAG 并行调度 | ok | `task_graph.json` 支持依赖、write_scope 冲突保护、join gate、parent gate | -| 能力自动选择 | ok | 根据任务文本推导 `required_capabilities`,调度前自动 enrich,派发文本显式展示 | -| 多 pane 协同 | ok | 主屏 + builder lab,支持不同模型/worker 能力和 lease 保护 | -| 远端执行 | ok | `solar-remote-dispatch` 支持 doctor、dispatch、pull 和 Mac mini 复核链路 | -| 知识库闭环 | ok | Obsidian Wiki、QMD、Solar DB、accepted artifacts、wiki dispatch | -| 文档/PDF 处理 | ok | MinerU / MarkItDown / wiki-ingest / QMD index 分层处理 | -| 统一数据访问 | warn | Mirage VFS 设计和基础 mount 存在,深层 SDK/FUSE 闭环继续演进 | -| Ruflo / Claude Flow | ok | sandbox runtime 可用,CLI/MCP smoke 通过,不污染宿主项目 hooks | -| Benchmark / Proof | ok | capability certification、activation proof、fusion benchmark、heavy proof | -| 自演化能力 | ok | capability scorecard、runtime-aware ranking、experience memory 和 regression gates | - -## 快速开始 - -```bash -git clone https://github.com/lisihao/Solar.git ~/Solar -cd ~/Solar -./install.sh -``` +Key primitives: -常用入口: - -| 入口 | 命令/位置 | 用途 | -|------|-----------|------| -| L1 安装 | `./install.sh` | 安装 Solar Core 到 `~/.claude` / `~/.solar` | -| Agent 使用 | `@Coder`, `/commit`, `/review` | 通过 Claude/Codex 调用 agents 和 skills | -| Harness 发布源 | `~/Solar/harness/` | GitHub 下载后的版本化 Harness 代码 | -| Harness 运行目录 | `~/.solar/harness/` | 本机实际运行的协调器目录 | -| Harness 同步 | `./scripts/sync-harness-runtime.sh` | 把 `~/Solar/harness/` 同步到 `~/.solar/harness/` | -| Harness 控制面 | `~/.solar/bin/solar-harness` | sprint 合约、派单、eval、coordinator | -| Harness 自检 | `cd ~/.solar/harness && ./doctor.sh --summary` | 检查本地运行环境和控制面 | -| Coordinator | `~/.solar/bin/solar-harness start` | 启动 tmux panes + coordinator | -| Status UI | `~/.solar/bin/solar-harness status-server` | 打开本地状态面板、配置页和集成健康 | -| 远端同步 | `harness/tools/sync-code-to-mac-mini.sh` | 同步 MacBook/Mac mini Harness 代码 | -| 远端复核 | `solar-remote-dispatch doctor --json` | 检查 SSH、rsync、remote harness、tmux、pane 状态 | -| 能力证明 | `~/.solar/bin/solar-harness integrations activation-proof --json` | 证明默认 dispatch/DAG/runtime/负例控制 | - -## 部署方式 - -1. 本机安装: - - ```bash - git clone https://github.com/lisihao/Solar.git ~/Solar - cd ~/Solar - ./install.sh - ./scripts/smoke-install.sh - ``` - -2. Harness 启动: - - ```bash - cd ~/Solar - ./scripts/sync-harness-runtime.sh - cd ~/.solar/harness - ./doctor.sh --summary - ~/.solar/bin/solar-harness start - ~/.solar/bin/solar-harness coord-status - ``` - -3. 远端 Mac mini 镜像部署(可选): - - ```bash - cd ~/Solar - ./scripts/sync-harness-runtime.sh - cd ~/.solar/harness - ./tools/sync-code-to-mac-mini.sh - solar-remote-dispatch doctor --host --json - ``` - -4. 提交/发布前检查: - - ```bash - cd ~/Solar - ./scripts/smoke-install.sh - cd harness - bash -n coordinator.sh lib/pane-lease.sh - python3 -m py_compile lib/graph_scheduler.py lib/graph_node_dispatcher.py lib/pane_lease.py - ./solar-harness.sh integrations activation-proof --json - ``` - -## ⚡ 一键安装(3 分钟) - -> **真实可执行最小路径** — 只承诺 L1 基础安装,不假装存在的功能。 - -### 给人看:直接跑 +| Primitive | Meaning | +|---|---| +| **Sprint Contract** | A file-backed engineering contract: objective, scope, constraints, acceptance, owner intent. | +| **TaskGraph IR** | Machine-readable DAG with `depends_on`, `read_scope`, `write_scope`, `required_capabilities`, `gate`, and `acceptance`. | +| **Physical Operator** | A concrete execution surface: tmux pane, Claude Code, Codex, browser profile, API worker, remote shell, local process. | +| **Logical Operator** | Stable semantic work: compile requirement, build graph, implement code, run browser research, evaluate evidence, optimize artifact. | +| **Pane / Actor Lease** | Runtime ownership protocol to prevent multiple tasks from fighting over the same worker. | +| **Evidence ABI** | Handoff, eval, session log, deterministic gate, and accepted artifact schema. | +| **Meta Harness** | Self-optimization layer for prompts, policies, capsules, evaluators, and routing rules. | -```bash -git clone https://github.com/lisihao/Solar.git ~/Solar -cd ~/Solar && ./install.sh -``` +--- -安装完成后会自动 verify L1/L2 项目,全 ✅ 表示成功。 +## Logical Operators → Physical Operators -### 给 AI agent 看:复制整段粘贴给 Claude / Codex / Cursor / Copilot +![Solar operator DAG runtime](docs/assets/solar-operator-dag.svg) -> 请帮我安装 Solar: -> -> 1. 严格按 https://raw.githubusercontent.com/lisihao/Solar/main/INSTALL-AGENT.md 的 8 步执行 -> 2. 每步必须先报告"目的+命令+预期输出",我点头才执行 -> 3. 任一步失败立刻停下,告诉我失败的具体输出,不要静默跳过 -> 4. 装完后必须跑 `cd ~/Solar && ./install.sh` 末尾的 L1/L2 自检,全 ✅ 才算成功 -> 5. L2 Harness 的发布源是 `~/Solar/harness`;运行和自检使用 `~/.solar/harness` / `~/.solar/bin/solar-harness` -> -> 现在开始 Step 1:系统检测。 +Solar separates **what to do** from **who executes it**. -### 安装做了什么 +Examples of logical operators: -| 阶段 | 操作 | 产物 | -|------|------|------| -| 1. clone | 单仓库 `lisihao/Solar` 到 `~/Solar` | `~/Solar/` | -| 2. 备份 | 现有 `~/.claude/` (如有) | `~/.claude/backup-<时间戳>/` | -| 3. 复制 | `~/Solar/{CLAUDE.md, rules, skills, agents, hooks, core}` → `~/.claude/` | `~/.claude/` 内容 | -| 4. 初始化 | 创建 `~/.solar/` + `solar.db` (如有 schema) | `~/.solar/solar.db` | -| 5. 自检 | L1/L2 verify 输出 PASS/FAIL | 退出码 0=成功 | +- `CompileRequirement` +- `GeneratePRD` +- `BuildTaskGraph` +- `ImplementCode` +- `RunBrowserResearch` +- `EvaluateEvidence` +- `UpdateContextMap` +- `OptimizeArtifact` -### 验收 (装完跑这一条) +Examples of physical operators: -```bash -ls ~/.claude/CLAUDE.md ~/.claude/rules ~/.claude/skills ~/.claude/agents ~/.solar && \ -echo "✅ Solar L1 安装就位" -``` +- Claude Code interactive pane +- Codex instance +- DeepSeek Reasonix reasoning surface +- GPT / Gemini / DeepSeek browser session +- GLM / DeepSeek / Claude subscription worker +- API model worker +- local model process +- remote Mac mini / devbox worker +- deterministic Python verifier -任一文件/目录不存在则失败,跳到 [INSTALL-AGENT.md Step 7 Troubleshoot](INSTALL-AGENT.md#step-7-troubleshoot)。 +Why this matters: -### 必需 vs 可选 +1. **Subscription-era AI has different economics** — Web/TUI products and monthly plans can be far more cost-efficient for long-running engineering work than pure API calls. +2. **Web AI surfaces often expose stronger product capabilities** — file handling, browser tools, multimodal UI, long context, workspace memory, and built-in agentic behavior may arrive before equivalent APIs. +3. **Code agents are already internal runtimes** — Claude Code and Codex are not simple LLM endpoints; each instance has its own planning, tool use, file editing, and execution loop. +4. **Scheduling should be about execution surfaces, not model names** — the planner should ask which surface is best for this logical operator under this cost, risk, context, and evidence requirement. -- **必需** (L1 基础): `~/Solar` 仓库 + `./install.sh` → `~/.claude/` 配置就位 → 启动 Claude Code 输入 `solar` 看启动宣告 -- **可选** (L2 高级): Solar Harness 协调器 / Sprint / DAG 调度 / 远端执行 — 发布源在 `~/Solar/harness`,运行目录在 `~/.solar/harness`;`./install.sh` 会自动同步,也可手动跑 `./scripts/sync-harness-runtime.sh` -- **可选** (L3 项目): `~/Solar-MAX` 项目模式 — 独立大仓库, 详见 USER-GUIDE +--- -完整 8 步剧本: [INSTALL-AGENT.md](INSTALL-AGENT.md) +## Autonomous Software Organization Loop -### 维护者: 改动后自测 +![Solar autonomous loop](docs/assets/solar-autonomous-loop.svg) -修改 `install.sh` 或仓库结构后, 跑 fresh-install smoke (沙盒里独立验证, 不污染本机 `~/.claude/`): +Solar's long-term direction is an autonomous software organization runtime: -```bash -./scripts/smoke-install.sh +```text +Boss + -> Boss Command Layer + -> Requirement Compiler + -> AI Organization Runtime + -> Evidence Court + -> Context + Experience Memory + -> Meta Harness + -> Better Solar ``` -输出 `✅ Solar L1 + L2 Smoke Test PASSED` 才能 push。 - -## 📖 使用说明 - -👉 **[完整用户使用指南 (USER-GUIDE.md)](./USER-GUIDE.md)** — 849 行全面文档 +This is the operating model: -涵盖: -- 触发词大全(100+ 常用触发词) -- 核心命令速查(18 个 bin 命令) -- MCP 工具调用技巧 -- Skills 速查(Top 50 分类) -- Sprint 工作流详解 -- 知识库使用指南 -- 故障排查 FAQ -- 进阶定制方法 - -快速参考:[TRIGGERS.md](./TRIGGERS.md) | [SPRINTS-HIGHLIGHTS.md](./SPRINTS-HIGHLIGHTS.md) +| Role | Responsibility | +|---|---| +| **Boss / Operator** | Sets goal, boundary, budget, risk tolerance, and final approval policy. | +| **PM** | Turns intent into requirements, acceptance, and non-goals. | +| **Planner** | Produces plan, architecture, TaskGraph IR, and capability plan. | +| **Scheduler** | Chooses ready nodes, batches safe parallel work, binds physical operators. | +| **Builder Fleet** | Implements, researches, tests, drafts, and produces artifacts. | +| **Evaluator** | Reads evidence, checks scope, verifies acceptance, and returns verdict + side-info. | +| **Autopilot** | Detects stuck work, stale leases, missing handoff, failed review, and safe repair actions. | +| **Meta Harness** | Optimizes templates, policies, capsules, evaluators, and routing based on replayable evidence. | --- -## Why AI Native? - -**传统方案**: 在现有 OS 上叠加 AI 功能 (AI-Powered) -**Solar**: 从计算本质为 AI 重新设计 (AI-Native) - -| 维度 | 传统 OS + AI | Solar (AI Native) | -|------|-------------|-------------------| -| 交互入口 | GUI/CLI | **语义意图** | -| AI 角色 | 附加特性 | **内核一等公民** | -| Token 效率 | 低(大量冗余) | **高(最短路径)** | -| 执行模式 | 多层翻译 | **结构化 Action** | -| 记忆系统 | 文件路径 | **语义索引** | +## What Solar can do today + +| Capability | Status | Notes | +|---|---|---| +| Solar Core install | Available | Installs Claude/Codex-facing agents, rules, skills, hooks, and core files. | +| Solar Harness local runtime | Available | File-backed sprint contracts, coordinator, queues, leases, builder/evaluator flow. | +| TaskGraph DAG scheduling | Available | Dependency gating, write-scope batching, capability matching, parent-gate checks. | +| Multi-pane / TUI execution | Available | Product delivery panes plus builder lab style execution. | +| Model / operator registry | Available | Model aliases, physical operators, actors, hosts, capability/risk/cost profiles. | +| Evidence-native evaluation | Available | Handoff, eval, node verdict, session logs, deterministic research gates. | +| Remote worker path | Available / evolving | Remote sync, dispatch, monitor, and verification scripts are present. | +| Deep Research OS | Evolving | Evidence extraction, citation checking, research evaluation, and report gates. | +| Context Map / PEEK-style layer | Planned / integrating | Orientation cache for repos, topics, vaults, and long-running projects. | +| Meta Harness self-optimization | Planned / integrating | Optimizes text artifacts using evaluator score, side-info, replay, and promotion gates. | +| Hard sandbox / write enforcement | Planned | Current design uses scope, lease, evaluator, and guards; stronger filesystem enforcement is a priority. | -``` -┌─────────────────────────────────────────────────────────────────┐ -│ AI Native OS 架构 │ -├─────────────────────────────────────────────────────────────────┤ -│ Intent Layer │ 自然语言 / @Agent / /Skill │ -│ ───────────────────────────────────────────────────────────── │ -│ Semantic Parser │ sys_agents + sys_skills + 路由规则 │ -│ ───────────────────────────────────────────────────────────── │ -│ Execution Engine │ 13 Agents + 五阶段流程 + Gate 检查 │ -│ ───────────────────────────────────────────────────────────── │ -│ Self-Evolution │ 互评系统 + 书记员 + 自动优化 │ -│ ───────────────────────────────────────────────────────────── │ -│ UI Runtime │ TVS ZenWhite 设计系统 │ -└─────────────────────────────────────────────────────────────────┘ -``` +--- ## Quick Start -| 说 | 启动模式 | 描述 | -|-----|----------|------| -| "我要开发" | Solar Dev | 13个Agent + 五阶段流程 | -| "我要办公" | Clawbot | 邮件/日程/文档/任务处理 | -| "我要研究" | Research | 技术调研 + 可行性分析 | - ```bash -# 安装 (与首页"一键安装"一致) git clone https://github.com/lisihao/Solar.git ~/Solar -cd ~/Solar && ./install.sh - -# 使用 -@Coder 优化这个函数 # 直达 Agent -/commit # 调用 Skill +cd ~/Solar +./install.sh ``` -## What's New (2026-02) +What install does: -### 🔥 抗失忆工作流 - STATE/DECISIONS 架构 +- copies Solar Core assets into `~/.claude/`; +- creates `~/.solar/`; +- syncs the published `harness/` source into `~/.solar/harness/` when present; +- creates `~/.solar/bin/solar-harness`; +- runs install verification. -传统 AI 会话的最大问题:上下文压缩导致失忆。Solar 通过文件系统持久化彻底解决: +Harness runtime: +```bash +cd ~/Solar +./scripts/sync-harness-runtime.sh +~/.solar/bin/solar-harness help +~/.solar/bin/solar-harness start ``` -第零原则: 对话是缓存,文件是唯一真相源 - -.solar/STATE.md - 当前作战态势 (Mission/Constraints/Progress/Next Actions) -.solar/DECISIONS.md - 决策日志 (追加式,永不压缩) -.solar/LOG/ - 命令历史、基准数据、错误记录 -``` - -**效果**: 即使会话压缩,读取 STATE.md 即可恢复完整上下文。 - -### 🏃 冲刺节奏控制 - 20~60 分钟工作块 - -每个任务拆解为可检查点的冲刺块: -- **开场 30 秒**: 读 STATE.md,复述 Mission/Next Actions -- **执行 10-40 分钟**: 只做 Next Actions,不跑题不发散 -- **收尾 2 分钟**: 更新 Progress + git checkpoint - -### 🧬 Skin-Check v2.0 - 本地模型实现 - -AI 驱动的皮肤健康检测系统: -- **Phase 2.1**: CoreML + MobileNetV3 本地分类 (~30ms, 100x faster) -- **Phase 2.2**: YOLOv8 病灶检测 + 严重程度评估 -- **Phase 2.3**: SQLite 历史追踪 + 30天趋势分析 - -性能:$0.002/次 → $0/次,3-5s → ~30ms -### 📊 Solar Web Dashboard +Runtime boundary: -极简监控面板,实时展示系统状态和性能指标。 +- repository source: `~/Solar/harness/` +- local runtime: `~/.solar/harness/` +- generated runtime state: `run/`, `state/`, `logs/`, `cache/`, `vendor/`, `venvs/` -### 🚀 Token 优化 -42% - -会话恢复从 16K tokens → 9K tokens,节省 42% 成本。 +Runtime logs, databases, private trajectories, local model caches, credentials, and machine-local state should not be committed as source. --- -## Core Features - -### Token First 原则 - -``` -传统方式 (50+ tokens): - 用户: "检查磁盘" - LLM: #!/bin/bash - df -h | grep -E "^/dev" | awk '{print $1,$5}' - # 检查使用率... - -AI Native (8 tokens): - 用户: "检查磁盘" - LLM: { "skill": "check_disk", "path": "/" } -``` - -**减少 85%+ Token 消耗**,同时提升安全性。 - -### 13 个专业 Agent - -| 层级 | Agent | 职责 | -|------|-------|------| -| 决策 | Researcher / Architect / PM / Reporter | 调研、设计、验收、报告 | -| 执行 | Coder / Tester / Reviewer | 编码、测试、审查 | -| 支撑 | Docs / Ops / Guard / Secretary | 文档、部署、守护、记录 | -| 工具 | BenchmarkReporter / SkillMarket | 测试报告、技能市场 | - -### 五阶段流程 - -``` -P1 研究 → P2 设计 → P3 实现 → P4 验证 → P5 收尾 - │ │ │ │ │ - ▼ ▼ ▼ ▼ ▼ -Researcher Architect Coder Tester// Ops→PM - +Guard +Guard Reviewer →Secretary -``` - -`//` = 并行 | `→` = 串行 | Gate 检查确保质量 - -### 自我演进系统 - -``` -┌─────────────────────────────────────────────────────────────────┐ -│ Self-Evolution System │ -├─────────────────────────────────────────────────────────────────┤ -│ 数据采集 │ Agent执行/Skill调用/阶段转换 → 自动记录 │ -│ 互评系统 │ 25条规则: Reviewer评Coder, PM评Tester... │ -│ 书记员 │ 会议纪要 + 性能评估 + 优化建议 │ -│ 持续优化 │ 基于历史数据自动调优参数 │ -└─────────────────────────────────────────────────────────────────┘ -``` - -### 38 个 Skill - -| 类别 | Skill | -|------|-------| -| 开发 | `/commit` `/pr` `/review` `/test` `/build` `/benchmark` | -| 文档 | `/docs` `/report` `/changelog` | -| 系统 | `/status` `/stats` `/save` `/restore` `/ontology` | -| 工具 | `/webapp-testing` `/mcp-builder` `/skill-creator` `/shortcut-builder` | -| 办公 | `/office` `/email-search` `/office-notes` `/office-tasks` `/office-reminders` | -| 健康 | `/skin-check` - AI 皮肤检测 (本地模型 + 专家评审) | - -## Agent 宣告 +## Design Principles -每个 Agent 执行前必须输出宣告(Thinking Out Loud): +1. **Natural language is the control surface** + Users give goals; Solar compiles goals into contracts, graphs, and execution plans. -``` -┌─ 💻 Coder ──────────────────────────────────────┐ -│ Task: 优化 Hash Join 性能 │ -│ Plan: │ -│ 1. 分析当前瓶颈 │ -│ 2. 实现 SIMD 加速 │ -│ 3. 验证性能提升 │ -└─────────────────────────────────────────────────┘ -``` +2. **Requirements are compilable artifacts** + Prompt is temporary. Contract, PRD, traceability, TaskGraph, and evidence are durable. -## Session Recovery +3. **Models are not the execution unit** + AI-capable environments are execution units: TUI panes, code agents, browser profiles, APIs, local processes, and remote workers. -``` -┌─────────────────────────────────────────────────┐ -│ 传统方式: 恢复会话 10K-50K tokens │ -│ Solar: /restore ~500 tokens (节省 90%+) │ -└─────────────────────────────────────────────────┘ -``` +4. **Parallelism requires boundaries** + Safe throughput requires dependency gates, write scopes, leases, worker health, and evaluator verdicts. -## Architecture +5. **Capabilities are schedulable assets** + Skills, MCPs, web product features, model strengths, code-agent behaviors, and deterministic tools should be modeled, injected, evaluated, and optimized. -``` - ┌─────────────────┐ - │ User Intent │ - │ 自然语言输入 │ - └────────┬────────┘ - │ - ┌──────────────┼──────────────┐ - │ │ │ - ▼ ▼ ▼ - ┌──────────┐ ┌──────────┐ ┌──────────┐ - │ Solar │ │ Clawbot │ │ Research │ - │ Dev Mode │ │ Office │ │ Mode │ - └────┬─────┘ └──────────┘ └──────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────┐ -│ Execution Engine │ -│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │ -│ │ P1 │→│ P2 │→│ P3 │→│ P4 │→│ P5 │ │ -│ │研究 │ │设计 │ │实现 │ │验证 │ │收尾 │ │ -│ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ │ -│ │ │ │ │ │ │ -│ Researcher Architect Coder Tester Ops │ -│ +Guard +Guard //Review →PM │ -│ //Docs →Secretary │ -└─────────────────────────────────────────────────────────┘ - │ - ├──► ┌─────────────────────────────────────┐ - │ │ State Persistence (抗失忆) │ - │ │ .solar/STATE.md + DECISIONS.md │ - │ │ 对话是缓存,文件是唯一真相源 │ - │ └─────────────────────────────────────┘ - ▼ -┌─────────────────────────────────────────────────────────┐ -│ Self-Evolution Layer │ -│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ -│ │ sys_* │ │ evo_* │ │ 书记员 │ │ -│ │ 191 表 │ │ 执行追踪 │ │ 汇总优化 │ │ -│ └──────────┘ └──────────┘ └──────────┘ │ -└─────────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────┐ -│ TVS UI Runtime + Web Dashboard │ -│ ZenWhite 设计系统 | 9种视觉风格 | 实时监控面板 │ -└─────────────────────────────────────────────────────────┘ -``` +6. **Evidence defines completion** + A task is not complete because a model says it is complete. It is complete when evidence passes review. -## Metadata System +7. **Self-optimization must be controlled** + Solar can optimize prompts, policies, capsules, and routing, but protected core changes require replay, canary, rollback, and human approval. -191 张系统表支撑智能路由与自我演进: +--- -| 类别 | 表 | 用途 | -|------|-----|------| -| 资源注册 | sys_agents, sys_skills, sys_hooks | 资源自省 | -| 路由规则 | sys_routing_model/agent/tool | 智能选择 | -| 执行追踪 | evo_agent_executions, evo_tool_calls | 数据采集 | -| 互评系统 | evo_review_rules, evo_votes | 质量评估 | -| 学习信号 | evo_learning_signals | 持续优化 | +## Roadmap -## vs 业界方案 +| Phase | Theme | Work | +|---|---|---| +| 1 | **Public homepage + docs cleanup** | Keep README, install docs, and user guide aligned with the current architecture. | +| 2 | **Privacy and release hardening** | Template local host configs, remove machine fingerprints, add privacy scan and release gates. | +| 3 | **Operator runtime** | Formalize logical/physical operator schemas, leases, health, scorecards, and fallback ladders. | +| 4 | **Model fleet manager** | Subscription-aware routing, cost/quality/latency scoring, browser-native operators. | +| 5 | **Hard execution boundaries** | Write-scope enforcement, per-node worktrees, patch gates, permission policy, sandbox adapters. | +| 6 | **Context Map plane** | PEEK-style repo/topic/project maps with provenance, staleness, role-aware rendering. | +| 7 | **Deep Research OS** | Source discovery, evidence ledger, claim ledger, citation gate, report compiler, research evaluator. | +| 8 | **Meta Harness** | Artifact registry, evaluator registry, replay set, side-info schema, Pareto frontier, promotion/rollback. | +| 9 | **Boss dashboard** | Autonomous progress, active DAGs, worker fleet, evidence status, cost/throughput, approvals needed. | -| 维度 | Solar | AutoGen | CrewAI | MetaGPT | -|------|-------|---------|--------|---------| -| AI Native 架构 | **Token First** | AI 叠加 | AI 叠加 | AI 叠加 | -| 五阶段流程 | **P1→P5 Gate** | 无 | 无 | 部分 | -| 自我演进 | **互评+书记员** | 无 | 无 | 无 | -| 会话恢复 | **90%+ Token 节省** | 无 | 无 | 无 | -| @Agent 直达 | **语义路由** | 无 | 无 | 无 | -| 多模式切换 | **Dev/Office/Research** | 单模式 | 单模式 | 单模式 | +--- -## Documentation +## Current Boundary -- [AI Native OS Architecture](docs/AI_NATIVE_OS_ARCHITECTURE.md) - 架构设计原理 -- [Workflow Design](docs/WORKFLOW_DESIGN.md) - 工作流程设计 -- [Metadata System](core/nerve/README.md) - 元数据系统 +Solar is a serious prototype, not a finished commercial operating system. The core abstractions are already visible: requirement compilation, TaskGraph IR, physical operator scheduling, evidence ABI, model fleet control, and self-optimization hooks. -## Installation +The next engineering priority is to make these abstractions clean, safe, observable, and easy to install: -见首页 [⚡ 一键安装](#-一键安装3-分钟) — 唯一推荐路径。 +- remove machine-local details from public-facing config and docs; +- replace Mermaid diagrams with maintained SVG architecture assets; +- stabilize the public documentation around Core / Harness / Knowledge; +- strengthen privacy, release, and sandbox gates; +- expose the Harness runtime through cleaner APIs and dashboards. -**详细 8 步剧本** (供 AI agent 执行): [INSTALL-AGENT.md](INSTALL-AGENT.md) -**用户使用指南**: [USER-GUIDE.md](USER-GUIDE.md) -**OpenClaw / 小爱 AI 秘书集成** (高级): [DEPLOY.md](DEPLOY.md) +--- -## License +## Closing -MIT +Solar is not built around a single model, a single UI, or a single agent loop. ---- +It treats natural language as the control surface, requirements as compilable artifacts, AI products as physical operators, capabilities as schedulable capsules, and engineering work as evidence-gated DAG execution. -**Solar** — AI Native Operating System | Token In → Token Out +**Solar makes AI work run like system software: compiled, scheduled, bounded, evidenced, and optimized.** diff --git a/docs/assets/solar-autonomous-loop.svg b/docs/assets/solar-autonomous-loop.svg new file mode 100644 index 000000000..a94446238 --- /dev/null +++ b/docs/assets/solar-autonomous-loop.svg @@ -0,0 +1 @@ +Solar Autonomous Software Organization LoopSolar autonomous loop from boss command to requirement compiler, AI organization execution, evidence gates, context memory, and meta harness optimization.Autonomous Software Organization LoopThe user acts as boss; Solar compiles goals, manages AI workers, verifies evidence, and optimizes itself.Bossgoal · boundary · budgetBoss Command LayerIntent envelopeAutonomy policyRequirement CompilerContract · PRD · TaskGraphCapability & evidence planAI Organization RuntimePM · Planner · BuildersEvaluator · AutopilotModel fleetEvidence CourtHandoff · Eval · GateAccepted artifactsContext & ExperienceContext Map · Session LogScorecards · Gene PoolMeta HarnessReplay · SideInfoPareto frontierPromotion / rollbackPrinciple: human as boss, AI as organization, evidence as completion, optimization as a controlled runtime process. \ No newline at end of file diff --git a/docs/assets/solar-operator-dag.svg b/docs/assets/solar-operator-dag.svg new file mode 100644 index 000000000..2e96da10b --- /dev/null +++ b/docs/assets/solar-operator-dag.svg @@ -0,0 +1 @@ +Solar Operator DAG RuntimeLogical operators are bound to heterogeneous physical AI operators and scheduled as a DAG.Agentic DAG Runtime: Logical Operators → Physical OperatorsSolar separates what needs to be done from who executes it, then schedules heterogeneous AI execution surfaces.Logical OperatorsStable semantic work unitsCompileRequirementBuildTaskGraphImplementCodeRunBrowserResearchEvaluateEvidencePhysical PlannerBinds tasks to execution surfacesInputs• task risk and scope• capability requirements• worker health and lease• model cost and quota• evidence requirementsOutputs• dispatch plan• fallback ladder• capsule injection• evaluator gatePhysical OperatorsAI-capable execution surfacesClaude Code PaneCodex InstanceDeepSeek ReasonixGPT / Gemini WebBrowser OperatorRemote WorkerAPI / Local ModelEvidence-gated executionhandoff · eval · session log · deterministic gate · parent verdict \ No newline at end of file diff --git a/docs/assets/solar-system-architecture.svg b/docs/assets/solar-system-architecture.svg new file mode 100644 index 000000000..6a8f65842 --- /dev/null +++ b/docs/assets/solar-system-architecture.svg @@ -0,0 +1 @@ +Solar System ArchitectureSolar architecture from multi ingress interface to requirement compiler, harness control plane, model fleet, evidence and meta harness.Solar: AI-Native Execution FabricNatural language → requirement compiler → operator DAG → model fleet → evidence gates → self-optimizationMulti-Ingress InterfaceCodex · Antigravity · TUIReasonix · CLI · WebRequirement CompilerContract · PRD · TraceabilityTaskGraph IR · DispatchHarness Control PlaneScheduler · Queue · LeaseAutopilot · EvaluatorEvidence RuntimeHandoff · Eval · Session LogNode Verdict · Parent GateSolar CoreAgents · Skills · Rules · HooksClaude/Codex-native workflow kernelL1 CoreSolar HarnessAgentic DAG runtimePhysical/logical operator bindingCapability injectionModel fleet schedulingL2 Control PlaneSolar KnowledgeQMD · Obsidian · Mirage · MinerUAccepted artifacts · Context mapsKnowledge LayerModel FleetClaude · Codex · Gemini · DeepSeek · GLMDeep Research OSEvidence · Claims · Citations · GateMeta HarnessReplay · SideInfo · Pareto · Promote \ No newline at end of file