-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
2293 lines (1856 loc) · 95.2 KB
/
Copy pathJustfile
File metadata and controls
2293 lines (1856 loc) · 95.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# GloriousFlywheel - Unified Task Runner
# =====================================
#
# Consolidated task automation for the pooled runner, cache, and dashboard
# substrate. Prefer entering through direnv or nix develop first, then use
# these repo entrypoints instead of ad hoc local-heavy workflows.
#
# Prerequisites:
# - just (https://github.com/casey/just)
# - direnv (loads Nix devShell automatically)
# - Nix with flakes enabled
#
# Quick Start:
# direnv allow # Preferred devshell entrypoint
# just setup # Seed local config files and backend scaffolds
# just info # Show substrate and backend state
# just # List all commands
# just check # Run bounded local validation
# ENV=dev just tofu-init attic
# ENV=dev just tofu-plan attic
#
# Environment Setup:
# Create .env from .env.example and choose one backend-init path:
# - TOFU_BACKEND_CONFIG_FILE=/abs/path/backend.hcl
# - TOFU_BACKEND_CONFIG_DIR=$PWD/config/backends
# - TOFU_BACKEND_S3_* environment variables for the active S3-backed stacks
# - TF_HTTP_* only for legacy or archived HTTP-backend repair paths
# S3-backed local helper paths:
# - just tofu-backend-scaffold-s3 <stack>
# - just tofu-backend-materialize-s3 <stack>
# Legacy GitLab state init remains available via:
# just tofu-init-gitlab-legacy <stack>
# Live backend direction:
# environment-owned S3-compatible state on `honey`
# The .envrc automatically loads .env via direnv (dotenv_if_exists)
#
# Environment Selection:
# ENV=prod just tofu-plan attic # Target prod cluster
# ENV=dev just tofu-plan attic # Target dev cluster (default)
# Default recipe - list available commands
default:
@just --list --unsorted
# Set up local development environment
setup:
#!/usr/bin/env bash
set -euo pipefail
echo "Setting up local development environment..."
echo
# Check for .env file
if [ ! -f .env ]; then
echo "Creating .env from .env.example..."
cp .env.example .env
echo
echo "Edit .env and choose your preferred backend-init path."
echo "Recommended current local path:"
echo " 1. For the active stacks, prefer TOFU_BACKEND_S3_* or copy"
echo " config/backend.s3.example.hcl into config/backends/<stack>-<env>.hcl"
echo " 2. Use that file directly, or set TOFU_BACKEND_CONFIG_DIR=\$PWD/config/backends"
echo " 3. Files under config/backends/ are auto-detected by just tofu-init <stack>."
echo
echo "Compatibility path:"
echo " Export TF_HTTP_ADDRESS / TF_HTTP_LOCK_ADDRESS / TF_HTTP_UNLOCK_ADDRESS"
echo " Use this only for legacy stacks or archived HTTP-backend repair work."
echo
echo "S3-backed helper path:"
echo " just tofu-backend-scaffold-s3 <stack>"
echo " or export TOFU_BACKEND_S3_* and run just tofu-backend-materialize-s3 <stack>"
echo " These helpers write local backend files for the active S3-backed contract."
echo
echo "Legacy compatibility path:"
echo " Set TF_HTTP_PASSWORD (and optionally TF_HTTP_USERNAME) and use"
echo " just tofu-init-gitlab-legacy <stack>"
echo
echo "Live backend direction:"
echo " environment-owned S3-compatible state on honey"
echo
echo "After editing .env, reload direnv:"
echo " direnv allow"
echo
else
echo ".env already exists"
fi
LOCAL_BACKEND_COUNT="$(find config/backends -maxdepth 1 -name '*.hcl' 2>/dev/null | wc -l | tr -d ' ')"
if [ -n "${TOFU_BACKEND_CONFIG_FILE:-}" ]; then
echo "TOFU_BACKEND_CONFIG_FILE: configured ✓"
elif [ -n "${TOFU_BACKEND_CONFIG_DIR:-}" ]; then
echo "TOFU_BACKEND_CONFIG_DIR: configured ✓"
elif [ "${LOCAL_BACKEND_COUNT:-0}" -gt 0 ]; then
echo "Local backend files: detected in config/backends ✓"
elif [ -n "${TOFU_BACKEND_S3_ENDPOINT:-}" ] && [ -n "${TOFU_BACKEND_S3_BUCKET:-}" ]; then
echo "TOFU_BACKEND_S3_*: configured ✓"
elif [ -n "${TF_HTTP_ADDRESS:-}" ]; then
echo "TF_HTTP_ADDRESS: configured ✓"
elif [ -n "${TF_HTTP_PASSWORD:-}" ]; then
echo "Legacy TF_HTTP_PASSWORD: configured ✓"
else
echo "WARNING: no backend-init path configured yet"
echo " Preferred: TOFU_BACKEND_CONFIG_FILE or TOFU_BACKEND_CONFIG_DIR"
echo " Active-stack path: TOFU_BACKEND_S3_* environment variables"
echo " HTTP path: TF_HTTP_* only for legacy or archived repair work"
echo " Local helper: just tofu-backend-scaffold-s3 <stack> or TOFU_BACKEND_S3_* + just tofu-backend-materialize-s3 <stack>"
echo " Legacy: TF_HTTP_PASSWORD + just tofu-init-gitlab-legacy <stack>"
echo " Live direction: environment-owned S3-compatible state on honey"
fi
echo
echo "Setup complete! Run 'just info' to confirm substrate mode and backend state."
# =============================================================================
# Configuration
# =============================================================================
# Organization config file location
org_config := "config/organization.yaml"
# Environment (set via ENV variable)
env := env_var_or_default("ENV", "dev")
# GitLab compatibility settings (optional, loaded from organization config)
gitlab_url := `yq '.gitlab.url // ""' config/organization.yaml 2>/dev/null || echo ""`
gitlab_project := `yq '.gitlab.project_id // ""' config/organization.yaml 2>/dev/null || echo ""`
gitlab_api := if gitlab_url != "" { gitlab_url + "/api/v4" } else { "" }
# Kubernetes context based on environment (loaded from organization config)
configured_kube_context := `ENV="${ENV:-dev}" && yq ".clusters[] | select(.name == \"$ENV\") | .context // \"\"" config/organization.yaml 2>/dev/null || echo ""`
kube_context_env := env_var_or_default("KUBE_CONTEXT", "")
kube_context := if kube_context_env != "" { kube_context_env } else if configured_kube_context != "" { configured_kube_context } else { "honey" }
kubeconfig_path := `ENV="${ENV:-dev}" && yq ".clusters[] | select(.name == \"$ENV\") | .kubeconfig_path // \"\"" config/organization.yaml 2>/dev/null || echo ""`
# Ingress domain based on environment (loaded from organization config)
ingress_domain := `ENV="${ENV:-dev}" && yq ".clusters[] | select(.name == \"$ENV\") | .domain" config/organization.yaml 2>/dev/null || echo ""`
# Make repo-managed wrappers available to Just recipes even when direnv or
# `nix develop` has not been entered yet. `scripts/tofu` falls back to the
# flake-owned OpenTofu app when host OpenTofu is unavailable.
export PATH := justfile_directory() + "/scripts:" + env_var_or_default("PATH", "")
# SOCKS proxy configuration (optional, loaded from organization config)
socks_host := `yq '.network.proxy_host // ""' config/organization.yaml 2>/dev/null || echo ""`
socks_port := `yq '.network.proxy_port // "1080"' config/organization.yaml 2>/dev/null || echo "1080"`
socks_proxy := if socks_host != "" { "socks5h://localhost:" + socks_port } else { "" }
# =============================================================================
# Network Proxy (Optional)
# =============================================================================
# Start SOCKS proxy (configure ssh host in ~/.ssh/config)
proxy-up:
@if ssh -O check proxy-host 2>/dev/null; then \
echo "Proxy already running on localhost:{{socks_port}}"; \
else \
echo "Starting SOCKS proxy on localhost:{{socks_port}}..."; \
ssh -fN proxy-host; \
echo "Proxy up. Use: HTTPS_PROXY={{socks_proxy}} kubectl ..."; \
fi
# Stop SOCKS proxy
proxy-down:
@ssh -O exit proxy-host 2>/dev/null && echo "Proxy stopped" || echo "Proxy not running"
# Check SOCKS proxy status
proxy-status:
@if ssh -O check proxy-host 2>/dev/null; then \
echo "Proxy: RUNNING on localhost:{{socks_port}}"; \
echo "Test: HTTPS_PROXY={{socks_proxy}} curl -sI https://your-service.example.com"; \
else \
echo "Proxy: NOT RUNNING"; \
echo "Start: just proxy-up"; \
fi
# Run kubectl through SOCKS proxy (auto-starts proxy if needed)
bk *args:
#!/usr/bin/env bash
set -euo pipefail
if ! ssh -O check proxy-host 2>/dev/null; then
echo "Starting proxy..." >&2
ssh -fN proxy-host
fi
HTTPS_PROXY={{socks_proxy}} kubectl {{args}}
# Run curl through SOCKS proxy
bcurl *args:
#!/usr/bin/env bash
set -euo pipefail
if ! ssh -O check proxy-host 2>/dev/null; then
echo "Starting proxy..." >&2
ssh -fN proxy-host
fi
HTTPS_PROXY={{socks_proxy}} curl {{args}}
# =============================================================================
# Development Workflows
# =============================================================================
# Bounded local validation cycle (format + links + public export scrub)
check: fmt-check check-links check-public-docs public-alpha-export-check dogfood-contract-audit dogfood-contract-audit-self-test arc-auth-secret-redaction-contract-check product-reality-review-check rbe-boundary-check rbe-storage-provider-boundary-check rbe-proof-contract-check rbe-target-eligibility-check rbe-platform-contracts-check rbe-worker-toolchain-model-contract-check gf-reapi-cell-chapel-contract-check browser-runtime-authority-contract-check web-rbe-candidate-template-contract-check arc-runner-executor-endpoint-contract-check gf-reapi-cell-manifest-check gf-reapi-cache-frontdoor-contract-check gf-reapi-cell-capacity-policy-check gf-reapi-fairness-dashboard-contract-check gf-runner-ttfch-probe-contract-check gf-reapi-cell-publish-contract-check gf-reapi-cell-digest-resolver-contract-check gf-reapi-cell-proof-contract-check darwin-rbe-proof-dispatch-contract-check darwin-rbe-proof-readiness-contract-check gf-reapi-cell-proof-artifact-contract-check gf-reapi-proof-artifact-download-contract-check gf-reapi-ac-nuke-key-contract-check gf-reapi-ac-attestation-chaos-check bazel-app-image-contract-check nix2container-adapter-node-image-contract-check bazel-devshell-authority-check nix-flake-source-input-authority-contract-check nix-flake-source-mirror-package-contract-check nix-flake-source-authority-package-contract-check bazel-cache-exposure-policy-check bazel-remote-cache-cas-integrity-contract-check pilot-workflow-contract-check workflow-cache-proof-check gf-hit-gate-contract-check bazel-executor-backed-contract-check bazel-benchmark-modes-contract-check consumer-bazel-wrapper-contract-check flywheel-consumer-env-contract-check flywheel-profile-distribution-contract-check flywheel-enrollment-frontdoor-contract-check flywheel-github-oidc-profile-contract-check flywheel-frontdoor-kit-contract-check dev-attach-contract-check kvm-cache-prewarm-contract-check kvm-capacity-policy-contract-check rustfs-openebs-restart-hygiene-contract-check rustfs-lifecycle-secret-contract-check tofu-state-contract-check rustfs-bucket-index-rca-empty-state-keys-contract-check rustfs-state-authority-parser-contract-check attic-nar-integrity-contract-check rustfs-repair-surface-contract-check rustfs-admin-status-contract-check rustfs-heal-semantics-contract-check rustfs-bucket-meta-semantics-contract-check rustfs-trusted-publication-gate-contract-check attic-backend-replacement-package-contract-check rustfs-upgrade-topology-candidate-contract-check rustfs-upgrade-topology-proof-plan-contract-check rustfs-upgrade-topology-plan-guard-contract-check bazel-external-fetch-authority bazel-repository-cache-evidence-contract-check bazel-http-archive-pins-check bazel-external-input-manifest-check bazel-external-input-distdir-check bazel-distdir-coverage-contract-check bazel-distdir-mirror-package-contract-check bazel-distdir-mirror-restore-contract-check bazel-distdir-full-package-proof-contract-check bazel-external-input-authority-contract-check bazel-external-input-authority-package-contract-check bazel-distdir-mirror-github-readiness-contract-check e3-external-input-authority-status-contract-check bazel-distdir-mirror-live-proof-contract-check bazel-vendor-mode-canary-contract-check bazel-external-fetch-authority-self-test bazel-lockfile-contract-check bazel-lockfile-check ha-state-candidate-inventory-contract-check ha-state-authority-truth-contract-check ha-state-candidate-static-gate-contract-check ha-state-selected-candidate-contract-check ha-state-endpoint-package-contract-check ha-state-endpoint-readiness-contract-check ha-state-github-secret-readiness-contract-check ha-state-candidate-proof-contract-check k8s-secret-last-applied-audit-contract-check arc-runner-rehome-manifest-check orgwide-enrollment-scoreboard-contract-check orgwide-enrollment-queue-contract-check arc-diagnostic-self-tests arc-source-cap-targets-check arc-local-apply-source-guard-check kubelet-imagefs-capacity-audit-self-test spoke-onboarding-contract-check consumers-onboarding-contract-check org-tenant-registry-contract-check consumer-registry-writeback-contract-check codeowners-registry-contract-check gf-reapi-cell-lease-gc-reconcile-check
@echo "All checks passed!"
# Validate markdown cross-references resolve to real files
check-links:
@node scripts/check-links.js --mode markdown
# Validate the future public docs package manifest and scrub rules
check-public-docs:
@node scripts/generate-public-docs-reference.js check
@node scripts/public-docs-export.js check
# Validate source-repo dogfood contract drift stays classified
dogfood-contract-audit:
@node scripts/dogfood-contract-audit.js
# Prove the dogfood audit catches hosted scalar, block-list, matrix, and exception drift
dogfood-contract-audit-self-test:
@bash ./tests/dogfood_contract_audit.sh
# Validate ARC auth secret dry-run output never prints credential material
arc-auth-secret-redaction-contract-check:
@bash ./tests/arc_auth_secret_redaction_contract.sh
# Validate the BCR/RBE/RustFS product reality review stays grounded
product-reality-review-check:
@python3 ./scripts/validate-product-reality-review.py
# Validate the repo still proves Bazel remote cache, not remote execution
rbe-boundary-check:
@python3 ./scripts/validate-rbe-boundary.py
# Validate CAS/distdir storage provider docs do not select Civo or a default provider
rbe-storage-provider-boundary-check:
@python3 ./scripts/validate-rbe-storage-provider-boundary.py
# Validate the explicit, non-default RBE proof wrapper contract
rbe-proof-contract-check:
@bash ./tests/rbe_proof_wrapper_contract.sh
# Validate target-class eligibility before expanding RBE claims
rbe-target-eligibility-check:
@bash ./tests/rbe_target_eligibility_contract.sh
# Validate Linux and Darwin RBE platform identities and boundaries
rbe-platform-contracts-check:
@bash ./tests/rbe_platform_contracts.sh
# Validate the spoke registry against the spoke-* module contract (W4.5)
spoke-onboarding-contract-check:
@bash ./tests/spoke_onboarding_contract.sh
# Validate the RBE/image consumer registry-of-record (config/consumer-registry.json)
consumers-onboarding-contract-check:
@bash ./tests/consumer_onboarding_contract.sh
# Validate the schema-only org tenant registry for future org-grained tenancy (TIN-2364)
org-tenant-registry-contract-check:
@bash ./tests/org_tenant_registry_contract.sh
# Validate the consumer-registry write-back latch contract (TIN-2212): offline
# fixture battery with a stubbed gh (happy path, idempotency, stale-run and
# absent-entry refusals, cache-hits-only mode, red run).
consumer-registry-writeback-contract-check:
@bash ./tests/consumer_registry_writeback_contract.sh
# Assert .github/CODEOWNERS exists and owner-gates both credential-granting
# registries (D6, TIN-2212) — keeps the "CODEOWNERS-gated registry entry"
# claim in the enrollment governance docs machine-true.
codeowners-registry-contract-check:
@bash ./tests/codeowners_registry_contract.sh
# Register / re-validate an RBE/image consumer: edit config/consumer-registry.json
# to add your entry, then run this. Static, GF-core-only; live reality is
# confirmed by `just flywheel-enroll-verify` in the implementation overlay.
flywheel-enroll-register:
@python3 ./scripts/validate-consumer-registry.py --self-test
@python3 ./scripts/validate-consumer-registry.py
@echo "Registered consumers:"
@python3 -c "import json; [print(' -', c['github_repository'], '->', c['runner_class'], '/', c['image_repository']) for c in json.load(open('config/consumer-registry.json'))['consumers']]"
# Register / re-validate a schema-only org tenant. This does not grant runtime
# exchange/cell authority; it only records explicit future org tenancy.
flywheel-org-tenant-register:
@python3 ./scripts/validate-org-tenant-registry.py --self-test
@python3 ./scripts/validate-org-tenant-registry.py
@echo "Registered org tenants:"
@python3 -c "import json; [print(' -', t['tenant_id'], '->', t['github_owner'], '/', t['migration_stage'], '/', 'runtime=' + str(t['runtime_grants_enabled']).lower()) for t in json.load(open('config/org-tenant-registry.json'))['tenants']]"
# Latch observed enrollment reality from a finished run (green conclusion +
# parsed Bazel remote counts) onto the matching registry entry (TIN-2212).
# Auto-detects the run's repo across config/consumer-registry.json and
# config/spoke-registry.json (D1: spokes latch on their spoke entry). Never
# creates or edits intent fields — the entry must already exist. Idempotent
# per run id; refuses runs older than the recorded latch.
flywheel-enroll-writeback run_url:
@python3 ./scripts/consumer-registry-writeback.py --run-url "{{run_url}}"
@python3 ./scripts/validate-consumer-registry.py
@python3 ./scripts/validate-spoke-registry.py
# Latch a fresh-repo enrollment proof onto the DISPATCHED consumer's registry
# entry (TIN-2126). The proof runs in this repo's Actions but proves the
# consumer named by its run title ('Fresh enroll <owner/repo>@<ref>'); the
# latch records the host under proof_repository. Same contract as
# flywheel-enroll-writeback otherwise.
flywheel-enroll-writeback-consumer run_url entry_repo:
@python3 ./scripts/consumer-registry-writeback.py --run-url "{{run_url}}" --entry-repo "{{entry_repo}}"
@python3 ./scripts/validate-consumer-registry.py
@python3 ./scripts/validate-spoke-registry.py
# Validate the current RBE worker image and toolchain model boundary
rbe-worker-toolchain-model-contract-check:
@bash ./tests/rbe_worker_toolchain_model_contract.sh
# Validate the pinned Chapel candidate closure in the shared Linux worker image
gf-reapi-cell-chapel-contract-check:
@bash ./tests/gf_reapi_cell_chapel_contract.sh
# Validate the browser runtime authority contract for web RBE proofs
browser-runtime-authority-contract-check:
@bash ./tests/browser_runtime_authority_contract.sh
# Validate the public web RBE candidate template and guide
web-rbe-candidate-template-contract-check:
@bash ./tests/web_rbe_candidate_template_contract.sh
# Validate opt-in ARC runner executor endpoint wiring
arc-runner-executor-endpoint-contract-check:
@bash ./tests/arc_runner_executor_endpoint_contract.sh
# Validate the explicit gf-rbe REAPI proof manifest boundary
gf-reapi-cell-manifest-check:
@bash ./tests/gf_reapi_cell_manifest_contract.sh
# Validate the token-enforced, routable gf-reapi-cell cache front-door gate
gf-reapi-cache-frontdoor-contract-check:
@bash ./tests/gf_reapi_cache_frontdoor_contract.sh
# Validate gf-reapi-cell proof-window residency and runner-capacity boundary
gf-reapi-cell-capacity-policy-check:
@bash ./tests/gf_reapi_cell_capacity_policy_contract.sh
# Validate the first gf-reapi-cell tenant fairness operator dashboard contract
gf-reapi-fairness-dashboard-contract-check:
@bash ./tests/gf_reapi_fairness_dashboard_contract.sh
# Validate the first runner-side TTFCH probe and dashboard contract
gf-runner-ttfch-probe-contract-check:
@bash ./tests/gf_runner_ttfch_probe_contract.sh
# Validate the app image still uses the current rules_img package-load contract.
bazel-app-image-contract-check:
@bash ./tests/bazel_app_image_contract.sh
# Validate the reusable nix2container adapter-node image builder for nix-only spokes.
nix2container-adapter-node-image-contract-check:
@bash ./tests/nix2container_adapter_node_image_contract.sh
# Validate gf-reapi-cell image publication and manifest rendering boundary
gf-reapi-cell-publish-contract-check:
@bash ./tests/gf_reapi_cell_publish_contract.sh
# Validate gf-reapi-cell GHCR digest resolution for proof dispatch inputs
gf-reapi-cell-digest-resolver-contract-check:
@bash ./tests/gf_reapi_cell_digest_resolver_contract.sh
# Validate the explicit gf-reapi-cell live proof harness boundary
gf-reapi-cell-proof-contract-check:
@bash ./tests/gf_reapi_cell_proof_contract.sh
# Validate the Darwin-specific proof dispatch/readiness wrapper
darwin-rbe-proof-dispatch-contract-check:
@bash ./tests/darwin_rbe_proof_dispatch_contract.sh
# Validate the Darwin proof readiness preflight
darwin-rbe-proof-readiness-contract-check:
@bash ./tests/darwin_rbe_proof_readiness_contract.sh
# Check Darwin proof inputs and render the dry-run dispatch command
darwin-rbe-proof-readiness *args:
@bash ./scripts/check-darwin-rbe-proof-readiness.sh {{args}}
# Validate client-lease vs GC-TTL reconciliation (W1.3)
gf-reapi-cell-lease-gc-reconcile-check:
@bash ./tests/gf_reapi_cell_lease_gc_reconcile_contract.sh
# Prove the gf-reapi-cell S3 backend against a real MinIO server (SigV4 + full
# CAS round-trip). Opt-in / not in `check`: spins a throwaway MinIO via nix.
gf-reapi-cell-s3-minio-proof:
cd services/gf-reapi-cell && \
GF_REAPI_MINIO_BIN="$(nix build --no-link --print-out-paths nixpkgs#minio)/bin/minio" \
go test -tags minio_integration ./internal/cell/ -run MinIO -count=1 -v
# Resolve the immutable published gf-reapi-cell image digest from GitHub Packages
gf-reapi-cell-resolve-digest *args:
@bash ./scripts/resolve-gf-reapi-cell-digest.sh {{args}}
# Validate downloaded gf-reapi-cell proof artifact evidence
gf-reapi-cell-proof-artifact-contract-check:
@bash ./tests/gf_reapi_cell_proof_artifact_contract.sh
# Validate hosted proof artifact download + verification handoff
gf-reapi-proof-artifact-download-contract-check:
@bash ./tests/gf_reapi_proof_artifact_download_contract.sh
# Download and verify a hosted GF REAPI Cell Proof artifact
gf-reapi-proof-artifact-download *args:
@bash ./scripts/download-gf-reapi-proof-artifact.sh {{args}}
# Validate surgical gf-reapi-cell action-cache invalidation and rollback
gf-reapi-ac-nuke-key-contract-check:
@bash ./tests/gf_reapi_ac_nuke_key_contract.sh
# Validate the W2.5 gf-reapi-cell AC writer-attestation chaos gate
gf-reapi-ac-attestation-chaos-check:
@bash ./tests/gf_reapi_cell_ac_attestation_chaos.sh
# Test the minimal GF-owned REAPI proof cell
gf-reapi-cell-test:
@cd services/gf-reapi-cell && go test ./...
# Mint a short-lived gf-reapi-cell JWT/profile from GitHub OIDC without
# printing bearer tokens.
gf-reapi-token-exchange *args:
@nix run .#gf-reapi-token-exchange -- {{args}}
# Run the explicit RBE proof wrapper. Requires operator-provided proof env.
bazel-rbe-proof *args:
@bash ./scripts/bazel-rbe-proof.sh {{args}}
# Run or render the explicit gf-reapi-cell proof harness
gf-reapi-cell-proof *args:
@bash ./scripts/run-gf-reapi-cell-proof.sh {{args}}
# Dispatch or render the hosted GF REAPI Cell Proof workflow
gf-reapi-cell-proof-dispatch *args:
@bash ./scripts/dispatch-gf-reapi-cell-proof.sh {{args}}
# Dry-run or execute a surgical gf-reapi-cell action-cache nuke-key drill
gf-reapi-ac-nuke-key *args:
@python3 ./scripts/gf-reapi-ac-nuke-key.py {{args}}
# Validate devshell Bazel resolves through Bazelisk and .bazelversion.
bazel-devshell-authority-check:
@python3 ./scripts/validate-bazel-devshell-authority.py
# Validate the developer-machine and package-cache exposure policy boundary.
bazel-cache-exposure-policy-check:
@bash ./tests/bazel_cache_exposure_policy.sh
# Audit bazel-remote CAS decoded payload digest integrity.
bazel-remote-cache-cas-integrity-audit *args:
@python3 ./scripts/bazel-remote-cache-cas-integrity-audit.py {{args}}
# Validate the bazel-remote CAS integrity audit contract.
bazel-remote-cache-cas-integrity-contract-check:
@bash ./tests/bazel_remote_cache_cas_integrity_contract.sh
# Validate public pilot workflow examples stay cache-backed and write-gated.
pilot-workflow-contract-check:
@bash ./tests/pilot_workflow_template_contract.sh
# Validate the opt-in executor-backed Bazel wrapper contract.
bazel-executor-backed-contract-check:
@bash ./tests/bazel_executor_backed_contract.sh
# Validate mode-separated Bazel benchmark evidence generation.
bazel-benchmark-modes-contract-check:
@bash ./tests/bazel_benchmark_modes_contract.sh
# Validate the copied consumer Bazel wrapper's cache/fetch/input wiring.
consumer-bazel-wrapper-contract-check:
@bash ./tests/consumer_bazel_wrapper_contract.sh
# Validate the consumer Bazel environment profile materializer.
flywheel-consumer-env-contract-check:
@bash ./tests/flywheel_consumer_env_contract.sh
# Validate the fleet-managed non-secret profile distribution contract.
flywheel-profile-distribution-contract-check:
@bash ./tests/flywheel_profile_distribution_contract.sh
# Validate the enroll/doctor/verify front-door classification contract.
flywheel-enrollment-frontdoor-contract-check:
@bash ./tests/flywheel_enrollment_frontdoor_contract.sh
# Validate the hosted GitHub OIDC token-exchange profile helper.
flywheel-github-oidc-profile-contract-check:
@bash ./tests/flywheel_github_oidc_profile_contract.sh
# Validate the distributable consumer front-door kit.
flywheel-frontdoor-kit-contract-check:
@bash ./tests/flywheel_frontdoor_kit_contract.sh
# Explain the current GloriousFlywheel enrollment/profile state.
flywheel-doctor *args:
@bash ./scripts/flywheel-doctor.sh {{args}}
# Fail unless the current shell is attached or explicitly in local-proof mode.
flywheel-verify *args:
@bash ./scripts/flywheel-verify.sh {{args}}
# Materialize a fallback .env.flywheel.local profile for a consumer repo.
flywheel-enroll profile *args:
@bash ./scripts/flywheel-enroll.sh "{{profile}}" {{args}}
# Exchange GitHub Actions OIDC for a short-lived gf-reapi-cell profile.
flywheel-github-oidc-profile *args:
@bash ./scripts/flywheel-github-oidc-profile.sh {{args}}
# Materialize a non-secret GloriousFlywheel consumer Bazel environment profile.
flywheel-consumer-env profile *args:
@bash ./scripts/flywheel-consumer-env.sh "{{profile}}" {{args}}
# Validate .agents/skills/<name>/SKILL.md contracts (frontmatter, 1536-char
# description cap, body length) and the .claude/skills symlink mirror.
skills-validate:
@python3 ./scripts/validate-skills.py
@for link in .claude/skills/*; do \
name="$(basename "$link")"; \
if [ ! -L "$link" ] || [ ! -f "$link/SKILL.md" ]; then \
echo "FAIL $name: .claude/skills/$name must be a symlink resolving to .agents/skills/$name" >&2; exit 1; \
fi; \
if [ ! -d ".agents/skills/$name" ]; then \
echo "FAIL $name: symlink exists but .agents/skills/$name does not" >&2; exit 1; \
fi; \
done
@for skill in .agents/skills/*/; do \
name="$(basename "$skill")"; \
if [ ! -L ".claude/skills/$name" ]; then \
echo "FAIL $name: missing .claude/skills/$name symlink" >&2; exit 1; \
fi; \
done
@echo "skills symlink mirror OK"
# List the published agent skills.
skills-list:
@ls -1 .agents/skills/
# Validate the developer cache attachment helper does not false-positive.
dev-attach-contract-check:
@bash ./tests/dev_attach_contract.sh
# Validate the trusted KVM cache prewarm boundary.
kvm-cache-prewarm-contract-check:
@bash ./tests/kvm_cache_prewarm_contract.sh
# Validate the KVM runner capacity policy boundary.
kvm-capacity-policy-contract-check:
@bash ./tests/kvm_capacity_policy_contract.sh
# Validate RustFS/OpenEBS restart hygiene stays bounded.
rustfs-openebs-restart-hygiene-contract-check:
@bash ./tests/rustfs_openebs_restart_hygiene.sh
# Validate RustFS lifecycle jobs keep credentials out of rendered pod args.
rustfs-lifecycle-secret-contract-check:
@bash ./tests/rustfs_lifecycle_secret_contract.sh
# Validate live honey state keys stay explicit and fail closed elsewhere.
tofu-state-contract-check:
@bash ./tests/tofu_state_contract.sh
# Validate bucket-only RustFS RCA mode handles no required state keys.
rustfs-bucket-index-rca-empty-state-keys-contract-check:
@bash ./tests/rustfs_bucket_index_rca_empty_state_keys.sh
# Validate RustFS S3 list-buckets parsing only accepts real Bucket/Name entries.
rustfs-state-authority-parser-contract-check:
@bash ./tests/rustfs_state_authority_check_parser.sh
# Validate Attic NAR integrity failure reporting.
attic-nar-integrity-contract-check:
@bash ./tests/attic_nar_integrity_contract.sh
# Validate RustFS repair-surface inventory stays read-only and truth-preserving.
rustfs-repair-surface-contract-check:
@bash ./tests/rustfs_repair_surface_contract.sh
# Validate RustFS admin status probing stays read-only and truth-preserving.
rustfs-admin-status-contract-check:
@bash ./tests/rustfs_admin_status_contract.sh
# Validate RustFS heal semantics audit stays source-only and truth-preserving.
rustfs-heal-semantics-contract-check:
@bash ./tests/rustfs_heal_semantics_contract.sh
# Validate RustFS bucket-metadata admin audit stays source-only and truth-preserving.
rustfs-bucket-meta-semantics-contract-check:
@bash ./tests/rustfs_bucket_meta_semantics_contract.sh
# Validate the TIN-1147 trusted Attic publication backend gate.
rustfs-trusted-publication-gate-contract-check:
@bash ./tests/rustfs_trusted_publication_gate_contract.sh
# Validate the static TIN-1147 trusted Attic publication backend gate.
rustfs-trusted-publication-gate-check *args:
@python3 ./scripts/validate-rustfs-trusted-publication-gate.py {{args}}
# Validate a non-secret TIN-1147 Attic backend replacement package.
attic-backend-replacement-package-gate *args:
@python3 ./scripts/attic-backend-replacement-package-gate.py {{args}}
# Write an intentionally non-live TIN-1147 Attic backend replacement package template.
attic-backend-replacement-package-template output="attic-backend-replacement-package.json":
@python3 ./scripts/attic-backend-replacement-package-gate.py --write-template {{output}}
# Offline guard test for the TIN-1147 Attic backend replacement package gate.
attic-backend-replacement-package-self-test:
@python3 ./scripts/attic-backend-replacement-package-gate.py --self-test
# Validate TIN-1147 Attic backend replacement package gate wiring.
attic-backend-replacement-package-contract-check:
@bash ./tests/attic_backend_replacement_package.sh
# Validate the RustFS upgrade-topology candidate packet.
rustfs-upgrade-topology-candidate-contract-check:
@bash ./tests/rustfs_upgrade_topology_candidate_contract.sh
# Validate the static RustFS upgrade-topology candidate packet.
rustfs-upgrade-topology-candidate-check *args:
@python3 ./scripts/validate-rustfs-upgrade-topology-candidate.py {{args}}
# Validate the RustFS upgrade-topology proof-plan contract.
rustfs-upgrade-topology-proof-plan-contract-check:
@bash ./tests/rustfs_upgrade_topology_proof_plan_contract.sh
# Validate the static RustFS upgrade-topology proof plan.
rustfs-upgrade-topology-proof-plan-check *args:
@python3 ./scripts/validate-rustfs-upgrade-topology-proof-plan.py {{args}}
# Validate the RustFS upgrade-topology saved-plan guard wiring.
rustfs-upgrade-topology-plan-guard-contract-check:
@bash ./tests/rustfs_upgrade_topology_plan_guard_contract.sh
# Guard a saved tofu show -json plan for the RustFS upgrade-topology attempt.
rustfs-upgrade-topology-plan-guard plan_json="":
#!/usr/bin/env bash
set -euo pipefail
if [ -n "{{plan_json}}" ]; then
python3 ./scripts/rustfs-upgrade-topology-plan-guard.py "{{plan_json}}"
else
python3 ./scripts/rustfs-upgrade-topology-plan-guard.py
fi
# Report Bazel external repository/archive fetch authority separately from the
# remote action cache contract.
bazel-external-fetch-authority *args:
@bash ./scripts/external-fetch-authority.sh {{args}}
# Summarize run-local Bazel repository-cache population evidence.
bazel-repository-cache-evidence *args:
@python3 ./scripts/bazel-repository-cache-evidence.py {{args}}
# Render the Bazel external input lockfile manifest.
bazel-external-input-manifest *args:
@python3 ./scripts/external-input-manifest.py {{args}}
# Render locked Nix flake source archive inputs.
nix-flake-source-input-manifest *args:
@python3 ./scripts/flake-source-input-manifest.py {{args}}
# Validate the Nix flake source input authority contract.
nix-flake-source-input-authority *args:
@python3 ./scripts/validate-nix-flake-source-authority.py {{args}}
# Package already-materialized Nix flake source archives into the provider-neutral mirror layout.
nix-flake-source-mirror-package *args:
@python3 ./scripts/nix-flake-source-mirror-package.py package {{args}}
# Verify a provider-neutral Nix flake source mirror package root.
nix-flake-source-mirror-verify *args:
@python3 ./scripts/nix-flake-source-mirror-package.py verify {{args}}
# Restore a Nix flake source archive root from a provider-neutral mirror package root.
nix-flake-source-mirror-restore *args:
@python3 ./scripts/nix-flake-source-mirror-package.py restore {{args}}
# Validate a non-secret Nix flake source authority package.
nix-flake-source-authority-package-gate *args:
@python3 ./scripts/nix-flake-source-authority-package-gate.py {{args}}
# Write an intentionally non-live Nix flake source authority package template.
nix-flake-source-authority-package-template output="nix-flake-source-authority-package.json":
@python3 ./scripts/nix-flake-source-authority-package-gate.py --write-template {{output}}
# Offline guard test for the Nix flake source authority package gate.
nix-flake-source-authority-package-self-test:
@python3 ./scripts/nix-flake-source-authority-package-gate.py --self-test
# Materialize a verified Bazel distdir from the candidate input manifest.
bazel-external-input-distdir *args:
@python3 ./scripts/materialize-bazel-distdir.py {{args}}
# Validate the Bazel distdir source-proof coverage contract.
bazel-distdir-coverage *args:
@python3 ./scripts/validate-bazel-distdir-coverage.py {{args}}
# Package a verified local distdir into the provider-neutral durable-mirror layout.
bazel-distdir-mirror-package *args:
@python3 ./scripts/bazel-distdir-mirror-package.py package {{args}}
# Verify a provider-neutral durable-mirror package root.
bazel-distdir-mirror-verify *args:
@python3 ./scripts/bazel-distdir-mirror-package.py verify {{args}}
# Restore a Bazel distdir from a provider-neutral durable-mirror package root.
bazel-distdir-mirror-restore *args:
@python3 ./scripts/bazel-distdir-mirror-package.py restore {{args}}
# Validate the durable Bazel external input authority contract.
bazel-external-input-authority *args:
@python3 ./scripts/validate-bazel-external-input-authority.py {{args}}
# Validate a non-secret Bazel external-input authority package.
bazel-external-input-authority-package-gate *args:
@python3 ./scripts/bazel-external-input-authority-package-gate.py {{args}}
# Write an intentionally non-live Bazel external-input authority package template.
bazel-external-input-authority-package-template output="bazel-external-input-authority-package.json":
@python3 ./scripts/bazel-external-input-authority-package-gate.py --write-template {{output}}
# Offline guard test for the Bazel external-input authority package gate.
bazel-external-input-authority-package-self-test:
@python3 ./scripts/bazel-external-input-authority-package-gate.py --self-test
# Validate the Bazel external input lockfile manifest guard.
bazel-external-input-manifest-check:
@bash ./tests/bazel_external_input_manifest.sh
# Validate the Bazel external input distdir materializer guard.
bazel-external-input-distdir-check:
@bash ./tests/bazel_external_input_distdir.sh
# Validate the Bazel distdir source-proof coverage contract.
bazel-distdir-coverage-contract-check:
@bash ./tests/bazel_distdir_coverage_contract.sh
# Validate the provider-neutral Bazel distdir mirror package primitive.
bazel-distdir-mirror-package-contract-check:
@bash ./tests/bazel_distdir_mirror_package_contract.sh
# Validate restored Bazel --distdir proof from a provider-neutral mirror package.
bazel-distdir-mirror-restore-contract-check:
@bash ./tests/bazel_distdir_mirror_restore_contract.sh
# Run the TIN-1468 full-candidate distdir package/restore proof. This is
# intentionally not part of `just check`; use the contract check there so local
# validation stays bounded.
bazel-distdir-full-package-proof:
@bash ./scripts/bazel-distdir-full-package-proof.sh
# Validate TIN-1468 full-candidate distdir package proof workflow and docs wiring.
bazel-distdir-full-package-proof-contract-check:
@bash ./tests/bazel_distdir_full_package_proof_contract.sh
# Validate the durable Bazel external input authority contract.
bazel-external-input-authority-contract-check:
@bash ./tests/bazel_external_input_authority_contract.sh
# Validate the Nix flake source input authority contract.
nix-flake-source-input-authority-contract-check:
@bash ./tests/nix_flake_source_input_authority.sh
# Validate the Nix flake source mirror package/restore primitive.
nix-flake-source-mirror-package-contract-check:
@bash ./tests/nix_flake_source_mirror_package_contract.sh
# Validate the Nix flake source authority package gate wiring.
nix-flake-source-authority-package-contract-check:
@bash ./tests/nix_flake_source_authority_package.sh
# Validate the Bazel external-input authority package gate wiring.
bazel-external-input-authority-package-contract-check:
@bash ./tests/bazel_external_input_authority_package.sh
# Prove a validated mirror package through the selected live S3-compatible
# external-input authority. This is intentionally not part of `just check`; use
# the contract check there so local validation stays bounded.
bazel-distdir-mirror-live-proof *args:
@python3 ./scripts/bazel-distdir-mirror-live-proof.py {{args}}
# Check the non-secret package and scoped env readiness before spending the
# full package/proof runtime. This writes redacted evidence and fails closed
# unless all required live-proof env names are present and match the package.
bazel-distdir-mirror-live-readiness *args:
@python3 ./scripts/bazel-distdir-mirror-live-readiness.py {{args}}
# Check visible GitHub variable/secret names for TIN-1468 live-proof injection.
bazel-distdir-mirror-github-readiness *args:
@python3 ./scripts/bazel-distdir-mirror-github-readiness.py {{args}}
# Render the read-only E3 external-input authority close-gate status.
e3-external-input-authority-status *args:
@python3 ./scripts/e3-external-input-authority-status.py {{args}}
# Validate E3 external-input authority status wiring and offline fixtures.
e3-external-input-authority-status-contract-check:
@bash ./tests/e3_external_input_authority_status.sh
# Validate TIN-1468 live mirror proof wiring and static safety boundaries.
bazel-distdir-mirror-live-proof-contract-check:
@bash ./tests/bazel_distdir_mirror_live_proof_contract.sh
# Validate TIN-1468 GitHub variable/secret-name readiness classification.
bazel-distdir-mirror-github-readiness-contract-check:
@bash ./tests/bazel_distdir_mirror_github_readiness.sh
# Run the W3.4 Bazel vendor-mode canary. This is intentionally not part of
# `just check`; use the contract check there so local validation stays bounded.
bazel-vendor-mode-canary:
@bash ./scripts/gf-bazel-vendor-mode-canary.sh
# Validate W3.4 vendor-mode canary workflow, script, and docs wiring.
bazel-vendor-mode-canary-contract-check:
@bash ./tests/bazel_vendor_mode_canary_contract.sh
# Run offline fixture tests for Bazel external fetch authority and wrapper args.
bazel-external-fetch-authority-self-test:
@bash ./tests/bazel_external_fetch_authority.sh
# Validate W3.3 repository-cache evidence generation.
bazel-repository-cache-evidence-contract-check:
@bash ./tests/bazel_repository_cache_evidence.sh
# Validate direct Bazel http_archive/http_file calls declare non-empty sha256.
bazel-http-archive-pins-check:
@bash ./tests/bazel_http_archive_pins_contract.sh
@python3 ./scripts/validate-bazel-http-archive-pins.py
# Validate MODULE.bazel.lock is present, tracked, well-formed, and current.
bazel-lockfile-check:
@bash ./scripts/validate-bazel-lockfile.sh
# Validate MODULE.bazel.lock checker stale-vs-unavailable behavior.
bazel-lockfile-contract-check:
@bash ./tests/bazel_lockfile_check_contract.sh
# Report whether the private repo can safely become public as-is
public-alpha-visibility-report:
@node scripts/public-alpha-visibility-gate.js report
# Fail until direct repository visibility blockers are resolved
public-alpha-visibility-strict:
@node scripts/public-alpha-visibility-gate.js strict
# Regenerate structured public-docs references
public-docs-generate:
@node scripts/generate-public-docs-reference.js write
# Materialize the scrubbed future public docs package
public-docs-export out=".public-docs-export":
@node scripts/public-docs-export.js write --out {{out}}
# Validate the scrubbed public-alpha mirror seed
public-alpha-export-check:
@node scripts/public-docs-export.js check --manifest config/public-alpha-export.json
# Materialize the scrubbed public-alpha mirror seed with fresh-history instructions
public-alpha-export out=".public-alpha-export":
@node scripts/public-docs-export.js write --manifest config/public-alpha-export.json --out {{out}}
# Full validation including Nix flake checks and tofu validation.
check-full: check nix-check tofu-validate-all
@echo "Full validation complete!"
# Full development cycle: check + build
dev: check nix-build
@echo "Development build complete!"
# Show current environment configuration
info:
#!/usr/bin/env bash
set -euo pipefail
ACTIVE_KUBE_CONTEXT="${KUBE_CONTEXT:-{{kube_context}}}"
ACTIVE_GITLAB_API="{{gitlab_api}}"
ACTIVE_GITLAB_PROJECT="{{gitlab_project}}"
ACTIVE_BAZEL_MODE="${GF_BAZEL_SUBSTRATE_MODE:-compatibility-local-only}"
LOCAL_BACKEND_COUNT="$(find config/backends -maxdepth 1 -name '*.hcl' 2>/dev/null | wc -l | tr -d ' ')"
echo "Environment Configuration"
echo "========================="
echo "ENV: {{env}}"
echo "Kube Context: ${ACTIVE_KUBE_CONTEXT:-unset}"
echo "Ingress: {{ingress_domain}}"
echo "GitLab API: ${ACTIVE_GITLAB_API:-unset}"
echo "Project ID: ${ACTIVE_GITLAB_PROJECT:-unset}"
echo
echo "Backend Initialization"
echo "======================"
if [ -n "${TOFU_BACKEND_CONFIG_FILE:-}" ]; then
echo "Config file: ${TOFU_BACKEND_CONFIG_FILE}"
elif [ -n "${TOFU_BACKEND_CONFIG_DIR:-}" ]; then
echo "Config dir: ${TOFU_BACKEND_CONFIG_DIR}"
elif [ "${LOCAL_BACKEND_COUNT:-0}" -gt 0 ]; then
echo "Auto local files: ${LOCAL_BACKEND_COUNT} file(s) under config/backends"
elif [ -n "${TOFU_BACKEND_S3_ENDPOINT:-}" ] && [ -n "${TOFU_BACKEND_S3_BUCKET:-}" ]; then
echo "S3 env path: ${TOFU_BACKEND_S3_ENDPOINT} (${TOFU_BACKEND_S3_BUCKET})"
elif [ -n "${TF_HTTP_ADDRESS:-}" ]; then
echo "TF_HTTP_ADDRESS: ${TF_HTTP_ADDRESS} (legacy compatibility path)"
elif [ -n "${TF_HTTP_PASSWORD:-}" ]; then
echo "Legacy GitLab: TF_HTTP_PASSWORD configured"
else
echo "Backend: not configured"
fi
echo "Active stacks: backend \"s3\" on environment-owned honey state"
echo
echo "Bazel Substrate"
echo "==============="
echo "Mode: ${ACTIVE_BAZEL_MODE}"
if [ -n "${BAZEL_REMOTE_CACHE:-}" ]; then
echo "Remote cache: ${BAZEL_REMOTE_CACHE}"
else
echo "Remote cache: unset"
echo "Contract note: just bazel-build-cached requires a real shared cache endpoint"
fi
if [ -n "${BAZEL_REMOTE_EXECUTOR:-}" ]; then
echo "Remote executor: ${BAZEL_REMOTE_EXECUTOR}"
else
echo "Remote executor: unset"
fi
echo "Contract check: just cache-contract"
echo
echo "Local Files"
echo "==========="
if [ -f .env ]; then
echo ".env file: exists ✓"
else
echo ".env file: missing (run 'just setup')"
fi
if [ -f config/organization.yaml ]; then
echo "organization.yaml: exists ✓"
else
echo "organization.yaml: missing (copy config/organization.example.yaml)"
fi
# Classify cache attachment without contacting services or running Bazel
cache-contract:
@scripts/cache-attachment-contract.sh
# Require a real Bazel remote-cache endpoint for cache-backed dogfood
cache-contract-strict:
@scripts/cache-attachment-contract.sh --strict
# Require local Nix to trust the configured Attic cache
cache-contract-nix-strict:
@scripts/cache-attachment-contract.sh --strict-nix
# Prove developer-machine shared-cache attachment with a bounded Bazel target.
# Defaults to read-only cache use; pass upload=true for trusted cache writes.
developer-cache-attachment-proof target="//:deployment_bundle" upload="false":
@GF_DEVELOPER_CACHE_PROOF_UPLOAD="{{upload}}" bash ./scripts/developer-cache-attachment-proof.sh "{{target}}"
gf-hit-gate-contract-check:
@bash ./tests/gf_hit_gate_contract.sh
# Alpha self-service developer cache attachment helper.
# Shows current state, prints actionable next steps if incomplete, optionally
# runs a bounded proof. Operator help still expected for endpoint provisioning.
# Pass --proof to exercise the cache against //:deployment_bundle when attached.
dev-attach *args:
@bash ./scripts/dev-attach.sh {{args}}
# =============================================================================
# Nix Commands
# =============================================================================
# Build Nix flake against the shared cache-backed substrate (local execution
# still occurs on cache miss)
nix-build:
nix build
# Build OCI container image
nix-build-container:
nix build .#container
# Build all Nix outputs against the same shared cache-backed substrate
nix-build-all:
nix build .#attic-client
nix build .#attic-server
nix build .#container
nix build .#attic-gc-image
# Run full Nix flake checks. This may build heavyweight Attic/container closures.
nix-check:
nix flake check
# Update flake inputs
nix-update:
nix flake update
# Show flake outputs
nix-show:
nix flake show
# Fallback devshell entrypoint when not using direnv
nix-shell:
nix develop
# Format Nix files