worktree-controller 1.32.10__tar.gz → 1.32.11__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 (79) hide show
  1. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/PKG-INFO +5 -5
  2. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/README.md +4 -4
  3. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/operations.md +18 -0
  4. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/reference.md +8 -0
  5. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/roadmap.md +1 -1
  6. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/pyproject.toml +1 -1
  7. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/pyproject.toml.orig +1 -1
  8. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/__init__.py +1 -1
  9. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/lifecycle.py +12 -1
  10. {worktree_controller-1.32.10 → worktree_controller-1.32.11/src/worktree_controller}/tool_cli_contract.json +1 -1
  11. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/transaction_scope.py +58 -0
  12. {worktree_controller-1.32.10/src/worktree_controller → worktree_controller-1.32.11}/tool_cli_contract.json +1 -1
  13. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/LICENSE +0 -0
  14. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/architecture.md +0 -0
  15. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/client-integration.md +0 -0
  16. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/daily-workflow.md +0 -0
  17. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/first-change.md +0 -0
  18. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/getting-started.md +0 -0
  19. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/integration-boundaries.md +0 -0
  20. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/publishing.md +0 -0
  21. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/docs/scope.md +0 -0
  22. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/examples/change_task.py +0 -0
  23. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/examples/client_continuation.py +0 -0
  24. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/examples/quickstart.py +0 -0
  25. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/activation_layout.py +0 -0
  26. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/branch_retirement.py +0 -0
  27. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/canonical_refresh.py +0 -0
  28. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/canonical_transition.py +0 -0
  29. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/cleanup_attempts.py +0 -0
  30. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/cleanup_evidence.py +0 -0
  31. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/cleanup_recovery.py +0 -0
  32. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/cli.py +0 -0
  33. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/controller.py +0 -0
  34. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/convergence.py +0 -0
  35. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/delivered_closeout.py +0 -0
  36. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/disposable.py +0 -0
  37. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/environment.py +0 -0
  38. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/frozen_recovery.py +0 -0
  39. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/git_backend.py +0 -0
  40. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/governance.py +0 -0
  41. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/hardlinks.py +0 -0
  42. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/integration_cleanup.py +0 -0
  43. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/integration_conflict.py +0 -0
  44. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/integration_retry.py +0 -0
  45. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/keyed_document_scope.py +0 -0
  46. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/lifecycle_history.py +0 -0
  47. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/lifecycle_observation.py +0 -0
  48. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/metadata_codec.py +0 -0
  49. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/metadata_relocation.py +0 -0
  50. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/models.py +0 -0
  51. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/mount_diagnostics.py +0 -0
  52. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/multiple_cleanup_recovery.py +0 -0
  53. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/namespace_migration.py +0 -0
  54. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/native_session_recovery.py +0 -0
  55. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/owner_actions.py +0 -0
  56. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/policy.py +0 -0
  57. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/preservation.py +0 -0
  58. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/preserved_cleanup.py +0 -0
  59. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/publication_execution.py +0 -0
  60. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/reconciler.py +0 -0
  61. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/record_updates.py +0 -0
  62. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/recovery_guidance.py +0 -0
  63. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/registration_backfill.py +0 -0
  64. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/registration_prune.py +0 -0
  65. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/release_intents.py +0 -0
  66. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/rendering.py +0 -0
  67. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/resource_admission.py +0 -0
  68. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/retirement_adapters.py +0 -0
  69. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/retirement_execution.py +0 -0
  70. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/semantics.py +0 -0
  71. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/session.py +0 -0
  72. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/session_admission.py +0 -0
  73. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/source_cleanup.py +0 -0
  74. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/source_preservation.py +0 -0
  75. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/source_recovery.py +0 -0
  76. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/store.py +0 -0
  77. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/task_workflow.py +0 -0
  78. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/src/worktree_controller/writer_lease.py +0 -0
  79. {worktree_controller-1.32.10 → worktree_controller-1.32.11}/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.32.10
3
+ Version: 1.32.11
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.32.10 · Linux · Python 3.12 · Apache-2.0**
26
+ **Current release: 1.32.11 · Linux · Python 3.12 · Apache-2.0**
27
27
 
28
28
  ## Install
29
29
 
@@ -32,7 +32,7 @@ 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.32.10
35
+ python -m pip install worktree-controller==1.32.11
36
36
  worktree-controller --version
37
37
  worktree-controller capabilities --json
38
38
  ```
@@ -41,7 +41,7 @@ WC requires Git and readable Linux `/proc`. Other operating systems and Python v
41
41
  supported by this release. Its one runtime dependency is `websockets>=15,<16`.
42
42
  On Ubuntu, if creating the environment reports that `ensurepip` is unavailable, install the
43
43
  distribution's `python3.12-venv` package first (for example, `sudo apt install python3.12-venv`).
44
- Software version 1.32.10 uses CLI contract **61** and storage layout **5**.
44
+ Software version 1.32.11 uses CLI contract **61** and storage layout **5**.
45
45
 
46
46
  ## Try it in a disposable repository
47
47
 
@@ -50,7 +50,7 @@ With the environment above active:
50
50
  ```bash
51
51
  git clone https://github.com/xuanheng-tech/worktree-controller.git wc
52
52
  cd wc
53
- git checkout v1.32.10
53
+ git checkout v1.32.11
54
54
  python examples/quickstart.py --workspace "$HOME/wc-first-run"
55
55
  ```
56
56
 
@@ -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.32.10 · Linux · Python 3.12 · Apache-2.0**
9
+ **Current release: 1.32.11 · Linux · Python 3.12 · Apache-2.0**
10
10
 
11
11
  ## Install
12
12
 
@@ -15,7 +15,7 @@ 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.32.10
18
+ python -m pip install worktree-controller==1.32.11
19
19
  worktree-controller --version
20
20
  worktree-controller capabilities --json
21
21
  ```
@@ -24,7 +24,7 @@ WC requires Git and readable Linux `/proc`. Other operating systems and Python v
24
24
  supported by this release. Its one runtime dependency is `websockets>=15,<16`.
25
25
  On Ubuntu, if creating the environment reports that `ensurepip` is unavailable, install the
26
26
  distribution's `python3.12-venv` package first (for example, `sudo apt install python3.12-venv`).
27
- Software version 1.32.10 uses CLI contract **61** and storage layout **5**.
27
+ Software version 1.32.11 uses CLI contract **61** and storage layout **5**.
28
28
 
29
29
  ## Try it in a disposable repository
30
30
 
@@ -33,7 +33,7 @@ With the environment above active:
33
33
  ```bash
34
34
  git clone https://github.com/xuanheng-tech/worktree-controller.git wc
35
35
  cd wc
36
- git checkout v1.32.10
36
+ git checkout v1.32.11
37
37
  python examples/quickstart.py --workspace "$HOME/wc-first-run"
38
38
  ```
39
39
 
@@ -290,6 +290,24 @@ belongs to the delegated reconciler. Dirty or active work stays with its owner;
290
290
  and immutable receipts are not disposable checkout payloads. For an interrupted release, use
291
291
  `release-recovery-inspect` and replay its exact published recovery arguments.
292
292
 
293
+ From 1.32.11, an already removed feature/audit checkout at `RELEASED_RECORDED` may finish
294
+ its original receipt with its own retained `METADATA_WRITTEN` acquire journal present. The
295
+ original plan and both journal identities must agree with the acquired/released history,
296
+ exact +1 record CAS, retained HEAD and absent checkout, binding and writer lease. Other
297
+ transactions, changed requests and earlier incomplete phases remain blocked. The acquire
298
+ journal is preserved and stays nonterminal until the immutable release receipt is complete.
299
+ This recovery completes evidence only; it does not grant owner authority or business acceptance.
300
+
301
+ If that exact pending release blocks a normal runtime rollout, first deliver and verify the
302
+ repair through source review, tests and normal publication, then stage the exact published
303
+ release through `controller-activate stage`. Its versioned `bin/worktree-controller` is the
304
+ ordinary public CLI: an independently authorized operator may invoke only the original
305
+ `release-recovery-inspect` / returned `release` request with that pinned installed binary.
306
+ Check the public version, staged source manifest and published commit first. No candidate
307
+ activation, active-pin edit, journal edit or rollout exception is involved. Require complete
308
+ exact receipt history, then rerun normal activation with the full governed repository set.
309
+
310
+
293
311
  `reconcile release-plans` keeps plans referenced by durable release receipts. They remain part
294
312
  of closed lifecycle and branch-retirement evidence after the checkout is gone. It retires only
295
313
  unreferenced leftover plans for already released allocations with durable release evidence.
@@ -957,6 +957,14 @@ keeps resolving after the move.
957
957
 
958
958
  ## Unified release plan and disposable resources
959
959
 
960
+ From 1.32.11, removed-release replay also admits its exact retained acquire predecessor
961
+ only for a feature/audit `RELEASED_RECORDED` release. Original plan/journal identity, acquired
962
+ and released history, +1 record CAS, retained HEAD, absence of checkout/binding/writer lease,
963
+ and all existing request/resource recovery guards remain mandatory. No journal is classified
964
+ terminal or changed by that admission; complete immutable release evidence is still required.
965
+ Other transactions and unsupported partial phases remain refused. This changes no command,
966
+ option, capability, CLI contract or storage format.
967
+
960
968
  From 1.32.10, typed cleanup serializes on the existing transactions-directory inode while
961
969
  holding `repo.lock` shared. This excludes normal metadata writers and older exclusive cleanup
962
970
  implementations for the entire operation, while closed history readers retain their existing
@@ -13,7 +13,7 @@ retain their original owners. Release acceptance covers the exact installed cand
13
13
  1.32.7 upgrades and historical 1.30.4 restoration. Publication and local activation remain
14
14
  separate verified steps. The 1.32.9 patch skips unrelated live Git inventory for closed lifecycle selectors while
15
15
  retaining full locked metadata and immutable evidence validation. The 1.32.10 patch keeps closed history readable during typed cleanup while preserving writer,
16
- cleanup, diagnostic and activation serialization. Software version 1.32.10 retains
16
+ cleanup, diagnostic and activation serialization. Software version 1.32.11 retains
17
17
  CLI contract 61, the existing capability versions and storage layout 5, and serializes doctor
18
18
  snapshot reads with normal Controller mutations. Diagnostics refresh Git inventory after taking
19
19
  the shared repository lock, then retain it through semantic, transaction and retirement checks.
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "worktree-controller"
7
- version = "1.32.10"
7
+ version = "1.32.11"
8
8
  description = "Govern Git worktree budgets, authority, ownership, and lifecycle"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12,<3.13"
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "worktree-controller"
7
- version = "1.32.10"
7
+ version = "1.32.11"
8
8
  description = "Govern Git worktree budgets, authority, ownership, and lifecycle"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12,<3.13"
@@ -1,3 +1,3 @@
1
1
  """Worktree lifecycle controller."""
2
2
 
3
- __version__ = "1.32.10"
3
+ __version__ = "1.32.11"
@@ -7820,6 +7820,7 @@ def _release_transaction(
7820
7820
  *,
7821
7821
  target_path: str,
7822
7822
  allocation_id: str | None = None,
7823
+ removed_release_recovery: bool = False,
7823
7824
  ) -> dict[str, Any] | None:
7824
7825
  if not store.transactions_dir.exists():
7825
7826
  return None
@@ -7836,6 +7837,14 @@ def _release_transaction(
7836
7837
  and transaction.get("target_path") == target_path
7837
7838
  and (allocation_id is None or transaction.get("allocation_id") == allocation_id)
7838
7839
  ]
7840
+ if removed_release_recovery and len(matches) == 1 and len(transactions) == 2:
7841
+ from .transaction_scope import acquire_precedes_removed_release
7842
+
7843
+ other, = (row for row in transactions if row is not matches[0])
7844
+ if other.get("command") == "acquire" and acquire_precedes_removed_release(
7845
+ store, other["transaction_id"], matches[0]
7846
+ ):
7847
+ transactions = matches
7839
7848
  if len(matches) > 1 or len(matches) != len(transactions):
7840
7849
  raise ControllerError(
7841
7850
  "INTERRUPTED_TRANSACTION", "another controller transaction requires recovery"
@@ -8561,7 +8570,9 @@ def _recover_or_replay_removed_release(
8561
8570
  raise ControllerError(
8562
8571
  "BLOCK_DRIFT", "release target remains registered but is unavailable"
8563
8572
  )
8564
- transaction = _release_transaction(store, target_path=target_path)
8573
+ transaction = _release_transaction(
8574
+ store, target_path=target_path, removed_release_recovery=not dry_run,
8575
+ )
8565
8576
  if transaction is None:
8566
8577
  matches = [
8567
8578
  receipt
@@ -1071,7 +1071,7 @@
1071
1071
  "session_launcher_entrypoint": "worktree-session",
1072
1072
  "session_entrypoint": "worktree-session-end",
1073
1073
  "tool_name": "worktree-controller",
1074
- "tool_version": "1.32.10",
1074
+ "tool_version": "1.32.11",
1075
1075
  "delivered_closeout_version": 1,
1076
1076
  "retained_archive_version": 1,
1077
1077
  "retention_convergence_version": 2,
@@ -453,6 +453,64 @@ def _acquire_task_progress(store: MetadataStore, journal: dict, head: str) -> st
453
453
  return None
454
454
 
455
455
 
456
+ def acquire_precedes_removed_release(store: MetadataStore, transaction: str, release: dict) -> bool:
457
+ """Permit receipt recovery, never terminal classification, for this exact predecessor.
458
+
459
+ A retained acquire cannot become terminal until the release receipt exists. Only a
460
+ release already recorded at its exact +1 CAS may finish that receipt in its presence.
461
+ Both journals stay authoritative; ordinary mutations and rollout still see them pending.
462
+ """
463
+ _require_flock(store)
464
+ acquire = _journal_preconditions(
465
+ store, transaction, "acquire", frozenset({"METADATA_WRITTEN"})
466
+ )
467
+ if acquire is None or release.get("phase") != "RELEASED_RECORDED":
468
+ return False
469
+ identity = ("repository_id", "allocation_id", "target_path", "branch")
470
+ if any(acquire.get(key) != release.get(key) for key in identity):
471
+ return False
472
+ plan_id = release.get("release_plan_id")
473
+ if not isinstance(plan_id, str):
474
+ return False
475
+ snapshot = store._load_unlocked()
476
+ plan = snapshot.release_plans.get(plan_id)
477
+ record = snapshot.records.get(acquire["allocation_id"])
478
+ if plan is None or record is None or not record.history:
479
+ return False
480
+ if any(release.get(key) != getattr(plan, key) for key in (
481
+ *identity, "expected_head", "expected_record_version",
482
+ )):
483
+ return False
484
+ first, last = record.history[0], record.history[-1]
485
+ if (
486
+ record.role not in {"feature", "audit"}
487
+ or record.role != plan.role
488
+ or record.authority_key != plan.authority_key
489
+ or record.base_commit != acquire["expected_head"]
490
+ or record.task_commit != plan.expected_head
491
+ or record.lifecycle != "RELEASED"
492
+ or record.owner != "unassigned"
493
+ or record.record_version != plan.expected_record_version + 1
494
+ or first.get("event") != "ACQUIRED"
495
+ or first.get("from") is not None
496
+ or first.get("to") != "ACTIVE"
497
+ or first.get("at") != record.created_at
498
+ or last.get("event") not in {"RELEASED", "RELEASE_RECOVERED"}
499
+ or last.get("from") != plan.lifecycle
500
+ or last.get("to") != "RELEASED"
501
+ or _target_state(Path(plan.target_path)) != "absent"
502
+ or _worktree_registration(store.root.parents[1], Path(plan.target_path))[2] != "absent"
503
+ or _allocation_bound_anywhere(store, plan.allocation_id) != "unbound"
504
+ or (store.writer_leases_dir / f"{plan.allocation_id}.json").exists()
505
+ or _branch_ref_state(store.root.parents[1], f"refs/heads/{plan.branch}")
506
+ != (plan.expected_head, "resolved")
507
+ ):
508
+ return False
509
+ from .git_backend import is_ancestor
510
+
511
+ return is_ancestor(store.root.parents[1], acquire["expected_head"], plan.expected_head)
512
+
513
+
456
514
  def acquire_evidence_terminal(store: MetadataStore, transaction: str) -> str | None:
457
515
  """Close an interrupted acquire only on positive current-state proof.
458
516
 
@@ -1071,7 +1071,7 @@
1071
1071
  "session_launcher_entrypoint": "worktree-session",
1072
1072
  "session_entrypoint": "worktree-session-end",
1073
1073
  "tool_name": "worktree-controller",
1074
- "tool_version": "1.32.10",
1074
+ "tool_version": "1.32.11",
1075
1075
  "delivered_closeout_version": 1,
1076
1076
  "retained_archive_version": 1,
1077
1077
  "retention_convergence_version": 2,