Skip to content

Eliminate null values from MPN fields in JSON output#39

Merged
valentinozegna merged 1 commit into
mainfrom
fix/remove-null-mpn-values
Mar 2, 2026
Merged

Eliminate null values from MPN fields in JSON output#39
valentinozegna merged 1 commit into
mainfrom
fix/remove-null-mpn-values

Conversation

@valentinozegna
Copy link
Copy Markdown
Contributor

Summary

  • Omit the mpn key entirely when MPN data is missing instead of emitting "mpn": null
  • The notes field already explains why MPN is unavailable, so null values add no information and waste tokens
  • Updated schemas, tool docs, types, service layer, parser, and tests

Test plan

  • npm run type-check passes
  • npm run lint passes
  • npm test passes (299/299)
  • MCP-level validation across all 4 test fixtures confirms no null values in output

Omit the mpn key entirely when MPN data is missing instead of emitting
"mpn": null. The notes field already explains why MPN is unavailable,
so the null value adds no information and wastes tokens.

Changes:
- types.ts: mpn fields changed from string | null to optional string
- service.ts: conditional property assignment instead of null
- pstxprt-parser.ts: parser no longer produces null MPN values
- circuit-traversal.ts: internal types aligned
- docs/: schemas and tool docs updated to reflect omission behavior
- tests: assertions updated from toBeNull to toBeUndefined
@valentinozegna valentinozegna merged commit d5775b9 into main Mar 2, 2026
2 checks passed
@valentinozegna valentinozegna deleted the fix/remove-null-mpn-values branch March 2, 2026 23:55
@valentinozegna valentinozegna mentioned this pull request Mar 2, 2026
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.

1 participant