Skip to content

fix(pipeline): drop transient BlameIndex before serialization - #323

Merged
RaghavChamadiya merged 1 commit into
mainfrom
fix/artifact-serialization-robustness
May 30, 2026
Merged

RaghavChamadiya merged 1 commit into
mainfrom
fix/artifact-serialization-robustness

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

Problem

Indexing FULL-tier repos with real git history crashed with Object of type BlameIndex is not JSON serializable. The per-file BlameIndex is an in-memory-only signal (consumed by the function_hotspot / code_age_volatility biomarkers) but it was being attached to the git-metadata dicts that escape the pipeline in PipelineResult.git_metadata_list. Any JSON serialization of git metadata then raised — aborting the whole artifact build so the repo ended up with no graph/decisions/docs.

Fix

Strip the transient signal once the health phase has consumed it, in both the full pipeline (orchestrator) and the incremental update path, via a shared drop_transient_git_signals() helper.

  • DB persistence already filtered blame_index out by column, so this is behaviour-preserving for OSS DB users.
  • Fixes any JSON artifact writer that serializes git_metadata_list.

Tests

tests/unit/pipeline/test_drop_transient_git_signals.py — verifies the key is dropped, other fields are preserved, the result is JSON-serializable, the shared git_meta_map view is cleaned, and the op is idempotent. Full health/pipeline suites pass (264 tests).

The per-file BlameIndex is an in-memory-only signal consumed by the health
biomarkers (function_hotspot / code_age_volatility); its own docstring notes
it must never round-trip through the DB or artifacts. It was being attached to
the git-metadata dicts that escape the pipeline in PipelineResult.git_metadata_list,
so any JSON serialization of git metadata raised "Object of type BlameIndex is
not JSON serializable", aborting the whole artifact build.

Strip it once the health phase has consumed it, in both the full pipeline
(orchestrator) and the incremental `update` path, via a shared
drop_transient_git_signals() helper. DB persistence already filtered it out by
column, so this is behaviour-preserving for OSS DB users and fixes JSON
artifact writers (e.g. the hosted backend's git_metadata.json).
@RaghavChamadiya
RaghavChamadiya requested a review from swati510 as a code owner May 30, 2026 13:00
@RaghavChamadiya
RaghavChamadiya merged commit 9a435b9 into main May 30, 2026
5 checks passed
@RaghavChamadiya
RaghavChamadiya deleted the fix/artifact-serialization-robustness branch May 30, 2026 13:04
RaghavChamadiya added a commit that referenced this pull request May 30, 2026
Bump version to 0.15.1 across pyproject, package __init__ files, web
footer, and uv.lock; add changelog entry.

Patch release shipping two fixes:
- mcp: surface embedder init failure instead of silent mock fallback (#324)
- pipeline: drop transient BlameIndex before serialization (#323)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants