This report summarizes scanner evidence for YuJunZhiXue/dsh-purge. SynthScan examined 56,984 lines of code across 87 source files, recording 113 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 2.6 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 86 finding(s).
Are imports declared and package/API names verified? 5 finding(s).
Are wrappers, guards, and repeated structures necessary? 102 finding(s).
Which changes need focused human review? 113 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 113 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/profile-insert.js | 28 | export function profileHasPurgeBodyInsert(text) { | CODE |
| LOW | lib/profile-insert.js | 226 | export function validateAllowBuildRewrite(text) { | CODE |
| LOW | lib/profile-insert.js | 352 | export function ensureAllProfileBodyInserts(dshHome) { | CODE |
| LOW | lib/core.js | 313 | function findAiBaseFromRunningProcess() { | CODE |
| LOW | lib/core.js | 360 | export function isDesktopCommandRuntimeDir(dir) { | CODE |
| LOW | lib/core.js | 364 | export function listDesktopCommandRuntimeDirs() { | CODE |
| LOW | lib/core.js | 605 | export function silenceSubprocessLocalFlash(dshHome = findDshHome()) { | CODE |
| LOW | lib/core.js | 708 | export function silenceLiangshenCustomBashFlash(dshHome = findDshHome()) { | CODE |
| LOW | lib/core.js | 755 | function listLiangshenCustomBashFiles(dshHome) { | CODE |
| LOW | lib/core.js | 943 | export function liangshenPromptFilterText(text) { | CODE |
| LOW | lib/core.js | 952 | function listLiangshenMinimalPromptFiles(dshHome) { | CODE |
| LOW | lib/core.js | 979 | export function keepLiangshenOperatorPrompt(dshHome = findDshHome()) { | CODE |
| LOW | lib/core.js | 1056 | function listLiangshenBootstrapFiles(dshHome) { | CODE |
| LOW | lib/core.js | 1375 | export function silenceDshmarketRestartFlash(dshHome = findDshHome()) { | CODE |
| LOW | lib/core.js | 1462 | function listDshmarketRestartFiles(dshHome) { | CODE |
| LOW | lib/core.js | 2227 | export function repairOfficialCliAfterUnpack(exe) { | CODE |
| LOW | lib/core.js | 2240 | export function scheduleSealedDesktopRestart(handoff) { | CODE |
| LOW | lib/core.js | 2346 | export function restartSealedDesktopIfNeeded(input = {}) { | CODE |
| LOW | lib/core.js | 2368 | export function rememberDesktopInstallForHandoff(handoff) { | CODE |
| LOW | lib/core.js | 2458 | export function committedOverrideRevision() { | CODE |
| LOW | lib/core.js | 2463 | export function rememberCommittedOverride(dshHome, text) { | CODE |
| LOW | lib/core.js | 2593 | function replacementPrecedenceRewrites(name) { | CODE |
| LOW | lib/core.js | 4286 | "function dshPurgeHandoffDesktopUpdate(owner) {\n" + | CODE |
| LOW | lib/core.js | 4338 | pattern: "function dshPurgeHandoffDesktopUpdate(owner) {", | CODE |
| LOW | lib/core.js | 4345 | "function dshPurgeHandoffDesktopUpdate(owner) {", | CODE |
| LOW | lib/core.js | 6169 | export async function dropStaleUserProfilePatchBackups(dshHome = findDshHome()) { | CODE |
| LOW | lib/core.js | 6218 | export function restoreMissingOriginalsFromBak(aiBase) { | CODE |
| LOW | lib/core.js | 6255 | export function restoreMissingOriginalsAllHosts(options = {}) { | CODE |
| LOW | lib/core.js | 6281 | export function refreshStaleBaksForUpgrade(aiBase) { | CODE |
| LOW | lib/core.js | 6839 | function isDisposableYamlFoldParagraph(para) { | CODE |
| LOW | lib/core.js | 6880 | function yamlStripDisposableFoldParas(bodyLines) { | CODE |
| LOW | lib/core.js | 6896 | function yamlHasDisposableFoldParagraph(bodyLines) { | CODE |
| LOW | lib/core.js | 6904 | function emptyDisposableFoldedYaml(text) { | CODE |
| LOW | lib/core.js | 6936 | function stripOrphanYamlAfterEmptyScalars(text) { | CODE |
| LOW | lib/core.js | 6951 | export function sanitizeYamlPersonaScalars(text) { | CODE |
| LOW | lib/core.js | 6988 | export function collapseDuplicateLegacyApplyPath(text) { | CODE |
| LOW | lib/core.js | 7020 | function rewriteStaleLegacyApplyCall(text) { | CODE |
| LOW | lib/core.js | 7520 | export function patchWatchedClientBundlesSync(aiBase = findAiBase()) { | CODE |
| LOW | lib/core.js | 7872 | export function sanitizeDesktopCommandRuntimes() { | CODE |
| LOW | lib/core.js | 7931 | function officialBinJsNearLauncher(fp) { | CODE |
| LOW | lib/core.js | 8239 | export function isUserCustomizedOverrideSync(dshHome) { | CODE |
| LOW | lib/core.js | 8283 | export function syncPromptInjectOnDiskSync(dshHome) { | CODE |
| LOW | lib/core.js | 8578 | export function healOfficeSkillsRuntimeOnDisk(extraSources) { | CODE |
| LOW | lib/reapply.js | 64 | function refreshStaleApplyPlaceholder(sha) { | CODE |
| LOW | lib/reapply.js | 116 | export function hostStillHasAppliedPatches() { | CODE |
| LOW | lib/reapply.js | 160 | export async function patchesMatchInstallStrict() { | CODE |
| LOW | lib/reapply.js | 183 | export function patchesLostAfterHostReset() { | CODE |
| LOW | lib/preset-default.js | 50 | function repairSelectedDefaultInYaml(text, fallback = FALLBACK_PRESET) { | CODE |
| LOW | lib/preset-default.js | 152 | export function clearOwnedSelectedDefault({ ctx = null, dshHome = "" } = {}) { | CODE |
| LOW | lib/preset-default.js | 175 | export function scheduleClearOwnedSelectedDefault(opts = {}) { | CODE |
| LOW | lib/preset-default.js | 188 | export function cancelClearOwnedSelectedDefault() { | CODE |
| LOW | lib/preset-default.js | 194 | export function removeStaleAgentPresetDir(dshHome, id = "redteam") { | CODE |
| LOW | lib/skills.js | 91 | function assertImportSourceOutsideSkills(dshHome, srcPath) { | CODE |
| LOW | lib/index.js | 533 | function installMnemonMessageStrip(ctx, config = {}) { | CODE |
| LOW | lib/index.js | 725 | function shouldKeepFreshFullAccess(session, svc) { | CODE |
| LOW | lib/index.js | 735 | function upgradeFreshSessionAccess(ctx, session) { | CODE |
| LOW | lib/index.js | 814 | function installRewindDeriveFilter(ctx) { | CODE |
| LOW | lib/hide-console.js | 75 | export function installChildProcessImportHook() { | CODE |
| LOW | lib/hide-console.js | 235 | export function installHideConsoleIntoBin(aiBase, { fs, path: nodePath } = {}) { | CODE |
| LOW | lib/restart-desktop.js | 263 | function killOtherDesktopProcesses(keepPid, exe = info.execPath) { | CODE |
| 20 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/redteam-setup.sh | 2 | # ───────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 20 | # ───────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 44 | # ── 输出工具 ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 84 | # ── 工具函数 ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 181 | # ───────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 186 | # ═══ ① 工具安装 ════════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 302 | # ═══ ② nuclei 模板 ═════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 320 | # ═══ ③ 配置:FOFA_KEY 与 VPS ══════════════════════════════════════════════ | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 435 | # ═══ ④ 体检表 ══════════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | scripts/redteam-setup.sh | 456 | # ═══ ⑤ 完成标记 ════════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 25 | # ── identity ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 140 | # ── shell ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 157 | # ── filesystem ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 169 | # ── background jobs ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 181 | # ── skills ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 210 | # ── goals ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 221 | # ── plan mode ─────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 247 | # ── compaction ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 278 | # ── delegation and workflows ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | presets/redteam/agent.cordis.yml | 376 | # ── remaining model-facing rows ───────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/redteam/skill-availability.js | 316 | addIssue('placeholder', p + '还是占位符(技能里写的是占位符,说明本机/本环境还没配)', { placeholder: p }) | CODE |
| LOW | lib/redteam/skill-fixes.js | 458 | * `kind` ∈ `'file-missing' | 'content-missing' | 'env-missing' | 'path-missing' | 'placeholder' | 'shadowed'`。 | COMMENT |
| LOW | lib/redteam/skill-fixes.js | 504 | } else if (kind === 'placeholder') { | CODE |
| LOW | lib/redteam/index.js | 118 | return { text: text.split(SKILLS_PLACEHOLDER).join(BUNDLED_SKILLS_EXPR), changed: true, reason: 'placeholder' } | CODE |
| LOW | lib/redteam/index.js | 410 | ? (rendered.reason === 'placeholder' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/redteam-setup.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | lib/web-reclaim.js | 1 | // #197:Web「应用 → 自动重启」用 detached 子进程接管 server,父进程 250ms 后退出, | COMMENT |
| LOW | lib/index.js | 261 | function installHungPromptGlobal() { | COMMENT |
| LOW | presets/redteam/agent.cordis.yml | 1 | # The `redteam` agent preset: 攻防演练红队指挥智能体(由 standard 复制改造)。 | COMMENT |
| LOW | presets/redteam/agent.cordis.yml | 181 | # ── skills ────────────────────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | presets/redteam/agent.cordis.yml | 3 | # This file is an AGENT-PLANE composition. The roster mounts it ONCE under a | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/redteam-setup.sh | 106 | except Exception: sys.exit(1) | CODE |
| LOW | scripts/redteam-setup.sh | 118 | except Exception: sys.exit(0) | CODE |