feat: knowledge store staleness detector (#92) #179

Closed
Rockachopa wants to merge 1 commits from feat/92-knowledge-staleness-detector into main
Owner

Closes #92

Changes

Added scripts/knowledge_staleness_check.py — detects stale knowledge entries by comparing source file hashes.

How It Works

  1. Reads knowledge/index.json with fact entries
  2. Each entry can have source_file and source_hash fields
  3. Computes current hash of source file and compares to stored hash
  4. Reports stale entries (hash mismatch, missing file, or no hash)

Usage

# Check staleness
python3 scripts/knowledge_staleness_check.py --index knowledge/index.json

# JSON output
python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --json

# Add hashes to entries missing them
python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --fix

# With custom repo root
python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --repo /path/to/repo

Expected Index Format

{
  "facts": [
    {
      "fact": "...",
      "source_file": "path/to/file.py",
      "source_hash": "sha256:abcdef1234",
      "extracted_at": "2026-04-13T20:00:00Z"
    }
  ]
}
Closes #92 ## Changes Added `scripts/knowledge_staleness_check.py` — detects stale knowledge entries by comparing source file hashes. ## How It Works 1. Reads `knowledge/index.json` with fact entries 2. Each entry can have `source_file` and `source_hash` fields 3. Computes current hash of source file and compares to stored hash 4. Reports stale entries (hash mismatch, missing file, or no hash) ## Usage ```bash # Check staleness python3 scripts/knowledge_staleness_check.py --index knowledge/index.json # JSON output python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --json # Add hashes to entries missing them python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --fix # With custom repo root python3 scripts/knowledge_staleness_check.py --index knowledge/index.json --repo /path/to/repo ``` ## Expected Index Format ```json { "facts": [ { "fact": "...", "source_file": "path/to/file.py", "source_hash": "sha256:abcdef1234", "extracted_at": "2026-04-13T20:00:00Z" } ] } ```
Rockachopa added 1 commit 2026-04-15 03:42:14 +00:00
Timmy approved these changes 2026-04-15 04:13:20 +00:00
Timmy left a comment
Owner

Feature implementation reviewed - looks solid.

Scope: 1 file(s) changed (221+ / 0-)

Suggestions

  • Feature PR without tests. Consider adding test coverage.
  • Found 6 print/console.log statements - verify these are not leftover debugging.
Feature implementation reviewed - looks solid. **Scope**: 1 file(s) changed (221+ / 0-) ### Suggestions - Feature PR without tests. Consider adding test coverage. - Found 6 print/console.log statements - verify these are not leftover debugging.
Author
Owner

Closing as this PR cannot be merged (branch protection or conflicts). Please reopen if needed.

Closing as this PR cannot be merged (branch protection or conflicts). Please reopen if needed.
Rockachopa closed this pull request 2026-04-16 01:45:22 +00:00
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Rockachopa reopened this pull request 2026-04-16 02:04:00 +00:00
Author
Owner

Superseded by merged PR #185. Closing as content is already in main.

Superseded by merged PR #185. Closing as content is already in main.
Rockachopa closed this pull request 2026-04-16 02:13:30 +00:00
Rockachopa reopened this pull request 2026-04-16 02:42:03 +00:00
Rockachopa closed this pull request 2026-04-16 02:52:39 +00:00

Pull request closed

Sign in to join this conversation.