Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#46 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
shell
Ambito
cli, tooling

Direzione di ricerca

Inizia leggendo metrics.sh intorno alle righe 96–99 e _date_to_epoch in compat.sh, righe 32–57; riproduci il problema con un file di task il cui valore di last_update sia racchiuso tra virgolette. Il report suggerisce di rimuovere le virgolette in metrics.sh oppure correggere il comportamento di fallback in compat.sh. Il lavoro è completato quando i timestamp tra virgolette non producono più errori nelle espressioni intere e il report delle metriche continua a gestire in modo sicuro le date non valide.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Shell
Stelle
16
Fork
6
Merge medio
6h 24m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DimitriGeelen/agentic-engineering-framework

Tutte le issue di DimitriGeelen/agentic-engineering-framework

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.