Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

English | [简体中文](README.zh-CN.md)

> Current protocol version: `0.1.19` (in development); workflow version: `0.1.2`
> Current protocol version: `0.1.20` (in development); workflow version: `0.1.3`

Polaris is a repo-native engineering workflow for coding agent hosts. It stores requirements, plans, implementation results, independent reviews, validation evidence, and task state in Git, then uses deterministic gates to prevent requirement drift, stale evidence, and agents declaring their own work complete.

Expand All @@ -11,17 +11,19 @@ Polaris currently supports Codex and Claude Code. [plan.md](plan.md) is the v0.1
## Core workflow

```text
DRAFT → QUALIFIED → PLANNED → IMPLEMENTING → IMPLEMENTED
→ DOCS_SYNCED → REVIEWING → REVIEWED
→ VALIDATING → VERIFIED → CLOSED
DRAFT → QUALIFIED → PLANNED → IMPLEMENTING → REVIEWING → VALIDATING
├─ R0/R1 → CLOSED
└─ R2 → VERIFIED → CLOSED
```

- A Work Item freezes the goal, scope, and acceptance criteria.
- An independent Implementer works from an immutable handoff and updates code, tests, and documentation.
- An independent Implementer works from an immutable handoff and updates code, tests, and documentation inside one `IMPLEMENTING` stage.
- An independent Reviewer checks specification compliance and engineering quality.
- Validation binds every acceptance criterion to reproducible evidence.
- `events.jsonl` records state changes; `state.json` is a rebuildable projection.
- Reviews and validations bind to the current revision, Git commits, and diff hash. Content changes invalidate stale evidence.
- R0/R1 atomically validate and close with `PASS_AND_CLOSE`; R2 retains `VERIFIED` for final Human approval.
- Live implementation progress is optional ignored telemetry and is never a durable gate.
- Only `transition_task.py` can write `VERIFIED` or `CLOSED` after its gates pass.

Tasks use `R1` by default. Low-risk mechanical changes may use `R0`; public APIs, persistent formats, architecture boundaries, concurrency, security, and resource-lifetime changes require `R2`.
Expand Down Expand Up @@ -87,7 +89,7 @@ codegraph init
polaris code-intelligence add codegraph --repo .
```

Run these commands from the target repository as appropriate. `codegraph init` creates the `.codegraph/` marker; without it Polaris records `UNAVAILABLE` and uses source and Git directly. Polaris can only read CodeGraph status, explore indexed relationships, and perform one bounded `codegraph sync` at a declared stage boundary. It never installs, initializes, starts, configures, reconfigures, waits for, or manages CodeGraph or its watcher/daemon/MCP configuration.
Run these commands from the target repository as appropriate. `codegraph init` creates the `.codegraph/` marker; without it Polaris uses source and Git directly and creates no stage record. Polaris writes a Code Intelligence record only when it actually performs a Provider status, sync, or explore operation. Polaris can only read CodeGraph status, explore indexed relationships, and perform one bounded `codegraph sync` at a declared stage boundary. It never installs, initializes, starts, configures, reconfigures, waits for, or manages CodeGraph or its watcher/daemon/MCP configuration.

CodeGraph's watcher and connection reconciliation are the primary freshness mechanisms. Polaris records a limited conclusion at the time it checks: `CURRENT_AT_CHECK`, `PARTIAL_STALE`, `INDEX_STALE`, `NOT_VERIFIED`, or `UNAVAILABLE`; it never claims commit-exact graph freshness. A `PARTIAL_STALE` response names specific files: read each current file directly (`READ_SOURCE`), or inspect the registered Git diff if it was deleted (`INSPECT_GIT_DIFF`). For `INDEX_STALE` or `NOT_VERIFIED`, treat the graph only as a lead and search the repository plus Git (`SEARCH_SOURCE`). Validation remains graph-free and relies on source, Git, builds, tests, static checks, and Human Checks.

Expand Down
14 changes: 8 additions & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](README.md) | 简体中文

> 当前协议版本:`0.1.19`(开发中);Workflow 版本:`0.1.2`
> 当前协议版本:`0.1.20`(开发中);Workflow 版本:`0.1.3`

Polaris 是运行在 Coding Agent 宿主上的仓库原生工程工作流。它把需求、计划、实现、独立审查、验证和任务状态保存在 Git 仓库中,并通过确定性门禁防止需求漂移、证据过期和 Agent 自行宣布完成。

Expand All @@ -11,17 +11,19 @@ Polaris 是运行在 Coding Agent 宿主上的仓库原生工程工作流。它
## 核心流程

```text
DRAFT → QUALIFIED → PLANNED → IMPLEMENTING → IMPLEMENTED
→ DOCS_SYNCED → REVIEWING → REVIEWED
→ VALIDATING → VERIFIED → CLOSED
DRAFT → QUALIFIED → PLANNED → IMPLEMENTING → REVIEWING → VALIDATING
├─ R0/R1 → CLOSED
└─ R2 → VERIFIED → CLOSED
```

- Work Item 冻结目标、范围和验收标准。
- 独立 Implementer 依据不可变 handoff 完成代码、测试和文档。
- 独立 Implementer 在一个 `IMPLEMENTING` 阶段内依据不可变 handoff 完成代码、测试和文档。
- 独立 Reviewer 审查需求符合性与工程质量。
- Validation 将每项验收标准绑定到可复现证据。
- `events.jsonl` 保存状态变更,`state.json` 是可重建投影。
- Review 和 Validation 绑定当前 Revision、Git commit 与 diff hash;内容变化会使旧证据失效。
- R0/R1 通过 `PASS_AND_CLOSE` 原子校验并关闭;R2 保留 `VERIFIED` 等待最终 Human approval。
- 实时 Implementation 进度只是 ignored 的可选遥测,不参与耐久门禁。
- 只有 `transition_task.py` 能通过合法门禁写入 `VERIFIED` 或 `CLOSED`。

任务默认采用 `R1`。低风险机械修改可使用 `R0`;公共接口、持久化格式、架构边界、并发、安全或资源生命周期变更使用 `R2`。
Expand Down Expand Up @@ -87,7 +89,7 @@ codegraph init
polaris code-intelligence add codegraph --repo .
```

`codegraph init` 创建 `.codegraph/` marker。只有目标仓库已经有这个 marker 且项目策略允许时,Polaris 才会使用 CodeGraph;没有 marker 时,记录 `UNAVAILABLE` 并直接使用源码和 Git。Polaris 只会读取 `status`、查询 `explore`,以及只在声明的阶段边界至多执行一次有界 `codegraph sync`;它绝不安装、初始化、启动、配置、重新配置、等待或管理 CodeGraph、watcher、daemon 或 MCP 配置。
`codegraph init` 创建 `.codegraph/` marker。只有目标仓库已经有这个 marker 且项目策略允许时,Polaris 才会使用 CodeGraph;没有 marker 时直接使用源码和 Git,不生成阶段 record。只有实际执行 Provider `status`、`sync` 或 `explore` 操作时才写 Code Intelligence record。Polaris 只会读取 `status`、查询 `explore`,以及只在声明的阶段边界至多执行一次有界 `codegraph sync`;它绝不安装、初始化、启动、配置、重新配置、等待或管理 CodeGraph、watcher、daemon 或 MCP 配置。

CodeGraph 的 watcher 和连接时 reconciliation 是正常情况下的实时更新机制。Polaris 只记录检查时的有限结论:`CURRENT_AT_CHECK`、`PARTIAL_STALE`、`INDEX_STALE`、`NOT_VERIFIED` 或 `UNAVAILABLE`,不会宣称与 Git commit 精确一致。`PARTIAL_STALE` 会精确列出待同步文件:当前普通文件必须直接读取并记录 `READ_SOURCE`;已删除文件必须检查注册 subject 的 Git diff 并记录 `INSPECT_GIT_DIFF`。`INDEX_STALE` 或 `NOT_VERIFIED` 时,图只能作为导航线索,Agent 必须通过仓库搜索和 Git 证据记录 `SEARCH_SOURCE`。Provider 不可用、status 不可读或 sync 失败都不阻断阶段;Validation 不调用 CodeGraph,仍以源码、Git、构建、测试、静态检查和 Human Check 为准。

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.19
0.1.20
Loading