Skip to content

Commit 9d94310

Browse files
authored
feat(benchmarks): add selected-task workflow (#572)
1 parent 36e2909 commit 9d94310

9 files changed

Lines changed: 750 additions & 16 deletions

File tree

.agents/skills/harbor-benchmarks/SKILL.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,26 @@ Use the pinned Harbor runner from the repository:
111111
```sh
112112
uvx --from harbor==0.20.0 harbor --version
113113
make harbor-plan BASE=origin/main
114-
make harbor-sync
115-
make harbor-check-task DATASET=mathematical-benchmarks-v1 TASKS="task-id"
116-
make harbor-oracle-task DATASET=mathematical-benchmarks-v1 TASKS="task-id"
114+
make harbor-prepare-task DATASET=mathematical-benchmarks-v1 TASKS="task-id"
115+
make harbor-validate-task DATASET=mathematical-benchmarks-v1 TASKS="task-id"
117116
```
118117

119-
The selected-task commands are the normal leaf-task gates and require an
120-
explicit task selection. Use the full `make harbor-check` and explicitly
118+
`harbor-prepare-task` is the explicitly mutating authoring step. It formats only
119+
the selected task Python and dedicated validation leaf, performs scoped public
120+
contract and verifier checksum synchronization, and reports exactly which
121+
generated files changed. `harbor-validate-task` is the complete source-read-only
122+
leaf gate: it resolves membership and planner-owned host selectors once, runs
123+
static quality before contracts, executes the selected leaf and generic tests
124+
with an isolated worktree-local pytest directory, then runs exact task Oracles
125+
serially and reports timings, digests, and evidence paths.
126+
127+
Both commands require an explicit task selection. The lower-level
128+
`harbor-sync`, `harbor-check-task`, and `harbor-oracle-task` targets remain
129+
available for a narrow edit loop. Use the full `make harbor-check` and explicitly
121130
scoped `make harbor-oracle` paths for shared tooling, schemas, registry, suite
122-
policy, or other control-plane changes. A full dataset Oracle requires
123-
`FULL=1`; ordinary Oracle runs require `TASKS` and never expand an omitted
124-
selection implicitly.
131+
policy, or other control-plane changes. A full dataset Oracle requires `FULL=1`;
132+
ordinary Oracle runs require `TASKS` and never expand an omitted selection
133+
implicitly.
125134

126135
After any input, instruction, metadata, verifier, dependency, image, or task
127136
contract change:
@@ -157,9 +166,11 @@ formatting applies to the entire `benchmarks/` tree, including task verifier
157166
code under `benchmarks/datasets/<dataset>/<task-id>/tests/verifier.py`.
158167

159168
After any verifier Python (`tests/verifier.py`) or Dockerfile change, run
160-
`make harbor-sync` to update the verifier checksum label embedded in each
161-
task's `tests/Dockerfile`. The `harbor-contracts` gate rejects stale checksum
162-
labels; `harbor-sync` recomputes them from the current verifier source.
169+
`make harbor-prepare-task DATASET=... TASKS="..."` to update the verifier
170+
checksum label embedded in each task's `tests/Dockerfile`. The
171+
`harbor-contracts` gate rejects stale checksum labels; the preparation command
172+
uses the scoped `harbor-sync` operations to recompute them from current verifier
173+
source.
163174

164175
### Validation regression layout
165176

.agents/skills/verifier-evaluations/SKILL.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ the Harbor skill owns dataset layout and repository commands.
2323
solution, hidden verifier logic, private authorization records, or Oracle
2424
fixtures merely to explain the format.
2525

26+
Use `tests/verifier_contract.json` as the sole task-local declaration of
27+
behavior consumed by generic verifier tests. Keep it versioned and validate
28+
it against a closed schema: boolean fields must be exact JSON booleans,
29+
unknown keys and unsupported versions fail closed, and missing metadata must
30+
not silently opt a task into exceptional behavior. Do not add parallel
31+
metadata files, fields on unrelated public-contract models, or global
32+
task-name registries for input-binding, scope, assurance, or diagnostic
33+
exceptions.
34+
2635
2. Trace every acceptance path:
2736

2837
`input file → envelope → typed structure → semantic claim → evidence/scope → metrics → reward`
@@ -63,6 +72,15 @@ the Harbor skill owns dataset layout and repository commands.
6372
documented in the visible contract, reject unrelated text, and accept
6473
mathematically equivalent phrasing.
6574

75+
Minimize the semantic obligations before implementing prose checks. Require
76+
only logically independent facts that the evidence must contribute. If the
77+
typed certificate plus one checked fact already entails a conclusion, do
78+
not also require a rhetorical sentence restating that conclusion. For
79+
example, a verifier that proves the submitted corrected condition fails
80+
must not additionally require the solver to say “therefore this does not
81+
refute the repair.” Keep such implications in verifier-owned mathematics,
82+
not in preferred wording.
83+
6684
For streamed prose verifiers, preserve the local relationship between the
6785
claim, its scope, and any negation; independent lexical matches are not a
6886
sufficient semantic parser. Add regressions for scope-before-claim and
@@ -86,6 +104,13 @@ the Harbor skill owns dataset layout and repository commands.
86104
verifier still emits `reward.json` without crashing. Include a large valid
87105
evidence artifact to prove that no undocumented byte cap is present.
88106

107+
Include at least one terse numeric or structural explanation fixture built
108+
independently from the public contract. It must express the required facts
109+
without reusing the canonical answer's labels, rhetorical conclusions, or
110+
sentence fragments. Do not inspect hidden solution text solely to construct
111+
this fixture; the point is to prove semantic acceptance rather than encode a
112+
second preferred answer.
113+
89114
7. Validate the final tree and handoff. Run focused tests, deliberate negative
90115
cases, the selected Oracle, and the repository's planned gate. If shared
91116
verifier support changes, migrate only deliberately selected task-local
@@ -97,6 +122,15 @@ the Harbor skill owns dataset layout and repository commands.
97122
it matches `sha256sum` of the final `verifier.py`; a stale label fails
98123
`validate_task_topology` and blocks the task.
99124

125+
If an Oracle run earns full mathematical correctness but zero evidence
126+
validity, diagnose the prose recognizer without reading or copying hidden
127+
answer text. Instrument or invoke the matcher to report only a boolean map
128+
of documented semantic clauses and contradiction checks. Do not print,
129+
tokenize, quote, or mine n-grams from the Oracle artifact. Repair the public
130+
semantic rule, write a fresh regression from the visible contract, and then
131+
rerun every check invalidated by the verifier change, including the exact
132+
Oracle.
133+
100134
Read [references/verifier-contract.md](references/verifier-contract.md) for the
101135
detailed checklist and anti-pattern catalogue.
102136

.github/scripts/plan-benchmarks

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ BENCHMARK_CONTROL_PATHS = frozenset(
6464
"tools/check_benchmark_contracts.py",
6565
"tools/check_benchmark_static.py",
6666
"tools/check_harbor_dataset.py",
67+
"tools/harbor_task_workflow.py",
6768
"tools/sync_harbor_verifier_support.py",
6869
}
6970
)

CONTRIBUTING.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ capability membership.
2121
| Documentation, benchmark README, or `benchmarks/validation/` | `make docs-linkcheck` | None |
2222
| Focused Python behavior | `make test-plan BASE=<revision>`, the selected lane, then `make check` | None |
2323
| Harbor job JSON, MCP config, job-level Compose overlay, or execution helper | `make harbor-execution-check` | None |
24-
| Benchmark task input or verifier | `make harbor-check-task DATASET=... TASKS=...`, then `make harbor-oracle-task DATASET=... TASKS=...` | Exact selected-task Oracle |
24+
| Benchmark task input or verifier | `make harbor-prepare-task DATASET=... TASKS="..."`, then `make harbor-validate-task DATASET=... TASKS="..."` | Exact selected-task Oracle |
2525
| Deployment entrypoint | `make deploy-check` | None |
2626
| CI, dependencies, or unknown paths | `make check-static` plus affected tests | As required by the selected plan |
2727

@@ -77,6 +77,18 @@ modules for focused changes, the changed validation file itself, and the full
7777
`benchmarks/validation` suite, sharded in hosted CI, for shared or unclassified
7878
infrastructure. To reproduce one selected host check locally, run
7979
`make harbor-validation-tests TESTS=<pytest-file-or-directory>`.
80+
81+
For task authoring, `make harbor-prepare-task DATASET=... TASKS="..."` is the
82+
explicitly mutating preparation step. It formats only Python owned by the
83+
selected task and its dedicated validation leaf, runs scoped public-contract
84+
and verifier-checksum synchronization, and reports every generated file that
85+
changed. Follow it with `make harbor-validate-task DATASET=... TASKS="..."` for
86+
the complete source-read-only leaf gate. That command resolves membership and
87+
planner selectors once, fails fast through static quality and contracts, runs
88+
the selected host tests serially in a worktree-local temporary pytest directory,
89+
then runs each exact Oracle serially. Its summary includes per-stage timings and
90+
the resulting task digest and Oracle evidence path.
91+
8092
Tests can be narrowed without learning another wrapper:
8193

8294
```sh
@@ -151,7 +163,7 @@ aid; `make check` and CI remain the handoff gates.
151163
| --- | --- | --- |
152164
| Docs only | `make docs-linkcheck` | Documentation |
153165
| Focused Python | affected target, then `make check` | Planned Python/static/package lanes |
154-
| Benchmark task or verifier | `make harbor-check-task DATASET=... TASKS=...` and `make harbor-oracle-task DATASET=... TASKS=...` | Exact task contract and Oracle |
166+
| Benchmark task or verifier | `make harbor-prepare-task DATASET=... TASKS="..."`, then `make harbor-validate-task DATASET=... TASKS="..."` | Exact task contract, planner-selected host tests, and Oracle |
155167
| Benchmark README or validation regression | focused Harbor checks | Contract checks; no Oracle |
156168
| Lean runtime | focused `make test-lean`, then `make check` | Lean plus affected lanes |
157169
| CI, dependencies, or unknown paths | `make check-static` plus affected tests | Fail-closed functional lanes |

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ORDERING_DEFAULT_SEED := --randomly-seed=17
1515
PYTEST_DIAGNOSTIC_ARGS ?= --durations=10
1616
RUFF_PATHS := src tests benchmarks
1717
TOPOLOGY_RUNNER := $(UV_RUN) python tools/test_topology.py
18-
PUBLIC_COMMANDS := help setup check check-changed ci-plan test-plan test-changed test-unit test-component test-domain test-composition test-storage test-process test-mcp test-provider test-lean test-e2e docs-command-check docs-linkcheck harbor-plan harbor-execution-check harbor-check-task harbor-oracle-task npm-test test-all-ci check-static deploy-check
18+
PUBLIC_COMMANDS := help setup check check-changed ci-plan test-plan test-changed test-unit test-component test-domain test-composition test-storage test-process test-mcp test-provider test-lean test-e2e docs-command-check docs-linkcheck harbor-plan harbor-prepare-task harbor-validate-task harbor-execution-check harbor-check-task harbor-oracle-task npm-test test-all-ci check-static deploy-check
1919

2020
ifneq ($(strip $(PATHS)),)
2121
PATHS_FILE := $(shell mktemp)
@@ -26,7 +26,7 @@ endif
2626
# in pyproject.toml: direct pytest invocations must not silently inherit a
2727
# signal-based deadline that cannot interrupt a native solver. Process and
2828
# provider lanes run risky work in killable children and set their own deadline.
29-
.PHONY: help help-all uv-version-check setup setup-agent container-image eval-image eval-image-pull eval-image-bind hooks fix lint complexity-check lint-full security-audit typecheck test-architecture architecture ci-plan test-plan test-changed check-changed test-unit test-component test-domain test-composition test-storage test-process test-mcp test-provider test-lean test-e2e test-affected test-all-ci test-compatibility test-stress test-ordering duplicate-code npm-test todo-check coverage build check precommit check-static harbor-plan harbor-sync harbor-contracts harbor-execution-check harbor-adapter-checks harbor-validation-tests harbor-validate harbor-check harbor-check-task benchmark-inventory benchmark-snapshot benchmark-snapshot-validate benchmark-publish harbor-oracle harbor-oracle-task harbor-oracle-run harbor-oracle-all harbor-adapter-check heldout-validate heldout-render heldout-smoke agent-eval agent-eval-validate agent-eval-compare codex-visibility provider-eval clean docs-command-check docs-linkcheck deploy-check
29+
.PHONY: help help-all uv-version-check setup setup-agent container-image eval-image eval-image-pull eval-image-bind hooks fix lint complexity-check lint-full security-audit typecheck test-architecture architecture ci-plan test-plan test-changed check-changed test-unit test-component test-domain test-composition test-storage test-process test-mcp test-provider test-lean test-e2e test-affected test-all-ci test-compatibility test-stress test-ordering duplicate-code npm-test todo-check coverage build check precommit check-static harbor-plan harbor-prepare-task harbor-validate-task harbor-sync harbor-contracts harbor-execution-check harbor-adapter-checks harbor-validation-tests harbor-validate harbor-check harbor-check-task benchmark-inventory benchmark-snapshot benchmark-snapshot-validate benchmark-publish harbor-oracle harbor-oracle-task harbor-oracle-run harbor-oracle-all harbor-adapter-check heldout-validate heldout-render heldout-smoke agent-eval agent-eval-validate agent-eval-compare codex-visibility provider-eval clean docs-command-check docs-linkcheck deploy-check
3030

3131
help: ## Show available developer commands.
3232
@awk -v public="$(PUBLIC_COMMANDS)" 'BEGIN {FS = ":.*## "; n = split(public, names, " "); for (i = 1; i <= n; i++) wanted[names[i]] = 1; printf "Jacobian common developer commands:\n\n"} /^[a-zA-Z_-]+:.*## / && ($$1 in wanted) {printf " %-18s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@@ -303,6 +303,18 @@ harbor-plan: ## Print the independent Harbor benchmark plan (BASE=... optional).
303303
echo "Plan receipt:"; \
304304
cat "$$tmp_dir/receipt.json"
305305

306+
harbor-prepare-task: ## Format and sync selected Harbor tasks (DATASET=..., TASKS="...").
307+
@test -n "$(DATASET)" || { echo "DATASET is required" >&2; exit 2; }
308+
@test -n "$(TASKS)" || { echo "TASKS is required; refusing an unscoped preparation" >&2; exit 2; }
309+
$(HARBOR_PYTHON) tools/harbor_task_workflow.py prepare \
310+
--dataset "$(DATASET)" --tasks $(TASKS)
311+
312+
harbor-validate-task: ## Run the complete selected-task static, host, and Oracle gate.
313+
@test -n "$(DATASET)" || { echo "DATASET is required" >&2; exit 2; }
314+
@test -n "$(TASKS)" || { echo "TASKS is required; refusing an implicit full-dataset validation" >&2; exit 2; }
315+
$(HARBOR_PYTHON) tools/harbor_task_workflow.py validate \
316+
--dataset "$(DATASET)" --tasks $(TASKS)
317+
306318
harbor-sync: ## Update verifier checksum labels for selected tasks (DATASET=... TASKS="...").
307319
@test -n "$(DATASET)" || { echo "DATASET is required" >&2; exit 2; }
308320
@test -n "$(TASKS)" || { echo "TASKS is required; refusing an unscoped checksum update" >&2; exit 2; }

benchmarks/validation/test_benchmark_planner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_planner_digest_binds_to_planner_and_path_policy_sources() -> None:
129129
".github/scripts/validate-benchmark-plan",
130130
".github/workflows/benchmarks.yml",
131131
"Makefile",
132+
"tools/harbor_task_workflow.py",
132133
],
133134
)
134135
def test_benchmark_control_plane_changes_run_contract_checks(path: str) -> None:

0 commit comments

Comments
 (0)