Tracewatch

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.2.2更新于 Nov 2, 2026

Observability, tracking, and root-cause for Security Wave scans and findings.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

为本地仓库长期跟踪安全扫描结果,让助手对比扫描、追溯问题来源并查看健康趋势。

可以做什么
  • 对本地仓库路径运行六个 Security Wave 扫描器并保存带时间戳的扫描记录
  • 对比两次扫描,列出新增、已解决、已变更的问题、结论变化与 action ref 事件
  • 追溯单个问题的引入提交、当前行提交、PR 与 ref 历史,并标注证据为已确认、推断或未确立
  • 生成仓库健康报告:结论趋势、按工具与严重度的未解决问题、平均存续时长、检测延迟
  • 按工具、严重度和状态筛选已跟踪问题,并输出单个问题的完整证据包
  • 汇总本地存储:已跟踪仓库、扫描次数、最近扫描、未解决问题数与检测延迟中位数
适用场景
适合已经使用 Security Wave 系列扫描器、希望获得历史而非单次快照的场景:发现两次扫描之间的 pin 回退或 ref 变动、定位引入问题的提交或 PR,以及衡量新内容的检测速度。
运行要求
通过 npx(npm 包)或 Docker 以 stdio 在本地运行。需要本地仓库路径,追溯来源需要 git;查询 PR 需要 GitHub 远程仓库且 API 可访问。存储默认在本地目录,可用参数或 TRACEWATCH_STORE 环境变量覆盖。无需账号,无遥测。
安装前请注意
ingest 与 watch 会扫描本地仓库内容并写入只追加的本地存储;watch 模式轮询目录或 GitHub 仓库并输出 JSONL 告警。存在 GitHub 远程仓库时,来源查询会把提交 SHA 发送到 GitHub API。扫描结论只是扫描结果,并不代表仓库安全。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tracewatch,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

tracewatch

Observability, tracking, and root-cause for the Security Wave.

The Security Wave tools (hookcheck, actionpin, injectcheck, mcpvet, depguard, flowcheck) answer "what is wrong right now, in this one scan." tracewatch is the wave's memory and stopwatch. It ingests their JSON reports over time and answers the questions an incident actually turns on:

  • What changed since the last scan? Did a pin silently regress to a mutable tag? Did the ref under an already-pinned action move? That move is the tj-actions shape from March 2025: a tag retargeted under every repo that trusted it, invisible to anyone who only ever ran one scan.
  • Where did this finding come from? tracewatch blames a finding to the commit that introduced it (git pickaxe on the finding's own content) and to the pull request that carried it, and labels every statement confirmed, inferred, or not established.
  • How fast do we notice? Watch mode scans new issues, PRs, files, and tree changes on arrival and records time-to-detect for each one, so "early detection" is a measured number. The comparison point matters: hosted AI firewalls detect at prompt time, after the agent has already read the content. tracewatch detects at rest and on arrival, before any agent session exists.
  • Is the estate getting better? Verdict trends, open findings by tool and severity, mean time open for resolved findings, and detection latency stats, per repo, over the whole scan history.

Deterministic, offline-first, local store you can grep. No hosted backend, no account, no telemetry.

Install

npx -y @reneturcios/tracewatch --versionnpm install -g @reneturcios/tracewatchdocker run -i --rm ghcr.io/cloudcorprecords/tracewatch mcp

Quick start

# scan a repo with all six tools and start tracking ittracewatch ingest ~/src/myrepo
# what changed since the previous scan?tracewatch diff myrepo
# where did this finding come from?tracewatch blame myrepo --finding tw_0123456789abcdef
# health over timetracewatch report myrepo
# watch a directory and scan new content on arrivaltracewatch watch ~/src/myrepo --interval 30

What it tracks

Every ingest stores one scan record (timestamp, tool versions, verdicts, git HEAD) plus one observation per finding. Findings carry stable IDs: a hash of tool, rule, normalized location, and a content signature. The same finding keeps its identity across scans and tool versions; a content edit keeps the identity and changes the ID version, which is what diff reports as CHANGED.

Diff groups: NEW, RESOLVED, CHANGED (with field-level old to new), verdict moves, and REF EVENTS. A ref event fires whenever an action's ref or classification moves, with both values spelled out:

  • pin-regression: PINNED to MUTABLE or BRANCH
  • pin-improvement: MUTABLE or BRANCH to PINNED
  • ref-move: the ref changed inside one classification (for a pinned action, the SHA itself moved)

Blame (root cause)

tracewatch blame myrepo --rule CURL-PIPE-SH --file package.jsontracewatch blame myrepo --finding tw_0123456789abcdef --json

Evidence is labeled, never blended:

  • CONFIRMED: the introducing commit from git log -S on the finding's needle in your local clone; the current-line commit from git blame; the PR association from the GitHub API (commits/{sha}/pulls) when the clone has a GitHub remote; ref history and first/last seen from the store itself.
  • INFERRED: circumstantial statements, written as inferences (for example, when the introducing commit and the current-line commit differ, the line was rewritten later without introducing the content).
  • NOT ESTABLISHED: whatever could not be proven, with the reason (no clone recorded, no GitHub remote, API unreachable). Provenance is never guessed to fill the page.

Watch and time-to-detect

tracewatch watch ~/src/myrepo --interval 60 --alerts alerts.jsonltracewatch watch owner/repo --path ~/src/myrepo-clone --interval 60

Local mode polls a directory: new or changed text files are scanned with injectcheck the poll they appear in; a git HEAD move triggers a full ingest plus diff. GitHub mode polls an owner/repo slug: new issues and PRs are scanned on arrival, HEAD moves are recorded (and scanned when you pass a local clone with --path). Every detection writes a record with time-to-detect = detection time minus the content's own creation time (issue created_at, commit time, file birth time). State checkpoints after every cycle, so a restarted watch resumes without re-alerting history. Alerts stream as JSONL to stdout and to the --alerts file.

Polling is the portable fallback. The fastest path is event-driven, in CI:

yaml
name: tracewatch-issueson:  issues:    types: [opened, edited]  pull_request:    types: [opened, edited, synchronize]permissions:  contents: readjobs:  scan-new-content:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4      - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4        with:          node-version: 24      - name: Scan the new issue or PR body on arrival        env:          BODY: ${{ github.event.issue.body || github.event.pull_request.body }}        run: |          printf '%s' "$BODY" > /tmp/body.md          npx -y @reneturcios/injectcheck file /tmp/body.md --json > /tmp/report.json          npx -y @reneturcios/tracewatch import ${{ github.repository }} --report injectcheck=/tmp/report.json

Known limit, stated plainly: GitHub watch mode reads through the local ghapi helper, whose output truncates long responses; an issue poll that cannot be parsed in full is logged as a watch note and retried next cycle rather than partially trusted. The CI pattern above has no such limit and is the recommended production path for issue scanning.

Reports

tracewatch report myrepo          # humantracewatch report myrepo --json   # machinetracewatch findings myrepo --tool hookcheck --status open

The health report carries the verdict trend across every scan, open findings by tool and severity, resolved count, mean time open for resolved findings (first-seen scan to the scan where the finding disappeared), all ref events, and detection latency stats (count, median, max, by kind).

MCP

tracewatch mcp serves a stdio MCP server with seven tools:

ToolWhat it does
ingest_scanRun the six tools on a local path and store the scan
diff_scansNEW / RESOLVED / CHANGED, verdict moves, ref events between two scans
finding_provenanceIntroducing commit, current-line commit, PR, ref history for one finding
repo_healthVerdict trend, open findings, mean time open, detection latency
watch_statusEvery tracked repo: scans, last scan, open findings, median TTD
list_findingsTracked findings filtered by tool, severity, status
explain_findingThe full evidence bundle for one finding, written to act on

Store

Append-only JSONL under ~/.tracewatch (override with --store

or TRACEWATCH_STORE): scans.jsonl, findings.jsonl, detections.jsonl, alerts.jsonl, plus watch-state.json checkpoints. Plain text on purpose. Finding status is derived from the observation series on every read, never stored as mutable state, so the store cannot disagree with itself. Identical store state always renders identical diff and report output.

Exit codes: 0 success or no changes, 1 a diff found changes, 2 usage error or total failure, 141 the reader closed the output pipe before the report was delivered.

Honesty rules

  • A verdict is a scan result, never a safety claim. tracewatch reports what the six tools found and when; it does not certify a repo clean.
  • Time-to-detect is measured against the content's own timestamps and recorded per detection; the report shows the distribution, not a best case.
  • Blame separates confirmed evidence from inference and says "not established" out loud.

depguard scope note

depguard findings only exist relative to a comparison: a dependency was added, removed, or changed against a base. tracewatch preserves that context end to end. Every depguard finding carries the base (a git ref, a directory path, or none), the head path, the run mode, and its per-finding change kind and version move, and the scan record carries the same context at scan level, so a diff can say what changed against what.

Direct-run ingest (tracewatch ingest) runs depguard in its offline snapshot mode against the bare target, which surfaces manifest and lockfile findings (including typosquat suspects) with base recorded as none. A full base/head comparison needs a base the bare target does not name: run depguard with --base <ref> or --base-path <dir> yourself and import the report (tracewatch import <repo> --report depguard=<file>), and the diff context lands in the store with the findings.

MIT. Part of the Security Wave: hookcheck (persistence hooks), actionpin (Actions pinning), injectcheck (prompt injection in agent-read content), mcpvet (MCP server and skill vetting), depguard (dependency change guard), flowcheck (workflow permission hardening), tracewatch (observability and root cause).

来源:README.md,提交 6a0f38a

工具

7

ingest_scan

Run hookcheck, actionpin, injectcheck, mcpvet, depguard, and flowcheck against a local repo path and store the results as a timestamped scan record with stable finding IDs. Returns the scan record and every finding observation. Use this to start or refresh tracking for a repo.

输入参数namepath必填tools

diff_scans

Diff two scans of a repo (default: the last two). Reports NEW, RESOLVED, and CHANGED findings, verdict moves, and action ref events with both refs spelled out, including pin regressions (PINNED to MUTABLE or BRANCH) and bare ref moves on pinned actions.

输入参数tofromrepo必填

finding_provenance

Root-cause provenance for one finding: the introducing commit from git pickaxe on the finding's content, the current-line commit from git blame, the associated GitHub PR when the API answers, and the finding's ref history from the scan store. Confirmed evidence, inferences, and unestablished items are reported separately; nothing is guessed.

输入参数pathrepo必填findingId必填

repo_health

Health report for a repo across all its scans: verdict trend, open findings by tool and severity, resolved count, mean time open for resolved findings, all action ref events, and watch detection latency stats (count, median, max time-to-detect).

输入参数repo必填

watch_status

Summarize the tracewatch store: every tracked repo with its scan count, last scan time, open finding count, detection count, and median time-to-detect. Use this to see what is being watched and tracked before drilling into one repo.

无需输入参数。

list_findings

List tracked findings for a repo with derived status. Filter by tool, severity, and status (open, resolved, or all; default open). Each entry carries the stable findingId usable with finding_provenance and explain_finding.

输入参数repo必填toolstatusseverity

explain_finding

The full evidence bundle for one finding, written to act on: the tracked finding (status, first and last seen, content versions), its scan history is summarized in the provenance record, and the provenance itself (introducing commit, PR, ref history, confirmed versus inferred versus not established).

输入参数pathrepo必填findingId必填

版本历史

4
  1. v0.2.2最新Oct 26, 2026
  2. v0.2.1Oct 23, 2026
  3. v0.1.1Oct 23, 2026
  4. v0.1.0Oct 22, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分