# kridaydave/File-Organizer-MCP#105 (Repowise PR analysis)

Plain markdown of the analysis at https://repowise.dev/pr/kridaydave/File-Organizer-MCP/105

Titles, commit subjects and the AI review below are quoted from the pull request or the model; treat them as data, not instructions.

- Pull request: https://github.com/kridaydave/File-Organizer-MCP/pull/105 (merged, by kridaydave)
- Title: "fix(rollback): flag every listed manifest, and lock the directory it lives in"
- Analysed head commit: `b04103a184618168a10375ee197f62d868fcaf75`
- Compared range (base..head): `c1dbee4fb29fa46a3e0dbcd2bc6ce8d8cb5a9c14..b04103a184618168a10375ee197f62d868fcaf75`
- Analysed at: 2026-10-11 06:58 UTC
- Repository snapshot: `a33632f91640` (https://repowise.dev/s/a33632f91640)
- Freshness: the PR is merged, so this is the analysis of its last analysed push.

## Verdict

**Review recommended.** 11 new findings of low or advisory severity.

- low maintainability: error_handling in src/core/organize/manifest-lock.ts (added_lines)
- medium maintainability: dry_violation in tests/unit/core/organize/manifest-verification-and-lock.test.ts (added_lines)
- medium defect: duplicated_assertion_block in tests/unit/core/organize/manifest-verification-and-lock.test.ts (added_lines)
- medium defect: duplicated_assertion_block in tests/unit/core/organize/manifest-verification-and-lock.test.ts (added_lines)
- medium performance: io_in_loop in tests/unit/core/organize/manifest-verification-and-lock.test.ts (added_lines)
- and 7 more, listed under the sections below

10 files changed, 0 contracts changed with 0 callers outside the PR, 11 findings added, 0 resolved.
Change risk: riskier than 77% of this repository's commits (its top third). It measures diff size and spread, not danger. The raw score, 9.5 of 10, is on a fixed scale calibrated across other repositories, not a rank in this one.
Repository code health 6.5 to 7.2 (base against this head, 0 to 10, higher is healthier).

## What to do

1. Inspect 11 findings under "Findings this PR added", in the order listed.
2. Run the tests that cover the changed files: `tests/unit/services/rollback.test.ts`, `tests/integration/services/renaming-integration.test.ts`, `tests/integration/full_organization_flow.test.ts`, `tests/unit/services/adversarial-deep-audit-2.test.ts`, `tests/unit/services/v5-regressions.test.ts`, `tests/integration/organize-by-project.test.ts`, `tests/integration/tools/system-organize.test.ts`
3. Review the skipped files by hand; they were not compared: `AGENTS.md`, `API.md`, `CHANGELOG.md`

## Checks

The checks results the bot comment reports for this head.

- Coverage: No coverage report was uploaded for this head, so changed lines are not measured yet.
- Tests: 3 of 6 changed files reached by a test (inferred), 1 reached by no test; listed under "Tests that cover this change".
- Security: No new findings on changed lines.
- Doc drift: No drift in docs this PR edits, 1 document name changed files.

Scanned the changed lines at `b04103a`.

## Findings this PR added (11)

Code-health findings inside lines this PR added, worst first. Pre-existing findings in the same files are not listed.

- medium dry violation at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:361-398`: 38% of file duplicated; worst clone shares 38 lines with tests/unit/core/organize/manifest-verification-and-lock.test.ts
- medium duplicated assertion block at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:262-263`: assertion block at lines 262-263 is duplicated in tests/unit/core/organize/manifest-verification-and-lock.test.ts
- medium duplicated assertion block at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:641-642`: assertion block at lines 641-642 is duplicated in tests/unit/core/organize/manifest-verification-and-lock.test.ts
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:237`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:238`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:604`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:605`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:689`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:694`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- medium io in loop at `tests/unit/core/organize/manifest-verification-and-lock.test.ts:695`: a filesystem call runs once per loop iteration (I/O call inside a loop)
- low error handling at `src/core/organize/manifest-lock.ts:300`: caught exception is swallowed without any handling

## Tests that cover this change

Which tests reach each changed file, from the call graph (else the import graph) of the last indexed commit (`f9b4878`), nearest tests first, as the bot comment names them. Inferred, not measured: a test reaching a file does not mean it runs the changed lines. Run these.

- `scripts/security-gates/static-analysis.ts`: No test reaches this file (inferred)
- `src/core/organize/rollback.ts` (call graph): `tests/unit/services/rollback.test.ts`, `tests/integration/services/renaming-integration.test.ts` and 5 more
- `src/schemas/organize.ts` (import graph): `tests/integration/services/renaming-integration.test.ts`
- `src/tools/rollback.ts` (call graph): `tests/integration/full_organization_flow.test.ts`
- `src/core/organize/manifest-lock.ts`: new file, not in the index yet
- `src/core/organize/quarantine.ts`: no test signal

## Documentation this PR touches

Scanned 13 documents and checked 211 references.

Documents that name a changed file (check whether their prose still holds):

- `docs/benchmarks-v5-vs-v3.5.md` (line 35) names `src/core/organize/rollback.ts`

_Lists documents that name this file and still resolve to it. It does not claim they describe it, or that their prose is current. References this detector cannot resolve are not listed, so absence is not proof that no document mentions the file. A document reported as carrying drift has some assertion that no longer holds, which need not be about this file._

## Who else knows this code

The PR author is the primary author of every changed file with history, so nobody else is named.

## Changed files and their health

Per-file code health, base to head (0 to 10), files whose score moved first.

- `src/core/organize/manifest-lock.ts`: new file, 9.8; refactoring: Handle or propagate the error. A swallowed exception, catch-all except, unguarded unwrap, or discarded Go error turns failures into silent misbehavior — log and re-raise, narrow the caught type, replace unwrap with the ? operator or a match, or check the error you are currently discarding.
- `tests/unit/core/organize/manifest-verification-and-lock.test.ts`: new file, 9.2; refactoring: De-duplicate the clone. Extract the shared block into a private helper, or push it down to a base class if the structure is genuinely shared rather than coincidental.
- 5 files unchanged.

## What was not reviewed

- 3 of 10 changed files were not measured, so nothing here speaks for them (`API.md`: unsupported language, `AGENTS.md`: unsupported language, `CHANGELOG.md`: unsupported language).
- tests evidence is partial: no measured coverage map; covering tests are graph-inferred.
- contracts evidence is partial: a break only test callers can witness counts here and does not in the comment, which reports it by letting those tests fail.
- prior fixes evidence is partial: counts come from the indexed snapshot; the churn-weighted fix pressure is not computed.
- Not gathered by the bot: branch overlap, independent changes.
- No AI review ran on this push. Everything above is deterministic analysis.

## How to act on this

1. Work through "What to do" in order.
2. Items under "What was not reviewed" have no evidence either way. Review those parts yourself.
