Skip to content

docs(SR-187): AGENTS.md datetime hygiene section (follow-up to #191)#192

Merged
Delqhi merged 1 commit into
mainfrom
docs/sr-187-agents-datetime-hygiene
May 13, 2026
Merged

docs(SR-187): AGENTS.md datetime hygiene section (follow-up to #191)#192
Delqhi merged 1 commit into
mainfrom
docs/sr-187-agents-datetime-hygiene

Conversation

@Delqhi
Copy link
Copy Markdown
Contributor

@Delqhi Delqhi commented May 13, 2026

Follow-up to #191 — closes the last open acceptance item from #186:

  • Docs: AGENTS.md 'datetime hygiene' section

What

Two edits to survey-cli/AGENTS.md (the only AGENTS.md in the repo — ../AGENTS.md link is dangling, FYI for a separate cleanup):

  1. 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.

  2. New ### Python / Datetime Hygiene (SR-187, Issue #186) subsection under EXPLICITE VERBOTE. Covers:

    • Why utcnow() is banned (naive dt + Py 3.12 deprecation + 3.14 removal)
    • Why bare datetime.now() is also flagged (local-tz leak)
    • The required pattern: datetime.now(timezone.utc)
    • Wire-format decision tree: when to keep the legacy Z suffix (external consumers — command_registry.json, jsonl logs) vs when +00:00 is fine (internal sqlite/state JSON)
    • Enforcement path: scripts/check_banned_patterns.py
    • Test location: UtcnowBanTests

YAML 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.

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.
@Delqhi Delqhi force-pushed the docs/sr-187-agents-datetime-hygiene branch from 76d274a to 9fb6c17 Compare May 13, 2026 11:21
@Delqhi Delqhi merged commit b6ac8be into main May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant