[Bug]: `fw fabric register` prints "REFUSED" but writes the card and exits 0

Aperta Adatta ai principianti
#108 2 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
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
shell
Ambito
cli

Direzione di ricerca

Inizia da agents/fabric/lib/register.sh, intorno alle righe 341–354, e segui in che modo una regola del sottosistema mancante influisce sulla scrittura della scheda, sul messaggio stampato e sullo stato di uscita. Riproduci il problema con un progetto appena creato con fw init e un percorso non coperto, come descritto. Il lavoro è concluso quando il comportamento è coerente: la registrazione viene rifiutata senza scrivere una scheda e termina con uno stato diverso da zero, oppure riesce con un avviso che non dice «REFUSED».

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

Descrizione

area:fabric bug severity:medium status:received triaged
Bug Description

When no subsystem rule matches the path, agents/fabric/lib/register.sh writes the card anyway (mv -f "$tmp_card" "$card_file", line 341), prints Card created: ... with Subsystem: unknown, then prints REFUSED: <path>: no subsystem rule matches — add a paths: pattern to .fabric/subsystems.yaml (line 352), and returns 0 (line 354).

So the output says the registration was refused while it succeeded. An agent or a script that trusts the exit code sees success; one that reads the message sees a refusal, and may register again after fixing subsystems.yaml, which then answers "Card already exists" and leaves subsystem: unknown in place.

Steps to Reproduce
  1. In a fresh fw init project, make sure no subsystem rule covers the file (e.g. remove .fabric/subsystems.yaml).
  2. touch notes.txt && fw fabric register notes.txt; echo "exit=$?"
  3. Output: Card created: .fabric/components/notes.yaml, Subsystem: unknown, REFUSED: notes.txt: no subsystem rule matches ..., exit=0; the card is on disk.
Expected Behavior

Either the registration is refused (no card written, non-zero exit), or it succeeds with a warning that does not say "REFUSED", e.g. WARN: subsystem unknown — add a paths: pattern to .fabric/subsystems.yaml.

Actual Behavior

"Card created" and "REFUSED" in the same output, exit code 0, card written with subsystem: unknown.

fw doctor output

AI Agent

Claude Code

Operating System

Linux

Additional Context

Seen on 1.8.14 in a real project, reproduced on 1.8.15 in a throwaway container (fresh fw init project, non-root, no network). register.sh is unchanged on bleeding-edge (0c3b8b6c3).

Lingua principale
Shell
Stelle
16
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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.