worktree-runtime 0.1.0a1__cp313-cp313-win_amd64.whl
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.
- _worktree_runtime_rust/__init__.py +5 -0
- _worktree_runtime_rust/_worktree_runtime_rust.cp313-win_amd64.pyd +0 -0
- worktree_runtime/AGENTS.md +14 -0
- worktree_runtime/SURFACE.yaml +224 -0
- worktree_runtime/__init__.py +1 -0
- worktree_runtime/api/__init__.py +148 -0
- worktree_runtime/api/__init__.pyi +144 -0
- worktree_runtime/api.pyi +144 -0
- worktree_runtime/presentation/__init__.py +1 -0
- worktree_runtime/presentation/audit_cli.py +68 -0
- worktree_runtime/py.typed +1 -0
- worktree_runtime-0.1.0a1.dist-info/METADATA +9 -0
- worktree_runtime-0.1.0a1.dist-info/RECORD +17 -0
- worktree_runtime-0.1.0a1.dist-info/WHEEL +4 -0
- worktree_runtime-0.1.0a1.dist-info/entry_points.txt +2 -0
- worktree_runtime-0.1.0a1.dist-info/licenses/LICENSE +15 -0
- worktree_runtime-0.1.0a1.dist-info/sboms/worktree_runtime_pyo3.cyclonedx.json +3159 -0
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# src/worktree_runtime
|
|
2
|
+
|
|
3
|
+
This tree is the Python facade.
|
|
4
|
+
|
|
5
|
+
Allowed in this tree:
|
|
6
|
+
|
|
7
|
+
- `api` re-export
|
|
8
|
+
- `.pyi` stubs
|
|
9
|
+
- `SURFACE.yaml`
|
|
10
|
+
- `presentation/audit_cli.py`
|
|
11
|
+
|
|
12
|
+
Do not implement behavior in new Python modules. Do not add files beyond this facade.
|
|
13
|
+
|
|
14
|
+
If the public surface changes, update `SURFACE.yaml` and `.pyi` in the same change.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
description: worktree_runtime public API surface manifest
|
|
3
|
+
enforced: true
|
|
4
|
+
modules:
|
|
5
|
+
root:
|
|
6
|
+
import_path: worktree_runtime.api
|
|
7
|
+
source_file: src/worktree_runtime/api/__init__.py
|
|
8
|
+
symbols:
|
|
9
|
+
- name: ADAPTIVE_TASK_SHARED_DIR_ENV
|
|
10
|
+
source: _worktree_runtime_rust
|
|
11
|
+
kind: constant
|
|
12
|
+
added_in_wave: issue-1982
|
|
13
|
+
- name: GitHubPolicy
|
|
14
|
+
source: _worktree_runtime_rust
|
|
15
|
+
kind: class
|
|
16
|
+
added_in_wave: rust-primary
|
|
17
|
+
- name: GitWorktree
|
|
18
|
+
source: _worktree_runtime_rust
|
|
19
|
+
kind: class
|
|
20
|
+
added_in_wave: git-domain-vocabulary
|
|
21
|
+
- name: ProjectIdInvalidError
|
|
22
|
+
source: _worktree_runtime_rust
|
|
23
|
+
kind: class
|
|
24
|
+
added_in_wave: rust-primary
|
|
25
|
+
- name: BindingValidationOptions
|
|
26
|
+
source: _worktree_runtime_rust
|
|
27
|
+
kind: class
|
|
28
|
+
added_in_wave: 1
|
|
29
|
+
- name: BindingValidationResult
|
|
30
|
+
source: _worktree_runtime_rust
|
|
31
|
+
kind: class
|
|
32
|
+
added_in_wave: 1
|
|
33
|
+
- name: CURRENT_SCHEMA_VERSION
|
|
34
|
+
source: _worktree_runtime_rust
|
|
35
|
+
kind: constant
|
|
36
|
+
added_in_wave: 1
|
|
37
|
+
- name: LEGACY_PROJECT_ID
|
|
38
|
+
source: _worktree_runtime_rust
|
|
39
|
+
kind: constant
|
|
40
|
+
added_in_wave: 1
|
|
41
|
+
- name: MAIN_BRANCHES
|
|
42
|
+
source: _worktree_runtime_rust
|
|
43
|
+
kind: constant
|
|
44
|
+
added_in_wave: 1
|
|
45
|
+
- name: NOVELER_BRANCH_ENV
|
|
46
|
+
source: _worktree_runtime_rust
|
|
47
|
+
kind: constant
|
|
48
|
+
added_in_wave: 1
|
|
49
|
+
- name: NOVELER_PROJECT_ROOT_ENV
|
|
50
|
+
source: _worktree_runtime_rust
|
|
51
|
+
kind: constant
|
|
52
|
+
added_in_wave: 1
|
|
53
|
+
- name: NOVELER_REPO_ROOT_ENV
|
|
54
|
+
source: _worktree_runtime_rust
|
|
55
|
+
kind: constant
|
|
56
|
+
added_in_wave: 1
|
|
57
|
+
- name: NOVELER_SHARED_DIR_ENV
|
|
58
|
+
source: _worktree_runtime_rust
|
|
59
|
+
kind: constant
|
|
60
|
+
added_in_wave: 1
|
|
61
|
+
- name: NOVELER_STATE_DIR_ENV
|
|
62
|
+
source: _worktree_runtime_rust
|
|
63
|
+
kind: constant
|
|
64
|
+
added_in_wave: 1
|
|
65
|
+
- name: NOVELER_WORKTREE_BASE_ENV
|
|
66
|
+
source: _worktree_runtime_rust
|
|
67
|
+
kind: constant
|
|
68
|
+
added_in_wave: 1
|
|
69
|
+
- name: NOVELER_WORKTREE_ENV
|
|
70
|
+
source: _worktree_runtime_rust
|
|
71
|
+
kind: constant
|
|
72
|
+
added_in_wave: 1
|
|
73
|
+
- name: UV_PROJECT_ENV
|
|
74
|
+
source: _worktree_runtime_rust
|
|
75
|
+
kind: constant
|
|
76
|
+
added_in_wave: 1
|
|
77
|
+
- name: WORKTREE_IDENTITY_ENV_VARS
|
|
78
|
+
source: _worktree_runtime_rust
|
|
79
|
+
kind: constant
|
|
80
|
+
added_in_wave: 1
|
|
81
|
+
- name: WORKTREE_LOCATION_ENV_VARS
|
|
82
|
+
source: _worktree_runtime_rust
|
|
83
|
+
kind: constant
|
|
84
|
+
added_in_wave: 1
|
|
85
|
+
- name: WORKTREE_PROJECT_ENV_VARS
|
|
86
|
+
source: _worktree_runtime_rust
|
|
87
|
+
kind: constant
|
|
88
|
+
added_in_wave: 1
|
|
89
|
+
- name: WORKTREE_RUNTIME_ENV_VARS
|
|
90
|
+
source: _worktree_runtime_rust
|
|
91
|
+
kind: constant
|
|
92
|
+
added_in_wave: 1
|
|
93
|
+
- name: WorktreeBinding
|
|
94
|
+
source: _worktree_runtime_rust
|
|
95
|
+
kind: class
|
|
96
|
+
added_in_wave: 1
|
|
97
|
+
- name: WorktreeBindingStore
|
|
98
|
+
source: _worktree_runtime_rust
|
|
99
|
+
kind: class
|
|
100
|
+
added_in_wave: 1
|
|
101
|
+
- name: WorktreeListEntry
|
|
102
|
+
source: _worktree_runtime_rust
|
|
103
|
+
kind: class
|
|
104
|
+
added_in_wave: issue-2231
|
|
105
|
+
- name: WorktreeListError
|
|
106
|
+
source: _worktree_runtime_rust
|
|
107
|
+
kind: class
|
|
108
|
+
added_in_wave: issue-2231
|
|
109
|
+
- name: WorktreePreconditionResult
|
|
110
|
+
source: _worktree_runtime_rust
|
|
111
|
+
kind: class
|
|
112
|
+
added_in_wave: 1
|
|
113
|
+
- name: is_main_worktree
|
|
114
|
+
source: _worktree_runtime_rust
|
|
115
|
+
kind: function
|
|
116
|
+
added_in_wave: git-domain-vocabulary
|
|
117
|
+
- name: list_worktrees
|
|
118
|
+
source: _worktree_runtime_rust
|
|
119
|
+
kind: function
|
|
120
|
+
added_in_wave: issue-2231
|
|
121
|
+
- name: list_bindings
|
|
122
|
+
source: _worktree_runtime_rust
|
|
123
|
+
kind: function
|
|
124
|
+
added_in_wave: binding-forget
|
|
125
|
+
- name: load_binding
|
|
126
|
+
source: _worktree_runtime_rust
|
|
127
|
+
kind: function
|
|
128
|
+
added_in_wave: 1
|
|
129
|
+
- name: normalize_path
|
|
130
|
+
source: _worktree_runtime_rust
|
|
131
|
+
kind: function
|
|
132
|
+
added_in_wave: 1
|
|
133
|
+
- name: path_fingerprint
|
|
134
|
+
source: _worktree_runtime_rust
|
|
135
|
+
kind: function
|
|
136
|
+
added_in_wave: git-domain-vocabulary
|
|
137
|
+
- name: read_records
|
|
138
|
+
source: _worktree_runtime_rust
|
|
139
|
+
kind: function
|
|
140
|
+
added_in_wave: 1
|
|
141
|
+
- name: reap_rotation_sentinel
|
|
142
|
+
source: _worktree_runtime_rust
|
|
143
|
+
kind: function
|
|
144
|
+
added_in_wave: 1
|
|
145
|
+
- name: record_event
|
|
146
|
+
source: _worktree_runtime_rust
|
|
147
|
+
kind: function
|
|
148
|
+
added_in_wave: 1
|
|
149
|
+
- name: recover_binding
|
|
150
|
+
source: _worktree_runtime_rust
|
|
151
|
+
kind: function
|
|
152
|
+
added_in_wave: 1
|
|
153
|
+
- name: remove_binding
|
|
154
|
+
source: _worktree_runtime_rust
|
|
155
|
+
kind: function
|
|
156
|
+
added_in_wave: binding-forget
|
|
157
|
+
- name: register_binding
|
|
158
|
+
source: _worktree_runtime_rust
|
|
159
|
+
kind: function
|
|
160
|
+
added_in_wave: 1
|
|
161
|
+
- name: resolve_git_worktree
|
|
162
|
+
source: _worktree_runtime_rust
|
|
163
|
+
kind: function
|
|
164
|
+
added_in_wave: git-domain-vocabulary
|
|
165
|
+
- name: resolve_github_policy
|
|
166
|
+
source: _worktree_runtime_rust
|
|
167
|
+
kind: function
|
|
168
|
+
added_in_wave: rust-primary
|
|
169
|
+
- name: resolve_main_branches
|
|
170
|
+
source: _worktree_runtime_rust
|
|
171
|
+
kind: function
|
|
172
|
+
added_in_wave: rust-primary
|
|
173
|
+
- name: resolve_known_worktree_bases
|
|
174
|
+
source: _worktree_runtime_rust
|
|
175
|
+
kind: function
|
|
176
|
+
added_in_wave: 1
|
|
177
|
+
- name: resolve_project_id
|
|
178
|
+
source: _worktree_runtime_rust
|
|
179
|
+
kind: function
|
|
180
|
+
added_in_wave: 1
|
|
181
|
+
- name: resolve_state_dir_name
|
|
182
|
+
source: _worktree_runtime_rust
|
|
183
|
+
kind: function
|
|
184
|
+
added_in_wave: 1
|
|
185
|
+
- name: resolve_worktree_base
|
|
186
|
+
source: _worktree_runtime_rust
|
|
187
|
+
kind: function
|
|
188
|
+
added_in_wave: 1
|
|
189
|
+
- name: resolve_worktree_dir
|
|
190
|
+
source: _worktree_runtime_rust
|
|
191
|
+
kind: function
|
|
192
|
+
added_in_wave: 1
|
|
193
|
+
- name: set_noveler_project_root_for_worktree
|
|
194
|
+
source: _worktree_runtime_rust
|
|
195
|
+
kind: function
|
|
196
|
+
added_in_wave: 1
|
|
197
|
+
- name: state_dir
|
|
198
|
+
source: _worktree_runtime_rust
|
|
199
|
+
kind: function
|
|
200
|
+
added_in_wave: 1
|
|
201
|
+
- name: store_relative_path
|
|
202
|
+
source: _worktree_runtime_rust
|
|
203
|
+
kind: function
|
|
204
|
+
added_in_wave: 1
|
|
205
|
+
- name: validate_binding
|
|
206
|
+
source: _worktree_runtime_rust
|
|
207
|
+
kind: function
|
|
208
|
+
added_in_wave: 1
|
|
209
|
+
- name: validate_current_binding
|
|
210
|
+
source: _worktree_runtime_rust
|
|
211
|
+
kind: function
|
|
212
|
+
added_in_wave: git-domain-vocabulary
|
|
213
|
+
- name: validate_main_worktree
|
|
214
|
+
source: _worktree_runtime_rust
|
|
215
|
+
kind: function
|
|
216
|
+
added_in_wave: git-domain-vocabulary
|
|
217
|
+
- name: worktree_identity_env_vars
|
|
218
|
+
source: _worktree_runtime_rust
|
|
219
|
+
kind: function
|
|
220
|
+
added_in_wave: 1
|
|
221
|
+
- name: worktree_runtime_env_vars
|
|
222
|
+
source: _worktree_runtime_rust
|
|
223
|
+
kind: function
|
|
224
|
+
added_in_wave: 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Worktree runtime package (Rust-primary)."""
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""Public worktree path and binding API.
|
|
2
|
+
|
|
3
|
+
Rust is the implementation SSOT. This module re-exports the PyO3 extension
|
|
4
|
+
``_worktree_runtime_rust``. A missing native module is a hard install error.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from pathlib import Path as _Path
|
|
10
|
+
|
|
11
|
+
from _worktree_runtime_rust import ( # type: ignore[import-not-found]
|
|
12
|
+
ADAPTIVE_TASK_SHARED_DIR_ENV,
|
|
13
|
+
CURRENT_SCHEMA_VERSION,
|
|
14
|
+
GitHubPolicy,
|
|
15
|
+
GitWorktree,
|
|
16
|
+
LEGACY_PROJECT_ID,
|
|
17
|
+
MAIN_BRANCHES,
|
|
18
|
+
NOVELER_BRANCH_ENV,
|
|
19
|
+
NOVELER_PROJECT_ROOT_ENV,
|
|
20
|
+
NOVELER_REPO_ROOT_ENV,
|
|
21
|
+
NOVELER_SHARED_DIR_ENV,
|
|
22
|
+
NOVELER_STATE_DIR_ENV,
|
|
23
|
+
NOVELER_WORKTREE_BASE_ENV,
|
|
24
|
+
NOVELER_WORKTREE_ENV,
|
|
25
|
+
UV_PROJECT_ENV,
|
|
26
|
+
WORKTREE_IDENTITY_ENV_VARS,
|
|
27
|
+
WORKTREE_LOCATION_ENV_VARS,
|
|
28
|
+
WORKTREE_PROJECT_ENV_VARS,
|
|
29
|
+
WORKTREE_RUNTIME_ENV_VARS,
|
|
30
|
+
WorktreeListEntry,
|
|
31
|
+
WorktreeListError,
|
|
32
|
+
is_main_worktree,
|
|
33
|
+
list_bindings,
|
|
34
|
+
list_worktrees,
|
|
35
|
+
load_binding,
|
|
36
|
+
normalize_path,
|
|
37
|
+
path_fingerprint,
|
|
38
|
+
read_records,
|
|
39
|
+
reap_rotation_sentinel,
|
|
40
|
+
record_event,
|
|
41
|
+
recover_binding,
|
|
42
|
+
register_binding,
|
|
43
|
+
remove_binding,
|
|
44
|
+
resolve_git_worktree,
|
|
45
|
+
resolve_github_policy,
|
|
46
|
+
resolve_known_worktree_bases,
|
|
47
|
+
resolve_main_branches,
|
|
48
|
+
resolve_project_id,
|
|
49
|
+
resolve_state_dir_name,
|
|
50
|
+
resolve_worktree_base,
|
|
51
|
+
resolve_worktree_dir,
|
|
52
|
+
set_noveler_project_root_for_worktree,
|
|
53
|
+
state_dir,
|
|
54
|
+
store_relative_path,
|
|
55
|
+
validate_binding,
|
|
56
|
+
validate_current_binding,
|
|
57
|
+
validate_main_worktree,
|
|
58
|
+
worktree_identity_env_vars_py as worktree_identity_env_vars,
|
|
59
|
+
worktree_runtime_env_vars_py as worktree_runtime_env_vars,
|
|
60
|
+
)
|
|
61
|
+
from _worktree_runtime_rust import ( # type: ignore[import-not-found]
|
|
62
|
+
ProjectIdInvalidError,
|
|
63
|
+
PyBindingValidationOptions as BindingValidationOptions,
|
|
64
|
+
PyBindingValidationResult as BindingValidationResult,
|
|
65
|
+
PyWorktreeBinding as WorktreeBinding,
|
|
66
|
+
PyWorktreeBindingStore as WorktreeBindingStore,
|
|
67
|
+
PyWorktreePreconditionResult as WorktreePreconditionResult,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
RUNTIME_IMPL = "rust"
|
|
71
|
+
|
|
72
|
+
_native_list_worktrees = list_worktrees
|
|
73
|
+
_native_list_bindings = list_bindings
|
|
74
|
+
_native_store_relative_path = store_relative_path
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _list_worktrees_as_tuple(repo_root, *, run=None):
|
|
78
|
+
return tuple(_native_list_worktrees(repo_root, run=run))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _list_bindings_as_tuple(repo_root):
|
|
82
|
+
return tuple(_native_list_bindings(repo_root))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _store_relative_path_as_path(project_id=None):
|
|
86
|
+
return _Path(_native_store_relative_path(project_id))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
list_worktrees = _list_worktrees_as_tuple
|
|
90
|
+
list_bindings = _list_bindings_as_tuple
|
|
91
|
+
store_relative_path = _store_relative_path_as_path
|
|
92
|
+
|
|
93
|
+
__all__ = [
|
|
94
|
+
"ADAPTIVE_TASK_SHARED_DIR_ENV",
|
|
95
|
+
"CURRENT_SCHEMA_VERSION",
|
|
96
|
+
"GitHubPolicy",
|
|
97
|
+
"GitWorktree",
|
|
98
|
+
"LEGACY_PROJECT_ID",
|
|
99
|
+
"MAIN_BRANCHES",
|
|
100
|
+
"BindingValidationOptions",
|
|
101
|
+
"BindingValidationResult",
|
|
102
|
+
"NOVELER_BRANCH_ENV",
|
|
103
|
+
"NOVELER_PROJECT_ROOT_ENV",
|
|
104
|
+
"NOVELER_REPO_ROOT_ENV",
|
|
105
|
+
"NOVELER_SHARED_DIR_ENV",
|
|
106
|
+
"NOVELER_STATE_DIR_ENV",
|
|
107
|
+
"NOVELER_WORKTREE_BASE_ENV",
|
|
108
|
+
"NOVELER_WORKTREE_ENV",
|
|
109
|
+
"ProjectIdInvalidError",
|
|
110
|
+
"WorktreeBinding",
|
|
111
|
+
"WorktreeBindingStore",
|
|
112
|
+
"WorktreeListEntry",
|
|
113
|
+
"WorktreeListError",
|
|
114
|
+
"WorktreePreconditionResult",
|
|
115
|
+
"UV_PROJECT_ENV",
|
|
116
|
+
"WORKTREE_IDENTITY_ENV_VARS",
|
|
117
|
+
"WORKTREE_LOCATION_ENV_VARS",
|
|
118
|
+
"WORKTREE_PROJECT_ENV_VARS",
|
|
119
|
+
"WORKTREE_RUNTIME_ENV_VARS",
|
|
120
|
+
"is_main_worktree",
|
|
121
|
+
"list_bindings",
|
|
122
|
+
"list_worktrees",
|
|
123
|
+
"load_binding",
|
|
124
|
+
"normalize_path",
|
|
125
|
+
"path_fingerprint",
|
|
126
|
+
"recover_binding",
|
|
127
|
+
"read_records",
|
|
128
|
+
"reap_rotation_sentinel",
|
|
129
|
+
"record_event",
|
|
130
|
+
"register_binding",
|
|
131
|
+
"remove_binding",
|
|
132
|
+
"resolve_git_worktree",
|
|
133
|
+
"resolve_github_policy",
|
|
134
|
+
"resolve_known_worktree_bases",
|
|
135
|
+
"resolve_main_branches",
|
|
136
|
+
"resolve_project_id",
|
|
137
|
+
"resolve_state_dir_name",
|
|
138
|
+
"resolve_worktree_base",
|
|
139
|
+
"resolve_worktree_dir",
|
|
140
|
+
"set_noveler_project_root_for_worktree",
|
|
141
|
+
"state_dir",
|
|
142
|
+
"store_relative_path",
|
|
143
|
+
"validate_binding",
|
|
144
|
+
"validate_current_binding",
|
|
145
|
+
"validate_main_worktree",
|
|
146
|
+
"worktree_identity_env_vars",
|
|
147
|
+
"worktree_runtime_env_vars",
|
|
148
|
+
]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""Typing stubs for worktree_runtime.api (Rust-primary public surface)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Callable, Mapping, Sequence
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any, Final
|
|
9
|
+
|
|
10
|
+
CURRENT_SCHEMA_VERSION: Final[int]
|
|
11
|
+
LEGACY_PROJECT_ID: Final[str]
|
|
12
|
+
MAIN_BRANCHES: Final[frozenset[str]]
|
|
13
|
+
ADAPTIVE_TASK_SHARED_DIR_ENV: Final[str]
|
|
14
|
+
NOVELER_BRANCH_ENV: Final[str]
|
|
15
|
+
NOVELER_PROJECT_ROOT_ENV: Final[str]
|
|
16
|
+
NOVELER_REPO_ROOT_ENV: Final[str]
|
|
17
|
+
NOVELER_SHARED_DIR_ENV: Final[str]
|
|
18
|
+
NOVELER_STATE_DIR_ENV: Final[str]
|
|
19
|
+
NOVELER_WORKTREE_BASE_ENV: Final[str]
|
|
20
|
+
NOVELER_WORKTREE_ENV: Final[str]
|
|
21
|
+
UV_PROJECT_ENV: Final[str]
|
|
22
|
+
WORKTREE_IDENTITY_ENV_VARS: Final[tuple[str, ...]]
|
|
23
|
+
WORKTREE_LOCATION_ENV_VARS: Final[tuple[str, ...]]
|
|
24
|
+
WORKTREE_PROJECT_ENV_VARS: Final[tuple[str, ...]]
|
|
25
|
+
WORKTREE_RUNTIME_ENV_VARS: Final[tuple[str, ...]]
|
|
26
|
+
RUNTIME_IMPL: str
|
|
27
|
+
|
|
28
|
+
class ProjectIdInvalidError(ValueError):
|
|
29
|
+
reason_code: str
|
|
30
|
+
|
|
31
|
+
class WorktreeListError(Exception): ...
|
|
32
|
+
|
|
33
|
+
class GitHubPolicy:
|
|
34
|
+
pr_title_prefixes: tuple[str, ...]
|
|
35
|
+
main_branches: frozenset[str]
|
|
36
|
+
pr_title_issue_suffix_required: bool
|
|
37
|
+
required_sections_issue: tuple[str, ...]
|
|
38
|
+
required_sections_pr: tuple[str, ...]
|
|
39
|
+
|
|
40
|
+
class GitWorktree:
|
|
41
|
+
git_dir: str
|
|
42
|
+
git_common_dir: str
|
|
43
|
+
toplevel: str
|
|
44
|
+
branch: str
|
|
45
|
+
def is_main_worktree(self) -> bool: ...
|
|
46
|
+
def is_main_branch(self) -> bool: ...
|
|
47
|
+
|
|
48
|
+
class WorktreeListEntry:
|
|
49
|
+
worktree: Path
|
|
50
|
+
branch: str | None
|
|
51
|
+
head: str
|
|
52
|
+
bare: bool
|
|
53
|
+
detached: bool
|
|
54
|
+
locked: bool
|
|
55
|
+
lock_reason: str | None
|
|
56
|
+
prunable: bool
|
|
57
|
+
|
|
58
|
+
class BindingValidationOptions: ...
|
|
59
|
+
class BindingValidationResult: ...
|
|
60
|
+
class WorktreeBinding:
|
|
61
|
+
session_id: str
|
|
62
|
+
worktree: str
|
|
63
|
+
branch: str
|
|
64
|
+
state_path: str
|
|
65
|
+
git_common_dir: str
|
|
66
|
+
main_worktree: str
|
|
67
|
+
commit_ish: str
|
|
68
|
+
schema_version: int
|
|
69
|
+
def to_dict(self) -> dict[str, Any]: ...
|
|
70
|
+
class WorktreeBindingStore: ...
|
|
71
|
+
class WorktreePreconditionResult: ...
|
|
72
|
+
|
|
73
|
+
def path_fingerprint(input_path: str) -> str: ...
|
|
74
|
+
def is_main_worktree(context: GitWorktree) -> bool: ...
|
|
75
|
+
def list_worktrees(
|
|
76
|
+
repo_root: Path,
|
|
77
|
+
*,
|
|
78
|
+
run: Callable[[Sequence[str], Path], Any] | None = None,
|
|
79
|
+
) -> tuple[WorktreeListEntry, ...]: ...
|
|
80
|
+
def list_bindings(repo_root: str) -> tuple[WorktreeBinding, ...]: ...
|
|
81
|
+
def load_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
82
|
+
def normalize_path(raw_path: str = "") -> str: ...
|
|
83
|
+
def recover_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
84
|
+
def remove_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
85
|
+
def read_records(
|
|
86
|
+
branch: str | None = None,
|
|
87
|
+
worktree_path: str | None = None,
|
|
88
|
+
since: datetime | None = None,
|
|
89
|
+
until: datetime | None = None,
|
|
90
|
+
) -> list[Any]: ...
|
|
91
|
+
def reap_rotation_sentinel() -> None: ...
|
|
92
|
+
def record_event(
|
|
93
|
+
kind: str,
|
|
94
|
+
branch: str,
|
|
95
|
+
worktree_path: str,
|
|
96
|
+
invoker: str,
|
|
97
|
+
outcome: str,
|
|
98
|
+
*,
|
|
99
|
+
session_id: str | None = None,
|
|
100
|
+
elapsed_ms: int | None = None,
|
|
101
|
+
correlation_id: str | None = None,
|
|
102
|
+
extra: Mapping[str, Any] | None = None,
|
|
103
|
+
) -> None: ...
|
|
104
|
+
def register_binding(
|
|
105
|
+
session_id: str,
|
|
106
|
+
worktree_path: str,
|
|
107
|
+
branch: str,
|
|
108
|
+
repo_root: str,
|
|
109
|
+
state_path: str | None = None,
|
|
110
|
+
source_ref: str = "",
|
|
111
|
+
) -> WorktreeBinding: ...
|
|
112
|
+
def resolve_git_worktree(cwd: str | None = None) -> GitWorktree | None: ...
|
|
113
|
+
def resolve_github_policy(project_root: str | Path | None = None) -> GitHubPolicy: ...
|
|
114
|
+
def resolve_known_worktree_bases(
|
|
115
|
+
repo_root: str | None = None, home: str | None = None
|
|
116
|
+
) -> list[str]: ...
|
|
117
|
+
def resolve_main_branches(project_root: str | Path | None = None) -> frozenset[str]: ...
|
|
118
|
+
def resolve_project_id(repo_root: str | None = None) -> str: ...
|
|
119
|
+
def resolve_state_dir_name(project_id: str | None = None) -> str: ...
|
|
120
|
+
def resolve_worktree_base(
|
|
121
|
+
explicit_base: str | None = None,
|
|
122
|
+
repo_root: str | None = None,
|
|
123
|
+
home: str | None = None,
|
|
124
|
+
) -> str: ...
|
|
125
|
+
def resolve_worktree_dir(
|
|
126
|
+
worktree_name: str,
|
|
127
|
+
explicit_base: str | None = None,
|
|
128
|
+
repo_root: str | None = None,
|
|
129
|
+
home: str | None = None,
|
|
130
|
+
) -> str: ...
|
|
131
|
+
def set_noveler_project_root_for_worktree(
|
|
132
|
+
target_path: str | None = None,
|
|
133
|
+
) -> dict[str, str]: ...
|
|
134
|
+
def state_dir(repo_root: str | None = None) -> str: ...
|
|
135
|
+
def store_relative_path(project_id: str | None = None) -> Path: ...
|
|
136
|
+
def validate_binding(
|
|
137
|
+
binding: WorktreeBinding, **kwargs: Any
|
|
138
|
+
) -> BindingValidationResult: ...
|
|
139
|
+
def validate_current_binding(**kwargs: Any) -> BindingValidationResult: ...
|
|
140
|
+
def validate_main_worktree(
|
|
141
|
+
cwd: str | None = None, allowed_branches: frozenset[str] | None = None
|
|
142
|
+
) -> WorktreePreconditionResult: ...
|
|
143
|
+
def worktree_identity_env_vars() -> tuple[str, ...]: ...
|
|
144
|
+
def worktree_runtime_env_vars() -> tuple[str, ...]: ...
|
worktree_runtime/api.pyi
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""Typing stubs for worktree_runtime.api (Rust-primary public surface)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Callable, Mapping, Sequence
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any, Final
|
|
9
|
+
|
|
10
|
+
CURRENT_SCHEMA_VERSION: Final[int]
|
|
11
|
+
LEGACY_PROJECT_ID: Final[str]
|
|
12
|
+
MAIN_BRANCHES: Final[frozenset[str]]
|
|
13
|
+
ADAPTIVE_TASK_SHARED_DIR_ENV: Final[str]
|
|
14
|
+
NOVELER_BRANCH_ENV: Final[str]
|
|
15
|
+
NOVELER_PROJECT_ROOT_ENV: Final[str]
|
|
16
|
+
NOVELER_REPO_ROOT_ENV: Final[str]
|
|
17
|
+
NOVELER_SHARED_DIR_ENV: Final[str]
|
|
18
|
+
NOVELER_STATE_DIR_ENV: Final[str]
|
|
19
|
+
NOVELER_WORKTREE_BASE_ENV: Final[str]
|
|
20
|
+
NOVELER_WORKTREE_ENV: Final[str]
|
|
21
|
+
UV_PROJECT_ENV: Final[str]
|
|
22
|
+
WORKTREE_IDENTITY_ENV_VARS: Final[tuple[str, ...]]
|
|
23
|
+
WORKTREE_LOCATION_ENV_VARS: Final[tuple[str, ...]]
|
|
24
|
+
WORKTREE_PROJECT_ENV_VARS: Final[tuple[str, ...]]
|
|
25
|
+
WORKTREE_RUNTIME_ENV_VARS: Final[tuple[str, ...]]
|
|
26
|
+
RUNTIME_IMPL: str
|
|
27
|
+
|
|
28
|
+
class ProjectIdInvalidError(ValueError):
|
|
29
|
+
reason_code: str
|
|
30
|
+
|
|
31
|
+
class WorktreeListError(Exception): ...
|
|
32
|
+
|
|
33
|
+
class GitHubPolicy:
|
|
34
|
+
pr_title_prefixes: tuple[str, ...]
|
|
35
|
+
main_branches: frozenset[str]
|
|
36
|
+
pr_title_issue_suffix_required: bool
|
|
37
|
+
required_sections_issue: tuple[str, ...]
|
|
38
|
+
required_sections_pr: tuple[str, ...]
|
|
39
|
+
|
|
40
|
+
class GitWorktree:
|
|
41
|
+
git_dir: str
|
|
42
|
+
git_common_dir: str
|
|
43
|
+
toplevel: str
|
|
44
|
+
branch: str
|
|
45
|
+
def is_main_worktree(self) -> bool: ...
|
|
46
|
+
def is_main_branch(self) -> bool: ...
|
|
47
|
+
|
|
48
|
+
class WorktreeListEntry:
|
|
49
|
+
worktree: Path
|
|
50
|
+
branch: str | None
|
|
51
|
+
head: str
|
|
52
|
+
bare: bool
|
|
53
|
+
detached: bool
|
|
54
|
+
locked: bool
|
|
55
|
+
lock_reason: str | None
|
|
56
|
+
prunable: bool
|
|
57
|
+
|
|
58
|
+
class BindingValidationOptions: ...
|
|
59
|
+
class BindingValidationResult: ...
|
|
60
|
+
class WorktreeBinding:
|
|
61
|
+
session_id: str
|
|
62
|
+
worktree: str
|
|
63
|
+
branch: str
|
|
64
|
+
state_path: str
|
|
65
|
+
git_common_dir: str
|
|
66
|
+
main_worktree: str
|
|
67
|
+
commit_ish: str
|
|
68
|
+
schema_version: int
|
|
69
|
+
def to_dict(self) -> dict[str, Any]: ...
|
|
70
|
+
class WorktreeBindingStore: ...
|
|
71
|
+
class WorktreePreconditionResult: ...
|
|
72
|
+
|
|
73
|
+
def path_fingerprint(input_path: str) -> str: ...
|
|
74
|
+
def is_main_worktree(context: GitWorktree) -> bool: ...
|
|
75
|
+
def list_worktrees(
|
|
76
|
+
repo_root: Path,
|
|
77
|
+
*,
|
|
78
|
+
run: Callable[[Sequence[str], Path], Any] | None = None,
|
|
79
|
+
) -> tuple[WorktreeListEntry, ...]: ...
|
|
80
|
+
def list_bindings(repo_root: str) -> tuple[WorktreeBinding, ...]: ...
|
|
81
|
+
def load_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
82
|
+
def normalize_path(raw_path: str = "") -> str: ...
|
|
83
|
+
def recover_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
84
|
+
def remove_binding(session_id: str, repo_root: str) -> WorktreeBinding | None: ...
|
|
85
|
+
def read_records(
|
|
86
|
+
branch: str | None = None,
|
|
87
|
+
worktree_path: str | None = None,
|
|
88
|
+
since: datetime | None = None,
|
|
89
|
+
until: datetime | None = None,
|
|
90
|
+
) -> list[Any]: ...
|
|
91
|
+
def reap_rotation_sentinel() -> None: ...
|
|
92
|
+
def record_event(
|
|
93
|
+
kind: str,
|
|
94
|
+
branch: str,
|
|
95
|
+
worktree_path: str,
|
|
96
|
+
invoker: str,
|
|
97
|
+
outcome: str,
|
|
98
|
+
*,
|
|
99
|
+
session_id: str | None = None,
|
|
100
|
+
elapsed_ms: int | None = None,
|
|
101
|
+
correlation_id: str | None = None,
|
|
102
|
+
extra: Mapping[str, Any] | None = None,
|
|
103
|
+
) -> None: ...
|
|
104
|
+
def register_binding(
|
|
105
|
+
session_id: str,
|
|
106
|
+
worktree_path: str,
|
|
107
|
+
branch: str,
|
|
108
|
+
repo_root: str,
|
|
109
|
+
state_path: str | None = None,
|
|
110
|
+
source_ref: str = "",
|
|
111
|
+
) -> WorktreeBinding: ...
|
|
112
|
+
def resolve_git_worktree(cwd: str | None = None) -> GitWorktree | None: ...
|
|
113
|
+
def resolve_github_policy(project_root: str | Path | None = None) -> GitHubPolicy: ...
|
|
114
|
+
def resolve_known_worktree_bases(
|
|
115
|
+
repo_root: str | None = None, home: str | None = None
|
|
116
|
+
) -> list[str]: ...
|
|
117
|
+
def resolve_main_branches(project_root: str | Path | None = None) -> frozenset[str]: ...
|
|
118
|
+
def resolve_project_id(repo_root: str | None = None) -> str: ...
|
|
119
|
+
def resolve_state_dir_name(project_id: str | None = None) -> str: ...
|
|
120
|
+
def resolve_worktree_base(
|
|
121
|
+
explicit_base: str | None = None,
|
|
122
|
+
repo_root: str | None = None,
|
|
123
|
+
home: str | None = None,
|
|
124
|
+
) -> str: ...
|
|
125
|
+
def resolve_worktree_dir(
|
|
126
|
+
worktree_name: str,
|
|
127
|
+
explicit_base: str | None = None,
|
|
128
|
+
repo_root: str | None = None,
|
|
129
|
+
home: str | None = None,
|
|
130
|
+
) -> str: ...
|
|
131
|
+
def set_noveler_project_root_for_worktree(
|
|
132
|
+
target_path: str | None = None,
|
|
133
|
+
) -> dict[str, str]: ...
|
|
134
|
+
def state_dir(repo_root: str | None = None) -> str: ...
|
|
135
|
+
def store_relative_path(project_id: str | None = None) -> Path: ...
|
|
136
|
+
def validate_binding(
|
|
137
|
+
binding: WorktreeBinding, **kwargs: Any
|
|
138
|
+
) -> BindingValidationResult: ...
|
|
139
|
+
def validate_current_binding(**kwargs: Any) -> BindingValidationResult: ...
|
|
140
|
+
def validate_main_worktree(
|
|
141
|
+
cwd: str | None = None, allowed_branches: frozenset[str] | None = None
|
|
142
|
+
) -> WorktreePreconditionResult: ...
|
|
143
|
+
def worktree_identity_env_vars() -> tuple[str, ...]: ...
|
|
144
|
+
def worktree_runtime_env_vars() -> tuple[str, ...]: ...
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Presentation layer: CLI entrypoints for worktree runtime tooling."""
|