howhard 2.2.0__tar.gz → 3.0.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 (102) hide show
  1. {howhard-2.2.0 → howhard-3.0.1}/.antigravity-plugin/plugin.json +1 -1
  2. {howhard-2.2.0 → howhard-3.0.1}/.claude-plugin/plugin.json +1 -1
  3. {howhard-2.2.0 → howhard-3.0.1}/CHANGELOG.md +34 -0
  4. {howhard-2.2.0/src/howhard.egg-info → howhard-3.0.1}/PKG-INFO +9 -9
  5. {howhard-2.2.0 → howhard-3.0.1}/README.md +8 -8
  6. howhard-3.0.1/docs/capability.md +142 -0
  7. {howhard-2.2.0 → howhard-3.0.1}/docs/concurrency.md +49 -4
  8. {howhard-2.2.0 → howhard-3.0.1}/docs/configuration.md +48 -1
  9. {howhard-2.2.0 → howhard-3.0.1}/docs/context.md +26 -3
  10. {howhard-2.2.0 → howhard-3.0.1}/docs/index.md +7 -2
  11. {howhard-2.2.0 → howhard-3.0.1}/docs/quickstart.md +8 -6
  12. {howhard-2.2.0 → howhard-3.0.1}/docs/reference.md +44 -20
  13. {howhard-2.2.0 → howhard-3.0.1}/docs/releasing.md +2 -1
  14. {howhard-2.2.0 → howhard-3.0.1}/docs/semantic-memory.md +44 -13
  15. {howhard-2.2.0 → howhard-3.0.1}/docs/skills.md +4 -0
  16. howhard-3.0.1/docs/upgrading-3.0.md +29 -0
  17. {howhard-2.2.0 → howhard-3.0.1}/plugin.json +1 -1
  18. {howhard-2.2.0 → howhard-3.0.1}/scripts/verify-wheel.py +7 -0
  19. {howhard-2.2.0 → howhard-3.0.1}/skills/howhard/SKILL.md +25 -12
  20. {howhard-2.2.0 → howhard-3.0.1}/skills/howhard/references/workflow.md +37 -9
  21. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/__init__.py +3 -2
  22. howhard-3.0.1/src/howhard/capability.py +390 -0
  23. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/cli.py +6 -4
  24. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/config.py +7 -1
  25. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/context.py +1 -1
  26. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/data/semantic.toml +2 -3
  27. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/decisions.py +25 -10
  28. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/engine.py +206 -57
  29. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/llm.py +17 -0
  30. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/native.py +2 -2
  31. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/report.py +73 -1
  32. howhard-3.0.1/src/howhard/request_state.py +182 -0
  33. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/selector.py +28 -10
  34. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/semantic.py +100 -21
  35. howhard-3.0.1/src/howhard/success.py +156 -0
  36. {howhard-2.2.0 → howhard-3.0.1/src/howhard.egg-info}/PKG-INFO +9 -9
  37. {howhard-2.2.0 → howhard-3.0.1}/src/howhard.egg-info/SOURCES.txt +8 -0
  38. {howhard-2.2.0 → howhard-3.0.1}/tests/conftest.py +33 -0
  39. howhard-3.0.1/tests/test_capability_filter.py +341 -0
  40. {howhard-2.2.0 → howhard-3.0.1}/tests/test_configured_candidates.py +1 -1
  41. {howhard-2.2.0 → howhard-3.0.1}/tests/test_context.py +2 -1
  42. howhard-3.0.1/tests/test_cost_to_success.py +146 -0
  43. {howhard-2.2.0 → howhard-3.0.1}/tests/test_current_contract.py +2 -2
  44. {howhard-2.2.0 → howhard-3.0.1}/tests/test_execution_accounting.py +3 -0
  45. {howhard-2.2.0 → howhard-3.0.1}/tests/test_portable_core.py +3 -0
  46. howhard-3.0.1/tests/test_request_dependencies.py +387 -0
  47. {howhard-2.2.0 → howhard-3.0.1}/tests/test_retrieval.py +1 -1
  48. {howhard-2.2.0 → howhard-3.0.1}/tests/test_semantic.py +11 -5
  49. {howhard-2.2.0 → howhard-3.0.1}/tests/test_semantic_cli.py +13 -3
  50. {howhard-2.2.0 → howhard-3.0.1}/tests/test_semantic_only.py +7 -4
  51. {howhard-2.2.0 → howhard-3.0.1}/tests/test_write_queue.py +16 -8
  52. {howhard-2.2.0 → howhard-3.0.1}/.agents/plugins/marketplace.json +0 -0
  53. {howhard-2.2.0 → howhard-3.0.1}/.claude-plugin/marketplace.json +0 -0
  54. {howhard-2.2.0 → howhard-3.0.1}/.readthedocs.yaml +0 -0
  55. {howhard-2.2.0 → howhard-3.0.1}/AGENTS.md +0 -0
  56. {howhard-2.2.0 → howhard-3.0.1}/MANIFEST.in +0 -0
  57. {howhard-2.2.0 → howhard-3.0.1}/benchmarks/__init__.py +0 -0
  58. {howhard-2.2.0 → howhard-3.0.1}/benchmarks/bench_rule_retrieval.py +0 -0
  59. {howhard-2.2.0 → howhard-3.0.1}/benchmarks/rule_cases.json +0 -0
  60. {howhard-2.2.0 → howhard-3.0.1}/benchmarks/rule_retrieval.py +0 -0
  61. {howhard-2.2.0 → howhard-3.0.1}/docs/changelog.md +0 -0
  62. {howhard-2.2.0 → howhard-3.0.1}/docs/conf.py +0 -0
  63. {howhard-2.2.0 → howhard-3.0.1}/docs/contributing.md +0 -0
  64. {howhard-2.2.0 → howhard-3.0.1}/docs/evaluation.md +0 -0
  65. {howhard-2.2.0 → howhard-3.0.1}/docs/requirements.txt +0 -0
  66. {howhard-2.2.0 → howhard-3.0.1}/docs/retrieval.md +0 -0
  67. {howhard-2.2.0 → howhard-3.0.1}/docs/rule-benchmark.md +0 -0
  68. {howhard-2.2.0 → howhard-3.0.1}/docs/session_handoff_format.md +0 -0
  69. {howhard-2.2.0 → howhard-3.0.1}/docs/upgrading-1.0.md +0 -0
  70. {howhard-2.2.0 → howhard-3.0.1}/docs/upgrading-2.0.md +0 -0
  71. {howhard-2.2.0 → howhard-3.0.1}/pyproject.toml +0 -0
  72. {howhard-2.2.0 → howhard-3.0.1}/scripts/check +0 -0
  73. {howhard-2.2.0 → howhard-3.0.1}/scripts/check-plugins.py +0 -0
  74. {howhard-2.2.0 → howhard-3.0.1}/scripts/check-skills.py +0 -0
  75. {howhard-2.2.0 → howhard-3.0.1}/setup.cfg +0 -0
  76. {howhard-2.2.0 → howhard-3.0.1}/skills/attribute-failure/SKILL.md +0 -0
  77. {howhard-2.2.0 → howhard-3.0.1}/skills/howhard/references/accounting.md +0 -0
  78. {howhard-2.2.0 → howhard-3.0.1}/skills/howhard/references/hosts.md +0 -0
  79. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/__main__.py +0 -0
  80. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/accounting.py +0 -0
  81. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/data/context.toml +0 -0
  82. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/data/default_config.toml +0 -0
  83. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/files.py +0 -0
  84. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/memory.py +0 -0
  85. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/retrieval.py +0 -0
  86. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/state.py +0 -0
  87. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/storage.py +0 -0
  88. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/validation.py +0 -0
  89. {howhard-2.2.0 → howhard-3.0.1}/src/howhard/writes.py +0 -0
  90. {howhard-2.2.0 → howhard-3.0.1}/src/howhard.egg-info/dependency_links.txt +0 -0
  91. {howhard-2.2.0 → howhard-3.0.1}/src/howhard.egg-info/entry_points.txt +0 -0
  92. {howhard-2.2.0 → howhard-3.0.1}/src/howhard.egg-info/requires.txt +0 -0
  93. {howhard-2.2.0 → howhard-3.0.1}/src/howhard.egg-info/top_level.txt +0 -0
  94. {howhard-2.2.0 → howhard-3.0.1}/tests/test_cli.py +0 -0
  95. {howhard-2.2.0 → howhard-3.0.1}/tests/test_fast_reranking.py +0 -0
  96. {howhard-2.2.0 → howhard-3.0.1}/tests/test_measurement_corrections.py +0 -0
  97. {howhard-2.2.0 → howhard-3.0.1}/tests/test_memory.py +0 -0
  98. {howhard-2.2.0 → howhard-3.0.1}/tests/test_native_startup.py +0 -0
  99. {howhard-2.2.0 → howhard-3.0.1}/tests/test_retrieval_config.py +0 -0
  100. {howhard-2.2.0 → howhard-3.0.1}/tests/test_rule_benchmark.py +0 -0
  101. {howhard-2.2.0 → howhard-3.0.1}/tests/test_skill_workflow.py +0 -0
  102. {howhard-2.2.0 → howhard-3.0.1}/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.1",
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.1",
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,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.1 — 2026-11-10
4
+
5
+ - Keep concurrent routing requests valid across unrelated observations and memory
6
+ writes. Capture one consistent read snapshot, freeze belief/capability weights, and
7
+ validate only surfaced memory/evidence dependencies plus bound configuration (#69).
8
+ - Return typed `StaleRequest` conflicts with changed IDs/versions or evidence digests
9
+ and a refreshed request. Preserve dependency tracking through extra retrieval,
10
+ filtering, forecasting and widening; retain FIFO admission and strict writer revisions
11
+ (#69).
12
+ - Preserve the original dependency conflict if refresh or failure-audit admission times
13
+ out; return bounded recovery diagnostics without masking the changed inputs (#69).
14
+ - Record the snapshot policy and dependency manifest in new immutable receipts while
15
+ retaining existing v6 receipt and conservative legacy v5 request compatibility (#69).
16
+
17
+ ## 3.0.0 — 2026-11-09
18
+
19
+ - Accept any nonempty distinct candidate inventory and learn a task-specific capability
20
+ order and fit band from similarity-weighted actual execution outcomes. Share the
21
+ observation store and tempered expert-score replay with calibrated forecasts; expose
22
+ prior-only placements, threshold evidence and filter-quality diagnostics (#66).
23
+ - Add filter → forecast requests, a default 12-cell fine-forecast budget with one explicit
24
+ re-filter, and bounded stronger-only widening before cap-unmet fallback. Never truncate
25
+ inventories or fabricate forecasts/outcomes for excluded cells (#66).
26
+ - Minimize expected cost to an accepted result with same-cell retries after loud failure.
27
+ Apply epsilon to accepted-result silent defect risk, calibrate bounded sampling from
28
+ forecast spread and predictive evidence, and restrict exploration by mean cost and
29
+ supported uncertainty. Cap-unmet selection is deterministic and requires review (#67).
30
+ - Break the calling-agent/provider contract: decision v6 receipts include both readers
31
+ and frozen accepted-result selection, agent requests use v5, and semantic state uses v4.
32
+ Old receipts cannot supply new receipt-bound feedback or predictive scoring; raw
33
+ historical evidence remains intact. Update adapters and skills; reprepare pending
34
+ requests. C_loud and epsilon have new retry/accepted-result meanings. See the 3.0
35
+ upgrade guide (#66, #67).
36
+
3
37
  ## Unreleased
4
38
 
5
39
  ## 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.1
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.
@@ -18,7 +18,8 @@ number may restart after the queue empties; the random ticket suffix distinguish
18
18
  | --- | --- |
19
19
  | First use | Validate evidence, establish project/store identity; initialize memory schema when needed |
20
20
  | Native inventories | Validate and merge historical identity metadata |
21
- | `context` / `retrieve` | Publish the immutable request artifact after checking evidence and memory again |
21
+ | `context` | Capture one consistent store snapshot; publish the immutable request even if writers ran during retrieval |
22
+ | `retrieve` / stage transitions | Recheck surfaced dependencies before publishing the next immutable request |
22
23
  | `decide` / `pick` | Commit the receipt after checking its forecast inputs again; audit events have separate turns |
23
24
  | `observe` / amendments | Read current evidence, validate IDs, provenance and corrections, then append/fsync |
24
25
  | `usage attach` | Collect the owned source outside admission; validate and append the correction inside admission |
@@ -102,14 +103,58 @@ crash/flush recovery rules still apply. Queueing does not make a multi-file flus
102
103
 
103
104
  ## Revalidation and retries
104
105
 
106
+ ### Prepared request dependencies
107
+
108
+ Preparation briefly takes shared data locks to capture evidence, native identities and
109
+ one SQLite memory snapshot consistently. Retrieval, capability relevance scoring and
110
+ model inference then run against those captured values outside the read lock and FIFO
111
+ write turn. Writers may continue while preparation runs; their commits cannot cause
112
+ preparation itself to fail as stale. A dependency changed during preparation is checked
113
+ when the resulting request is used.
114
+
115
+ New v5 requests persist the read snapshot and a dependency manifest. It contains exact
116
+ content/active versions of surfaced memories, effective-row digests of surfaced evidence
117
+ (including execution experts and capability inputs), and the bound configuration digest.
118
+ Dependencies accumulate across filtering, extra retrieval, forecasting and widening.
119
+ Additional memory/evidence retrieval reads the original snapshot. It cannot silently
120
+ replace old content with a newer version. Edits to unsurfaced memories, new observations
121
+ and unrelated learning commits leave the request valid. Amendments or usage corrections
122
+ to a surfaced execution invalidate it when its effective contents change.
123
+
124
+ The weight policy is **snapshot**. Both readers use the captured belief/expert scores,
125
+ evidence counts and capability observation/recency weights throughout the workflow.
126
+ They do not replay concurrent outcomes into an in-flight forecast. The receipt's optional
127
+ `request_snapshot` records this policy, the dependency manifest, the captured evidence
128
+ hash and memory revision. These are decision-time provenance; the global revision is
129
+ not a freshness condition. Previously prepared v5 requests without this metadata retain
130
+ their conservative whole-store validation. Existing v6 receipts remain readable.
131
+
132
+ At load and after write admission, howhard checks the dependencies again before a new
133
+ stage or receipt is committed. A genuine conflict raises Python `StaleRequest`, exported
134
+ from `howhard`. Its `as_dict()` returns `code: "stale_request"`, the original request ID,
135
+ `changes` and `refreshed_request`. Memory changes name the ID, old/new versions and active
136
+ states; evidence/configuration changes report old/new digests. `decide` and `retrieve`
137
+ with `--json` return this object under `error` on stderr with exit status 2.
138
+
139
+ The refreshed request restarts filtering because a changed precedent can affect the
140
+ fit band as well as its forecasts. It preserves the original task/project snapshot and
141
+ explicit inventory, or refreshes a named configured inventory. No old response is applied
142
+ automatically. `baseline_unchanged` says whether the failed request's independent baseline
143
+ is identical to the returned one; only an identical baseline permits reusing that isolated
144
+ answer. Re-evaluate affected memory/evidence reasoning. Refresh is attempted once; if
145
+ admission or configuration prevents it, `refresh_error` explains the failure and the
146
+ original conflict remains visible. There is no unbounded retry or writer-window protocol.
147
+ If recording the failed-decision audit also fails admission, `audit_error` carries its
148
+ typed diagnostic without replacing the original `stale_request` or changed dependencies.
149
+
105
150
  For example, an observation and a memory update from two worktrees register in one
106
151
  store queue. The memory update waits its turn, then checks the expected revision
107
152
  against current memory. A stale revision still returns the existing actionable
108
153
  conflict; howhard never silently rebases a patch. Learning also checks the effective
109
154
  evidence event after admission. A prepared request remains bound to its worktree,
110
- actual candidate inventory, evidence and memory revision. Evidence or memory changes
111
- during forecasting, retrieval or a queue wait require a new request. Adding an unrelated
112
- historical model identity alone does not invalidate a disjoint inventory.
155
+ actual candidate inventory and surfaced dependencies. A changed dependency during
156
+ forecasting, retrieval or a queue wait returns the structured conflict described above.
157
+ Unrelated writes and historical identity additions do not invalidate a disjoint request.
113
158
 
114
159
  A timeout does not execute later in the background. Resubmit a normal call if needed;
115
160
  no manual queue cleanup is required. Reuse the same stable observation/attachment ID
@@ -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
@@ -38,7 +39,11 @@ howhard observe DECISION_ID clean --tokens 12000 --seconds 45
38
39
  Every pick saves a content-addressed receipt under `decisions/` in the backend state
39
40
  root reported by `howhard paths` (local `.howhard` for plain folders). Its ID is
40
41
  printed in text and JSON output. The receipt includes the chosen cell, task description,
41
- project snapshot, seed and risk class. A later observation resolves the receipt and
42
+ project snapshot, seed and risk class. New receipts also retain `request_snapshot`:
43
+ the snapshot weight policy and exact surfaced dependencies used by the staged request.
44
+ Unrelated concurrent writes leave those prospective inputs unchanged; a changed
45
+ dependency returns a [structured conflict and refresh](concurrency.md).
46
+ A later observation resolves the receipt and
42
47
  copies that original context into the append-only row. It does not rescan the newer
43
48
  project. `--save-decision PATH` copies the receipt for another process; the short observe
44
49
  form also accepts that file path. Explicit four-argument observe supports `--decision ID`
@@ -61,3 +66,21 @@ available and accepts `--text` or `--text-file`; without a receipt it captures c
61
66
  at observation time. Use a receipt when the task changed project state. A receipt can
62
67
  also be passed to `Engine.observe(..., decision=...)`. Amendments always retain the
63
68
  original run's text, project snapshot and usage measurements.
69
+
70
+
71
+ ## Two reader stages in a frozen request
72
+
73
+ `context` first returns a capability-filter baseline and memory request over the full
74
+ inventory. Its task-specific order is recomputed for each decision. Submitting the
75
+ filter to `decide` returns a new request ID for calibrated forecasts over the fit band.
76
+ Both stages keep the original task and project snapshot and independently reject stale
77
+ evidence or memory. Retrieval, one explicit re-filter, and each stronger-only widening
78
+ round also return bound request IDs. Follow the returned `stage` until a `decision_id`
79
+ is produced. Neither clean baseline includes earlier execution evidence or memories.
80
+
81
+ The receipt freezes full inventory coverage, capability positions/classes, prior-only
82
+ placement labels, learned threshold probabilities, widening, cross-reader disagreements,
83
+ and stage-2 forecasts/selection. Stage 2 records same-cell retry cost, accepted-result
84
+ silent-risk bounds, calibrated uncertainty and exploration status. One later observation
85
+ uses this original receipt to update both readers. See [capability filtering](capability.md)
86
+ and [upgrading to 3.0](upgrading-3.0.md).
@@ -3,8 +3,11 @@
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
- - [Concurrent clients](concurrency.md) — backend-owned FIFO write admission, bounded waits,
7
- cancellation, queue status and safe retries across worktrees.
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.
9
+ - [Concurrent clients](concurrency.md) — backend-owned FIFO admission, snapshot/dependency
10
+ validity, structured refresh conflicts, bounded waits and safe retries across worktrees.
8
11
  - [Task text and changing project context](context.md) — original task/project text, immutable
9
12
  snapshots and decision receipts.
10
13
  - [LLM reasoning and writable semantic memory](semantic-memory.md) — reader/writer
@@ -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.