agentpace 0.12.1__tar.gz → 0.12.2__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 (104) hide show
  1. {agentpace-0.12.1 → agentpace-0.12.2}/CHANGELOG.md +9 -0
  2. {agentpace-0.12.1 → agentpace-0.12.2}/CITATION.cff +1 -1
  3. {agentpace-0.12.1 → agentpace-0.12.2}/PKG-INFO +1 -1
  4. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/__init__.py +1 -1
  5. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/schema.py +11 -3
  6. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/share.py +11 -1
  7. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_share_validate.py +124 -0
  8. {agentpace-0.12.1 → agentpace-0.12.2}/.gitattributes +0 -0
  9. {agentpace-0.12.1 → agentpace-0.12.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  10. {agentpace-0.12.1 → agentpace-0.12.2}/.github/ISSUE_TEMPLATE/ingest-found-nothing.yml +0 -0
  11. {agentpace-0.12.1 → agentpace-0.12.2}/.github/ISSUE_TEMPLATE/remove-my-rows.yml +0 -0
  12. {agentpace-0.12.1 → agentpace-0.12.2}/.github/dependabot.yml +0 -0
  13. {agentpace-0.12.1 → agentpace-0.12.2}/.github/pull_request_template.md +0 -0
  14. {agentpace-0.12.1 → agentpace-0.12.2}/.github/workflows/ci.yml +0 -0
  15. {agentpace-0.12.1 → agentpace-0.12.2}/.github/workflows/publish.yml +0 -0
  16. {agentpace-0.12.1 → agentpace-0.12.2}/.github/workflows/validate-data.yml +0 -0
  17. {agentpace-0.12.1 → agentpace-0.12.2}/.gitignore +0 -0
  18. {agentpace-0.12.1 → agentpace-0.12.2}/CODE_OF_CONDUCT.md +0 -0
  19. {agentpace-0.12.1 → agentpace-0.12.2}/CONTRIBUTING.md +0 -0
  20. {agentpace-0.12.1 → agentpace-0.12.2}/LICENSE +0 -0
  21. {agentpace-0.12.1 → agentpace-0.12.2}/README.md +0 -0
  22. {agentpace-0.12.1 → agentpace-0.12.2}/SECURITY.md +0 -0
  23. {agentpace-0.12.1 → agentpace-0.12.2}/data/LICENSE +0 -0
  24. {agentpace-0.12.1 → agentpace-0.12.2}/data/README.md +0 -0
  25. {agentpace-0.12.1 → agentpace-0.12.2}/data/runs/4546788e7930eccd-2026-W40-2026-W45.jsonl +0 -0
  26. {agentpace-0.12.1 → agentpace-0.12.2}/data/runs/4546788e7930eccd-2026-W44-2026-W45.jsonl +0 -0
  27. {agentpace-0.12.1 → agentpace-0.12.2}/docs/.nojekyll +0 -0
  28. {agentpace-0.12.1 → agentpace-0.12.2}/docs/DESIGN.md +0 -0
  29. {agentpace-0.12.1 → agentpace-0.12.2}/docs/assets/backtest-coverage.svg +0 -0
  30. {agentpace-0.12.1 → agentpace-0.12.2}/docs/assets/hero.webp +0 -0
  31. {agentpace-0.12.1 → agentpace-0.12.2}/docs/assets/run-ranges.svg +0 -0
  32. {agentpace-0.12.1 → agentpace-0.12.2}/docs/assets/social-preview.png +0 -0
  33. {agentpace-0.12.1 → agentpace-0.12.2}/docs/backtest.json +0 -0
  34. {agentpace-0.12.1 → agentpace-0.12.2}/docs/backtest.md +0 -0
  35. {agentpace-0.12.1 → agentpace-0.12.2}/docs/cli.md +0 -0
  36. {agentpace-0.12.1 → agentpace-0.12.2}/docs/index.html +0 -0
  37. {agentpace-0.12.1 → agentpace-0.12.2}/docs/releasing.md +0 -0
  38. {agentpace-0.12.1 → agentpace-0.12.2}/docs/robots.txt +0 -0
  39. {agentpace-0.12.1 → agentpace-0.12.2}/docs/sitemap.xml +0 -0
  40. {agentpace-0.12.1 → agentpace-0.12.2}/docs/verify-adapter.md +0 -0
  41. {agentpace-0.12.1 → agentpace-0.12.2}/examples/plan.json +0 -0
  42. {agentpace-0.12.1 → agentpace-0.12.2}/examples/quote-plan.json +0 -0
  43. {agentpace-0.12.1 → agentpace-0.12.2}/pyproject.toml +0 -0
  44. {agentpace-0.12.1 → agentpace-0.12.2}/schema/run.schema.json +0 -0
  45. {agentpace-0.12.1 → agentpace-0.12.2}/schema/turn.schema.json +0 -0
  46. {agentpace-0.12.1 → agentpace-0.12.2}/skills/agentpace/SKILL.md +0 -0
  47. {agentpace-0.12.1 → agentpace-0.12.2}/skills/agentpace/assets/portable-prompt.md +0 -0
  48. {agentpace-0.12.1 → agentpace-0.12.2}/skills/agentpace/references/method.md +0 -0
  49. {agentpace-0.12.1 → agentpace-0.12.2}/skills/pace-estimate/SKILL.md +0 -0
  50. {agentpace-0.12.1 → agentpace-0.12.2}/skills/pace-log/SKILL.md +0 -0
  51. {agentpace-0.12.1 → agentpace-0.12.2}/skills/pace-share/SKILL.md +0 -0
  52. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/__main__.py +0 -0
  53. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/__init__.py +0 -0
  54. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/base.py +0 -0
  55. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/claude_code.py +0 -0
  56. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/cline.py +0 -0
  57. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/codex.py +0 -0
  58. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/gemini_cli.py +0 -0
  59. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/adapters/opencode.py +0 -0
  60. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/backtest.py +0 -0
  61. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/cache.py +0 -0
  62. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/charts.py +0 -0
  63. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/claims.py +0 -0
  64. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/classify.py +0 -0
  65. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/cli.py +0 -0
  66. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/estimate.py +0 -0
  67. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/forecasts.py +0 -0
  68. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/ingest.py +0 -0
  69. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/paths.py +0 -0
  70. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/pseudonym.py +0 -0
  71. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/py.typed +0 -0
  72. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/render.py +0 -0
  73. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/report.py +0 -0
  74. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/site.py +0 -0
  75. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/turns.py +0 -0
  76. {agentpace-0.12.1 → agentpace-0.12.2}/src/agentpace/validate.py +0 -0
  77. {agentpace-0.12.1 → agentpace-0.12.2}/tests/__init__.py +0 -0
  78. {agentpace-0.12.1 → agentpace-0.12.2}/tests/fixtures/__init__.py +0 -0
  79. {agentpace-0.12.1 → agentpace-0.12.2}/tests/fixtures/cline_tasks.py +0 -0
  80. {agentpace-0.12.1 → agentpace-0.12.2}/tests/fixtures/gemini_cli.py +0 -0
  81. {agentpace-0.12.1 → agentpace-0.12.2}/tests/fixtures/opencode.py +0 -0
  82. {agentpace-0.12.1 → agentpace-0.12.2}/tests/synthetic.py +0 -0
  83. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_backtest.py +0 -0
  84. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_claims.py +0 -0
  85. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_classify.py +0 -0
  86. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_cli.py +0 -0
  87. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_cline.py +0 -0
  88. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_codex.py +0 -0
  89. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_counts.py +0 -0
  90. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_docs.py +0 -0
  91. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_estimate.py +0 -0
  92. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_forecasts.py +0 -0
  93. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_frozen_method.py +0 -0
  94. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_gemini_cli.py +0 -0
  95. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_ingest.py +0 -0
  96. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_labels.py +0 -0
  97. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_opencode.py +0 -0
  98. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_outcomes.py +0 -0
  99. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_plan_risk.py +0 -0
  100. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_review_capacity.py +0 -0
  101. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_schema.py +0 -0
  102. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_site.py +0 -0
  103. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_skills.py +0 -0
  104. {agentpace-0.12.1 → agentpace-0.12.2}/tests/test_turns.py +0 -0
@@ -4,6 +4,15 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) an
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.12.2 - 2026-11-09
8
+
9
+ ### Fixed
10
+
11
+ - A rows file with a line that is not valid JSON, or not a JSON object, is refused with its file name and line number and exit 2, instead of the decoder's message. The message never quotes the line.
12
+ - When the contribution file cannot be replaced because another program holds it open, as Windows does, `share --write` says so, leaves the file as it was and removes its temporary file, instead of a traceback.
13
+
14
+ No published number moved.
15
+
7
16
  ## 0.12.1 - 2026-11-09
8
17
 
9
18
  ### Fixed
@@ -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.1
11
+ version: 0.12.2
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.1
3
+ Version: 0.12.2
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
@@ -1,3 +1,3 @@
1
1
  """agentpace: real run times for coding agents, as P50/P80/P90 ranges."""
2
2
 
3
- __version__ = "0.12.1"
3
+ __version__ = "0.12.2"
@@ -100,11 +100,19 @@ def dedupe_key(row: Row) -> tuple[str, str, int, int]:
100
100
 
101
101
 
102
102
  def read_rows(path: Path) -> list[Row]:
103
+ """Every row in `path`. A bad line is named by file and line number, never by its content."""
103
104
  rows: list[Row] = []
104
105
  with path.open(encoding="utf-8") as handle:
105
- for line in handle:
106
- if line.strip():
107
- rows.append(json.loads(line))
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)
108
116
  return rows
109
117
 
110
118
 
@@ -8,6 +8,7 @@ from __future__ import annotations
8
8
 
9
9
  import os
10
10
  from collections.abc import Iterable, Sequence
11
+ from contextlib import suppress
11
12
  from pathlib import Path
12
13
 
13
14
  from agentpace import render, schema
@@ -103,7 +104,16 @@ def write_contribution(path: Path, rows: Sequence[Row]) -> tuple[int, int]:
103
104
  path.parent.mkdir(parents=True, exist_ok=True)
104
105
  temporary = path.with_name(path.name + ".tmp")
105
106
  temporary.write_bytes(old + new)
106
- os.replace(temporary, path)
107
+ try:
108
+ os.replace(temporary, path)
109
+ except OSError:
110
+ # On Windows a file another program holds open cannot be replaced.
111
+ with suppress(OSError):
112
+ temporary.unlink()
113
+ raise ValueError(
114
+ f"could not replace {path.name}: it is open in another program. Nothing was changed;"
115
+ " close it and run share --write again"
116
+ ) from None
107
117
  return len(rows), existing
108
118
 
109
119
 
@@ -361,6 +361,130 @@ class ValidateCommand(Temp):
361
361
  self.assertEqual(cli.main(["validate", str(bad)]), 1)
362
362
 
363
363
 
364
+ class BadRowLines(Temp):
365
+ """A rows file with a bad line is refused by file name and line number, never content."""
366
+
367
+ SECRET = "do-not-print-this"
368
+
369
+ def setUp(self):
370
+ super().setUp()
371
+ patch = mock.patch.dict(os.environ, {"AGENTPACE_HOME": str(self.root / "home")})
372
+ patch.start()
373
+ self.addCleanup(patch.stop)
374
+
375
+ def estimate(self, path):
376
+ out, err = io.StringIO(), io.StringIO()
377
+ with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
378
+ code = cli.main(["estimate", "--example", "--data", str(path)])
379
+ return code, out.getvalue(), err.getvalue()
380
+
381
+ def assert_refused(self, bad_line, message):
382
+ # A blank line before the bad one: the number counts every line in the file.
383
+ good, later = schema.canonical(row()), schema.canonical(row(offset_s=5))
384
+ path = self.write([good, "", bad_line, later])
385
+ code, out, err = self.estimate(path)
386
+ self.assertEqual(code, 2)
387
+ self.assertEqual(out, "")
388
+ self.assertEqual(err, f"agentpace: {NAME}:3: {message}\n")
389
+ self.assertNotIn("Traceback", err)
390
+ self.assertNotIn(self.SECRET, err)
391
+
392
+ def test_a_line_that_is_not_json_is_refused(self):
393
+ self.assert_refused(f'{{"contributor": "{self.SECRET}"', "not valid JSON")
394
+
395
+ def test_a_line_that_is_not_an_object_is_refused(self):
396
+ self.assert_refused(json.dumps([self.SECRET]), "not a JSON object")
397
+
398
+ def test_a_json_string_line_is_not_an_object(self):
399
+ self.assert_refused(json.dumps(self.SECRET), "not a JSON object")
400
+
401
+ def test_the_error_does_not_carry_the_decoder_message(self):
402
+ path = self.write(["{broken"])
403
+ with self.assertRaises(ValueError) as caught:
404
+ schema.read_rows(path)
405
+ self.assertEqual(str(caught.exception), f"{NAME}:1: not valid JSON")
406
+ self.assertIsNone(caught.exception.__cause__)
407
+ self.assertTrue(caught.exception.__suppress_context__)
408
+
409
+
410
+ class ReplaceRefused(Temp):
411
+ """`share --write` when another program holds the contribution file open."""
412
+
413
+ def setUp(self):
414
+ super().setUp()
415
+ patch = mock.patch.dict(os.environ, {"AGENTPACE_HOME": str(self.root / "home")})
416
+ patch.start()
417
+ self.addCleanup(patch.stop)
418
+ schema.write_rows(paths.local_runs(), [row(), row(offset_s=5)])
419
+ self.out = self.root / "runs"
420
+ self.path = self.out / NAME
421
+
422
+ def run_cli(self, *args):
423
+ out, err = io.StringIO(), io.StringIO()
424
+ with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
425
+ code = cli.main(["share", "--out-dir", str(self.out), *args])
426
+ return code, out.getvalue(), err.getvalue()
427
+
428
+ def held_open(self):
429
+ real = os.replace
430
+
431
+ def replace(source, target):
432
+ if Path(target) == self.path:
433
+ raise PermissionError(13, "The process cannot access the file")
434
+ real(source, target)
435
+
436
+ return mock.patch.object(os, "replace", side_effect=replace)
437
+
438
+ def test_a_held_file_is_left_as_it_was(self):
439
+ self.assertEqual(self.run_cli("--write")[0], 0)
440
+ first = self.path.read_bytes()
441
+ stored = schema.read_rows(paths.local_runs())
442
+ schema.write_rows(paths.local_runs(), [*stored, row(offset_s=50)])
443
+ with self.held_open():
444
+ code, out, err = self.run_cli("--write")
445
+ self.assertEqual(code, 2)
446
+ self.assertEqual(self.path.read_bytes(), first)
447
+ self.assertEqual(sorted(p.name for p in self.out.iterdir()), [NAME])
448
+ self.assertIn(
449
+ f"agentpace: could not replace {NAME}: it is open in another program. Nothing was"
450
+ " changed; close it and run share --write again\n",
451
+ err,
452
+ )
453
+ for said in (out, err):
454
+ self.assertNotIn("wrote", said)
455
+ self.assertNotIn("added", said)
456
+ self.assertNotIn("Traceback", said)
457
+
458
+ def test_a_new_file_that_cannot_be_placed_leaves_nothing(self):
459
+ with self.held_open():
460
+ code, out, err = self.run_cli("--write")
461
+ self.assertEqual(code, 2)
462
+ self.assertEqual(list(self.out.iterdir()), [])
463
+ self.assertIn(f"could not replace {NAME}", err)
464
+ self.assertNotIn("wrote", out + err)
465
+
466
+ def test_after_the_file_is_closed_the_append_keeps_the_prior_bytes(self):
467
+ self.run_cli("--write")
468
+ first = self.path.read_bytes()
469
+ stored = schema.read_rows(paths.local_runs())
470
+ schema.write_rows(paths.local_runs(), [*stored, row(offset_s=50)])
471
+ with self.held_open():
472
+ self.run_cli("--write")
473
+ code, _, err = self.run_cli("--write")
474
+ self.assertEqual(code, 0)
475
+ self.assertTrue(self.path.read_bytes().startswith(first))
476
+ self.assertEqual(len(schema.read_rows(self.path)), 3)
477
+ self.assertEqual(sorted(p.name for p in self.out.iterdir()), [NAME])
478
+ self.assertIn("added", err)
479
+
480
+ def test_a_corrupt_contribution_file_is_named_by_line(self):
481
+ self.out.mkdir()
482
+ self.path.write_text(schema.canonical(row(offset_s=90)) + "\n{broken\n", encoding="utf-8")
483
+ code, _, err = self.run_cli("--write")
484
+ self.assertEqual(code, 2)
485
+ self.assertEqual(err, f"agentpace: {NAME}:2: not valid JSON\n")
486
+
487
+
364
488
  class NoNetwork(unittest.TestCase):
365
489
  """The package contains no way to send anything anywhere."""
366
490
 
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