# Backlog

Items gated on future milestones or external dependencies.

---

## Phases-helpers extension-load error (pre-triage, T1)

- **Source:** TODO.md triage 2025-06
- **Symptom:** Every `sf …` invocation prints `Extension load error: './phases-helpers.js' does not provide an export named 'closeoutAndStop'`
- **Root cause:** Recent rename in `phases-helpers.js` not propagated to its importer(s); or `npm run copy-resources` shipped a partial state.
- **Fix:** Locate callers of `closeoutAndStop` in the extension source, update the import to the new symbol name. Add a test that imports every symbol from the extension entry point and asserts they all resolve.
- **Priority:** T1 — noisy on every run, degrades operator confidence.

---

## Slash command `/todo triage` must route through typed backend (pre-triage, T1)

- **Source:** TODO.md triage 2025-06
- **Symptom:** `sf --print "/todo triage"` triggers the agent, which reads TODO.md and emits triage-shaped markdown, but never calls `handleTodo → triageTodoDump`. DB records never written; patched backend bypassed.
- **Fix:**
  1. In the slash-command dispatch prompt, enumerate handlers and forbid the LLM from doing the work itself when a typed handler exists.
  2. Add integration test: run `sf --print "/todo triage"` against a fixture TODO.md, assert `triage_runs` rows appear in `sf.db`.
- **Priority:** T1 — core correctness issue, not a UX polish.

---

## Triage result needs structured tier/priority per item (pre-triage, T2)

- **Source:** TODO.md triage 2025-06
- **Problem:** Tiers (T1/T2/T3) appear only in LLM prose appended to `BUILD_PLAN.md`, not as structured fields per item. Blocks downstream automation that needs to escalate Tier-1 items to milestones.
- **Fix:** Extend triage JSON schema:
  ```ts
  { title: string, tier: "T1" | "T2" | "T3", rationale: string }
  ```
  Update `appendBacklogItems` + future milestone-escalator to consume the structured tier.
- **Priority:** T2 — enables milestone automation; blocks `sf plan promote` from triage.

---

## Sha-track source-of-truth markdown files, diff on change (pre-triage, T2)

- **Source:** TODO.md triage 2025-06
- **Want:** On session start + autonomous-cycle entry, hash `AGENTS.md`, `README.md`, `.sf/wiki/**/*.md`, `.sf/milestones/**/*.md`, `docs/adr/**/*.md`, `docs/plans/**/*.md`. Diff against last-seen hash in `sf.db`. Surface changed files for review/accept.
- **Schema:**
  ```sql
  CREATE TABLE tracked_md_files (
    relpath TEXT PRIMARY KEY, sha256 TEXT NOT NULL, size_bytes INTEGER NOT NULL,
    last_seen_at TEXT NOT NULL, last_seen_commit TEXT, category TEXT
  );
  ```
- **Out of scope:** `TODO.md`, `CHANGELOG.md`, `BUILD_PLAN.md`, `node_modules`, `dist`.
- **Priority:** T2 — high value for cross-agent coordination; deferred behind T1 fixes.

---

## Cross-repo triage / unified backlog view (pre-triage, T3)

- **Source:** TODO.md triage 2025-06
- **Want:** `sf headless triage-all-repos --config ~/.sf/repos.yaml` — walk N repo paths, run `triageTodoDump` per repo in its own SF db, emit a unified read-only aggregated report sorted by priority/tier.
- **Constraints:** Per-repo SF dbs stay separate; cross-repo view is read-only aggregation into `~/.sf/cross-repo-view.md`.
- **Priority:** T3 — useful for multi-repo operators; deferred until T1/T2 items land.

## M009 Promote-Only Adoption Review

- **Gate:** M010 (schedule system) must ship first
- **Date:** 2026-05-04
- **Action:** `sf schedule add --in 2w --kind review "Review promote-only adoption: count promotions, scan git log for .sf/ touches, assess sf plan promote ergonomics"`
- **Intent:** Two weeks after M009 closes, review whether agents and humans are following the promote-only rule. Count promotions via `sf plan list`. Scan git log for `.sf/` commits. Assess `sf plan promote` ergonomics and whether the workflow needs adjustment.
