Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

CrossVendorAudit is hardcoded to codex; doctrine breaks if that vendor lapses

Open 0bsolescence opened this issue 3 months ago • 2 comments

Issue draft: CrossVendorAudit is single-vendor, which makes the doctrine fragile

Title: CrossVendorAudit is hardcoded to codex; doctrine breaks if that vendor lapses


The gap

INSTALL.md states that LifeOS doctrine leans on "a cross-vendor audit CLI (codex)", and Doctor ships a codex capability described as "independent second-vendor review on high-impact work". CrossVendorAudit.ts implements that well: ISA and artifact bundling, read-only ephemeral execution, schema-enforced verdicts, a preflight, and an append-only findings log that builds a track record over time.

The issue is that the doctrine is about independence, while the implementation is about one vendor. Those are not the same requirement, and today they are welded together.

Concretely, codex appears 29 times across 470 lines, and the coupling is structural rather than cosmetic:

  • binary resolution with vendor-specific install paths
  • a sandboxed CODEX_HOME plus auth.json symlink strategy
  • an OPENAI_API_KEY / OPENAI_BASE_URL env scrub, because that vendor's auth precedence would otherwise silently flip which account performs the audit
  • --output-schema with OpenAI strict structured-output rules
  • a codex doctor --json preflight
  • an AGENTS.md isolation shim

Why it matters

If a user's access to that one vendor ends, whether through subscription lapse, regional availability, or org policy, the audit path does not degrade to a different vendor. It simply stops, and with it the verification rule that elects it during VERIFY on high-stakes runs.

That is a single point of failure underneath a constitutional guarantee.

What a fix looks like

Introduce a small vendor adapter with a stable shape, and keep CrossVendorAudit's bundling, schema enforcement, logging and findings history exactly as they are:

interface AuditVendor {
  id: string;                                  // "codex" | "agy" | ...
  resolveBinary(): string | null;
  preflight(): Promise<{ ok: boolean; detail: string }>;
  scrubEnv(env: Record<string,string>): Record<string,string>;
  invoke(promptPath: string, schemaPath: string): Promise<string>;  // returns raw JSON
}

A second implementation already looks viable. Google's Antigravity CLI (agy) is scriptable with -p/--print, supports --output-format json, and enforces structured output via --json-schema, which maps onto the same contract. It authenticates from ~/.gemini rather than a vendor home directory, so the sandboxing step differs but the interface holds.

Vendor selection could follow the existing pattern: config first, then whichever vendor Doctor reports as live, so an install with only one available still works unchanged.

Scope note

This is a refactor of an existing file rather than a new feature, and it changes no behaviour for a single-vendor install. Raising it as an issue first rather than opening a PR, since it touches a tool wired into the Algorithm and the maintainer may already have a direction in mind. Happy to implement if the shape above is acceptable.

Context

Found while setting up both vendors across two Linux machines. Related observation worth recording: a presence check on the second vendor's credentials file reports healthy while the token is expired, so any preflight for it should verify expiry rather than existence.

0bsolescence avatar Aug 11 '26 03:08 0bsolescence

Agreed the single-vendor coupling is fragile. A vendor registry with graceful degradation is the right shape and it's queued. The doctrine side already treats the audit as cross-vendor-or-fresh-context; the hardcoded CLI is the real gap you found.

danielmiessler avatar Aug 14 '26 22:08 danielmiessler

Declining the abstraction, though the observation is correct — CrossVendorAudit.ts names one vendor 30 times, and the doctrine around it does claim vendor independence.

The gap is narrower than it looks. What the doctrine actually asserts is independence of judgment — that a second opinion comes from a different model family than the one that did the work. That's a property of who we ask, not of a pluggable backend. And adding a vendor here needs explicit approval regardless, so an interface with exactly one implementation would be scaffolding for a swap we haven't decided to make.

If and when a second approved vendor lands, the extraction happens then, with a concrete consumer to shape it. Doing it now means guessing at the seam.

Worth raising, though — the mismatch between what the doctrine says and what the code does was real, and we've tightened the wording rather than the code.

danielmiessler avatar Aug 20 '26 00:08 danielmiessler