Commit c034829
committed
fix(codex P1 #457): restore deprecated NarsRule + nars_rule() for back-compat
PR #457 removed PearlJunction::nars_rule() + the NarsRule enum
outright. Codex P1 review flagged this as a breaking change for
downstream consumers that imported PR #456's public surface, even
one commit after introduction.
This PR restores both as #[deprecated] shims:
- pub enum NarsRule { Deduction, Induction, Abduction } marked
#[deprecated(since = "0.2.0", note = "...")] - preserved as the
original three-variant alias enum
- PearlJunction::nars_rule() -> Option<NarsRule> marked deprecated
with the same since/note - delegates to the same Chain/ChainRev/
Fork/Collider mapping it had in PR #456
- impl From<NarsRule> for InferenceType - 1:1 migration helper so
consumers can lift the deprecated type to the canonical one
The canonical inference_type() -> Option<InferenceType> method
introduced in PR #457 is the recommended API; the deprecated
shims emit a compile-time warning pointing to it. Removed in a
future major version bump.
Tests:
- deprecated_nars_rule_matches_inference_type (round-trip via From)
- deprecated_nars_rule_none_when_unrelated
- from_nars_rule_lifts_to_inference_type (the From mapping)
All marked #[allow(deprecated)] so they exercise the shim without
triggering the warning.
Net: the public surface of PR #456 remains intact (with deprecation
warnings); new consumers reach for inference_type() + InferenceType;
the duplication-map drift CodeRabbit warned about is constrained
to the deprecated subset and slated for removal in 0.x.0.
Provenance: codex P1 on PR #457 commit 5e3740c.1 parent 063f7df commit c034829
1 file changed
Lines changed: 111 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
102 | 168 | | |
103 | 169 | | |
104 | 170 | | |
| |||
345 | 411 | | |
346 | 412 | | |
347 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
348 | 459 | | |
0 commit comments