@tacuchi/agent-workflow-cli 21.4.0 → 21.5.0

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.
Files changed (68) hide show
  1. package/dist/adapters/git-cli.js +64 -0
  2. package/dist/adapters/git-cli.js.map +1 -1
  3. package/dist/adapters/node-file-system.js +14 -1
  4. package/dist/adapters/node-file-system.js.map +1 -1
  5. package/dist/application/branch-resolver.js +18 -3
  6. package/dist/application/branch-resolver.js.map +1 -1
  7. package/dist/application/check-branch-service.js +137 -19
  8. package/dist/application/check-branch-service.js.map +1 -1
  9. package/dist/application/dev-only-services.js +50 -3
  10. package/dist/application/dev-only-services.js.map +1 -1
  11. package/dist/application/export-service.js +2 -2
  12. package/dist/application/export-service.js.map +1 -1
  13. package/dist/application/hook-branch-check.js +71 -58
  14. package/dist/application/hook-branch-check.js.map +1 -1
  15. package/dist/application/lock-service.js +54 -15
  16. package/dist/application/lock-service.js.map +1 -1
  17. package/dist/application/paths-service.js +10 -0
  18. package/dist/application/paths-service.js.map +1 -1
  19. package/dist/application/persist-service.js +2 -2
  20. package/dist/application/persist-service.js.map +1 -1
  21. package/dist/application/process-registry-service.js +94 -25
  22. package/dist/application/process-registry-service.js.map +1 -1
  23. package/dist/application/project-tab-data.js +1 -1
  24. package/dist/application/project-tab-data.js.map +1 -1
  25. package/dist/application/resume-service.js +2 -0
  26. package/dist/application/resume-service.js.map +1 -1
  27. package/dist/application/session-close-service.js +23 -1
  28. package/dist/application/session-close-service.js.map +1 -1
  29. package/dist/application/source-launch-service.js +39 -4
  30. package/dist/application/source-launch-service.js.map +1 -1
  31. package/dist/application/source-remove-service.js +1 -1
  32. package/dist/application/source-remove-service.js.map +1 -1
  33. package/dist/application/status-service.js +2 -0
  34. package/dist/application/status-service.js.map +1 -1
  35. package/dist/application/workline-index-service.js +35 -0
  36. package/dist/application/workline-index-service.js.map +1 -1
  37. package/dist/application/worktree-service.js +357 -0
  38. package/dist/application/worktree-service.js.map +1 -0
  39. package/dist/cli/commands/check-branch.js +4 -0
  40. package/dist/cli/commands/check-branch.js.map +1 -1
  41. package/dist/cli/commands/dev-only.js +9 -3
  42. package/dist/cli/commands/dev-only.js.map +1 -1
  43. package/dist/cli/commands/index.js +2 -0
  44. package/dist/cli/commands/index.js.map +1 -1
  45. package/dist/cli/commands/resume.js +1 -1
  46. package/dist/cli/commands/resume.js.map +1 -1
  47. package/dist/cli/commands/session-close.js +7 -1
  48. package/dist/cli/commands/session-close.js.map +1 -1
  49. package/dist/cli/commands/status.js +1 -1
  50. package/dist/cli/commands/status.js.map +1 -1
  51. package/dist/cli/commands/worktree.js +39 -0
  52. package/dist/cli/commands/worktree.js.map +1 -0
  53. package/dist/cli/help-groups.js +3 -0
  54. package/dist/cli/help-groups.js.map +1 -1
  55. package/dist/cli/tui/tabs/project-tab.js +23 -6
  56. package/dist/cli/tui/tabs/project-tab.js.map +1 -1
  57. package/dist/domain/flow/authority.js +15 -1
  58. package/dist/domain/flow/authority.js.map +1 -1
  59. package/dist/domain/isolation-unit.js +85 -0
  60. package/dist/domain/isolation-unit.js.map +1 -0
  61. package/package.json +1 -1
  62. package/skills/w/commands/spec-new.md +1 -1
  63. package/skills/w/hooks/README.md +1 -1
  64. package/skills/w/loops/CODE-POLICIES.md +6 -4
  65. package/skills/w/loops/plan-new-loop/LOOP.md +1 -1
  66. package/skills/w/loops/quick-loop/LOOP.md +1 -1
  67. package/skills/w/modules/PLAN-INPUT.md +1 -1
  68. package/skills/w/roles/git/ROLE.md +1 -1
@@ -15,6 +15,12 @@ recorded as uncommitted in `CHECKPOINT` and `BACKLOG`. Between units each workin
15
15
  explicitly acknowledged; a `continuous` batch is the narrow exception that intentionally co-mingles
16
16
  its internal phases in one reviewed commit, and no batch may co-mingle with another.
17
17
 
18
+ Concurrent flows never share a working tree: each edits in its own **isolation unit** — a worktree
19
+ of the source on its own branch (`aw worktree ensure | list | release`). An edit outside it is
20
+ blocked naming the command that creates one, and at close `aw worktree integrate` merges that
21
+ branch into the source's declared work branch; a conflict is reported and routed to
22
+ `aw fix-git --path`, never resolved alone.
23
+
18
24
  > **When the branch is verified, when a commit becomes available and what an approval covers is not this document's call:** the deterministic steps below are decided by the CLI (`aw flow advance`), not by this document. Approving is the person's act and committing is a separate effect that comes back as the sources' real git state — which is also what makes "the checks passed" impossible to assert without having run them.
19
25
 
20
26
  ## Closing review gate (conventions, pre-commit)
@@ -33,10 +39,6 @@ same gate before any pending commit.
33
39
  - **Artifact-first + verification-first**: seed `CHECKPOINT.Next = "review <batch/task>"`; Success
34
40
  criteria require the whole diff to pass before commits.
35
41
 
36
- ## Location
37
-
38
- Same as the chassis: code-editing loops reference it as `../CODE-POLICIES.md` — the `w/loops/` tree is installed intact on every host (chassis § *Reference resolution*).
39
-
40
42
  ## Conditional modules
41
43
 
42
44
  - `db` — the DB scripts-only rule → `../modules/DB-SCRIPTS-ONLY.md`
@@ -32,7 +32,7 @@ PLAN
32
32
  ## Writes
33
33
  `docs/plans/PPP-plan-<slug>.md` (`generate`; **overwrites with confirmation** if it exists) — or **several sibling plans** when an accepted split applies (§ *Split gate (multi-plan)*). With UI, also the design revision it publishes under `docs/designs` (chassis § *docs/ boundary*). It never graduates/exports anything else to `docs/` — that is separate `export-*` work.
34
34
 
35
- > **Naming** follows [`PLAN-INPUT`](../../modules/PLAN-INPUT.md) § *Numbering*: `aw next-number docs/plans` mints `PPP` and the slug is short kebab-case from the Requirement. To locate plans, glob `docs/plans/PPP-plan-*.md`.
35
+ > **Naming** follows [`PLAN-INPUT`](../../modules/PLAN-INPUT.md) § *Numbering*: `aw next-number docs/plans --claim plan-<slug>.md` CLAIMS `PPP` two concurrent flows never get the same one. To locate plans, glob `docs/plans/PPP-plan-*.md`.
36
36
 
37
37
  > **Adoption (command mode 4):** an **externally-built plan** (host plan mode, hand-written, another agent) is materialized by the **command** in a single pass — this loop does not run: transcribe + normalize into the Delta 1 schema, `## Origin` = "adopted from <source>" + attribution; then `plan-refine` closes schema gaps (its coherence gate degrades for spec-less plans). See `../../modules/PLAN-INPUT.md` (the command's `input` module).
38
38
 
@@ -58,7 +58,7 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
58
58
  - **`Recortar alcance`**, if chosen: propose the **sub-task that DOES fit** a quick (`SESSION.Objective` = the sub-task; the original prompt goes into `## Origin`) and defer the rest to `BACKLOG` ("trimmed at the gate — may warrant its own spec, `/w:spec-new`").
59
59
  - **`Cambiar a SPEC`**, if chosen: **no quick session is created** — run the *Live transition to SPEC* (next bullet).
60
60
  - **Live transition to SPEC** (shared by the gate and mid-loop escalation). On acceptance, the work line **moves to the SPEC flow**: the explicit consent in the structured-choice **equals invoking the destination command** (*consented exception* — rule 3 of the *Continuity rule*, [`../../SKILL.md`](../../SKILL.md) § *Operating context*). On the SPEC side:
61
- 1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs`, slug, schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
61
+ 1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --claim spec-<slug>.md`, schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
62
62
  2. **Load and execute** [`../spec-refine-loop/LOOP.md`](../spec-refine-loop/LOOP.md) — over that spec (trampoline pattern).
63
63
  3. The run's session is that loop's **normal** `NNN-<slug>-spec-refine` (the CLI numbers it; its `## Origin` records the escalation). **Invariant 2 intact**: quick, while it is quick, never writes `docs/` — the draft is written by the SPEC flow, post-consent.
64
64
  - **Mid-loop escalation + handoff**: if the task grows, declare the signals again — the CLI applies the same threshold and, if it fires, asks. If the user accepts moving up:
@@ -25,4 +25,4 @@ Loaded when the input is not plainly a `ready-for-plan` spec (signal `input`).
25
25
 
26
26
  ## Numbering
27
27
 
28
- The plan is named `docs/plans/PPP-plan-<slug>.md`; `aw next-number docs/plans` mints `PPP` and the slug comes from the Requirement. It does **not inherit the spec's `NNN`** — the link is established by reference in `## Origin`, never by number.
28
+ The plan is named `docs/plans/PPP-plan-<slug>.md`; `aw next-number docs/plans --claim plan-<slug>.md` claims it; the slug comes from the Requirement. It does **not inherit the spec's `NNN`** — the link is established by reference in `## Origin`, never by number.
@@ -50,7 +50,7 @@ And **always** forbidden, even when the user asks for a commit: `--no-verify` (r
50
50
 
51
51
  ### Branch verification (before editing)
52
52
 
53
- The expected branch is **never assumed from the current branch** — the user may have switched it by hand. Verify against each source's declared work branch before any `Write/Edit`.
53
+ The expected branch is **never assumed from the current branch** — the user may have switched it by hand. Verify against the flow's own line of work before any `Write/Edit`: its isolation unit's branch when the source has units (`aw worktree`), the source's declared work branch when it has none.
54
54
 
55
55
  **Primary mechanism**: `aw check-branch --source <alias>` (or `--file <path-of-the-imminent-edit>`; `--strict` returns exit 2 on mismatch — useful as a gate). It returns the per-source fields already computed: `alias`, `path`, `main_branch` (base), `expected_work_branch`, `current_branch`, `match` (`current == expected`), `dirty` (uncommitted changes). **Fallback** (loose repo without workspace/CLI): compute them with direct read-only git (`git branch --show-current` + `git status --porcelain`) plus the session's declared branch.
56
56