Repository navigation
feat(agent_runtime): paired capability/efficiency gates for harness changes - #302
Draft
raymondginger2018-sudo wants to merge 1 commit into
Draft
raymondginger2018-sudo wants to merge 1 commit into
raymondginger2018-sudo wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
(base, candidate)pair is only a pair when provider, model and effort match; a mismatch refuses the comparison instead of averaging it away;HarnessRecord/GateDecisionare frozen dataclasses;HarnessLedgeris 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 formatclean; pre-commit hooks pass.