BUG: Memory curator misses upcoming anniversaries across year boundaries and on leap days
メンテナーはふだん 10 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 83/100
調査の方向性
backend/app/utils/memory_curator.pyから始め、EVENT_ANNIVERSARY_LOOKAHEAD_DAYS設定とあわせて_semantic_surface_date()を読みます。issueの12月30日のケースを再現し、その後、うるう年ではない年の2月29日に対する関数の動作を確認します。両方のケースで、3日間の先行期間を維持しながら、期待される次の記念日の日付が返されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description
In backend/app/utils/memory_curator.py, _semantic_surface_date() computes whether a semantic event's anniversary is within EVENT_ANNIVERSARY_LOOKAHEAD_DAYS (3 days) of the reference date.
However, the calculation only evaluates event_start.date().replace(year=reference.year):
- Year Boundary: If the reference date is in late December (e.g. Dec 30) and an event happened on January 1, the upcoming anniversary on Jan 1 of the following year (2 days away) is calculated as Jan 1 of the current year (
delta = -363). This causes the lookahead condition0 <= delta <= 3to evaluate toFalse, prematurely surfacing the memory today instead of on its upcoming anniversary. - Leap Day (Feb 29): When an event occurred on Feb 29, evaluating it in a non-leap year raises a
ValueError, which immediately returnsreference.isoformat(), discarding the lookahead window instead of falling back to Feb 28.
Steps to Reproduce
- Call
_semantic_surface_date(reference=date(2026, 12, 30), event_start=datetime(2024, 1, 1)). - Notice the anniversary is 2 days away (January 1, 2027), which is within the 3-day lookahead window.
- Observe output is
"2026-12-30"(today) instead of"2027-01-01".
Expected Behavior
The function should evaluate the next upcoming anniversary in reference.year + 1 when the current year's date has passed, and map leap day anniversaries to Feb 28 in non-leap years.
Proposed Fix
Check reference.year + 1 if anniversary < reference, and catch ValueError to map Feb 29 to Feb 28.
Record
- I agree to follow this project's Code of Conduct
- 主要言語
- Python
- スター
- 320
- フォーク
- 771
- 平均マージ
- 9日 5時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @avika269 が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 2 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id対応中かも @sathvikn113 が 4 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md references対応中かも @avika269 が 4 日前に担当しました。 オープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
AOSSIE-Org/PictoPy#1730 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
-
bug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/PictoPy#1729 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
BUG: Album create/update accept a blank or whitespace-only name対応中かも @sayxnn17 が 3 日前に担当しました。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
AOSSIE-Org/PictoPy#1722 · コメント 5 件 ·
メンテナーはふだん 10 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Niko1221/Strata#6475 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
skills: _skill_body cuts the frontmatter short when a description contains ---対応中かも @nurlanmnn が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/memsearch#876 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
acl-org/acl-anthology#11025 ·
メンテナーはふだん 1 日以内に返信