From b022d362dd6915564839e5dc0538e9133be5b910 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Sun, 2 Aug 2026 20:21:19 -0400 Subject: [PATCH] chore(hardening): refresh filesystem inventory --- docs/reports/hardening-inventory.json | 88 ++++++++++++++------------- docs/reports/hardening-inventory.md | 12 ++-- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/docs/reports/hardening-inventory.json b/docs/reports/hardening-inventory.json index ccbd41b6..976dbcc2 100644 --- a/docs/reports/hardening-inventory.json +++ b/docs/reports/hardening-inventory.json @@ -1,11 +1,30 @@ { "scope": "src/**/*.{ts,tsx,js,jsx,mjs,cjs}", "syncFs": { - "totalOccurrences": 2388, - "filesAffected": 257, - "hotpathOccurrences": 1103, - "hotpathFilesAffected": 151, + "totalOccurrences": 2427, + "filesAffected": 258, + "hotpathOccurrences": 1142, + "hotpathFilesAffected": 152, "topHotpathFiles": [ + { + "file": "src/management/shared-manager/diverged-file-adopter.ts", + "count": 39, + "calls": [ + "closeSync", + "fsyncSync", + "linkSync", + "lstatSync", + "openSync", + "readdirSync", + "readFileSync", + "readlinkSync", + "renameSync", + "statSync", + "unlinkSync", + "writeFileSync" + ], + "markers": [] + }, { "file": "src/utils/browser/mcp-installer.ts", "count": 32, @@ -139,24 +158,6 @@ "statSync" ], "markers": [] - }, - { - "file": "src/utils/claude-dir-installer.ts", - "count": 21, - "calls": [ - "copyFileSync", - "cpSync", - "existsSync", - "lstatSync", - "mkdirSync", - "readdirSync", - "renameSync", - "rmSync", - "statSync", - "unlinkSync", - "writeFileSync" - ], - "markers": [] } ], "topFilesOverall": [ @@ -227,6 +228,25 @@ ], "markers": [] }, + { + "file": "src/management/shared-manager/diverged-file-adopter.ts", + "count": 39, + "calls": [ + "closeSync", + "fsyncSync", + "linkSync", + "lstatSync", + "openSync", + "readdirSync", + "readFileSync", + "readlinkSync", + "renameSync", + "statSync", + "unlinkSync", + "writeFileSync" + ], + "markers": [] + }, { "file": "src/cliproxy/executor/__tests__/variant-port-integration.test.js", "count": 36, @@ -282,20 +302,6 @@ "writeFileSync" ], "markers": [] - }, - { - "file": "src/cliproxy/__tests__/session-tracker-port.test.js", - "count": 31, - "calls": [ - "existsSync", - "mkdirSync", - "readdirSync", - "readFileSync", - "rmSync", - "unlinkSync", - "writeFileSync" - ], - "markers": [] } ] }, @@ -573,8 +579,8 @@ }, "loggerCoverage": { "filesWithCreateLogger": 65, - "totalSourceFiles": 758, - "coverageRatio": 0.0858, + "totalSourceFiles": 759, + "coverageRatio": 0.0856, "subdomainsWithZeroCreateLogger": [ "api", "bin", @@ -609,12 +615,12 @@ "withLogger": 1 }, { - "subdomain": "cliproxy/auth", - "count": 32, + "subdomain": "management", + "count": 33, "withLogger": 1 }, { - "subdomain": "management", + "subdomain": "cliproxy/auth", "count": 32, "withLogger": 1 }, diff --git a/docs/reports/hardening-inventory.md b/docs/reports/hardening-inventory.md index 79b13f92..0b8a3082 100644 --- a/docs/reports/hardening-inventory.md +++ b/docs/reports/hardening-inventory.md @@ -6,10 +6,10 @@ Scope: `src/**/*.{ts,tsx,js,jsx,mjs,cjs}` | Metric | Value | |---|---:| -| Sync fs occurrences (all) | 2388 | -| Sync fs files affected (all) | 257 | -| Sync fs occurrences (runtime hotpaths) | 1103 | -| Sync fs files affected (runtime hotpaths) | 151 | +| Sync fs occurrences (all) | 2427 | +| Sync fs files affected (all) | 258 | +| Sync fs occurrences (runtime hotpaths) | 1142 | +| Sync fs files affected (runtime hotpaths) | 152 | | Legacy shim markers | 458 | | Legacy shim files affected | 173 | @@ -17,6 +17,7 @@ Scope: `src/**/*.{ts,tsx,js,jsx,mjs,cjs}` | File | Sync Calls | API Names | |---|---:|---| +| `src/management/shared-manager/diverged-file-adopter.ts` | 39 | closeSync, fsyncSync, linkSync, lstatSync, openSync, readdirSync, readFileSync, readlinkSync, renameSync, statSync, unlinkSync, writeFileSync | | `src/utils/browser/mcp-installer.ts` | 32 | chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync | | `src/utils/image-analysis/mcp-installer.ts` | 30 | chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync | | `src/utils/claude-symlink-manager.ts` | 27 | copyFileSync, existsSync, lstatSync, mkdirSync, readdirSync, readlinkSync, renameSync, rmSync, statSync, symlinkSync, unlinkSync | @@ -26,7 +27,6 @@ Scope: `src/**/*.{ts,tsx,js,jsx,mjs,cjs}` | `src/cliproxy/services/variant-settings.ts` | 23 | existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync | | `src/management/recovery-manager.ts` | 23 | copyFileSync, existsSync, lstatSync, mkdirSync, renameSync, statSync, unlinkSync, writeFileSync | | `src/utils/shell-completion.ts` | 23 | appendFileSync, copyFileSync, existsSync, mkdirSync, readFileSync, statSync | -| `src/utils/claude-dir-installer.ts` | 21 | copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync | ## Top Legacy Shim Marker Files @@ -60,7 +60,7 @@ Scope: `src/**/*.{ts,tsx,js,jsx,mjs,cjs}` | typed-error adoption (P4 locked subdomains) | 93.3% (28/30), target 40% | | hotpath console.error/warn occurrences | 266 (571 total, 305 CLI-UX exempt) | | hotpath console.error/warn files | 82 | -| files with createLogger | 65/758 | +| files with createLogger | 65/759 | | subdomains with zero createLogger | 15 (api, bin, channels, cliproxy, cliproxy/accounts, cliproxy/ai-providers, cliproxy/binary, cliproxy/config, cliproxy/management, cliproxy/sync, cliproxy/types, config, dispatcher, shared, types) | | files > 400 LOC | 91 | | files > 600 LOC | 42 |