compound-engineering-plugin icon indicating copy to clipboard operation
compound-engineering-plugin copied to clipboard

Host attestation treats omp's CLAUDECODE=1 as Claude serving family; can falsely verify cross-model independence

Open taonos opened this issue 2 months ago • 1 comments

Summary

oh-my-pi (omp) sets CLAUDECODE=1 in its standard shell environment regardless of which model is serving the session. CE's host-attestation snippet treats that marker as evidence of both the harness (claude) and the serving family (claude). In an omp session served by a non-Claude model (for example after a /model switch to a GPT model, or a configured fallback to one), the snippet reports the wrong host family. If that family is passed to the cross-model workers, a same-family peer can be recorded as independence_verified: true.

This is traced from source. I have not run a full review that produced a false receipt; the end-to-end consequences below are the predicted result.

Environment

  • compound-engineering v3.30.3; same code on main at 9af474a70e
  • oh-my-pi 18.4.12 (CE publishes an omp plugin under .omp-plugin/)

The marker

omp's standard shell configuration sets OMPCODE=1 and CLAUDECODE=1 without inspecting the serving model (@oh-my-pi/pi-utils/src/procmgr.ts, buildSpawnEnv; added in omp commit f3a36eb). omp sessions can be served by Claude, GPT, Grok and other model families, and can switch mid-session. So under omp, CLAUDECODE=1 is not serving-family evidence.

Where CE reads it

Three cross-model references contain the same host-attestation snippet, with the CLAUDECODE branch first and no OMPCODE check:

  • skills/ce-code-review/references/cross-model-review.md:21
  • skills/ce-doc-review/references/cross-model-review.md:20
  • skills/ce-pov/references/cross-model-panel.md:45
if [ "${CLAUDECODE:-}" = "1" ]; then XHOST_HARNESS=claude; XHOST_FAMILY=claude;

Separately, skills/ce-code-review/scripts/run-log.py:47 (host_from_env) classifies omp as claude too, so metadata.cost.host is mislabeled. That is a logging issue only; it does not affect peer selection or independence.

Captured output in an omp shell

Evaluating the ce-code-review snippet verbatim in an omp bash tool call:

$ env | grep -E '^(CLAUDECODE|OMPCODE)='
CLAUDECODE=1
OMPCODE=1
$ <snippet>; echo "XHOST_HARNESS=$XHOST_HARNESS XHOST_FAMILY=$XHOST_FAMILY"
XHOST_HARNESS=claude XHOST_FAMILY=claude

Consequences when the session is not Claude-served (source-traced)

The snippet is guidance the orchestrator runs; the workers take the host family as their first argument. If the orchestrator forwards the snippet's claude during a GPT-served session:

  1. Same-family peer certified independent. cross-model-adversarial-review.sh:1201 sets _independent=true when host and target families are both known and differ. Host claude vs target codex passes, although both are GPT. The same comparison exists in ce-doc-review/scripts/cross-model-doc-review.sh:1182 and ce-pov/scripts/cross-model-pov.sh:923.
  2. Agreement credit and validator skip. findings-mechanics.py:75-79 counts a cross-model reviewer as independent only when independence_verified is True. For matching findings that pass the existing evidence and agreement gates, the false flag grants the cross-model confidence increase, and finish-review.md:61 lets such findings skip the Stage 5b validator.
  3. A genuinely different peer is excluded. Candidate filtering drops targets of the host family (cross-model-adversarial-review.sh:450, cross-model-doc-review.sh:497), so a Claude peer is skipped on a GPT-served omp host. If that is the only installed peer CLI, no cross-model pass runs.

When omp is served by a Claude-family model, the guessed family happens to match, but the harness is still mislabeled as Claude Code.

Source-traced failure scenario (not an executed reproduction)

  1. Start an omp session served by a GPT model, before host attestation runs.
  2. Run ce-code-review at a depth where the adversarial cross-model pass runs, on a local tree, with the codex route permitted and installed.
  3. The orchestrator runs the snippet, gets XHOST_FAMILY=claude, and passes it to cross-model-adversarial-review.sh.
  4. Predicted: the codex peer completes and its artifact records independence_verified: true.

Expected behavior

  • A Claude Code compatibility marker set by another harness is not taken as serving-family evidence.
  • Under omp, the host family is either attested from trustworthy runtime serving evidence or left unknown; with unknown, same-family exclusion and independence stay conservative, as they already do.

Possible fixes

  1. Minimal, fail-closed: check OMPCODE before CLAUDECODE and set both tokens to unknown for omp. unknown is already accepted by every worker. The cost: cross-model-adversarial-review.sh:387 then skips the automatic pass with its existing "host serving family unattested" reason, so omp users lose automatic cross-model coverage.
  2. Keep coverage where the family is knowable: make the instructions say explicitly how trustworthy runtime serving-family evidence sets the family token (codex for GPT, claude for Claude, grok for Grok), and keep unknown otherwise. The existing "attest what you know" sentence in cross-model-panel.md points this way but does not define what counts as evidence; a requested model or a model's self-report should not.
  3. Optional: add an omp harness token. This needs the accepted host-harness vocabulary in all three workers (and their tests) to be extended; without that, workers refuse the job.

Apply the change consistently to the three snippets and run-log.py. The existing attestation tests are natural places to cover it: tests/review-skill-contract.test.ts (extractHostAttestation) and tests/ce-code-review-run-log.test.ts, with an OMPCODE=1 + CLAUDECODE=1 case.

taonos avatar Oct 02 '26 23:10 taonos

Triage: leaving open — valid attestation bug on omp.

skills/ce-code-review/references/cross-model-review.md (and the doc-review twin) still map CLAUDECODE=1 to both harness claude and family claude. omp sets that marker for its shell regardless of the serving model, so a non-Claude omp session can be attested as Claude and a same-family peer can be recorded independence_verified: true.

Fix belongs in the shared attestation snippet (and any omp-specific path): treat OMPCODE / omp as its own harness, and do not take serving family from CLAUDECODE alone when omp is the host. No community PR yet.

tmchow avatar Oct 16 '26 15:10 tmchow