Add differential pair point-to-point error - #686
Closed
0hmX wants to merge 2 commits into
Closed
Conversation
0hmX
marked this pull request as ready for review
August 5, 2026 00:05
Comment on lines
+23
to
+58
| test("source_differential_pair_not_point_to_point_error schema parses and defaults its identifiers", () => { | ||
| const error = | ||
| source_differential_pair_not_point_to_point_error.parse(errorInput) | ||
|
|
||
| expect(error.error_type).toBe( | ||
| "source_differential_pair_not_point_to_point_error", | ||
| ) | ||
| expect(error.source_differential_pair_not_point_to_point_error_id).toMatch( | ||
| /^source_differential_pair_not_point_to_point_error_/, | ||
| ) | ||
| expect(error.connection_polarity).toBe("positive") | ||
| expect(error.connected_source_port_ids).toEqual([ | ||
| "source_port_1", | ||
| "source_port_2", | ||
| "source_port_3", | ||
| ]) | ||
| const circuitJsonError: CircuitJsonError = error | ||
| expect(circuitJsonError.type).toBe( | ||
| "source_differential_pair_not_point_to_point_error", | ||
| ) | ||
| }) | ||
|
|
||
| test("any_circuit_element includes source_differential_pair_not_point_to_point_error", () => { | ||
| const parsed = any_circuit_element.parse(errorInput) | ||
|
|
||
| expect(parsed.type).toBe("source_differential_pair_not_point_to_point_error") | ||
| }) | ||
|
|
||
| test("source_differential_pair_not_point_to_point_error validates polarity", () => { | ||
| expect(() => | ||
| source_differential_pair_not_point_to_point_error.parse({ | ||
| ...errorInput, | ||
| connection_polarity: "neutral", | ||
| }), | ||
| ).toThrow() | ||
| }) |
Contributor
There was a problem hiding this comment.
This test file contains 3 test(...) calls (at lines 23, 45, and 51), but the rule states that a *.test.ts file may have AT MOST one test(...). The file should be split into multiple numbered files, for example:
source-differential-pair-not-point-to-point-error1.test.ts(schema parses and defaults its identifiers)source-differential-pair-not-point-to-point-error2.test.ts(any_circuit_element includes the error)source-differential-pair-not-point-to-point-error3.test.ts(validates polarity)
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
seveibar
requested changes
Aug 5, 2026
seveibar
left a comment
Contributor
There was a problem hiding this comment.
too specific, use props warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source_differential_pair_not_point_to_point_errorCircuit JSON elementCircuitJsonErrorunionsWhy
RFC tscircuit/rfc#13 requires branched differential-pair conductors to produce an actionable error. Core needs a durable Circuit JSON diagnostic so the error survives serialization and can be displayed by downstream tools.
Developer impact
This PR only adds the schema contract. A follow-up Core PR will emit the error during source design-rule checks and keep invalid differential-pair constraints out of autorouter input.
Validation
bun test(287 passed)bun run lint:zodbun run check-snake-casetsc --noEmitbun run buildgit diff --checkAll GitHub Actions checks are green.