cloud-env-check: reconcile --verify-domains against per-entry expect (#27) - #28
Merged
Merged
Conversation
…27) The check reported what each host answered; it had no notion of what the record claimed the answer would be, so claim and observation could invert silently — .github-private#316 exactly: two entries recorded as blocked kept probing green after a dialog update, caught by a human reading prose. Each allowedDomains entry may now carry "expect": "reachable" | "blocked" (default "reachable", so every existing record behaves identically until it opts in). Red means the record and the proxy disagree, in either direction: expect probe result reachable status green (unchanged) reachable 000 red (unchanged) blocked 000 green (was red-until-dialog-change — a deliberate recorded-but-absent entry no longer holds the gate red) blocked status red (the #316 drift, machine-caught) "expect" is repo-side annotation like "reason" and "probe": excluded from the digest, so adopting it moves no handshake value and needs no dialog edit — proven by test. An invalid value is refused loudly rather than falling back to the default and un-failing the check, same posture as the typo'd-container-key refusal. The dead-network INCONCLUSIVE guard narrows to expected-reachable probes: a 000 matching expect: blocked can neither trigger nor veto it. Tests run hermetically via a shimmed curl — the reachable-but-recorded- blocked direction cannot be produced on demand against real hosts, and it is the direction the change exists for. New self-test job asks for it by name. CANONICAL_SHA256 bumped in step with the script per README; step-4 re-vendor into adopters follows separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015u76VQjvDnvZVAX8pcM9m6
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.
Closes #27.
What changed
--verify-domainsgoes from reporting raw reachability to reconciling observation against expectation. EachallowedDomainsentry may carry"expect": "reachable" | "blocked"(defaultreachable); red now means the record and the proxy disagree, in either direction:Design constraints honored, each proven by a test:
expectis repo-side annotation likereasonandprobe— excluded from the digest, so adopting it moves no handshake value and needs no dialog edit (test_expect_excluded_from_digest).test_invalid_expect_refused).expect: blockedcannot distinguish the proxy refusing from the network being gone, so it neither triggers nor vetoes the guard (test_dead_network_inconclusive_not_mass_failure).reachablemeans no flag-day: every existing record (infra, front-desk-scheduler, .github-private) behaves identically until it opts in.One posture note, per discussion: nothing here probes past anyone's block. The "blocked" in
expect: blockedis our own environment's egress allowlist — the check asks our proxy "would you let me through," one GET per domain per explicit invocation, no retries, and a mismatch is fixed by editing the dialog or the record, never by circumvention. The check-3 comment now says so explicitly.Files
tools/cloud-env-check.mjs— the reconcile logic,expectvalidation, updated check-3 header docstest/test_verify_domains.py— new; 7 hermetic cases via a shimmedcurl(the reachable-but-recorded-blocked direction can't be produced on demand against real hosts, and it's the direction this change exists for).github/workflows/self-test.yml— newverify-domainsjob running the tests, asking for the new direction by name.github/workflows/env-check-drift.yml—CANONICAL_SHA256bumped in step with the script, per the README bump procedureVerification
Smoke-tested against
.github-private's real record with the modified script:--print-digeststill yields840af7c900b1(digest unmoved, as designed) and a live--verify-domainsstill reportsallowlist ✓ 5/5.Not in this PR
Step 4 of the bump procedure — re-vendoring into each adopter and bumping caller pins — follows per-repo after merge, which is exactly the drift
env-check-drift.ymlmakes visible in the meantime..github-privateinitially adopts with noexpect: blockedentries (both formerly-absent hosts are now carried); the field is for the next deliberate recorded-but-absent entry, which is the state the convention exists for.Generated by Claude Code