Repository navigation
Conversation
… prod root (ENC-2)
…mpotent migrations (ENC-2)
…lthz and well-known document (ENC-2)
Collaborator
Author
Whole-PR review (Sonnet): verdict FIX-FIRST (a short fix-up, then merge)I ran the 172 tests and ruff; the worktree is unchanged. Sources and tests are byte-identical to the verified prototype, and the diff matches the plan's File Structure. CI is green, and Fix before merge
Confirmed:
Can wait for a later leaf: migration contiguity, underscore-joined prose in |
… commit-failure rollback, origin/env validation Review items on PR #670 (internal#548): 1. web.py module logger renamed _log -> logger: ruff's G/LOG rules only check loggers they recognise by name, so _log escaped lint entirely. The rename surfaced a latent G201 (.error(exc_info=True)); now logger.exception(). The vacuous pyproject-select-list test is replaced by one that runs `ruff check --select G,LOG --isolated` on a bad snippet and asserts a nonzero exit with G004 (skips without ruff on PATH). README documents the naming rule. 2. Database.run(): COMMIT moved inside the try; on any failure ROLLBACK runs only when conn.in_transaction, then re-raises. A COMMIT-time failure no longer wedges the shared connection (test injects a connection proxy whose execute("COMMIT") raises and asserts the next run() succeeds). 3. settings: _https_origin rejects userinfo and an empty host, lowercases the host, and guards parts.port; dev public_url now goes through it with http allowed only for localhost/127.0.0.1/::1; transparency_url gets the same host checks. 4. Settings.__post_init__ refuses env values outside ENVS, closing the dataclasses.replace(env="PROD") sidestep of the owner-EOA refusal. Suite: 172 -> 188 tests (187 passed + 1 ruff-PATH skip under the plain `python -m pytest` invocation; 188 passed with the venv bin on PATH). ruff check / format clean; check-docs and phrase-safety guards pass. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Collaborator
Author
|
Review fix-up landed in be17a84, covering all four items:
188 tests pass and CI is green. The ruff test skips only when ruff isn't on PATH; CI and an activated venv run it. D13 (the owner-EOA flag allowed in |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ENC-2 — enclave package scaffold
Refs p-diogo/totalreclaw-internal#531 (Enclave MCP v1 spec tracking issue). Plan:
2026-09-27-enc-2-enclave-scaffold.md.What
enclave/(totalreclaw_enclave, Python 3.12, distributiontotalreclaw-enclave0.1.0,Private :: Do Not Upload). Pins:mcp>=2.2,<3,starlette>=1.7,<2,uvicorn>=0.54,<1,totalreclaw>=2.5.2,<3(dev/CI install./python),totalreclaw-core>=2.6.0,<3.settings.py: env → frozenSettings.ENCLAVE_ENVhas no default. Relay, DataEdge and derivation root are fixed per env, and the production relay is refused outside prod.ENCLAVE_ALLOW_OWNER_EOA=1is refused whenENCLAVE_ENV=prodor ontotalreclaw-enclave-v1/prod(E3-4). The check runs on everySettingsconstruction, sodataclasses.replacecannot bypass it.db/: stdlibsqlite3on one DB thread, WAL,synchronous=FULL,secure_delete. Migration 1 creates every spec §3.1 table (STRICT, exact column names,ON DELETE CASCADEfromvaultsso unpair is one delete).audit.py:AuditLogger.recordrefuses plaintext-shaped fields and stores a 16-hexvault_hash, never the address.logs.py+redaction.py: one redacting JSON root handler (arguments, extras, exception messages, third-party loggers, warnings, uncaught exceptions). RuffG/LOGrules forbid building log templates from values.web.py/subsystems.py/deps.py: Starlette app from orderedSubsystem(name, routes, lifespan)values; frozenDepswithRootProvider/Sealerplaceholders for ENC-3.GET /healthz,GET /.well-known/totalreclaw-enclave.json(spec §4.1 keys).enclave-tests(path-scoped);enclave/README.mdadded tocheck-docs.sh.Not in this PR
Sealing (ENC-3),
/mcp(ENC-4), OAuth (ENC-5; authlib intentionally not added), tools, worker, NEAR, inference, Dockerfile.Tests
172 tests (
enclave/tests/), includingtest_logging_redaction.py(no-plaintext invariant),test_migrations.py::test_initial_schema_matches_spec_3_1_exactly, andtest_web.py::test_mcp_sdk_streamable_http_mounts_as_a_subsystem(proves the ENC-4 mount pattern againstmcp2.2).E2E (open item)
No staging E2E is possible until a staging enclave exists (ENC-13). This PR makes no network calls;
load_settingsrefuses the production relay/DataEdge outsideENCLAVE_ENV=prod. Staging E2E is owned by ENC-15.Review focus
f-string/concat logging in later leaves (ruff G); non-ASCII / multi-line / huge values in logs and audit; env typos (
PROD,true); EIP-55 checksummed vault addresses; opening a DB twice or after a newer build migrated it.