fix(gtd): preserve RFC 3339 due fidelity in agent-mode presentation#956
Merged
Conversation
gtd.assign returns properties.due as a top-level convenience field. Agent-mode presentation compacts every top-level ISO-like string unless its field name is in PAYLOAD_TIMESTAMP_FIELDS, and that allowlist held only trigger_at, so a future due date was minute-truncated on the way out even though parse_due already normalized it to full RFC 3339 with seconds and offset. The nested properties.due survived correctly since the inside_properties guard protects it separately. Add due to PAYLOAD_TIMESTAMP_FIELDS alongside trigger_at, mirroring the existing fix for the same defect class on trigger_at. Regression tests: a presentation-layer unit test for a bare top-level due field, and a gtd-pack integration test that assigns a task with an offset-bearing RFC 3339 due, then reads it back through gtd.tasks/gtd.next and re-applies Agent-mode presentation, asserting the value round-trips unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
|
APPROVE Findings: 0 Blocker, 0 High, 0 Medium, 0 Low Reviewed PR #956 ( Looks Right
Commands Run
What I Did Not Check
Re-Review Guidance
Domain utility: SKIPPED — no separate domain corpus was available or needed for this narrowly scoped presentation-layer review. |
oceanwaves630
approved these changes
Jul 13, 2026
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
Fixes #912.
gtd.assignreturns the normalizedproperties.dueas a top-leveldueconvenience field. Agent-mode presentation (crates/khive-runtime/src/presentation.rs) compacts every top-level ISO-like string except field names inPAYLOAD_TIMESTAMP_FIELDS, and that allowlist held onlytrigger_at(added for the same defect class in a prior fix). A future task'sduewas therefore minute-truncated (YYYY-MM-DDTHH:MM) on the way out, even thoughparse_duealready guarantees a full RFC 3339 value with seconds and offset. The nestedproperties.duewas unaffected since theinside_propertiesguard protects it separately.Root cause: presentation layer only — not the parser (
parse_duealready normalizes correctly) and not storage (properties.dueround-trips fine). The loss happens exclusively inpresent()'s Agent-mode timestamp-compaction pass, which treats an unlisted top-level ISO-like field the same as a generic timestamp.Fix: add
"due"toPAYLOAD_TIMESTAMP_FIELDSincrates/khive-runtime/src/presentation.rs, mirroring the existingtrigger_atentry. Minimal, single allowlist addition; no change to parsing, storage, or the render shape for tasks withoutdue.Test plan
cargo fmt --all -- --checkcargo clippy -p khive-pack-gtd -p khive-runtime --all-targets -- -D warningscargo test -p khive-pack-gtd(includes newassign_due_survives_agent_mode_presentation_round_trip: assigns a task with an offset-bearing RFC 3339due, reads it back viagtd.tasksandgtd.next, re-applies Agent-mode presentation, asserts verbatim round-trip)cargo test -p khive-runtime presentation::(includes newagent_does_not_compact_top_level_dueunit test)cargo check --workspace🤖 Generated with Claude Code