Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fw metrics: quoted last_update timestamps crash the stale-task integer test

オープン 初心者向け
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell
領域
cli, tooling

調査の方向性

まず、96~99行付近の metrics.sh と、compat.sh の32~57行にある _date_to_epoch を読みます。last_update の値が引用符で囲まれているタスクファイルを使って再現してください。報告では、metrics.sh で引用符を取り除くか、compat.sh のフォールバック動作を修正することが提案されています。引用符で囲まれたタイムスタンプが整数式エラーを発生させなくなり、メトリクスレポートが無効な日付を引き続き安全に処理できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Context

  • Framework version: 1.6.769
  • Project: 1409-sprind (shared-tooling mode)
  • Reported: 2026-09-21T15:49:38Z

Description

Symptom

fw metrics prints its report but also emits repeated stderr noise:

metrics.sh: line 99: [: 0
0: integer expression expected

The occurrence count scales with the number of active tasks whose last_update:
frontmatter is YAML-quoted (observed 25x in a 49-active-task repo this run).

Root cause, traced to source

  1. metrics.sh:96 extracts the timestamp: grep "^last_update:" "$f" | sed 's/last_update: //' | cut -dT -f1.
    When the YAML value is single-quoted (e.g. last_update: '2026-09-19T12:26:14Z' — which
    fw bvp estimate/fw task update write whenever the YAML dumper judges a quote necessary),
    the cut -dT -f1 leaves a stray leading quote: '2026-09-19.
  2. date -d "'2026-09-19" fails to parse (tested live: date: invalid date "'2026-09-19"),
    and so do the BSD-date and python3 fallbacks inside _date_to_epoch (compat.sh:32-57).
  3. _date_to_epoch's final fallback (compat.sh:56-57) does echo "0"; return 1 — it prints
    "0" to stdout and signals failure.
  4. The caller, metrics.sh:98, is last_ts=$(_date_to_epoch "$last_update" 2>/dev/null || echo 0).
    Because step 3 returned exit code 1, the || fires too, appending a second "0". last_ts
    is now the two-line string "0\n0".
  5. metrics.sh:99: if [ "$last_ts" -lt "$seven_days_ago" ] && ... — a two-line value fed to
    [ -lt ] produces exactly the observed error text.

Minimal repro

f=.tasks/active/<any task with a quoted last_update:>.md
raw=$(grep "^last_update:" "$f" | sed 's/last_update: //' | cut -dT -f1)
date -d "$raw" +%s   # fails with a leading-quote artifact

Suggested fix

Either (a) strip surrounding quotes before cut in metrics.sh:96 (e.g. pipe through
tr -d "\"'" first), or (b) make _date_to_epoch's final fallback silent (no echo) and let
callers own their own || echo 0, removing the double-echo. (a) is the smaller, more local fix.

Context

Found while investigating WR3-05 (SPRIND Streichliste value-review round 3), which observed
the symptom once without root-causing it. .agentic-framework/ is vendored/read-only in that
project (T-1017), so this report is filed rather than patched locally.


Reported via fw upstream report from field installation

主要言語
Shell
スター
16
フォーク
6
平均マージ
6時間 24分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DimitriGeelen/agentic-engineering-framework のほかの issue

DimitriGeelen/agentic-engineering-framework の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。