Skip to content

feat(echo): the adapter lifecycle surface - #28

Merged
rennf93 merged 1 commit into
masterfrom
feat/adapter-lifecycle-surface
Oct 8, 2026
Merged

rennf93 merged 1 commit into
masterfrom
feat/adapter-lifecycle-surface

Conversation

@rennf93

@rennf93 rennf93 commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

Ports the fastapi-guard middleware lifecycle ops the FEATURE_MATRIX_GO adapter row left PARTIAL/MISSING (guard/middleware.py: mark_initialized :131, get_initialization_status :705, reset :685, agent_stats :256, refresh_cloud_ip_ranges :661) as explicit functions over the engine handle, the same seam as GuardWebSocket and AddStatusRoute (the reference ops are methods on SecurityMiddleware because the Python middleware owns its machinery internally; this adapter's machinery is the engine New receives).

  • MarkInitialized: a warmed engine makes Initialize a no-op (guard-core-go MarkInitialized).
  • GetInitializationStatus: the payload AddStatusRoute serves (cloud_providers, geo_ip, redis probe).
  • Reset: the reference reset - the rate limiter's redis sliding windows and in-memory counters.
  • AgentStats: the reference agent_stats property - enabled/degraded merged with the wired handler's AgentStats dict (guard-core-go Engine.AgentStats + AgentStatsProvider; the guard-agent-go get_stats dict view landed in guard-agent-go feat(echo): the websocket handshake guard #26).
  • RefreshCloudIPRanges: the redis-backed refresh at the configured TTL (the reference cloud_handler.refresh_async) or the in-memory refresh (the reference cloud_handler.refresh); no blocked providers is the reference's no-op early return.

Floors guard-core-go at the #66 engine surface.

Test plan

  • gofmt clean, go vet clean, staticcheck clean
  • unit suite green; integration suite green against local redis (127.0.0.1) including the redis-backed refresh arm answering from a seeded cache
  • fail-closed 100% coverage gate green under the go 1.26 toolchain (mark-skips-startup against an unreachable redis, nil arms, reset drops a tripped in-memory window, agent stats agentless/wired/without-surface, refresh both arms with a pinned fetcher)

Ports the fastapi-guard middleware lifecycle ops the FEATURE_MATRIX_GO
adapter row left PARTIAL/MISSING (guard/middleware.py): mark_initialized
(:131), get_initialization_status (:705), reset (:685), agent_stats
(:256) and refresh_cloud_ip_ranges (:661), as explicit functions over
the engine handle (the same seam as GuardWebSocket and AddStatusRoute;
the reference ops are methods on SecurityMiddleware because the Python
middleware owns its machinery, while this adapter's machinery is the
engine New receives). The engine side (Initialize/Close,
MarkInitialized, AgentStats with the AgentStatsProvider seam) landed in
guard-core-go #66; the agent-side get_stats dict view in guard-agent-go
#26.

- MarkInitialized: a warmed engine makes Initialize a no-op.
- GetInitializationStatus: the payload AddStatusRoute serves.
- Reset: the rate limiter's windows (redis and in-memory).
- AgentStats: enabled/degraded merged with the wired handler's stats.
- RefreshCloudIPRanges: the redis-backed refresh at the configured TTL
  (the reference cloud_handler.refresh_async) or the in-memory refresh
  (the reference cloud_handler.refresh); no blocked providers is the
  reference's no-op early return.
@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 8, 2026
@github-actions github-actions Bot added dependencies go.mod or go.sum changes tests Test suite changes build Module files / packaging labels Oct 8, 2026
@rennf93
rennf93 merged commit 1767b6e into master Oct 8, 2026
13 of 14 checks passed
@rennf93
rennf93 deleted the feat/adapter-lifecycle-surface branch October 8, 2026 04:25
rennf93 added a commit that referenced this pull request Oct 9, 2026
… lifecycle surface - floor guard-core-go v4.3.2 (#30)

The family 1.4.0 wave on Echo: GuardWebSocket plus WebSocketHTTPStatus
(#26), AddStatusRoute (#27), the adapter lifecycle surface (MarkInitialized,
GetInitializationStatus, Reset, AgentStats, RefreshCloudIPRanges, #28).
Raises the engine floor to v4.3.2, pins golang.org/x/net v0.60.0 for the
five 2026 http2 GO advisories reachable through the cloud-refresh
lifecycle, and carries the post-transfer Guard-Core metadata sweep.

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Module files / packaging dependencies go.mod or go.sum changes no-issue Chore or dependency PR that does not need an issue tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant