xone-cli 0.1.2__tar.gz → 0.1.3__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 (54) hide show
  1. {xone_cli-0.1.2 → xone_cli-0.1.3}/CHANGELOG.md +6 -0
  2. {xone_cli-0.1.2/src/xone_cli.egg-info → xone_cli-0.1.3}/PKG-INFO +11 -2
  3. {xone_cli-0.1.2 → xone_cli-0.1.3}/README.md +10 -1
  4. {xone_cli-0.1.2 → xone_cli-0.1.3}/README.zh-CN.md +10 -1
  5. {xone_cli-0.1.2 → xone_cli-0.1.3}/docs/feedback/open-source-feedback-ledger.md +2 -0
  6. {xone_cli-0.1.2 → xone_cli-0.1.3}/docs/install.md +32 -0
  7. {xone_cli-0.1.2 → xone_cli-0.1.3}/pyproject.toml +1 -1
  8. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/__init__.py +1 -1
  9. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/cli.py +17 -0
  10. xone_cli-0.1.3/src/xone_cli/open_source_eval.py +226 -0
  11. {xone_cli-0.1.2 → xone_cli-0.1.3/src/xone_cli.egg-info}/PKG-INFO +11 -2
  12. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli.egg-info/SOURCES.txt +2 -0
  13. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_cli.py +1 -1
  14. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_docs.py +6 -3
  15. xone_cli-0.1.3/tests/test_open_source_eval.py +139 -0
  16. {xone_cli-0.1.2 → xone_cli-0.1.3}/LICENSE +0 -0
  17. {xone_cli-0.1.2 → xone_cli-0.1.3}/MANIFEST.in +0 -0
  18. {xone_cli-0.1.2 → xone_cli-0.1.3}/docs/product-foundation.md +0 -0
  19. {xone_cli-0.1.2 → xone_cli-0.1.3}/docs/release.md +0 -0
  20. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/aider.json +0 -0
  21. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/anthropics-claude-code.json +0 -0
  22. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/cline.json +0 -0
  23. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/continue.json +0 -0
  24. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/desktop-commander-mcp.json +0 -0
  25. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/docker-mcp-gateway.json +0 -0
  26. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/github-github-mcp-server.json +0 -0
  27. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/microsoft-playwright-mcp.json +0 -0
  28. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/modelcontextprotocol-servers.json +0 -0
  29. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/openai-codex.json +0 -0
  30. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/openhands.json +0 -0
  31. {xone_cli-0.1.2 → xone_cli-0.1.3}/fixtures/open-source-samples/upstash-context7.json +0 -0
  32. {xone_cli-0.1.2 → xone_cli-0.1.3}/ops/constraints/main-entry.md +0 -0
  33. {xone_cli-0.1.2 → xone_cli-0.1.3}/ops/constraints/production.md +0 -0
  34. {xone_cli-0.1.2 → xone_cli-0.1.3}/ops/opt-overlay.md +0 -0
  35. {xone_cli-0.1.2 → xone_cli-0.1.3}/ops/skills/evolution.md +0 -0
  36. {xone_cli-0.1.2 → xone_cli-0.1.3}/setup.cfg +0 -0
  37. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/__main__.py +0 -0
  38. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/evidence.py +0 -0
  39. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/lab.py +0 -0
  40. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/model.py +0 -0
  41. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/release.py +0 -0
  42. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/repo_context.py +0 -0
  43. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/risk.py +0 -0
  44. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/runbook.py +0 -0
  45. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli/tooling.py +0 -0
  46. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli.egg-info/dependency_links.txt +0 -0
  47. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli.egg-info/entry_points.txt +0 -0
  48. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli.egg-info/requires.txt +0 -0
  49. {xone_cli-0.1.2 → xone_cli-0.1.3}/src/xone_cli.egg-info/top_level.txt +0 -0
  50. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_evidence.py +0 -0
  51. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_release.py +0 -0
  52. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_repo_context.py +0 -0
  53. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_risk_lab.py +0 -0
  54. {xone_cli-0.1.2 → xone_cli-0.1.3}/tests/test_tooling.py +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3
4
+
5
+ - Add `xone eval open-source` for repeatable, sanitized open-source adoption evaluation.
6
+ - Support metadata-only evaluation and optional `--clone-root` shallow public clone evaluation.
7
+ - Keep the evaluator read-only by default and document that it does not run third-party scripts, containers, tests, or project commands.
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  - Pin `xone doctor --install-plan` to the current recommended X-One tool versions.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xone-cli
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Unified CLI entry point for X-One Agent Evidence Loop workflows.
5
5
  Author: X-One-AI
6
6
  License-Expression: MIT
@@ -61,6 +61,14 @@ xone runbook --head HEAD --dry-run
61
61
 
62
62
  `xone runbook` auto-detects the local repository default branch. Remote GitHub URLs are not accepted yet; clone the repository first, then pass the local path with `--repo`.
63
63
 
64
+ For repeatable open-source adoption checks, use the read-only evaluator:
65
+
66
+ ```bash
67
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
68
+ ```
69
+
70
+ Add `--clone-root .xone-eval-clones` when you want X-One to shallow-clone public repositories and run only X-One dry-run commands against those local clones. It does not run third-party install scripts, tests, containers, or project commands.
71
+
64
72
  `xone-cli` orchestrates these X-One tools:
65
73
 
66
74
  - `agent-pr-evidence`
@@ -81,7 +89,8 @@ Current recommended tool versions:
81
89
  - It does not post GitHub comments.
82
90
  - It does not modify repositories automatically.
83
91
  - It does not make allow/deny runtime enforcement decisions.
84
- - It does not make hidden network calls.
92
+ - It does not run third-party project scripts.
93
+ - `xone eval open-source` makes explicit GitHub API and `git clone --depth 1` calls only when requested by the command.
85
94
 
86
95
  ## Docs
87
96
 
@@ -34,6 +34,14 @@ xone runbook --head HEAD --dry-run
34
34
 
35
35
  `xone runbook` auto-detects the local repository default branch. Remote GitHub URLs are not accepted yet; clone the repository first, then pass the local path with `--repo`.
36
36
 
37
+ For repeatable open-source adoption checks, use the read-only evaluator:
38
+
39
+ ```bash
40
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
41
+ ```
42
+
43
+ Add `--clone-root .xone-eval-clones` when you want X-One to shallow-clone public repositories and run only X-One dry-run commands against those local clones. It does not run third-party install scripts, tests, containers, or project commands.
44
+
37
45
  `xone-cli` orchestrates these X-One tools:
38
46
 
39
47
  - `agent-pr-evidence`
@@ -54,7 +62,8 @@ Current recommended tool versions:
54
62
  - It does not post GitHub comments.
55
63
  - It does not modify repositories automatically.
56
64
  - It does not make allow/deny runtime enforcement decisions.
57
- - It does not make hidden network calls.
65
+ - It does not run third-party project scripts.
66
+ - `xone eval open-source` makes explicit GitHub API and `git clone --depth 1` calls only when requested by the command.
58
67
 
59
68
  ## Docs
60
69
 
@@ -34,6 +34,14 @@ xone runbook --head HEAD --dry-run
34
34
 
35
35
  `xone runbook` 会自动探测本地仓库默认分支。当前还不直接接收远程 GitHub URL;请先 clone 仓库,再用 `--repo` 传本地路径。
36
36
 
37
+ 如果要重复执行开源样本替代真实用户反馈评测,可以使用只读评测入口:
38
+
39
+ ```bash
40
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
41
+ ```
42
+
43
+ 当你希望 X-One shallow clone 公开仓库并只运行 X-One dry-run 命令时,增加 `--clone-root .xone-eval-clones`。它不会运行第三方安装脚本、测试、容器或项目命令。
44
+
37
45
  `xone-cli` 编排这些 X-One 工具:
38
46
 
39
47
  - `agent-pr-evidence`
@@ -54,7 +62,8 @@ xone runbook --head HEAD --dry-run
54
62
  - 不自动发布 GitHub 评论。
55
63
  - 不自动修改仓库。
56
64
  - 不做 runtime allow/deny enforcement。
57
- - 不做隐藏网络调用。
65
+ - 不运行第三方项目脚本。
66
+ - `xone eval open-source` 只会在用户显式执行该命令时调用 GitHub API 和 `git clone --depth 1`。
58
67
 
59
68
  ## 文档
60
69
 
@@ -12,6 +12,8 @@ Rules:
12
12
 
13
13
  The first ledger entries live in `fixtures/open-source-samples/`.
14
14
 
15
+ Use `xone eval open-source --repos repos.txt --output evaluation.json --format json` to refresh sanitized evaluation records. Add `--clone-root <dir>` only when shallow public clones are acceptable for the review.
16
+
15
17
  | Source | Stars | Forks | Type | Feedback |
16
18
  | --- | ---: | ---: | --- | --- |
17
19
  | modelcontextprotocol/servers | 87186 | 10998 | mcp-server-examples | catalog-update |
@@ -8,6 +8,7 @@ xone --version
8
8
  xone doctor
9
9
  xone doctor --install-plan
10
10
  xone runbook --head HEAD --dry-run
11
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
11
12
  ```
12
13
 
13
14
  ## User Install
@@ -17,6 +18,7 @@ python -m pip install xone-cli
17
18
  xone doctor
18
19
  xone doctor --install-plan
19
20
  xone runbook --head HEAD --dry-run
21
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
20
22
  ```
21
23
 
22
24
  `xone doctor` reports missing X-One tools and shows install guidance.
@@ -35,3 +37,33 @@ Current scenario groups:
35
37
  git clone --depth 1 https://github.com/owner/repo
36
38
  xone runbook --repo repo --head HEAD --dry-run
37
39
  ```
40
+
41
+ ## Open-Source Adoption Evaluation
42
+
43
+ Use `xone eval open-source` when you want a repeatable, sanitized surrogate feedback pass over public repositories.
44
+
45
+ Create a repo list:
46
+
47
+ ```text
48
+ openai/codex
49
+ https://github.com/docker/mcp-gateway
50
+ ```
51
+
52
+ Metadata-only evaluation:
53
+
54
+ ```bash
55
+ xone eval open-source --repos repos.txt --output evaluation.json --format json
56
+ ```
57
+
58
+ Public shallow-clone evaluation:
59
+
60
+ ```bash
61
+ xone eval open-source --repos repos.txt --clone-root .xone-eval-clones --output evaluation.md --format markdown
62
+ ```
63
+
64
+ Safety boundary:
65
+
66
+ - The command records public repository metadata and X-One command summaries.
67
+ - It does not label third-party repositories as safe or unsafe.
68
+ - It does not run third-party install scripts, test scripts, containers, or project commands.
69
+ - `--clone-root` performs `git clone --depth 1` only, then runs X-One dry-run commands against the local clones.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xone-cli"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Unified CLI entry point for X-One Agent Evidence Loop workflows."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
@@ -9,6 +9,7 @@ from collections.abc import Sequence
9
9
  from xone_cli import __version__
10
10
  from xone_cli.evidence import build_failure_packet, collect_evidence, collect_for_runbook, gate_evidence
11
11
  from xone_cli.lab import render_evidence_loop_lab
12
+ from xone_cli.open_source_eval import evaluate_open_source
12
13
  from xone_cli.risk import render_risk_context
13
14
  from xone_cli.runbook import write_runbook
14
15
  from xone_cli.release import print_release_report, verify_release
@@ -71,6 +72,14 @@ def build_parser() -> argparse.ArgumentParser:
71
72
  verify.add_argument("--smoke", action="store_true")
72
73
  verify.add_argument("--json", action="store_true")
73
74
 
75
+ eval_parser = subparsers.add_parser("eval", help="run safe X-One evaluation workflows")
76
+ eval_subparsers = eval_parser.add_subparsers(dest="eval_command")
77
+ open_source = eval_subparsers.add_parser("open-source", help="evaluate public repositories as surrogate feedback")
78
+ open_source.add_argument("--repos", type=Path, required=True, help="text file containing owner/repo or GitHub URLs")
79
+ open_source.add_argument("--clone-root", type=Path, help="optional directory for shallow public clones")
80
+ open_source.add_argument("--output", type=Path, required=True, help="evaluation output path")
81
+ open_source.add_argument("--format", choices=("json", "markdown"), default="json")
82
+
74
83
  runbook = subparsers.add_parser("runbook", help="assemble a local X-One evidence runbook")
75
84
  _add_evidence_collection_args(runbook, require_base=False)
76
85
  runbook.add_argument("--output", type=Path)
@@ -145,6 +154,14 @@ def main(argv: Sequence[str] | None = None) -> int:
145
154
  print_release_report(report, as_json=args.json)
146
155
  return 0 if report["ok"] else 1
147
156
 
157
+ if args.command == "eval" and args.eval_command == "open-source":
158
+ return evaluate_open_source(
159
+ repos_file=args.repos,
160
+ clone_root=args.clone_root,
161
+ output=args.output,
162
+ output_format=args.format,
163
+ )
164
+
148
165
  if args.command == "runbook":
149
166
  code, report, message = collect_for_runbook(
150
167
  repo=args.repo,
@@ -0,0 +1,226 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import subprocess
5
+ import urllib.request
6
+ from dataclasses import dataclass
7
+ from datetime import date
8
+ from pathlib import Path
9
+ from urllib.parse import urlparse
10
+
11
+ from xone_cli.evidence import collect_for_runbook
12
+ from xone_cli.tooling import doctor_status
13
+
14
+
15
+ BATCH_SCHEMA_VERSION = "xone.open_source_evaluation_batch.v1"
16
+ RECORD_SCHEMA_VERSION = "xone.open_source_evaluation.v1"
17
+
18
+
19
+ @dataclass(frozen=True)
20
+ class EvalRecord:
21
+ source: str
22
+ source_url: str
23
+ snapshot_date: str
24
+ stars: int
25
+ forks: int
26
+ open_issues: int
27
+ default_branch: str
28
+ language: str | None
29
+ commands_run: list[dict]
30
+ sanitization: dict
31
+ decision: str
32
+
33
+ def to_dict(self) -> dict:
34
+ return {
35
+ "schema_version": RECORD_SCHEMA_VERSION,
36
+ "source": self.source,
37
+ "source_url": self.source_url,
38
+ "snapshot_date": self.snapshot_date,
39
+ "stars": self.stars,
40
+ "forks": self.forks,
41
+ "open_issues": self.open_issues,
42
+ "default_branch": self.default_branch,
43
+ "language": self.language,
44
+ "categories": [],
45
+ "xone_tools_used": ["xone-cli"],
46
+ "commands_run": self.commands_run,
47
+ "role_findings": [],
48
+ "sanitization": self.sanitization,
49
+ "decision": self.decision,
50
+ }
51
+
52
+
53
+ def evaluate_open_source(
54
+ *,
55
+ repos_file: Path,
56
+ output: Path,
57
+ output_format: str,
58
+ clone_root: Path | None = None,
59
+ snapshot_date: date | None = None,
60
+ ) -> int:
61
+ snapshot = snapshot_date or date.today()
62
+ sources = read_repo_refs(repos_file)
63
+ records = []
64
+ for source in sources:
65
+ metadata = fetch_github_metadata(source, snapshot)
66
+ commands = [
67
+ {
68
+ "name": "doctor-json",
69
+ "command": "xone doctor --json",
70
+ "mode": "read-only",
71
+ "result": "pass" if doctor_status().ok else "needs-install",
72
+ }
73
+ ]
74
+ if clone_root is None:
75
+ commands.append(
76
+ {
77
+ "name": "runbook-dry-run",
78
+ "command": "xone runbook --repo <local-clone> --head HEAD --dry-run",
79
+ "mode": "read-only",
80
+ "result": "skipped",
81
+ "reason": "clone-root not provided",
82
+ }
83
+ )
84
+ else:
85
+ try:
86
+ local_repo = clone_repo(metadata, clone_root)
87
+ except Exception as exc:
88
+ commands.append(
89
+ {
90
+ "name": "shallow-clone",
91
+ "command": f"git clone --depth 1 {metadata['source_url']} <clone-root>",
92
+ "mode": "read-only",
93
+ "result": "fail",
94
+ "output_summary": str(exc),
95
+ }
96
+ )
97
+ else:
98
+ code, _report, message = collect_for_runbook(
99
+ repo=str(local_repo),
100
+ base=None,
101
+ head="HEAD",
102
+ test_logs=[],
103
+ profile="strict",
104
+ dry_run=True,
105
+ )
106
+ commands.append(
107
+ {
108
+ "name": "runbook-dry-run",
109
+ "command": "xone runbook --repo <local-clone> --head HEAD --dry-run",
110
+ "mode": "read-only",
111
+ "result": "pass" if code == 0 else "fail",
112
+ "output_summary": message.strip(),
113
+ }
114
+ )
115
+ records.append(_record_from_metadata(metadata, commands).to_dict())
116
+
117
+ batch = {
118
+ "schema_version": BATCH_SCHEMA_VERSION,
119
+ "snapshot_date": snapshot.isoformat(),
120
+ "records": records,
121
+ }
122
+ if output_format == "json":
123
+ output.write_text(json.dumps(batch, indent=2, sort_keys=True) + "\n", encoding="utf-8")
124
+ else:
125
+ output.write_text(render_markdown(batch), encoding="utf-8")
126
+ print(f"Wrote {len(records)} open-source evaluation records to {output}")
127
+ return 0
128
+
129
+
130
+ def read_repo_refs(path: Path) -> list[str]:
131
+ refs = []
132
+ for line in path.read_text(encoding="utf-8").splitlines():
133
+ value = line.strip()
134
+ if not value or value.startswith("#"):
135
+ continue
136
+ refs.append(normalize_repo_ref(value))
137
+ return refs
138
+
139
+
140
+ def normalize_repo_ref(value: str) -> str:
141
+ parsed = urlparse(value)
142
+ if parsed.netloc == "github.com":
143
+ parts = [part for part in parsed.path.split("/") if part]
144
+ if len(parts) >= 2:
145
+ return f"{parts[0]}/{parts[1].removesuffix('.git')}"
146
+ return value.removesuffix(".git")
147
+
148
+
149
+ def fetch_github_metadata(repo: str, snapshot_date: date) -> dict:
150
+ request = urllib.request.Request(
151
+ f"https://api.github.com/repos/{repo}",
152
+ headers={"Accept": "application/vnd.github+json", "User-Agent": "xone-cli-open-source-eval"},
153
+ )
154
+ with urllib.request.urlopen(request, timeout=20) as response:
155
+ payload = json.load(response)
156
+ return {
157
+ "source": payload["full_name"],
158
+ "source_url": payload["html_url"],
159
+ "snapshot_date": snapshot_date.isoformat(),
160
+ "stars": payload["stargazers_count"],
161
+ "forks": payload["forks_count"],
162
+ "open_issues": payload["open_issues_count"],
163
+ "default_branch": payload["default_branch"],
164
+ "language": payload.get("language"),
165
+ }
166
+
167
+
168
+ def clone_repo(record: dict, root: Path) -> Path:
169
+ root.mkdir(parents=True, exist_ok=True)
170
+ target = root / record["source"].replace("/", "-")
171
+ if (target / ".git").exists():
172
+ return target
173
+ subprocess.run(
174
+ ["git", "clone", "--depth", "1", record["source_url"], str(target)],
175
+ check=True,
176
+ text=True,
177
+ stdout=subprocess.PIPE,
178
+ stderr=subprocess.PIPE,
179
+ )
180
+ return target
181
+
182
+
183
+ def render_markdown(batch: dict) -> str:
184
+ lines = [
185
+ "# X-One Open-Source Adoption Evaluation",
186
+ "",
187
+ f"Snapshot date: {batch['snapshot_date']}",
188
+ "",
189
+ "| Source | Stars | Forks | Issues | Default Branch | Decision |",
190
+ "|---|---:|---:|---:|---|---|",
191
+ ]
192
+ for record in batch["records"]:
193
+ lines.append(
194
+ f"| {record['source']} | {record['stars']} | {record['forks']} | "
195
+ f"{record['open_issues']} | {record['default_branch']} | {record['decision']} |"
196
+ )
197
+ lines.extend(["", "## Command Evidence", ""])
198
+ for record in batch["records"]:
199
+ lines.append(f"### {record['source']}")
200
+ for command in record["commands_run"]:
201
+ lines.append(f"- {command.get('name', command['command'])}: {command['result']}")
202
+ lines.append(f" - command: `{command['command']}`")
203
+ if command.get("output_summary"):
204
+ lines.append(f" - summary: `{command['output_summary']}`")
205
+ lines.append("")
206
+ return "\n".join(lines).rstrip() + "\n"
207
+
208
+
209
+ def _record_from_metadata(metadata: dict, commands: list[dict]) -> EvalRecord:
210
+ return EvalRecord(
211
+ source=metadata["source"],
212
+ source_url=metadata["source_url"],
213
+ snapshot_date=metadata["snapshot_date"],
214
+ stars=metadata["stars"],
215
+ forks=metadata["forks"],
216
+ open_issues=metadata["open_issues"],
217
+ default_branch=metadata["default_branch"],
218
+ language=metadata.get("language"),
219
+ commands_run=commands,
220
+ sanitization={
221
+ "raw_logs_committed": False,
222
+ "secrets_removed": True,
223
+ "third_party_safety_label_used": False,
224
+ },
225
+ decision="defer-with-reason",
226
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xone-cli
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Unified CLI entry point for X-One Agent Evidence Loop workflows.
5
5
  Author: X-One-AI
6
6
  License-Expression: MIT
@@ -61,6 +61,14 @@ xone runbook --head HEAD --dry-run
61
61
 
62
62
  `xone runbook` auto-detects the local repository default branch. Remote GitHub URLs are not accepted yet; clone the repository first, then pass the local path with `--repo`.
63
63
 
64
+ For repeatable open-source adoption checks, use the read-only evaluator:
65
+
66
+ ```bash
67
+ xone eval open-source --repos repos.txt --output evaluation.md --format markdown
68
+ ```
69
+
70
+ Add `--clone-root .xone-eval-clones` when you want X-One to shallow-clone public repositories and run only X-One dry-run commands against those local clones. It does not run third-party install scripts, tests, containers, or project commands.
71
+
64
72
  `xone-cli` orchestrates these X-One tools:
65
73
 
66
74
  - `agent-pr-evidence`
@@ -81,7 +89,8 @@ Current recommended tool versions:
81
89
  - It does not post GitHub comments.
82
90
  - It does not modify repositories automatically.
83
91
  - It does not make allow/deny runtime enforcement decisions.
84
- - It does not make hidden network calls.
92
+ - It does not run third-party project scripts.
93
+ - `xone eval open-source` makes explicit GitHub API and `git clone --depth 1` calls only when requested by the command.
85
94
 
86
95
  ## Docs
87
96
 
@@ -30,6 +30,7 @@ src/xone_cli/cli.py
30
30
  src/xone_cli/evidence.py
31
31
  src/xone_cli/lab.py
32
32
  src/xone_cli/model.py
33
+ src/xone_cli/open_source_eval.py
33
34
  src/xone_cli/release.py
34
35
  src/xone_cli/repo_context.py
35
36
  src/xone_cli/risk.py
@@ -44,6 +45,7 @@ src/xone_cli.egg-info/top_level.txt
44
45
  tests/test_cli.py
45
46
  tests/test_docs.py
46
47
  tests/test_evidence.py
48
+ tests/test_open_source_eval.py
47
49
  tests/test_release.py
48
50
  tests/test_repo_context.py
49
51
  tests/test_risk_lab.py
@@ -12,7 +12,7 @@ def _fake_tool(bin_dir: Path, name: str, body: str = "echo tool") -> None:
12
12
 
13
13
  def test_version_outputs_package_version(capsys):
14
14
  assert main(["--version"]) == 0
15
- assert capsys.readouterr().out.strip() == "xone 0.1.2"
15
+ assert capsys.readouterr().out.strip() == "xone 0.1.3"
16
16
 
17
17
 
18
18
  def test_doctor_json_reports_required_tools(tmp_path, monkeypatch, capsys):
@@ -19,17 +19,20 @@ def test_docs_and_package_metadata_stay_aligned():
19
19
  assert "xone doctor" in english
20
20
  assert "xone doctor --install-plan" in english
21
21
  assert "xone runbook --head HEAD --dry-run" in english
22
+ assert "xone eval open-source" in english
22
23
  assert "Remote GitHub URLs are not accepted yet" in english
23
24
  assert "xone doctor" in chinese
24
25
  assert "xone doctor --install-plan" in chinese
25
26
  assert "xone runbook --head HEAD --dry-run" in chinese
27
+ assert "xone eval open-source" in chinese
26
28
  assert "远程 GitHub URL" in chinese
27
29
  assert "git clone --depth 1 https://github.com/owner/repo" in Path("docs/install.md").read_text(encoding="utf-8")
30
+ assert "xone eval open-source --repos repos.txt" in Path("docs/install.md").read_text(encoding="utf-8")
28
31
  assert "xone release verify --build --install --smoke" in Path("docs/release.md").read_text(encoding="utf-8")
29
32
  assert 'name = "xone-cli"' in pyproject
30
- assert 'version = "0.1.2"' in pyproject
31
- assert __version__ == "0.1.2"
32
- assert "## 0.1.2" in changelog
33
+ assert 'version = "0.1.3"' in pyproject
34
+ assert __version__ == "0.1.3"
35
+ assert "## 0.1.3" in changelog
33
36
  assert 'xone = "xone_cli.cli:entrypoint"' in pyproject
34
37
  assert "python -m pytest -q" in ci
35
38
  assert "xone runbook --base HEAD~1 --head HEAD --dry-run" in ci
@@ -0,0 +1,139 @@
1
+ import json
2
+ from datetime import date
3
+
4
+ from xone_cli.cli import main
5
+
6
+
7
+ def test_eval_open_source_json_outputs_sanitized_records(tmp_path, monkeypatch):
8
+ repos = tmp_path / "repos.txt"
9
+ repos.write_text("openai/codex\nhttps://github.com/docker/mcp-gateway\n", encoding="utf-8")
10
+ output = tmp_path / "records.json"
11
+
12
+ def fake_metadata(repo, snapshot_date):
13
+ return {
14
+ "source": repo,
15
+ "source_url": f"https://github.com/{repo}",
16
+ "snapshot_date": snapshot_date.isoformat(),
17
+ "stars": 10,
18
+ "forks": 2,
19
+ "open_issues": 1,
20
+ "default_branch": "main",
21
+ "language": "Python",
22
+ }
23
+
24
+ monkeypatch.setattr("xone_cli.open_source_eval.fetch_github_metadata", fake_metadata)
25
+
26
+ assert main(["eval", "open-source", "--repos", str(repos), "--output", str(output), "--format", "json"]) == 0
27
+
28
+ payload = json.loads(output.read_text(encoding="utf-8"))
29
+ assert payload["schema_version"] == "xone.open_source_evaluation_batch.v1"
30
+ assert [record["source"] for record in payload["records"]] == ["openai/codex", "docker/mcp-gateway"]
31
+ assert payload["records"][0]["sanitization"] == {
32
+ "raw_logs_committed": False,
33
+ "secrets_removed": True,
34
+ "third_party_safety_label_used": False,
35
+ }
36
+ assert payload["records"][0]["commands_run"][0]["command"] == "xone doctor --json"
37
+ assert payload["records"][0]["commands_run"][1]["result"] == "skipped"
38
+
39
+
40
+ def test_eval_open_source_with_clone_root_runs_local_runbook_dry_run(tmp_path, monkeypatch):
41
+ repos = tmp_path / "repos.txt"
42
+ repos.write_text("upstash/context7\n", encoding="utf-8")
43
+ output = tmp_path / "records.md"
44
+ clone_root = tmp_path / "clones"
45
+
46
+ def fake_metadata(repo, snapshot_date):
47
+ return {
48
+ "source": repo,
49
+ "source_url": f"https://github.com/{repo}",
50
+ "snapshot_date": snapshot_date.isoformat(),
51
+ "stars": 20,
52
+ "forks": 3,
53
+ "open_issues": 4,
54
+ "default_branch": "master",
55
+ "language": "TypeScript",
56
+ }
57
+
58
+ def fake_clone(record, root):
59
+ repo = root / "upstash-context7"
60
+ (repo / ".git").mkdir(parents=True)
61
+ (repo / ".git" / "HEAD").write_text("ref: refs/heads/master\n", encoding="utf-8")
62
+ return repo
63
+
64
+ monkeypatch.setattr("xone_cli.open_source_eval.fetch_github_metadata", fake_metadata)
65
+ monkeypatch.setattr("xone_cli.open_source_eval.clone_repo", fake_clone)
66
+
67
+ assert main(
68
+ [
69
+ "eval",
70
+ "open-source",
71
+ "--repos",
72
+ str(repos),
73
+ "--clone-root",
74
+ str(clone_root),
75
+ "--output",
76
+ str(output),
77
+ "--format",
78
+ "markdown",
79
+ ]
80
+ ) == 0
81
+
82
+ markdown = output.read_text(encoding="utf-8")
83
+ assert "# X-One Open-Source Adoption Evaluation" in markdown
84
+ assert "upstash/context7" in markdown
85
+ assert "runbook-dry-run" in markdown
86
+ assert "--base master" in markdown
87
+
88
+
89
+ def test_eval_open_source_records_clone_failure_without_crashing(tmp_path, monkeypatch):
90
+ repos = tmp_path / "repos.txt"
91
+ repos.write_text("cline/cline\nopenai/codex\n", encoding="utf-8")
92
+ output = tmp_path / "records.json"
93
+ clone_root = tmp_path / "clones"
94
+
95
+ def fake_metadata(repo, snapshot_date):
96
+ return {
97
+ "source": repo,
98
+ "source_url": f"https://github.com/{repo}",
99
+ "snapshot_date": snapshot_date.isoformat(),
100
+ "stars": 10,
101
+ "forks": 2,
102
+ "open_issues": 1,
103
+ "default_branch": "main",
104
+ "language": "TypeScript",
105
+ }
106
+
107
+ def fake_clone(record, root):
108
+ if record["source"] == "cline/cline":
109
+ raise RuntimeError("clone failed")
110
+ repo = root / "openai-codex"
111
+ (repo / ".git").mkdir(parents=True)
112
+ (repo / ".git" / "HEAD").write_text("ref: refs/heads/main\n", encoding="utf-8")
113
+ return repo
114
+
115
+ monkeypatch.setattr("xone_cli.open_source_eval.fetch_github_metadata", fake_metadata)
116
+ monkeypatch.setattr("xone_cli.open_source_eval.clone_repo", fake_clone)
117
+
118
+ assert main(
119
+ [
120
+ "eval",
121
+ "open-source",
122
+ "--repos",
123
+ str(repos),
124
+ "--clone-root",
125
+ str(clone_root),
126
+ "--output",
127
+ str(output),
128
+ "--format",
129
+ "json",
130
+ ]
131
+ ) == 0
132
+
133
+ payload = json.loads(output.read_text(encoding="utf-8"))
134
+ assert [record["source"] for record in payload["records"]] == ["cline/cline", "openai/codex"]
135
+ failed_command = payload["records"][0]["commands_run"][1]
136
+ assert failed_command["name"] == "shallow-clone"
137
+ assert failed_command["result"] == "fail"
138
+ assert failed_command["mode"] == "read-only"
139
+ assert payload["records"][1]["commands_run"][1]["name"] == "runbook-dry-run"
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