docs(SR-187): AGENTS.md datetime hygiene section (follow-up to #191)#192
Merged
Conversation
This was referenced May 13, 2026
Closes the last open acceptance item from #186: - [ ] Docs: AGENTS.md 'datetime hygiene' section What was added -------------- 1. Step 3 of ARCHÄOLOGIE-TSUNAMI's BANNED-Patterns list now mentions datetime.utcnow() with a forward-ref to the new Python section. 2. New 'Python / Datetime Hygiene' subsection under EXPLICITE VERBOTE. Documents: - Why utcnow() is banned (naive dt + Py 3.12 deprecation + 3.14 removal) - Why bare datetime.now() is also banned (local-tz leak) - The required pattern: datetime.now(timezone.utc) - When to keep the legacy 'Z' suffix (external wire-format / log consumers) vs when '+00:00' is fine (internal sqlite/state JSON) - Where the rule is enforced: scripts/check_banned_patterns.py - Where the tests live: UtcnowBanTests YAML-frontmatter format preserved (content: | scalar, 2-space indent, manually verified via python3 indentation-scan). No code changes. CI's check_banned_patterns.py will pass unchanged because banned tokens inside markdown frontmatter aren't scanned.
76d274a to
9fb6c17
Compare
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.
Follow-up to #191 — closes the last open acceptance item from #186:
What
Two edits to
survey-cli/AGENTS.md(the only AGENTS.md in the repo —../AGENTS.mdlink is dangling, FYI for a separate cleanup):ARCHÄOLOGIE-TSUNAMI step 3 — BANNED-Patterns list now mentions
datetime.utcnow()with a forward-ref to the new Python section so agents discover it during the mandatory pre-edit scan.New
### Python / Datetime Hygiene (SR-187, Issue #186)subsection under EXPLICITE VERBOTE. Covers:utcnow()is banned (naive dt + Py 3.12 deprecation + 3.14 removal)datetime.now()is also flagged (local-tz leak)datetime.now(timezone.utc)Zsuffix (external consumers —command_registry.json, jsonl logs) vs when+00:00is fine (internal sqlite/state JSON)scripts/check_banned_patterns.pyUtcnowBanTestsYAML format note
The file uses an unusual
---\ncontent: |\n …indented markdown…YAML-frontmatter scalar. I preserved the 2-space indentation strictly — verified via a manual scan (0 indentation errors, body parses back to 6105 chars with all anchors present).No code changes
Pure docs. PR #191 (which actually fixes the call-sites) stands alone — happy to merge in either order, but logically #191 first, then this.