howhard 2.2.0__tar.gz → 3.0.0__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 (100) hide show
  1. {howhard-2.2.0 → howhard-3.0.0}/.antigravity-plugin/plugin.json +1 -1
  2. {howhard-2.2.0 → howhard-3.0.0}/.claude-plugin/plugin.json +1 -1
  3. {howhard-2.2.0 → howhard-3.0.0}/CHANGELOG.md +20 -0
  4. {howhard-2.2.0/src/howhard.egg-info → howhard-3.0.0}/PKG-INFO +9 -9
  5. {howhard-2.2.0 → howhard-3.0.0}/README.md +8 -8
  6. howhard-3.0.0/docs/capability.md +142 -0
  7. {howhard-2.2.0 → howhard-3.0.0}/docs/configuration.md +48 -1
  8. {howhard-2.2.0 → howhard-3.0.0}/docs/context.md +21 -2
  9. {howhard-2.2.0 → howhard-3.0.0}/docs/index.md +5 -0
  10. {howhard-2.2.0 → howhard-3.0.0}/docs/quickstart.md +8 -6
  11. {howhard-2.2.0 → howhard-3.0.0}/docs/reference.md +39 -18
  12. {howhard-2.2.0 → howhard-3.0.0}/docs/releasing.md +2 -1
  13. {howhard-2.2.0 → howhard-3.0.0}/docs/semantic-memory.md +40 -12
  14. howhard-3.0.0/docs/upgrading-3.0.md +29 -0
  15. {howhard-2.2.0 → howhard-3.0.0}/plugin.json +1 -1
  16. {howhard-2.2.0 → howhard-3.0.0}/scripts/verify-wheel.py +7 -0
  17. {howhard-2.2.0 → howhard-3.0.0}/skills/howhard/SKILL.md +21 -11
  18. {howhard-2.2.0 → howhard-3.0.0}/skills/howhard/references/workflow.md +29 -8
  19. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/__init__.py +1 -1
  20. howhard-3.0.0/src/howhard/capability.py +390 -0
  21. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/cli.py +4 -3
  22. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/config.py +7 -1
  23. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/context.py +1 -1
  24. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/data/semantic.toml +2 -3
  25. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/decisions.py +18 -10
  26. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/engine.py +120 -43
  27. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/llm.py +17 -0
  28. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/native.py +2 -2
  29. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/report.py +73 -1
  30. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/selector.py +28 -10
  31. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/semantic.py +100 -21
  32. howhard-3.0.0/src/howhard/success.py +156 -0
  33. {howhard-2.2.0 → howhard-3.0.0/src/howhard.egg-info}/PKG-INFO +9 -9
  34. {howhard-2.2.0 → howhard-3.0.0}/src/howhard.egg-info/SOURCES.txt +6 -0
  35. {howhard-2.2.0 → howhard-3.0.0}/tests/conftest.py +33 -0
  36. howhard-3.0.0/tests/test_capability_filter.py +341 -0
  37. {howhard-2.2.0 → howhard-3.0.0}/tests/test_configured_candidates.py +1 -1
  38. {howhard-2.2.0 → howhard-3.0.0}/tests/test_context.py +1 -1
  39. howhard-3.0.0/tests/test_cost_to_success.py +146 -0
  40. {howhard-2.2.0 → howhard-3.0.0}/tests/test_current_contract.py +2 -2
  41. {howhard-2.2.0 → howhard-3.0.0}/tests/test_execution_accounting.py +3 -0
  42. {howhard-2.2.0 → howhard-3.0.0}/tests/test_portable_core.py +3 -0
  43. {howhard-2.2.0 → howhard-3.0.0}/tests/test_retrieval.py +1 -1
  44. {howhard-2.2.0 → howhard-3.0.0}/tests/test_semantic.py +11 -5
  45. {howhard-2.2.0 → howhard-3.0.0}/tests/test_semantic_cli.py +13 -3
  46. {howhard-2.2.0 → howhard-3.0.0}/tests/test_semantic_only.py +5 -1
  47. {howhard-2.2.0 → howhard-3.0.0}/tests/test_write_queue.py +3 -0
  48. {howhard-2.2.0 → howhard-3.0.0}/.agents/plugins/marketplace.json +0 -0
  49. {howhard-2.2.0 → howhard-3.0.0}/.claude-plugin/marketplace.json +0 -0
  50. {howhard-2.2.0 → howhard-3.0.0}/.readthedocs.yaml +0 -0
  51. {howhard-2.2.0 → howhard-3.0.0}/AGENTS.md +0 -0
  52. {howhard-2.2.0 → howhard-3.0.0}/MANIFEST.in +0 -0
  53. {howhard-2.2.0 → howhard-3.0.0}/benchmarks/__init__.py +0 -0
  54. {howhard-2.2.0 → howhard-3.0.0}/benchmarks/bench_rule_retrieval.py +0 -0
  55. {howhard-2.2.0 → howhard-3.0.0}/benchmarks/rule_cases.json +0 -0
  56. {howhard-2.2.0 → howhard-3.0.0}/benchmarks/rule_retrieval.py +0 -0
  57. {howhard-2.2.0 → howhard-3.0.0}/docs/changelog.md +0 -0
  58. {howhard-2.2.0 → howhard-3.0.0}/docs/concurrency.md +0 -0
  59. {howhard-2.2.0 → howhard-3.0.0}/docs/conf.py +0 -0
  60. {howhard-2.2.0 → howhard-3.0.0}/docs/contributing.md +0 -0
  61. {howhard-2.2.0 → howhard-3.0.0}/docs/evaluation.md +0 -0
  62. {howhard-2.2.0 → howhard-3.0.0}/docs/requirements.txt +0 -0
  63. {howhard-2.2.0 → howhard-3.0.0}/docs/retrieval.md +0 -0
  64. {howhard-2.2.0 → howhard-3.0.0}/docs/rule-benchmark.md +0 -0
  65. {howhard-2.2.0 → howhard-3.0.0}/docs/session_handoff_format.md +0 -0
  66. {howhard-2.2.0 → howhard-3.0.0}/docs/skills.md +0 -0
  67. {howhard-2.2.0 → howhard-3.0.0}/docs/upgrading-1.0.md +0 -0
  68. {howhard-2.2.0 → howhard-3.0.0}/docs/upgrading-2.0.md +0 -0
  69. {howhard-2.2.0 → howhard-3.0.0}/pyproject.toml +0 -0
  70. {howhard-2.2.0 → howhard-3.0.0}/scripts/check +0 -0
  71. {howhard-2.2.0 → howhard-3.0.0}/scripts/check-plugins.py +0 -0
  72. {howhard-2.2.0 → howhard-3.0.0}/scripts/check-skills.py +0 -0
  73. {howhard-2.2.0 → howhard-3.0.0}/setup.cfg +0 -0
  74. {howhard-2.2.0 → howhard-3.0.0}/skills/attribute-failure/SKILL.md +0 -0
  75. {howhard-2.2.0 → howhard-3.0.0}/skills/howhard/references/accounting.md +0 -0
  76. {howhard-2.2.0 → howhard-3.0.0}/skills/howhard/references/hosts.md +0 -0
  77. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/__main__.py +0 -0
  78. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/accounting.py +0 -0
  79. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/data/context.toml +0 -0
  80. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/data/default_config.toml +0 -0
  81. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/files.py +0 -0
  82. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/memory.py +0 -0
  83. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/retrieval.py +0 -0
  84. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/state.py +0 -0
  85. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/storage.py +0 -0
  86. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/validation.py +0 -0
  87. {howhard-2.2.0 → howhard-3.0.0}/src/howhard/writes.py +0 -0
  88. {howhard-2.2.0 → howhard-3.0.0}/src/howhard.egg-info/dependency_links.txt +0 -0
  89. {howhard-2.2.0 → howhard-3.0.0}/src/howhard.egg-info/entry_points.txt +0 -0
  90. {howhard-2.2.0 → howhard-3.0.0}/src/howhard.egg-info/requires.txt +0 -0
  91. {howhard-2.2.0 → howhard-3.0.0}/src/howhard.egg-info/top_level.txt +0 -0
  92. {howhard-2.2.0 → howhard-3.0.0}/tests/test_cli.py +0 -0
  93. {howhard-2.2.0 → howhard-3.0.0}/tests/test_fast_reranking.py +0 -0
  94. {howhard-2.2.0 → howhard-3.0.0}/tests/test_measurement_corrections.py +0 -0
  95. {howhard-2.2.0 → howhard-3.0.0}/tests/test_memory.py +0 -0
  96. {howhard-2.2.0 → howhard-3.0.0}/tests/test_native_startup.py +0 -0
  97. {howhard-2.2.0 → howhard-3.0.0}/tests/test_retrieval_config.py +0 -0
  98. {howhard-2.2.0 → howhard-3.0.0}/tests/test_rule_benchmark.py +0 -0
  99. {howhard-2.2.0 → howhard-3.0.0}/tests/test_skill_workflow.py +0 -0
  100. {howhard-2.2.0 → howhard-3.0.0}/tests/test_storage.py +0 -0
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "howhard",
4
4
  "displayName": "howhard",
5
- "version": "2.2.0",
5
+ "version": "3.0.0",
6
6
  "description": "Recommend model and reasoning effort from task context, then learn from actual feedback through writable semantic memory.",
7
7
  "author": {"name": "howhard contributors"},
8
8
  "repository": "https://github.com/xu-hao/howhard"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "howhard",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "Recommend model and reasoning effort from task context, then learn from actual feedback through writable semantic memory.",
5
5
  "author": {"name": "howhard contributors"},
6
6
  "repository": "https://github.com/xu-hao/howhard"
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0 — 2026-11-09
4
+
5
+ - Accept any nonempty distinct candidate inventory and learn a task-specific capability
6
+ order and fit band from similarity-weighted actual execution outcomes. Share the
7
+ observation store and tempered expert-score replay with calibrated forecasts; expose
8
+ prior-only placements, threshold evidence and filter-quality diagnostics (#66).
9
+ - Add filter → forecast requests, a default 12-cell fine-forecast budget with one explicit
10
+ re-filter, and bounded stronger-only widening before cap-unmet fallback. Never truncate
11
+ inventories or fabricate forecasts/outcomes for excluded cells (#66).
12
+ - Minimize expected cost to an accepted result with same-cell retries after loud failure.
13
+ Apply epsilon to accepted-result silent defect risk, calibrate bounded sampling from
14
+ forecast spread and predictive evidence, and restrict exploration by mean cost and
15
+ supported uncertainty. Cap-unmet selection is deterministic and requires review (#67).
16
+ - Break the calling-agent/provider contract: decision v6 receipts include both readers
17
+ and frozen accepted-result selection, agent requests use v5, and semantic state uses v4.
18
+ Old receipts cannot supply new receipt-bound feedback or predictive scoring; raw
19
+ historical evidence remains intact. Update adapters and skills; reprepare pending
20
+ requests. C_loud and epsilon have new retry/accepted-result meanings. See the 3.0
21
+ upgrade guide (#66, #67).
22
+
3
23
  ## Unreleased
4
24
 
5
25
  ## 2.2.0 — 2026-11-08
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howhard
3
- Version: 2.2.0
3
+ Version: 3.0.0
4
4
  Summary: Choose an agent's model and reasoning effort, and learn from outcomes.
5
5
  Project-URL: Repository, https://github.com/xu-hao/howhard
6
6
  Project-URL: Issues, https://github.com/xu-hao/howhard/issues
@@ -32,11 +32,12 @@ Requires-Dist: sentence-transformers<7,>=5.4; extra == "qwen"
32
32
 
33
33
  `howhard` chooses the model and reasoning effort for a task delegated to an AI
34
34
  agent. An LLM reads the actual task, current project and writable semantic memory,
35
- forecasting clean completion, caught failures, escaped failures, tokens and time for
36
- each candidate. Recorded outcomes update the predictive support for memories.
35
+ learning a task-specific capability-fit band over the full supplied inventory, then
36
+ forecasting clean/caught/escaped outcomes, tokens and time only for that band. One
37
+ recorded outcome updates both the threshold reader and predictive support for memories.
37
38
 
38
- Selection balances worker cost, expected failure cost and waiting time. Its risk cap
39
- uses a weighted envelope of LLM forecasts; these estimates are not a calibrated
39
+ Selection minimizes expected cost to an accepted result, including same-cell retries
40
+ after loud failures. Its risk cap applies to defects among accepted results; these estimates are not a calibrated
40
41
  failure guarantee. Without a usable LLM forecast, routing stops explicitly.
41
42
 
42
43
  ## Quickstart
@@ -44,17 +45,16 @@ failure guarantee. Without a usable LLM forecast, routing stops explicitly.
44
45
  You need Python 3.11+, a POSIX shell, Git and a current Codex, Claude Code or
45
46
  Antigravity client with native plugin support.
46
47
 
47
- Install the Python backend from [PyPI](https://pypi.org/project/howhard/2.1.0/) in your
48
- project directory:
48
+ Install the 3.0 backend from the tagged GitHub release in your project directory:
49
49
 
50
50
  ```sh
51
51
  python3 -m venv .venv-howhard
52
52
  . .venv-howhard/bin/activate
53
- python -m pip install "howhard==2.1.0"
53
+ python -m pip install "howhard @ git+https://github.com/xu-hao/howhard.git@v3.0.0"
54
54
  howhard --version
55
55
  ```
56
56
 
57
- Expect `howhard 2.1.0`. Keep the environment active and start your agent from the same
57
+ Expect `howhard 3.0.0`. Keep the environment active and start your agent from the same
58
58
  shell so it can find `howhard`. An existing GUI session may need the absolute path to
59
59
  `.venv-howhard/bin/howhard` in your project.
60
60
 
@@ -6,11 +6,12 @@
6
6
 
7
7
  `howhard` chooses the model and reasoning effort for a task delegated to an AI
8
8
  agent. An LLM reads the actual task, current project and writable semantic memory,
9
- forecasting clean completion, caught failures, escaped failures, tokens and time for
10
- each candidate. Recorded outcomes update the predictive support for memories.
9
+ learning a task-specific capability-fit band over the full supplied inventory, then
10
+ forecasting clean/caught/escaped outcomes, tokens and time only for that band. One
11
+ recorded outcome updates both the threshold reader and predictive support for memories.
11
12
 
12
- Selection balances worker cost, expected failure cost and waiting time. Its risk cap
13
- uses a weighted envelope of LLM forecasts; these estimates are not a calibrated
13
+ Selection minimizes expected cost to an accepted result, including same-cell retries
14
+ after loud failures. Its risk cap applies to defects among accepted results; these estimates are not a calibrated
14
15
  failure guarantee. Without a usable LLM forecast, routing stops explicitly.
15
16
 
16
17
  ## Quickstart
@@ -18,17 +19,16 @@ failure guarantee. Without a usable LLM forecast, routing stops explicitly.
18
19
  You need Python 3.11+, a POSIX shell, Git and a current Codex, Claude Code or
19
20
  Antigravity client with native plugin support.
20
21
 
21
- Install the Python backend from [PyPI](https://pypi.org/project/howhard/2.1.0/) in your
22
- project directory:
22
+ Install the 3.0 backend from the tagged GitHub release in your project directory:
23
23
 
24
24
  ```sh
25
25
  python3 -m venv .venv-howhard
26
26
  . .venv-howhard/bin/activate
27
- python -m pip install "howhard==2.1.0"
27
+ python -m pip install "howhard @ git+https://github.com/xu-hao/howhard.git@v3.0.0"
28
28
  howhard --version
29
29
  ```
30
30
 
31
- Expect `howhard 2.1.0`. Keep the environment active and start your agent from the same
31
+ Expect `howhard 3.0.0`. Keep the environment active and start your agent from the same
32
32
  shell so it can find `howhard`. An existing GUI session may need the absolute path to
33
33
  `.venv-howhard/bin/howhard` in your project.
34
34
 
@@ -0,0 +1,142 @@
1
+ # Task-specific capability filtering
2
+
3
+ howhard reads one execution evidence store in two ways. The coarse reader learns a
4
+ capability-fit band over the full inventory. The fine reader forecasts clean/loud/silent
5
+ outcomes, tokens and time only for that band. One `observe` row supplies both readers;
6
+ there is no separate fitness ledger or feedback command.
7
+
8
+ ## An order for this task
9
+
10
+ Each decision starts with an independent LLM prior: a complete order of opaque cell
11
+ keys, weakest to strongest **for this task and project**, plus inclusive lower and
12
+ upper fit cut points. A model may rank differently for debugging and writing. No
13
+ universal model leaderboard is fitted or reused. Within a model, known efforts follow
14
+ `low < medium < high < xhigh < max < ultra`; custom controls retain the prior's
15
+ within-model order. Cross-model placements can change with related execution evidence.
16
+
17
+ Fitness is a band: underpowered, fit, then overpowered. Threshold-clearing probability
18
+ is monotone along this decision's order; fitness is not a score that improves forever
19
+ with capability. A stronger cell is overpowered when a weaker one already meets the
20
+ reliability target and the additional clearing probability is below the gain margin.
21
+ The upper cut uses a reliable weaker cell whose gain to the strongest remaining cell
22
+ is below the margin, so the entire excluded suffix qualifies. Price, retry cost, and
23
+ accepted-result silent risk belong to stage 2.
24
+
25
+ The order assumes a useful scalar approximation to the demands of this task. Related
26
+ tasks and noisy outcomes do not establish a universal ranking, causal explanation,
27
+ or guarantee that a stronger cell succeeds. Receipts expose the prior, learned order,
28
+ observations, and assumptions so these approximations can be assessed.
29
+
30
+ ## Similarity-weighted censored observations
31
+
32
+ The required capability is a discrete latent threshold with a possible value beyond
33
+ the strongest supplied cell. Each expert's cut points define a smoothed prior CDF:
34
+ underpowered positions lie below `min_clear_probability`, the upper fit position
35
+ reaches `reliability_probability`, and the overpowered tail's possible gain stays
36
+ below `overpowered_gain_margin`. With no execution evidence or memory adjustment,
37
+ the result retains the independent prior's order and cuts exactly.
38
+
39
+ The existing tempered log-score weights mix the independent and versioned-memory
40
+ prior CDFs. Consensus ranks preserve each model's effort chain. A pooled adjacent
41
+ violators projection makes the mixed CDF monotone. The threshold reader then applies
42
+ the execution likelihood once to this mixed prior; it does not compete as a second
43
+ independent learner.
44
+
45
+ For a clean run at position c, the noisy likelihood is `1-noise` for thresholds at or
46
+ below c and `noise` above it. Loud/silent outcomes reverse that likelihood. Each
47
+ likelihood is raised to a fractional evidence weight:
48
+
49
+ ```text
50
+ row weight × sigmoid(relevance score) × severity/cause strength × recency discount
51
+ ```
52
+
53
+ Use the existing task/project retrieval to select at most eight precedents. The
54
+ configured cross-encoder supplies the absolute relevance score. Small retrieval
55
+ corpora normally skip reranking for display; the threshold reader scores those
56
+ selected precedents too. Sigmoid scores are heuristic relevance strengths, not
57
+ calibrated probabilities of task equivalence. A lone weak match is not normalized to
58
+ unit weight. The receipt freezes the raw score, similarity and effective weight.
59
+
60
+ Clean outcomes have strength 1. Loud and silent strengths default to 0.75 and 1.
61
+ An explicit `cause=capability` retains that strength; depth/unrecorded failures get
62
+ half strength. For those otherwise unattributed failures, an explicit
63
+ `capability_caused=false` assertion in the note gives zero threshold evidence. Ordinary
64
+ prose is not interpreted as a causal label. Recorded cause takes precedence over a
65
+ contradictory note. Outcomes always remain clean/loud/silent in the single store.
66
+
67
+ Cross-model order updates use the same marginal threshold likelihood with an initial
68
+ normalized order-distance penalty. Deterministic improving cross-model swaps preserve effort
69
+ chains. This is approximate task-local posterior/MAP search, not exact inference over
70
+ all permutations. Observed placements can swap across unseen cells while preserving
71
+ each model's effort chain. Only actual executions contribute likelihoods. If a precedent's
72
+ executed cell is absent, the reader does not guess an equivalent identity/control.
73
+
74
+ New cells have `placement=prior-only`: their initial position comes from the task's
75
+ LLM prior. They can still receive `threshold=learned` because observations at other
76
+ positions inform the shared task threshold. A receipt distinguishes these sources.
77
+ This transfer is conditional on the proposed placement; it is not an observed outcome
78
+ for the new cell.
79
+
80
+ ## Protocol and forecast budget
81
+
82
+ `context` returns `stage=filter`, the full validated inventory, a clean
83
+ `baseline_request`, and a separate memory reader request. The independent response is:
84
+
85
+ ```json
86
+ {"filter": {"order": ["cell:key-a", "cell:key-b"], "lower": "cell:key-a", "upper": "cell:key-b"}, "reason": "Task-specific prior"}
87
+ ```
88
+
89
+ The actual keys come from the request. Before submitting to `decide`, add
90
+ `memory_filters: []` or up to eight `{id, version, filter}` adjustments grounded in
91
+ retrieved active memories. Each adjustment supplies a complete order and cut points;
92
+ it can move a boundary or move a particular cell. Missing, duplicate or unknown keys,
93
+ nonordinal known efforts, reversed cuts and empty bands are refused.
94
+
95
+ `decide` applies the learned filter and returns a new `stage=forecast` request ID.
96
+ Evaluate its clean `baseline_request` in another independent context and supply the
97
+ normal `{forecasts, memory_forecasts, reason}` response. Only fit cells receive rows.
98
+ Neither independent call receives memory, execution evidence or learned tables.
99
+ `pick` and `summary` drive these same stages through a stateless provider adapter.
100
+
101
+ The inventory has no count limit. `max_forecast_cells` is a budget for fine forecasts,
102
+ not an inventory cap. If the learned band exceeds it, `decide` returns one re-filter
103
+ request with the full inventory. A second oversized band errors and asks for a tighter
104
+ filter. The backend never slices a band to fit the budget. If the posterior puts every cell
105
+ below the minimum clearing probability, it refuses routing and asks for a more capable
106
+ inventory; it does not relabel a known underpowered strongest cell as fit.
107
+
108
+ If no forecast cell passes the accepted-result silent cap, request the next stronger
109
+ overpowered cell, one per widening round, in capability order. Each requires an actual
110
+ new prospective forecast before entering selection. Underpowered cells never enter
111
+ widening. The default is two rounds, within the same total forecast budget. Only after
112
+ widening ends does `on_cap_unmet` apply. No probability is invented for an unforecast
113
+ cell. The final {ref}`selection policy <accepted-result-selection>` includes retry cost and
114
+ never explores when the cap is unmet.
115
+
116
+ ## Shared predictive scores and quality reports
117
+
118
+ Stage-1 experts use `filter:llm` and `filter:memory:ID:VERSION` in the same belief replay
119
+ as stage-2 experts. Both use the packaged probability floor, prior masses, temperature,
120
+ recency, evidence counts and support normalization. A stage-1 prior earns a binary
121
+ clean/non-clean log probability ratio against the independent fine forecast, coarsened
122
+ to the same binary outcome. Stage 2 keeps its ternary outcome and measured-usage log
123
+ scores. Normalize over participating experts separately for each reader. New or revised
124
+ memories have no historical predictive credit; unchanged overrides earn no exposure.
125
+ Amendments replace the effective outcome and score the original exposure once.
126
+
127
+ For every forecasted cell, compare the threshold posterior's `P_clear` with stage 2's
128
+ weighted `P_clean`. A difference above `consistency_margin` (default 0.2) is recorded,
129
+ without changing stage-2 selection. After the actual outcome, compare the frozen binary
130
+ log losses and report which reader was closer, including ties.
131
+
132
+ `howhard report --json` includes `filter_quality`: observed fit-cell loud/silent rates,
133
+ widening frequency, later clean executions of previously underpowered cells on retrieved
134
+ similar tasks, pending disagreements and resolved reader comparisons. Execution entries
135
+ retain the selected cell's original classification and position. Excluded cells that
136
+ never ran contribute no outcome. Reported rates are descriptive diagnostics.
137
+
138
+ Configuration defaults and validation are in [configuration](configuration.md).
139
+ Decision v6 receipts freeze the full filter, expert priors, task-specific order,
140
+ probabilities, band, widening, disagreement data, fine forecasts, and accepted-result
141
+ selection. Older receipts remain inspectable as raw artifacts but cannot supply new
142
+ receipt-bound feedback or predictive scores; old observation rows remain evidence.
@@ -46,7 +46,7 @@ When availability changes, pass Python `native_candidates=[...]` or CLI
46
46
  `--candidates FILE` instead. Supplied lists and named inventories are mutually exclusive;
47
47
  there is no union or fallback between them. An empty list or unknown inventory name is
48
48
  an error. Without an explicit list or inventory selector, the backend refuses selection
49
- even when saved lists exist. The same 1–32-cell validation and optional pricing fields
49
+ even when saved lists exist. The same nonempty, unbounded inventory validation and optional pricing fields
50
50
  apply to both sources; invalid configured lists fail before creating state. The
51
51
  `[models]` registry describes identities and evidence weights, not availability.
52
52
  Previously observed models never become candidates merely because they are in history.
@@ -188,3 +188,50 @@ model/control cells through `--candidates`, and the backend owns their minimal h
188
188
  metadata. Native price omission means unknown. `--state-dir` redirects standard `.howhard/` data paths while honoring custom
189
189
  configured paths, and keeps current project capture separate. Explicit configuration
190
190
  without that override retains its existing data locations and policies.
191
+
192
+
193
+ ## Capability and sampling policy
194
+
195
+ Defaults work without configuration. These optional application-owned settings control
196
+ forecast work and approximate inference; reader/retrieval messages cannot change them.
197
+
198
+ ```toml
199
+ [capability]
200
+ max_forecast_cells = 12
201
+ widening_rounds = 2
202
+ min_clear_probability = 0.5
203
+ reliability_probability = 0.9
204
+ overpowered_gain_margin = 0.05
205
+ consistency_margin = 0.2
206
+ observation_noise = 0.05
207
+ order_penalty = 0.15
208
+ loud_weight = 0.75
209
+ silent_weight = 1.0
210
+ unknown_cause_weight = 0.5
211
+
212
+ [sampling]
213
+ min_concentration = 8.0
214
+ max_concentration = 1000000.0
215
+ prior_strength = 8.0
216
+ explore_within = 0.10
217
+ uncertainty_multiplier = 1.0
218
+ ```
219
+
220
+ The full inventory has no size bound. An oversized fit band gets one re-filter round
221
+ and then a clear error; it is never truncated. Widening forecasts the next stronger
222
+ overpowered cell per round, within the same total forecast budget.
223
+
224
+ `max_forecast_cells` is a positive integer; widening rounds are nonnegative integers.
225
+ Require `0 < min_clear_probability < reliability_probability < 1` and observation noise
226
+ in `(0,0.5)`. Probability/strength margins are in `[0,1]`; order penalty is nonnegative.
227
+ Concentration bounds satisfy `1 <= min <= max`, prior strength and uncertainty multiplier
228
+ are positive, and sampling `explore_within` lies in `[0,1]`. A risk class's optional
229
+ `explore_within` further narrows that fraction. The supported uncertainty allowance is
230
+ `uncertainty_multiplier * (sd_best + sd_candidate)` using delta-method retry-cost
231
+ standard deviations; a candidate must satisfy both that allowance and the mean fraction.
232
+ No exploration occurs when no cell passes the accepted-result silent cap.
233
+
234
+ `C_loud` now prices extra overhead for each loud failure on top of its redo. Epsilon
235
+ caps defects among accepted non-loud results, not the raw per-attempt silent rate.
236
+ Review these meanings when upgrading a custom policy. See [estimator assumptions](capability.md)
237
+ and the {ref}`selection objective <accepted-result-selection>`.
@@ -1,8 +1,9 @@
1
1
  # Task text and changing project context
2
2
 
3
3
  The LLM receives original task text and bounded project text, together with observable
4
- project attributes. No lexical feature hashing, pretrained local encoder, contextual
5
- regression or statistical task representation is used. Historical observations preserve
4
+ project attributes. The independent LLM uses no lexical feature hashing or contextual regression.
5
+ Retrieval represents earlier task/project text, and the coarse threshold reader uses
6
+ its relevance scores; it does not replace the original task text. Historical observations preserve
6
7
  the task and snapshot captured for the actual execution.
7
8
 
8
9
  ## Capturing project state
@@ -61,3 +62,21 @@ available and accepts `--text` or `--text-file`; without a receipt it captures c
61
62
  at observation time. Use a receipt when the task changed project state. A receipt can
62
63
  also be passed to `Engine.observe(..., decision=...)`. Amendments always retain the
63
64
  original run's text, project snapshot and usage measurements.
65
+
66
+
67
+ ## Two reader stages in a frozen request
68
+
69
+ `context` first returns a capability-filter baseline and memory request over the full
70
+ inventory. Its task-specific order is recomputed for each decision. Submitting the
71
+ filter to `decide` returns a new request ID for calibrated forecasts over the fit band.
72
+ Both stages keep the original task and project snapshot and independently reject stale
73
+ evidence or memory. Retrieval, one explicit re-filter, and each stronger-only widening
74
+ round also return bound request IDs. Follow the returned `stage` until a `decision_id`
75
+ is produced. Neither clean baseline includes earlier execution evidence or memories.
76
+
77
+ The receipt freezes full inventory coverage, capability positions/classes, prior-only
78
+ placement labels, learned threshold probabilities, widening, cross-reader disagreements,
79
+ and stage-2 forecasts/selection. Stage 2 records same-cell retry cost, accepted-result
80
+ silent-risk bounds, calibrated uncertainty and exploration status. One later observation
81
+ uses this original receipt to update both readers. See [capability filtering](capability.md)
82
+ and [upgrading to 3.0](upgrading-3.0.md).
@@ -3,6 +3,9 @@
3
3
  - [Quickstart](quickstart.md) — install, choose, record an outcome and learn, with no setup.
4
4
  - [Model and storage contracts](reference.md) — LLM forecasts, cost/risk selection, strict rows,
5
5
  reproducibility and storage.
6
+ - [Task-specific capability filtering](capability.md) — learned fit bands, threshold evidence,
7
+ bounded fine forecasts, widening and filter-quality reports.
8
+ - [Upgrading to 3.0](upgrading-3.0.md) — two-stage requests and accepted-result selection.
6
9
  - [Concurrent clients](concurrency.md) — backend-owned FIFO write admission, bounded waits,
7
10
  cancellation, queue status and safe retries across worktrees.
8
11
  - [Task text and changing project context](context.md) — original task/project text, immutable
@@ -32,6 +35,8 @@
32
35
 
33
36
  quickstart
34
37
  reference
38
+ capability
39
+ upgrading-3.0
35
40
  concurrency
36
41
  context
37
42
  semantic-memory
@@ -10,12 +10,12 @@ Run these commands from the project where you want to use howhard:
10
10
  ```sh
11
11
  python3 -m venv .venv-howhard
12
12
  . .venv-howhard/bin/activate
13
- python -m pip install "howhard==2.1.0"
13
+ python -m pip install "howhard @ git+https://github.com/xu-hao/howhard.git@v3.0.0"
14
14
  howhard --version
15
15
  ```
16
16
 
17
- Expect `howhard 2.1.0`. The Python package is available on
18
- [PyPI](https://pypi.org/project/howhard/2.1.0/).
17
+ Expect `howhard 3.0.0`. This installs the tagged source release. Earlier PyPI distributions use the older
18
+ protocol; installing 3.0 does not require a PyPI publication.
19
19
 
20
20
  Keep this environment active and start your coding agent from the same shell so it
21
21
  can find `howhard`. If an existing GUI session cannot find it, configure the absolute
@@ -72,9 +72,11 @@ run it automatically. For persistent use, copy the
72
72
  {ref}`coordinating-agent instruction <require-howhard-before-delegation>` into
73
73
  your host's project instructions.
74
74
 
75
- The agent discovers the host's supported model and effort controls, obtains a baseline
76
- forecast in a fresh context without memory or history, and considers retrieved
77
- experience before selecting a worker. It creates temporary protocol inputs and calls
75
+ The agent discovers the full host inventory, obtains a task-specific capability prior
76
+ in a fresh context, and learns a fit band from related executions. It obtains fine
77
+ forecasts only for that band in another independent context and consults retrieved
78
+ experience before selecting a worker. Explicit re-filter/widening requests preserve
79
+ the inventory; no cells are silently dropped. It creates temporary protocol inputs and calls
78
80
  the backend directly. You do not need to configure model-family mappings or tune
79
81
  parameters. If an independent forecast or required execution control is unavailable,
80
82
  the agent reports the limitation instead of inventing a selection.
@@ -5,18 +5,21 @@ contract](semantic-memory.md) for retrieval, isolated forecasts and predictive w
5
5
  The [retrieval stages](retrieval.md) select execution precedents and written lessons
6
6
  before support is normalized over participating forecasts. Observed runs retain their
7
7
  joint model/effort, outcome and measured usage; no unrun action is labeled retrospectively.
8
- There is no fitted outcome regression, token/time regression, lexical predictor,
9
- statistical safety floor or generic prior transfer.
8
+ The [coarse reader](capability.md) learns a task-specific capability threshold from the
9
+ same observed runs. Fine forecasts retain their independent LLM and memory protocol;
10
+ there is no token/time regression, lexical outcome predictor or statistical risk floor.
10
11
 
12
+ (accepted-result-selection)=
11
13
  ## Selection
12
14
 
13
15
  For each supplied native model and effort/control cell, minimize
14
16
 
15
17
  ```text
16
- J = C_run + P_loud * C_loud + P_silent * C_silent + lambda_per_hour * T
18
+ J = (C_run + lambda_per_hour * T + C_loud * P_loud + C_silent * P_silent)
19
+ / max(probability_floor, 1 - P_loud)
17
20
  ```
18
21
 
19
- The caller supplies 1–32 distinct actual cells through `--candidates FILE` or Python
22
+ The caller supplies any nonempty number of distinct actual cells through `--candidates FILE` or Python
20
23
  `native_candidates`. External routers can explicitly select a saved list from
21
24
  `howhard.toml` with `--inventory NAME` or Python `inventory="NAME"` instead. Neither
22
25
  option is implicit, and the two sources cannot be combined. An empty list is refused. Each has `model`,
@@ -28,7 +31,8 @@ opaque family labels for protocol bookkeeping, without model assumptions or effe
28
31
  Configured identities retain their declared labels and evidence weights. Historical
29
32
  identity metadata does not activate candidates in a later request.
30
33
 
31
- An independent stateless LLM forecasts every cell using the task and project alone.
34
+ A [task-specific capability filter](capability.md) first reads the full inventory.
35
+ An independent stateless LLM then forecasts only the fit band using the task and project alone.
32
36
  The reader supplies conditional overrides for memories it has seen; omitted cells and
33
37
  unretrieved memories use the independent LLM forecast. No learned probability table
34
38
  or synthetic forecast is supplied to either call. Provider absence, invalid forecasts
@@ -37,29 +41,46 @@ and provider failures are explicit errors; none produces a routing recommendatio
37
41
  Probability means are weighted by predictive expert support. Lower/upper bounds use
38
42
  the weighted 2.5%/97.5% forecast quantiles expanded to include the mean. This is a
39
43
  heuristic forecast envelope, not a Bayesian credible interval or calibrated guarantee.
40
- Admissibility compares the silent-failure upper envelope to the risk class epsilon.
44
+ Admissibility compares the accepted-result defect envelope to the risk class epsilon.
45
+ For each expert, transform its joint row to `P_silent / max(probability_floor, 1-P_loud)`
46
+ before taking envelope quantiles, then include the ratio of weighted means. This retains
47
+ the expert's loud/silent relationship instead of dividing unrelated marginal bounds.
41
48
  There is no additional statistical risk floor.
42
49
 
43
- `pick` samples one expert by its weight, samples outcome probabilities around that
44
- expert's forecast using the packaged Dirichlet concentration, and chooses the admissible
45
- cell with the smallest sampled cost. Tokens and time come directly from the forecast.
50
+ `pick` samples one expert by its weight and draws outcome probabilities using an
51
+ evidence-calibrated Dirichlet. The concentration uses the maximum of between-expert
52
+ variance, squared envelope width divided by `3.92²`, and
53
+ `p*(1-p)/(prior_strength + expert_evidence_count + 1)`. Moment-matching gives
54
+ `p*(1-p)/variance - 1`; take the most conservative outcome and apply configured bounds.
55
+ Agreeing, well-observed experts tighten; weak priors and disagreement stay wider.
56
+ Selection admits exploration only inside both the mean-J fraction and a delta-method
57
+ cost-uncertainty band. Receipts retain concentrations, evidence counts, variance sources,
58
+ the seed and the reason for a sampled non-best choice. Tokens and time come directly from the forecast.
46
59
  `summary` returns the same means and envelope without sampling a selection. A fixed
47
60
  seed reproduces selection given frozen forecasts; it does not make inference deterministic.
48
61
 
49
- When no cell meets the cap, `flag-review` selects by sampled cost and requires review;
50
- `lowest-bound` selects the lowest silent upper envelope. `explore_within`, if supplied,
51
- limits eligible cells by expected total cost. Cheaper alternatives include signed cost
62
+ Loud attempts are retried on the same cell until a non-loud result is accepted.
63
+ `1/(1-P_loud)` charges the expected attempts; `C_loud` is extra detection/rework overhead
64
+ per loud failure, in addition to the repeated time/money. The probability floor keeps
65
+ a near-certain loud failure finite but very costly. Retry-on-another-cell is not assumed.
66
+
67
+ If the cap is unmet after stronger-only capability widening, no expert or probability
68
+ sample is drawn. `flag-review` chooses the minimum mean J; `lowest-bound` chooses the
69
+ lowest accepted-result silent upper envelope, with mean J breaking ties. Both require
70
+ review. `exploration.reason` records `disabled-cap-unmet`. Risk-class `explore_within`
71
+ can further tighten the default sampling band; it cannot permit exploration outside
72
+ the uncertainty-supported band. Cheaper alternatives include signed cost
52
73
  component explanations or the policy that excluded them.
53
74
 
54
75
  ## Prices and measurements
55
76
 
56
- Prices belong to the host inventory. If any candidate is unpriced, worker money is
77
+ Prices belong to the host inventory. If any forecasted band/widened candidate is unpriced, worker money is
57
78
  omitted uniformly from every candidate's objective. Known `C_run` remains visible;
58
79
  unknown values stay null, and `cost_policy` labels the partial risk/time comparison.
59
80
  Fully priced inventories with a uniform money basis use the full objective. Never substitute provider API prices
60
81
  for unknown host charges. Tokens include cached/uncached input and output; T is hours.
61
82
  Actual `tokens`, `seconds` and `cost_usd` remain null unless measured. Observations
62
- update memory predictive evidence, not a separate fitted statistical model.
83
+ update both the threshold reader and shared predictive evidence from one stored row.
63
84
 
64
85
  (portable-execution-accounting)=
65
86
  ## Portable execution accounting
@@ -234,8 +255,8 @@ or memory writes. All receipts require that identity and their native inventory/
234
255
  policy. The resolved state subtree is excluded from capture and
235
256
  `project.read`, including symlink aliases; a state root equal to or containing the capture
236
257
  root is refused. Prepared calling-agent requests bind the worktree and reject sibling
237
- retrieve/decide. Requests use `howhard-agent-request-v4` and receipts use
238
- `howhard-decision-v5`, with required LLM forecasts.
258
+ retrieve/decide. Requests use `howhard-agent-request-v5` and receipts use
259
+ `howhard-decision-v6`, with required capability and accepted-result selection state.
239
260
  Earlier formats are refused; prepare a fresh request and decision.
240
261
  Frozen-receipt observations and learning share the store across that project's worktrees.
241
262
 
@@ -247,8 +268,8 @@ current worktree, native inventory, effective evidence and memory revision; stal
247
268
  must be prepared again. Calling-agent submissions are audited with unknown external
248
269
  inference costs and latency rather than being counted as free provider calls.
249
270
 
250
- Receipts use `howhard-decision-v5`, requests `howhard-agent-request-v4`, semantic state
251
- `howhard-semantic-v3`. Older receipts and requests are refused for execution/feedback;
271
+ Receipts use `howhard-decision-v6`, requests `howhard-agent-request-v5`, semantic state
272
+ `howhard-semantic-v4`. Older receipts and requests are refused for execution/feedback;
252
273
  old receipt forecasts are excluded from replay/report scoring. Existing raw observations
253
274
  and semantic memories remain stored. Old posterior/prior artifacts are unused and left
254
275
  untouched. Removed interfaces include `--llm`, `HOWHARD_LLM`, `--cache`, `Engine(cache_path=...)`,
@@ -8,7 +8,8 @@ major for incompatible public interfaces. While below 1.0, document any incompat
8
8
  change explicitly. Receipt and request format versions are separate compatibility contracts.
9
9
  Keep the version fields in the portable, Claude Code and Antigravity plugin manifests
10
10
  in sync with that Python version; distribution validation checks them in the source archive.
11
- The [2.0 upgrade guide](upgrading-2.0.md) records the current compatibility boundary;
11
+ The [3.0 upgrade guide](upgrading-3.0.md) records the current protocol/selection boundary;
12
+ the [2.0 guide](upgrading-2.0.md) retains the earlier accounting transition, and
12
13
  the published 0.6.1 maintenance release has its own retained changelog section.
13
14
 
14
15
  Before release: