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

Abierto Apto para principiantes
#108 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
shell
Área
cli

Línea de trabajo

Empieza en agents/fabric/lib/register.sh, alrededor de las líneas 341–354, y sigue cómo afecta una regla de subsistema ausente a la escritura de la tarjeta, al mensaje impreso y al estado de salida. Reprodúcelo con un proyecto recién creado mediante fw init y una ruta no cubierta, tal como se describe. Se considera terminado cuando el comportamiento es coherente: o bien se rechaza el registro sin escribir una tarjeta y se sale con un estado distinto de cero, o bien se completa correctamente con una advertencia que no diga «REFUSED».

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Shell
Estrellas
16
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DimitriGeelen/agentic-engineering-framework

Todos los issues de DimitriGeelen/agentic-engineering-framework

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.