Skip to content

[Bug]: malformed learning sidecar data can hide valid annotations #5019

Closed

Description

@azizur100389

Reproduction

Confirmed on v8 at 59b5ab11 (0.9.102), Python 3.12 on Windows. No LLM or API credentials are needed.

Next to graph.json, save .graphify_learning.json containing {"nodes":{"bad":{"source_file":["app.py"]},"good":{"status":"preferred","score":2}}}. Call graphify.reflect.load_learning_overlay with the graph path. A second reproduction is a sidecar containing JSON null or [].

Actual behavior

A non-string source raises TypeError while resolving a path. The MCP loader catches the exception and drops the entire overlay, including healthy entries. A non-object JSON root raises AttributeError before entries are read.

Expected behavior

Treat a malformed root as an empty optional overlay, and keep healthy entries when an individual row is malformed.

The change concerns sidecar input handling. The staleness characterization in #4996 exercises the existing behavior for well-formed entries.

Activity

  1. github-actions commented on Nov 5, 2026

    @github-actions

    Thanks for opening this issue, @azizur100389. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. safishamsi commented on Nov 8, 2026

    @safishamsi
    Member

    Fixed in 0.9.104 (now on PyPI) via #5024: a malformed learning-overlay entry is now skipped instead of crashing the load, and a legacy null-source entry is preserved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions