Skip to content

[Extension]: Add logreduce (Log Intake) #4800

Description

@alexcpn

Extension ID

logreduce

Extension Name

Log Intake (logreduce)

Version

0.3.1

Description

Reduce large logs attached to a bug report into .specify/bugs/<slug>/evidence.md before assessment. This is a log-intake step for the bundled bug triage workflow: /speckit.bug.assess, fix and test then work from one saved, reduced log instead of each re-reading a raw log that may run to thousands or millions of lines.

Author

Alex Punnen

Repository URL

https://github.com/alexcpn/log_tfidf_reducer

Download URL

https://github.com/alexcpn/log_tfidf_reducer/releases/download/v0.3.1/logreduce-speckit.zip

License

Apache-2.0

Homepage (optional)

https://github.com/alexcpn/log_tfidf_reducer/tree/main/speckit

Documentation URL (optional)

https://github.com/alexcpn/log_tfidf_reducer/blob/main/speckit/README.md

Changelog URL (optional)

https://github.com/alexcpn/log_tfidf_reducer/blob/main/speckit/CHANGELOG.md

Required Spec Kit Version

=0.9.0

Required Tools (optional)

  • logreduce (>=0.3.1) - required. A single static binary from the same repository's releases, or cargo install logreduce.

Number of Commands

1

Number of Hooks (optional)

1

Tags

bug, logs, triage, debugging

Key Features

  • /speckit.logreduce.intake runs logreduce (TF-IDF over masked log templates, plus severity weighting) on each log in a bug report, with a token budget (default 8k).
  • Writes .specify/bugs/<slug>/evidence.md: source path, original line count, the exact command, stats, and the reduced log. It appends a dated section on re-runs and never overwrites.
  • Reuses the bug extension's slug resolution and handoff, so the evidence sits next to assessment.md / fix.md / test.md.
  • Guardrails: writes only inside BUG_DIR, treats log content as untrusted data, and keeps secret/PII redaction on.
  • Registers an optional before_bug_assess hook. That event is proposed in [Feature]: Hook events for the bundled bug extension commands #4799; until it exists, the command is run by hand before /speckit.bug.assess.

Testing Checklist

  • Extension installs successfully via download URL
  • All commands execute without errors
  • Documentation is complete and accurate
  • No security vulnerabilities identified
  • Tested on at least one real project

Submission Requirements

  • Valid extension.yml manifest included
  • README.md with installation and usage instructions
  • LICENSE file included
  • GitHub release created with version tag
  • All command files exist and are properly formatted
  • Extension ID follows naming conventions (lowercase-with-hyphens)

Testing Details

Tested on: Linux (Pop!_OS 22.04, kernel 6.9) with Specify CLI 1.0.14, Claude Code integration.

Test project: a fresh specify init scratch project with the bundled bug extension installed.

Real-world testing: logreduce was run on the logs attached to real bug reports in five open-source GitHub repositories (open-webui, koreader, aws-toolkit-visual-studio, Pehkui, diagonal-fences). Logs ranged from 817 to 30,003 lines, and the root cause was kept in every case. The cases, reduced outputs and results are in evidence/.

Test scenarios:

  • specify extension add logreduce --from <the download URL above> installs the extension, registers the command as a Claude skill, and adds before_bug_assess to .specify/extensions.yml.
  • specify extension add --dev speckit/ from a checkout also works.
  • /speckit.logreduce.intake slug=crash-test crash_loop.log (a 503-line crash-loop log) produced .specify/bugs/crash-test/evidence.md: 503 → 180 lines, 9.9k → 3.7k tokens. It recorded the command and stats and suggested /speckit.bug.assess slug=crash-test as the next step.

Security review (0.3.1): the extension was reviewed before submission, and the fixes shipped in v0.3.1 (PR #3):

  • Paths from the bug report are treated as untrusted. Any path with shell metacharacters is skipped before a command runs on it. Paths outside the project, under .git/, or dotfiles need the user's confirmation and are skipped in hook mode. Commands pass the path as -- '<path>'.
  • evidence.md resists prompt injection. It opens with an "untrusted log data" banner, and each reduced log is fenced with more backticks than any run inside it, so a log line cannot end the code block.
  • Redaction gaps are closed: JSON "api_key": "…", quoted values with spaces, URL passwords, Authorization: Basic, and --password <value>. These are covered by regression tests, alongside a test that benign lines are left untouched.
  • Scope: slugs are limited to [a-z0-9-], writes stay inside BUG_DIR, redaction cannot be turned off from the command, and the binary makes no network calls.

Example Usage

# Install the logreduce binary (see the releases page), then:
specify extension add bug
specify extension add logreduce --from https://github.com/alexcpn/log_tfidf_reducer/releases/download/v0.3.1/logreduce-speckit.zip
/speckit.logreduce.intake slug=deploy-timeout ci/run-4812.log
/speckit.bug.assess slug=deploy-timeout Deploy step times out; evidence in .specify/bugs/deploy-timeout/evidence.md

Proposed Catalog Entry

{
  "logreduce": {
    "name": "Log Intake (logreduce)",
    "id": "logreduce",
    "description": "Reduce large logs attached to a bug report into .specify/bugs/<slug>/evidence.md before assessment",
    "author": "Alex Punnen",
    "version": "0.3.1",
    "download_url": "https://github.com/alexcpn/log_tfidf_reducer/releases/download/v0.3.1/logreduce-speckit.zip",
    "sha256": "97a495b3ad823a36ad6da9d01127c8121954d464531e61eed21d2f052f04bb47",
    "repository": "https://github.com/alexcpn/log_tfidf_reducer",
    "homepage": "https://github.com/alexcpn/log_tfidf_reducer/tree/main/speckit",
    "documentation": "https://github.com/alexcpn/log_tfidf_reducer/blob/main/speckit/README.md",
    "changelog": "https://github.com/alexcpn/log_tfidf_reducer/blob/main/speckit/CHANGELOG.md",
    "license": "Apache-2.0",
    "requires": {
      "speckit_version": ">=0.9.0",
      "tools": [
        { "name": "logreduce", "version": ">=0.3.1", "required": true }
      ]
    },
    "provides": { "commands": 1, "hooks": 1 },
    "tags": ["bug", "logs", "triage", "debugging"],
    "verified": false,
    "downloads": 0,
    "stars": 0,
    "created_at": "2026-09-30T00:00:00Z",
    "updated_at": "2026-10-01T00:00:00Z"
  }
}

Additional Context

  • The extension lives in the speckit/ subdirectory of the logreduce repository (speckit/extension.yml). Its version (0.3.1) matches the release tag that ships it (v0.3.1), and the archive includes LICENSE.
  • Companion feature request for the hook events: [Feature]: Hook events for the bundled bug extension commands #4799.
  • Submission prepared and filed with Claude Code (Claude Opus 5.5) on the author's behalf.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions