Files
ForgeFlow/reports/architecture-audit.md
T
NuklearRabbitandClaude Opus 5 a5666e95f2 test: cover the deployment and deploy-key paths, and gate coverage per module
deployment-service.cjs sat at 52% and unraid-deploy-key-host.cjs at 39% of its
functions, both hidden behind a healthy aggregate. They are now at 100% lines
and functions, tested through real HTTP endpoints and by intercepting the shell
script the key host sends, rather than by mocking the boundary away.

What is pinned down: a successful workflow run still fails when the server
cannot prove it runs that exact commit; a rollback ends as rolled-back rather
than success; an unreachable status endpoint is never treated as healthy; a
failed poll is recorded on the operation instead of losing it; deploy keys stay
repository-scoped under the server base path with a pinned host key; promotion
verifies the candidate before swapping atomically; and revocation moves key
material to recovery instead of deleting it.

Two assumptions turned out to be wrong and the tests follow the real behaviour:
the previous-SHA check runs before the already-live check, and a rollback
against an unreachable endpoint surfaces the underlying network error.

Covering clone-target exposed a real defect: a remote ending in "....git"
yielded the folder name "...". Windows strips trailing dots, so that resolves
back to the project root itself, past an escape guard that only looks for "..".
A dots-only name now falls back to "repository", consistent with how an empty
name was already handled. As a side effect "." and ".." resolve to a usable
folder instead of raising an error.

Coverage gates: the aggregate moves to 85/85/68, and a new per-module gate
(60 statements, 50 functions, 36 branches) stops a single module from silently
collapsing behind the total. It reuses the data from the first run, so the
suite is not executed twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 14:32:12 +02:00

1.3 KiB

ForgeFlow architecture audit

Generated 2026-08-23T12:21:43.185Z. Complexity is a deterministic decision-point count used for hotspot ranking, not a claim of exact McCabe complexity.

Files above 750 lines

File Lines Decisions Functions IPC handlers Responsibilities
No findings.

Files above 1,000 lines

File Lines Decisions Functions IPC handlers Responsibilities
No findings.

Cyclomatic hotspots

File Lines Decisions Functions IPC handlers Responsibilities
src/renderer/actions/shell.js 518 101 86 0 inventory, deployment, git, renderer, updates
src/renderer/app.js 732 80 124 0 inventory, deployment, git, renderer, security, updates
src/main/server-inventory.cjs 578 89 104 0 inventory, deployment, git, security, updates
src/main/git-service.cjs 687 111 118 0 git, security
src/main/unraid-inventory-methods.cjs 708 76 93 0 inventory, deployment, git, security, updates

Interpretation

Files above 750 lines require decomposition. Files above 1,000 lines are release blockers unless a concrete technical exception is documented. Mixed responsibility and IPC hotspot lists are available in the JSON report.