Skip to content

feat(agent_runtime): paired capability/efficiency gates for harness changes - #302

Draft
raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/harness-paired-gates
Draft

raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/harness-paired-gates

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Summary

Mechanism ports are justified by the claim "same work, fewer tokens", and a token saving can always be faked by doing less work. This adds the acceptance rule those claims are judged by — as typed, inspectable objects rather than prompt text, so prompt drift cannot loosen a gate:

  • capability gate — every capability metric stays within a predeclared tolerance (savings that come from getting less done do not count);
  • efficiency gate — at least one efficiency metric must improve;
  • identity check — a (base, candidate) pair is only a pair when provider, model and effort match; a mismatch refuses the comparison instead of averaging it away;
  • fail closed — an unknown capability score is a rejection, not a pass;
  • activation — a mechanism that never fired cannot claim a gain.

HarnessRecord / GateDecision are frozen dataclasses; HarnessLedger is append-only JSONL (fsync per append) and replays in order, raising on a corrupt line rather than silently truncating history.

Status: no runtime consumer yet

Split out of #300, which bundled this framework with the post-compaction fog observation (#301). The fog half has a real call site; this half does not — it is the gate layer the mechanism PRs are meant to cite, deliberately not wired into the runner.

Opening it as a draft for that reason. If you would rather not carry an unconsumed module, close this and I will re-open it together with the first mechanism that uses it; the branch stays available either way.

Tests

  • pytest tests/test_harness_metrics.py → 29 passed (gate accept/reject, tolerance, efficiency, identity mismatch, fail-closed, pairing rules, record round-trip, ledger replay/quarantine/pair-up/summary).
  • ruff check + ruff format clean; pre-commit hooks pass.

…hanges

Mechanism ports are justified by the claim "same work, fewer tokens", and a
token saving can always be faked by doing less work. This adds the acceptance
rule those claims are judged by, as a typed, inspectable object rather than
prompt text:

* capability gate — every capability metric stays within a predeclared
  tolerance, so savings that come from getting less done do not count;
* efficiency gate — at least one efficiency metric must improve;
* identity check — a (base, candidate) pair is only a pair when provider,
  model and effort match, otherwise the comparison is refused instead of
  averaged away;
* fail closed — an unknown capability score is a rejection;
* activation — a mechanism that never fired cannot claim a gain.

Records and verdicts are frozen dataclasses; the ledger is append-only JSONL
(fsync per append) and replays in order, raising on a corrupt line rather
than silently truncating history.

Split out of HKUDS#300, which bundled this framework with the post-compaction fog
observation. This module has no runtime consumer yet: it is the gate layer
the mechanism PRs are meant to cite, and it is deliberately not wired into
the runner.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant