worktree-controller 1.30.5__tar.gz → 1.31.0__tar.gz

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 (72) hide show
  1. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/PKG-INFO +21 -6
  2. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/README.md +20 -5
  3. worktree_controller-1.31.0/docs/daily-workflow.md +127 -0
  4. worktree_controller-1.31.0/docs/first-change.md +144 -0
  5. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/docs/getting-started.md +4 -3
  6. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/docs/operations.md +12 -1
  7. worktree_controller-1.31.0/docs/publishing.md +104 -0
  8. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/docs/reference.md +8 -2
  9. worktree_controller-1.31.0/examples/change_task.py +245 -0
  10. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/pyproject.toml +1 -1
  11. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/pyproject.toml.orig +1 -1
  12. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/__init__.py +1 -1
  13. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/cli.py +14 -1
  14. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/lifecycle.py +25 -3
  15. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/recovery_guidance.py +7 -0
  16. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/rendering.py +42 -0
  17. worktree_controller-1.31.0/src/worktree_controller/task_workflow.py +269 -0
  18. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/tool_cli_contract.json +37 -2
  19. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/tool_cli_contract.json +37 -2
  20. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/LICENSE +0 -0
  21. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/docs/architecture.md +0 -0
  22. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/examples/quickstart.py +0 -0
  23. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/activation_layout.py +0 -0
  24. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/branch_retirement.py +0 -0
  25. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/canonical_refresh.py +0 -0
  26. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/canonical_transition.py +0 -0
  27. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/cleanup_attempts.py +0 -0
  28. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/cleanup_evidence.py +0 -0
  29. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/cleanup_recovery.py +0 -0
  30. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/controller.py +0 -0
  31. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/convergence.py +0 -0
  32. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/delivered_closeout.py +0 -0
  33. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/disposable.py +0 -0
  34. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/environment.py +0 -0
  35. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/frozen_recovery.py +0 -0
  36. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/git_backend.py +0 -0
  37. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/governance.py +0 -0
  38. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/hardlinks.py +0 -0
  39. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/integration_cleanup.py +0 -0
  40. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/integration_conflict.py +0 -0
  41. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/integration_retry.py +0 -0
  42. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/keyed_document_scope.py +0 -0
  43. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/lifecycle_history.py +0 -0
  44. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/lifecycle_observation.py +0 -0
  45. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/metadata_codec.py +0 -0
  46. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/metadata_relocation.py +0 -0
  47. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/models.py +0 -0
  48. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/mount_diagnostics.py +0 -0
  49. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/multiple_cleanup_recovery.py +0 -0
  50. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/namespace_migration.py +0 -0
  51. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/native_session_recovery.py +0 -0
  52. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/owner_actions.py +0 -0
  53. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/policy.py +0 -0
  54. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/preservation.py +0 -0
  55. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/preserved_cleanup.py +0 -0
  56. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/publication_execution.py +0 -0
  57. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/reconciler.py +0 -0
  58. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/registration_backfill.py +0 -0
  59. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/registration_prune.py +0 -0
  60. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/resource_admission.py +0 -0
  61. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/retirement_adapters.py +0 -0
  62. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/retirement_execution.py +0 -0
  63. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/semantics.py +0 -0
  64. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/session.py +0 -0
  65. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/session_admission.py +0 -0
  66. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/source_cleanup.py +0 -0
  67. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/source_preservation.py +0 -0
  68. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/source_recovery.py +0 -0
  69. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/store.py +0 -0
  70. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/transaction_scope.py +0 -0
  71. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/writer_lease.py +0 -0
  72. {worktree_controller-1.30.5 → worktree_controller-1.31.0}/src/worktree_controller/writer_session.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worktree-controller
3
- Version: 1.30.5
3
+ Version: 1.31.0
4
4
  Summary: Govern Git worktree budgets, authority, ownership, and lifecycle
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -23,7 +23,7 @@ It checks repository policy before allocating a worktree, grants writing authori
23
23
  process, and records handoff, integration, recovery and release evidence. Git remains the source
24
24
  of truth for files, branches, commits and registered worktrees.
25
25
 
26
- **Current release: 1.30.5 · Linux · Python 3.12 · Apache-2.0**
26
+ **Current release: 1.31.0 · Linux · Python 3.12 · Apache-2.0**
27
27
 
28
28
  ## Install
29
29
 
@@ -32,14 +32,16 @@ Use a virtual environment in a new directory:
32
32
  ```bash
33
33
  python3.12 -m venv .venv
34
34
  . .venv/bin/activate
35
- python -m pip install worktree-controller==1.30.5
35
+ python -m pip install worktree-controller==1.31.0
36
36
  worktree-controller --version
37
37
  worktree-controller capabilities --json
38
38
  ```
39
39
 
40
40
  WC requires Git and readable Linux `/proc`. Other operating systems and Python versions are not
41
41
  supported by this release. Its one runtime dependency is `websockets>=15,<16`.
42
- Software version 1.30.5 retains CLI contract **60** and storage layout **5**.
42
+ On Ubuntu, if creating the environment reports that `ensurepip` is unavailable, install the
43
+ distribution's `python3.12-venv` package first (for example, `sudo apt install python3.12-venv`).
44
+ Software version 1.31.0 uses CLI contract **61** and storage layout **5**.
43
45
 
44
46
  ## Try it in a disposable repository
45
47
 
@@ -48,7 +50,7 @@ With the environment above active:
48
50
  ```bash
49
51
  git clone https://github.com/xuanheng-tech/worktree-controller.git wc
50
52
  cd wc
51
- git checkout v1.30.5
53
+ git checkout v1.31.0
52
54
  python examples/quickstart.py --workspace "$HOME/wc-first-run"
53
55
  ```
54
56
 
@@ -63,6 +65,17 @@ The [getting started guide](https://github.com/xuanheng-tech/worktree-controller
63
65
  explains the output and how to proceed to tasks that change files. The example also ships in the
64
66
  source distribution; it requires only WC and Git, with no companion delivery tools.
65
67
 
68
+ To actually change a file, publish to a local bare remote, integrate and recover a paused task,
69
+ follow [your first change](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/first-change.md).
70
+ That complete example additionally uses public Git Finalizer and Snapshot Runner installations.
71
+
72
+ ## Everyday tasks
73
+
74
+ Use `worktree-controller task list` to see live checkout tasks and `task show --task-key <task>`
75
+ for the recorded owner and next formal step. The [everyday task guide](docs/daily-workflow.md)
76
+ covers simpler start, original-task checkpoint/resume, guarded no-change release and exact
77
+ Finalizer handoff. These CLI 61 entrypoints retain the existing ownership, lease and policy checks.
78
+
66
79
  ## Use WC in a real project
67
80
 
68
81
  A governed repository tracks `.agents/worktree-policy.toml` and registers its checkouts with WC.
@@ -74,7 +87,8 @@ for task admission, writer identity, handoff, integration and safe release.
74
87
  WC manages checkout authority and lifecycle. It does not implement your task, commit changes or
75
88
  publish a branch. Real handoff and integration flows use separate delivery evidence from
76
89
  [Git Finalizer](https://github.com/xuanheng-tech/git-finalizer).
77
- Context Loader and Snapshot Runner are optional companion tools; see
90
+ Context Loader and the maintenance checker are optional. The complete integration example uses
91
+ Snapshot Runner for the explicit review receipts required by its policy; see
78
92
  [optional integrations](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/reference.md#optional-integrations-and-dependencies).
79
93
 
80
94
  When blocked, run `worktree-controller recovery-guide --repo /path/to/repo --path /path/to/checkout --json`
@@ -90,6 +104,7 @@ a successful process exit alone does not prove that all worktrees are settled.
90
104
  - [Architecture](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/architecture.md)
91
105
  - [Exact CLI and capability contract](https://github.com/xuanheng-tech/worktree-controller/blob/main/tool_cli_contract.json)
92
106
  - [Changelog](https://github.com/xuanheng-tech/worktree-controller/blob/main/CHANGELOG.md)
107
+ - [Publishing and recovery](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/publishing.md)
93
108
  - [Releases](https://github.com/xuanheng-tech/worktree-controller/releases) · [PyPI](https://pypi.org/project/worktree-controller/)
94
109
  - [Report a bug](https://github.com/xuanheng-tech/worktree-controller/issues) · [Contribute](https://github.com/xuanheng-tech/worktree-controller/blob/main/CONTRIBUTING.md)
95
110
  - [Report a security issue](https://github.com/xuanheng-tech/worktree-controller/blob/main/SECURITY.md)
@@ -6,7 +6,7 @@ It checks repository policy before allocating a worktree, grants writing authori
6
6
  process, and records handoff, integration, recovery and release evidence. Git remains the source
7
7
  of truth for files, branches, commits and registered worktrees.
8
8
 
9
- **Current release: 1.30.5 · Linux · Python 3.12 · Apache-2.0**
9
+ **Current release: 1.31.0 · Linux · Python 3.12 · Apache-2.0**
10
10
 
11
11
  ## Install
12
12
 
@@ -15,14 +15,16 @@ Use a virtual environment in a new directory:
15
15
  ```bash
16
16
  python3.12 -m venv .venv
17
17
  . .venv/bin/activate
18
- python -m pip install worktree-controller==1.30.5
18
+ python -m pip install worktree-controller==1.31.0
19
19
  worktree-controller --version
20
20
  worktree-controller capabilities --json
21
21
  ```
22
22
 
23
23
  WC requires Git and readable Linux `/proc`. Other operating systems and Python versions are not
24
24
  supported by this release. Its one runtime dependency is `websockets>=15,<16`.
25
- Software version 1.30.5 retains CLI contract **60** and storage layout **5**.
25
+ On Ubuntu, if creating the environment reports that `ensurepip` is unavailable, install the
26
+ distribution's `python3.12-venv` package first (for example, `sudo apt install python3.12-venv`).
27
+ Software version 1.31.0 uses CLI contract **61** and storage layout **5**.
26
28
 
27
29
  ## Try it in a disposable repository
28
30
 
@@ -31,7 +33,7 @@ With the environment above active:
31
33
  ```bash
32
34
  git clone https://github.com/xuanheng-tech/worktree-controller.git wc
33
35
  cd wc
34
- git checkout v1.30.5
36
+ git checkout v1.31.0
35
37
  python examples/quickstart.py --workspace "$HOME/wc-first-run"
36
38
  ```
37
39
 
@@ -46,6 +48,17 @@ The [getting started guide](https://github.com/xuanheng-tech/worktree-controller
46
48
  explains the output and how to proceed to tasks that change files. The example also ships in the
47
49
  source distribution; it requires only WC and Git, with no companion delivery tools.
48
50
 
51
+ To actually change a file, publish to a local bare remote, integrate and recover a paused task,
52
+ follow [your first change](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/first-change.md).
53
+ That complete example additionally uses public Git Finalizer and Snapshot Runner installations.
54
+
55
+ ## Everyday tasks
56
+
57
+ Use `worktree-controller task list` to see live checkout tasks and `task show --task-key <task>`
58
+ for the recorded owner and next formal step. The [everyday task guide](docs/daily-workflow.md)
59
+ covers simpler start, original-task checkpoint/resume, guarded no-change release and exact
60
+ Finalizer handoff. These CLI 61 entrypoints retain the existing ownership, lease and policy checks.
61
+
49
62
  ## Use WC in a real project
50
63
 
51
64
  A governed repository tracks `.agents/worktree-policy.toml` and registers its checkouts with WC.
@@ -57,7 +70,8 @@ for task admission, writer identity, handoff, integration and safe release.
57
70
  WC manages checkout authority and lifecycle. It does not implement your task, commit changes or
58
71
  publish a branch. Real handoff and integration flows use separate delivery evidence from
59
72
  [Git Finalizer](https://github.com/xuanheng-tech/git-finalizer).
60
- Context Loader and Snapshot Runner are optional companion tools; see
73
+ Context Loader and the maintenance checker are optional. The complete integration example uses
74
+ Snapshot Runner for the explicit review receipts required by its policy; see
61
75
  [optional integrations](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/reference.md#optional-integrations-and-dependencies).
62
76
 
63
77
  When blocked, run `worktree-controller recovery-guide --repo /path/to/repo --path /path/to/checkout --json`
@@ -73,6 +87,7 @@ a successful process exit alone does not prove that all worktrees are settled.
73
87
  - [Architecture](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/architecture.md)
74
88
  - [Exact CLI and capability contract](https://github.com/xuanheng-tech/worktree-controller/blob/main/tool_cli_contract.json)
75
89
  - [Changelog](https://github.com/xuanheng-tech/worktree-controller/blob/main/CHANGELOG.md)
90
+ - [Publishing and recovery](https://github.com/xuanheng-tech/worktree-controller/blob/main/docs/publishing.md)
76
91
  - [Releases](https://github.com/xuanheng-tech/worktree-controller/releases) · [PyPI](https://pypi.org/project/worktree-controller/)
77
92
  - [Report a bug](https://github.com/xuanheng-tech/worktree-controller/issues) · [Contribute](https://github.com/xuanheng-tech/worktree-controller/blob/main/CONTRIBUTING.md)
78
93
  - [Report a security issue](https://github.com/xuanheng-tech/worktree-controller/blob/main/SECURITY.md)
@@ -0,0 +1,127 @@
1
+ # Everyday task operations
2
+
3
+ Use `worktree-controller task` for named feature/audit checkout tasks. It resolves the recorded
4
+ path, owner and record version, then calls the existing guarded lifecycle operation. The existing
5
+ low-level commands remain available. No separate task database or lifecycle is introduced.
6
+
7
+ These entrypoints require **WC 1.31.0, CLI 61, task_workflow_version 1**. Storage layout remains 5.
8
+ Check the installed `--version`, `capabilities --json` and `task --help` before using them. A newer
9
+ source checkout does not update a separately installed Controller. Governed installations still
10
+ need their normal compatibility, deployment and activation checks.
11
+
12
+ Start in an already governed repository: inspect `status`, `doctor` and its selected policy;
13
+ adopt existing checkouts explicitly. Examples below use `/project` as that repository's canonical
14
+ checkout. These commands operate locally and do not grant permission to publish or deploy.
15
+
16
+ ## See the current work
17
+
18
+ ```bash
19
+ worktree-controller task list --repo /project
20
+ worktree-controller task show --repo /project --task-key report-fix
21
+ ```
22
+
23
+ `list` shows live linked checkouts, their recorded owner, lifecycle, writer lease observation,
24
+ cleanliness and any checkpoint dependency. It is not a list of all business Tasks or queued
25
+ integrations. `show` explains the named checkout and its next formal step. After release, the
26
+ task key queries the original lifecycle history instead of inventing a new task.
27
+
28
+ Task keys can be ambiguous in imported or historical work. Mutations never pick a checkout by
29
+ owner, age or directory order. If multiple live checkouts share a key, select its exact `--path`
30
+ instead. Historical results retain their proof status and pagination; absence is not completion.
31
+
32
+ ## 1. Start and finish a task with no changes
33
+
34
+ ```bash
35
+ worktree-controller task start --repo /project --task-key report-fix \
36
+ --owner alice --scope src/reports
37
+
38
+ # An inspection that made no file changes and produced no task commit:
39
+ worktree-controller task finish --repo /project --task-key report-fix \
40
+ --owner alice --outcome no-change
41
+ ```
42
+
43
+ Start requires an explicit task key, owner and file scope. It defaults to feature role,
44
+ `authority_key=task_key`, module `task`, branch `task/<task-key>`, and the repository policy's
45
+ publication remote/branch as base. Override `--authority-key`, `--module`, `--branch`, `--base-ref`
46
+ or `--path` when your existing task requires different values. It does not fetch or substitute
47
+ another base when the policy base is unavailable locally. An existing live task is not duplicated.
48
+
49
+ Admission creates a checkout, **not write entitlement**. Before editing, bind the real writer
50
+ with the existing writer-session/lease flow and require `write-guard` to allow the operation.
51
+ Use the admitted path and declared task/authority. End only that writer's exact lease before
52
+ finishing. See [start or resume development](operations.md#start-or-resume-development).
53
+
54
+ The no-change finish first records the existing `complete-no-change` result, then attempts normal
55
+ guarded release. It retains the branch. A task commit or dirty worktree refuses no-change completion.
56
+ Unknown ignored files or registered resources can block the separate release step. In that case,
57
+ exit status is **2**, `TASK_RELEASE_BLOCKED` retains the completed prefix and provides a release
58
+ dry-run command. Preserve/classify those files through their existing owner flow. Repeating this
59
+ finish while `NO_CHANGE_COMPLETED` retries release without creating another completion receipt.
60
+ After successful release, use `task show`; another finish refuses the absent live allocation.
61
+
62
+ ## 2. Pause and continue the original task
63
+
64
+ First save a checkpoint in your existing Task system. Obtain its content-addressed ID and the
65
+ exact HEAD it records. WC records that owner's attestation; it does not create or verify the
66
+ checkpoint payload and does not copy uncommitted files into it. Then, after the writer ends:
67
+
68
+ ```bash
69
+ worktree-controller task finish --repo /project --task-key report-fix --owner alice \
70
+ --outcome checkpoint --checkpoint-id "$checkpoint_id" --checkpoint-head "$checkpoint_head" \
71
+ --waiting-on 'Awaiting source data'
72
+
73
+ worktree-controller task resume --repo /project --task-key report-fix --owner alice
74
+ ```
75
+
76
+ The checkpoint ID must use the existing `sha256:<64 hex>` or `art_<64 hex>` format. Its HEAD
77
+ must still match the checkout. Parking preserves the same checkout, branch, uncommitted files
78
+ and unknown files; work remains unfinished. Resume uses the same allocation and owner, without
79
+ creating a replacement task or writer lease. Obtain fresh write entitlement before editing again.
80
+ This entry does not release an unfinished checkout; that remains a separate reviewed owner flow.
81
+
82
+ ## 3. Hand off a completed change
83
+
84
+ Run appropriate tests/review and publish the task branch through your authorized Git Finalizer
85
+ flow. Use the actual returned record and the exact commit it binds; do not invent evidence.
86
+ After ending the exact writer:
87
+
88
+ ```bash
89
+ worktree-controller task finish --repo /project --task-key report-fix --owner alice \
90
+ --outcome handoff --finalizer-record-id "$finalizer_record_id" --commit "$commit"
91
+ ```
92
+
93
+ `TASK_HANDED_OFF` freezes the original scope and commit. It does not integrate or publish main,
94
+ release the checkout, declare the business Task complete or authorize a production deployment.
95
+ Continue the existing [handoff and integration](operations.md#handoff-and-integrate) flow, or use
96
+ the complete [first change example](first-change.md). Scope/commit drift and unknown files keep
97
+ their existing refusals. Active **or expired but still recorded** writer leases remain blocked;
98
+ these entrypoints never steal, renew or remove them.
99
+
100
+ ## Inspect a blocked integration
101
+
102
+ ```bash
103
+ worktree-controller task recover --repo /project --task-key original-integration-task
104
+ # Also works after its candidate checkout has been released:
105
+ worktree-controller task recover --repo /project --intent-id "$original_intent_id" --json
106
+ ```
107
+
108
+ `recover` is a read-only entry to the existing `recovery-guide`. It shows the recorded owner,
109
+ blockers and exact next formal command, retaining the original intent and evidence. For an
110
+ unchanged BLOCKED integration, the supported path starts with quarantine, then formal abort,
111
+ guarded release and retry of the original intent. Execute only the current owner-authorized
112
+ step, then run `recover` again: every transition can change the next command and record version.
113
+ Source/scope drift, dirty files, active publication and missing evidence still block recovery.
114
+ The entry does not run commands, edit Controller metadata or make a recovery plan executable.
115
+
116
+ ## Read results accurately
117
+
118
+ All actions accept `--json`. `list`, `show` and `recover` return 0 when observation succeeds,
119
+ including when that observation describes a blocker. This is not recovery or task completion.
120
+ Mutating actions return 0 only when the requested supported operation finishes; refusals,
121
+ `RESOURCE_WAIT` and incomplete release return 2. A waiting admission keeps its existing request;
122
+ inspect `admission-queue` instead of creating another task or branch.
123
+
124
+ Task selectors do not replace exact session closeout. At normal session exit, use the real
125
+ client/session/holder/run and every known expected allocation with `worktree-session-end --check
126
+ --require-complete`; read all rows and `summary.terminal_complete`. Business Task completion,
127
+ checkout release and published integration each require their own evidence.
@@ -0,0 +1,144 @@
1
+ # Deliver your first change
2
+
3
+ This example changes one README, commits and publishes its branch through Git Finalizer, hands
4
+ it off to WC, reviews and validates an integration candidate, and publishes local main. It can
5
+ pause after handoff and continue in a new process with the original task and integration request.
6
+ It creates a **local bare Git remote**, never contacts a hosting service, and needs no credentials.
7
+ Use a disposable workspace; do not point it at an existing project.
8
+
9
+ This release uses the CLI 61 [task entrypoints](daily-workflow.md) for start, handoff and
10
+ recovery inspection; use WC 1.31.0 or newer with `task_workflow_version` 1. The underlying
11
+ writer, review, integration and closeout guards are the same as the low-level flow.
12
+
13
+ ## Install the example's tools
14
+
15
+ WC itself needs Linux, Python 3.12, Git and readable `/proc`. Install the released version using
16
+ the [README](../README.md#install). On Ubuntu, a Python installation without `ensurepip` also
17
+ needs its distribution's `python3.12-venv` package before `python3.12 -m venv` can work.
18
+
19
+ This complete delivery example also uses these public tools:
20
+
21
+ - [Git Finalizer 1.9.3](https://github.com/xuanheng-tech/git-finalizer#installation): download its
22
+ published release tarball and checksum file, verify them, and keep all `git-finalize*` companions
23
+ together as its installation instructions describe. It is not a PyPI package.
24
+ - [Snapshot Runner 2.5.11](https://github.com/xuanheng-tech/snapshot-runner#requirements-and-installation):
25
+ install its PyPI package in a separate virtual environment. Its own interpreter needs
26
+ Python 3.12.13 or a later supported version; using Python 3.12.13+ for both environments meets
27
+ WC's Python 3.12 requirement too. WC's core Python requirement is unchanged.
28
+
29
+ For example, with a suitable Python 3.12 already installed and a new `runner-venv` path:
30
+
31
+ ```bash
32
+ python3.12 --version
33
+ python3.12 -m venv /absolute/path/to/runner-venv
34
+ /absolute/path/to/runner-venv/bin/python -m pip install 'snapshot-runner==2.5.11'
35
+ ```
36
+
37
+ Use the WC environment's Python to run the example. Pass the two installed entrypoints
38
+ explicitly, or put their directories on PATH. `tool-skill-sync`, Context Loader, agent clients,
39
+ model APIs and personal Skills are not required by this example.
40
+
41
+ WC policy schema 4 and newer requires separate explicit **test and Snapshot receipt identities**
42
+ at `integration-validate`. The example creates real Snapshot Runner artifacts and reads their
43
+ README evidence; it checks the expected README content and clean candidate separately. A tool's
44
+ successful evidence collection alone is not a passed test or code review. No fake receipt, lowered
45
+ policy version or changed Controller state is used.
46
+
47
+ ## Run the whole task
48
+
49
+ From this release's source checkout, with the WC environment active:
50
+
51
+ ```bash
52
+ python examples/change_task.py --workspace "$HOME/wc-first-change" \
53
+ --finalizer /absolute/path/to/git-finalize \
54
+ --snapshot-runner /absolute/path/to/runner-venv/bin/snapshot-runner
55
+ ```
56
+
57
+ The workspace path must be new and its parent must exist. The script refuses an existing path
58
+ without changing it. The source archive includes both `change_task.py` and its neighboring
59
+ `quickstart.py`; keep them together. Missing tools are refused before the workspace is created.
60
+
61
+ `PASS` means all of the following were checked:
62
+
63
+ 1. The admitted feature's real writer passed the write guard before changing `README.md`.
64
+ 2. The exact file scope was reviewed, committed and published to the local remote with Finalizer.
65
+ 3. The writer ended and its exact commit was handed off, then queued and claimed through WC.
66
+ 4. Tests and Snapshot evidence were bound to the candidate before its main-publication lease.
67
+ 5. Finalizer and WC independently verified the published commit; WC released both linked checkouts.
68
+ 6. Canonical main was refreshed, the delivered README was checked, strict closeout proof covered
69
+ both known allocations, and `doctor` passed.
70
+
71
+ The example intentionally changes only a known text file, so its content review is narrow and
72
+ deterministic. Real application changes need their own tests and appropriate review.
73
+ This local demonstration does not authorize a hosted publication or production deployment.
74
+
75
+ ## Pause and resume the same task
76
+
77
+ Use a different new workspace for this exercise:
78
+
79
+ ```bash
80
+ python examples/change_task.py --workspace "$HOME/wc-change-resume" \
81
+ --finalizer /absolute/path/to/git-finalize \
82
+ --snapshot-runner /absolute/path/to/runner-venv/bin/snapshot-runner \
83
+ --pause-after-handoff
84
+ ```
85
+
86
+ The output is **`PAUSED`**, not `PASS`. The change and its branch have reached the local remote,
87
+ the feature writer is released, and `handoff.json` records the original task's source, repository
88
+ and integration identities. The integration is queued, with no candidate checkout yet.
89
+ The preserved source is still awaiting integration; this is not completed business work.
90
+
91
+ Run in a new process with the **same** workspace and installed tools:
92
+
93
+ ```bash
94
+ python examples/change_task.py --workspace "$HOME/wc-change-resume" \
95
+ --finalizer /absolute/path/to/git-finalize \
96
+ --snapshot-runner /absolute/path/to/runner-venv/bin/snapshot-runner --resume
97
+ ```
98
+
99
+ Resume checks the existing repository, local remote, source identity and uncommitted files. It
100
+ claims the original queued intent, or observes the same unchanged claimed candidate. It does not
101
+ create another task, replace source evidence, reset a branch or delete unknown files. Repeating
102
+ resume after verified completion only rechecks the delivered result and closeout evidence.
103
+
104
+ ## Inspect a failure and keep the evidence
105
+
106
+ Every command's actual exit code, stdout and stderr is saved in `commands.jsonl`. The workspace
107
+ also retains Finalizer receipts, Snapshot summaries and artifacts, content-check results, branches,
108
+ the local remote and final `closeout.json`. Linked checkouts are removed only through WC.
109
+
110
+ An unexpected refusal stops with nonzero exit status and preserves the current result. This
111
+ example's resume entry covers queued or unchanged claimed handoffs and verified completion;
112
+ it is not a general crash-recovery engine. For a different interruption point, unknown files,
113
+ identity drift or a publication in progress, inspect the saved command and the formal
114
+ [recovery guidance](operations.md#recovery-guidance-and-session-closeout). Do not rerun without
115
+ `--resume` into an old workspace or clear metadata to make the example continue.
116
+
117
+ The isolated state is under the workspace's `home/`. For inspection, activate the WC environment
118
+ and use the actual workspace path:
119
+
120
+ ```bash
121
+ workspace="$HOME/wc-change-resume"
122
+ HOME="$workspace/home" XDG_STATE_HOME="$workspace/home/.local/state" \
123
+ worktree-controller status --repo "$workspace/main" --json
124
+ ```
125
+
126
+ Use the original `intent_id` from `handoff.json` with `recovery-guide --intent-id` even after a
127
+ checkout is released. Follow each returned owner/CAS step and reobserve. `doctor PASS` and an
128
+ observation command's exit 0 do not prove recovery, integration or task completion.
129
+
130
+ ## Repeat the regression as a contributor
131
+
132
+ The default test suite checks refusal of existing workspaces and missing prerequisites. The real
133
+ cross-tool regression is explicit opt-in, runs entirely against temporary local repositories,
134
+ and covers unknown-file preservation, source drift, pause/resume and completed replay:
135
+
136
+ ```bash
137
+ WC_DEMO_FINALIZER=/absolute/path/to/git-finalize \
138
+ WC_DEMO_SNAPSHOT_RUNNER=/absolute/path/to/runner-venv/bin/snapshot-runner \
139
+ uv run --locked --python 3.12 --no-env-file python -m pytest -q tests/test_change_task.py \
140
+ -p no:cacheprovider --basetemp /absolute/path/to/a/new/demo-pytest
141
+ ```
142
+
143
+ Install the contributor environment as described in [CONTRIBUTING](../CONTRIBUTING.md). Without
144
+ both opt-in entrypoints, the cross-tool case is skipped; a skipped case is not acceptance evidence.
@@ -63,9 +63,10 @@ not establish completion.
63
63
 
64
64
  The example deliberately performs a genuine no-change inspection, so `complete-no-change` is
65
65
  appropriate. A task that edits files or creates commits must preserve or deliver that work;
66
- it cannot use this shortcut. See the [operations guide](operations.md) for the existing
67
- handoff, integration and recovery contracts and [Git Finalizer](https://github.com/xuanheng-tech/git-finalizer)
68
- for delivery evidence. WC itself does not commit, push or approve a production release.
66
+ it cannot use this shortcut. Follow [your first change](first-change.md) for an executable local
67
+ commit, handoff, integration and pause/resume example with public companion tools. See the
68
+ [operations guide](operations.md) for the existing contracts. WC itself does not commit, push
69
+ or approve a production release.
69
70
 
70
71
  For real session closeout, pass the complete recorded selector (`--client-id`, `--session-id`,
71
72
  `--run-id` when present, and `--holder`) and every known `--expected-allocation-id` to
@@ -7,8 +7,19 @@ the [getting started guide](getting-started.md) provides an isolated first run.
7
7
 
8
8
  ## Start or resume development
9
9
 
10
- 1. Run `tool-skill-sync doctor --repo <checkout> --summary`, then Controller `status --json`.
10
+ For everyday feature/audit work, the [task entrypoints](daily-workflow.md) resolve the original
11
+ checkout and record identity by task key, covering start, checkpoint/resume and finish. The
12
+ steps below remain the underlying authority and the route for advanced integration/recovery.
13
+
14
+ For a worked local task, use [your first change](first-change.md). Core inspection/allocation needs
15
+ WC and Git. The integration flow below additionally uses Git Finalizer and separate test and
16
+ Snapshot evidence; policy schema 4+ requires both receipt identities explicitly. The worked example
17
+ uses the public Snapshot Runner package. Context Loader and `tool-skill-sync` are optional.
18
+
19
+ 1. Run Controller `--version`, `capabilities --json`, `status --json` and `doctor --json`.
11
20
  Read the selected repository policy and distinguish installed runtime from source candidates.
21
+ If your site installed the optional maintenance checker, also run
22
+ `tool-skill-sync doctor --repo <checkout> --summary` for its tool/Skill pairing checks.
12
23
  2. Use `plan` for the existing task/authority. Reuse its allocation when supported; otherwise use
13
24
  `acquire` with explicit owner, branch, base and scope. A waiting request is not an allocation.
14
25
  3. Bind the real writer process and session/run through `writer-session` or `writer-lease-acquire`.
@@ -0,0 +1,104 @@
1
+ # Publishing WC packages
2
+
3
+ The `Publish release` workflow in `.github/workflows/release.yml` releases an existing stable tag
4
+ that is already integrated into public `main`. It does not create tags, commit, merge or push Git
5
+ branches. Source delivery continues to use the repository's Controller and Git Finalizer flow.
6
+ The software version, CLI contract and storage layout remain independently versioned.
7
+
8
+ ## One-time setup
9
+
10
+ The repository uses a GitHub environment named **`pypi`**, restricted to workflow runs from **main**.
11
+ The environment grants no additional review exemption. Keep any existing platform protections.
12
+
13
+ In the PyPI project's **Manage → Publishing → Add a new publisher → GitHub** form, register:
14
+
15
+ | Field | Exact value |
16
+ | --- | --- |
17
+ | PyPI project | `worktree-controller` |
18
+ | Owner | `xuanheng-tech` |
19
+ | Repository | `worktree-controller` |
20
+ | Workflow filename | `release.yml` |
21
+ | Environment | `pypi` |
22
+
23
+ The owner completes this authenticated PyPI account step. Do not put a long-lived PyPI token in
24
+ GitHub secrets. The workflow uses `uv publish --trusted-publishing always`: an unavailable or
25
+ mismatched publisher fails rather than falling back to another credential. Existing local
26
+ credentials are not read, copied, revoked or changed by this workflow.
27
+
28
+ See [PyPI's publisher setup](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) and
29
+ [uv's GitHub integration](https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi).
30
+
31
+ ## Audit an existing release
32
+
33
+ Run from an authenticated GitHub CLI with access to the public repository:
34
+
35
+ ```bash
36
+ gh workflow run release.yml --repo xuanheng-tech/worktree-controller --ref main \
37
+ -f tag=v1.30.5 -F publish=false
38
+ ```
39
+
40
+ This checks and builds the exact tag in a job with read-only repository permissions. Automation
41
+ comes from the immutable workflow commit; the payload is checked out separately at its tag.
42
+ The workflow records a manifest and checksums and audits the existing GitHub/PyPI inventory.
43
+ For an already published release, it also downloads and installs both distributions in fresh
44
+ environments and runs the onboarding example shipped in the source archive.
45
+
46
+ For an unpublished tag, audit reports the missing remote files and skips post-publication
47
+ installation. A successful audit is preparation evidence, not proof of a new publication or a
48
+ successful OIDC upload. WC's packaged onboarding contract introduced in 1.30.5 is required.
49
+
50
+ ## Publish a real version
51
+
52
+ After the actual source change and version update have been validated and integrated, create and
53
+ publish its exact stable version tag through the normal release process. Then trigger once:
54
+
55
+ ```bash
56
+ gh workflow run release.yml --repo xuanheng-tech/worktree-controller --ref main \
57
+ -f tag=vX.Y.Z -F publish=true
58
+ ```
59
+
60
+ Replace `vX.Y.Z` with that existing tag. The tag must exactly match `pyproject.toml` and the CLI
61
+ contract's software version. A tag outside main, a moved tag, dirty source, unknown file or
62
+ checksum mismatch stops the workflow. No force operation or Controller-state edit is used.
63
+
64
+ The workflow performs these stages:
65
+
66
+ 1. Run `scripts/check-project` on the tag: lint, full default suite, wheel/sdist build, sdist
67
+ rebuild and installed checks. Freeze one authoritative wheel/sdist pair in an immutable run
68
+ artifact. Rebuilding the sdist for validation does not replace that pair.
69
+ 2. With publishing permissions, recheck the source identity and both remote inventories. Store
70
+ the exact pair and SHA256SUMS in a GitHub draft, upload only missing PyPI files using short-lived
71
+ publishing credentials, verify the registry, and make the matching GitHub release public.
72
+ Building or installing package code never runs in this privileged job.
73
+ 3. In a separate job without publishing permissions, independently download both PyPI files,
74
+ compare their hashes, install them with fresh caches, verify metadata and all three CLI entry
75
+ points, and run the source archive's onboarding example. A short bounded retry handles a newly
76
+ uploaded version missing from the package index; functional failures are not retried.
77
+
78
+ ## Recover a failed or interrupted run
79
+
80
+ Inspect the failing step and its real exit code. A nonzero uploader exit remains a failed step,
81
+ even if a file reached the server. The GitHub draft and immutable Actions artifact retain the
82
+ original bytes. Resolve the stated blocker and use **Re-run failed jobs** in that same run:
83
+
84
+ ```bash
85
+ gh run rerun RUN_ID --failed --repo xuanheng-tech/worktree-controller
86
+ ```
87
+
88
+ The publish job consumes the successful build job's original artifact name, including its original
89
+ run attempt. It checks already uploaded bytes, uploads only missing files, and never uses
90
+ `--clobber` or blindly skips an existing PyPI filename. An already complete matching release is
91
+ observed without another upload. Unknown assets, yanked files, identity drift and different bytes
92
+ remain blocked; do not delete or replace them to make a retry pass.
93
+
94
+ A repository-wide workflow concurrency group serializes release runs without interrupting an
95
+ active publisher. GitHub retains only one pending run per concurrency group, so use failed-job
96
+ recovery instead of submitting a queue of duplicate dispatches. Bundles and check evidence have
97
+ 90-day retention. Once an artifact expires, a new run must build and validate again; if its bytes
98
+ differ from existing remote files, it stops and requires review of the retained original evidence.
99
+ It never overwrites the old release.
100
+
101
+ Receipts distinguish a read-only audit, `PUBLISHED_VERIFIED`, and `FRESH_INSTALLS_VERIFIED`.
102
+ Skipped tests remain skipped. Local installation or activation of a maintainer's WC runtime is a
103
+ separate operation; publishing a package does not update that runtime or authorize a production
104
+ release in any repository governed by WC.
@@ -1,5 +1,8 @@
1
1
  # Technical reference
2
2
 
3
+ For the task-oriented CLI 61 entrypoints, see [everyday task operations](daily-workflow.md).
4
+ They delegate to the existing lifecycle guards and introduce no additional stored state.
5
+
3
6
  For a first run, use the [getting started guide](getting-started.md). This reference retains
4
7
  the detailed contracts, historical compatibility notes and benchmark evidence previously in the README.
5
8
  The [CLI contract](../tool_cli_contract.json) is authoritative for exact interfaces.
@@ -7,14 +10,17 @@ The [CLI contract](../tool_cli_contract.json) is authoritative for exact interfa
7
10
  ## Optional integrations and dependencies
8
11
 
9
12
  The core control plane has a single runtime dependency (`websockets>=15,<16`) and works standalone
10
- against any local Git repository on the supported platform. Everything below is optional and is
11
- exercised only when the corresponding context or companion tool is present:
13
+ against any local Git repository on the supported platform. The integrations below are optional
14
+ for core inspection/allocation; selecting a delivery flow can add explicit evidence requirements:
12
15
 
13
16
  - **Companion delivery tools.** WC composes with, but does not require or embed, the separate
14
17
  **Context Loader** (context reading), **Snapshot Runner** (read-only review evidence) and
15
18
  **Git Finalizer** (commit and publication). Each owns its own authority; WC never merges,
16
19
  publishes or commits on their behalf. The handoff and integration flows in
17
20
  [docs/operations.md](operations.md) assume Git Finalizer is installed for delivery evidence.
21
+ Policy schema 4+ also requires explicit test and Snapshot receipt identities for preparation;
22
+ [your first change](first-change.md) uses the public Snapshot Runner package to produce them.
23
+ Context Loader and the optional maintenance checker are not required by that example.
18
24
  - **Client-specific recovery.** The `archived_codex_binding_recovery_version` capability
19
25
  (`--recover-archived-codex-session`) recovers a released writer lease whose original session
20
26
  belonged to the Codex CLI client, by verifying that client's own archived-session and