Skip to content

feat(deps): base-image build recipe + wired-image drift guard - #71

Open
WayforthOfficial wants to merge 1 commit into
mainfrom
feat/base-image-recipe-drift-guard
Open

feat(deps): base-image build recipe + wired-image drift guard#71
WayforthOfficial wants to merge 1 commit into
mainfrom
feat/base-image-recipe-drift-guard

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

Closes the ⚠ process gap from the egress flip-readiness check: the base image was baked by an uncommitted manual step, so nothing tied the wired image to BASE_DEPS. A future BASE_DEPS change would silently leave a stale wired image — the "lock engaged on the wrong image" failure mode, one step removed. No wiring, no flip — recipe + assertion only.

What's here

  • base_deps_lock() / diff_against_base_deps() / base_deps_match() in agent_deps.py — one source of truth (BASE_DEPS) for both the bake and the check.
  • scripts/build_base_image.py (NEW, gated BUILD_BASE_IMAGE=1) — bakes the base image from base_deps_lock(), asserts the built pip freeze == BASE_DEPS before snapshotting, prints the ref. Reproducible, committed — no more manual bake.
  • scripts/deps_live_proof.py — now builds from the shared base_deps_lock(), and adds the wired-image assertion: if AGENT_BASE_IMAGE is set, it boots that image and fails closed unless its pip freeze equals BASE_DEPS. This is what makes "proof passed" ⟹ "wired image correct" — a stale/hand-built image can't slip through.

Proven

  • 6 unit tests, including test_current_template_matches_base_deps — the actual pip freeze I captured from the live wayforth-agent-base-v1 matches BASE_DEPS, so the assertion passes on today's image — and missing/mismatch/extra cases prove it fails on a drifted one.
  • Both scripts are gated no-ops without their env flags (verified). Full suite 632 passed.

This PR changes nothing operationally

  • Does not set AGENT_BASE_IMAGE, does not run the build, does not flip any flag.
  • Wiring sequence (separate, your call, manual): set AGENT_BASE_IMAGErun deps_live_proof green (now also asserts wired == BASE_DEPS) → flip AGENT_GATEWAY_EGRESS_ENABLED.

🤖 Generated with Claude Code

Closes the process gap the egress flip-readiness check found: the base image was baked
by an uncommitted manual step, so nothing tied the WIRED image to BASE_DEPS — a future
BASE_DEPS change would silently leave a stale image (the 'lock engaged on the wrong image'
failure mode, one step removed).

- services/agent_deps.py: base_deps_lock() (hashed closure lock), base_deps_pinned(),
  diff_against_base_deps()/base_deps_match() — single source of truth = BASE_DEPS.
- scripts/build_base_image.py (NEW, gated BUILD_BASE_IMAGE=1): bakes the base image FROM
  base_deps_lock(), ASSERTS the built pip-freeze == BASE_DEPS before snapshotting, prints
  the ref. Does NOT set AGENT_BASE_IMAGE, does NOT flip.
- scripts/deps_live_proof.py: builds from the shared base_deps_lock(); ADDS a wired-image
  assertion — if AGENT_BASE_IMAGE is set, boots it and fails closed unless its pip-freeze
  equals BASE_DEPS. This ties 'proof passed' to 'wired image correct'.
- 6 unit tests incl. the ACTUAL current-template freeze matching BASE_DEPS (assertion would
  pass on today's image) + drift detection (missing/mismatch/extra → fail). Suite 632.

Both scripts are gated no-ops without their env flags. Nothing wired, nothing flipped.
Wiring sequence (separate, manual): set AGENT_BASE_IMAGE -> run deps_live_proof green
(now also asserts wired==BASE_DEPS) -> flip AGENT_GATEWAY_EGRESS_ENABLED.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@railway-app

railway-app Bot commented Jun 30, 2026

Copy link
Copy Markdown

🚅 Deployed to the wayforth-pr-71 environment in wayforth

Service Status Web Updated (UTC)
api ❌ Build Failed (View Logs) Web Jun 30, 2026 at 8:53 pm
8 services not affected by this PR
  • Postgres-DLNK
  • Redis
  • vault-api
  • Postgres
  • wayforth-rank
  • mcp-server
  • crawler
  • labs

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.

2 participants