cc-continuity 0.3.5__tar.gz → 0.3.7__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.
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/PKG-INFO +1 -1
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/README.md +14 -15
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/__init__.py +1 -1
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/cli.py +80 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity.egg-info/PKG-INFO +1 -1
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/pyproject.toml +1 -1
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_cli.py +42 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/LICENSE +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/__main__.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/atomic.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/blink.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/blink_watch.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/bootstrap.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/checkpoint.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/config.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/daemon_supervisor.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/doctor.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/gitsnap.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/__init__.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/common.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/pre_compact.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/pre_tool_use.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/session_end.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/session_start.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/stop.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/task.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/tool_use.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hooks/user_prompt.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/hosting.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/install.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/launch.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/ledger.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/lock.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/managed.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/naming.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/notify.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/paths.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/power_plug.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/progress_pane.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/project.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/redact.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/rotator.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/settings_merge.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/skills.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/state.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/statusline.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/thresholds.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/transcript.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/validate.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/watchdog.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/watchdog_digest.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity/watchdogd.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity.egg-info/SOURCES.txt +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity.egg-info/dependency_links.txt +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity.egg-info/entry_points.txt +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/cc_continuity.egg-info/top_level.txt +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/setup.cfg +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_atomic.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_blink.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_blink_watch.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_bootstrap.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_checkpoint.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_config.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_daemon_supervisor.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_doctor.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_gitsnap.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_common.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_pre_compact.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_pre_tool_use.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_session_end.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_session_start.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_stop.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_task.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_tool_use.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hooks_user_prompt.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hosting.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_hygiene.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_install.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_integration_phase5.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_integration_phase6.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_integration_phase7.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_launch.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_ledger.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_lock.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_managed.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_naming.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_notify.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_notify_integration.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_paths.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_power_plug.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_progress_pane.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_project.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_redact.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_rotator.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_settings_merge.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_skills.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_state.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_status.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_statusline.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_thresholds.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_tmux_host.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_transcript.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_transcript_finalize.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_uninstall.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_validate.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_watchdog.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_watchdog_digest.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_watchdog_integration.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_watchdogd.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_wsl_doctor.py +0 -0
- {cc_continuity-0.3.5 → cc_continuity-0.3.7}/tests/test_wsl_install.py +0 -0
|
@@ -26,6 +26,14 @@ The five most recent updates, newest first. Each line links to its
|
|
|
26
26
|
commit, so you can see what changed lately without digging through the
|
|
27
27
|
log:
|
|
28
28
|
|
|
29
|
+
- **2026-11-10**: The quickstart now recommends `pipx install` (and
|
|
30
|
+
`uv tool install`) for the CLI - the Python environment stays clean,
|
|
31
|
+
the command lands on PATH
|
|
32
|
+
([commit](https://github.com/pqant/claude-continuity/commit/6ea23a9)).
|
|
33
|
+
- **2026-11-10**: New `cc-continuity ratio [slug]` prints the live
|
|
34
|
+
context ratio of a project on one line - the manual metric-file read
|
|
35
|
+
in trial bookkeeping is gone
|
|
36
|
+
([commit](https://github.com/pqant/claude-continuity/commit/c0e6cdc)).
|
|
29
37
|
- **2026-11-10**: `cc-continuity doctor` now verifies the rotation
|
|
30
38
|
prerequisites in `settings.json` (auto-compact override + context
|
|
31
39
|
window pin) and flags drift with the exact recommended values
|
|
@@ -39,19 +47,6 @@ log:
|
|
|
39
47
|
hard context limit the in-flight tool call now passes and the handoff
|
|
40
48
|
instruction arrives as a neutral notice, so the pane stays clean
|
|
41
49
|
([commit](https://github.com/pqant/claude-continuity/commit/d8e015c)).
|
|
42
|
-
- **2026-11-09**: When the gate does deny a tool (only after the model
|
|
43
|
-
was told to write the handoff and kept working), the full guidance
|
|
44
|
-
shows as an informational message instead of a red error line
|
|
45
|
-
([commit](https://github.com/pqant/claude-continuity/commit/f8a6cc9)).
|
|
46
|
-
- **2026-11-09**: Exported transcript pages now carry a session
|
|
47
|
-
switcher: a header dropdown lists the newest exports of the project
|
|
48
|
-
(the top ten plus the current page) and loads them over plain
|
|
49
|
-
`file://`
|
|
50
|
-
([commit](https://github.com/pqant/claude-continuity/commit/e22f4ac)).
|
|
51
|
-
- **2026-11-09**: The transcript header was rebuilt on a single grid:
|
|
52
|
-
the Sessions label sits under Session Time, the search box keeps a
|
|
53
|
-
fixed width, and labels read bold and high-contrast
|
|
54
|
-
([commit](https://github.com/pqant/claude-continuity/commit/18af742)).
|
|
55
50
|
## How it works
|
|
56
51
|
|
|
57
52
|
The whole flow in one picture: the automatic session loop, the optional
|
|
@@ -119,15 +114,19 @@ exec zsh # reload the shell (claude() wrapper)
|
|
|
119
114
|
cc-continuity doctor # everything should be green
|
|
120
115
|
```
|
|
121
116
|
|
|
122
|
-
From PyPI:
|
|
117
|
+
From PyPI (recommended: `pipx`, the standard way to install Python CLIs):
|
|
123
118
|
|
|
124
119
|
```bash
|
|
125
|
-
|
|
120
|
+
pipx install cc-continuity # or: uv tool install cc-continuity
|
|
126
121
|
cc-continuity install
|
|
127
122
|
exec zsh
|
|
128
123
|
cc-continuity doctor
|
|
129
124
|
```
|
|
130
125
|
|
|
126
|
+
Plain `pip install cc-continuity` also works inside a venv or when
|
|
127
|
+
embedding it as a library; `pipx`/`uv tool` put the CLI on PATH without
|
|
128
|
+
touching your Python environment.
|
|
129
|
+
|
|
131
130
|
On Windows (WSL) the same steps run inside the distro (bash as the
|
|
132
131
|
login shell); the full WSL guide is [`docs/WINDOWS.md`](docs/WINDOWS.md).
|
|
133
132
|
|
|
@@ -64,6 +64,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
64
64
|
p_hist.add_argument("-n", type=int, default=20,
|
|
65
65
|
help="show at most N most recent sessions (default 20)")
|
|
66
66
|
|
|
67
|
+
p_ratio = sub.add_parser("ratio",
|
|
68
|
+
help="print the live context ratio of a project")
|
|
69
|
+
p_ratio.add_argument("slug", nargs="?",
|
|
70
|
+
help="project slug (default: current project)")
|
|
71
|
+
|
|
67
72
|
p_vd = sub.add_parser("validate-draft",
|
|
68
73
|
help="validate a handoff draft (PRD §10.1)")
|
|
69
74
|
p_vd.add_argument("file", help="path to handoff.draft.md")
|
|
@@ -478,6 +483,79 @@ def cmd_history(args: argparse.Namespace) -> int:
|
|
|
478
483
|
return 0
|
|
479
484
|
|
|
480
485
|
|
|
486
|
+
def _project_record(key: str) -> dict | None:
|
|
487
|
+
pfile = paths.project_dir(key) / "project.json"
|
|
488
|
+
try:
|
|
489
|
+
record = json.loads(pfile.read_text(encoding="utf-8"))
|
|
490
|
+
except (OSError, json.JSONDecodeError):
|
|
491
|
+
return None
|
|
492
|
+
return record if isinstance(record, dict) else None
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
def cmd_ratio(args: argparse.Namespace) -> int:
|
|
496
|
+
"""One-shot context ratio for trial bookkeeping (issue #28)."""
|
|
497
|
+
from . import notify # local: keep the module import list tight
|
|
498
|
+
if args.slug:
|
|
499
|
+
pdir = paths.projects_dir()
|
|
500
|
+
matches = [d.name for d in pdir.iterdir()
|
|
501
|
+
if d.is_dir() and notify.project_slug(d.name) == args.slug] \
|
|
502
|
+
if pdir.is_dir() else []
|
|
503
|
+
if len(matches) != 1:
|
|
504
|
+
if not matches:
|
|
505
|
+
print(f"cc-continuity ratio: no project {args.slug!r}",
|
|
506
|
+
file=sys.stderr)
|
|
507
|
+
else:
|
|
508
|
+
print(f"cc-continuity ratio: ambiguous slug {args.slug!r} "
|
|
509
|
+
f"({', '.join(sorted(matches))})", file=sys.stderr)
|
|
510
|
+
return 1
|
|
511
|
+
key = matches[0]
|
|
512
|
+
record = _project_record(key)
|
|
513
|
+
if record is None or not record.get("root"):
|
|
514
|
+
print(f"cc-continuity ratio: unreadable project record for {key}",
|
|
515
|
+
file=sys.stderr)
|
|
516
|
+
return 1
|
|
517
|
+
root = Path(record["root"])
|
|
518
|
+
else:
|
|
519
|
+
root = project.resolve_root(Path.cwd())
|
|
520
|
+
key = project.project_key_for_root(root)
|
|
521
|
+
record = _project_record(key)
|
|
522
|
+
if record is None:
|
|
523
|
+
# fall back to the single globally registered project
|
|
524
|
+
pdir = paths.projects_dir()
|
|
525
|
+
regs = [d for d in pdir.iterdir()
|
|
526
|
+
if d.is_dir() and (d / "project.json").is_file()] \
|
|
527
|
+
if pdir.is_dir() else []
|
|
528
|
+
if len(regs) == 1:
|
|
529
|
+
key = regs[0].name
|
|
530
|
+
record = _project_record(key)
|
|
531
|
+
if record is None or not record.get("root"):
|
|
532
|
+
print(f"cc-continuity ratio: unreadable project record "
|
|
533
|
+
f"for {key}", file=sys.stderr)
|
|
534
|
+
return 1
|
|
535
|
+
root = Path(record["root"])
|
|
536
|
+
else:
|
|
537
|
+
print(f"No cc-continuity project for {root} and "
|
|
538
|
+
f"{len(regs)} registered: pass a slug.",
|
|
539
|
+
file=sys.stderr)
|
|
540
|
+
return 1
|
|
541
|
+
_rec, metric = _resolve_session(root, key)
|
|
542
|
+
if not metric:
|
|
543
|
+
# the runtime marker is statusline-owned; trial runs often have no
|
|
544
|
+
# statusline yet: fall back to the newest registered session.
|
|
545
|
+
for s in reversed((record or {}).get("sessions") or []):
|
|
546
|
+
sid = s.get("session_id") if isinstance(s, dict) else None
|
|
547
|
+
if sid:
|
|
548
|
+
metric = statusline.read_metric(str(sid))
|
|
549
|
+
if metric:
|
|
550
|
+
break
|
|
551
|
+
ratio = (metric or {}).get("ratio")
|
|
552
|
+
if not isinstance(ratio, (int, float)) or isinstance(ratio, bool):
|
|
553
|
+
print(f"{notify.project_slug(key)}: no metrics yet", file=sys.stderr)
|
|
554
|
+
return 1
|
|
555
|
+
print(f"{notify.project_slug(key)} {ratio}")
|
|
556
|
+
return 0
|
|
557
|
+
|
|
558
|
+
|
|
481
559
|
# ----------------------------------------------------------- Phase 4 cmds
|
|
482
560
|
|
|
483
561
|
|
|
@@ -1236,6 +1314,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
1236
1314
|
return cmd_hook(args)
|
|
1237
1315
|
if args.command == "history":
|
|
1238
1316
|
return cmd_history(args)
|
|
1317
|
+
if args.command == "ratio":
|
|
1318
|
+
return cmd_ratio(args)
|
|
1239
1319
|
if args.command == "validate-draft":
|
|
1240
1320
|
return cmd_validate_draft(args)
|
|
1241
1321
|
if args.command == "validate":
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cc-continuity"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.7"
|
|
8
8
|
description = "Zero-touch session rotation for Claude Code (local large-context model)"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
dependencies = [] # stdlib only at runtime (PRD §0.5)
|
|
@@ -122,6 +122,48 @@ def test_history_n_limits_output(cc_home, tmp_path, monkeypatch, capsys):
|
|
|
122
122
|
assert "spike-repo-001" not in out
|
|
123
123
|
|
|
124
124
|
|
|
125
|
+
# -------------------------------------------------------------------- ratio
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def test_ratio_prints_current_project(cc_home, tmp_path, monkeypatch,
|
|
129
|
+
capsys):
|
|
130
|
+
repo = make_repo(tmp_path)
|
|
131
|
+
register_session(repo, session_id=SID)
|
|
132
|
+
set_metric(0.774, session_id=SID)
|
|
133
|
+
monkeypatch.chdir(repo)
|
|
134
|
+
monkeypatch.setenv("CC_CONTINUITY_SESSION", SID)
|
|
135
|
+
assert cli.main(["ratio"]) == 0
|
|
136
|
+
assert capsys.readouterr().out == "spike-repo 0.774\n"
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_ratio_no_metrics_exits_1(cc_home, tmp_path, monkeypatch, capsys):
|
|
140
|
+
repo = make_repo(tmp_path)
|
|
141
|
+
register_session(repo, session_id=SID)
|
|
142
|
+
monkeypatch.chdir(repo)
|
|
143
|
+
monkeypatch.setenv("CC_CONTINUITY_SESSION", SID)
|
|
144
|
+
assert cli.main(["ratio"]) == 1
|
|
145
|
+
assert "no metrics" in capsys.readouterr().err
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_ratio_explicit_slug_from_elsewhere(cc_home, tmp_path, monkeypatch,
|
|
149
|
+
capsys):
|
|
150
|
+
repo = make_repo(tmp_path)
|
|
151
|
+
register_session(repo, session_id=SID)
|
|
152
|
+
set_metric(0.4, session_id=SID)
|
|
153
|
+
elsewhere = make_repo(tmp_path, name="elsewhere-repo")
|
|
154
|
+
monkeypatch.chdir(elsewhere)
|
|
155
|
+
assert cli.main(["ratio", "spike-repo"]) == 0
|
|
156
|
+
assert capsys.readouterr().out == "spike-repo 0.4\n"
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def test_ratio_unknown_slug_exits_1(cc_home, tmp_path, monkeypatch, capsys):
|
|
160
|
+
repo = make_repo(tmp_path)
|
|
161
|
+
register_session(repo, session_id=SID)
|
|
162
|
+
monkeypatch.chdir(repo)
|
|
163
|
+
assert cli.main(["ratio", "nope"]) == 1
|
|
164
|
+
assert "nope" in capsys.readouterr().err
|
|
165
|
+
|
|
166
|
+
|
|
125
167
|
# ------------------------------------------------------------- Phase 4 cmds
|
|
126
168
|
|
|
127
169
|
import os as _os
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|