From 560454fdaddb1d8021335d9117255e1062ccd301 Mon Sep 17 00:00:00 2001 From: whitelonng Date: Sun, 19 Jul 2026 23:31:23 +0800 Subject: [PATCH 1/9] fix: complete V3 beta release surface --- .github/workflows/quality.yml | 27 ++++++ README.en.md | 43 ++++++--- README.md | 42 +++++--- package.json | 4 +- src/commands/status.ts | 13 ++- src/commands/uninstall.ts | 2 +- src/commands/workflow.ts | 150 ++++++++++++++++++++++++++++- src/context/store.ts | 51 ++++++---- tests/v3-adapter-contracts.test.ts | 13 +++ tests/v3-command-contracts.test.ts | 63 ++++++++++++ tests/version.test.ts | 5 +- tests/website-docs.test.ts | 42 ++++---- website/docs.html | 125 ++++++++++-------------- website/docs.zh-CN.html | 125 ++++++++++-------------- website/index.html | 12 +-- website/index.zh-CN.html | 12 +-- 16 files changed, 498 insertions(+), 231 deletions(-) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..a8ba87f --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,27 @@ +name: Quality gate + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - name: Lint + run: npm run lint + - name: Typecheck + run: npm run typecheck + - name: Build + run: npm run build + - name: Test + run: npm test diff --git a/README.en.md b/README.en.md index c9bbe39..58479a4 100644 --- a/README.en.md +++ b/README.en.md @@ -17,7 +17,7 @@

License: AGPL-3.0 npm version - Status: stable v0.3.13 + Status: V3 beta v0.3.13 Platforms: Claude Code, Cursor, Codex in ChatGPT desktop and CLI, GitHub Copilot, ZCode

@@ -177,7 +177,7 @@ the original mode entries, never task/session snapshots. `mancode init default `solo` for lightweight implementation, or continue the full `/man` validation and bounded risk-review workflow. - **Keep workflow artifacts on disk**: save research, plans, review reports, - and summaries under `.mancode/local/workflows//`. + and summaries under `.mancode//workflows//`. - **Support team context**: use `/manteam` with confirmed typed entities under `.mancode/shared/`. - **Scan project health**: use `mancode manps` to detect stale TODOs, unused @@ -263,7 +263,7 @@ Context Pack: work. A planning or research request made from default `solo` routes into `/man`. It inspects the project, asks only questions that can change scope, architecture, cost, or acceptance, and recommends 2–3 options when a decision benefits from -guidance. It writes the plan under `.mancode/local/workflows//` only +guidance. It writes the plan under `.mancode/local/workflows//` only after the requirements are ready. Finishing the plan does not automatically start the full workflow. At the plan @@ -350,9 +350,9 @@ it should behave, and why previous decisions were made. ## Installation -**Status**: stable v0.3.13. Claude Code, Cursor, Codex in the ChatGPT desktop app -and CLI, and GitHub Copilot are supported. ZCode adapter support is included, -with project skill discovery kept behind a verification gate before release. +**Status**: V3 beta v0.3.13. Claude Code, Cursor, Codex in the ChatGPT desktop +app and CLI, GitHub Copilot, and ZCode adapters are included. Stable release +still requires the five-host real-session acceptance and the `context beta` B1 gate. Requires Node.js 20 or newer. macOS, Linux, Windows CMD, PowerShell, and Git Bash are supported. Git is optional: without it, initialization continues with solo @@ -426,6 +426,8 @@ mancode list-platforms mancode team identity create --name "" mancode context session new --client mancode workflow create "" --session +mancode workflow list --json +mancode workflow show --json mancode context resume --session mancode workflow requirements finalize --file --expected-revision --session mancode workflow plan revise --file --expected-revision --session @@ -507,9 +509,11 @@ mancode context session new --client codex mancode workflow create man "refactor auth module" --session mancode workflow requirements finalize --file requirements.json --expected-revision --session mancode workflow plan revise --file plan.md --expected-revision --session +mancode workflow plan confirm --plan-decision --expected-revision --session mancode workflow review apply --file review-ledger.json --expected-revision --session mancode workflow verify apply --file verification-ledger.json --expected-revision --session mancode workflow complete --expected-revision --session +mancode context compact --dry-run ``` ### `mancode manps` @@ -635,23 +639,34 @@ Ensure the `.cursor/rules/mancode-*.mdc` files exist. Rules with Mode-specific rules (manba, man, manteam, manps) trigger based on the description field — invoke them by asking for `/manba` or similar. -### How to do a clean reinstall +### How to reinstall V3 adapters ```bash -mancode uninstall --all --force -mancode init -mancode install +mancode uninstall claude-code --force +mancode uninstall cursor --force +mancode uninstall codex --force +mancode uninstall copilot --force +mancode uninstall zcode --force +mancode install claude-code +mancode install cursor +mancode install codex +mancode install copilot +mancode install zcode ``` -### How to completely remove mancode +V3 authority is protected, so `mancode uninstall --all` does not delete workflow +authority. To inspect removable runtime records, run +`mancode context compact --dry-run` first. + +### How to remove the CLI ```bash -mancode uninstall --all --force npm uninstall -g mancode ``` -This removes `.mancode/`, platform config files, and mancode hooks from -`.claude/settings.json`. User-authored rules and instructions are preserved. +Uninstalling each platform removes its mancode bootstrap while preserving +user-authored rules, instructions, and V3 workflow data. The `--all` form is only +supported for projects explicitly initialized with `mancode init --legacy`. ## FAQ diff --git a/README.md b/README.md index 4a2d310..d73f72e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@

许可证:AGPL-3.0 npm 版本 - 状态:稳定版 v0.3.13 + 状态:V3 Beta v0.3.13 平台:Claude Code、Cursor、ChatGPT 桌面端 Codex、Codex CLI、GitHub Copilot、ZCode

@@ -155,7 +155,7 @@ AGENTS.md # Codex(ChatGPT 桌面端/CLI):托管 ins - **在存在 UI 时匹配现有设计系统**:检查项目 UI 依赖、Tailwind 配置、CSS 变量和已有组件,让 agent 复用现有颜色、字体和交互模式。 - **先把需求和计划对齐**:`/man` 会调研项目、引导澄清会改变方案的需求、推荐可行选项并生成可确认的持久计划;计划完成后不会自动进入完整实施。 - **自由选择执行强度**:计划确认后,可只保留计划、交给默认 `solo` 轻量开发,或继续完整 `/man` 的验证与有界风险审查。 -- **保留工作流产物**:调研、计划、审查报告和总结会保存到 `.mancode/local/workflows//`。 +- **保留工作流产物**:调研、计划、审查报告和总结会保存到 `.mancode//workflows//`。 - **支持团队上下文**:`/manteam` 通过 `.mancode/shared/` 的类型化实体共享已确认信息。 - **扫描项目健康度**:`mancode manps` 检测陈旧 TODO、未使用依赖、风险依赖和硬编码设计值。 @@ -228,7 +228,7 @@ mancode 不把“当前模式”写进持久状态。需要某种工作方式时 `solo`,当用户要求先调研、给方案或出计划时,也会进入 `/man`。它会先了解项目, 只追问会改变范围、架构、成本或验收的问题;适合由系统推荐的决策会给出 2–3 个 方案、优缺点和明确建议。需求足够清楚后,计划才会写入 -`.mancode/local/workflows//plan.md`。 +`.mancode/local/workflows//plan.md`。 计划完成不会自动开始完整开发。用户在计划关卡选择:交给 `solo` 按已确认计划 轻量开发、继续完整 `/man`、只保留计划,或修改计划。只有选择完整 `/man` 才继续 @@ -305,9 +305,9 @@ src/components/ ## 安装 -**状态**:稳定版 v0.3.13。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、 -Codex CLI 和 GitHub Copilot 均已支持。ZCode adapter 已接入,但项目级 skill -发现路径在发布前仍作为验证门禁。 +**状态**:V3 Beta v0.3.13。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、 +Codex CLI 和 GitHub Copilot 均已接入;ZCode adapter 已接入。正式稳定发布仍需 +完成五平台真实宿主验收和 `context beta` B1 门禁。 需要 Node.js 20 或更高版本。原生支持 macOS、Linux、Windows CMD、 PowerShell 和 Git Bash。Git 是可选依赖:未安装时仍可初始化,只会把团队 @@ -379,6 +379,8 @@ mancode list-platforms mancode team identity create --name "" mancode context session new --client mancode workflow create "" --session +mancode workflow list --json +mancode workflow show --json mancode context resume --session mancode workflow requirements finalize --file --expected-revision --session mancode workflow plan revise --file --expected-revision --session @@ -458,9 +460,11 @@ mancode context session new --client codex mancode workflow create man "refactor auth module" --session mancode workflow requirements finalize --file requirements.json --expected-revision --session mancode workflow plan revise --file plan.md --expected-revision --session +mancode workflow plan confirm --plan-decision --expected-revision --session mancode workflow review apply --file review-ledger.json --expected-revision --session mancode workflow verify apply --file verification-ledger.json --expected-revision --session mancode workflow complete --expected-revision --session +mancode context compact --dry-run ``` ### `mancode manps` @@ -575,23 +579,33 @@ mancode/ (context、practice、solo)在每次对话加载。模式规则(manba、man、manteam、 manps)按 description 触发——输入 `/manba` 等关键词即可激活。 -### 如何完全重装 +### 如何重装 V3 适配器 ```bash -mancode uninstall --all --force -mancode init -mancode install +mancode uninstall claude-code --force +mancode uninstall cursor --force +mancode uninstall codex --force +mancode uninstall copilot --force +mancode uninstall zcode --force +mancode install claude-code +mancode install cursor +mancode install codex +mancode install copilot +mancode install zcode ``` -### 如何完全卸载 mancode +V3 authority 受保护,`mancode uninstall --all` 不会删除工作流权威数据。需要 +清理运行时保留记录时,先用 `mancode context compact --dry-run` 检查候选。 + +### 如何移除 CLI ```bash -mancode uninstall --all --force npm uninstall -g mancode ``` -这会移除 `.mancode/`、平台配置文件和 `.claude/settings.json` 中的 mancode -hooks。用户自定义的 rules 和 instructions 会被保留。 +逐个平台卸载会移除对应的 mancode bootstrap,并保留用户自定义 rules、instructions +和 V3 工作流数据。旧项目若明确使用 `mancode init --legacy`,才支持 legacy 的 +`mancode uninstall --all --force`。 ## 常见问题 diff --git a/package.json b/package.json index bd86b8d..fd6e224 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "AI coding agent workflow harness. Five modes from practice to playoffs: stop over-engineering, reuse project context, and add multi-agent code review.", "type": "module", "license": "AGPL-3.0-only", - "author": "", - "homepage": "https://github.com/whitelonng/mancode", + "author": "whitelonng", + "homepage": "https://whitelonng.github.io/mancode/", "repository": { "type": "git", "url": "git+https://github.com/whitelonng/mancode.git" diff --git a/src/commands/status.ts b/src/commands/status.ts index 73700d3..a1cc529 100644 --- a/src/commands/status.ts +++ b/src/commands/status.ts @@ -872,8 +872,19 @@ function printV3Text(result: V3StatusResult): void { console.log( `Identity: ${result.localIdentity.displayName ?? 'not configured'}`, ); + const sessionEvidenceDetail = result.sessionEvidence.ready + ? 'ready' + : [ + ...result.sessionEvidence.explicitRequiredPlatforms, + ...result.sessionEvidence.missingPlatforms.filter( + (platform) => + !result.sessionEvidence.explicitRequiredPlatforms.includes( + platform, + ), + ), + ].join(', ') || 'none recorded'; console.log( - `Session evidence: ${result.sessionEvidence.ready ? 'ready' : `explicit required (${result.sessionEvidence.explicitRequiredPlatforms.join(', ')})`}`, + `Session evidence: ${result.sessionEvidence.ready ? 'ready' : `explicit required (${sessionEvidenceDetail})`}`, ); if (result.compatibility.failures.length > 0) { console.log(`Compatibility: ${result.compatibility.failures.join(', ')}`); diff --git a/src/commands/uninstall.ts b/src/commands/uninstall.ts index 323e04f..4fa4a97 100644 --- a/src/commands/uninstall.ts +++ b/src/commands/uninstall.ts @@ -104,7 +104,7 @@ async function uninstallV3( if (!platform || options.all) { console.error('✗ mancode authority is protected from bulk uninstall.'); console.error( - ' Remove a single bootstrap with `mancode uninstall `, or complete an explicit mancode archive/migration workflow first.', + ' Remove a single bootstrap with `mancode uninstall `. Inspect runtime retention with `mancode context compact --dry-run`; V3 workflow authority is not bulk-deleted.', ); return EXIT_V3_AUTHORITY_PROTECTED; } diff --git a/src/commands/workflow.ts b/src/commands/workflow.ts index 3200865..e98762b 100644 --- a/src/commands/workflow.ts +++ b/src/commands/workflow.ts @@ -16,9 +16,10 @@ import { startV3SoloHandoff, } from '../context/solo-handoff.js'; import { completeV3Task } from '../context/task-complete.js'; -import { parseTaskRef } from '../context/task-ref.js'; +import { formatTaskRef, parseTaskRef } from '../context/task-ref.js'; import { recordV3Verification } from '../context/verification-record.js'; import { createV3Workflow } from '../context/workflow-create.js'; +import type { WorkflowMetadataV3 } from '../context/workflow-metadata.js'; import { updateV3Workflow } from '../context/workflow-update.js'; import { detectTeamAssessmentSignals } from '../system/detect-team.js'; import { @@ -216,6 +217,15 @@ async function workflowV3( args: string[], options: WorkflowOptions, ): Promise { + if (subcommand === 'list') { + return workflowListV3(rootDir, args, options); + } + if (subcommand === 'show') { + return workflowShowV3(rootDir, args, options); + } + if (subcommand === 'clean') { + return workflowCleanV3(options); + } if (subcommand === 'create') { return workflowCreateV3(rootDir, args, options); } @@ -256,6 +266,144 @@ async function workflowV3( ); } +async function workflowListV3( + rootDir: string, + args: string[], + options: WorkflowOptions, +): Promise { + if (args.length !== 0) { + return printV3Error( + options.json, + 'MANCODE_WORKFLOW_LIST_ARGUMENT_INVALID', + 'Use: workflow list [--json].', + EXIT_INVALID_ARG, + ); + } + try { + const project = await readV3CommandProject(rootDir); + const workflows = await project.store.listWorkflowMetadata(); + if (options.json) { + return printV3Result(true, { + schemaVersion: 1, + workflows, + }); + } + if (workflows.length === 0) { + console.log('No mancode workflows.'); + return EXIT_OK; + } + const active = workflows.filter((item) => + ['in_progress', 'planned', 'blocked'].includes(item.status), + ).length; + console.log( + `mancode workflows (${workflows.length} total, ${active} active)`, + ); + console.log(''); + for (const metadata of workflows) { + console.log(formatV3WorkflowRow(metadata)); + } + return EXIT_OK; + } catch (error) { + return printV3Error( + options.json, + v3ErrorCode(error, 'MANCODE_V3_WORKFLOW_LIST_FAILED'), + error instanceof Error + ? error.message + : 'Unable to list mancode workflows.', + ); + } +} + +async function workflowShowV3( + rootDir: string, + args: string[], + options: WorkflowOptions, +): Promise { + const requested = args[0]; + if (!requested || args.length !== 1) { + return printV3Error( + options.json, + 'MANCODE_WORKFLOW_SHOW_ARGUMENT_INVALID', + 'Use: workflow show [--json].', + EXIT_INVALID_ARG, + ); + } + try { + const project = await readV3CommandProject(rootDir); + const location = await project.store.locateTask(requested); + const [snapshot, activeChildren] = await Promise.all([ + project.store.readTaskSnapshot(location.taskRef), + project.store.listActiveChildTaskRefs(location.taskRef), + ]); + const result = { + schemaVersion: 1, + taskRef: location.taskRef, + metadata: snapshot.metadata, + aggregate: snapshot.aggregate, + aggregateError: snapshot.aggregateError, + activeChildren, + }; + if (options.json) return printV3Result(true, result); + + const metadata = snapshot.metadata; + console.log(`Workflow: ${formatTaskRef(metadata.taskRef)}`); + console.log(`Task: ${metadata.task}`); + console.log(`Mode: ${metadata.workflowMode}`); + console.log(`Status: ${metadata.status}`); + console.log( + `Current step: ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`, + ); + console.log(`Revision: ${metadata.revision}`); + console.log(`Visibility: ${metadata.visibility}`); + console.log(`Coordination: ${metadata.coordination}`); + console.log(`Updated: ${metadata.updatedAt}`); + if (metadata.blockingReason !== null) { + console.log(`Blocked: ${metadata.blockingReason}`); + } + if (activeChildren.length > 0) { + console.log( + `Children: ${activeChildren.map(formatTaskRef).join(', ')}`, + ); + } + if (snapshot.aggregateError !== null) { + console.log(`Aggregate: ${snapshot.aggregateError}`); + } + return EXIT_OK; + } catch (error) { + return printV3Error( + options.json, + v3ErrorCode(error, 'MANCODE_V3_WORKFLOW_SHOW_FAILED'), + error instanceof Error + ? error.message + : 'Unable to show the mancode workflow.', + ); + } +} + +function workflowCleanV3(options: WorkflowOptions): number { + return printV3Error( + options.json, + 'MANCODE_V3_WORKFLOW_CLEAN_UNSUPPORTED', + 'V3 workflow authority is durable and is not deleted by workflow clean. Use `mancode context compact --dry-run` to inspect eligible runtime retention records.', + EXIT_INVALID_ARG, + ); +} + +function formatV3WorkflowRow(metadata: WorkflowMetadataV3): string { + return [ + formatTaskRef(metadata.taskRef), + metadata.workflowMode, + metadata.status, + `Step ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`, + `r${metadata.revision}`, + metadata.task, + ].join(' '); +} + +function maxV3WorkflowStep(mode: WorkflowMetadataV3['workflowMode']): number { + return mode === 'manba' ? 5 : 9; +} + async function workflowUpdateV3( rootDir: string, args: string[], diff --git a/src/context/store.ts b/src/context/store.ts index b490ac6..b4a1531 100644 --- a/src/context/store.ts +++ b/src/context/store.ts @@ -336,14 +336,9 @@ export class V3ContextStore { }; } - /** - * Lists non-terminal children from canonical metadata only. Callers that - * need a completion gate must hold the parent task lock while invoking it; - * V3 child creation takes that same parent lock before publishing. - */ - async listActiveChildTaskRefs(parentTaskRef: TaskRef): Promise { - const parent = parseTaskRefValue(parentTaskRef); - const children: TaskRef[] = []; + /** Lists every canonical V3 workflow without relying on a session pointer. */ + async listWorkflowMetadata(): Promise { + const workflows: WorkflowMetadataV3[] = []; for (const namespace of ['local', 'shared'] as const) { const directory = path.join('.mancode', namespace, 'workflows'); const entries = await readDirectoryEntriesWithin( @@ -352,7 +347,7 @@ export class V3ContextStore { ); for (const taskId of entries.sort(compareUtf8)) { try { - assertUlid(taskId, 'workflow child directory'); + assertUlid(taskId, 'workflow directory'); } catch { throw new Error('MANCODE_CONTEXT_COLLECTION_ENTRY_INVALID'); } @@ -367,22 +362,42 @@ export class V3ContextStore { 'metadata.json', parseWorkflowMetadata, ); - if ( - metadata.parent !== null && - sameTaskRef(metadata.parent.taskRef, parent) && - !isTerminalWorkflowStatus(metadata.status) - ) { - children.push(metadata.taskRef); + if (!sameTaskRef(metadata.taskRef, taskRef)) { + throw new Error('MANCODE_CONTEXT_TASK_LOCATION_MISMATCH'); } + workflows.push(metadata); } } - return children.sort( + return workflows.sort( (left, right) => - compareUtf8(left.namespace, right.namespace) || - compareUtf8(left.taskId, right.taskId), + Date.parse(right.updatedAt) - Date.parse(left.updatedAt) || + compareUtf8(left.taskRef.namespace, right.taskRef.namespace) || + compareUtf8(left.taskRef.taskId, right.taskRef.taskId), ); } + /** + * Lists non-terminal children from canonical metadata only. Callers that + * need a completion gate must hold the parent task lock while invoking it; + * V3 child creation takes that same parent lock before publishing. + */ + async listActiveChildTaskRefs(parentTaskRef: TaskRef): Promise { + const parent = parseTaskRefValue(parentTaskRef); + return (await this.listWorkflowMetadata()) + .filter( + (metadata) => + metadata.parent !== null && + sameTaskRef(metadata.parent.taskRef, parent) && + !isTerminalWorkflowStatus(metadata.status), + ) + .map((metadata) => metadata.taskRef) + .sort( + (left, right) => + compareUtf8(left.namespace, right.namespace) || + compareUtf8(left.taskId, right.taskId), + ); + } + private mancodeRoot(): string { return path.join(this.projectRoot, '.mancode'); } diff --git a/tests/v3-adapter-contracts.test.ts b/tests/v3-adapter-contracts.test.ts index bc052b3..0cbc025 100644 --- a/tests/v3-adapter-contracts.test.ts +++ b/tests/v3-adapter-contracts.test.ts @@ -73,6 +73,13 @@ describe('V3 adapter bootstrap integration', () => { }); expect(result.activation.managedAdapters.codex).toBe('3'); + logs.mockClear(); + expect(await status(root, {})).toBe(0); + const textOutput = logs.mock.calls.flat().join('\n'); + expect(textOutput).toContain('Session evidence: explicit required'); + expect(textOutput).toContain('codex'); + expect(textOutput).not.toContain('explicit required ()'); + expect(await install(root, 'cursor')).toBe(0); const cursorRule = await readFile( path.join(root, '.cursor', 'rules', 'mancode-v3.mdc'), @@ -578,6 +585,12 @@ describe('V3 adapter bootstrap integration', () => { expect(await uninstall(root, undefined, { all: true })).toBe( EXIT_V3_AUTHORITY_PROTECTED, ); + expect(errors.mock.calls.flat().join('\n')).toContain( + 'context compact --dry-run', + ); + expect(errors.mock.calls.flat().join('\n')).not.toContain( + 'archive/migration workflow', + ); } finally { logs.mockRestore(); errors.mockRestore(); diff --git a/tests/v3-command-contracts.test.ts b/tests/v3-command-contracts.test.ts index 3e617f3..f02d093 100644 --- a/tests/v3-command-contracts.test.ts +++ b/tests/v3-command-contracts.test.ts @@ -33,6 +33,7 @@ import { requirementsLedgerDigest, } from '../src/context/requirements-ledger.js'; import { V3ContextStore } from '../src/context/store.js'; +import type { TaskRef } from '../src/context/task-ref.js'; import { readSession } from '../src/runtime/session.js'; import { readLocalActor } from '../src/team/actor.js'; @@ -197,6 +198,68 @@ describe('V3 CLI command contracts', () => { } }); + it('lists and shows V3 workflows without deleting durable authority', async () => { + const logs = vi.spyOn(console, 'log').mockImplementation(() => {}); + const errors = vi.spyOn(console, 'error').mockImplementation(() => {}); + try { + expect(await workflow(root, 'list', [], { json: true })).toBe(0); + expect(JSON.parse(String(logs.mock.calls.at(-1)?.[0]))).toMatchObject({ + schemaVersion: 1, + workflows: [], + }); + + await teamIdentityCreate(root, { name: 'Fixture User', json: true }); + await contextSessionNew(root, { client: 'fixture', json: true }); + const sessionId = ( + JSON.parse(String(logs.mock.calls.at(-1)?.[0])) as { + session: { sessionId: string }; + } + ).session.sessionId; + await workflow(root, 'create', ['man', 'Discover this V3 task.'], { + session: sessionId, + client: 'fixture', + json: true, + }); + const created = JSON.parse(String(logs.mock.calls.at(-1)?.[0])) as { + taskRef: { namespace: string; taskId: string }; + }; + const task = `${created.taskRef.namespace}:${created.taskRef.taskId}`; + + expect(await workflow(root, 'list', [], { json: true })).toBe(0); + expect(JSON.parse(String(logs.mock.calls.at(-1)?.[0]))).toMatchObject({ + workflows: [ + { + taskRef: created.taskRef, + workflowMode: 'man', + status: 'in_progress', + }, + ], + }); + expect(await workflow(root, 'show', [task], { json: true })).toBe(0); + expect(JSON.parse(String(logs.mock.calls.at(-1)?.[0]))).toMatchObject({ + taskRef: created.taskRef, + metadata: { + task: 'Discover this V3 task.', + revision: 1, + }, + activeChildren: [], + }); + + expect(await workflow(root, 'clean', [], { json: true })).toBe(2); + expect(JSON.parse(String(logs.mock.calls.at(-1)?.[0]))).toMatchObject({ + error: { code: 'MANCODE_V3_WORKFLOW_CLEAN_UNSUPPORTED' }, + }); + await expect( + new V3ContextStore(root).readTaskSnapshot(created.taskRef as TaskRef), + ).resolves.toMatchObject({ + metadata: { task: 'Discover this V3 task.' }, + }); + } finally { + logs.mockRestore(); + errors.mockRestore(); + } + }); + it('reports an empty local coordination view and rejects local conflict queries', async () => { const logs = vi.spyOn(console, 'log').mockImplementation(() => {}); const errors = vi.spyOn(console, 'error').mockImplementation(() => {}); diff --git a/tests/version.test.ts b/tests/version.test.ts index 245cd89..a2e1ae4 100644 --- a/tests/version.test.ts +++ b/tests/version.test.ts @@ -8,7 +8,7 @@ describe('version', () => { expect(VERSION).toMatch(/^\d+\.\d+\.\d+/); }); - it('is a stable release without prerelease tag', () => { + it('keeps the npm version consumable without a prerelease tag', () => { expect(VERSION).not.toMatch(/-(alpha|beta|rc)\./); }); @@ -21,7 +21,8 @@ describe('version', () => { for (const readme of readmes) { expect(readme).toContain(`v${VERSION}`); - expect(readme).toContain(`status-stable%20v${VERSION}`); + expect(readme).toContain(`status-V3%20beta%20v${VERSION}`); + expect(readme).not.toContain(`status-stable%20v${VERSION}`); } }); }); diff --git a/tests/website-docs.test.ts b/tests/website-docs.test.ts index dc8c590..61ccc49 100644 --- a/tests/website-docs.test.ts +++ b/tests/website-docs.test.ts @@ -47,8 +47,8 @@ describe('website documentation', () => { 'refresh-project', 'manps [area]', '--remediate', - 'require-manual', - 'confirm-manual', + 'workflow verify', + 'workflow review', 'governed_execution', 'plan_only', 'blockingUnknowns', @@ -71,13 +71,13 @@ describe('website documentation', () => { ); }); - it('shows workflow commands in a legal governed order', async () => { + it('shows the V3 workflow command contract', async () => { for (const name of ['docs.html', 'docs.zh-CN.html']) { const html = await readPage(name); const start = html.indexOf( name === 'docs.html' - ? '

A valid governed sequence

' - : '

一条合法的治理式执行顺序

', + ? '

A valid V3 sequence

' + : '

一条合法的 V3 顺序

', ); const end = html.indexOf( name === 'docs.html' @@ -87,20 +87,15 @@ describe('website documentation', () => { ); const example = html.slice(start, end); const orderedTokens = [ - '--step 2', - 'requirements <taskId> finalize', - '--step 3', - '--step 4', - 'governed_execution', - '--step 5', - '--step 6', - 'verify <taskId> init', - 'verify <taskId> record', - 'review <taskId> init', - '--step 7', - 'review <taskId> complete', - '--step 9', - '--status completed', + 'workflow create man', + 'workflow list --json', + 'workflow show <local:ULID> --json', + 'workflow requirements <local:ULID> finalize', + 'workflow plan <local:ULID> revise', + 'workflow plan <local:ULID> confirm', + 'workflow review <local:ULID> apply', + 'workflow verify <local:ULID> apply', + 'workflow complete <local:ULID>', ]; let previous = -1; @@ -111,7 +106,10 @@ describe('website documentation', () => { ); previous = current; } - expect(example).not.toContain('--step 4 --plan-version 1'); + expect(example).not.toMatch(/workflow update[^\n]*--step/); + expect(example).not.toContain('workflow decide'); + expect(example).not.toContain('verify <taskId>'); + expect(example).not.toContain('review <taskId>'); } }); @@ -147,8 +145,8 @@ describe('website documentation', () => { expect(chinese).toContain('代码,避免'); expect(chinese).toContain('AI 屎山。'); expect(chinese).toContain('预览适配器'); - expect(english).not.toMatch(/\b(?:V3|Beta)\b/); - expect(chinese).not.toMatch(/\b(?:V3|Beta)\b/); + expect(english).toContain('V3 Beta / v0.3.13'); + expect(chinese).toContain('V3 Beta / v0.3.13'); }); it('documents the cross-session boundary in both languages', async () => { diff --git a/website/docs.html b/website/docs.html index 1374eda..40258b5 100644 --- a/website/docs.html +++ b/website/docs.html @@ -98,10 +98,10 @@

Verify the installation

Files & privacy

mancode works locally, scans only the current project, and sends no telemetry. It deliberately does not rewrite your project's .gitignore, so your team—not the installer—decides which generated context belongs in version control.

- - - - + + + +
PathWhat it containsBefore committing
.mancode/config.json
.mancode/state.json
Selected adapters, current mode, and active workflow pointers.Review as project configuration; share only when the team wants the same setup.
.mancode/project-profile.json
style-tokens.json
Detected stack, validation commands, and UI tokens.Inspect for internal project details and decide whether reproducibility justifies sharing.
.mancode/workflows/Requirements, plans, review scope, verification evidence, reports, and summaries.Review carefully. Evidence, logs, screenshots, traces, and browser artifacts may contain sensitive data and are often better ignored or sanitized.
.mancode/memory/Team decisions and durable shared context.Commit only information intentionally written for the team.
.mancode/schema.json
.mancode/shared/
.mancode/local/
V3 authority, project policy, sessions, workflow metadata, and local runtime records. Legacy state.json exists only after explicit --legacy initialization.Review workflow evidence and local records before sharing; raw host session keys are never persisted.
.mancode/shared/context/project.json
.mancode/local/cache/style-tokens.json
Detected stack, validation commands, and local UI tokens.Inspect for internal project details and decide whether reproducibility justifies sharing.
.mancode/local/workflows/
.mancode/shared/workflows/
Requirements, plans, review and verification ledgers, reports, checkpoints, and summaries.Review carefully. Evidence and reports may contain sensitive data; shared workflows pass the V3 privacy boundary.
.mancode/shared/context/decisions/
.mancode/shared/team/
Confirmed decisions and durable coordination authority.Commit only information intentionally written for the team.
.claude/, .cursor/, .agents/, .github/, AGENTS.mdAdapter instructions, commands or prompts, skills, hooks, and managed blocks.Share when the adapter is part of the team's development workflow. Content outside mancode's managed blocks remains yours.
Safety boundary

mancode manps scans and reports by default. Remediation is explicit. Irreversible project operations still require human confirmation; installing mancode does not grant the agent permission to publish, delete, or rewrite unrelated work.

@@ -171,19 +171,19 @@

CLI reference

mancode install [platform]

Adapter

Installs or repairs an adapter after initialization. Omit the platform for interactive selection.

  • --force regenerates managed content.
  • --minimal installs solo-mode essentials only.

mancode status [--json]

Inspect

Reports project facts, current mode and workflow, adapter readiness, and Claude hook registration where applicable.

mancode list-platforms

Discover

Lists adapters known to the installed CLI and marks those already configured in the project.

-

mancode workflow <subcommand>

Govern

Creates and validates requirements, plans, verification evidence, reviews, remediation, and completion. See the detailed lifecycle below.

  • Inspect with list and show <taskId> [--json].
  • Prune old completed records with clean --older-than <duration> [--dry-run].
+

mancode workflow <subcommand>

Govern

Creates and validates V3 requirements, plans, verification evidence, reviews, remediation, and completion.

  • Inspect with list and show <namespace:ULID> [--json].
  • Use context compact --dry-run to inspect removable runtime records; V3 workflow authority is not deleted by workflow clean.

mancode manps [area]

Scan

Runs a deterministic health scan for all, deps, security, dead-code, config.

  • --json emits machine-readable output.
  • --remediate enters the explicit remediation path; the default is scan-only.

mancode refresh-project

Rescan

Refreshes project facts after adding Git, a manifest, a framework, or validation commands, then updates installed static adapters.

mancode refresh-style

Design

Refreshes the project profile and design tokens. Reinstall static adapters with --force afterward.

-

mancode uninstall [platform]

Remove

Removes one adapter, or all mancode project artifacts with --all. Use --force for non-interactive confirmation.

+

mancode uninstall [platform]

Remove

Removes one V3 adapter. V3 protects authority from bulk removal; use context compact --dry-run for retention candidates. The --all form is legacy-only.

mancode version

Version

Prints the installed CLI version for upgrade checks and issue reports.

Study the /man workflow

-

/man is a progressive nine-step protocol. It first makes the decision inspectable, then lets the user choose between a lightweight handoff, a plan-only result, or governed execution. Every gate is backed by files under .mancode/workflows/<taskId>/.

-
Who runs these commands?

The installed man skill creates the task, stores its active pointer in .mancode/state.json, writes artifacts, and calls the CLI. The commands below are the machine contract for studying, debugging, or integrating the process. A standalone workflow create does not activate the task pointer by itself.

+

/man is a progressive nine-step protocol. It first makes the decision inspectable, then lets the user choose between a lightweight handoff, a plan-only result, or governed execution. Every gate is backed by V3 files under .mancode/<namespace>/workflows/<ULID>/.

+
Who runs these commands?

The installed V3 mode entry creates the task and reads its Context Pack. The commands below are the machine contract for studying, debugging, or integrating the process. V3 identifies tasks with explicit namespace:ULID TaskRefs and does not use a legacy active pointer.

The nine steps and their gates

@@ -226,78 +226,61 @@

Requirements ledger

} ] } -
$ mancode workflow requirements <taskId> finalize --file requirements-input.json
+
$ mancode workflow requirements <local:ULID> finalize --file requirements-input.json --expected-revision <revision> --session <session-id>

A successful result says ready. A result of needs_clarification is a hard stop: resolve blockingUnknowns, regenerate the input, and finalize again.

The Step 4 decision

-

Solo handoff

Deliver

Use when the plan is settled but implementation risk is routine.

$ mancode workflow handoff <taskId> --to solo
+            

Solo handoff

Deliver

Use when the plan is settled but implementation risk is routine.

$ mancode workflow handoff <local:ULID> --to solo --expected-revision <revision> --session <session-id>
 # after solo implements and verifies
-$ mancode workflow handoff <taskId> --complete
-

Governed execution

Continue

Use when implementation, evidence, and independent review should remain inside the nine-step record.

$ mancode workflow decide <taskId> --plan-decision governed_execution
-

Plan only

Stop

Use when the requested deliverable is the confirmed plan, not code.

$ mancode workflow decide <taskId> --plan-decision plan_only
+$ mancode workflow handoff <local:ULID> --complete --expected-revision <revision> --session <session-id>
+

Governed execution

Continue

Use when implementation, evidence, and independent review should remain inside the nine-step record.

$ mancode workflow plan <local:ULID> confirm --plan-decision governed_execution --expected-revision <revision> --session <session-id>
+

Plan only

Stop

Use when the requested deliverable is the confirmed plan, not code.

$ mancode workflow plan <local:ULID> confirm --plan-decision plan_only --expected-revision <revision> --session <session-id>
-

All three choices require an active in-progress man workflow at Step 4, ready requirements, and plan.md. Revision stays at the plan gate, updates the file, and increments --plan-version from the initial v1 to v2, then v3, and so on.

+

All three choices require an active man workflow, confirmed requirements, and plan.md. Revise the plan with workflow plan ... revise; every successful mutation returns the revision required by the next command.

-

A valid governed sequence

-

This condensed trace shows legal ordering. Comments mark files written by the agent; they are not shell commands. The agent advances each numbered step only after its work and artifact are complete.

-
# Step 1–2: create, scout, clarify, and freeze requirements
-$ mancode workflow create man "refactor auth module" --json
-# agent stores taskId as the active workflow and writes scout-report.md
-$ mancode workflow update <taskId> --step 2
-$ mancode workflow requirements <taskId> finalize --file requirements-input.json
+          

A valid V3 sequence

+

V3 uses explicit TaskRefs and expected revisions. The CLI owns every durable mutation; do not edit metadata files or use the legacy --step protocol.

+
# Bootstrap an actor and explicit session
+$ mancode team identity create --name "Your name"
+$ mancode context session new --client codex --json
 
-# Step 3–4: write plan.md and reach the user decision gate
-$ mancode workflow update <taskId> --step 3
-# agent writes plan.md
-$ mancode workflow update <taskId> --step 4
-$ mancode workflow decide <taskId> --plan-decision governed_execution
+# Create, discover, and inspect a task
+$ mancode workflow create man "refactor auth module" --session <session-id> --json
+$ mancode workflow list --json
+$ mancode workflow show <local:ULID> --json
 
-# Step 5–6: implement, initialize verification, and record every required AC
-$ mancode workflow update <taskId> --step 5
-# agent implements the confirmed plan
-$ mancode workflow update <taskId> --step 6
-$ mancode workflow verify <taskId> init
-$ mancode workflow verify <taskId> record --acceptance AC-LOGIN --method automated --result passed --evidence "auth tests passed" --command "npm test -- auth" --exit-code 0
+# Requirements and plan gates (use the revision returned by each command)
+$ mancode workflow requirements <local:ULID> finalize --file requirements-input.json --expected-revision <revision> --session <session-id>
+$ mancode workflow plan <local:ULID> revise --file plan.md --expected-revision <revision> --session <session-id>
+$ mancode workflow plan <local:ULID> confirm --plan-decision governed_execution --expected-revision <revision> --session <session-id>
 
-# Step 7–9: targeted review, report, summary, completion
-# agent writes review-scope.md
-$ mancode workflow review <taskId> init --review-depth targeted --review-domain quality
-$ mancode workflow update <taskId> --step 7
-# agent writes film-report-1.md
-$ mancode workflow review <taskId> complete --review-domain quality --report film-report-1.md
-$ mancode workflow update <taskId> --step 9
-# agent writes summary.md
-$ mancode workflow update <taskId> --status completed
+# Record canonical review and verification ledgers +$ mancode workflow review <local:ULID> apply --file review-ledger.json --expected-revision <revision> --session <session-id> +$ mancode workflow verify <local:ULID> apply --file verification-ledger.json --expected-revision <revision> --session <session-id> +$ mancode workflow complete <local:ULID> --expected-revision <revision> --session <session-id>

Verification, manual checks, and remediation

StepAgent workDurable gate
- - - - + + + +
CaseRequired recordGate behavior
Automatedrecord with acceptance ID, method, result, evidence, exact command, and exit code. A passing result requires exit code 0; a failure requires non-zero.Step 7 and review stay blocked until every required acceptance criterion passes.
Manualrequire-manual explains why automation cannot decide. Only after the user performs the check may the agent call confirm-manual with observed evidence.The workflow is blocked while confirmation is pending.
Review findingreview complete ... --blockers Q1,Q2 stores stable IDs. Fix once with review remediate --resolved Q1,Q2.Remediation invalidates earlier verification; all required criteria must be re-run and re-recorded at Step 9.
User skips reviewreview skip --reason "explicit user request" at Step 6 after verification.The reason is durable, but summary.md and Step 9 completion are still required.
AutomatedThe canonical verification ledger records the criterion, command, exit code, evidence summary, and result.workflow verify ... apply rejects a ledger that does not satisfy the V3 schema and current revision.
ManualThe ledger records why automation cannot decide and only changes to passed after explicit user confirmation.Completion remains blocked while required manual evidence is pending.
Review findingThe canonical review ledger stores stable blocker IDs and their remediation state.Applying a review ledger makes earlier verification stale; apply current verification after review and before completion.
User skips reviewThe review ledger records the explicit user decision and residual risk.Completion still requires a valid summary and every remaining gate.
-
# manual acceptance: stop and wait after require-manual
-$ mancode workflow verify <taskId> require-manual --acceptance AC-UI --evidence "foreground browser judgment required"
-# only after explicit user confirmation
-$ mancode workflow verify <taskId> confirm-manual --acceptance AC-UI --evidence "user confirmed the interaction"
-
-# one blocker-remediation round
-$ mancode workflow review <taskId> complete --review-domain quality --report film-report-1.md --blockers Q1
-$ mancode workflow update <taskId> --step 9
-$ mancode workflow review <taskId> remediate --resolved Q1
-$ mancode workflow verify <taskId> record --acceptance AC-LOGIN --method automated --result passed --evidence "post-fix tests passed" --command "npm test -- auth" --exit-code 0
+
# Update the canonical ledgers after a remediation
+$ mancode workflow review <local:ULID> apply --file review-ledger.json --expected-revision <revision> --session <session-id>
+$ mancode workflow verify <local:ULID> apply --file verification-ledger.json --expected-revision <revision> --session <session-id>
+$ mancode workflow complete <local:ULID> --expected-revision <revision> --session <session-id>

Workflow subcommands

- - - - - - - - + + + + + + +
CommandPurposeImportant options
createStart a man, manba, or manteam record.--parent-task links a diagnostic child; --json exposes the task ID.
requirementsFinalize the Step 2 ledger from JSON.finalize --file.
updateAdvance step, status, plan version, or durable outcome.--step, --status, --plan-version, --blocking-reason, --outcome. Only clarification may use generic --skipped.
decideResolve the Step 4 plan gate.--plan-decision governed_execution|plan_only.
handoffTransfer a confirmed plan to solo and later close it.--to solo, then --complete.
verifyInitialize and record acceptance evidence.init, record, require-manual, confirm-manual; evidence options include --command, --exit-code, and --evidence-file.
reviewInitialize targeted/full review, store reports and blockers, remediate once, or record an explicit skip.--review-depth, --review-domain, --report, --blockers, --resolved, --reason.
list / show / cleanInspect records or remove old completed records.show --json; clean --older-than 30d --dry-run.
createStart a man, manba, or manteam record.--parent <TaskRef> links a diagnostic child; --json exposes the TaskRef.
requirementsFinalize the structured requirements ledger.finalize --file --expected-revision --session.
planRevise a plan or confirm its execution decision.revise --file; confirm --plan-decision; both require revision and session.
updateChange lifecycle status or a blocking reason.--status --expected-revision --session; governed fields use dedicated commands.
handoffTransfer a confirmed local plan to solo and later close it.--to solo or --complete, with revision and session.
verify / reviewApply canonical V3 ledgers.apply --file --expected-revision --session.
list / show / cleanList or inspect V3 TaskRefs. clean is not a V3 authority deletion command.show <namespace:ULID> --json; use context compact --dry-run for retention.
@@ -324,16 +307,14 @@

Refresh project context

Uninstall safely

-

Uninstall preserves user-authored rules, instructions, and unrelated Claude settings. Review workflow records before deletion if they contain decisions or evidence you still need.

+

Uninstalling one adapter preserves user-authored rules, instructions, unrelated Claude settings, and V3 workflow authority. Use context compact --dry-run to inspect eligible runtime retention records.

Remove one adapter

$ mancode uninstall cursor --force
-

Clean reinstall

-
$ mancode uninstall --all --force
-$ mancode init
-$ mancode install <platform>
-

Remove mancode completely

-
$ mancode uninstall --all --force
-$ npm uninstall -g mancode
+

Reinstall one adapter

+
$ mancode uninstall claude-code --force
+$ mancode install claude-code
+

Remove the CLI

+
$ npm uninstall -g mancode
@@ -347,7 +328,7 @@

Claude Code hooks do not run

Cursor rules do not trigger

Confirm that .cursor/rules/mancode-*.mdc and .cursor/commands/*.md exist. Core context and solo rules are persistent; higher-intensity rules are description-triggered, so invoke the generated mode command explicitly.

A workflow command is rejected

-

Treat the rejection as a gate, not a file-corruption problem. Use mancode workflow show <taskId> --json to inspect the step, requirements readiness, plan decision, verification, review domains, and blockers. Do not edit metadata.json manually.

+

Treat the rejection as a gate, not a file-corruption problem. Use mancode workflow list --json to discover TaskRefs, then mancode workflow show <namespace:ULID> --json to inspect metadata, revision, aggregate, and blockers. Do not edit V3 metadata manually.

Project facts became stale

After adding Git, a manifest, dependencies, or validation scripts, run mancode refresh-project. Use refresh-style for UI tokens. Then repair a static adapter only if its generated files need regeneration.

diff --git a/website/docs.zh-CN.html b/website/docs.zh-CN.html index adf59d2..e6f5aa3 100644 --- a/website/docs.zh-CN.html +++ b/website/docs.zh-CN.html @@ -98,10 +98,10 @@

验证安装结果

文件与隐私

mancode 本地运行,只扫描当前项目,不发送遥测。它不会擅自改写项目的 .gitignore,因此哪些生成上下文应该进入版本控制,需要由你的团队明确决定。

- - - - + + + +
路径包含什么提交前怎么处理
.mancode/config.json
.mancode/state.json
所选平台、当前模式和活动工作流指针。把它当作项目配置检查;只有团队希望共享同一套设置时才提交。
.mancode/project-profile.json
style-tokens.json
识别出的技术栈、验证命令和 UI token。检查是否带有内部项目信息,再权衡复现能力与暴露范围。
.mancode/workflows/需求、计划、评审范围、验证证据、报告与总结。重点检查。日志、截图、trace 和浏览器产物可能含敏感数据,通常应忽略、脱敏或只保留必要摘要。
.mancode/memory/团队决策与长期共享上下文。只提交有意写给团队的内容。
.mancode/schema.json
.mancode/shared/
.mancode/local/
V3 权威、项目策略、会话、工作流元数据和本地运行时记录。只有显式使用 --legacy 初始化后才会出现旧 state.json共享前检查工作流证据和本地记录;原始宿主 session key 不会持久化。
.mancode/shared/context/project.json
.mancode/local/cache/style-tokens.json
识别出的技术栈、验证命令和本地 UI token。检查是否带有内部项目信息,再权衡复现能力与暴露范围。
.mancode/local/workflows/
.mancode/shared/workflows/
需求、计划、评审和验证台账、报告、checkpoint 与总结。重点检查。证据和报告可能含敏感数据;shared workflow 必须通过 V3 隐私边界。
.mancode/shared/context/decisions/
.mancode/shared/team/
已确认决策与持久化协调权威。只提交有意写给团队的内容。
.claude/.cursor/.agents/.github/AGENTS.md平台 instructions、命令或 prompt、skills、hooks 与受控区块。团队确实把该适配器作为开发流程的一部分时再共享;mancode 管理标记之外的内容仍归用户所有。
安全边界

mancode manps 默认只扫描和报告,修复必须显式进入 remediation 路径。安装 mancode 也不会赋予 Agent 发布、删除或重写无关工作的权限;不可逆操作仍需人工确认。

@@ -171,19 +171,19 @@

CLI 参考

mancode install [platform]

适配器

初始化后安装或修复一个平台。省略平台名时进入交互选择。

  • --force 重新生成受控内容。
  • --minimal 只安装 solo 的必要内容。

mancode status [--json]

检查

报告项目事实、当前模式和工作流、平台就绪状态,以及适用时的 Claude hook 注册情况。

mancode list-platforms

发现

列出当前 CLI 支持的平台,并标出项目中已经配置的平台。

-

mancode workflow <subcommand>

治理

创建和校验需求、计划、验证证据、评审、修复与完成状态。完整生命周期见下一节。

  • 使用 listshow <taskId> [--json] 检查。
  • 使用 clean --older-than <duration> [--dry-run] 清理较早的已完成记录。
+

mancode workflow <subcommand>

治理

创建和校验 V3 需求、计划、验证证据、评审、修复与完成状态。

  • 使用 listshow <namespace:ULID> [--json] 检查。
  • 使用 context compact --dry-run 检查可回收的运行时记录;V3 workflow authority 不会被 workflow clean 删除。

mancode manps [area]

扫描

alldepssecuritydead-codeconfig 执行确定性健康扫描。

  • --json 输出机器可读结果。
  • --remediate 显式进入修复路径;默认只扫描。

mancode refresh-project

重扫项目

在加入 Git、manifest、框架或验证命令后刷新项目事实,并更新已安装的静态适配器。

mancode refresh-style

设计上下文

刷新项目画像和设计 token,之后可用 --force 重装需要更新的静态适配器。

-

mancode uninstall [platform]

移除

移除一个平台;使用 --all 清理项目内全部 mancode 产物,--force 用于非交互确认。

+

mancode uninstall [platform]

移除

移除一个 V3 适配器。V3 会保护权威数据不被批量删除;用 context compact --dry-run 检查保留候选。--all 只适用于 legacy 项目。

mancode version

版本

输出已安装 CLI 版本,便于升级检查和提交问题。

深入研究 /man 工作流

-

/man 是一个渐进式九步协议:先让决策变得可检查,再由用户选择轻量交接、仅保留计划,或继续治理式执行。每个闸门都由 .mancode/workflows/<taskId>/ 下的文件支撑。

-
谁来运行这些命令?

安装后的 man skill 会创建任务、把活动指针写入 .mancode/state.json、生成产物,并调用 CLI。下面展示的是供研究、排错或集成使用的机器契约。单独执行一次 workflow create 并不会自动激活该任务指针。

+

/man 是一个渐进式九步协议:先让决策变得可检查,再由用户选择轻量交接、仅保留计划,或继续治理式执行。每个闸门都由 V3 的 .mancode/<namespace>/workflows/<ULID>/ 文件支撑。

+
谁来运行这些命令?

安装后的 V3 mode entry 会创建任务并读取 Context Pack。下面展示的是供研究、排错或集成使用的机器契约。V3 使用显式 namespace:ULID TaskRef,不依赖旧的活动指针。

九个步骤与闸门

@@ -226,78 +226,61 @@

结构化需求台账

} ] } -
$ mancode workflow requirements <taskId> finalize --file requirements-input.json
+
$ mancode workflow requirements <local:ULID> finalize --file requirements-input.json --expected-revision <revision> --session <session-id>

成功结果会显示 ready。如果结果是 needs_clarification,必须停止推进,先解决 blockingUnknowns,重新生成输入后再次 finalize。

Step 4 的三种决策

-

交给 solo

实施

计划已经稳定,但实现风险属于日常范围。

$ mancode workflow handoff <taskId> --to solo
+            

交给 solo

实施

计划已经稳定,但实现风险属于日常范围。

$ mancode workflow handoff <local:ULID> --to solo --expected-revision <revision> --session <session-id>
 # solo 实现并验证后
-$ mancode workflow handoff <taskId> --complete
-

治理式执行

继续

实现、证据和独立评审都需要保留在九步记录内。

$ mancode workflow decide <taskId> --plan-decision governed_execution
-

只保留计划

停止

用户需要的交付物是计划,而不是代码。

$ mancode workflow decide <taskId> --plan-decision plan_only
+$ mancode workflow handoff <local:ULID> --complete --expected-revision <revision> --session <session-id>
+

治理式执行

继续

实现、证据和独立评审都需要保留在九步记录内。

$ mancode workflow plan <local:ULID> confirm --plan-decision governed_execution --expected-revision <revision> --session <session-id>
+

只保留计划

停止

用户需要的交付物是计划,而不是代码。

$ mancode workflow plan <local:ULID> confirm --plan-decision plan_only --expected-revision <revision> --session <session-id>
-

三种选择都要求:活动中的 man 工作流位于 Step 4、需求已 ready,并且 plan.md 存在。选择修订时仍停留在计划闸门,更新文件,并用 --plan-version 从初始 v1 递增到 v2、v3。

+

三种选择都要求活动中的 man 工作流、已确认需求和 plan.md。使用 workflow plan ... revise 修订计划;每次成功写入都会返回下一个命令需要的 revision。

-

一条合法的治理式执行顺序

-

下面是压缩后的有效顺序。注释表示由 Agent 写入的文件,不是终端命令;只有当前阶段的工作和产物都完成后,Agent 才推进编号步骤。

-
# Step 1–2:创建、侦察、澄清并冻结需求
-$ mancode workflow create man "refactor auth module" --json
-# Agent 保存活动 taskId,并写入 scout-report.md
-$ mancode workflow update <taskId> --step 2
-$ mancode workflow requirements <taskId> finalize --file requirements-input.json
+          

一条合法的 V3 顺序

+

V3 使用显式 TaskRef 和 expected revision。所有持久化变更都由 CLI 完成;不要手工编辑 metadata,也不要使用 legacy --step 协议。

+
# 创建 actor 和显式 session
+$ mancode team identity create --name "Your name"
+$ mancode context session new --client codex --json
 
-# Step 3–4:写入 plan.md,到达用户决策闸门
-$ mancode workflow update <taskId> --step 3
-# Agent 写入 plan.md
-$ mancode workflow update <taskId> --step 4
-$ mancode workflow decide <taskId> --plan-decision governed_execution
+# 创建、发现并检查任务
+$ mancode workflow create man "refactor auth module" --session <session-id> --json
+$ mancode workflow list --json
+$ mancode workflow show <local:ULID> --json
 
-# Step 5–6:实现、初始化验证、记录每个必需 AC
-$ mancode workflow update <taskId> --step 5
-# Agent 实现已确认计划
-$ mancode workflow update <taskId> --step 6
-$ mancode workflow verify <taskId> init
-$ mancode workflow verify <taskId> record --acceptance AC-LOGIN --method automated --result passed --evidence "auth tests passed" --command "npm test -- auth" --exit-code 0
+# 需求和计划闸门(每次使用上一个命令返回的 revision)
+$ mancode workflow requirements <local:ULID> finalize --file requirements-input.json --expected-revision <revision> --session <session-id>
+$ mancode workflow plan <local:ULID> revise --file plan.md --expected-revision <revision> --session <session-id>
+$ mancode workflow plan <local:ULID> confirm --plan-decision governed_execution --expected-revision <revision> --session <session-id>
 
-# Step 7–9:targeted review、报告、总结、完成
-# Agent 写入 review-scope.md
-$ mancode workflow review <taskId> init --review-depth targeted --review-domain quality
-$ mancode workflow update <taskId> --step 7
-# Agent 写入 film-report-1.md
-$ mancode workflow review <taskId> complete --review-domain quality --report film-report-1.md
-$ mancode workflow update <taskId> --step 9
-# Agent 写入 summary.md
-$ mancode workflow update <taskId> --status completed
+# 记录规范化评审和验证台账 +$ mancode workflow review <local:ULID> apply --file review-ledger.json --expected-revision <revision> --session <session-id> +$ mancode workflow verify <local:ULID> apply --file verification-ledger.json --expected-revision <revision> --session <session-id> +$ mancode workflow complete <local:ULID> --expected-revision <revision> --session <session-id>

自动验证、手工确认与修复后重验

步骤Agent 工作持久化闸门
- - - - + + + +
场景必须记录闸门行为
自动验证record 必须包含验收 ID、方法、结果、证据、准确命令和退出码。passed 要求退出码 0,failed 要求非 0。所有必需验收标准通过前,Step 7 和 review 都会被阻止。
手工验证require-manual 解释自动化为何不能判断。只有用户亲自执行并确认后,Agent 才能用 confirm-manual 写入观察证据。等待确认期间工作流处于 blocked。
评审发现review complete ... --blockers Q1,Q2 保存稳定 ID;用 review remediate --resolved Q1,Q2 进行唯一一轮修复。任何 remediation 都会使旧验证失效,Step 9 必须重新运行并记录全部必需验收。
用户跳过评审在 Step 6 完成验证后,使用 review skip --reason "explicit user request"理由会持久保存,但仍需写 summary.md 并到 Step 9 才能完成。
自动验证规范化 verification ledger 记录验收项、命令、退出码、证据摘要与结果。workflow verify ... apply 会拒绝不符合 V3 schema 或 revision 的台账。
手工验证台账记录自动化不能判断的原因;只有用户明确确认后才能改为 passed。必需人工证据未完成时,completion 持续阻塞。
评审发现规范化 review ledger 保存稳定 blocker ID 及其 remediation 状态。应用 review ledger 会使旧验证失效;评审后、完成前必须 apply 当前验证。
用户跳过评审review ledger 记录用户显式决定和残余风险。仍然需要有效 summary 和其余全部门禁。
-
# 手工验收:require-manual 后必须暂停等待
-$ mancode workflow verify <taskId> require-manual --acceptance AC-UI --evidence "需要前台浏览器和人工判断"
-# 只有用户明确确认后才能执行
-$ mancode workflow verify <taskId> confirm-manual --acceptance AC-UI --evidence "用户确认交互符合预期"
-
-# 唯一一轮 blocker remediation
-$ mancode workflow review <taskId> complete --review-domain quality --report film-report-1.md --blockers Q1
-$ mancode workflow update <taskId> --step 9
-$ mancode workflow review <taskId> remediate --resolved Q1
-$ mancode workflow verify <taskId> record --acceptance AC-LOGIN --method automated --result passed --evidence "修复后测试通过" --command "npm test -- auth" --exit-code 0
+
# remediation 后更新规范化台账
+$ mancode workflow review <local:ULID> apply --file review-ledger.json --expected-revision <revision> --session <session-id>
+$ mancode workflow verify <local:ULID> apply --file verification-ledger.json --expected-revision <revision> --session <session-id>
+$ mancode workflow complete <local:ULID> --expected-revision <revision> --session <session-id>

workflow 子命令速查

- - - - - - - - + + + + + + +
命令用途关键选项
create创建 manmanbamanteam 记录。--parent-task 关联诊断子任务;--json 输出 task ID。
requirements从 JSON 完成 Step 2 需求台账。finalize --file
update推进步骤、状态、计划版本或结果。--step--status--plan-version--blocking-reason--outcome。通用 --skipped 只允许记录 clarification。
decide解决 Step 4 计划闸门。--plan-decision governed_execution|plan_only
handoff把已确认计划交给 solo,随后关闭该计划。--to solo,完成后使用 --complete
verify初始化并记录验收证据。initrecordrequire-manualconfirm-manual;证据选项包括 --command--exit-code--evidence-file
review初始化 targeted/full review、保存报告和 blocker、修复一次,或记录用户显式跳过。--review-depth--review-domain--report--blockers--resolved--reason
list / show / clean检查记录或删除较早的已完成记录。show --jsonclean --older-than 30d --dry-run
create创建 manmanbamanteam 记录。--parent <TaskRef> 关联诊断子任务;--json 输出 TaskRef。
requirements完成结构化需求台账。finalize --file --expected-revision --session
plan修订计划或确认执行决策。revise --fileconfirm --plan-decision;两者都需要 revision 和 session。
update改变生命周期状态或阻塞原因。--status --expected-revision --session;治理字段使用专用命令。
handoff把已确认的本地计划交给 solo,随后关闭。--to solo--complete,并传 revision 与 session。
verify / review应用规范化 V3 台账。apply --file --expected-revision --session
list / show / clean列出或检查 V3 TaskRef;clean 不是删除 V3 权威数据的命令。show <namespace:ULID> --json;保留清理使用 context compact --dry-run
@@ -324,16 +307,14 @@

刷新项目上下文

安全卸载

-

卸载会保留用户自己编写的 rules、instructions 和无关的 Claude settings。删除前先检查工作流记录,避免丢失仍然需要的决策或证据。

+

卸载单个平台会保留用户自己编写的 rules、instructions、无关的 Claude settings 和 V3 工作流权威数据。使用 context compact --dry-run 检查可清理的运行时保留记录。

移除一个适配器

$ mancode uninstall cursor --force
-

完整重装

-
$ mancode uninstall --all --force
-$ mancode init
-$ mancode install <platform>
-

完全移除 mancode

-
$ mancode uninstall --all --force
-$ npm uninstall -g mancode
+

重装一个适配器

+
$ mancode uninstall claude-code --force
+$ mancode install claude-code
+

移除 CLI

+
$ npm uninstall -g mancode
@@ -347,7 +328,7 @@

Claude Code hooks 没有触发

Cursor rules 没有触发

确认 .cursor/rules/mancode-*.mdc.cursor/commands/*.md 都存在。核心上下文与 solo rules 持续生效;高强度规则按描述触发,因此应显式调用生成的模式命令。

workflow 命令被拒绝

-

把拒绝当作流程闸门,而不是元数据损坏。使用 mancode workflow show <taskId> --json 检查步骤、需求就绪状态、计划决策、验证、评审域和 blocker。不要直接编辑 metadata.json

+

把拒绝当作流程闸门,而不是元数据损坏。先用 mancode workflow list --json 找到 TaskRef,再用 mancode workflow show <namespace:ULID> --json 检查元数据、revision、aggregate 和 blocker。不要手工编辑 V3 metadata。

项目事实已经过期

添加 Git、manifest、依赖或验证脚本后执行 mancode refresh-project;UI token 改变时执行 refresh-style。只有静态适配器的生成文件需要更新时,才重新安装对应平台。

diff --git a/website/index.html b/website/index.html index 76cd820..a4d879e 100644 --- a/website/index.html +++ b/website/index.html @@ -253,7 +253,7 @@

Every task
is not game seven.

/man workflow

From scout report
to final buzzer.

Every planning run leaves a readable trail under - .mancode/workflows/<taskId>/. After approval, hand the plan to lightweight solo + .mancode/<namespace>/workflows/<ULID>/. After approval, hand the plan to lightweight solo delivery or continue through the full governed workflow.

@@ -299,10 +299,10 @@

Read the room
before writing.

project / local
your-project/
 ├── .mancode/
-│   ├── project-profile.json
-│   ├── aesthetics/style-tokens.json
-│   ├── workflows/<taskId>/
-│   └── memory/
+│   ├── shared/context/project.json
+│   ├── local/cache/style-tokens.json
+│   ├── local/workflows/<ULID>/
+│   └── shared/team/
 ├── .claude/
 ├── .cursor/rules/
 ├── .agents/skills/
@@ -439,7 +439,7 @@ 

Stop babysitting
AI bloat.

中文 AGPL-3.0 - Stable / v0.3.13 + V3 Beta / v0.3.13 diff --git a/website/index.zh-CN.html b/website/index.zh-CN.html index 04a7817..bec2eab 100644 --- a/website/index.zh-CN.html +++ b/website/index.zh-CN.html @@ -38,7 +38,7 @@
02 / 五档强度按风险匹配流程。

不是每个任务
都是抢七。

同一个编码 Agent,日常任务轻装上阵;需要正式方案时先用 /man 对齐需求和计划,再选择 solo 轻量开发或完整治理。针对最新模型自带审查的特点,mancode 会限制 review 轮次,同时给不主动审查的模型保留质量门槛。

日常训练

solo

一次受限 diff 自检、最窄验证,不调用额外 reviewer。

真实诊断

/manba

复现、定位根因、驱动真实路径并回归验证。

团队协作

/manteam

共享项目记忆、决策记录与协作约定。

季前赛

/manps

检测陈旧 TODO、依赖风险和硬编码设计值。

-
03 / 先计划再选择solo 交付或完整治理。

/man 工作流

从需求对齐
到确认计划。

每次规划都会在 .mancode/workflows/<taskId>/ 产生可读记录。计划确认后,可交给 solo 轻量开发,也可继续完整九步治理。

  1. 01球探报告梳理代码、风险与未知项
  2. 02需求澄清确认真正要解决的问题
  3. 03计划输出可验证步骤
  4. 04计划关卡solo、完整治理、仅计划或修改
  5. 06验证与范围验证后选择审查深度
  6. 07定向审查有证据的质量 finding
  7. 08风险防守高风险时审查安全边界
  8. 09收尾一轮修复、复验、停止
+
03 / 先计划再选择solo 交付或完整治理。

/man 工作流

从需求对齐
到确认计划。

每次规划都会在 .mancode/<namespace>/workflows/<ULID>/ 产生可读记录。计划确认后,可交给 solo 轻量开发,也可继续完整九步治理。

  1. 01球探报告梳理代码、风险与未知项
  2. 02需求澄清确认真正要解决的问题
  3. 03计划输出可验证步骤
  4. 04计划关卡solo、完整治理、仅计划或修改
  5. 06验证与范围验证后选择审查深度
  6. 07定向审查有证据的质量 finding
  7. 08风险防守高风险时审查安全边界
  8. 09收尾一轮修复、复验、停止
04 / 项目感知你的代码库本来就有自己的战术。
@@ -52,10 +52,10 @@

先读懂现场,
再开始写。

project / local
your-project/
 ├── .mancode/
-│   ├── project-profile.json
-│   ├── aesthetics/style-tokens.json
-│   ├── workflows/<taskId>/
-│   └── memory/
+│   ├── shared/context/project.json
+│   ├── local/cache/style-tokens.json
+│   ├── local/workflows/<ULID>/
+│   └── shared/team/
 ├── .claude/
 ├── .cursor/rules/
 ├── .agents/skills/
@@ -88,6 +88,6 @@ 

一项任务。
下个会话继续。

简单任务少一点仪式。
关键任务多一点纪律。

别再替 AI
收拾臃肿。

> npm install -g mancode
GitHub 上查看 ↗
- + From 573c7db34fa75e93de7ce68799a97af312a6d13f Mon Sep 17 00:00:00 2001 From: whitelonng Date: Sun, 19 Jul 2026 23:47:05 +0800 Subject: [PATCH 2/9] chore: release 0.3.14 --- README.en.md | 6 +++--- README.md | 6 +++--- docs/12-lifecycle.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- tests/website-docs.test.ts | 4 ++-- website/docs.html | 2 +- website/docs.zh-CN.html | 2 +- website/index.html | 2 +- website/index.zh-CN.html | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.en.md b/README.en.md index 58479a4..92da94c 100644 --- a/README.en.md +++ b/README.en.md @@ -17,7 +17,7 @@

License: AGPL-3.0 npm version - Status: V3 beta v0.3.13 + Status: V3 beta v0.3.14 Platforms: Claude Code, Cursor, Codex in ChatGPT desktop and CLI, GitHub Copilot, ZCode

@@ -350,7 +350,7 @@ it should behave, and why previous decisions were made. ## Installation -**Status**: V3 beta v0.3.13. Claude Code, Cursor, Codex in the ChatGPT desktop +**Status**: V3 beta v0.3.14. Claude Code, Cursor, Codex in the ChatGPT desktop app and CLI, GitHub Copilot, and ZCode adapters are included. Stable release still requires the five-host real-session acceptance and the `context beta` B1 gate. @@ -449,7 +449,7 @@ mancode version Simplified output: ```text -mancode v0.3.13 +mancode v0.3.14 Project: my-app Runtime: ready diff --git a/README.md b/README.md index d73f72e..a15a90e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@

许可证:AGPL-3.0 npm 版本 - 状态:V3 Beta v0.3.13 + 状态:V3 Beta v0.3.14 平台:Claude Code、Cursor、ChatGPT 桌面端 Codex、Codex CLI、GitHub Copilot、ZCode

@@ -305,7 +305,7 @@ src/components/ ## 安装 -**状态**:V3 Beta v0.3.13。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、 +**状态**:V3 Beta v0.3.14。Claude Code、Cursor、ChatGPT 桌面端中的 Codex、 Codex CLI 和 GitHub Copilot 均已接入;ZCode adapter 已接入。正式稳定发布仍需 完成五平台真实宿主验收和 `context beta` B1 门禁。 @@ -402,7 +402,7 @@ mancode version 以下是简化输出示例: ```text -mancode v0.3.13 +mancode v0.3.14 Project: my-app Runtime: ready diff --git a/docs/12-lifecycle.md b/docs/12-lifecycle.md index 077e6da..9dfde5c 100644 --- a/docs/12-lifecycle.md +++ b/docs/12-lifecycle.md @@ -107,7 +107,7 @@ Node 直接解析 JSON。不存在 jq fallback,也不会调用任何外部进 ```json { - "version": "0.3.13", + "version": "0.3.14", "currentMode": "solo", "lastMode": "solo", "platform": "claude-code", diff --git a/package-lock.json b/package-lock.json index 0d8c5a7..af627fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mancode", - "version": "0.3.13", + "version": "0.3.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mancode", - "version": "0.3.13", + "version": "0.3.14", "license": "AGPL-3.0-only", "dependencies": { "commander": "^12.1.0", diff --git a/package.json b/package.json index fd6e224..d5461a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mancode", - "version": "0.3.13", + "version": "0.3.14", "description": "AI coding agent workflow harness. Five modes from practice to playoffs: stop over-engineering, reuse project context, and add multi-agent code review.", "type": "module", "license": "AGPL-3.0-only", diff --git a/tests/website-docs.test.ts b/tests/website-docs.test.ts index 61ccc49..964d95f 100644 --- a/tests/website-docs.test.ts +++ b/tests/website-docs.test.ts @@ -145,8 +145,8 @@ describe('website documentation', () => { expect(chinese).toContain('代码,避免'); expect(chinese).toContain('AI 屎山。'); expect(chinese).toContain('预览适配器'); - expect(english).toContain('V3 Beta / v0.3.13'); - expect(chinese).toContain('V3 Beta / v0.3.13'); + expect(english).toContain('V3 Beta / v0.3.14'); + expect(chinese).toContain('V3 Beta / v0.3.14'); }); it('documents the cross-session boundary in both languages', async () => { diff --git a/website/docs.html b/website/docs.html index 40258b5..605447b 100644 --- a/website/docs.html +++ b/website/docs.html @@ -24,7 +24,7 @@
mancode - Documentation / v0.3.13 + Documentation / v0.3.14
@@ -98,9 +98,9 @@

Verify the installation

Files & privacy

mancode works locally, scans only the current project, and sends no telemetry. It deliberately does not rewrite your project's .gitignore, so your team—not the installer—decides which generated context belongs in version control.

- + - +
PathWhat it containsBefore committing
.mancode/schema.json
.mancode/shared/
.mancode/local/
V3 authority, project policy, sessions, workflow metadata, and local runtime records. Legacy state.json exists only after explicit --legacy initialization.Review workflow evidence and local records before sharing; raw host session keys are never persisted.
.mancode/schema.json
.mancode/shared/
.mancode/local/
Continuity authority, project policy, sessions, workflow metadata, and local runtime records. Legacy state.json exists only after explicit --legacy initialization.Review workflow evidence and local records before sharing; raw host session keys are never persisted.
.mancode/shared/context/project.json
.mancode/local/cache/style-tokens.json
Detected stack, validation commands, and local UI tokens.Inspect for internal project details and decide whether reproducibility justifies sharing.
.mancode/local/workflows/
.mancode/shared/workflows/
Requirements, plans, review and verification ledgers, reports, checkpoints, and summaries.Review carefully. Evidence and reports may contain sensitive data; shared workflows pass the V3 privacy boundary.
.mancode/local/workflows/
.mancode/shared/workflows/
Requirements, plans, review and verification ledgers, reports, checkpoints, and summaries.Review carefully. Evidence and reports may contain sensitive data; shared workflows pass the Continuity privacy boundary.
.mancode/shared/context/decisions/
.mancode/shared/team/
Confirmed decisions and durable coordination authority.Commit only information intentionally written for the team.
.claude/, .cursor/, .agents/, .github/, AGENTS.mdAdapter instructions, commands or prompts, skills, hooks, and managed blocks.Share when the adapter is part of the team's development workflow. Content outside mancode's managed blocks remains yours.
@@ -111,7 +111,7 @@

Files & privacy

Continue work across sessions

mancode stores goals, requirements, plans, validation results, and handoff notes under a stable TaskRef. A new chat window or supported CLI can resume the same task and load a purpose-specific Context Pack.

What is carried forward

This is task continuity, not a copy of raw chat history. Sessions from different clients remain isolated; the new session must identify its own client and explicitly resume the existing TaskRef.

-
$ mancode status --json
+          
$ mancode status --brief --json
 $ mancode context session new --client claude-code
 $ mancode context resume <namespace:ULID> --session <id> --client claude-code
 $ mancode context show --purpose orient --session <id> --client claude-code
@@ -169,21 +169,21 @@

CLI reference

mancode init

Start

Creates .mancode/, detects the project, scans style tokens where relevant, and installs adapters.

  • Options: --force, --yes, --team, --no-team, --style <name>, --platform <list>, --empty, --lang <locale>.

mancode install [platform]

Adapter

Installs or repairs an adapter after initialization. Omit the platform for interactive selection.

  • --force regenerates managed content.
  • --minimal installs solo-mode essentials only.
-

mancode status [--json]

Inspect

Reports project facts, current mode and workflow, adapter readiness, and Claude hook registration where applicable.

+

mancode status [--json] [--brief]

Inspect

Reports project facts, current mode and workflow, adapter readiness, and Claude hook registration where applicable. Combine --brief --json for the compact Continuity runtime view.

mancode list-platforms

Discover

Lists adapters known to the installed CLI and marks those already configured in the project.

-

mancode workflow <subcommand>

Govern

Creates and validates V3 requirements, plans, verification evidence, reviews, remediation, and completion.

  • Inspect with list and show <namespace:ULID> [--json].
  • Use context compact --dry-run to inspect removable runtime records; V3 workflow authority is not deleted by workflow clean.
+

mancode workflow <subcommand>

Govern

Creates and validates Continuity requirements, plans, verification evidence, reviews, remediation, and completion.

  • Inspect with list and show <namespace:ULID> [--json].
  • Use context compact --dry-run to inspect removable runtime records; Continuity workflow authority is not deleted by workflow clean.

mancode manps [area]

Scan

Runs a deterministic health scan for all, deps, security, dead-code, config.

  • --json emits machine-readable output.
  • --remediate enters the explicit remediation path; the default is scan-only.

mancode refresh-project

Rescan

Refreshes project facts after adding Git, a manifest, a framework, or validation commands, then updates installed static adapters.

mancode refresh-style

Design

Refreshes the project profile and design tokens. Reinstall static adapters with --force afterward.

-

mancode uninstall [platform]

Remove

Removes one V3 adapter. V3 protects authority from bulk removal; use context compact --dry-run for retention candidates. The --all form is legacy-only.

+

mancode uninstall [platform]

Remove

Removes one Continuity adapter. Continuity protects authority from bulk removal; use context compact --dry-run for retention candidates. The --all form is legacy-only.

mancode version

Version

Prints the installed CLI version for upgrade checks and issue reports.

Study the /man workflow

-

/man is a progressive nine-step protocol. It first makes the decision inspectable, then lets the user choose between a lightweight handoff, a plan-only result, or governed execution. Every gate is backed by V3 files under .mancode/<namespace>/workflows/<ULID>/.

-
Who runs these commands?

The installed V3 mode entry creates the task and reads its Context Pack. The commands below are the machine contract for studying, debugging, or integrating the process. V3 identifies tasks with explicit namespace:ULID TaskRefs and does not use a legacy active pointer.

+

/man is a progressive nine-step protocol. It first makes the decision inspectable, then lets the user choose between a lightweight handoff, a plan-only result, or governed execution. Every gate is backed by Continuity files under .mancode/<namespace>/workflows/<ULID>/.

+
Who runs these commands?

The installed Continuity mode entry creates the task and reads its Context Pack. The commands below are the machine contract for studying, debugging, or integrating the process. Continuity identifies tasks with explicit namespace:ULID TaskRefs and does not use a legacy active pointer.

The nine steps and their gates

@@ -239,8 +239,8 @@

The Step 4 decision

All three choices require an active man workflow, confirmed requirements, and plan.md. Revise the plan with workflow plan ... revise; every successful mutation returns the revision required by the next command.

-

A valid V3 sequence

-

V3 uses explicit TaskRefs and expected revisions. The CLI owns every durable mutation; do not edit metadata files or use the legacy --step protocol.

+

A valid Continuity sequence

+

Continuity uses explicit TaskRefs and expected revisions. The CLI owns every durable mutation; do not edit metadata files or use the legacy --step protocol.

# Bootstrap an actor and explicit session
 $ mancode team identity create --name "Your name"
 $ mancode context session new --client codex --json
@@ -262,7 +262,7 @@ 

A valid V3 sequence

Verification, manual checks, and remediation

StepAgent workDurable gate
- + @@ -279,8 +279,8 @@

Workflow subcommands

- - + +
CaseRequired recordGate behavior
AutomatedThe canonical verification ledger records the criterion, command, exit code, evidence summary, and result.workflow verify ... apply rejects a ledger that does not satisfy the V3 schema and current revision.
AutomatedThe canonical verification ledger records the criterion, command, exit code, evidence summary, and result.workflow verify ... apply rejects a ledger that does not satisfy the Continuity schema and current revision.
ManualThe ledger records why automation cannot decide and only changes to passed after explicit user confirmation.Completion remains blocked while required manual evidence is pending.
Review findingThe canonical review ledger stores stable blocker IDs and their remediation state.Applying a review ledger makes earlier verification stale; apply current verification after review and before completion.
User skips reviewThe review ledger records the explicit user decision and residual risk.Completion still requires a valid summary and every remaining gate.
planRevise a plan or confirm its execution decision.revise --file; confirm --plan-decision; both require revision and session.
updateChange lifecycle status or a blocking reason.--status --expected-revision --session; governed fields use dedicated commands.
handoffTransfer a confirmed local plan to solo and later close it.--to solo or --complete, with revision and session.
verify / reviewApply canonical V3 ledgers.apply --file --expected-revision --session.
list / show / cleanList or inspect V3 TaskRefs. clean is not a V3 authority deletion command.show <namespace:ULID> --json; use context compact --dry-run for retention.
verify / reviewApply canonical Continuity ledgers.apply --file --expected-revision --session.
list / show / cleanList or inspect Continuity TaskRefs. clean is not a Continuity authority deletion command.show <namespace:ULID> --json; use context compact --dry-run for retention.
@@ -307,7 +307,7 @@

Refresh project context

Uninstall safely

-

Uninstalling one adapter preserves user-authored rules, instructions, unrelated Claude settings, and V3 workflow authority. Use context compact --dry-run to inspect eligible runtime retention records.

+

Uninstalling one adapter preserves user-authored rules, instructions, unrelated Claude settings, and Continuity workflow authority. Use context compact --dry-run to inspect eligible runtime retention records.

Remove one adapter

$ mancode uninstall cursor --force

Reinstall one adapter

@@ -328,7 +328,7 @@

Claude Code hooks do not run

Cursor rules do not trigger

Confirm that .cursor/rules/mancode-*.mdc and .cursor/commands/*.md exist. Core context and solo rules are persistent; higher-intensity rules are description-triggered, so invoke the generated mode command explicitly.

A workflow command is rejected

-

Treat the rejection as a gate, not a file-corruption problem. Use mancode workflow list --json to discover TaskRefs, then mancode workflow show <namespace:ULID> --json to inspect metadata, revision, aggregate, and blockers. Do not edit V3 metadata manually.

+

Treat the rejection as a gate, not a file-corruption problem. Use mancode workflow list --json to discover TaskRefs, then mancode workflow show <namespace:ULID> --json to inspect metadata, revision, aggregate, and blockers. Do not edit Continuity metadata manually.

Project facts became stale

After adding Git, a manifest, dependencies, or validation scripts, run mancode refresh-project. Use refresh-style for UI tokens. Then repair a static adapter only if its generated files need regeneration.

diff --git a/website/docs.zh-CN.html b/website/docs.zh-CN.html index 0ca73be..0a6c3b0 100644 --- a/website/docs.zh-CN.html +++ b/website/docs.zh-CN.html @@ -24,7 +24,7 @@
mancode - 文档 / v0.3.14 + 文档 / v0.3.15