agentpace 0.12.3__tar.gz → 0.12.5__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 (106) hide show
  1. agentpace-0.12.5/.claude-plugin/marketplace.json +12 -0
  2. {agentpace-0.12.3 → agentpace-0.12.5}/CHANGELOG.md +21 -0
  3. {agentpace-0.12.3 → agentpace-0.12.5}/CITATION.cff +1 -1
  4. {agentpace-0.12.3 → agentpace-0.12.5}/PKG-INFO +1 -1
  5. {agentpace-0.12.3 → agentpace-0.12.5}/docs/cli.md +1 -1
  6. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/__init__.py +1 -1
  7. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/schema.py +14 -11
  8. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/share.py +10 -2
  9. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_ingest.py +18 -0
  10. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_share_validate.py +82 -0
  11. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_skills.py +47 -0
  12. {agentpace-0.12.3 → agentpace-0.12.5}/.gitattributes +0 -0
  13. {agentpace-0.12.3 → agentpace-0.12.5}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  14. {agentpace-0.12.3 → agentpace-0.12.5}/.github/ISSUE_TEMPLATE/ingest-found-nothing.yml +0 -0
  15. {agentpace-0.12.3 → agentpace-0.12.5}/.github/ISSUE_TEMPLATE/remove-my-rows.yml +0 -0
  16. {agentpace-0.12.3 → agentpace-0.12.5}/.github/dependabot.yml +0 -0
  17. {agentpace-0.12.3 → agentpace-0.12.5}/.github/pull_request_template.md +0 -0
  18. {agentpace-0.12.3 → agentpace-0.12.5}/.github/workflows/ci.yml +0 -0
  19. {agentpace-0.12.3 → agentpace-0.12.5}/.github/workflows/publish.yml +0 -0
  20. {agentpace-0.12.3 → agentpace-0.12.5}/.github/workflows/validate-data.yml +0 -0
  21. {agentpace-0.12.3 → agentpace-0.12.5}/.gitignore +0 -0
  22. {agentpace-0.12.3 → agentpace-0.12.5}/CODE_OF_CONDUCT.md +0 -0
  23. {agentpace-0.12.3 → agentpace-0.12.5}/CONTRIBUTING.md +0 -0
  24. {agentpace-0.12.3 → agentpace-0.12.5}/LICENSE +0 -0
  25. {agentpace-0.12.3 → agentpace-0.12.5}/README.md +0 -0
  26. {agentpace-0.12.3 → agentpace-0.12.5}/SECURITY.md +0 -0
  27. {agentpace-0.12.3 → agentpace-0.12.5}/data/LICENSE +0 -0
  28. {agentpace-0.12.3 → agentpace-0.12.5}/data/README.md +0 -0
  29. {agentpace-0.12.3 → agentpace-0.12.5}/data/runs/4546788e7930eccd-2026-W40-2026-W45.jsonl +0 -0
  30. {agentpace-0.12.3 → agentpace-0.12.5}/data/runs/4546788e7930eccd-2026-W44-2026-W45.jsonl +0 -0
  31. {agentpace-0.12.3 → agentpace-0.12.5}/docs/.nojekyll +0 -0
  32. {agentpace-0.12.3 → agentpace-0.12.5}/docs/DESIGN.md +0 -0
  33. {agentpace-0.12.3 → agentpace-0.12.5}/docs/assets/backtest-coverage.svg +0 -0
  34. {agentpace-0.12.3 → agentpace-0.12.5}/docs/assets/hero.webp +0 -0
  35. {agentpace-0.12.3 → agentpace-0.12.5}/docs/assets/run-ranges.svg +0 -0
  36. {agentpace-0.12.3 → agentpace-0.12.5}/docs/assets/social-preview.png +0 -0
  37. {agentpace-0.12.3 → agentpace-0.12.5}/docs/backtest.json +0 -0
  38. {agentpace-0.12.3 → agentpace-0.12.5}/docs/backtest.md +0 -0
  39. {agentpace-0.12.3 → agentpace-0.12.5}/docs/index.html +0 -0
  40. {agentpace-0.12.3 → agentpace-0.12.5}/docs/releasing.md +0 -0
  41. {agentpace-0.12.3 → agentpace-0.12.5}/docs/robots.txt +0 -0
  42. {agentpace-0.12.3 → agentpace-0.12.5}/docs/sitemap.xml +0 -0
  43. {agentpace-0.12.3 → agentpace-0.12.5}/docs/verify-adapter.md +0 -0
  44. {agentpace-0.12.3 → agentpace-0.12.5}/examples/plan.json +0 -0
  45. {agentpace-0.12.3 → agentpace-0.12.5}/examples/quote-plan.json +0 -0
  46. {agentpace-0.12.3 → agentpace-0.12.5}/experiments/model_offset/PROTOCOL.md +0 -0
  47. {agentpace-0.12.3 → agentpace-0.12.5}/pyproject.toml +0 -0
  48. {agentpace-0.12.3 → agentpace-0.12.5}/schema/run.schema.json +0 -0
  49. {agentpace-0.12.3 → agentpace-0.12.5}/schema/turn.schema.json +0 -0
  50. {agentpace-0.12.3 → agentpace-0.12.5}/skills/agentpace/SKILL.md +0 -0
  51. {agentpace-0.12.3 → agentpace-0.12.5}/skills/agentpace/assets/portable-prompt.md +0 -0
  52. {agentpace-0.12.3 → agentpace-0.12.5}/skills/agentpace/references/method.md +0 -0
  53. {agentpace-0.12.3 → agentpace-0.12.5}/skills/pace-estimate/SKILL.md +0 -0
  54. {agentpace-0.12.3 → agentpace-0.12.5}/skills/pace-log/SKILL.md +0 -0
  55. {agentpace-0.12.3 → agentpace-0.12.5}/skills/pace-share/SKILL.md +0 -0
  56. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/__main__.py +0 -0
  57. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/__init__.py +0 -0
  58. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/base.py +0 -0
  59. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/claude_code.py +0 -0
  60. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/cline.py +0 -0
  61. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/codex.py +0 -0
  62. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/gemini_cli.py +0 -0
  63. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/adapters/opencode.py +0 -0
  64. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/backtest.py +0 -0
  65. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/cache.py +0 -0
  66. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/charts.py +0 -0
  67. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/claims.py +0 -0
  68. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/classify.py +0 -0
  69. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/cli.py +0 -0
  70. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/estimate.py +0 -0
  71. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/forecasts.py +0 -0
  72. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/ingest.py +0 -0
  73. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/paths.py +0 -0
  74. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/pseudonym.py +0 -0
  75. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/py.typed +0 -0
  76. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/render.py +0 -0
  77. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/report.py +0 -0
  78. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/site.py +0 -0
  79. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/turns.py +0 -0
  80. {agentpace-0.12.3 → agentpace-0.12.5}/src/agentpace/validate.py +0 -0
  81. {agentpace-0.12.3 → agentpace-0.12.5}/tests/__init__.py +0 -0
  82. {agentpace-0.12.3 → agentpace-0.12.5}/tests/fixtures/__init__.py +0 -0
  83. {agentpace-0.12.3 → agentpace-0.12.5}/tests/fixtures/cline_tasks.py +0 -0
  84. {agentpace-0.12.3 → agentpace-0.12.5}/tests/fixtures/gemini_cli.py +0 -0
  85. {agentpace-0.12.3 → agentpace-0.12.5}/tests/fixtures/opencode.py +0 -0
  86. {agentpace-0.12.3 → agentpace-0.12.5}/tests/synthetic.py +0 -0
  87. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_backtest.py +0 -0
  88. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_claims.py +0 -0
  89. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_classify.py +0 -0
  90. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_cli.py +0 -0
  91. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_cline.py +0 -0
  92. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_codex.py +0 -0
  93. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_counts.py +0 -0
  94. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_docs.py +0 -0
  95. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_estimate.py +0 -0
  96. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_forecasts.py +0 -0
  97. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_frozen_method.py +0 -0
  98. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_gemini_cli.py +0 -0
  99. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_labels.py +0 -0
  100. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_opencode.py +0 -0
  101. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_outcomes.py +0 -0
  102. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_plan_risk.py +0 -0
  103. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_review_capacity.py +0 -0
  104. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_schema.py +0 -0
  105. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_site.py +0 -0
  106. {agentpace-0.12.3 → agentpace-0.12.5}/tests/test_turns.py +0 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "agentpace",
3
+ "owner": { "name": "mohamedzhioua" },
4
+ "description": "The agentpace plugin: estimates of coding-agent work from measured agent runs.",
5
+ "plugins": [
6
+ {
7
+ "name": "agentpace",
8
+ "source": "./",
9
+ "description": "Estimates how long software work will take when coding agents do it, from measured agent runs: P50/P80/P90 ranges with the human part stated apart. Four skills; needs the agentpace Python CLI on PATH."
10
+ }
11
+ ]
12
+ }
@@ -4,6 +4,27 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) an
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.12.5 - 2026-11-09
8
+
9
+ ### Added
10
+
11
+ - `.claude-plugin/marketplace.json`, so the repository can serve as a Claude Code plugin marketplace. It lists one plugin served from the repository root, with no bundled hook. Not yet documented: the install route is advertised after a real install is checked.
12
+
13
+ No published number moved.
14
+
15
+ ## 0.12.4 - 2026-11-09
16
+
17
+ ### Fixed
18
+
19
+ - A rows file that is not UTF-8 is refused as `<file>: file is not UTF-8` with exit 2, instead of the codec's message.
20
+ - `share --write` into a folder it cannot write says so, leaves everything as it was and exits 2, instead of a traceback.
21
+
22
+ ### Changed
23
+
24
+ - `docs/cli.md` says to run `ingest` by hand when the quiet hook stops producing rows: it prints what the hook could not, such as a store line that is not valid JSON.
25
+
26
+ No published number moved.
27
+
7
28
  ## 0.12.3 - 2026-11-09
8
29
 
9
30
  ### Added
@@ -8,7 +8,7 @@ authors:
8
8
  repository-code: https://github.com/mohamedzhioua/agentpace
9
9
  url: https://mohamedzhioua.github.io/agentpace/
10
10
  license: MIT
11
- version: 0.12.3
11
+ version: 0.12.5
12
12
  date-released: 2026-11-09
13
13
  keywords:
14
14
  - coding agents
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentpace
3
- Version: 0.12.3
3
+ Version: 0.12.5
4
4
  Summary: Stop estimating agent work in human weeks. agentpace measures how long coding agents actually take: P50/P80/P90 ranges from real Claude Code and Codex runs, the human part stated apart, never derived. Open CC0 dataset, zero-dependency Python CLI, agent skill.
5
5
  Project-URL: Homepage, https://mohamedzhioua.github.io/agentpace/
6
6
  Project-URL: Repository, https://github.com/mohamedzhioua/agentpace
@@ -63,7 +63,7 @@ Reads a harness's local history and merges the rows into the store. Only timesta
63
63
  | `--out` | `~/.agentpace/runs.jsonl` | The rows file to merge into. |
64
64
  | `--idle-cap` | `900` | Seconds an idle gap may contribute, inside a run's duration and between runs on the session clock. A non-default cap neither reads nor writes the cache. |
65
65
  | `--kind-map NAME=KIND` | none | Map one of your agent types to a task kind. Repeatable. |
66
- | `--hook` | off | Read a Claude Code `SubagentStop` payload on stdin and ingest that session quietly. Prints nothing and always exits 0. Gives up after 5 s if the store is busy. |
66
+ | `--hook` | off | Read a Claude Code `SubagentStop` payload on stdin and ingest that session quietly. Prints nothing and always exits 0. Gives up after 5 s if the store is busy. Because it cannot report, run `agentpace ingest` by hand when runs stop appearing: it prints what the hook could not, such as a store line that is not valid JSON. |
67
67
 
68
68
  stdout: nothing. stderr: a note when the source is experimental, then the report (files seen, read from cache, rows produced, empty runs, unreadable files, unparsed lines, zero-duration, still running, and skipped files or runs when there are any), then `store now holds: N rows`.
69
69
 
@@ -1,3 +1,3 @@
1
1
  """agentpace: real run times for coding agents, as P50/P80/P90 ranges."""
2
2
 
3
- __version__ = "0.12.3"
3
+ __version__ = "0.12.5"
@@ -102,17 +102,20 @@ def dedupe_key(row: Row) -> tuple[str, str, int, int]:
102
102
  def read_rows(path: Path) -> list[Row]:
103
103
  """Every row in `path`. A bad line is named by file and line number, never by its content."""
104
104
  rows: list[Row] = []
105
- with path.open(encoding="utf-8") as handle:
106
- for number, line in enumerate(handle, start=1):
107
- if not line.strip():
108
- continue
109
- try:
110
- row = json.loads(line)
111
- except ValueError:
112
- raise ValueError(f"{path.name}:{number}: not valid JSON") from None
113
- if not isinstance(row, dict):
114
- raise ValueError(f"{path.name}:{number}: not a JSON object")
115
- rows.append(row)
105
+ try:
106
+ with path.open(encoding="utf-8") as handle:
107
+ for number, line in enumerate(handle, start=1):
108
+ if not line.strip():
109
+ continue
110
+ try:
111
+ row = json.loads(line)
112
+ except ValueError:
113
+ raise ValueError(f"{path.name}:{number}: not valid JSON") from None
114
+ if not isinstance(row, dict):
115
+ raise ValueError(f"{path.name}:{number}: not a JSON object")
116
+ rows.append(row)
117
+ except UnicodeDecodeError:
118
+ raise ValueError(f"{path.name}: file is not UTF-8") from None
116
119
  return rows
117
120
 
118
121
 
@@ -101,9 +101,17 @@ def write_contribution(path: Path, rows: Sequence[Row]) -> tuple[int, int]:
101
101
  if old and not old.endswith(b"\n"):
102
102
  old += b"\n"
103
103
  new = "".join(schema.canonical(row) + "\n" for row in rows).encode("utf-8")
104
- path.parent.mkdir(parents=True, exist_ok=True)
105
104
  temporary = path.with_name(path.name + ".tmp")
106
- temporary.write_bytes(old + new)
105
+ try:
106
+ path.parent.mkdir(parents=True, exist_ok=True)
107
+ temporary.write_bytes(old + new)
108
+ except OSError as error:
109
+ with suppress(OSError):
110
+ temporary.unlink()
111
+ raise ValueError(
112
+ f"could not write {path.name} in {path.parent}: {error.strerror or error}. Nothing was"
113
+ " changed; choose a writable --out-dir and run share --write again"
114
+ ) from None
107
115
  try:
108
116
  os.replace(temporary, path)
109
117
  except OSError:
@@ -738,6 +738,24 @@ class Hook(TempRoot):
738
738
  ingest.ingest(ADAPTER, self.history, pseudonym.load_secret(home), cache=cache)
739
739
  self.assertEqual(parse.call_count, 1) # only the other session's one transcript
740
740
 
741
+ def test_a_corrupt_store_is_silent_in_the_hook_and_named_by_a_manual_ingest(self):
742
+ self.store.parent.mkdir(parents=True)
743
+ self.store.write_bytes(schema.canonical(synthetic.row()).encode("utf-8") + b"\n{broken\n")
744
+ before = self.store.read_bytes()
745
+ self.assertEqual(self.hook(self.payload(self.paths[0])), (0, ""))
746
+ self.assertEqual(self.store.read_bytes(), before)
747
+ out, err = io.StringIO(), io.StringIO()
748
+ env = {"AGENTPACE_HOME": str(self.root / "home")}
749
+ with (
750
+ mock.patch.dict(os.environ, env),
751
+ contextlib.redirect_stdout(out),
752
+ contextlib.redirect_stderr(err),
753
+ ):
754
+ code = cli.main(["ingest", str(self.history)])
755
+ self.assertEqual(code, 2)
756
+ self.assertEqual(err.getvalue(), "agentpace: runs.jsonl:2: not valid JSON\n")
757
+ self.assertEqual(self.store.read_bytes(), before)
758
+
741
759
 
742
760
  class StoreLock(TempRoot):
743
761
  def test_a_second_writer_waits_then_gives_up(self):
@@ -360,6 +360,16 @@ class ValidateCommand(Temp):
360
360
  with contextlib.redirect_stderr(io.StringIO()), contextlib.redirect_stdout(io.StringIO()):
361
361
  self.assertEqual(cli.main(["validate", str(bad)]), 1)
362
362
 
363
+ def test_a_file_that_is_not_utf8_stays_a_finding(self):
364
+ path = self.root / NAME
365
+ path.write_bytes(b"\xff\xfe\x00")
366
+ out, err = io.StringIO(), io.StringIO()
367
+ with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
368
+ code = cli.main(["validate", str(path)])
369
+ self.assertEqual(code, 1)
370
+ self.assertIn("file is not UTF-8", out.getvalue() + err.getvalue())
371
+ self.assertNotIn("agentpace: ", err.getvalue())
372
+
363
373
 
364
374
  class BadRowLines(Temp):
365
375
  """A rows file with a bad line is refused by file name and line number, never content."""
@@ -406,6 +416,14 @@ class BadRowLines(Temp):
406
416
  self.assertIsNone(caught.exception.__cause__)
407
417
  self.assertTrue(caught.exception.__suppress_context__)
408
418
 
419
+ def test_a_file_that_is_not_utf8_is_refused_by_name(self):
420
+ path = self.root / NAME
421
+ path.write_bytes(b"\xff\xfe\x00")
422
+ code, out, err = self.estimate(path)
423
+ self.assertEqual(code, 2)
424
+ self.assertEqual(out, "")
425
+ self.assertEqual(err, f"agentpace: {NAME}: file is not UTF-8\n")
426
+
409
427
 
410
428
  class ReplaceRefused(Temp):
411
429
  """`share --write` when another program holds the contribution file open."""
@@ -484,6 +502,70 @@ class ReplaceRefused(Temp):
484
502
  self.assertEqual(code, 2)
485
503
  self.assertEqual(err, f"agentpace: {NAME}:2: not valid JSON\n")
486
504
 
505
+ def test_an_out_dir_holding_a_file_that_is_not_utf8_is_refused_by_name(self):
506
+ self.out.mkdir()
507
+ self.path.write_bytes(b"\xff\xfe\x00")
508
+ for flags in ((), ("--write",)):
509
+ with self.subTest(flags=flags):
510
+ code, out, err = self.run_cli(*flags)
511
+ self.assertEqual(code, 2)
512
+ self.assertEqual(out, "")
513
+ self.assertEqual(err, f"agentpace: {NAME}: file is not UTF-8\n")
514
+ self.assertEqual(self.path.read_bytes(), b"\xff\xfe\x00")
515
+
516
+ def refuse(self, method, target):
517
+ """Patch one `Path` method to fail with a permission error on `target` alone."""
518
+ real = getattr(Path, method)
519
+
520
+ def refused(path, *args, **kwargs):
521
+ if path == target:
522
+ raise PermissionError(13, "Permission denied")
523
+ return real(path, *args, **kwargs)
524
+
525
+ return mock.patch.object(Path, method, refused)
526
+
527
+ def assert_write_refused(self, code, out, err):
528
+ # The privacy notice comes first; the refusal is the last line and the only error.
529
+ refusal = err.splitlines(keepends=True)[-1]
530
+ self.assertEqual(code, 2)
531
+ self.assertEqual(err.count("agentpace:"), 1)
532
+ self.assertTrue(refusal.startswith("agentpace: could not write"), err)
533
+ self.assertEqual(
534
+ refusal,
535
+ f"agentpace: could not write {NAME} in {self.out}: Permission denied. Nothing was"
536
+ " changed; choose a writable --out-dir and run share --write again\n",
537
+ )
538
+ for said in (out, err):
539
+ self.assertNotIn("wrote", said)
540
+ self.assertNotIn("added", said)
541
+ self.assertNotIn("Traceback", said)
542
+
543
+ def test_an_unwritable_folder_leaves_a_new_file_unmade(self):
544
+ self.out.mkdir()
545
+ temporary = self.path.with_name(NAME + ".tmp")
546
+ with self.refuse("write_bytes", temporary):
547
+ code, out, err = self.run_cli("--write")
548
+ self.assert_write_refused(code, out, err)
549
+ self.assertEqual(list(self.out.iterdir()), [])
550
+
551
+ def test_an_unwritable_folder_leaves_an_existing_file_as_it_was(self):
552
+ self.assertEqual(self.run_cli("--write")[0], 0)
553
+ first = self.path.read_bytes()
554
+ stored = schema.read_rows(paths.local_runs())
555
+ schema.write_rows(paths.local_runs(), [*stored, row(offset_s=50)])
556
+ temporary = self.path.with_name(NAME + ".tmp")
557
+ with self.refuse("write_bytes", temporary):
558
+ code, out, err = self.run_cli("--write")
559
+ self.assert_write_refused(code, out, err)
560
+ self.assertEqual(self.path.read_bytes(), first)
561
+ self.assertEqual(sorted(p.name for p in self.out.iterdir()), [NAME])
562
+
563
+ def test_a_folder_that_cannot_be_made_is_refused_the_same_way(self):
564
+ with self.refuse("mkdir", self.out):
565
+ code, out, err = self.run_cli("--write")
566
+ self.assert_write_refused(code, out, err)
567
+ self.assertFalse(self.out.exists())
568
+
487
569
 
488
570
  class NoNetwork(unittest.TestCase):
489
571
  """The package contains no way to send anything anywhere."""
@@ -1,4 +1,5 @@
1
1
  import hashlib
2
+ import json
2
3
  import re
3
4
  import unittest
4
5
  from pathlib import Path
@@ -214,5 +215,51 @@ class Skills(unittest.TestCase):
214
215
  self.assertIn("P90", text)
215
216
 
216
217
 
218
+ class Marketplace(unittest.TestCase):
219
+ def setUp(self):
220
+ path = REPO / ".claude-plugin" / "marketplace.json"
221
+ self.manifest = json.loads(path.read_text(encoding="utf-8"))
222
+
223
+ def entry(self):
224
+ plugins = self.manifest["plugins"]
225
+ self.assertEqual(len(plugins), 1)
226
+ return plugins[0]
227
+
228
+ def test_the_marketplace_names_itself_and_its_owner(self):
229
+ self.assertEqual(self.manifest["name"], "agentpace")
230
+ self.assertEqual(self.manifest["owner"]["name"], "mohamedzhioua")
231
+
232
+ def test_it_lists_one_plugin_served_from_the_repository_root(self):
233
+ entry = self.entry()
234
+ self.assertEqual(entry["name"], "agentpace")
235
+ self.assertEqual(entry["source"], "./")
236
+
237
+ def test_the_entry_lists_no_components_so_every_skill_loads(self):
238
+ entry = self.entry()
239
+ for field in ("skills", "hooks", "commands", "agents", "mcpServers"):
240
+ with self.subTest(field=field):
241
+ self.assertNotIn(field, entry)
242
+
243
+ def test_the_source_holds_the_skills_folder(self):
244
+ entry = self.entry()
245
+ self.assertEqual((REPO / entry["source"] / "skills").resolve(), SKILLS.resolve())
246
+
247
+ def test_no_hooks_folder_or_plugin_manifest_ships(self):
248
+ self.assertFalse((REPO / "hooks").exists())
249
+ self.assertFalse((REPO / ".claude-plugin" / "plugin.json").exists())
250
+
251
+ def test_the_descriptions_are_short_and_carry_no_banned_phrase(self):
252
+ descriptions = {
253
+ "marketplace": self.manifest["description"],
254
+ "plugin": self.entry()["description"],
255
+ }
256
+ for level, description in descriptions.items():
257
+ with self.subTest(level=level):
258
+ self.assertTrue(1 <= len(description) <= 300)
259
+ for phrase in BANNED_PHRASES:
260
+ with self.subTest(level=level, phrase=phrase):
261
+ self.assertNotIn(phrase.lower(), description.lower())
262
+
263
+
217
264
  if __name__ == "__main__":
218
265
  unittest.main()
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