agentpace 0.11.3__tar.gz → 0.12.1__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 (105) hide show
  1. {agentpace-0.11.3 → agentpace-0.12.1}/CHANGELOG.md +32 -0
  2. {agentpace-0.11.3 → agentpace-0.12.1}/CITATION.cff +1 -1
  3. {agentpace-0.11.3 → agentpace-0.12.1}/CONTRIBUTING.md +1 -1
  4. {agentpace-0.11.3 → agentpace-0.12.1}/PKG-INFO +3 -3
  5. {agentpace-0.11.3 → agentpace-0.12.1}/README.md +2 -2
  6. {agentpace-0.11.3 → agentpace-0.12.1}/docs/DESIGN.md +2 -0
  7. {agentpace-0.11.3 → agentpace-0.12.1}/docs/cli.md +9 -7
  8. {agentpace-0.11.3 → agentpace-0.12.1}/docs/releasing.md +9 -9
  9. {agentpace-0.11.3 → agentpace-0.12.1}/docs/verify-adapter.md +1 -1
  10. {agentpace-0.11.3 → agentpace-0.12.1}/skills/agentpace/SKILL.md +3 -3
  11. {agentpace-0.11.3 → agentpace-0.12.1}/skills/agentpace/references/method.md +2 -2
  12. {agentpace-0.11.3 → agentpace-0.12.1}/skills/pace-estimate/SKILL.md +3 -3
  13. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/__init__.py +1 -1
  14. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/classify.py +19 -0
  15. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/cli.py +57 -26
  16. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/estimate.py +25 -4
  17. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/render.py +12 -5
  18. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/share.py +8 -5
  19. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/turns.py +11 -8
  20. agentpace-0.12.1/tests/test_classify.py +120 -0
  21. agentpace-0.12.1/tests/test_counts.py +299 -0
  22. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_estimate.py +33 -0
  23. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_labels.py +10 -2
  24. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_outcomes.py +6 -3
  25. agentpace-0.12.1/tests/test_plan_risk.py +176 -0
  26. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_share_validate.py +6 -6
  27. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_skills.py +2 -0
  28. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_turns.py +2 -2
  29. agentpace-0.11.3/tests/test_classify.py +0 -54
  30. {agentpace-0.11.3 → agentpace-0.12.1}/.gitattributes +0 -0
  31. {agentpace-0.11.3 → agentpace-0.12.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  32. {agentpace-0.11.3 → agentpace-0.12.1}/.github/ISSUE_TEMPLATE/ingest-found-nothing.yml +0 -0
  33. {agentpace-0.11.3 → agentpace-0.12.1}/.github/ISSUE_TEMPLATE/remove-my-rows.yml +0 -0
  34. {agentpace-0.11.3 → agentpace-0.12.1}/.github/dependabot.yml +0 -0
  35. {agentpace-0.11.3 → agentpace-0.12.1}/.github/pull_request_template.md +0 -0
  36. {agentpace-0.11.3 → agentpace-0.12.1}/.github/workflows/ci.yml +0 -0
  37. {agentpace-0.11.3 → agentpace-0.12.1}/.github/workflows/publish.yml +0 -0
  38. {agentpace-0.11.3 → agentpace-0.12.1}/.github/workflows/validate-data.yml +0 -0
  39. {agentpace-0.11.3 → agentpace-0.12.1}/.gitignore +0 -0
  40. {agentpace-0.11.3 → agentpace-0.12.1}/CODE_OF_CONDUCT.md +0 -0
  41. {agentpace-0.11.3 → agentpace-0.12.1}/LICENSE +0 -0
  42. {agentpace-0.11.3 → agentpace-0.12.1}/SECURITY.md +0 -0
  43. {agentpace-0.11.3 → agentpace-0.12.1}/data/LICENSE +0 -0
  44. {agentpace-0.11.3 → agentpace-0.12.1}/data/README.md +0 -0
  45. {agentpace-0.11.3 → agentpace-0.12.1}/data/runs/4546788e7930eccd-2026-W40-2026-W45.jsonl +0 -0
  46. {agentpace-0.11.3 → agentpace-0.12.1}/data/runs/4546788e7930eccd-2026-W44-2026-W45.jsonl +0 -0
  47. {agentpace-0.11.3 → agentpace-0.12.1}/docs/.nojekyll +0 -0
  48. {agentpace-0.11.3 → agentpace-0.12.1}/docs/assets/backtest-coverage.svg +0 -0
  49. {agentpace-0.11.3 → agentpace-0.12.1}/docs/assets/hero.webp +0 -0
  50. {agentpace-0.11.3 → agentpace-0.12.1}/docs/assets/run-ranges.svg +0 -0
  51. {agentpace-0.11.3 → agentpace-0.12.1}/docs/assets/social-preview.png +0 -0
  52. {agentpace-0.11.3 → agentpace-0.12.1}/docs/backtest.json +0 -0
  53. {agentpace-0.11.3 → agentpace-0.12.1}/docs/backtest.md +0 -0
  54. {agentpace-0.11.3 → agentpace-0.12.1}/docs/index.html +0 -0
  55. {agentpace-0.11.3 → agentpace-0.12.1}/docs/robots.txt +0 -0
  56. {agentpace-0.11.3 → agentpace-0.12.1}/docs/sitemap.xml +0 -0
  57. {agentpace-0.11.3 → agentpace-0.12.1}/examples/plan.json +0 -0
  58. {agentpace-0.11.3 → agentpace-0.12.1}/examples/quote-plan.json +0 -0
  59. {agentpace-0.11.3 → agentpace-0.12.1}/pyproject.toml +0 -0
  60. {agentpace-0.11.3 → agentpace-0.12.1}/schema/run.schema.json +0 -0
  61. {agentpace-0.11.3 → agentpace-0.12.1}/schema/turn.schema.json +0 -0
  62. {agentpace-0.11.3 → agentpace-0.12.1}/skills/agentpace/assets/portable-prompt.md +0 -0
  63. {agentpace-0.11.3 → agentpace-0.12.1}/skills/pace-log/SKILL.md +0 -0
  64. {agentpace-0.11.3 → agentpace-0.12.1}/skills/pace-share/SKILL.md +0 -0
  65. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/__main__.py +0 -0
  66. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/__init__.py +0 -0
  67. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/base.py +0 -0
  68. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/claude_code.py +0 -0
  69. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/cline.py +0 -0
  70. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/codex.py +0 -0
  71. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/gemini_cli.py +0 -0
  72. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/adapters/opencode.py +0 -0
  73. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/backtest.py +0 -0
  74. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/cache.py +0 -0
  75. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/charts.py +0 -0
  76. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/claims.py +0 -0
  77. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/forecasts.py +0 -0
  78. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/ingest.py +0 -0
  79. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/paths.py +0 -0
  80. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/pseudonym.py +0 -0
  81. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/py.typed +0 -0
  82. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/report.py +0 -0
  83. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/schema.py +0 -0
  84. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/site.py +0 -0
  85. {agentpace-0.11.3 → agentpace-0.12.1}/src/agentpace/validate.py +0 -0
  86. {agentpace-0.11.3 → agentpace-0.12.1}/tests/__init__.py +0 -0
  87. {agentpace-0.11.3 → agentpace-0.12.1}/tests/fixtures/__init__.py +0 -0
  88. {agentpace-0.11.3 → agentpace-0.12.1}/tests/fixtures/cline_tasks.py +0 -0
  89. {agentpace-0.11.3 → agentpace-0.12.1}/tests/fixtures/gemini_cli.py +0 -0
  90. {agentpace-0.11.3 → agentpace-0.12.1}/tests/fixtures/opencode.py +0 -0
  91. {agentpace-0.11.3 → agentpace-0.12.1}/tests/synthetic.py +0 -0
  92. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_backtest.py +0 -0
  93. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_claims.py +0 -0
  94. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_cli.py +0 -0
  95. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_cline.py +0 -0
  96. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_codex.py +0 -0
  97. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_docs.py +0 -0
  98. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_forecasts.py +0 -0
  99. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_frozen_method.py +0 -0
  100. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_gemini_cli.py +0 -0
  101. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_ingest.py +0 -0
  102. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_opencode.py +0 -0
  103. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_review_capacity.py +0 -0
  104. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_schema.py +0 -0
  105. {agentpace-0.11.3 → agentpace-0.12.1}/tests/test_site.py +0 -0
@@ -4,6 +4,38 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) an
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.12.1 - 2026-11-09
8
+
9
+ ### Fixed
10
+
11
+ - Count messages agree in number: the CLI's own messages read `1 row`, `1 session` or `1 gap` where they read `1 rows`, through one helper, `render.count`. The published report and the site are generated documents and keep their wording.
12
+ - Corrected the adapter guide's description of `duration_s`, the `completed_without_duration` definition in `docs/cli.md`, and the release runbook's line references, which had gone stale.
13
+
14
+ ### Changed
15
+
16
+ - `docs/cli.md` says that without `--data`, the seed rows and your local rows are estimated together even when they were ingested under different idle caps, and how to keep one cap.
17
+ - The banned-phrase test also scans `docs/releasing.md` and `docs/verify-adapter.md`.
18
+
19
+ No published number moved.
20
+
21
+ ## 0.12.0 - 2026-11-09
22
+
23
+ ### Changed
24
+
25
+ - A plan task's `risk` is now read as the recorded category it matches against. In the rows, risk is the agent's role (review and research agents `low`, migration agents `high`, everything else `normal`), not how hard or how reversible the work is.
26
+ - A written risk is used only where the rows can record that kind at that risk: `review` low, `migration` high, `other` low (research) or normal, every other kind normal.
27
+ - Any other value, and an omitted one, takes the kind's recorded risk, and a warning names each task it changed, such as `risk as written was not used for api (high -> normal), review (normal -> low): …`.
28
+ - Before, such a task matched an empty `kind x risk` cell, which dropped the model. For an Opus feature marked `high`, that cut the P50 by a factor of 16, in the shorter direction.
29
+ - An explicit `"risk": null` in a plan now means "not given", as `"model": null` already did, instead of being refused.
30
+ - The skills stop advising `risk: high`: they leave `risk` out except for research (`other` with `risk: low`), ask for the model, which is the strongest split in the data, and pass a stated review capacity as the figure itself, in at most 80 characters, or not at all.
31
+ - `docs/cli.md`, the README, DESIGN section 5, `method.md` and CONTRIBUTING say the same. CONTRIBUTING's `label` example no longer sets `--risk high`.
32
+
33
+ ### Added
34
+
35
+ - `agentpace estimate --use-risk` looks every written risk up as given, for datasets whose labelled rows hold other pairs.
36
+
37
+ Training, the back-off order, the backtest's queries and the frozen selection are unchanged. Forecasts for plans with such risks change by design; the published example quantiles, the backtest numbers and the record ids of canonical plans do not. No published number moved.
38
+
7
39
  ## 0.11.3 - 2026-11-09
8
40
 
9
41
  ### Changed
@@ -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.11.3
11
+ version: 0.12.1
12
12
  date-released: 2026-11-09
13
13
  keywords:
14
14
  - coding agents
@@ -28,7 +28,7 @@ Rows from an experimental adapter (Gemini CLI, OpenCode, Cline) fail "Validate d
28
28
 
29
29
  ## Label your runs
30
30
 
31
- Metadata cannot tell a feature from a bug fix. Labels can: without them, bug fixes and refactors look like any other implementation run, so the `bugfix` and `refactor` cells stay thin until people label runs. Run `agentpace runs` to find a reference, then `agentpace label <ref> --kind bugfix --risk high`. Do this before `agentpace share`.
31
+ Metadata cannot tell a feature from a bug fix. Labels can: without them, bug fixes and refactors look like any other implementation run, so the `bugfix` and `refactor` cells stay thin until people label runs. Run `agentpace runs` to find a reference, then `agentpace label <ref> --kind bugfix`. Do this before `agentpace share`.
32
32
 
33
33
  ## Add a harness
34
34
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentpace
3
- Version: 0.11.3
3
+ Version: 0.12.1
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
@@ -83,7 +83,7 @@ The plan it estimated is [examples/plan.json](examples/plan.json), where each ta
83
83
  }
84
84
  ```
85
85
 
86
- To estimate your own, write a plan like it and run `agentpace estimate plan.json`, or pass `-` to read it from stdin. In a plan, `depends_on`, `risk` and `model` are optional. Effective parallelism is work divided by elapsed time. It can be below 1, because a session's clock includes the time between runs.
86
+ To estimate your own, write a plan like it and run `agentpace estimate plan.json`, or pass `-` to read it from stdin. In a plan, `depends_on` and `model` are optional, and `risk` can be left out: it defaults to the risk the rows record for the task's kind, because in the data risk is the agent's role, not a rating of the work. Effective parallelism is work divided by elapsed time. It can be below 1, because a session's clock includes the time between runs.
87
87
 
88
88
  Why a range and not one number? Agent run times have a long tail, so any single number misses most of the time. P50 is a coin flip, and P80 is the one to plan on.
89
89
 
@@ -306,7 +306,7 @@ Each of these does something better than agentpace:
306
306
  - **Not a model speed ranking.** People send harder work to stronger models, so a slower row may just mean harder tasks.
307
307
  - **`feature` means any implementation work.** Without reading prompts, metadata cannot separate features, bug fixes and refactors. Those kinds stay thin until people label runs.
308
308
  - **Retries are not separated.** A run's duration includes any test-fix loop inside it. `retries` counts errored tool results, a proxy, because a real retry cannot be seen without reading content, and no field that describes what happened in a run (`retries`, `tool_calls`, `tokens`, `outcome`) ever predicts a duration. Codex upkeep sessions (`compact`) are skipped; nothing else is split out.
309
- - **Pooled by kind, risk and model only.** A cell with fewer than 30 runs leans on broader cells, with a warning. Repository size is not recorded, and `size` is an edit count measured after the run, so neither can segment the published runs. Long integration work has no cell of its own.
309
+ - **Pooled by kind, risk and model only.** A cell with fewer than 30 runs leans on broader cells, with a warning. Repository size is not recorded, and `size` is an edit count measured after the run, so neither can segment the published runs. Long integration work has no cell of its own. `risk` in the rows is the agent's role (review and research agents `low`, migration agents `high`, all else `normal`), and a plan's `risk` is read the same way, so marking a task `high` does not lengthen its range.
310
310
  - **Two harnesses, still one person.** The published rows hold Claude Code subagent runs and, since 0.6.0, Codex turns, all from the same contributor. Codex is scored on its own, never in the headline. Each Codex exec session is a single turn, so the session effect and the parallelism factor learn nothing from Codex, and a Codex plan borrows Claude Code's session structure. Gemini CLI, OpenCode and Cline have experimental adapters: built from each tool's source, not yet verified on real sessions, with no published rows (`validate` rejects them until each adapter is verified; [how to verify one](docs/verify-adapter.md)), and problems go in an [issue](https://github.com/mohamedzhioua/agentpace/issues). Other harnesses have no adapter.
311
311
  - **No human allowance, and short waits sit inside the clock.** The plan total is a forecast on the session clock, which counts agent runs and the gaps between them, each gap up to the idle cap (900 s in the published rows). So a wait on you shorter than that sits inside the total, a longer one is clipped at the cap, and no allowance for review, testing or decisions is added. Every estimate says so on its own lines and never derives the human part from agent time. `agentpace turns` measures your own wait per human turn from your main-session timestamps and keeps it on your machine. That is elapsed time, not effort, shown beside the range and never added to it.
312
312
  - **Failed runs are under-counted.** Only runs with a clear completion signal train the estimator, so P90 may run low. Recorded runs that did not complete (failed or unknown), by harness: <!-- claim:not_completed_by_harness -->claude-code 13 of 3,219 (0.4%), codex 34 of 211 (16.1%)<!-- /claim -->. Those are harness outcomes, not task acceptance, and every estimate prints the counts for the rows it loaded.
@@ -56,7 +56,7 @@ The plan it estimated is [examples/plan.json](examples/plan.json), where each ta
56
56
  }
57
57
  ```
58
58
 
59
- To estimate your own, write a plan like it and run `agentpace estimate plan.json`, or pass `-` to read it from stdin. In a plan, `depends_on`, `risk` and `model` are optional. Effective parallelism is work divided by elapsed time. It can be below 1, because a session's clock includes the time between runs.
59
+ To estimate your own, write a plan like it and run `agentpace estimate plan.json`, or pass `-` to read it from stdin. In a plan, `depends_on` and `model` are optional, and `risk` can be left out: it defaults to the risk the rows record for the task's kind, because in the data risk is the agent's role, not a rating of the work. Effective parallelism is work divided by elapsed time. It can be below 1, because a session's clock includes the time between runs.
60
60
 
61
61
  Why a range and not one number? Agent run times have a long tail, so any single number misses most of the time. P50 is a coin flip, and P80 is the one to plan on.
62
62
 
@@ -279,7 +279,7 @@ Each of these does something better than agentpace:
279
279
  - **Not a model speed ranking.** People send harder work to stronger models, so a slower row may just mean harder tasks.
280
280
  - **`feature` means any implementation work.** Without reading prompts, metadata cannot separate features, bug fixes and refactors. Those kinds stay thin until people label runs.
281
281
  - **Retries are not separated.** A run's duration includes any test-fix loop inside it. `retries` counts errored tool results, a proxy, because a real retry cannot be seen without reading content, and no field that describes what happened in a run (`retries`, `tool_calls`, `tokens`, `outcome`) ever predicts a duration. Codex upkeep sessions (`compact`) are skipped; nothing else is split out.
282
- - **Pooled by kind, risk and model only.** A cell with fewer than 30 runs leans on broader cells, with a warning. Repository size is not recorded, and `size` is an edit count measured after the run, so neither can segment the published runs. Long integration work has no cell of its own.
282
+ - **Pooled by kind, risk and model only.** A cell with fewer than 30 runs leans on broader cells, with a warning. Repository size is not recorded, and `size` is an edit count measured after the run, so neither can segment the published runs. Long integration work has no cell of its own. `risk` in the rows is the agent's role (review and research agents `low`, migration agents `high`, all else `normal`), and a plan's `risk` is read the same way, so marking a task `high` does not lengthen its range.
283
283
  - **Two harnesses, still one person.** The published rows hold Claude Code subagent runs and, since 0.6.0, Codex turns, all from the same contributor. Codex is scored on its own, never in the headline. Each Codex exec session is a single turn, so the session effect and the parallelism factor learn nothing from Codex, and a Codex plan borrows Claude Code's session structure. Gemini CLI, OpenCode and Cline have experimental adapters: built from each tool's source, not yet verified on real sessions, with no published rows (`validate` rejects them until each adapter is verified; [how to verify one](docs/verify-adapter.md)), and problems go in an [issue](https://github.com/mohamedzhioua/agentpace/issues). Other harnesses have no adapter.
284
284
  - **No human allowance, and short waits sit inside the clock.** The plan total is a forecast on the session clock, which counts agent runs and the gaps between them, each gap up to the idle cap (900 s in the published rows). So a wait on you shorter than that sits inside the total, a longer one is clipped at the cap, and no allowance for review, testing or decisions is added. Every estimate says so on its own lines and never derives the human part from agent time. `agentpace turns` measures your own wait per human turn from your main-session timestamps and keeps it on your machine. That is elapsed time, not effort, shown beside the range and never added to it.
285
285
  - **Failed runs are under-counted.** Only runs with a clear completion signal train the estimator, so P90 may run low. Recorded runs that did not complete (failed or unknown), by harness: <!-- claim:not_completed_by_harness -->claude-code 13 of 3,219 (0.4%), codex 34 of 211 (16.1%)<!-- /claim -->. Those are harness outcomes, not task acceptance, and every estimate prints the counts for the rows it loaded.
@@ -153,6 +153,8 @@ All math lives in `src/agentpace/estimate.py`. Fields used as predictors: `model
153
153
 
154
154
  `size` is accepted as the brief specifies, but it is ignored by default. Stored `size` is an edit count measured after the run (F6), and a user's S/M/L guess made before the run is a different quantity. `--use-size` opts in, and the output names the oracle-size track. Phase 4 shows what that costs or gains. If the backtest supports it, this default can change.
155
155
 
156
+ `risk` is read the same way (0.12.0). In the rows, `risk` is the agent's role, set by the classifier (section 4). A plan's `risk` is a judgment about the work, which no row records. So a task's risk is looked up as written only where the rows can record that kind at that risk; any other value, and an omitted one, takes the kind's recorded risk, and the output names the tasks it changed. `--use-risk` looks every written value up as given, for datasets whose labelled rows hold other pairs. The rule lives at the plan boundary (`tasks_from_json`), never in `fit` or `locate`, so training, the back-off order and the backtest's held-out queries are unchanged, and the frozen selection stands without re-registration.
157
+
156
158
  **Single-task distribution, on the log scale**
157
159
 
158
160
  *Superseded:* this section first gave every run a session weight of `1 / sqrt(runs in that session)` (F2), with `n_eff` the Kish effective size under those weights. The pre-registered selection chose the unweighted `shrunk` (section 11), so the default is unweighted and `n_eff` equals `n`. Session weighting survives only as the `weighted` candidate.
@@ -100,7 +100,7 @@ stdout: `labeled <ref>: <kind>, <risk> risk`.
100
100
  ## estimate
101
101
 
102
102
  ```text
103
- agentpace estimate (PLAN | - | --example) [--data PATH]... [--method NAME] [--use-size] [--draws N] [--seed N] [--json] [--turns FILE] [--record] [--quoted TEXT] [--review-capacity TEXT]
103
+ agentpace estimate (PLAN | - | --example) [--data PATH]... [--method NAME] [--use-size] [--use-risk] [--draws N] [--seed N] [--json] [--turns FILE] [--record] [--quoted TEXT] [--review-capacity TEXT]
104
104
  ```
105
105
 
106
106
  Simulates a plan of tasks and prints P50, P80 and P90 per task (agent run time) and for the plan (its span on the session clock).
@@ -112,6 +112,7 @@ Simulates a plan of tasks and prints P50, P80 and P90 per task (agent run time)
112
112
  | `--data PATH` | the seed data plus `~/.agentpace/runs.jsonl` if it exists | A rows file or folder. Repeatable. When given, only these rows are used. |
113
113
  | `--method` | `shrunk` | One of `global`, `kind`, `backoff`, `shrunk`, `weighted`. The default is the backtest's pre-registered winner. |
114
114
  | `--use-size` | off | Use `size`. An oracle track, because stored size is measured after a run. |
115
+ | `--use-risk` | off | Look each task's `risk` up as written, as a recorded category (review and research agents `low`, migration agents `high`, all else `normal`), even where no recorded run has that kind at that risk. By default such a task takes its kind's recorded risk; see `risk` under Plan JSON. |
115
116
  | `--draws` | `20000` | Simulations. At least 100. |
116
117
  | `--seed` | `20261107` | Random seed. The same plan, data and seed give the same result. |
117
118
  | `--json` | off | Print the result as JSON instead of text. |
@@ -132,7 +133,7 @@ The session clock counts agent runs and the gaps between them, each gap up to th
132
133
  Human part (review, testing, decisions, waiting between agent turns): not measured. No allowance for it is added to the total above. State it separately; do not derive it from the agent time.
133
134
  ```
134
135
 
135
- The clock note gives the default cap. In rows ingested with a non-default `--idle-cap`, each gap counts up to that cap instead.
136
+ The clock note gives the default cap. In rows ingested with a non-default `--idle-cap`, each gap counts up to that cap instead. Without `--data`, the seed rows, clipped at 900 s, are pooled with your local rows, which were clipped at whatever `--idle-cap` you ingested with; for one consistent cap, pass `--data` with rows ingested under it.
136
137
 
137
138
  With `--quoted`, one line sits directly under the total. It holds the quote verbatim and is never converted into agent time or compared with the range:
138
139
 
@@ -158,12 +159,12 @@ Each task:
158
159
  |---|---|---|---|
159
160
  | `id` | string or integer | required | Unique within the plan. An integer is read as its string form. |
160
161
  | `kind` | string | required | One of `feature`, `bugfix`, `refactor`, `migration`, `tests`, `docs`, `review`, `other`. |
161
- | `risk` | string | `normal` | One of `low`, `normal`, `high`. |
162
+ | `risk` | string or `null` | the kind's recorded risk: `low` for `review`, `high` for `migration`, else `normal` | One of `low`, `normal`, `high`. In the rows, risk is the agent's role, not a rating of the work. A written value is used when the rows can record that kind at that risk (`review` low, `migration` high, `other` low for research or normal, all else normal); any other value takes the kind's recorded risk and a warning names the task; `--use-risk` looks every written value up as given. |
162
163
  | `size` | string or `null` | `null` | One of `S`, `M`, `L`, `XL`, `na`. Ignored, with a warning, unless `--use-size` is given. |
163
164
  | `model` | string or `null` | the plan's `model` | Overrides the plan's model for this task. An explicit `null` means no model for this task; it does not inherit the plan's `model`. |
164
165
  | `depends_on` | list of task ids | `[]` | Tasks that must finish before this one starts. Each must be in the plan, and the graph must have no cycle. |
165
166
 
166
- The plan holds no durations: every number comes from the data. A task with a model draws from the model × kind × risk cell, and one without from kind × risk. A model name the data has never seen falls back to the broader cell with a wider interval and a warning, so use the model family as it appears in `agentpace runs`, such as `claude-opus-5-5`.
167
+ The plan holds no durations: every number comes from the data. A task with a model draws from the model × kind × risk cell, and one without from kind × risk. A model name the data has never seen falls back to the broader cell with a wider interval and a warning, so use the model family as it appears in `agentpace runs`, such as `claude-opus-5-5`. A cell with no recorded run gets a warning that names the level that had none (kind, risk or model), which of the task's levels were therefore not used, where the mean and the residuals came from, and what is recorded under the broader cell. A cell with too few runs to stand alone gets one that says its mean was shrunk toward broader cells and names the cell its residuals were pooled from. A written risk the rows cannot record at that kind gets one that names each such task with its risk as written and the risk used.
167
168
 
168
169
  A plan that breaks these rules is refused with exit 2. A field problem is reported by the task's position and the rule (`task #2: ...`), never by the plan's text. A dependency on an id that is not in the plan is reported with both ids; a duplicate id or a cycle is reported as such. `model` must be a string or `null`, at plan and task level.
169
170
 
@@ -173,7 +174,8 @@ A plan that breaks these rules is refused with exit 2. A field problem is report
173
174
  "model": "claude-opus-5-5",
174
175
  "tasks": [
175
176
  { "id": "schema", "kind": "feature" },
176
- { "id": "api", "kind": "feature", "risk": "high", "depends_on": ["schema"] },
177
+ { "id": "research", "kind": "other", "risk": "low" },
178
+ { "id": "api", "kind": "feature", "depends_on": ["schema"] },
177
179
  { "id": "docs", "kind": "docs", "model": null, "depends_on": ["api"] }
178
180
  ]
179
181
  }
@@ -197,10 +199,10 @@ One JSON object. Every duration is in seconds, as a number.
197
199
  | `size_used` | boolean | Whether `--use-size` was given. |
198
200
  | `rows_used` | integer | Completed runs the estimate learned from. |
199
201
  | `rows_excluded` | integer | Runs left out of the fit: those that did not complete (failed or unknown), and completed runs with no duration. |
200
- | `outcomes` | object | Recorded harness outcomes of every row the estimate loaded, after duplicates are dropped, and never per cell: `rows`, `completed`, `failed`, `unknown`, `completed_without_duration` (completed rows with a duration of 0), and `by_harness`, a list sorted by harness name of objects with `harness`, `rows`, `completed`, `failed` and `unknown`. An outcome is how the run ended in its harness, not task acceptance, and `unknown` is not counted as a failure. The counts are shown, never used to change the range. `rows` is `completed` + `failed` + `unknown`, `rows_used` is `completed` - `completed_without_duration`, and `rows_excluded` is `failed` + `unknown` + `completed_without_duration`. |
202
+ | `outcomes` | object | Recorded harness outcomes of every row the estimate loaded, after duplicates are dropped, and never per cell: `rows`, `completed`, `failed`, `unknown`, `completed_without_duration` (completed rows with no positive duration), and `by_harness`, a list sorted by harness name of objects with `harness`, `rows`, `completed`, `failed` and `unknown`. An outcome is how the run ended in its harness, not task acceptance, and `unknown` is not counted as a failure. The counts are shown, never used to change the range. `rows` is `completed` + `failed` + `unknown`, `rows_used` is `completed` - `completed_without_duration`, and `rows_excluded` is `failed` + `unknown` + `completed_without_duration`. |
201
203
  | `draws` | integer | Simulations run. |
202
204
  | `seed` | integer | The random seed. |
203
- | `warnings` | list of strings | Thin or unseen cells, ignored sizes, an assumed parallelism. Pass them on. |
205
+ | `warnings` | list of strings | Thin or unseen cells, ignored sizes, a written risk the estimate did not use, an assumed parallelism. Pass them on. |
204
206
  | `human` | object | The human part. `status` is `not measured` or `measured`, and `included_in_total` is always `false`: no allowance for the human part is added to the total (waits shorter than the idle cap sit inside the session clock already). When measured, it also holds `source`, `per_turn_p50`, `per_turn_p80`, `per_turn_p90` (seconds per human turn), `gaps` and `sessions`. With `--review-capacity`, it holds `review_capacity_stated`, your text as given, stripped. Keys without a value are left out. |
205
207
 
206
208
  The JSON output does not change with `--record` or `--quoted`.
@@ -141,14 +141,14 @@ PyPI renders the README as the project description. The three images use absolut
141
141
 
142
142
  The README's other relative links do not resolve on PyPI, because PyPI has no repository to resolve them against. That is accepted: the page links the repository, and these targets are one click away there. As of v0.8.4 they are:
143
143
 
144
- - `LICENSE` (lines 9 and 260) and `data/LICENSE` (lines 10 and 260)
145
- - `examples/plan.json` (line 41) and `examples/quote-plan.json` (line 118; added in v0.9.0, which moved every README line below it down by 33)
146
- - `docs/verify-adapter.md` (lines 84 to 86 and 243)
147
- - `skills/` and `skills/agentpace/assets/portable-prompt.md` (line 103), the portable prompt again (line 114)
148
- - `skills/agentpace/SKILL.md`, `skills/pace-estimate/SKILL.md`, `skills/pace-log/SKILL.md`, `skills/pace-share/SKILL.md` (lines 109 to 112), and `skills/pace-log/SKILL.md` again (line 137)
149
- - `docs/backtest.md` and its anchors `#by-harness` (line 145), `#time-split-week-by-week` (line 173) and `#pooled-for-the-record` (line 186)
150
- - `schema/run.schema.json` (line 193)
151
- - `CONTRIBUTING.md` (line 212)
152
- - `docs/DESIGN.md` (lines 218 and 256) and `src/agentpace/estimate.py` (line 256)
144
+ - `LICENSE` and `data/LICENSE`
145
+ - `examples/plan.json` and `examples/quote-plan.json` (added in v0.9.0)
146
+ - `docs/verify-adapter.md`
147
+ - `skills/` and `skills/agentpace/assets/portable-prompt.md`
148
+ - `skills/agentpace/SKILL.md`, `skills/pace-estimate/SKILL.md`, `skills/pace-log/SKILL.md`, `skills/pace-share/SKILL.md`
149
+ - `docs/backtest.md` and its anchors `#by-harness`, `#time-split-week-by-week` and `#pooled-for-the-record`
150
+ - `schema/run.schema.json`
151
+ - `CONTRIBUTING.md`
152
+ - `docs/DESIGN.md` and `src/agentpace/estimate.py`
153
153
 
154
154
  In-page anchors such as `#install` and `#limitations` depend on how PyPI renders heading ids; that has not been checked.
@@ -36,7 +36,7 @@ Compare the rows with your notes, session by session:
36
36
 
37
37
  - **Rows against turns.** Each run as DESIGN section 3 defines it for the harness (for Gemini CLI and Cline an agent turn, for OpenCode one prompt of yours and the replies to it) should be one row, with none missing and none extra.
38
38
  - **`outcome`** against what happened: the completed turn should be `completed`, and the interrupted and errored turns should be what DESIGN section 3 says for that harness.
39
- - **`duration_s`** against your noted start and end. It is agent active time, with every idle gap over the idle cap (900 s by default) clipped to the cap, and for Cline with approval waits dropped. So it can be shorter than the span you noted, but should not be longer than it, give or take how precisely you noted the times.
39
+ - **`duration_s`** against your noted start and end. It is the run's elapsed time with each idle gap counted up to the idle cap (900 s by default), and for Cline with approval waits dropped. So it can be shorter than the span you noted, but should not be longer than it, give or take how precisely you noted the times.
40
40
  - **`tool_calls`** against your tally and the tool's own log.
41
41
  - **`model`** against the model the harness showed you, after agentpace's normalization to a model family.
42
42
  - **`batch`:** one value per session. A sub-agent's own session or file has its own `batch`, as DESIGN section 3 says for each harness.
@@ -48,7 +48,7 @@ If they do not want to install anything, use [assets/portable-prompt.md](assets/
48
48
  agentpace estimate plan.json
49
49
  ```
50
50
 
51
- Kinds: `feature`, `bugfix`, `refactor`, `migration`, `tests`, `docs`, `review`, `other`. Risks: `low`, `normal`, `high`. Use `risk: high` for migrations and for work that is hard to reverse. `model` is optional.
51
+ Kinds: `feature`, `bugfix`, `refactor`, `migration`, `tests`, `docs`, `review`, `other`, as the data records them: `feature` is implementation work of any kind, `review` a read-only review, `other` anything else; research is `other` with `risk: low`. Leave `risk` out otherwise: in the rows it is the agent's role, not how hard or how reversible the work is, so `high` buys nothing and the output says when a written risk was not used. Set `model` whenever you know which model will run the task; it is the strongest split in the data. `bugfix`, `refactor` and `migration` have few or no seed runs: an estimate with them leans on broader runs, up to all runs, and says so; pass that on rather than relabel the work.
52
52
 
53
53
  ## Re-answer a human quote
54
54
 
@@ -65,9 +65,9 @@ If the user wants to see later which number held, offer the same command with `-
65
65
  ## Report the result
66
66
 
67
67
  - Lead with the plan total as a range: P50, P80 and P90, on the session clock. Recommend P80 for planning.
68
- - Pass on the session-clock line and the human part line as the CLI prints them. The first says that gaps between runs count toward the total up to the idle cap, so short waits on the user sit inside it. Unmeasured, the human part line says no allowance for review, testing, decisions and waiting between agent turns is added. Measured by `agentpace turns`, it quotes the user's own wait per human turn, from their local history. Either way, do not derive a number for it from the agent time, and do not multiply the per-turn wait by a guessed number of turns. If the user gives their own figure, repeat it and label it as theirs. If they state their review capacity, such as "4 PRs a day", pass it verbatim with `--review-capacity "<figure>"`, relay the `Review capacity:` line as printed, and never turn it into a timeline.
68
+ - Pass on the session-clock line and the human part line as the CLI prints them. The first says that gaps between runs count toward the total up to the idle cap, so short waits on the user sit inside it. Unmeasured, the human part line says no allowance for review, testing, decisions and waiting between agent turns is added. Measured by `agentpace turns`, it quotes the user's own wait per human turn, from their local history. Either way, do not derive a number for it from the agent time, and do not multiply the per-turn wait by a guessed number of turns. If the user gives their own figure, repeat it and label it as theirs. If they state their review capacity, such as "4 PRs a day", pass it verbatim with `--review-capacity "<figure>"`, relay the `Review capacity:` line as printed, and never turn it into a timeline. Pass the figure itself, not the sentence around it, in at most 80 characters; if it does not fit, leave the flag off and repeat the user's figure as theirs beside the result.
69
69
  - Name the critical path and the effective parallelism.
70
- - Pass every warning on. A warning means a cell had too few runs, so that range leans on broader data.
70
+ - Pass every warning on, as printed. One names a cell with no or few recorded runs and says what the range could not use (the kind, the risk level or the model) and where it leaned instead; one says a written risk or size was not used; one says parallelism was assumed.
71
71
  - Do not state a single number, even when pressed. If someone needs one figure to plan around, give the P80 and call it the P80.
72
72
 
73
73
  ## Limits to state when they matter
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use this page to answer questions about the method. It is not needed for a routine estimate.
4
4
 
5
- **A task.** The estimator finds the closest cell of past runs by kind, risk and model. A thin cell leans on broader cells, so a cell with few runs gets a wider range and a warning.
5
+ **A task.** The estimator finds the closest cell of past runs by kind, risk and model. A thin cell leans on broader cells, so a cell with few runs gets a wider range and a warning. Risk is the agent's role as recorded, not a rating of the work; a plan's risk is read the same way.
6
6
 
7
7
  **A plan.** Each simulation draws a duration for every task, then takes the longer of two limits: the longest dependency path, and the total work divided by the throughput real sessions achieved at that agent cap. Tasks in one plan share a session effect, because they share a repo, a model and a day. Without it, the total of many tasks would come out falsely narrow.
8
8
 
@@ -12,6 +12,6 @@ Use this page to answer questions about the method. It is not needed for a routi
12
12
 
13
13
  **What is measured.** Per task, the time an agent ran, with each idle gap inside the run counted up to 900 seconds. Per plan, the session's span on its own clock, built the same way across the gaps between runs.
14
14
 
15
- **The human part.** No allowance for review, testing, decisions or waiting between agent turns is added to the total; because the session clock counts the gaps between runs up to the idle cap, a wait shorter than that sits inside the plan total and a longer one is clipped. Every estimate prints this on its own lines. They read "not measured" unless `agentpace turns` has measured the user's own wait per human turn from their main-session timestamps. That measurement is elapsed time, not effort, and is kept local. No multiplier turns agent time into human time, so none is applied. A human-scale quote such as "three weeks" is shown beside the range as unverified, never converted.
15
+ **The human part.** No allowance for review, testing, decisions or waiting between agent turns is added to the total; because the session clock counts the gaps between runs up to the idle cap, a wait shorter than that sits inside the plan total and a longer one is clipped. Every estimate prints this on its own lines. The human part line reads "not measured" unless `agentpace turns` has measured the user's own wait per human turn from their main-session timestamps. That measurement is elapsed time, not effort, and is kept local. No multiplier turns agent time into human time, so none is applied. A human-scale quote such as "three weeks" is shown beside the range as unverified, never converted.
16
16
 
17
17
  **How far to trust it.** See `docs/backtest.md`. Every number there is regenerated from the published rows by `agentpace backtest`.
@@ -26,6 +26,6 @@ The plan to estimate: $ARGUMENTS
26
26
  }
27
27
  ```
28
28
 
29
- Kinds: `feature`, `bugfix`, `refactor`, `migration`, `tests`, `docs`, `review`, `other`. Risks: `low`, `normal`, `high`.
30
- 3. Run `agentpace estimate <file>`. If the conversation already holds a timeline in days, weeks or months, add `--quoted "<quote>"` in the words it was given. Only if the user stated their own review capacity, such as "4 PRs a day", add `--review-capacity "<figure>"` with their words verbatim.
31
- 4. Report the total as P50, P80 and P90, then the `Quoted:` line as printed when there is one, then the session-clock line and the human part line exactly as the CLI prints them, and the `Review capacity:` line as printed when there is one, never turned into a timeline, then the critical path, the effective parallelism and every warning. Do not derive a number for the human part from the agent time. Never convert the quote, compare it with the range, say what the difference between them is, or say what the quote counts: it is calendar time, as quoted, and nothing has checked it. Never reduce the result to one number.
29
+ Kinds: `feature`, `bugfix`, `refactor`, `migration`, `tests`, `docs`, `review`, `other`; `feature` is implementation work of any kind, and research is `other` with `risk: low`. Leave `risk` out otherwise: in the rows it is the agent's role, not how hard the work is, so `high` buys nothing. Set `model` whenever you know it; it is the strongest split in the data.
30
+ 3. Run `agentpace estimate <file>`. If the conversation already holds a timeline in days, weeks or months, add `--quoted "<quote>"` in the words it was given. Only if the user stated their own review capacity, such as "4 PRs a day", add `--review-capacity "<figure>"` with their words verbatim: the figure itself, in at most 80 characters; otherwise leave the flag off and repeat their figure as theirs.
31
+ 4. Report the total as P50, P80 and P90, then the `Quoted:` line as printed when there is one, then the session-clock line and the human part line exactly as the CLI prints them, and the `Review capacity:` line as printed when there is one, never turned into a timeline, then the critical path, the effective parallelism and every warning as printed. Do not derive a number for the human part from the agent time. Never convert the quote, compare it with the range, say what the difference between them is, or say what the quote counts: it is calendar time, as quoted, and nothing has checked it. Never reduce the result to one number.
@@ -1,3 +1,3 @@
1
1
  """agentpace: real run times for coding agents, as P50/P80/P90 ranges."""
2
2
 
3
- __version__ = "0.11.3"
3
+ __version__ = "0.12.1"
@@ -43,6 +43,25 @@ def classify_risk(agent_type: str | None, kind: str) -> str:
43
43
  return "normal"
44
44
 
45
45
 
46
+ RECORDED_RISKS: Mapping[str, frozenset[str]] = {
47
+ "review": frozenset({"low"}),
48
+ "migration": frozenset({"high"}),
49
+ "other": frozenset({"low", "normal"}),
50
+ }
51
+
52
+
53
+ def kind_default_risk(kind: str) -> str:
54
+ return {"review": "low", "migration": "high"}.get(kind, "normal")
55
+
56
+
57
+ def recorded_risk(kind: str, risk: str | None) -> str:
58
+ """The risk a plan task is looked up at: as written when the rows can record that kind at that
59
+ risk, else the kind's recorded risk."""
60
+ if risk is not None and risk in RECORDED_RISKS.get(kind, frozenset({"normal"})):
61
+ return risk
62
+ return kind_default_risk(kind)
63
+
64
+
46
65
  def size_bucket(edit_calls: int) -> str:
47
66
  """Measured after the run, so it is kept out of the default forecast."""
48
67
  if edit_calls == 0:
@@ -127,7 +127,8 @@ def cmd_ingest(args: argparse.Namespace) -> int:
127
127
  print(EXPERIMENTAL_NOTE.format(name=adapter.name), file=sys.stderr)
128
128
  for line in report.lines():
129
129
  print(line, file=sys.stderr)
130
- print(f"store now holds: {total} rows", file=sys.stderr)
130
+ # Two spaces: the value lines up with the ingest report's 18-character label column above it.
131
+ print(f"store now holds: {render.count(total, 'row')}", file=sys.stderr)
131
132
  return 0
132
133
 
133
134
 
@@ -155,14 +156,22 @@ def _cached_starts() -> dict[str, float]:
155
156
  return starts
156
157
 
157
158
 
158
- NO_CHRONOLOGY = (
159
- "{count} sessions have no local chronology (no cache entry, or ingested with another idle "
160
- "cap); they are listed by week only. Run agentpace ingest to refresh the cache."
161
- )
162
- CANNOT_TELL_LAST = (
163
- "cannot tell which run is last: {count} sessions have no local chronology. "
164
- "Run agentpace ingest, or give a reference from agentpace runs"
165
- )
159
+ def _no_chronology(count: int) -> str:
160
+ one = count == 1
161
+ return (
162
+ f"{render.count(count, 'session')} {'has' if one else 'have'} no local chronology "
163
+ "(no cache entry, or ingested with another idle cap); "
164
+ f"{'it is' if one else 'they are'} listed by week only. "
165
+ "Run agentpace ingest to refresh the cache."
166
+ )
167
+
168
+
169
+ def _cannot_tell_last(count: int) -> str:
170
+ return (
171
+ f"cannot tell which run is last: {render.count(count, 'session')} "
172
+ f"{'has' if count == 1 else 'have'} no local chronology. "
173
+ "Run agentpace ingest, or give a reference from agentpace runs"
174
+ )
166
175
 
167
176
 
168
177
  def cmd_runs(args: argparse.Namespace) -> int:
@@ -186,7 +195,7 @@ def cmd_runs(args: argparse.Namespace) -> int:
186
195
  )
187
196
  unknown = {row["batch"] for row in listed if row["batch"] not in starts}
188
197
  if unknown:
189
- print(NO_CHRONOLOGY.format(count=len(unknown)), file=sys.stderr)
198
+ print(_no_chronology(len(unknown)), file=sys.stderr)
190
199
  return 0
191
200
 
192
201
 
@@ -199,7 +208,7 @@ def _last_ref(rows: Sequence[schema.Row], starts: dict[str, float]) -> str:
199
208
  known = {row["batch"] for row in rows if row["batch"] in starts}
200
209
  if not known:
201
210
  unknown = {row["batch"] for row in rows}
202
- raise ValueError(CANNOT_TELL_LAST.format(count=len(unknown)))
211
+ raise ValueError(_cannot_tell_last(len(unknown)))
203
212
  chosen = max(known, key=lambda batch: (starts[batch], batch))
204
213
  members = [row for row in rows if row["batch"] == chosen]
205
214
  latest_week = max(row["week"] for row in members)
@@ -207,7 +216,7 @@ def _last_ref(rows: Sequence[schema.Row], starts: dict[str, float]) -> str:
207
216
  row["batch"] for row in rows if row["batch"] not in starts and row["week"] >= latest_week
208
217
  }
209
218
  if rivals:
210
- raise ValueError(CANNOT_TELL_LAST.format(count=len(rivals)))
219
+ raise ValueError(_cannot_tell_last(len(rivals)))
211
220
  return ingest.run_ref(max(members, key=lambda row: row["offset_s"]))
212
221
 
213
222
 
@@ -281,9 +290,12 @@ def _experimental_rows_note(rows: Sequence[schema.Row]) -> str | None:
281
290
  if not harnesses:
282
291
  return None
283
292
  names = ", ".join(sorted(set(harnesses)))
293
+ one = len(harnesses) == 1
284
294
  return (
285
- f"note: {len(harnesses)} of {len(rows)} rows come from experimental adapters ({names}); "
286
- "they take part in this estimate because they are in your local store. "
295
+ f"note: {len(harnesses)} of {render.count(len(rows), 'row')} "
296
+ f"{'comes' if one else 'come'} from experimental adapters ({names}); "
297
+ f"{'it takes' if one else 'they take'} part in this estimate because "
298
+ f"{'it is' if one else 'they are'} in your local store. "
287
299
  "Pass --data to choose the rows."
288
300
  )
289
301
 
@@ -304,7 +316,7 @@ def cmd_estimate(args: argparse.Namespace) -> int:
304
316
  document = json.loads(text)
305
317
  except json.JSONDecodeError:
306
318
  raise ValueError("the plan is not valid JSON") from None
307
- tasks, cap = estimate.tasks_from_json(document)
319
+ tasks, cap = estimate.tasks_from_json(document, args.use_risk)
308
320
  rows = _dataset(args.data)
309
321
  # Only the default pool takes in rows unasked; rows passed with --data were chosen.
310
322
  experimental = None if args.data else _experimental_rows_note(rows)
@@ -401,7 +413,10 @@ def _local_rows() -> list[schema.Row]:
401
413
  def cmd_score(args: argparse.Namespace) -> int:
402
414
  ledger = forecasts.read(paths.forecasts_file())
403
415
  if ledger.skipped:
404
- print(f"skipped {ledger.skipped} damaged lines in the ledger", file=sys.stderr)
416
+ print(
417
+ f"skipped {render.count(ledger.skipped, 'damaged line')} in the ledger",
418
+ file=sys.stderr,
419
+ )
405
420
  if args.id:
406
421
  return _score_one(args, ledger)
407
422
  if args.session or args.actual:
@@ -439,8 +454,8 @@ def cmd_turns(args: argparse.Namespace) -> int:
439
454
  print("No waits on you were found, so the human part stays not measured.")
440
455
  return 0
441
456
  print(
442
- f"Waiting on you, from your history (local): {summary.gaps} gaps between agent turns "
443
- f"in {summary.sessions} sessions."
457
+ f"Waiting on you, from your history (local): {render.count(summary.gaps, 'gap')} "
458
+ f"between agent turns in {render.count(summary.sessions, 'session')}."
444
459
  )
445
460
  print(
446
461
  f"Per human turn: P50 {render.duration(summary.p50)}, P80 {render.duration(summary.p80)}, "
@@ -495,11 +510,16 @@ def cmd_share(args: argparse.Namespace) -> int:
495
510
  print(share.NOTICE, file=sys.stderr)
496
511
  if dropped:
497
512
  print(
498
- f"{sum(dropped.values())} rows from {len(dropped)} dropped sessions left out.",
513
+ f"{render.count(sum(dropped.values()), 'row')} from "
514
+ f"{render.count(len(dropped), 'dropped session')} left out.",
499
515
  file=sys.stderr,
500
516
  )
501
517
  if skipped:
502
- print(f"{skipped} rows are already published and left out.", file=sys.stderr)
518
+ print(
519
+ f"{render.count(skipped, 'row')} {'is' if skipped == 1 else 'are'} already published "
520
+ "and left out.",
521
+ file=sys.stderr,
522
+ )
503
523
  if not chosen:
504
524
  print("nothing new to share.", file=sys.stderr)
505
525
  return 0
@@ -514,22 +534,26 @@ def cmd_share(args: argparse.Namespace) -> int:
514
534
  target = (
515
535
  f"--write would create {path}."
516
536
  if held is None
517
- else f"--write would add them to {path}, which holds {held} rows."
537
+ else f"--write would add {'it' if len(chosen) == 1 else 'them'} to {path}, "
538
+ f"which holds {render.count(held, 'row')}."
518
539
  )
519
540
  print(
520
- f"dry run: {len(chosen)} rows shown above, nothing written. {target}",
541
+ f"dry run: {render.count(len(chosen), 'row')} shown above, nothing written. {target}",
521
542
  file=sys.stderr,
522
543
  )
523
544
  return 0
524
545
  added, existing = share.write_contribution(path, chosen)
525
546
  if existing:
526
547
  print(
527
- f"added {added} rows to {path}, which already held {existing}. "
548
+ f"added {render.count(added, 'row')} to {path}, which already held {existing}. "
528
549
  "Nothing has been sent. To submit:",
529
550
  file=sys.stderr,
530
551
  )
531
552
  else:
532
- print(f"wrote {added} rows to {path}. Nothing has been sent. To submit:", file=sys.stderr)
553
+ print(
554
+ f"wrote {render.count(added, 'row')} to {path}. Nothing has been sent. To submit:",
555
+ file=sys.stderr,
556
+ )
533
557
  for command in share.git_commands(path):
534
558
  print(f" {command}", file=sys.stderr)
535
559
  return 0
@@ -543,7 +567,7 @@ def cmd_validate(args: argparse.Namespace) -> int:
543
567
  for finding in findings:
544
568
  print(finding)
545
569
  if findings:
546
- print(f"{len(findings)} problems", file=sys.stderr)
570
+ print(render.count(len(findings), "problem"), file=sys.stderr)
547
571
  return 1
548
572
  print("all rows valid")
549
573
  return 0
@@ -593,7 +617,7 @@ def cmd_claims(args: argparse.Namespace) -> int:
593
617
  if args.check and stale:
594
618
  print(f"out of date: {', '.join(stale)}. Run `agentpace claims`.", file=sys.stderr)
595
619
  return 1
596
- print("claims match the data" if args.check else f"updated {len(stale)} files")
620
+ print("claims match the data" if args.check else f"updated {render.count(len(stale), 'file')}")
597
621
  return 0
598
622
 
599
623
 
@@ -659,6 +683,13 @@ def build_parser() -> argparse.ArgumentParser:
659
683
  action="store_true",
660
684
  help="use size: an oracle track, because stored size is measured after a run",
661
685
  )
686
+ estimate_cmd.add_argument(
687
+ "--use-risk",
688
+ action="store_true",
689
+ help="use each task's risk as written, as a recorded category (review and research agents "
690
+ "low, migration agents high, all else normal), even where no recorded run has that kind "
691
+ "at that risk; by default such a task takes its kind's recorded risk",
692
+ )
662
693
  estimate_cmd.add_argument("--draws", type=int, default=estimate.DEFAULT_DRAWS)
663
694
  estimate_cmd.add_argument("--seed", type=int, default=estimate.DEFAULT_SEED)
664
695
  estimate_cmd.add_argument("--json", action="store_true", help="machine-readable output")
@@ -38,6 +38,7 @@ from collections.abc import Iterable, Mapping, Sequence
38
38
  from dataclasses import dataclass, field
39
39
  from typing import Any
40
40
 
41
+ from agentpace import classify
41
42
  from agentpace.schema import Row
42
43
 
43
44
  QUANTILES = (0.5, 0.8, 0.9)
@@ -479,6 +480,8 @@ class Task:
479
480
  size: str | None = None
480
481
  model: str | None = None
481
482
  depends_on: tuple[str, ...] = ()
483
+ # The plan's risk as written, kept to say when the lookup used another; None when omitted.
484
+ risk_given: str | None = None
482
485
 
483
486
 
484
487
  @dataclass(frozen=True)
@@ -635,6 +638,18 @@ def _warnings(model: Model, tasks: Sequence[Task], located: Mapping[str, Located
635
638
  "size ignored: stored size is measured after a run, so it is left out unless you "
636
639
  "pass --use-size."
637
640
  )
641
+ changed = [
642
+ f"{task.id} ({task.risk_given} -> {task.risk})"
643
+ for task in tasks
644
+ if task.risk_given is not None and task.risk_given != task.risk
645
+ ]
646
+ if changed:
647
+ notes.append(
648
+ f"risk as written was not used for {', '.join(changed)}: in the recorded runs, risk "
649
+ "is the agent's role (review and research agents low, migration agents high, "
650
+ "everything else normal), not how hard or how reversible the work is, so each took "
651
+ "the risk recorded for its kind. Pass --use-risk to look the values up as written."
652
+ )
638
653
  return notes
639
654
 
640
655
 
@@ -780,8 +795,12 @@ def cell_quantiles(
780
795
  return p50, p80, p90
781
796
 
782
797
 
783
- def tasks_from_json(document: Any) -> tuple[list[Task], int]:
784
- """Validate a plan document. Errors name the problem, never the document's text."""
798
+ def tasks_from_json(document: Any, use_risk: bool = False) -> tuple[list[Task], int]:
799
+ """Validate a plan document. Errors name the problem, never the document's text.
800
+
801
+ A task's risk is looked up as written only where the rows can record that kind at that risk;
802
+ any other value, and an omitted one, takes the kind's recorded risk. `use_risk=True` keeps
803
+ every written value. The rule lives here, at the plan boundary, never in `fit` or `locate`."""
785
804
  from agentpace import schema
786
805
 
787
806
  if not isinstance(document, dict) or not isinstance(document.get("tasks"), list):
@@ -800,9 +819,10 @@ def tasks_from_json(document: Any) -> tuple[list[Task], int]:
800
819
  kind = item.get("kind")
801
820
  if kind not in schema.enum("task_kind"):
802
821
  raise ValueError(f"{where}: kind must be one of {schema.enum('task_kind')}")
803
- risk = item.get("risk", "normal")
804
- if risk not in schema.enum("risk"):
822
+ given = item.get("risk")
823
+ if given is not None and given not in schema.enum("risk"):
805
824
  raise ValueError(f"{where}: risk must be one of {schema.enum('risk')}")
825
+ risk = given if (use_risk and given is not None) else classify.recorded_risk(kind, given)
806
826
  size = item.get("size")
807
827
  if size is not None and size not in schema.enum("size"):
808
828
  raise ValueError(f"{where}: size must be one of {schema.enum('size')}")
@@ -820,6 +840,7 @@ def tasks_from_json(document: Any) -> tuple[list[Task], int]:
820
840
  size=size,
821
841
  model=item.get("model", plan_model),
822
842
  depends_on=tuple(str(dependency) for dependency in dependencies),
843
+ risk_given=given,
823
844
  )
824
845
  )
825
846
  return tasks, cap