test(ui): lock in state-management semantics (vs React)#50
Merged
Conversation
Captures the state-management behaviors verified during the correctness hunt that produced the v3.5.3 render-phase fix: - functional updaters compose; a plain value can follow an updater - the GoUseState getter is a LIVE read (deliberate difference from React's per-render snapshot): a getter captured at an earlier render returns the latest value, avoiding React's stale-closure footgun - reference/value dedup: slice/map state re-renders on a new equal-content value (like Object.is on a new object); a comparable struct value dedups on equality (Go value semantics) - a function can be stored as state (the setter distinguishes a func(T) T updater from a plain function value) All pass; documents GWC's correct behavior and its intentional divergences. No version bump. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
monstercameron
pushed a commit
that referenced
this pull request
Jul 6, 2026
…ndary (#88) Assessment of the #88 logging-redaction findings: - struct-field blind spot: already fixed — normalizeLogValue walks structs into maps (json tags, unexported skipped, nested recursion) so redaction reaches their fields. Added an END-TO-END pin proving a struct logged through buildLogRecord has its sensitive field scrubbed in the final record (the standalone helpers were pinned; the composition was not). - unredacted console PII: the console emits the REDACTED record; only the message string is verbatim, so this collapses into the message gap. - message not redacted: real, but the message is free text with no field key for the key-based RedactionPolicy to match, so content/pattern-based message scrubbing is a deferred policy decision (owner-level, cf. #50). Documented the redaction boundary at the record's message field so callers keep PII in fields, not the message. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
monstercameron
pushed a commit
that referenced
this pull request
Jul 6, 2026
…alue (#50) redactValue only walks JSON-like shapes (map[string]any, []any, scalars); a struct or pointer falls through and is returned WITHOUT redacting its nested fields. Verified every in-tree caller normalizes to JSON first (the three devtools exporters do a json.Marshal->Unmarshal round-trip; logging's record path runs normalizeLogValue, which flattens structs to map[string]any), so the fallthrough is unreachable today — decision (a): keep the JSON-decoded contract and add a cheap, fail-visible dev guard rather than a risky reflect walker. Value now flags any non-JSON-scalar reaching the default branch via a diagnostics.Emit (GWC-TELEMETRY-NONJSON), deduplicated per Go type so it cannot spam the sink, so a FUTURE caller passing a raw struct with secret fields is caught in dev/test instead of leaking silently. The scalar hot path adds only one cheap type switch and no reflection. Pins (negative-verified): TestValueGuardsAgainstNonJSONValues, TestNonJSONReportDedupesPerType. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Locks in verified state-management behavior from the correctness hunt: functional-update composition, live-read getter (intentional vs React snapshot), slice/map vs struct dedup, function-as-state. Documents GWC's correct behavior + intentional divergences. No version bump.
🤖 Generated with Claude Code