I will list the files in the repository to locate existing test files and understand the project structure.
I have completed the code review of the new `sprint-plan` command and its related components. Below is the structured analysis and feedback.

---

### ftl_project_expert/prompts/sprint_plan.py
VERDICT: PASS
CORRECTNESS: VALID
SPEC_COMPLIANCE: MEETS
ISSUE_COMPLIANCE: ADDRESSES
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: The prompt template correctly organizes the project name, sprint length, team size, gating analysis, team capacities, open issues, and top belief network context. It provides detailed and structured EM-persona instructions that map cleanly to the expected sections in the sprint plan.
---

### ftl_project_expert/prompts/__init__.py
VERDICT: PASS
CORRECTNESS: VALID
SPEC_COMPLIANCE: N/A
ISSUE_COMPLIANCE: ADDRESSES
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: Exposes the prompt builder under `__all__` and imports it correctly, making it available for the CLI command.
---

### ftl_project_expert/cli.py:_compute_gating_analysis
VERDICT: PASS
CORRECTNESS: VALID
SPEC_COMPLIANCE: N/A
ISSUE_COMPLIANCE: ADDRESSES
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: Correctly maps and traverses downstream conclusions using a BFS traversal on the belief network to compute gating impact counts. Cycle detection is correctly managed using a `visited` set to prevent infinite loops, and nodes without justifications are gracefully omitted.
---

### ftl_project_expert/cli.py:_compute_team_signals
VERDICT: PASS
CORRECTNESS: VALID
SPEC_COMPLIANCE: N/A
ISSUE_COMPLIANCE: ADDRESSES
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: Successfully extracts team member metadata, including active/closed counts and priority spreads, from cached issue lists. Time-based logic for recent closures is robust, and the timezone parsing has graceful fallback handlers (`try...except`).
---

### ftl_project_expert/cli.py:_format_backlog_section
VERDICT: CONCERN
CORRECTNESS: QUESTIONABLE
SPEC_COMPLIANCE: N/A
ISSUE_COMPLIANCE: PARTIAL
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: 
1. **Substring Collision Bug:** The check `if cached_id and cached_id in text` is highly prone to false positives on shorter/sequential issue IDs. For instance, an issue with ID `"6"` or `"8"` will match any occurrence of those characters within the belief texts (e.g., in other IDs, timestamps, or duration descriptions like `"6+ times"` or `"80+ days"`). It is recommended to use word boundaries or matching patterns (e.g. `rf"\b{cached_id}\b"` or prefix matching `GL-{cached_id}`) to map beliefs to issue IDs safely.
2. **Missing Tests:** The mapping and ranking algorithms have zero unit tests.
---

### ftl_project_expert/cli.py:sprint_plan
VERDICT: CONCERN
CORRECTNESS: VALID
SPEC_COMPLIANCE: N/A
ISSUE_COMPLIANCE: PARTIAL
BELIEF_COMPLIANCE: N/A
TEST_COVERAGE: UNTESTED
INTEGRATION: WIRED
REASONING: 
1. **Missing CLI Options:** The command lacks the requested `--format` and `--retrospective` options specified in the issue. As a result, the EM feedback loop (feeding retrospective outcomes back into the belief network) is not implemented.
2. **Lack of Automated Verification:** No automated unit tests were added to verify the command execution, error paths, or the formatting of the generated LLM prompt.
---

### SELF_REVIEW
LIMITATIONS: 
- Could not run shell commands (like test runs or static checkers) as command execution was denied by policy.
- Could not see full definitions of classes such as `Issue` (defined in `sources/models.py`) to confirm if all attributes accessed (e.g., `issue.closed`) are guaranteed to exist, though robust fallback structures in the code mitigate this risk.
---
