Skip to content

fix: green CI — stable enum JSON serialization and clean mypy - #882

Merged
devdanzin merged 1 commit into
mainfrom
fix/ci-mypy-and-enum-roundtrip
Jul 1, 2026
Merged

devdanzin merged 1 commit into
mainfrom
fix/ci-mypy-and-enum-roundtrip

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

Summary

Both CI jobs were failing (surfaced by recent PR runs; both issues pre-existing on main).

jit-tests: test_to_dict_json_roundtrip

CrashSignature.to_dict() left crash_type as a CrashType(str, Enum) member. json.dumps of a str-Enum subclass is version-dependent — some CPython builds emit the value ("C_ASSERTION"), others str(enum) ("CrashType.C_ASSERTION") — so the test passed locally but failed on CI's CPython. Now serializes crash_type.value explicitly for stable, cross-version output.

static-analysis: mypy lafleur (25 errors, 10 files)

All pre-existing (identical count at 4ecede4). Fixed with no runtime behavior change:

  • Telemetry/dynamic keys go through plain-dict views instead of the RunStats TypedDict (artifacts.py timeseries snapshot, orchestrator.py dynamic stat_key, utils.py setdefault).
  • Formatter argument types bridged with casts / corrected annotations (report.py, campaign.py crash-attribution card + lines redefinition, orchestrator.py _format_run_* params).
  • LineageGraph.metadata annotation widened to dict[str, Any]; forest-mode metrics None-guard added.
  • Nits cleared: unused type: ignore (corpus_manager.py), var_map annotation (generic.py), dedent argument (jit_seeds.py), driver main() call.

Test plan

  • mypy lafleur → Success: no issues found in 38 source files (was 25 errors).
  • test_to_dict_json_roundtrip passes; full suite 2169 passed.
  • ruff check + ruff format --check clean.

Closes #881

🤖 Generated with Claude Code

Two CI jobs were failing (surfaced by recent PR runs; both pre-existing):

- jit-tests: CrashSignature.to_dict() left crash_type as a CrashType(str, Enum)
  member. json.dumps of a str-Enum subclass is version-dependent (value vs
  str(enum)), so test_to_dict_json_roundtrip passed locally but failed on CI's
  CPython. Serialize crash_type.value explicitly for stable, cross-version output.

- static-analysis: `mypy lafleur` reported 25 errors in 10 files (present since
  before the recent PRs). Fixed all of them with no runtime behavior change:
  telemetry/dynamic keys go through plain-dict views instead of the RunStats
  TypedDict (artifacts, orchestrator, utils); formatter argument types are bridged
  with casts / corrected annotations (report, campaign, lineage, orchestrator); a
  LineageGraph.metadata annotation and a forest-mode metrics None-guard were
  tightened; and small nits cleared (unused type: ignore, var_map annotation,
  dedent argument, driver main() call).

Closes #881

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@devdanzin
devdanzin merged commit 37e1c29 into main Jul 1, 2026
2 checks passed
@devdanzin
devdanzin deleted the fix/ci-mypy-and-enum-roundtrip branch July 1, 2026 02:18
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.

CI is red: version-dependent enum JSON serialization + 25 pre-existing mypy errors

1 participant