Repository navigation
fix(api): return stored timestamps from survey creates; remove SEM markers - #1157
Merged
Merged
Conversation
…eate Survey and survey-response Create echoed the created_at/modified_at that GORM's autoCreateTime/autoUpdateTime generated (nanosecond precision on Linux), while PostgreSQL timestamptz and Oracle TIMESTAMP(6) store microseconds, so the create response disagreed with every later GET. Set microsecond-truncated UTC timestamps on the model before the insert, as the note, document, repository and asset stores already do. Update paths are unaffected: their handlers re-read the row. Tests: unit tests with a nanosecond NowFunc fail before the fix (761ns residue) and pass after; a new integration test compares the create responses with a GET. Verification: `make verify` OK; scoped `make test-integration-oci` on a throwaway Always Free ADB: TestSurveyCRUD, TestSurveyResponseWorkflow and TestSurveyCreateReturnsStoredTimestampsIntegration pass; oracle-db-admin APPROVED. The remaining same-pattern instances are tracked in #1155. Fixes #1153 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
Strip every `SEM@` marker comment line (6,623 lines in 670 files) with one scripted pass, dropping a bare `//` separator left orphaned above a removed marker. Historical plans under docs/superpowers/plans/ keep their prose with `SEM@` rewritten to `SEM-`, so `rg SEM@` over tracked files is empty. Remove the sem-markers block from .claude/CLAUDE.md. api/api.go carried no markers, so no regeneration was needed. No CI, Makefile, script or hook automation referenced the markers. Also gofmt wstest/main.go (pre-existing extra blank line). Verification: `make verify` OK; `git grep SEM@` empty. Closes #1154 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
Drop unused E402 noqa directives, sort imports, use datetime.UTC, pass check= explicitly to subprocess.run, collapse nested if/with blocks, narrow a blind except, and mark shebang scripts executable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
net/http HTTP/1 server crash from a MaxBytesReader header race, fixed in go1.27.4; govulncheck reports it reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
logRequestDetails/logResponseDetails logged Authorization, Cookie, Set-Cookie and API-key headers in the clear when redact_auth_tokens was off. Credential headers now always log as [REDACTED] via a shared credentialHeaders list (also used by RedactHeaders). Delete the unused RequestTracingMiddleware, which logged all headers unredacted. Resolves CodeQL alert 1308. Fixes #1158 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
Default-deny: request/response debug logs keep values only for known-safe headers (Content-Type, Accept, User-Agent, X-Request-Id, ...); every other header, credentials and custom ones such as webhook signatures included, logs as [REDACTED]. Refs #1158 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP
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.
Summary
#1153: survey timestamps.
POST /admin/surveysandPOST /intake/survey_responsesreturned GORM-generated timestamps with nanosecond precision. The database stores microseconds, so the create response disagreed with a later GET. Both stores now set microsecond-truncated UTCcreated_at/modified_atbefore insert. Update paths already re-read the row.#1154: remove SEM markers. Removes every
SEM@intent-marker comment line (6,623 in 670 files), the SEM section of.claude/CLAUDE.md, and.local/sem.db. Comment-only otherwise.Lint. Fixes the ruff findings in the 9 Python scripts that the marker removal touched.
#1158: credential headers in debug logs (CodeQL alert 1308). The request/response debug logger logged Authorization, Cookie, Set-Cookie and API-key header values in the clear when
logging.redact_auth_tokenswas off. These headers now always log as[REDACTED], using a shared list thatRedactHeaders()also uses. The unusedRequestTracingMiddleware, which logged every header unredacted, is deleted. New tests fail on the old code and pass on the fix.Go toolchain go1.27.4. Fixes GO-2026-6859, a reachable net/http crash that govulncheck reported. The advisory is newer than main's last green run.
Verification
api/survey_timestamps_test.go) fail without the fix and pass with it. A NowFunc with 761 ns of extra precision makes the bug show on every OS.TestSurveyCreateReturnsStoredTimestampsIntegrationpassed against a throwaway Oracle ADB, together withTestSurveyCRUDandTestSurveyResponseWorkflow. The ADB was deleted afterwards. Theoracle-db-adminreview approved the change.make verifypasses on this branch.make test-dev-scripts: 218 tests pass, and every touched script's--helpruns.Follow-ups
test-admina security reviewer, which breaks the triage subtests.Fixes #1153
Fixes #1158
Closes #1154
🤖 Generated with Claude Code
https://claude.ai/code/session_011fnCFtPzfvJmmkCSfXZgqP