---
id: T-1406
name: "T-1346-B2 fw doctor and fw version disclose active framework mode"
description: >
  Build B2 from T-1346 GO decomposition: fw doctor and fw version print which framework
  copy resolved (vendored, global, framework-repo) with absolute path and version
  pin. Closes the silent-leak observability gap from T-1346 — even after T-1356 (B1)
  flips rule order, users have no signal showing which copy is active. Acceptance:
  (1) fw version output includes 'Mode: <vendored|global|framework-repo>' + path;
  (2) fw doctor includes a structural section reporting same; (3) bats test asserts
  mode line appears for each resolution path.

status: work-completed
workflow_type: build
owner: agent
horizon:
tags: []
components: [bin/fw]
related_tasks: []
created: 2026-04-23T18:43:36Z
last_update: '2026-06-11T22:23:47Z'
date_finished: 2026-04-23T18:48:34Z
bvp_scores_proposed:
  - ts: '2026-06-11T22:23:47Z'
    estimator: bvp-estimator-v1-heuristic
    scores:
      D1: 0
      D2: 0
      D3: 0
      D4: 0
      F-RECALL: 0
      F-ORCH: 0
      F3: 0
      F1: 0
      F2: 0
    rationale: D1=0 (no-signal); D2=0 (no-signal); D3=0 (no-signal); D4=0 
      (no-signal); F-RECALL=0 (no-signal); F-ORCH=0 (no-signal); F3=0 
      (no-signal); F1=0 (no-signal); F2=0 (no-signal)
    rubric_sha: e4a00f38e801
---

# T-1406: T-1346-B2 fw doctor and fw version disclose active framework mode

## Context

<!-- One sentence for small tasks. Link to design docs for substantial ones. -->

## Acceptance Criteria

### Agent
- [x] `_detect_fw_mode()` function exists in `bin/fw` and returns one of `vendored|framework-repo|global|unknown`
- [x] `fw version` prints `Mode: <mode>` line below `Framework:` path
- [x] `fw doctor` includes a structural check showing active mode + path
- [x] Bats test `tests/unit/fw_mode_detection.bats` passes; covers all three resolution paths (vendored, framework-repo, global)
- [x] `fw doctor` and `fw version` continue to exit 0 in framework-repo mode (no regression)

## Verification

bin/fw version 2>&1 | grep -qE "^Mode:[[:space:]]+framework-repo"
bash -c 'out=$(bin/fw doctor 2>&1); echo "$out" | grep -q "Active mode: framework-repo"'
bats tests/unit/fw_mode_detection.bats

## Decisions

<!-- Record decisions ONLY when choosing between alternatives.
     Skip for tasks with no meaningful choices.
     Format:
     ### [date] — [topic]
     - **Chose:** [what was decided]
     - **Why:** [rationale]
     - **Rejected:** [alternatives and why not]
-->

## Updates

### 2026-04-23T18:43:36Z — task-created [task-create-agent]
- **Action:** Created task via task-create agent
- **Output:** /opt/999-Agentic-Engineering-Framework/.tasks/active/T-1406-t-1346-b2-fw-doctor-and-fw-version-discl.md
- **Context:** Initial task creation

### 2026-04-23T18:48:34Z — status-update [task-update-agent]
- **Change:** status: started-work → work-completed

## Reviewer Verdict (v1.5)

- **Scan ID:** R-5df0bb74
- **Timestamp:** 2026-06-02T14:57:15Z
- **Catalogue:** v1.3-seed
- **Overall:** CONCERN
- **Needs Human:** no
- **Findings:** 1

**Verification-level findings:**

  1. **l387-sigpipe-risk** (partial, heuristic) @ Verification:line 1
     - evidence: `bin/fw version 2>&1 | grep -qE "^Mode:[[:space:]]+framework-repo"`
