refactor: strip doc and issue narration from code comments

Remove PRD/doc paths, bead IDs, phase notes and deleted-test references
from comments; drop test-only hooks left by the test deletion. Includes
in-progress archied bootstrap, gateway and query changes.
This commit is contained in:
sam committed 2026-10-03 21:47:46 +10:00
1 parent 15e55c1c50
commit 96e5d7b84b
269 files changed
+1201 -2609

No files matched your search

+2 -6
View File
@@ -2,11 +2,7 @@
// inbound webhook-shaped HTTP requests before anything trusts them:
// signature verification, per-source rate limiting, and payload redaction.
//
// It is cross-cutting per docs/architecture/organisation.md: importable by
// any layer, and it imports none of domain, infrastructure, or app. It owns
// none of a caller's vocabulary -- not what a "source" is, not how a
// It owns none of a caller's vocabulary -- not what a "source" is, not how a
// captured event is stored, not what a binding's approval state means. Those
// stay with the packages that own that state (see
// docs/prds/event-sources-and-reactions.md for why a generic Source
// interface was rejected).
// stay with the packages that own that state.
package webhookguard
+6 -9
View File
@@ -5,16 +5,13 @@ import (
"time"
)
// RateLimiter caps request volume per source using a token bucket per
// source ID. Source IDs are assumed to come from a registered, operator-
// controlled set (per docs/prds/webhook-intake-security.md's "a source
// registers with a secret before its events can trigger anything"), not
// from unbounded attacker-supplied request data -- the bucket map is not
// itself bounded, because the key space is bounded by registration.
// RateLimiter caps request volume per source using a token bucket per source
// ID. Source IDs are assumed to come from a registered, operator- controlled
// set, not from unbounded attacker-supplied request data -- the bucket map is
// not itself bounded, because the key space is bounded by registration.
//
// A rejected request must be surfaced as an observable rejection by the
// caller (HTTP 429), never silently dropped -- see
// docs/prds/webhook-intake-security.md point 3.
// A rejected request must be surfaced as an observable rejection by the caller
// (HTTP 429), never silently dropped.
type RateLimiter struct {
mu sync.Mutex
rate float64 // tokens added per second
+6 -8
View File
@@ -36,14 +36,12 @@ var jwtTokenRe = regexp.MustCompile(`^eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z
// inbound webhook body before persisting it.
//
// This intentionally does NOT reuse internal/gateway/stream.go's
// SummarizeToolParameters shape unchanged: that function replaces every
// string value regardless of key, which produces a bounded one-line summary
// for a chat transcript. A captured webhook payload exists to be inspected
// and mapped field-by-field (see docs/prds/event-sources-and-reactions.md
// and t2db.3's schema-by-example mapping) -- redacting every string would
// make that impossible. Only a value whose key matches the marker list, or
// whose value is an unambiguous secret shape, is touched; everything else is
// returned exactly as decoded.
// SummarizeToolParameters shape unchanged: that function replaces every string
// value regardless of key, which produces a bounded one-line summary for a chat
// transcript. A captured webhook payload exists to be inspected and mapped
// field-by-field -- redacting every string would make that impossible. Only a
// value whose key matches the marker list, or whose value is an unambiguous
// secret shape, is touched; everything else is returned exactly as decoded.
//
// A key match redacts its entire value, including a nested object or array
// -- "credentials": {"host": ..., "user": ...} is wholesale replaced, not