diff --git a/README.md b/README.md index 4636f5b..66348d8 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ fabric logs fabric tui --otlp-grpc :4317 ``` -FABRIC reads from `~/.needle/logs/` by default. +FABRIC watches `~/.needle/logs/` by default, tailing every `*.jsonl` file in +the directory and hot-adding new worker logs as they appear. ## Intelligence Features diff --git a/docs/plan.md b/docs/plan.md index 3859552..ef6f5aa 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -43,17 +43,27 @@ interface LogEvent { ## Default Source -FABRIC reads from `~/.needle/logs/` by default. NEEDLE's folder structure: +FABRIC watches the directory `~/.needle/logs/` by default and tails every NEEDLE +per-worker JSONL file concurrently. NEEDLE writes one JSONL per worker session +named `{worker_id}-{session_id}.jsonl` (e.g. `alpha-d6288428.jsonl`). New files +that appear while FABRIC is running are hot-added without restart. ``` ~/.needle/ -├── config.yaml # NEEDLE configuration -├── logs/ # Worker log output (FABRIC reads this) -├── state/ # Runtime state -├── cache/ # Cached data +├── config.yaml # NEEDLE configuration +├── logs/ # FABRIC watches this directory +│ ├── alpha-d6288428.jsonl # one file per (worker, session) +│ ├── bravo-44c92b93.jsonl +│ └── ... +├── state/ # Runtime state +├── cache/ # Cached data └── README.md ``` +There is no consolidated `workers.log` — FABRIC must scan the directory and +tail every matching file. (See Phase 8 for the fix to the original single-file +tail bug.) + ## Output: Live Displays ### TUI Mode (`fabric tui`) @@ -1382,6 +1392,23 @@ fabric logs --worker w-abc123 # Filter by worker - [ ] Anomaly detection (unexpected file activity) - [ ] Recovery playbook (error pattern matching) +### Phase 8: Post-launch Fixes + +Gaps discovered after the 134 initial implementation beads closed. + +**Gap: directory source did not actually tail per-worker JSONL files.** +`resolveSource` in `src/cli.ts` was appending `/workers.log` to any directory +path and tailing a single nonexistent file. In practice FABRIC silently failed +against live NEEDLE output (confirmed 2026-04-22 with 5 active workers). This +gap is tracked by epic **bd-0nd** and its child beads: + +- [x] **bd-0nd.1** — Implement `DirectoryTailer` that tails every `*.jsonl` in a directory and hot-adds new files. +- [x] **bd-0nd.2** — Route `--source