Skip to content

g8e v1.6.5

Choose a tag to compare

@github-actions github-actions released this 27 Jul 12:05
Immutable release. Only release title and notes can be modified.
aa1a9dd

[1.6.5] - 2026-07-26

Overview

Dead code removal across the codebase using the deadcode analyzer (golang.org/x/tools/cmd/deadcode). 107 unreachable functions were removed from production and test code across 9 phases. 91 functions were retained as false positives (cross-package test callers, build-tagged test files, defense-in-depth APIs, and future infrastructure). The publisherstest/ test helper package was deleted entirely (zero external consumers). All tests pass with no coverage regression.

Removed

  • Gateway services (Phase 2, 16 functions) — VerifyCLICertificate, GatewaySchema, CanonicalDBService.GetDB, CanonicalDBService.Wait, HTTPHandler.readBody, isPrivateIP, isSafeHost, gatewayServiceBuilder.withPreBuiltDB, gatewayServiceBuilder.withPreBuiltPubsub, newGatewayModeServiceForTest, GatewayModeService.GetDB, GatewayModeService.GetPKIAuthority, GatewayModeService.IsRunning, decodeCredID, newReplayStoreServiceWithDB, NewSecretManagerWithKeystore. Also removed preBuiltDB, preBuiltStores, preBuiltPubsub fields from gatewayServiceBuilder.
  • CLI packages (Phase 3, 17 functions) — NewSecureHTTPClient, FetchRootCAFingerprint, TrustRootCAInWindowsStore (both platforms), readDoctrineRule (+ DoctrineRule/DoctrineFile types), handleToolsList, handleToolsCall, createMCPClient, expandPath, LoadWithPaths, resolveInfraPaths, SetEndpointOverrideWithPort, ProcessManager.Reset, EmitPipeline, EmitLedger, EmitConsensus, postureNameFromChoice, yesNo.
  • Governance services (Phase 4, 5 functions + 1 type) — L1Doctrine.aggregateThreatLevel, L1Doctrine.calculateRiskScore, NewCLIL3Notary, cliNotary.VerifyL3Proof, cliNotary struct, TribunalStoreAdapter struct + GetConsensusPolicy method. TribunalStoreAdapter moved to test-only tribunalStoreTestAdapter in test files.
  • Scattered services (Phase 5, 14 functions) — G8eoService.SetPubSubClient, G8eoService.SetKeystore, SanitizeURL, FileEditService.validateFilePath, ParseFieldPath, NewNativeToolHandlerWithRegistry, SetPrivateIPAllowlist, HashString, IsDuplicateColumnError, CommitmentLedger.GetLatestCommitmentJSON, GetLocalIP (both platforms), FixedClock struct + NewFixedClock. Also renamed 3 setStatfsBsize platform files to _test.go suffix.
  • Utility packages (Phase 6, 9 functions) — NormalizePath, IsWindowsAbsPath, FromSlash, EnsureTrailingSeparator, RemoveTrailingSeparator, MapEventTypeToActionType, ProtoToExecutionStatus, ValidateL2PostureStartup, NowUTC.
  • Test utilities (Phase 7, 19 functions) — GenerateTestCSRP256 (later restored as false positive), ReadHubCA, ReadBootstrapCA, ReadTrustBundle, ReadHubBundle, RequirePKIInitialized, WaitForMessage, AssertMessageReceived, CreateTestChannel, SubscribeToChannel, PublishTestMessage, MarshalJSON, BuildCommandRequestedPayload, BuildCommandCancelRequestedPayload, UnmarshalPayload, FileEditRequestFields struct, BuildFileEditRequestedPayload, BuildFsListRequestedPayload, BuildCheckPortRequestedPayload, BuildFsReadRequestedPayload, BuildFetchLogsRequestedPayload, BuildFetchFileDiffRequestedPayload, BuildAuditMsgRequestedPayload, BuildDirectCommandAuditRequestedPayload, BuildDirectCommandResultAuditRequestedPayload, BuildHeartbeatRequestedPayload, BuildShutdownRequestedPayload, MarshalGovernanceEnvelope, MarshalGovernanceEnvelopeWithVotes, UnmarshalGovernanceEnvelope, GenerateGovernanceMessageID, MarshalGovernanceEnvelopeWithNonce, CreateGovernanceVote, TempFile.
  • Test helper packages (Phase 8, 12 functions) — publisherstest/ package deleted entirely (NewTestResultsPublisher + 11 methods). pubsub_test.go deleted (all tests were for removed functions).

Retained (False Positives)

  • GatewayModeService.GetHTTPPort/GetHTTPSPort — cross-package test callers in test/fixtures/ (build tag integration || e2e).
  • CapabilityFromContext — defense-in-depth public API for downstream capability verification (see docs/architecture/core-architecture-realignment.md).
  • Lattice adapter (12 functions) — future infrastructure for Anduril Lattice gRPC integration.
  • agent_harness client methods (6 functions) — test-only callers in a testing tool, retained as client API surface.
  • restorePorts/getServerPort — called from cert_integration_test.go (//go:build integration).
  • GenerateTestCSRP256 — 30+ cross-package test callers in gateway integration tests (initially removed, restored after integration build failure).
  • keystore.NewWithKeyringAndFS, auth.BootstrapService.SetHTTPClient, storage.CommitmentLedger.AppendCommitmentJSON — cross-package test callers.
  • testutil functions (NewTestPaths, NewTestPathsFromTemp, GetPKICertPaths, ReadCACert, ReadRootCA, ReadOperatorCA, TestPubSubAvailable) — cross-package test callers.
  • governancetest/, keystoretest/, pubsubtest/, storagetest/ — all functions retained (extensive cross-package test callers).

Changed

  • gatewayServiceBuilder simplifiedpreBuiltDB, preBuiltStores, preBuiltPubsub fields removed. build() method unconditionally constructs DB and pubsub.
  • Gateway test files restructuredgateway_service_test.go split into 5 focused test files (gateway_service_governance_test.go, gateway_service_lifecycle_test.go, gateway_service_heartbeat_test.go, gateway_service_cert_test.go, gateway_service_getters_test.go). All tests now use NewGatewayModeService via shared newTestGatewayService helper.
  • TribunalStoreAdapter moved to test code — Production abstraction removed; test-only tribunalStoreTestAdapter defined in tribunal_store_test_helper_test.go. pubsub_fixtures_test.go defines local pubsubTestTribunalStoreAdapter.
  • Gateway L3 notary tests refactored — Tests for dead cliNotary rewritten to use NewGatewayL3Notary and NewOutboundL3Notary (production constructors).
  • setStatfsBsize files renamed — Three platform-specific helper files renamed to _test.go suffix to correctly scope them as test-only.
  • G8eoService test field access — Tests now use direct field access with mutex lock/unlock instead of removed SetPubSubClient/SetKeystore methods.
  • mcp/validation_test.go test helpersSetPrivateIPAllowlist replaced with test-only setPrivateIPAllowlistForTest/resetPrivateIPAllowlistForTest helpers.

Verification

All verification checks pass:

  • go build ./... (Linux, Windows, macOS)
  • go test ./... (all unit tests)
  • go test -tags integration ./... (all integration tests)
  • go vet ./... (only pre-existing tribunal lock-copy warning)
  • gofmt -l . (clean)
  • deadcode -test ./... (only known false positives remain)
  • No empty .go files created