Documentation
¶
Overview ¶
Package detect determines the reference time for change detection using markers, events, or flags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTimestamp ¶
ExtractTimestamp extracts a timestamp from a JSON line without full unmarshal. Looks for "timestamp":"..." and parses as RFC3339.
Parameters:
- jsonLine: JSON string to extract timestamp from
Returns:
- time.Time: Parsed timestamp
- bool: True if extraction succeeded
func FromEvents ¶
FromEvents scans events.jsonl in reverse for the last context-load-gate event.
Returns:
- time.Time: Event timestamp
- bool: True if a valid event was found
func FromMarkers ¶
FromMarkers finds the second most recent ctx-loaded-* marker file. The most recent is the current session's marker.
Returns:
- time.Time: Marker file modification time
- bool: True if a valid marker was found
func ParseSinceFlag ¶
ParseSinceFlag parses a duration (like "24h") or date (like "2026-03-01").
Parameters:
- since: Time reference string to parse
Returns:
- time.Time: Parsed time
- string: Human-readable label
- error: Non-nil if parsing fails
func ReferenceTime ¶
ReferenceTime determines the reference time for change detection.
Priority:
- --since flag (duration like "24h" or date like "2026-03-01")
- ctx-loaded-* marker files (second most recent by mtime)
- events.jsonl (last context-load-gate event)
- Fallback to 24h ago
Parameters:
- since: User-provided time reference, or empty for auto-detection
Returns:
- time.Time: The determined reference time
- string: Human-readable label describing the reference point
- error: Non-nil if the --since value cannot be parsed
Types ¶
This section is empty.