worktree-controller 1.32.8__tar.gz → 1.32.9__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.8 → worktree_controller-1.32.9}/PKG-INFO +5 -5
  2. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/README.md +4 -4
  3. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/roadmap.md +3 -2
  4. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/pyproject.toml +1 -1
  5. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/pyproject.toml.orig +1 -1
  6. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/__init__.py +1 -1
  7. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/git_backend.py +16 -2
  8. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/lifecycle_history.py +20 -4
  9. {worktree_controller-1.32.8 → worktree_controller-1.32.9/src/worktree_controller}/tool_cli_contract.json +1 -1
  10. {worktree_controller-1.32.8/src/worktree_controller → worktree_controller-1.32.9}/tool_cli_contract.json +1 -1
  11. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/LICENSE +0 -0
  12. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/architecture.md +0 -0
  13. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/client-integration.md +0 -0
  14. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/daily-workflow.md +0 -0
  15. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/first-change.md +0 -0
  16. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/getting-started.md +0 -0
  17. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/integration-boundaries.md +0 -0
  18. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/operations.md +0 -0
  19. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/publishing.md +0 -0
  20. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/reference.md +0 -0
  21. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/docs/scope.md +0 -0
  22. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/examples/change_task.py +0 -0
  23. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/examples/client_continuation.py +0 -0
  24. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/examples/quickstart.py +0 -0
  25. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/activation_layout.py +0 -0
  26. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/branch_retirement.py +0 -0
  27. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/canonical_refresh.py +0 -0
  28. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/canonical_transition.py +0 -0
  29. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/cleanup_attempts.py +0 -0
  30. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/cleanup_evidence.py +0 -0
  31. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/cleanup_recovery.py +0 -0
  32. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/cli.py +0 -0
  33. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/controller.py +0 -0
  34. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/convergence.py +0 -0
  35. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/delivered_closeout.py +0 -0
  36. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/disposable.py +0 -0
  37. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/environment.py +0 -0
  38. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/frozen_recovery.py +0 -0
  39. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/governance.py +0 -0
  40. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/hardlinks.py +0 -0
  41. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/integration_cleanup.py +0 -0
  42. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/integration_conflict.py +0 -0
  43. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/integration_retry.py +0 -0
  44. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/keyed_document_scope.py +0 -0
  45. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/lifecycle.py +0 -0
  46. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/lifecycle_observation.py +0 -0
  47. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/metadata_codec.py +0 -0
  48. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/metadata_relocation.py +0 -0
  49. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/models.py +0 -0
  50. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/mount_diagnostics.py +0 -0
  51. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/multiple_cleanup_recovery.py +0 -0
  52. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/namespace_migration.py +0 -0
  53. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/native_session_recovery.py +0 -0
  54. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/owner_actions.py +0 -0
  55. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/policy.py +0 -0
  56. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/preservation.py +0 -0
  57. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/preserved_cleanup.py +0 -0
  58. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/publication_execution.py +0 -0
  59. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/reconciler.py +0 -0
  60. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/record_updates.py +0 -0
  61. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/recovery_guidance.py +0 -0
  62. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/registration_backfill.py +0 -0
  63. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/registration_prune.py +0 -0
  64. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/release_intents.py +0 -0
  65. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/rendering.py +0 -0
  66. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/resource_admission.py +0 -0
  67. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/retirement_adapters.py +0 -0
  68. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/retirement_execution.py +0 -0
  69. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/semantics.py +0 -0
  70. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/session.py +0 -0
  71. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/session_admission.py +0 -0
  72. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/source_cleanup.py +0 -0
  73. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/source_preservation.py +0 -0
  74. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/source_recovery.py +0 -0
  75. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/store.py +0 -0
  76. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/task_workflow.py +0 -0
  77. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/transaction_scope.py +0 -0
  78. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/src/worktree_controller/writer_lease.py +0 -0
  79. {worktree_controller-1.32.8 → worktree_controller-1.32.9}/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.8
3
+ Version: 1.32.9
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.8 · Linux · Python 3.12 · Apache-2.0**
26
+ **Current release: 1.32.9 · 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.8
35
+ python -m pip install worktree-controller==1.32.9
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.8 uses CLI contract **61** and storage layout **5**.
44
+ Software version 1.32.9 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.8
53
+ git checkout v1.32.9
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.8 · Linux · Python 3.12 · Apache-2.0**
9
+ **Current release: 1.32.9 · 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.8
18
+ python -m pip install worktree-controller==1.32.9
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.8 uses CLI contract **61** and storage layout **5**.
27
+ Software version 1.32.9 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.8
36
+ git checkout v1.32.9
37
37
  python examples/quickstart.py --workspace "$HOME/wc-first-run"
38
38
  ```
39
39
 
@@ -6,12 +6,13 @@ direction. Each stage needs its own tested deliverable; later ideas are not curr
6
6
  ## Current baseline
7
7
 
8
8
  WC 1.32.6 completed the runtime-visibility fix and the previously planned allocation-to-intent
9
- query extraction. The 1.32.8 maintenance candidate places shared bounded, FD-bound document reads
9
+ query extraction. The 1.32.8 maintenance release places shared bounded, FD-bound document reads
10
10
  in the existing cleanup evidence module, removing four private imports (76 to 72). Raw-byte
11
11
  hashes, file/ancestor checks, limits and refusal codes stay unchanged; mutation and crash hooks
12
12
  retain their original owners. Release acceptance covers the exact installed candidate, ordinary
13
13
  1.32.7 upgrades and historical 1.30.4 restoration. Publication and local activation remain
14
- separate verified steps. Software version 1.32.8 retains
14
+ separate verified steps. The 1.32.9 patch skips unrelated live Git inventory for closed lifecycle selectors while
15
+ retaining full locked metadata and immutable evidence validation. Software version 1.32.9 retains
15
16
  CLI contract 61, the existing capability versions and storage layout 5, and serializes doctor
16
17
  snapshot reads with normal Controller mutations. Diagnostics refresh Git inventory after taking
17
18
  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.8"
7
+ version = "1.32.9"
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.8"
7
+ version = "1.32.9"
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.8"
3
+ __version__ = "1.32.9"
@@ -219,8 +219,7 @@ def _observe_each[T](function: Callable[[Path], T], paths: Sequence[Path]) -> li
219
219
  return [pool.submit(function, item) for item in paths]
220
220
 
221
221
 
222
- def inventory(path: Path) -> RepositoryInventory:
223
- requested_root, common = resolve_repository(path)
222
+ def _registered_worktrees(requested_root: Path, common: Path) -> list[dict[str, str | bool]]:
224
223
  raw = _git(requested_root, "worktree", "list", "--porcelain", "-z").stdout
225
224
  parsed = _parse_porcelain(raw)
226
225
  # Git's main entry can name the common directory itself after
@@ -245,6 +244,21 @@ def inventory(path: Path) -> RepositoryInventory:
245
244
  ):
246
245
  raise ControllerError("GIT_DRIFT", "separate Git directory canonical mapping differs")
247
246
  parsed[0]["path"] = os.fspath(canonical)
247
+ return parsed
248
+
249
+
250
+ def canonical_checkout(path: Path) -> Path:
251
+ """Resolve Git's canonical checkout without observing live worktree contents."""
252
+ requested_root, common = resolve_repository(path)
253
+ parsed = _registered_worktrees(requested_root, common)
254
+ if parsed[0].get("bare") is True:
255
+ raise ControllerError("GIT_ERROR", "bare worktrees are unsupported")
256
+ return Path(str(parsed[0]["path"])).resolve(strict=True)
257
+
258
+
259
+ def inventory(path: Path) -> RepositoryInventory:
260
+ requested_root, common = resolve_repository(path)
261
+ parsed = _registered_worktrees(requested_root, common)
248
262
  canonical_path = Path(str(parsed[0]["path"])).resolve(strict=True)
249
263
  present = [
250
264
  record.get("bare") is not True and Path(str(record["path"])).exists() for record in parsed
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
  from typing import Any
9
9
 
10
10
  from .controller import envelope
11
- from .git_backend import inventory, resolve_repository
11
+ from .git_backend import canonical_checkout, inventory, resolve_repository
12
12
  from .models import (
13
13
  ControllerError,
14
14
  MetadataRecord,
@@ -246,7 +246,6 @@ def lifecycle_history(
246
246
  store = MetadataStore(common)
247
247
  with store.lock(exclusive=False):
248
248
  snapshot = store._load_unlocked()
249
- repository = inventory(repository_path)
250
249
  wanted = None
251
250
  if integration_intent_id is not None:
252
251
  intent = snapshot.integration_intents.get(integration_intent_id)
@@ -267,6 +266,23 @@ def lifecycle_history(
267
266
  and (task_key is None or identity["task_key"] == task_key)
268
267
  )
269
268
 
269
+ # A receipt query has no live projection; other selectors only need Git
270
+ # inventory when a matching record is still bound to a checkout. Keep the
271
+ # full locked metadata validation even for entirely closed history.
272
+ bound_records = (
273
+ snapshot.records.get(allocation) for allocation in set(snapshot.bindings.values())
274
+ )
275
+ needs_live_inventory = release_receipt_id is None and any(
276
+ record is not None and matches(asdict(record)) for record in bound_records
277
+ )
278
+ if needs_live_inventory:
279
+ repository = inventory(repository_path)
280
+ canonical_path = repository.canonical_path
281
+ worktrees = repository.worktrees
282
+ else:
283
+ canonical_path = canonical_checkout(repository_path)
284
+ worktrees = ()
285
+
270
286
  closed = []
271
287
  matching_count = 0
272
288
  index = None
@@ -301,7 +317,7 @@ def lifecycle_history(
301
317
  closed.append(row)
302
318
  live = []
303
319
  if release_receipt_id is None:
304
- for item in repository.worktrees:
320
+ for item in worktrees:
305
321
  record = snapshot.records.get(snapshot.bindings.get(item.key, ""))
306
322
  if record is not None and matches(asdict(record)):
307
323
  live.append(
@@ -339,7 +355,7 @@ def lifecycle_history(
339
355
  payload = envelope("lifecycle-history")
340
356
  payload["repository"] = {
341
357
  "repository_id": snapshot.repository_id,
342
- "canonical_path": str(repository.canonical_path),
358
+ "canonical_path": str(canonical_path),
343
359
  "common_dir": str(common),
344
360
  "metadata_path": str(store.root),
345
361
  }
@@ -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.8",
1074
+ "tool_version": "1.32.9",
1075
1075
  "delivered_closeout_version": 1,
1076
1076
  "retained_archive_version": 1,
1077
1077
  "retention_convergence_version": 2,
@@ -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.8",
1074
+ "tool_version": "1.32.9",
1075
1075
  "delivered_closeout_version": 1,
1076
1076
  "retained_archive_version": 1,
1077
1077
  "retention_convergence_version": 2,