dsh-tower 2.0.3 → 2.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +141 -0
- package/COMPATIBILITY.md +38 -0
- package/CONTRIBUTING.md +150 -2
- package/README.en.md +59 -16
- package/README.md +57 -16
- package/SECURITY.md +31 -1
- package/adapters/default.js +10 -0
- package/adapters/store-fs.js +6 -0
- package/adapters/vcs-git.js +4 -0
- package/app/batch.js +79 -0
- package/app/board.js +25 -0
- package/app/checkCompletion.js +76 -0
- package/app/enrichedMissions.js +26 -0
- package/app/findings.js +78 -0
- package/app/gate.js +108 -0
- package/app/init.js +249 -0
- package/app/merge.js +567 -0
- package/app/messages.js +66 -0
- package/app/mission.js +35 -0
- package/app/missionContext.js +14 -0
- package/app/plan.js +42 -0
- package/app/provision.js +193 -0
- package/app/read.js +57 -0
- package/app/rebase.js +302 -0
- package/app/recording.js +72 -0
- package/app/review.js +145 -0
- package/app/roster.js +123 -0
- package/app/spawn.js +125 -0
- package/app/teardown.js +184 -0
- package/app/tower.js +524 -0
- package/cordis.patch.yml +61 -53
- package/docs/README.md +33 -1
- package/docs/architecture/overview.md +114 -14
- package/docs/board.md +72 -0
- package/docs/examples/first-mission.md +2 -1
- package/docs/faq.md +11 -7
- package/docs/guide/hot-reload.md +1 -1
- package/docs/guide/install-upgrade-migration.md +22 -6
- package/docs/guide/quickstart.md +12 -7
- package/docs/guide/release.md +125 -0
- package/docs/guide/scenarios-and-philosophy.md +86 -69
- package/docs/operations/security.md +65 -14
- package/docs/reference/blockers.md +11 -10
- package/docs/reference/config.generated.md +66 -0
- package/docs/reference/config.md +11 -7
- package/docs/reference/errors.generated.md +39 -0
- package/docs/reference/errors.md +10 -2
- package/docs/reference/events.md +7 -4
- package/docs/reference/testing.md +2 -1
- package/docs/reference/tools.generated.md +33 -0
- package/docs/reference/tools.md +8 -7
- package/docs/zh/README.md +4 -3
- package/docs/zh/faq.md +9 -6
- package/docs/zh/guide/hot-reload.md +1 -1
- package/docs/zh/guide/install-upgrade-migration.md +17 -5
- package/docs/zh/guide/quickstart.md +13 -8
- package/docs/zh/guide/scenarios-and-philosophy.md +55 -50
- package/docs/zh/operations/security.md +43 -7
- package/docs/zh/reference/blockers.md +10 -10
- package/docs/zh/reference/config.md +11 -7
- package/docs/zh/reference/errors.md +4 -1
- package/docs/zh/reference/events.md +6 -3
- package/docs/zh/reference/testing.md +3 -2
- package/docs/zh/reference/tools.md +8 -7
- package/domain/collab/batch.js +112 -0
- package/domain/collab/messages.js +127 -0
- package/domain/collab/roster.js +158 -0
- package/domain/collab/spawn.js +188 -0
- package/domain/config/schema.js +404 -0
- package/domain/contracts/outputs.js +279 -0
- package/domain/contracts/tool-inputs/collaboration.js +58 -0
- package/domain/contracts/tool-inputs/findings.js +29 -0
- package/domain/contracts/tool-inputs/index.js +94 -0
- package/domain/contracts/tool-inputs/integration.js +37 -0
- package/domain/contracts/tool-inputs/missions.js +94 -0
- package/domain/contracts/tool-inputs/ops.js +75 -0
- package/domain/contracts/tool-inputs/shared.js +25 -0
- package/domain/errors.js +96 -0
- package/domain/gate.js +125 -0
- package/domain/integration/gate.js +176 -0
- package/domain/integration/init.js +225 -0
- package/domain/integration/liveness.js +31 -0
- package/domain/integration/merge.js +377 -0
- package/domain/integration/provision.js +124 -0
- package/domain/integration/rebase.js +236 -0
- package/domain/integration/review.js +52 -0
- package/domain/integration/teardown.js +118 -0
- package/domain/mission.js +68 -0
- package/domain/missions/completion.js +114 -0
- package/domain/missions/findings.js +201 -0
- package/domain/missions/lifecycle.js +185 -0
- package/domain/missions/plan.js +149 -0
- package/domain/missions/review.js +179 -0
- package/domain/planning.js +118 -0
- package/domain/read/enrichedMissions.js +58 -0
- package/domain/read/missionContext.js +53 -0
- package/domain/read/views.js +128 -0
- package/domain/report.js +59 -0
- package/domain/roster.js +40 -0
- package/domain/scope.js +105 -0
- package/domain/state/schema.js +233 -0
- package/domain/state/semantics.js +117 -0
- package/domain/state.js +33 -0
- package/domain/summary.js +114 -0
- package/domain/vocabulary.js +179 -0
- package/index.js +86 -34
- package/lib/briefing.js +176 -0
- package/lib/compatibility.js +108 -0
- package/lib/config.js +54 -302
- package/lib/doctor.js +108 -9
- package/lib/git.js +93 -15
- package/lib/hmr.js +4 -3
- package/lib/leases.js +3 -2
- package/lib/legacy.js +20 -9
- package/lib/modeState.js +39 -0
- package/lib/modeStore.js +35 -33
- package/lib/persistence.js +349 -0
- package/lib/presets.js +35 -0
- package/lib/spawn-prechecks.js +168 -0
- package/lib/spawn-support.js +79 -0
- package/lib/store.js +57 -85
- package/lib/tests.js +46 -11
- package/lib/tool-registry.js +544 -0
- package/lib/workspaceLock.js +46 -22
- package/lib/worktreeOwnership.js +5 -4
- package/locale/en.json +23 -1
- package/locale/zh.json +22 -0
- package/package.json +33 -4
- package/ports/clock.js +6 -0
- package/ports/ids.js +7 -0
- package/ports/index.js +2 -0
- package/ports/store.js +11 -0
- package/ports/vcs.js +11 -0
- package/scripts/architecture.mjs +94 -0
- package/scripts/check-docs.mjs +44 -3
- package/scripts/check-pack.mjs +49 -0
- package/scripts/domain-metrics.mjs +48 -0
- package/scripts/generate-config-reference.mjs +46 -0
- package/scripts/generate-error-reference.mjs +29 -0
- package/scripts/generate-tools-reference.mjs +56 -0
- package/scripts/issue-audit.mjs +259 -0
- package/scripts/lib/cli.mjs +76 -0
- package/scripts/lib/tmp.mjs +20 -0
- package/scripts/mount-smoke/fixtures.mjs +162 -0
- package/scripts/mount-smoke/host.json +4 -0
- package/scripts/mount-smoke/probe.mjs +125 -0
- package/scripts/mount-smoke/surface.mjs +141 -0
- package/scripts/mount-smoke.mjs +270 -0
- package/scripts/pack-manifest.txt +203 -0
- package/scripts/release-check.mjs +303 -0
- package/skills/tower-recovery.md +7 -5
- package/tools/adopt.js +72 -0
- package/tools/batch.js +78 -0
- package/tools/complete.js +53 -0
- package/tools/diff.js +39 -0
- package/tools/doctor.js +50 -0
- package/tools/finding.js +40 -0
- package/tools/findings.js +39 -0
- package/tools/import-legacy.js +42 -0
- package/tools/inbox.js +39 -0
- package/tools/index.js +39 -0
- package/tools/init.js +63 -0
- package/tools/interrupt.js +42 -0
- package/tools/legacy-map.js +44 -0
- package/tools/merge.js +39 -0
- package/tools/mission.js +41 -0
- package/tools/plan.js +39 -0
- package/tools/preflight.js +44 -0
- package/tools/rebase.js +39 -0
- package/tools/recover.js +45 -0
- package/tools/reload.js +52 -0
- package/tools/resource.js +54 -0
- package/tools/review.js +45 -0
- package/tools/roster.js +60 -0
- package/tools/send.js +147 -0
- package/tools/spawn.js +196 -0
- package/tools/status.js +94 -0
- package/tools/teardown.js +42 -0
- package/tools/test.js +61 -0
- package/types/cordis.d.ts +6 -0
- package/types/index.d.ts +339 -0
- package/ui-bundle/README.md +111 -0
- package/ui-bundle/client.js +1980 -0
- package/ui-bundle/cordis.patch.yml +3 -0
- package/ui-bundle/icon.svg +6 -0
- package/ui-bundle/index.js +2 -0
- package/ui-bundle/locale/en.json +6 -0
- package/ui-bundle/locale/zh.json +6 -0
- package/ui-bundle/package.json +35 -0
- package/lib/errors.js +0 -111
- package/lib/tools.js +0 -2250
- package/lib/tower.js +0 -2689
- /package/{lib → domain}/batch.js +0 -0
package/docs/reference/config.md
CHANGED
|
@@ -22,7 +22,7 @@ win, profile keys survive when the repo does not set them. `tower_status` report
|
|
|
22
22
|
|
|
23
23
|
```json
|
|
24
24
|
{
|
|
25
|
-
"review": { "maxRoundsPerReviewer": 3 },
|
|
25
|
+
"review": { "requireReview": true, "maxRoundsPerReviewer": 3 },
|
|
26
26
|
"merge": { "timeoutMs": 1800000 },
|
|
27
27
|
"worktrees": { "root": "D:/tower-worktrees" },
|
|
28
28
|
"spawn": { "reviewerPreset": "tower-reviewer", "maxDepth": 2 }
|
|
@@ -38,14 +38,16 @@ violates the declared schema (for example `merge.timeoutMs` below 1000) fail wit
|
|
|
38
38
|
| Key | Default | Meaning |
|
|
39
39
|
|---|---|---|
|
|
40
40
|
| `section` | `''` | Legacy alias: replace the whole Tower-mode prompt text. Empty keeps the built-in reminder. |
|
|
41
|
-
| `allowAgentControl` | `
|
|
41
|
+
| `allowAgentControl` | `true` (alias of `mode.allowAgentControl`) | Legacy alias: register `tower_control` so the model may toggle the mode. |
|
|
42
42
|
| `init.autoGitInit` | `false` (bundled patch: `true`) | `tower_init` may run `git init` + an empty initial commit when `repoRoot` is an absolute, existing directory that is not a repository. |
|
|
43
43
|
| `init.snapshotDirty` | `false` | `tower_init` may snapshot uncommitted **tracked** changes into a dangling commit used as the mission baseline (untracked files are not included; the commit is kept alive under `refs/tower/snapshot/*`). |
|
|
44
|
+
| `init.autoExclude` | `true` | Append in-repo artifacts (`MISSIONS.md`, in-repo worktree roots) to `.git/info/exclude`; never touches `.gitignore`. |
|
|
44
45
|
| `mode.promptSection` | `''` | Replacement prompt text (takes precedence over `section` when both set). |
|
|
45
46
|
| `mode.sectionAppend` | `''` | Extra text appended after the reminder (team conventions). |
|
|
46
|
-
| `mode.allowAgentControl` | `
|
|
47
|
+
| `mode.allowAgentControl` | `true` | Register `tower_control`; the model may enter/leave with a reason. Set `false` for human-only mode control. |
|
|
47
48
|
| `mode.autoPauseGoal` | `true` | Pause an active goal on entry; the goal is never auto-resumed on exit. |
|
|
48
49
|
| `mode.requireResumeAuthorization` | `false` | Resuming a mission paused with `pauseCause:user` requires an `authorization` reference. |
|
|
50
|
+
| `mode.requireHumanAckOnFirstEntry` | `false` | Require a human `/tower ack` before the model may make the first Tower-mode entry in a session. |
|
|
49
51
|
| `mode.workspaceLock` | `false` (bundled patch: `true`) | Allow only one Tower session per repository (`tower.lock`); others get `workspace-busy`. |
|
|
50
52
|
| `mode.workspaceLockScope` | `all` | `all` locks every repo tool; `mutations` skips the workspace lock for read-only tools. |
|
|
51
53
|
| `mode.planModePolicy` | `clear` | Tower entry clears an active plan mode (or `refuse` until the plan is exited); a pre-step also clears a plan activated later. |
|
|
@@ -58,6 +60,7 @@ violates the declared schema (for example `merge.timeoutMs` below 1000) fail wit
|
|
|
58
60
|
| `review.maxRoundsPerReviewer` | `5` | Review-round cap per reviewer per branch. |
|
|
59
61
|
| `merge.timeoutMs` | `900000` (15 min) | Default `tower_merge` timeout, including hooks. A per-call `timeoutMs` wins. |
|
|
60
62
|
| `merge.maxBufferBytes` | `67108864` (64 MB) | Merge output buffer. |
|
|
63
|
+
| `git.timeoutMs` | `15000` | Default timeout for Git commands other than merge; merge uses `merge.timeoutMs`. |
|
|
61
64
|
| `worktrees.root` | `''` | Default worktree parent; empty derives `<checkout parent>/.dsh-tower-worktrees/<hash>`. |
|
|
62
65
|
| `spawn.workerPreset` | `tower-worker` | Preset used for `role=worker`. |
|
|
63
66
|
| `spawn.reviewerPreset` | `tower-reviewer` | Preset used for `role=reviewer`. |
|
|
@@ -72,20 +75,21 @@ violates the declared schema (for example `merge.timeoutMs` below 1000) fail wit
|
|
|
72
75
|
| `send.maxPerMinute` | `120` | Per-repository `tower_send` rate limit (0 disables); exceeding it returns `rate-limited`. |
|
|
73
76
|
| `send.interruptDefault` | `false` (bundled patch: `true`) | Default for `tower_send.interrupt` (interrupt the running turn before delivering). |
|
|
74
77
|
| `tests.enabled` | `true` | Run declared test discovery when the worktree `package.json` configures it. |
|
|
75
|
-
| `tests.admission` | `
|
|
78
|
+
| `tests.admission` | `off` | `spawn` runs discovery before starting a worker, `complete` at `tower_complete`, `off` only on explicit `tower_test` (default; repository code is not executed automatically). |
|
|
76
79
|
| `tests.timeoutMs` | `60000` | Per discovery command timeout. |
|
|
77
80
|
| `tests.maxBytes` | `16777216` (16 MiB) | Captured stdout cap per command. |
|
|
78
81
|
| `tests.autoChecks` | `true` | Attach an automatic `tests` check to the completion report. |
|
|
79
82
|
| `tests.allowPackageDiscovery` | `true` | Allow repo-controlled `tower.testDiscovery` commands (executes worktree code; see security). |
|
|
80
83
|
| `gates.requireChecks` | `false` | Require at least one `tower_complete.checks` entry before merge (`no-check-evidence`). |
|
|
81
|
-
| `gates.requireTests` | `false` | Require a passing discovery receipt for the
|
|
82
|
-
| `gates.allowReviewExemption` | `false` |
|
|
84
|
+
| `gates.requireTests` | `false` | Require a passing discovery receipt for the current mission branch tip (`tests-missing`); independent of the review gate. |
|
|
85
|
+
| `gates.allowReviewExemption` | `false` | With `review.requireReview:true`, allow `reviewPolicy:"none"` + a non-empty reason to skip review blockers. Off deliberately; irrelevant while the global review gate is off. |
|
|
83
86
|
| `docs.board` | `true` | Write `MISSIONS.md` after mutations. |
|
|
84
87
|
| `docs.boardLocation` | `common` | `common` = `<git-common-dir>/dsh-tower/MISSIONS.md`; `repo` = `<repoRoot>/MISSIONS.md`. |
|
|
88
|
+
| `tools.exposeOperational` | `true` | Register batch/resource/import/legacy/recover/test/doctor tools; `false` shrinks the fixed tool-schema context. |
|
|
85
89
|
| `leases.ttlMs` | `900000` | Default advisory lease lifetime; expiry never auto-releases. |
|
|
86
90
|
| `dev.hotReload` | `true` | Register `tower_reload`; `/tower reload` is disabled when off. It returns `reload-unavailable` when the profile has no HMR service. |
|
|
87
91
|
| `dev.reloadDelayMs` | `50` | Delay before a scheduled reload so the tool result is delivered first. |
|
|
88
|
-
| `dev.reloadRequiredIds` |
|
|
92
|
+
| `dev.reloadRequiredIds` | five Tower loader ids | Entry ids passed to `reconcileProfile` as required. |
|
|
89
93
|
|
|
90
94
|
## Example
|
|
91
95
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Error code catalog (generated)
|
|
2
|
+
|
|
3
|
+
> Generated by `npm run docs:generate:errors` from `domain/errors.js`. Do not edit by hand.
|
|
4
|
+
|
|
5
|
+
| Code | Description |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `invalid-argument` | A tool argument is missing, malformed, or not allowed. |
|
|
8
|
+
| `repo-invalid` | repoRoot is missing, relative, or not inside a Git repository. |
|
|
9
|
+
| `not-initialized` | Tower is not initialized for this repository; run tower_init. |
|
|
10
|
+
| `mission-not-found` | No mission with that id exists. |
|
|
11
|
+
| `finding-not-found` | No finding with that id exists. |
|
|
12
|
+
| `invalid-transition` | The requested state transition is not allowed. |
|
|
13
|
+
| `stale-base` | The repository state changed while the operation was being prepared; retry. |
|
|
14
|
+
| `state-locked` | Another Tower writer holds the state lock. |
|
|
15
|
+
| `state-corrupt` | The Tower state file is unreadable or invalid. |
|
|
16
|
+
| `config-invalid` | Tower configuration is invalid. |
|
|
17
|
+
| `config-unknown-key` | Tower configuration has an unknown top-level key. |
|
|
18
|
+
| `git-failed` | A git command failed. |
|
|
19
|
+
| `git-timeout` | A git command timed out or exceeded its output buffer. |
|
|
20
|
+
| `worktree-dirty` | The mission worktree has uncommitted changes and cannot complete. |
|
|
21
|
+
| `spawn-unavailable` | The subagents service is unavailable. |
|
|
22
|
+
| `provider-missing` | No subagent provider is registered. |
|
|
23
|
+
| `provider-cooldown` | The provider is throttled; spawn is in a short cooldown. |
|
|
24
|
+
| `preset-missing` | The configured agent preset is not registered. |
|
|
25
|
+
| `reviewer-prerequisite` | The reviewer spawn prerequisite is not met. |
|
|
26
|
+
| `not-authorized` | The calling agent role may not perform this action. |
|
|
27
|
+
| `workspace-busy` | Another Tower session owns this repository workspace lock. |
|
|
28
|
+
| `worker-limit` | The repository reached spawn.maxLiveWorkers live workers. |
|
|
29
|
+
| `rate-limited` | The tower_send per-minute rate limit was reached. |
|
|
30
|
+
| `takeover-refused` | The mission already has a live worker that was not stopped first. |
|
|
31
|
+
| `reload-unavailable` | The DSH HMR service is not available in this profile. |
|
|
32
|
+
| `reload-failed` | The HMR reload failed; check the DSH log and restart if needed. |
|
|
33
|
+
| `tests-failed` | Declared test discovery failed or did not meet its admission requirements. |
|
|
34
|
+
| `tests-timeout` | Test discovery exceeded its time or output budget. |
|
|
35
|
+
| `lease-busy` | Another holder owns the requested advisory lease. |
|
|
36
|
+
| `lease-token` | The lease release token does not match the current holder. |
|
|
37
|
+
| `batch-invalid` | The batch request or its close evidence is invalid. |
|
|
38
|
+
| `legacy-invalid` | The legacy snapshot or mapping is invalid. |
|
|
39
|
+
| `tool-internal` | An unexpected failure; read the message and the activity log. |
|
package/docs/reference/errors.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
# Tool error codes
|
|
2
2
|
|
|
3
3
|
Tool failures are thrown errors, not `{ok:false}` results (gate outcomes are the exception: see
|
|
4
|
-
[blockers.md](blockers.md)). Every thrown error carries a stable code as a message prefix
|
|
4
|
+
[blockers.md](blockers.md)). Every thrown error carries a stable code as a message prefix. This
|
|
5
|
+
release defines 33 tool error codes.
|
|
6
|
+
|
|
7
|
+
Every `TowerToolError` also carries `retryable` (boolean), `nextAction` (string or `null`) and `details`
|
|
8
|
+
(structured context or `null`) for programmatic callers; the message prefix remains the stable contract
|
|
9
|
+
for text-only clients.
|
|
5
10
|
|
|
6
11
|
```
|
|
7
12
|
[tower:mission-not-found] unknown mission "M9"
|
|
8
13
|
```
|
|
9
14
|
|
|
10
15
|
Callers can match the prefix instead of the prose. Codes are reserved for the conditions below; a
|
|
11
|
-
|
|
16
|
+
plain `Error` without a structured code is reported as `tool-internal`.
|
|
12
17
|
|
|
13
18
|
| Code | Meaning | Typical trigger |
|
|
14
19
|
|---|---|---|
|
|
@@ -18,6 +23,8 @@ message without a more specific match is reported as `tool-internal`.
|
|
|
18
23
|
| `mission-not-found` | No mission with that id exists. | a stale or mistyped `M9` |
|
|
19
24
|
| `finding-not-found` | No finding with that id exists. | `tower_findings({id:"F99"})` |
|
|
20
25
|
| `invalid-transition` | The requested state transition is not allowed. | a blocked→merged attempt; a finding transition not in the graph; a reviewer mutating findings; completing a mission with open tasks, blockers, no commits, or unread inbox messages. |
|
|
26
|
+
| `stale-base` | The repository state changed while the operation was being prepared; retry. | two-phase mutation revalidation |
|
|
27
|
+
| `worktree-dirty` | The mission worktree has uncommitted changes and cannot complete. | staged, modified, or untracked files left behind before `tower_complete` |
|
|
21
28
|
| `state-locked` | Another Tower writer holds the state lock. | concurrent mutation after the lock timeout |
|
|
22
29
|
| `state-corrupt` | The Tower state file is unreadable or invalid. | hand-edited `state.json` |
|
|
23
30
|
| `config-invalid` | Tower configuration is invalid. | malformed repo `config.json`, a value that violates the schema |
|
|
@@ -26,6 +33,7 @@ message without a more specific match is reported as `tool-internal`.
|
|
|
26
33
|
| `git-timeout` | A git command timed out or exceeded its output buffer. | slow pre-merge hook, huge diff |
|
|
27
34
|
| `spawn-unavailable` | The subagents service is unavailable. | a Host without `subagents` |
|
|
28
35
|
| `provider-missing` | No subagent provider is registered. | an empty provider list |
|
|
36
|
+
| `provider-cooldown` | spawn is in a short cooldown after repeated retryable provider failures. | wait for `blockedUntil`, then retry |
|
|
29
37
|
| `preset-missing` | The configured agent preset is not registered. | missing `tower-worker`/`tower-reviewer` preset rows, DSH not restarted |
|
|
30
38
|
| `reviewer-prerequisite` | The reviewer spawn prerequisite is not met. | reviewer spawned before the mission is `completed`, or before a worktree exists |
|
|
31
39
|
| `not-authorized` | The calling agent role may not perform this action. | a worker calling a tower-only tool or changing mission status/scope; a reviewer mutating findings |
|
package/docs/reference/events.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Tower events
|
|
2
2
|
|
|
3
3
|
Tower emits process-local Cordis events after successful tool calls (mutations and read-only tools), so
|
|
4
|
-
other plugins can observe a repository without polling.
|
|
5
|
-
no telemetry.
|
|
4
|
+
other plugins can observe a repository without polling. This release emits 29 process-local events.
|
|
5
|
+
Events are **not** sent over the network and carry no telemetry.
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
8
|
ctx.on('tower/merge', (payload) => {
|
|
@@ -32,14 +32,17 @@ ctx.on('tower/merge', (payload) => {
|
|
|
32
32
|
| `tower/status` | `tower_status` read the dashboard |
|
|
33
33
|
| `tower/preflight` | `tower_preflight` evaluated the gate |
|
|
34
34
|
| `tower/doctor` | `tower_doctor` completed its read-only checks |
|
|
35
|
+
| `tower/recover` | `tower_recover` inspected or cleared a stale state lock |
|
|
35
36
|
| `tower/test` | `tower_test` ran discovery |
|
|
36
37
|
| `tower/batch` | `tower_batch` created, inspected or closed a batch |
|
|
37
38
|
| `tower/resource` | `tower_resource` acquired/released/inspected leases |
|
|
38
39
|
| `tower/import_legacy` | `tower_import_legacy` stored a legacy snapshot |
|
|
39
40
|
| `tower/legacy_map` | `tower_legacy_map` mapped or listed legacy ids |
|
|
41
|
+
| `tower/mode` | `tower_mode` read/changed the session stance (`value.mode`, `allowAgentControl`, `deniedWhileActive`) |
|
|
42
|
+
| `tower/control` | `tower_control` entered/left the mode (`value.mode`, actor/reason in `value`) |
|
|
43
|
+
| `tower/reload` | `tower_reload` returned a reload schedule/result |
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
`{tool, repoRoot, value}`. Listener exceptions never affect the tool result.
|
|
45
|
+
Payloads are JSON: `{tool, repoRoot, value}`. Listener exceptions never affect the tool result.
|
|
43
46
|
|
|
44
47
|
For a durable audit trail use `<git-common-dir>/dsh-tower/activity.jsonl` and `MISSIONS.md` instead;
|
|
45
48
|
events are process-local and are not replayed.
|
|
@@ -50,7 +50,8 @@ discovery fails.
|
|
|
50
50
|
- `tower_test({repoRoot,missionId})` runs discovery on demand and records a receipt.
|
|
51
51
|
- `tower_complete` adds a `tests` check when `tests.autoChecks` is on.
|
|
52
52
|
- `gates.requireChecks` requires any completion check; `gates.requireTests` requires a passing receipt
|
|
53
|
-
for the
|
|
53
|
+
for the current mission branch tip (`tests-missing`). Review is independent of this gate: with
|
|
54
|
+
`review.requireReview:false` the tests gate still checks the branch tip.
|
|
54
55
|
|
|
55
56
|
## Trust boundary
|
|
56
57
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tools overview (generated)
|
|
2
|
+
|
|
3
|
+
> Generated by `npm run docs:generate:tools` from the registered tool definitions. Do not edit by hand.
|
|
4
|
+
|
|
5
|
+
| Tool | Description |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `tower_adopt` | Reconcile the roster with the durable subagent catalog after a restart or new session. Agents that are provably gone are marked retired (records are kept) or missing (retireMissing:false, so the tower can inspect/take over); agents whose parent catalog cannot be read stay unknown and are never changed. Only the tower may adopt. |
|
|
8
|
+
| `tower_batch` | Manage finite evidence batches: create freezes missionIds/requiredChecks/receiptPaths, status summarizes members, close verifies every required check and receipt hash, abandon retires a stale open batch. Membership and exclusions are immutable after create; close/abandon never remove missions. |
|
|
9
|
+
| `tower_complete` | Worker-only: report mission completion. Enforced by the store: every task done or dropped, no blockers, the current owner, the mission branch has at least one commit since its spawn base, and no unread inbox messages. checks records verifiable evidence (name/command/exitCode/evidence); gates.requireChecks can require at least one before merge. Stores the full report; completion means ready for preflight and optional review, not merged. |
|
|
10
|
+
| `tower_diff` | Read-only view of a mission branch for review: merge base, changed files, commits, and a capped patch against the recorded base. Safe for reviewers; it never modifies the repository. |
|
|
11
|
+
| `tower_doctor` | Read-only environment and repository health check: git, state schema, config, presets/subagents/HMR, workspace lock, roster staleness, worktree ownership, test discovery, leases. Returns checks with pass/warn/fail and an environment contract. Never writes state. |
|
|
12
|
+
| `tower_finding` | File a structured finding (bug / improve / vuln / idea) for the tower to route. Use this for anything notable OUTSIDE your mission scope instead of editing out-of-scope files. Severity is one of low|medium|high|critical. Use tower_findings to list, read, or close findings later. |
|
|
13
|
+
| `tower_findings` | List, read, or update findings for a repository. Without id it lists findings newest-first with counts by status (filters: status, type, severity, missionId, open, limit). With id it returns that finding; with id plus status and/or note it records a lifecycle transition. Statuses are open -> triaged -> fixed|wontfix, and fixed/wontfix can be reopened to open. Only the tower or a worker may change a finding; reviewers may only list and read. Read-only when no id is given. |
|
|
14
|
+
| `tower_import_legacy` | Read-only import of a Tower Codex (schemaVersion 1) or DSH legacy state file. Stores the full payload under <common>/dsh-tower/legacy/<sha256>.json and records only a summary in state.legacySnapshots; never activates, adopts, or resumes paused missions. |
|
|
15
|
+
| `tower_inbox` | Read your tower inbox: messages addressed to you plus broadcasts, newest first. Only returned messages are acknowledged; the result reports unreadRemaining, so keep reading until it reaches 0. Set include_read for history. Unread messages block tower_complete. |
|
|
16
|
+
| `tower_init` | Initialize Tower mission state for a repository (absolute repoRoot). Creates <git-common-dir>/dsh-tower/state.json and an activity log; idempotent on an existing workspace. Options: autoGitInit (git init + empty initial commit when the directory is not a repository), snapshotDirty (snapshot uncommitted work into a dangling commit used as the mission baseline), reanchor (change base when every mission is merged/abandoned). Only the tower may initialize. |
|
|
17
|
+
| `tower_interrupt` | Interrupt one running tower roster agent (worker or reviewer) and record it as interrupted in the roster. Only the tower may interrupt. Idempotent: an agent that is not running returns interrupted:false. Use it before takeover after a runaway worker, or to stop work that is no longer wanted. |
|
|
18
|
+
| `tower_legacy_map` | Audit-only mapping between a legacy snapshot id and a current mission. map records sourceHash/oldId/newMissionId; status lists mappings. Mapping never adopts or resumes a legacy mission. |
|
|
19
|
+
| `tower_merge` | Merge a mission branch into the recorded base branch with --no-ff, after the hard gate passes. Verifies the two merge parents and records the mission as merged. If the merge commit already landed (manual merge, crashed or slow pre-merge hook), it detects the merge commit and records it as reconciled instead of merging again. A failed gate returns stable blocker codes without merging; a hook failure aborts cleanly and returns "merge-hook-failed" while a real content conflict returns "merge-conflict". |
|
|
20
|
+
| `tower_mission` | Update one mission: lifecycle status, decision note, blocker, clear blockers, mark a task done, drop a task with a reason, or widen the scope (tower only). "merged" is never set here; only a future tower_merge records it. Merged and abandoned are terminal. |
|
|
21
|
+
| `tower_plan` | Plan one or more missions in an initialized repository. Each mission has a printable-ASCII title, relative scope globs, optional task checklist, optional mission-id dependencies, and kind build|survey. Assigns M1.. ids and auto-adds a dependency when build scopes overlap (serializes merges); rejects dependency cycles. |
|
|
22
|
+
| `tower_preflight` | Read-only merge gate for one mission: returns ok plus stable blocker codes (branch-missing, deps-unmerged, read-only-survey, stale-base, out-of-scope, base-dirty, branch-owned-by-closed-missions, and mission/worker guards). Review blockers (no-review, review-hold, not-clean, review-not-approved, tip-moved, review-mission-mismatch) apply only when review.requireReview is on. Never changes anything. |
|
|
23
|
+
| `tower_rebase` | Rebase a mission branch onto the current base tip inside its own worktree. Refuses while its worker is running or the worktree is dirty. A clean conflict-free rebase waives re-review for the old review; a conflict is aborted and the mission is marked blocked. If the branch is already contained in the base, it returns alreadyMerged and leaves the branch untouched so tower_merge can record the landed merge. |
|
|
24
|
+
| `tower_recover` | Read-only recovery diagnostics and an explicit stale-state-lock repair. status reports the state lock owner; clear-stale-lock requires confirm:"CLEAR_STALE_LOCK" and only moves a lock whose PID is provably dead to a backup file. It never resets Tower state or worktrees. |
|
|
25
|
+
| `tower_reload` | Dev-only: ask DSH HMR to reconcile this profile and reload the Tower Host plugin from disk. The reload is scheduled a few milliseconds after this call returns (so the result reaches the model first). Use after editing the plugin source in a linked profile; plugin_manager install/update already triggers reconciliation by itself. Registered while dev.hotReload is on; fails with reload-unavailable when the HMR service is absent. |
|
|
26
|
+
| `tower_resource` | Advisory resource leases per repository (coordination only; no OS CPU/memory hard cap). acquire/release require a token and are tower-only; status is read-only. Expired leases are never taken over silently. |
|
|
27
|
+
| `tower_review` | Submit an independent review verdict for a completed mission, bound to the current branch tip. status is "clean", "p1-Nitems", or "p2-Nitems"; merge is "merge", "fix-then-merge", or "hold" (only clean + merge is later approval). Non-clean returns the mission to active. Reviewers are capped at 5 rounds per branch; a tower-submitted review is break-glass and requires breakGlassReason. |
|
|
28
|
+
| `tower_roster` | List tower roster agents with authoritative live activity from the subagent catalog (running/inactive/missing/unknown). Read-only; never resumes children. Use before completion or merge decisions. |
|
|
29
|
+
| `tower_send` | Send a durable inbox message to a tower participant: a roster agent name, "tower", or "all" (broadcast). The message is persisted first; when the recipient is a currently running roster agent the tower also steers it into that child's current turn. Returns delivery results. |
|
|
30
|
+
| `tower_spawn` | Spawn a worker or reviewer for a mission. Workers use the tower-worker preset; reviewers require a completed mission and use the read-only tower-reviewer preset. Provisions (or reuses) the mission git worktree and branch, generates a self-contained briefing, and starts a background subagent in that worktree. The child final report is delivered back to this session; tower_roster shows authoritative activity. Records the agent in the roster; reviewer spawns record the branch tip so a reviewer that modifies the branch cannot submit a review. Returns immediately unless wait=true. |
|
|
31
|
+
| `tower_status` | Read the Tower dashboard for a repository: state path, base branch, revision, mission status counts, paged mission summaries (scope/deps/tasks/worktree/owner), roster size, findings, config path and the activity tail. Pass missionId for one full mission (tasks, notes, reviews, findings, completion report); offset/limit page the mission list (default 20, max 100); includeGate adds preflight gate digests for the page; format:"markdown" returns the human-readable mission board. Read-only. |
|
|
32
|
+
| `tower_teardown` | Tear down eligible mission worktrees after their missions are merged or abandoned. A worktree whose roster agent is running is always kept (force cannot override); dirty worktrees need force; exclude keeps named missions. dry_run previews the remove/keep decisions without changing anything. |
|
|
33
|
+
| `tower_test` | Run the mission worktree's declared tower.testDiscovery (package.json) and record the receipt. Returns ok:false with diagnostics when discovery fails; does not change mission status. Use tower_complete for automatic admission checks. |
|
package/docs/reference/tools.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Tools reference
|
|
2
2
|
|
|
3
3
|
All tools take `repoRoot` (an absolute path inside the target Git repository) and return JSON.
|
|
4
|
-
The build exposes up to
|
|
5
|
-
`tower_mode`, `tower_control`
|
|
4
|
+
The build exposes up to 29 tools: 19 core repository tools below (including `tower_interrupt`),
|
|
5
|
+
`tower_mode`, `tower_control` (registered by default; set `mode.allowAgentControl:false` to disable),
|
|
6
6
|
`tower_reload` while `dev.hotReload` is on, and the 2.1 verification/ops tools `tower_doctor`,
|
|
7
|
-
`tower_test`, `tower_batch`, `tower_resource`, `tower_import_legacy`, `tower_legacy_map`.
|
|
7
|
+
`tower_recover`, `tower_test`, `tower_batch`, `tower_resource`, `tower_import_legacy`, `tower_legacy_map`.
|
|
8
8
|
|
|
9
9
|
`tower_mission` uses `id` (alias `missionId`); every other mission-scoped tool uses `missionId`
|
|
10
10
|
(alias `id`). Other input aliases: `task_done`/`taskDone`, `task_drop`/`taskDrop`,
|
|
@@ -31,16 +31,16 @@ findings but not mutate them. Violations throw `[tower:not-authorized]` or
|
|
|
31
31
|
| Tool | Parameters | Purpose / notes |
|
|
32
32
|
|---|---|---|
|
|
33
33
|
| `tower_init` | `base?`, `autoGitInit?`, `snapshotDirty?`, `reanchor?` | Create `<git-common-dir>/dsh-tower/state.json`. `autoGitInit` runs `git init` + empty initial commit; `snapshotDirty` records a dangling snapshot commit of uncommitted tracked changes used as the mission baseline; `reanchor` changes base only when no non-terminal mission exists. Returns `dirty`, `snapshotCommit`, `reanchored`. |
|
|
34
|
-
| `tower_plan` | `missions[]` (`title`, `scope[]`, `tasks[]?`, `deps[]?`, `kind?`, `context?`, `references[]?` ≤20, `reviewPolicy?`, `reviewExemptionReason?`) | Create missions `M1..`; overlapping build scopes auto-add a dependency; rejects unknown deps and cycles. `reviewPolicy:"none"` requires a reason
|
|
34
|
+
| `tower_plan` | `missions[]` (`title`, `scope[]`, `tasks[]?`, `deps[]?`, `kind?`, `context?`, `references[]?` ≤20, `reviewPolicy?`, `reviewExemptionReason?`) | Create missions `M1..`; overlapping build scopes auto-add a dependency; rejects unknown deps and cycles. `reviewPolicy:"none"` requires a non-empty reason; when the review gate is on, preflight also requires `gates.allowReviewExemption`. |
|
|
35
35
|
| `tower_mission` | `id` (alias `missionId`), `status?`, `task_done?`, `task_drop?`+`task_drop_reason?`, `blocker?`, `clear_blockers?`, `note?`, `scope?`, `pause_cause?`, `authorization?` | Update one mission. Worker-safe fields are task/blocker/note; `merged` cannot be set here. Paused missions record `pause_cause` (user/failure/resource/dependency); resuming a user-paused mission honors `mode.requireResumeAuthorization`. |
|
|
36
|
-
| `tower_status` | `missionId?`, `offset?`, `limit?`, `includeGate?`, `format?` | Dashboard by default. `missionId` returns full detail (tasks/notes/reviews/findings/completionReport). `offset`/`limit` page missions (default 20, max 100), `includeGate` adds gate digests, `format:"markdown"` returns the board. |
|
|
36
|
+
| `tower_status` | `missionId?`, `offset?`, `limit?`, `includeGate?`, `format?` | Dashboard by default. `missionId` returns full detail (tasks/notes/reviews/findings/completionReport). `offset`/`limit` page missions (default 20, max 100), `includeGate` adds gate digests, `format:"markdown"` returns the board. Includes `mode` with `lastChange` and recent `history` when the host mode hook is available. |
|
|
37
37
|
| `tower_spawn` | `missionId` (alias `id`), `role` (`worker`/`reviewer`), `name?`, `instructions?`, `worktreeRoot?`, `wait?`, `waitMs?`, `takeover?`, `includeDirtyBase?` | Provision/reuse the worktree and start a subagent. Worker uses `tower-worker`; reviewer requires a `completed` mission and uses the read-only `tower-reviewer`. `takeover:true` replaces a live worker entry that is no longer running (increments ownerGeneration). Only one live worker per mission; `spawn.maxLiveWorkers` caps the repository. |
|
|
38
38
|
| `tower_roster` | — | Roster with live activity (`running`/`inactive`/`missing`/`unknown`) and `stale` flags from the subagent catalog. Read-only. |
|
|
39
39
|
| `tower_adopt` | `retireMissing?` | Reconcile roster entries with the durable subagent catalog. Provably gone agents are retired (default) or marked `missing` (`retireMissing:false`) so they can be inspected/taken over. |
|
|
40
40
|
| `tower_diff` | `missionId` (alias `id`), `maxBytes?` | Read-only merge-base diff: files, commits, capped patch. Safe for reviewers. |
|
|
41
41
|
| `tower_send` | `to`, `subject`, `body`, `scope?`, `interrupt?`, `consentRef?` | Durable message to a roster name, `tower`, or `all`; delivers live to a running agent. `interrupt:true` interrupts the running turn first (Kimi-style), then delivers; `consentRef` is recorded for audit. Rate-limited by `send.maxPerMinute`. |
|
|
42
42
|
| `tower_inbox` | `limit?`, `include_read?` | Read/ack messages addressed to the caller; unread messages block `tower_complete`. |
|
|
43
|
-
| `tower_complete` | `missionId` (alias `id`), `report`, `checks?` | Worker reports completion (mission becomes `completed`,
|
|
43
|
+
| `tower_complete` | `missionId` (alias `id`), `report`, `checks?` | Worker reports completion (mission becomes `completed`, ready for preflight and optional review). Requires current owner, no open tasks/blockers, ≥1 commit, no unread inbox. `checks` records `{name, command?, exitCode?, evidence?}` evidence; `gates.requireChecks` can demand it. When configured, test discovery runs automatically and adds a `tests` check; failure throws `[tower:tests-failed]`. |
|
|
44
44
|
| `tower_interrupt` | `to?` (roster name), `agentId?`, `reason?` | Interrupt one running roster agent via `subagents.interrupt`, record `state:"interrupted"`. Idempotent (not running → `interrupted:false`). |
|
|
45
45
|
| `tower_finding` | `type`, `title`, `summary`, `details`, `suggested_fix`, `severity?`, `missionId?`, `location?` | Record an out-of-scope issue; reviewers use this instead of editing. Finds start as `open`. |
|
|
46
46
|
| `tower_findings` | `id?`, `status?`, `note?`, filters (`type?`, `severity?`, `missionId?`, `open?`, `limit?`) | Lifecycle tool: list/read/transition. Statuses `open → triaged → fixed`/`wontfix`, reopen allowed. Only the tower or a worker may mutate; a reviewer can list/read. |
|
|
@@ -50,9 +50,10 @@ findings but not mutate them. Violations throw `[tower:not-authorized]` or
|
|
|
50
50
|
| `tower_rebase` | `missionId` (alias `id`) | Rebase the branch onto the base in its worktree. Refuses while the worker runs or the worktree is dirty. Already-contained branches return `alreadyMerged` untouched. |
|
|
51
51
|
| `tower_teardown` | `force?`, `exclude?`, `dry_run?` (alias `dryRun`) | Remove eligible merged/abandoned worktrees and branches; running agents are always kept. |
|
|
52
52
|
| `tower_mode` | — | Report mode, last change, paused goal, denied tools, store path, plugin version, HMR availability, workspace-lock holder. |
|
|
53
|
-
| `tower_control` | `action` (`enter`/`exit`), `reason` | Model-initiated mode change;
|
|
53
|
+
| `tower_control` | `action` (`enter`/`exit`), `reason` | Model-initiated mode change; registered by default; disable with `mode.allowAgentControl:false`; reason is mandatory. |
|
|
54
54
|
| `tower_reload` | `repoRoot?` | Dev-only: ask DSH HMR to reconcile the profile and reload the Host plugin from disk. Registered while `dev.hotReload` is on; scheduled after the result (default 50 ms); fails with `reload-unavailable` without HMR. When `repoRoot` is supplied the caller must be the tower. |
|
|
55
55
|
| `tower_doctor` | — (takes `repoRoot`) | Read-only health contract: git, state schema, config, presets/subagents/HMR, workspace lock, roster, worktree realpath/ownership, test config, leases. Returns `{ok, checks[{id,status,detail}], environmentContract}`. Never writes. |
|
|
56
|
+
| `tower_recover` | `action` (`status`/`clear-stale-lock`), `confirm?` | Recovery diagnostics plus an explicit stale state-lock repair. `clear-stale-lock` requires `confirm:"CLEAR_STALE_LOCK"` and only moves a lock whose PID is provably dead to a backup; it never resets state/worktrees. |
|
|
56
57
|
| `tower_test` | `missionId` (alias `id`) | Run the worktree's `package.json` `tower.testDiscovery` and record a receipt; `ok:false` on failure. Use `tower_complete` for automatic admission checks. |
|
|
57
58
|
| `tower_batch` | `action` (`create`/`status`/`close`/`abandon`), `missionIds?`, `exclusions?`, `requiredChecks?`, `receiptPaths?`, `batchId?`, `checks?`, `treeTip?`, `receiptHashes?`, `reason?` | Finite evidence batch. Create freezes members/checks/receipts; close verifies every required check and receipt hash; merged members are eligible; abandon retires a stale open batch without deleting missions. Membership is immutable. |
|
|
58
59
|
| `tower_resource` | `action` (`acquire`/`release`/`status`), `name?`, `holder?`, `token?`, `ttlMs?`, `force?` | Advisory per-repository lease in `<common>/dsh-tower/leases.json`. No OS CPU/memory hard cap; expired leases require explicit `force` and the correct token. |
|
package/docs/zh/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
workspace 锁、roster、worktree 归属、测试策略与租约,不写任何状态。
|
|
12
12
|
- **测试发现与完成证据**:[测试、发现与证据](reference/testing.md)。仓库可在
|
|
13
13
|
`package.json.tower.testDiscovery` 声明发现命令;回执可自动附加到 `tower_complete`,
|
|
14
|
-
`gates.requireTests`
|
|
14
|
+
`gates.requireTests` 可要求针对当前 mission 分支 tip 的通过回执(与审查门禁独立)。
|
|
15
15
|
- **证据批次、咨询式租约、旧版导入**:[批次、租约与旧版导入](reference/operations.md)
|
|
16
16
|
(`tower_batch`、`tower_resource`、`tower_import_legacy`、`tower_legacy_map`)。
|
|
17
17
|
- **workspace 锁与计划模式**:`mode.workspaceLock` 限制每个仓库同时只有一个 Tower 会话,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
| 新用户 | [什么时候用 Tower](guide/scenarios-and-philosophy.md) → [快速开始](guide/quickstart.md) → [工具参考](reference/tools.md) → [第一个 mission 示例(英文)](../examples/first-mission.md) |
|
|
30
30
|
| 正在选择工作流 | [Tower 与 Agent Teams、Ralph、Workflow、普通并行子代理的区别](guide/scenarios-and-philosophy.md) |
|
|
31
31
|
| 运维 | [运维 runbook(英文)](../operations/runbook.md) → [blocker 与失败码](reference/blockers.md) → [错误码](reference/errors.md) → [事件](reference/events.md) → [Doctor](reference/doctor.md) → [测试](reference/testing.md) → [批次/租约/旧版](reference/operations.md) → [安全模型](operations/security.md) |
|
|
32
|
-
| 维护者 | [架构与状态机(英文)](../architecture/overview.md) → [配置参考](reference/config.md) → [热重载](guide/hot-reload.md) → [贡献指南](../../CONTRIBUTING.md) |
|
|
32
|
+
| 维护者 | [架构与状态机(英文)](../architecture/overview.md) → [配置参考](reference/config.md) → [热重载](guide/hot-reload.md) → [发布检查清单(英文)](../guide/release.md) → [看板查询(英文)](../board.md) → [贡献指南](../../CONTRIBUTING.md) |
|
|
33
33
|
|
|
34
34
|
参考页是当前发行版的权威说明;CI 中的 `npm run docs:check` 会校验文档与实现一致(包括中文页)。
|
|
35
35
|
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
- [安全模型](operations/security.md)
|
|
52
52
|
|
|
53
53
|
以下页面目前只有英文版:[架构与状态机](../architecture/overview.md)、
|
|
54
|
-
[运维 runbook](../operations/runbook.md)、[示例:第一个 mission](../examples/first-mission.md)
|
|
54
|
+
[运维 runbook](../operations/runbook.md)、[示例:第一个 mission](../examples/first-mission.md)、
|
|
55
|
+
[发布检查清单](../guide/release.md)、[看板查询](../board.md)。
|
|
55
56
|
|
|
56
57
|
## 语言 / Language
|
|
57
58
|
|
package/docs/zh/faq.md
CHANGED
|
@@ -3,22 +3,25 @@
|
|
|
3
3
|
[English](../faq.md) | **简体中文**
|
|
4
4
|
|
|
5
5
|
**什么时候该用 Tower,而不是 Agent Teams、Ralph、Workflow 或普通子代理?**
|
|
6
|
-
当输出是单个 Git
|
|
6
|
+
当输出是单个 Git 仓库中需要集成的变更时,用 Tower(需要独立结论时再开启审查)。只读探索或快速独立子任务用普通子代理;
|
|
7
7
|
横切的人类协作/设计决策用 Agent Teams;对同一目标反复新鲜尝试用 Ralph;程序化高扇出分析用 Workflow。
|
|
8
8
|
完整选择路径、场景与对比表见[什么时候用 Tower](guide/scenarios-and-philosophy.md)。
|
|
9
9
|
|
|
10
10
|
**可以同时把 Tower 和 Team/Workflow/Ralph 组合使用吗?**
|
|
11
11
|
同一会话中不能并发:Tower 模式会拒绝这些工具并清除 plan mode。请按阶段组合——先用 Workflow/Team
|
|
12
|
-
分析与决策,再启动 Tower
|
|
12
|
+
分析与决策,再启动 Tower 执行(可选审查)仓库变更。详见[完整指南](guide/scenarios-and-philosophy.md#4-tower-与其他-dsh-工作流模式的区别)。
|
|
13
13
|
|
|
14
14
|
**为什么 worker 刚完成,`tower_preflight` 就因 `no-review` 失败?**
|
|
15
|
-
|
|
15
|
+
只有在 `review.requireReview:true` 开启时才会如此:已完成的 mission 在等待独立审查。spawn 一个
|
|
16
|
+
reviewer;干净审查后门禁就会变绿。默认 `review.requireReview:false` 时审查可选,不会产生
|
|
17
|
+
`no-review` blocker。
|
|
16
18
|
|
|
17
19
|
**需要轮询 worker 吗?**
|
|
18
20
|
不需要。worker 的最终报告会送回本会话;`tower_roster` 显示实时活动。轮询只会浪费回合。
|
|
19
21
|
|
|
20
22
|
**`/tower` 显示模式已开启,但没有 `tower_control`。**
|
|
21
|
-
`mode.allowAgentControl`
|
|
23
|
+
`mode.allowAgentControl` 被关闭了。它默认为 `true`;如果被显式设为 `false`,在 profile patch 中改回
|
|
24
|
+
`true` 并重启 DSH。
|
|
22
25
|
|
|
23
26
|
**合并钩子要跑几分钟,`tower_merge` 失败了。**
|
|
24
27
|
用更大的 `timeoutMs` 重试:`tower_merge({ missionId, timeoutMs: 1800000 })`。默认超时是 15 分钟,
|
|
@@ -33,8 +36,8 @@
|
|
|
33
36
|
|
|
34
37
|
**可以要求强制独立审查吗?**
|
|
35
38
|
可以。在 profile 或仓库配置中设 `review.requireReview:true` 可开启全局审查门禁(默认 `false`,
|
|
36
|
-
即审查可选)。开启后可用 mission 级 `reviewPolicy:"none"` +
|
|
37
|
-
始终可用并记录结论。
|
|
39
|
+
即审查可选)。开启后可用 mission 级 `reviewPolicy:"none"` + 理由 + `gates.allowReviewExemption:true`
|
|
40
|
+
做更窄的豁免。`tower_review` 始终可用并记录结论。
|
|
38
41
|
|
|
39
42
|
**reviewer 能修改文件吗?**
|
|
40
43
|
不能。reviewer 使用只读的 `tower-reviewer` preset(没有 write/edit/pwsh);reviewer spawn 之后分支
|
|
@@ -97,7 +97,7 @@ Windows 上通常是 `C:\Users\<you>\.dsh`):
|
|
|
97
97
|
|---|---|
|
|
98
98
|
| `dev.hotReload` | 注册 `tower_reload`;关闭时 `/tower reload` 也被禁用(默认 `true`)。无 HMR 服务时工具仍注册,以便返回 `reload-unavailable`。 |
|
|
99
99
|
| `dev.reloadDelayMs` | 计划中的对账运行前的延迟,单位毫秒(默认 `50`),让工具/命令结果先送达模型,再替换插件。 |
|
|
100
|
-
| `dev.reloadRequiredIds` | profile 必须保持活跃的 Loader 条目 id(默认 `tower`、`tower-skills`、`preset-tower-worker`、`preset-tower-reviewer`)。即使某个 required 条目早已处于非活跃状态,也会被报告为重载失败。 |
|
|
100
|
+
| `dev.reloadRequiredIds` | profile 必须保持活跃的 Loader 条目 id(默认 `tower-bundle`、`tower`、`tower-skills`、`preset-tower-worker`、`preset-tower-reviewer`)。即使某个 required 条目早已处于非活跃状态,也会被报告为重载失败。 |
|
|
101
101
|
|
|
102
102
|
重载是**调度而非等待**:`/tower reload` 与 `tower_reload` 立即返回 `scheduled`、`delayMs`、
|
|
103
103
|
`requiredIds`(以及存在待处理错误时的 `lastError`),随后 HMR 在延迟后对账 profile。这是有意为之——
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 环境要求
|
|
6
6
|
|
|
7
|
-
- DSH `0.2.1-rc.2
|
|
7
|
+
- DSH `0.2.1-rc.2`;每个版本实际验证过的 host 构建见 [COMPATIBILITY.md](../../../COMPATIBILITY.md)
|
|
8
8
|
- Node.js 22+
|
|
9
9
|
- Git(本地 worktree;不需要网络访问)
|
|
10
10
|
|
|
@@ -31,12 +31,24 @@ Host 插件在 DSH 启动时加载:**安装或更新后需要重启 DSH**。
|
|
|
31
31
|
|
|
32
32
|
## 迁移说明
|
|
33
33
|
|
|
34
|
-
- **
|
|
34
|
+
- **2.0.4 → 2.1.0-beta.1**:不需要迁移 state/config。这是发布到 `next` dist-tag 的**预发布**,
|
|
35
|
+
`latest` 仍指向 2.0.4——请用 `dsh plugin --profile web add dsh-tower@next`(或精确版本号)安装。
|
|
36
|
+
运行时行为未变;本版本承载的是交付闸门(CI 中的 mount smoke、`npm run release:check`、证据约定
|
|
37
|
+
与追踪策略),而不是工具变化。本文档先于人工发布步骤合入:只有在[发布清单](release.md)执行
|
|
38
|
+
`npm publish --tag next` 之后,`next` 才会解析到 2.1.0-beta.1;`latest` 在稳定版发布前保持 2.0.4。
|
|
39
|
+
- **2.0.3 → 2.0.4**:不需要迁移 state/config。本版本是安全加固与完整性修复(授权、merge SHA 绑定、
|
|
40
|
+
dirty worktree 完成拒绝、stale lock 恢复、限制 test/git 进程环境、`tower_recover`、UI 0.2.2)。
|
|
41
|
+
升级后请按威胁模型重新检查 `review.requireReview`、`tests.admission` 与 worker 工具权限。
|
|
42
|
+
- **2.0.1 → 2.0.3**:不需要迁移状态。2.0.3 起独立审查**默认可选**(`review.requireReview:false`);
|
|
43
|
+
若要保留旧的审查门禁行为,请显式设为 `true`。2.0.1 为 `tower_batch` 增加 `abandon`、允许 merged
|
|
44
|
+
成员 close、让 doctor 跳过已 teardown 的 worktree,并修复终态 mission spawn/preflight 边界。
|
|
45
|
+
可选 `ui-bundle` 0.2.1 增加常驻 Tower 模式 chip 与模式感知的 disabled 工具行。
|
|
46
|
+
- **1.x → 2.0(已发布)**:不需要迁移状态(`schemaVersion` 保持 1;新字段都是可选的)。需要留意的
|
|
35
47
|
行为变化:Tower 模式激活期间,`mode.denyTools` 现在还会拒绝 `workflow`、`ralph`、`subagent`、
|
|
36
48
|
`subagent_fork`、`wait_agent` 与 `team_task_list`(可用显式列表覆盖);`spawn.maxLiveWorkers`
|
|
37
|
-
默认为 4;`mode.workspaceLock`
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
默认为 4;`mode.workspaceLock` 代码默认关闭、随包 patch 开启。worker 不能再直接完成/放弃/扩大
|
|
50
|
+
mission 的 scope——请使用 `tower_complete`。新工具:`tower_interrupt`,以及 HMR 可用时的
|
|
51
|
+
`tower_reload`。升级后重启一次 DSH;见[热重载](hot-reload.md)。
|
|
40
52
|
- **1.3 → 1.4**:不需要迁移状态。新增:仓库级配置(`<git-common-dir>/dsh-tower/config.json`)、
|
|
41
53
|
稳定的 `[tower:<code>]` 工具错误、`tower_findings`,以及 `id`/`missionId` 与 snake/camel 输入
|
|
42
54
|
别名。既有调用保持可用;重启 DSH 以加载新工具面(`tower_findings` 与更新的 output schema)。
|
|
@@ -32,14 +32,17 @@ tower_spawn repoRoot=D:\work\repo missionId=M1 role=worker
|
|
|
32
32
|
调用立即返回子代理 id。worker 在 mission worktree 内工作、提交、把任务标记完成,并调用
|
|
33
33
|
`tower_complete`;它的最终报告会送回本会话。用 `tower_roster` 观察活动,不要循环轮询。
|
|
34
34
|
|
|
35
|
-
## 4.
|
|
35
|
+
## 4. 可选:审查
|
|
36
|
+
|
|
37
|
+
独立审查默认可选。若要采用严格流程,先在 profile 或仓库配置中开启
|
|
38
|
+
`review.requireReview:true`,然后:
|
|
36
39
|
|
|
37
40
|
```
|
|
38
41
|
tower_spawn repoRoot=D:\work\repo missionId=M1 role=reviewer
|
|
39
42
|
```
|
|
40
43
|
|
|
41
|
-
reviewer 使用只读的 `tower-reviewer` preset
|
|
42
|
-
`clean` + `merge` 的结论才允许合并。
|
|
44
|
+
reviewer 使用只读的 `tower-reviewer` preset,查看 `tower_diff` 并提交 `tower_review`。开启
|
|
45
|
+
`review.requireReview:true` 后,只有 `clean` + `merge` 的结论才允许合并。
|
|
43
46
|
|
|
44
47
|
## 5. 门禁、合并与清理
|
|
45
48
|
|
|
@@ -49,8 +52,9 @@ tower_merge repoRoot=D:\work\repo missionId=M1
|
|
|
49
52
|
tower_teardown repoRoot=D:\work\repo
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
`
|
|
55
|
+
开启审查门禁时,审查前运行 `tower_preflight` 会报告 `no-review`;干净审查之后应为 `ok:true`。
|
|
56
|
+
默认 `review.requireReview:false` 时没有审查 blocker。存在其他 blocker 时 `tower_merge` 拒绝合并。
|
|
57
|
+
`tower_teardown` 移除已 merged/abandoned 的 worktree 与分支。
|
|
54
58
|
|
|
55
59
|
```
|
|
56
60
|
/tower off
|
|
@@ -59,8 +63,9 @@ tower_teardown repoRoot=D:\work\repo
|
|
|
59
63
|
## 如果失败
|
|
60
64
|
|
|
61
65
|
阅读 blocker code 并查阅 [blocker 参考](../reference/blockers.md)。最常见的情况:`stale-base`
|
|
62
|
-
(执行 `tower_rebase`)、`no-review
|
|
63
|
-
`timeoutMs`)、`tip-moved
|
|
66
|
+
(执行 `tower_rebase`)、`no-review`(仅在 `review.requireReview:true` 时;spawn reviewer)、
|
|
67
|
+
`merge-hook-failed`(重试,或调大 `timeoutMs`)、`tip-moved`(仅在审查门禁开启时;审查后分支
|
|
68
|
+
已变化,需要重新审查)。
|
|
64
69
|
|
|
65
70
|
工具抛出的错误带 `[tower:<code>]` 前缀;见[错误码](../reference/errors.md)(例如
|
|
66
71
|
`preset-missing` 表示安装 bundle 后需要重启 DSH,`not-initialized` 表示先运行 `tower_init`)。
|
|
@@ -72,7 +77,7 @@ tower_teardown repoRoot=D:\work\repo
|
|
|
72
77
|
|
|
73
78
|
```json
|
|
74
79
|
{
|
|
75
|
-
"review": { "maxRoundsPerReviewer": 3 },
|
|
80
|
+
"review": { "requireReview": true, "maxRoundsPerReviewer": 3 },
|
|
76
81
|
"merge": { "timeoutMs": 1800000 },
|
|
77
82
|
"worktrees": { "root": "D:/tower-worktrees" }
|
|
78
83
|
}
|