Commit Graph
596 Commits
Author SHA1 Message Date
Hermes AgentandClaude Opus 4.8 79e2fa35d5 fix(mosaic): close claudex isolation gaps S1 (Bedrock/Vertex bypass) + S2 (fail-open catches)
Addresses MS-LEAD secrev REQUEST CHANGES on #806.

S1 (CRITICAL — REQ 2 defeated by provider switches + cloud creds): the env sweep
did not neutralize AWS Bedrock / GCP Vertex routing. CLAUDE_CODE_USE_BEDROCK /
CLAUDE_CODE_USE_VERTEX are routing switches whose mere presence makes Claude Code
talk to the real Anthropic API via the ambient cloud credential chain, bypassing
ANTHROPIC_BASE_URL (the loopback proxy) entirely — and the cloud credentials
(AWS_SECRET_ACCESS_KEY, AWS_BEARER_TOKEN_BEDROCK, GOOGLE_APPLICATION_CREDENTIALS,
…) passed straight through.
- buildClaudexEnv now force-deletes the routing switches by exact name
  (CLAUDEX_FORCED_UNSET_ENV) regardless of value — a name pattern is the wrong
  model for a boolean switch.
- CLAUDEX_CREDENTIAL_ENV_RE extended to the cloud-cred families (^AWS_,
  ^GOOGLE_APPLICATION_CREDENTIALS, ^GOOGLE_CLOUD_, ^GCP_) and the mid-string
  _KEY$ / _SECRET gap (STRIPE_SECRET_KEY, SSH_PRIVATE_KEY, AWS_SECRET_ACCESS_KEY).
- Doc-comment updated to match reality.

S2 (HIGH — fail-open contradicts documented fail-closed): defaultCanonicalizeIntended
and defaultIsSymlink swallowed ANY fs error. Now they distinguish ENOENT
(genuinely absent → safe to continue) from every other errno (ELOOP, EACCES,
ENOTDIR, …) which rethrows and fails CLOSED.

Tests (TDD red-first, 4 new specs red before the fix): Bedrock/Vertex switches +
AWS/GCP creds swept while the loopback proxy stays the only route; mid-string
_KEY/_SECRET closed; real-FS ELOOP (canonicalize) and ENOTDIR (isSymlink) fail
closed; injected EACCES not swallowed.

New-module coverage 100% stmts/lines, 93.75% branch. Full mosaic suite 1169 green;
typecheck / lint / format:check green. No --no-verify.

Refs #790

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-16 17:00:04 -05:00
Hermes AgentandClaude Opus 4.8 ab8c9a2d4b feat(mosaic): claudex isolated config + env-inject + yolo wiring (P2–P4 of #790)
Second and final PR for `mosaic [yolo] claudex` — runs GPT models inside the
Claude Code harness via claude-code-proxy (ChatGPT-subscription OAuth). Builds
on the PR-1 preflight/lifecycle library (#793).

New `claudex.ts` (pure / dependency-injected composition):
- resolveClaudexConfigDir / assertIsolatedConfigDir — the isolated
  CLAUDE_CONFIG_DIR seam. HARD REQ 1 (provable isolation): canonicalizes both
  sides, rejects `~/.claude` and any descendant, ensures the dir 0700, then
  re-checks post-create and rejects a symlinked target (TOCTOU). Ambient
  CLAUDE_CONFIG_DIR is never inherited. Fails closed on any uncertainty.
- buildClaudexEnv — HARD REQ 2 (zero token leakage): strips the entire
  credential-bearing env family (ANTHROPIC_*, *_TOKEN, *_API_KEY, *_SECRET,
  CLAUDE_CODE_OAUTH*) and hands Claude Code only ANTHROPIC_AUTH_TOKEN=unused.
  Never reads the proxy credential file. Returns a fresh object (no mutation).
- resolveClaudexModels — P3 tier map: primary→gpt-5.6-sol,
  small/fast→gpt-5.6-luna; operator env values win.
- buildClaudexBanner / buildClaudexContractNote — P4 EXPERIMENTAL classification
  (no token material by construction).
- runClaudexProxyGate — preflight → device reauth (only when needed) → ensure a
  trusted-live listener → re-preflight; surfaces non-sensitive problems only.
- launchClaudex — fail-closed DI orchestration: preflight → gate → compose env →
  exec; never reaches exec on a gate failure or guard throw. Proxy endpoint
  imported from claudex-proxy.ts (single source of truth).

launch.ts wiring:
- execRuntime gains an env parameter.
- `claudex` + `yolo claudex` commander dispatch (keeps the #454 arg-slice fix);
  claudexHandler is an injectable seam for the wiring tests.
- launchClaudexProduction glue assembles the real harness adapter.

Tests: 45 claudex specs + 5 launch wiring specs, TDD red-first. New-module
coverage 99% stmts/lines, 93% branch (≥85% gate). Full mosaic suite 1164 green;
typecheck / lint / format:check green.

Refs #790

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-16 16:42:32 -05:00
jason.woltje 59f5f51ffd feat(mosaic): claudex proxy preflight + lifecycle (P1 of #790) (#793) 2026-07-16 21:15:33 +00:00
jason.woltje 9745bc3f29 feat(fleet): add reviewed v1-to-v2 migration preview (#788) 2026-07-16 13:11:16 +00:00
jason.woltje adad486b6f fix(fleet): enforce exact comms authority (#787) 2026-07-16 00:32:23 +00:00
jason.woltje c1aecfabe9 test(fleet): cover reconciler lifecycle gates (#786) 2026-07-15 16:46:13 +00:00
jason.woltje 499090508e feat(fleet): reconcile local roster state (#785) 2026-07-15 15:03:31 +00:00
jason.woltje c593a15ef8 docs(kbn): freeze KBN-101 database role split contract (#774) 2026-07-15 13:34:29 +00:00
jason.woltje bc5e73629e feat(fleet): add generation-guarded agent CRUD (#773) 2026-07-15 12:03:05 +00:00
jason.woltje 191efaefeb feat(fleet): enforce generated environment boundary (#772) 2026-07-15 08:40:32 +00:00
jason.woltje e9c4aa3e8b test(fleet): validate shipped artifact dispositions (#770) 2026-07-15 01:37:12 +00:00
jason.woltje a5e8e55401 feat(fleet): add shared role semantics (#768) 2026-07-15 00:53:47 +00:00
jason.woltje eb4e14ae5c feat(mos): add logical identity connector fencing (#757) 2026-07-14 23:33:06 +00:00
jason.woltje 2e2280070a docs(#753): clear KBN-010 threat and schema gate (#765) 2026-07-14 21:46:44 +00:00
jason.woltje aa5b43bba2 feat(fleet): add roster v2 structural compiler (#764) 2026-07-14 20:37:52 +00:00
jason.woltje ba13c08890 Fixes #756 (#763) 2026-07-14 20:26:15 +00:00
jason.woltje c32d85a337 docs(fleet): define declarative configuration M0 (#760) 2026-07-14 19:53:12 +00:00
jason.woltje 48b2bc42c9 docs(mos): format Option 2 qualification report (#762) 2026-07-14 19:33:09 +00:00
jason.woltje 5e832049bb docs(mos): preserve Option 2 qualification evidence (#759) 2026-07-14 19:16:11 +00:00
jason.woltje 49e8a54105 docs(#751): Publish native Kanban/SOT canon (#752) 2026-07-14 17:08:09 +00:00
jason.woltje d077183554 docs(tess): remediate M5 qualification findings (#750) 2026-07-13 19:59:38 +00:00
jason.woltje 405984af5a De-hardcode orchestrator and interaction agent names (#748) 2026-07-13 18:59:27 +00:00
jason.woltje 8dd4e9d541 docs(tess): ledger sync m4 — M5-003 done, #745/#746 merged (#749) 2026-07-13 18:14:24 +00:00
jason.woltje bc8016c831 docs(#744): complete Tess documentation gate (#746) 2026-07-13 17:44:17 +00:00
jason.woltje e72388b2cb docs(tess): ledger sync m3 — M5-001 + M5-002 done (#745) 2026-07-13 16:14:23 +00:00
jason.woltje 6345dbfcf2 feat(agent): add Matrix native runtime provider (#744) 2026-07-13 15:29:37 +00:00
jason.woltje c6e3cfbd95 docs(tess): ledger sync — W-001 3-of-3 merged, M5-002 approved, M5-001 in TDD (#743) 2026-07-13 15:29:33 +00:00
jason.woltje 5789711ee0 docs(tess): add migration evidence set (#742) 2026-07-13 15:14:29 +00:00
jason.woltje f40e6ba388 docs(tess): sync M4 tracking to merged reality (M4 in-progress / gate-pending) (#741) 2026-07-13 15:00:15 +00:00
jason.woltje b7b0f508e6 feat(gateway): register Hermes runtime provider (#740) 2026-07-13 14:45:08 +00:00
jason.woltje 3378b857eb feat(memory): bind operator plugin to agent sessions (#739) 2026-07-13 13:44:20 +00:00
jason.woltje e2376190e5 feat(gateway): expose Mos coordination boundary (#737) 2026-07-13 13:14:44 +00:00
jason.woltje cca6aaf947 feat(agent): add Hermes transitional capability matrix (#738) 2026-07-13 13:14:43 +00:00
jason.woltje 2363f155b4 feat(memory): add operator retrieval plugin (#736) 2026-07-13 12:44:31 +00:00
jason.woltje 76325ca3f2 feat(tess): add Mos coordination boundary (#735) 2026-07-13 11:59:16 +00:00
jason.woltje 9e5b9188ce feat(agent): add transitional Hermes runtime adapter (#734) 2026-07-13 11:29:27 +00:00
jason.woltje f1c6b37b46 fix(tess): route bare Discord approvals (#733) 2026-07-13 10:29:10 +00:00
jason.woltje 0b621660c8 feat(tess): wire durable interaction surfaces (#732) 2026-07-13 10:05:29 +00:00
jason.woltje 84d884b932 feat(#709): add configured Discord interaction binding (#730) 2026-07-13 09:02:45 +00:00
jason.woltje 8246ee0137 feat(tess): add generic interaction CLI (#731) 2026-07-13 05:52:41 +00:00
jason.woltje 99a2d0fc9d feat(tess): persist durable session state (#729) 2026-07-13 05:14:11 +00:00
jason.woltje e3b5113be2 feat(tess): add configurable Pi interaction service (#728) 2026-07-13 02:59:27 +00:00
jason.woltje 24b07d0f83 docs(tess): sync M1 ledger to merged state; M1-V Mos-owned (#727) 2026-07-13 02:14:13 +00:00
jason.woltje 86a50138a9 feat(tess): add safe runtime observability (#726) 2026-07-13 01:29:18 +00:00
jason.woltje 7b9f40d3b7 fix(tess): redact chat persistence and egress (#725) 2026-07-13 01:14:16 +00:00
jason.woltje 9a8a572fcf feat(tess): add roster-bound tmux fleet provider (#724) 2026-07-13 00:59:24 +00:00
jason.woltje 753a360517 fix(#707): scope session GC retention (#720) 2026-07-13 00:44:19 +00:00
jason.woltje e92186d768 feat: add Tess runtime provider registry (#722) 2026-07-12 23:53:54 +00:00
jason.woltje 119f64e69d feat(#707): secure Discord service ingress (#716) 2026-07-12 23:18:29 +00:00
jason.woltje 46ca3ce742 fix(tess): enforce command authorization approvals (#718) 2026-07-12 23:18:01 +00:00