Logdigest

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Oct 27, 2026

Condense a CI log to its failure sections and root-cause lines, with original line anchors.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

把 CI 或測試日誌濃縮成失敗區段與根因行,保留原始行號,並給出 FAILURES-FOUND 或 NO-FAILURES 結論。

可以做什麼
  • 摘要日誌檔:找出錯誤行、測試失敗行與非零結束碼行,依原始行號分成區段,並回傳結論以及總行數與保留行數的統計。
  • 讀取與命令列 --json 輸出相同的報告,包含各規則計數、嚴重程度與擷取的堆疊上下文。
適用情境
適合需要在本機快速檢視冗長的 CI 或測試日誌、想直接看到失敗測試、錯誤行與堆疊開頭而不必讀完上千行的情況。它只是閱讀輔助,不做根因診斷。
執行需求
以本機 stdio 程序執行,可透過 npx 使用 npm 套件,或使用 Docker 映像。npm 方式需要 Node 20 或更新版本。未宣告帳號、API 金鑰或環境變數。工具依路徑讀取使用者電腦上的日誌檔。
安裝前請注意
助理可讀取被指定的任何日誌檔路徑,日誌可能含機密或個人資料並進入對話。偵測採樣式比對,NO-FAILURES 只代表未找到已知失敗樣式。最多輸出前 200 個區段,每行截斷為 200 字元,因此摘要並非日誌全文。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Logdigest,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

logdigest

Condense a log file to its failure evidence.

A CI or test log can run to ten thousand lines, but the part anyone reads is the handful of failure sections: the failing test, the error line, the stack, the nonzero exit. logdigest reads a log file, finds those lines, groups them into sections with their original line numbers, and prints a digest you can read in one screen. It reports a verdict of FAILURES-FOUND when it finds any failure section and NO-FAILURES when it finds none.

Install

sh
npx @reneturcios/logdigest digest build.log

Or install it globally:

sh
npm install -g @reneturcios/logdigest

Requires Node 20 or newer.

CLI

sh
logdigest digest [file] [--json]logdigest mcplogdigest --version
  • logdigest digest <file> prints the human readable digest.
  • logdigest digest <file> --json prints the full report as JSON.
  • logdigest mcp runs the MCP server over stdio (see below).
  • logdigest --version prints the version.

Exit codes: 0 when the verdict is NO-FAILURES, 1 when the verdict is FAILURES-FOUND, 2 for a usage or read error (for example, the target is a directory or cannot be read), and 141 when the reader closed the output pipe early.

Example digest:

text
logdigest digest test.log: FAILURES-FOUND  2 failure section(s) found in 28 line(s): 9 matched line(s).  [HIGH] TEST-FAIL lines 5-16FAIL src/math.test.ts    AssertionError: expected 3 to be 4        at Object.<anonymous> (src/math.test.ts:10:11)  totals: total lines 28, matched lines 9, sections 2, overflow sections 0  by rule: TEST-FAIL 8, ERROR-LINE 1, EXIT-NONZERO 0

(The example above is shortened; the real digest prints every captured line of every section.)

MCP

The same binary is an MCP server:

sh
npx @reneturcios/logdigest mcp

It exposes one tool:

  • digest_log with a path argument (the log file to check). It returns the same report as the CLI --json output.

What it detects

Detection is pattern based. Every matched line is assigned to exactly one rule; when a line matches several patterns, the most specific rule wins (TEST-FAIL over EXIT-NONZERO over ERROR-LINE).

RulePatternsNotes
TEST-FAILFAIL , the word failing (for example 2 failing in a runner summary), ✕, × , not ok (TAP), AssertionError, and the shape expected ... to ...Test runner failures and assertion failures
ERROR-LINEthe word error (any case), Error:, ERR!, fatal:, panic, Traceback, ExceptionGeneric error evidence, including Python tracebacks and npm ERR! lines
EXIT-NONZEROexit code or exited with code followed by a nonzero number, and the phrase command failedAn exit code of 0 is not a match

How sections and verdicts work

  • Matched lines that are within 3 lines of each other form one section. A wider gap starts a new section.
  • After a stack head (a Traceback line, the first at stack line of a run, or a matched line directly followed by a stack line), up to 5 further lines are captured as context, so the top of a stack survives the digest. The capture never crosses into the next section.
  • Each section becomes one finding. Its line is the section's first line number, its evidence is the first matched line, and findings also carry endLine and the captured sectionLines.
  • Severity is high for a TEST-FAIL or ERROR-LINE section that contains a stack head or an assertion, and medium otherwise. An empty log produces one info finding with rule EMPTY-LOG.
  • The report counts totalLines, matchedLines, sections (sections actually emitted), sectionsTotal, overflowSections, and one count per rule.
  • Verdict: FAILURES-FOUND if there is at least one section, otherwise NO-FAILURES. An empty log is NO-FAILURES with the EMPTY-LOG finding above.
  • Findings are capped at 200 sections. Sections past the cap are not emitted, but they are counted in overflowSections so the report never silently truncates.
  • In the human readable digest, each section prints its line range followed by its captured lines verbatim, trimmed to 200 characters per line, then the totals. Output is deterministic: it is a pure function of the file contents, with no timestamps.

Limits

  • Detection is pattern based, so a log that phrases a failure in a novel way, with none of the shapes in the table above, can be missed. A NO-FAILURES verdict means "no known failure shape was found", not a proof that the run succeeded.
  • logdigest condenses; it does not diagnose. It surfaces the failure lines and their immediate context, but root cause analysis beyond the lines it surfaces is up to the reader.
  • Only the first 200 sections are emitted (the rest are counted), and rendered lines are trimmed to 200 characters, so a digest is a starting point for reading the original log, not a copy of it. The original line numbers are always preserved so any section can be found in the source log.

Development

sh
npm installnpm run buildnpm test

The core is in src/core.ts and uses only the Node standard library.

來源:README.md,提交 a673376

工具

1

digest_log

Digest a log file: finds error and failure lines (test failures, stack heads, nonzero exits, error keywords), groups them into sections with original line numbers, counts total lines versus kept lines, and returns a verdict of FAILURES-FOUND or NO-FAILURES plus the condensed digest.

輸入參數path必填

版本歷史

1
  1. v0.1.0最新Oct 25, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分