Skip to content

core: preserve pinned deployer policy through final execution - #158

Open
gngsn wants to merge 2 commits into
google-research:mainfrom
gngsn:feat/pinned-policy-staging
Open

gngsn wants to merge 2 commits into
google-research:mainfrom
gngsn:feat/pinned-policy-staging

Conversation

@gngsn

@gngsn gngsn commented Oct 29, 2026

Copy link
Copy Markdown

A deployer can now set BenchSpec.pinned_policy to keep fixed policy text outside the editable harness tree and deliver it to both base and candidate runs. Propose–Probe–Compose can edit the surrounding harness without trimming or deleting the policy.

Addresses #94, following the staging approach discussed in #94 (comment).

Implementation

  • Carry policy separately in trusted Install metadata. Inject it after template rendering or workspace installation, then verify the final execution input before launching the model. This preserves literal Jinja/template syntax and HTML comments that renderers would otherwise interpret or remove.
  • Cover JobBench, LAB, and WorkBuddy on both OpenCode and Codex. Preserve the existing base rendering and component selection, including any task-image AGENTS.md in WorkBuddy Codex base runs.
  • Account for policy in proposal validation, automatic skill triggers, direct materialisation, and final input size limits. Enforce Codex's UTF-8 byte limit before execution.
  • Include policy identity in execution markers and whole-task summaries. Adding, changing, or removing policy invalidates cached results; summaries from different policies cannot merge mode results. Empty policy preserves existing execution fingerprints and legacy summary resume behavior.
  • Install the shared standard-library policy runtime with the LAB/WorkBuddy overlays and reject configured-policy launches with outdated runners. Document the API, delivery contract, and limits in docs/PINNED_POLICY.md; update runner provenance checksums.

Validation

  • python3 -m unittest discover -s tests: 28 tests pass.
  • ruff check harness2 tests and ruff format --check harness2 tests: pass.
  • Python compilation, bash -n for the JobBench Codex runner, and git diff --check: pass.
  • python3 scripts/check_provenance.py: all 47 asset checksums pass.

Regression coverage includes literal policy preservation after rendering, final-file tampering blocking launch, base/candidate delivery, character and byte limits, policy-change/removal invalidation, summary isolation, and stale runner rejection. WorkBuddy Codex installation commands are exercised locally with process/model interfaces stubbed. No model-backed benchmark or Docker end-to-end run was performed.

This guarantees policy text preservation and delivery before launch, not model compliance or enforcement against hooks/plugins during execution. Policy is configured through the Python adapter API; no new CLI flag is introduced.

gngsn added 2 commits October 27, 2026 06:26
Add BenchSpec.pinned_policy. The policy is injected at the head of the staged
always-on file at materialise time and read back by hash before the run, so
Propose-Probe-Compose cannot trim or delete it. It is mixed into the run
fingerprint, charged to the always-on cap, and a no-op when unset. LAB and
WorkBuddy base runs refuse to run with a policy until they can inject it.
@google-cla

google-cla Bot commented Oct 29, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gngsn
gngsn force-pushed the feat/pinned-policy-staging branch from 01d322e to 28889c6 Compare October 29, 2026 14:28
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