cribsheet 0.21.2.dev2__py3-none-any.whl → 0.21.2.dev3__py3-none-any.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.
crib/app.py CHANGED
@@ -3285,10 +3285,16 @@ class Crib:
3285
3285
  new_root = Path(project_path).expanduser().resolve()
3286
3286
  if not new_root.is_dir():
3287
3287
  raise CribUserError(f"no such directory: {new_root}")
3288
- if old in self.code.sweeps or old in self.code_jobs:
3288
+ # a relocate JOB of ours may be mid-flight WITH its own trailing code
3289
+ # sweep (the rehash runs inside the job) — that must JOIN, not fence:
3290
+ # the sweep-conflict refusal exists only when no relocate context exists.
3291
+ if old not in self.relocate_jobs and (
3292
+ old in self.code.sweeps or old in self.code_jobs
3293
+ ):
3289
3294
  raise CribUserError(
3290
- f"a code-index sweep is running for {old!r} — project_cancel "
3291
- "or project_wait it first"
3295
+ f"a code-index sweep is running for {old!r} (not a relocate's "
3296
+ "own) — project_cancel or project_wait it first; a relocate in "
3297
+ "flight would have joined instead"
3292
3298
  )
3293
3299
  if self._reconcile_remaining is not None:
3294
3300
  raise CribUserError(
crib/cli.py CHANGED
@@ -1441,6 +1441,14 @@ def build_parser() -> argparse.ArgumentParser:
1441
1441
  "prefix (citations keep spelling the old dir name; the docs rehash "
1442
1442
  "is skipped so no double-mount)",
1443
1443
  )
1444
+ _sp.add_argument(
1445
+ "--wait-s",
1446
+ type=float,
1447
+ default=None,
1448
+ dest="wait_s",
1449
+ help="block up to N seconds joining the rekey job (default: a "
1450
+ "running handle returns at once; re-invoke to poll/join)",
1451
+ )
1444
1452
  _pf = pjsub.add_parser(
1445
1453
  "forget", help="clear the code index (keeps learnings/notes)"
1446
1454
  )
@@ -2899,12 +2907,13 @@ VERBS: dict[str, Verb] = {
2899
2907
  "project_path": a.project_path,
2900
2908
  "source": getattr(a, "source", None),
2901
2909
  "keep_prefix": getattr(a, "keep_prefix", False),
2910
+ "wait_s": getattr(a, "wait_s", None),
2902
2911
  },
2903
2912
  _E, # the report is structured; json-aware print
2904
2913
  is_async=True,
2905
2914
  policy="none",
2906
2915
  wants_cwd=False, # the new dir is named, never inferred from cwd
2907
- mcp=_PROJ + " source=None keep_prefix=False",
2916
+ mcp=_PROJ + " source=None keep_prefix=False wait_s=None",
2908
2917
  ),
2909
2918
  "project delete": _DELETE_VERB,
2910
2919
  # code index
crib/server.py CHANGED
@@ -936,6 +936,7 @@ def build_server(crib: Crib | None = None):
936
936
  project_path: str | None = None,
937
937
  source: str | None = None,
938
938
  keep_prefix: bool = False,
939
+ wait_s: float | None = None,
939
940
  ) -> dict[str, Any]:
940
941
  """The move-and-rename verb: a repo project's checkout was moved and/or
941
942
  renamed on this machine (works after the fact — the old path may be gone).
@@ -946,13 +947,16 @@ def build_server(crib: Crib | None = None):
946
947
  citation in THIS project's notes is rewritten to the new spelling (the
947
948
  prior note stashed to the ring first). The code index's .source_root and
948
949
  this repo's own .crib `project:` line (when it names the pre-rename name,
949
- fenced by dead-source evidence) are rewritten; the code + docs rehash at
950
- the new path runs at the end (cheap, content-hash gate). Foreign sites are
951
- REPORTED, not edited (other projects citing this repo). Pass
952
- project=<name> AND project_path=<the repo's new dir>; source=<segment>
953
- disambiguates dead in-situ sources; keep_prefix=true = identity-keeping
954
- only (citations keep spelling the old dir name)."""
955
- return await crib.project_relocate(project, project_path, source, keep_prefix)
950
+ fenced by dead-source evidence) are rewritten; the heavy half runs as a
951
+ DAEMON-OWNED job (a client disconnect can't cancel it mid-embed):
952
+ wait_s=None returns a running handle with progress (re-invoke to poll or
953
+ join); wait_s=<seconds> blocks. A trailing CODE rehash surface uses
954
+ project_wait. Foreign sites are REPORTED, not edited. Pass project=<name>
955
+ AND project_path=<the repo's new dir>; source=<segment> disambiguates
956
+ dead in-situ sources; keep_prefix=true = identity-keeping only."""
957
+ return await crib.project_relocate(
958
+ project, project_path, source, keep_prefix, wait_s
959
+ )
956
960
 
957
961
  @crib_tool("source")
958
962
  def project_status(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cribsheet
3
- Version: 0.21.2-dev2
3
+ Version: 0.21.2-dev3
4
4
  Summary: Local MCP server: markdown memory with a Chroma embedding index
5
5
  Requires-Python: >=3.13
6
6
  Requires-Dist: chromadb>=0.5
@@ -1,9 +1,9 @@
1
1
  crib/__init__.py,sha256=zj2qVJwYgLInI0Ie2N4NeJQw1ltiUhCM6_umP4skhcg,1005
2
2
  crib/__main__.py,sha256=umIc03A2oA7s2oiL80Ts_QnS-0zj9fjV3IQ103AmNXg,232
3
- crib/app.py,sha256=plHssTkeyttn3JNYj6hckzNQWgKAhyUU38egWIyR1rE,248675
3
+ crib/app.py,sha256=lRj_jNGNbahXYhXdmE9yWvxlQJdzIf-gYXYWs1vIVgo,249063
4
4
  crib/chunk.py,sha256=GDGpmVE7JhP7zVy0TzbCBSRO0PnQUIXQISsxkC7SWKA,13653
5
5
  crib/claudemem.py,sha256=Xf4mVgTFbXHdhhqteTIRz2zirc4irf0wim8AeMybudI,4804
6
- crib/cli.py,sha256=3CbIsTe605koilnaW-KUwIS61Uc9NT9zC-zGsyRg8gc,139498
6
+ crib/cli.py,sha256=jzbuSjCXrjAKnxGxylQMlhKVu4MZ2OrcrPufzCTiCI8,139812
7
7
  crib/client.py,sha256=fjd2QwvbSNZmq9eXWFgQsMq_2o5-OLH7ZhE48xLxMNs,6602
8
8
  crib/codeindex.py,sha256=Xw-37_uOarZvIledYEUqSzc1PA-DrOVNmdx_94MvJ6E,89312
9
9
  crib/codeindexer.py,sha256=E0A9PGKJPp413-W3R_e5JlxHMnY-9g3Vg1MA9ixNA4w,33769
@@ -28,7 +28,7 @@ crib/project_services.py,sha256=dOPz7RUdw_QS9AeR18d2gcnk6Z9JzeK9nRiFafF_IuI,2112
28
28
  crib/refs.py,sha256=A42tIAg2vsgjp4r7Gdp1PyfmWm46jcnde9j_DfUpxo8,13106
29
29
  crib/retrieve.py,sha256=eeRiI1oE_02H_i_qDsS6804RvBpvh4BkwD-HYcQo35c,22149
30
30
  crib/section_index.py,sha256=nhFEZQBjlfV9y5fpB39Rp5RPFHLnp2nhZbAG8S7fUNg,8846
31
- crib/server.py,sha256=kt-lwN6MVKo68Tl-fwG-g-QyEYdFQIiQbwUw-9r7l-Y,118555
31
+ crib/server.py,sha256=pbMVttMnyy4FjfSyoYZfyMo7gUUuFOYmZC7_cw6L33Y,118716
32
32
  crib/session.py,sha256=HMF_6n6ZIPY3p8mRJfMJ75iByKOoPIUvUJST1r8sSOQ,13631
33
33
  crib/sharedserver.py,sha256=SLGcF3Iax5ThPiFyCJ9ahs3movG-p5nNk0n8dahgWQo,1919
34
34
  crib/sources.py,sha256=gJNhRQeLTKC7v_KSSVGy7kaYgj_9iWJyz_Yd9W8512Q,2918
@@ -39,7 +39,7 @@ crib/tomlrec.py,sha256=ptDbYNhTLmXQeN1BrQGcy2E4wNv0hpKM7aayQ7WvkxE,3796
39
39
  crib/util.py,sha256=pf2iB3cvMC8JG5JJo7vH0t-7qy-d9ABHuSP7AJInauE,3018
40
40
  crib/versions.py,sha256=qFjPG9iFOEyRZ6K5CESM87JvbV1qf4tQoUIvqz-nADk,3621
41
41
  crib/watch.py,sha256=KpH-ipA-wkJVTxeghzM-Y9ljMAyrPxnmMumj3TNchmg,24303
42
- cribsheet-0.21.2.dev2.dist-info/METADATA,sha256=_DWEDLCODXbj5lJvfOfsYS4qvGSG6DYYIeAJHTOZELI,18790
43
- cribsheet-0.21.2.dev2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
44
- cribsheet-0.21.2.dev2.dist-info/entry_points.txt,sha256=CjLxgcZdPGI6U4VRZmrwQ2kL1gUkNykYNkLzT8EQkfQ,39
45
- cribsheet-0.21.2.dev2.dist-info/RECORD,,
42
+ cribsheet-0.21.2.dev3.dist-info/METADATA,sha256=drmN-dW6UT1OODAJf1S8f7gJyFNUOXFsGZUSbU9i9MI,18790
43
+ cribsheet-0.21.2.dev3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
44
+ cribsheet-0.21.2.dev3.dist-info/entry_points.txt,sha256=CjLxgcZdPGI6U4VRZmrwQ2kL1gUkNykYNkLzT8EQkfQ,39
45
+ cribsheet-0.21.2.dev3.dist-info/RECORD,,