-
Notifications
You must be signed in to change notification settings - Fork 16
feat(constation): wire production miner-key dial path end to end #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
echobt
merged 1 commit into
BaseIntelligence:main
from
alpha1122x:feat/constation-prod-orchestration
Jul 27, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| """Add sealed_manifest_hashes to image_digest_allowlist. | ||
|
|
||
| Stores the build-time sealed surface (path → 64-hex SHA-256) alongside each | ||
| BASE-produced digest so production can supply prism's non-empty | ||
| ``expected_sealed_manifest_hashes``. Application registration rejects empty | ||
| maps; the column uses a non-null JSON server default of ``{}`` so existing | ||
| rows migrate without rewrite. Legacy empty maps cannot be re-registered and | ||
| fail closed if loaded into DigestRecord until backfilled. | ||
|
|
||
| Revision ID: 0019_allowlist_sealed_hashes | ||
| Revises: 0018_attestation_nonces | ||
| Create Date: 2026-07-27 00:00:00.000000 | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| import sqlalchemy as sa | ||
|
|
||
| from alembic import op | ||
|
|
||
| revision: str = "0019_allowlist_sealed_hashes" | ||
| down_revision: str | None = "0018_attestation_nonces" | ||
| branch_labels: str | Sequence[str] | None = None | ||
| depends_on: str | Sequence[str] | None = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| """Apply the migration.""" | ||
|
|
||
| op.add_column( | ||
| "image_digest_allowlist", | ||
| sa.Column( | ||
| "sealed_manifest_hashes", | ||
| sa.JSON(), | ||
| server_default=sa.text("'{}'"), | ||
| nullable=False, | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| """Revert the migration.""" | ||
|
|
||
| op.drop_column("image_digest_allowlist", "sealed_manifest_hashes") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env bash | ||
| # T12: production constation surface scenarios S1–S8 + B1s/B2s. | ||
| # Exit non-zero on any failure. No live Lium. | ||
| set -euo pipefail | ||
|
|
||
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| cd "$ROOT" | ||
|
|
||
| export UV_CACHE_DIR="${UV_CACHE_DIR:-/var/tmp/uv-cache}" | ||
| # Prism optional surface pieces (S3/S6) + local surface helpers. | ||
| export PYTHONPATH="${ROOT}/packages/challenges/prism/src:${ROOT}/tests/surface${PYTHONPATH:+:${PYTHONPATH}}" | ||
|
|
||
| SURFACE_NODEIDS=( | ||
| "tests/surface/test_constation_production_surface.py::test_s1_honest_path_seal_store_forward_nests_bundle" | ||
| "tests/surface/test_constation_production_surface.py::test_s2_adversarial_triangle_fail_no_ok_bundle_put" | ||
| "tests/surface/test_constation_production_surface_prism_http.py::test_s3_missing_bundle_prism_behavior" | ||
| "tests/surface/test_constation_production_surface.py::test_s4_nonce_issue_seal_consume_once_ok" | ||
| "tests/surface/test_constation_production_surface.py::test_s5_allowlist_sealed_hashes_required" | ||
| "tests/surface/test_constation_production_surface_prism_http.py::test_s6_legacy_gate_no_elevation_without_constation" | ||
| "tests/surface/test_constation_production_surface.py::test_s7_forwarder_embed_from_lookup" | ||
| "tests/surface/test_constation_production_surface_prism_http.py::test_s8_challenge_route_smoke" | ||
| "tests/surface/test_constation_production_surface.py::test_b1s_verify_key_wiring_smoke" | ||
| "tests/surface/test_constation_production_surface.py::test_b2s_orchestrator_source_never_calls_consume" | ||
| ) | ||
|
|
||
| echo "==> surface_constation: UV_CACHE_DIR=${UV_CACHE_DIR}" | ||
| echo "==> running ${#SURFACE_NODEIDS[@]} node ids" | ||
|
|
||
| exec uv run pytest -q --tb=short "${SURFACE_NODEIDS[@]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
allowlist.register(record)sits outside theValueErrorhandler — rebind conflicts 500 instead of 422.DigestAllowlist.register()raisesValueErrorwhen the same digest is rebound to a different commit/tree/variant. Here that call (line 339) is outside thetry/except ValueErrorblock, so a legitimate conflict crashes with an unhandled 500. The equivalent endpoint insrc/base/master/constation/routes.pycorrectly wraps both theDigestRecordconstruction and theallowlist_repo.register(record)call in the same try block, convertingValueErrorto a 422 — this file should match that pattern.🐛 Proposed fix to catch registration conflicts too
try: record = DigestRecord( commit_sha=body.commit_sha, tree_sha=body.tree_sha, variant=ImageVariant(body.variant.strip().lower()), digest=body.digest, sealed_manifest_hashes=body.sealed_manifest_hashes, ) + allowlist.register(record) except ValueError as exc: raise HTTPException( status.HTTP_422_UNPROCESSABLE_ENTITY, detail=str(exc), ) from exc - allowlist.register(record) return {"status": "registered", "digest": record.digest}📝 Committable suggestion
🤖 Prompt for AI Agents