feat(tin-2423): substrate-boundary conformance validator (ledger item 30)#15
Merged
Merged
Conversation
… 30) Port the GF substrate-boundary conformance validator (scripts/validate-substrate-boundary.py, reference: tinyland-inc/GloriousFlywheel PR #1016, feat/tin-2423-substrate-boundary) to this repo. Asserts ADR-008 logical replaceability as a checked invariant: code surfaces may only reach the blahaj substrate through named, provenance-carrying interfaces recorded in config/substrate-boundary-allowlist.json; docs (*.md) stay exempt. Scan result for this repo: CLEAN. No blahaj repo-ref, path-reach, or state-key hits in any code surface (tofu/**, .github/workflows/**, scripts/**, Justfile, flake.nix, MODULE.bazel, *.bzl, BUILD.bazel, tinyland.repo.json) — the allowlist ships empty. The dormant blahaj_app_install tofu module consumer (count = var.blahaj_installation_id > 0 ? 1 : 0, default 0) resolves its module source through the operator-injected var.gf_modules_source placeholder, never a literal tinyland-inc/blahaj reference. Wired into scripts/check-conformance.sh as checklist item 17 (own summary/exit-code aggregation, matching this repo's existing conformance idiom) and exposed via `just substrate-boundary-check`; both are already covered by the existing `just conformance` step in .github/workflows/ci.yml. Committed with --no-verify per TIN-2423 fanout house rules (spokes-A lane); no functional hooks were skipped for validation purposes — output above was run locally in-clone. Not signing this commit per the fanout task's stated house rules for this batch.
Ports the SELF-exclusion fix from GloriousFlywheel main (6fb1f50): the validator was scanning its own source under scripts/**, which contains the blahaj repo-ref/path-reach/state-key regex literals used for detection and self-testing, producing false-positive violations against itself. SELF is now resolved and excluded in tracked_code_files().
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.
Summary
Fans out the substrate-boundary conformance validator to this repo, per TIN-2423 and
operator-ratified ledger item 30. Reference implementation: GF PR #1016
(
feat/tin-2423-substrate-boundaryontinyland-inc/GloriousFlywheel).Asserts ADR-008 "logical replaceability" as a checked invariant instead of prose: this
repo's code surfaces may reach the blahaj substrate only through named interfaces recorded
(with provenance) in
config/substrate-boundary-allowlist.json. Docs (*.md) stay exempt.Correction (adversarial-verify REWORK — fixed)
The version of
scripts/validate-substrate-boundary.pyoriginally pushed on this branch(
e0f0983) predated the SELF-exclusion fix that landed on GF main (6fb1f50). BecauseCODE_GLOBSincludesscripts/**, and the validator's own source contains the literaldetection strings (
tinyland-inc/blahaj,../blahaj,~/git/blahaj,key = "blahaj/) inits regex definitions and
self_test()fixtures, the un-fixed script flagged itself.Confirmed by re-running the validator against
e0f0983directly: 8 un-allowlistedviolations, exit 1 — not the "CLEAN / 0 violations" this PR originally (and incorrectly)
reported below. That prior claim was stale evidence, not a real passing run.
Fixed by porting the identical GF-main fix: added
SELF = Path(__file__).resolve().relative_to(REPO)right afterREPO, and excluded it intracked_code_files()'s filter (Path(p) != SELF). Nothing else in the script changed.Scan result: CLEAN (re-verified post-fix, post
git add -A)No
tinyland-inc/blahajrepo-ref,../blahaj/~/git/blahajpath-reach, orkey = "blahaj/state-key hits anywhere in this repo's code surfaces (
tofu/**,.github/workflows/**,scripts/**,Justfile,flake.nix,MODULE.bazel,**/*.bzl,**/BUILD.bazel,tinyland.repo.json). The allowlist ships empty.The dormant
blahaj_app_installtofu module block (count = var.blahaj_installation_id > 0 ? 1 : 0, default0) resolves its module source through the operator-injectedvar.gf_modules_sourceplaceholder (git::ssh://git@github.com/ORG/REPO.git//...), never aliteral
tinyland-inc/blahajstring — consistent with this repo's existing "personal Pagesspoke, blahaj installation dormant" posture (see
tofu/README.md,AGENTS.md).What changed
scripts/validate-substrate-boundary.py— byte-identical to the GF reference exceptCODE_GLOBS, adapted to this repo's layout (tofu/**, plustinyland.repo.jsonsinceit declares
gitops_receiver); plus the SELF-exclusion fix (see Correction above).config/substrate-boundary-allowlist.json— emptyallowedarray (nothing to allowlist).scripts/check-conformance.sh— new checklist item 17, matching the existingok/no/man idiom.
Justfile— newsubstrate-boundary-checkrecipe..github/workflows/ci.ymlalready runsjust conformance, whichnow includes this check.
Test plan
python3 scripts/validate-substrate-boundary.py --self-testpassespython3 scripts/validate-substrate-boundary.pypasses (0 hits, 0 violations) —re-verified after
git add -A, verbatim output abovebash scripts/check-conformance.shpasses with new item 17 green (16 pass, 0 fail,7 manual)
Committed with
--no-verify -c commit.gpgsign=falseper the TIN-2423 fanout task's statedhouse rules for this batch.