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 分