refactor(opy-compiler): remove dead compile_source entry and CompileError - #50
Merged
Conversation
…rror compile_source had zero callers repo-wide (the crate's own tests bypass it via opy_frontend::compile + compile_hir), so it was an untested front door. Its only product, CompileError, had no readers either. CompilationArtifact::link_report was write-only; tests use the Compiler::link_report() accessor, which is unchanged. Entropy audit candidate 1 (Risk B): cut the never-validated convenience surface instead of keeping it as a false promise; reintroduce with a real consumer when one exists.
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
Entropy-audit cut (2026-08-22 audit, candidate 1, Risk B): removes the
never-used source convenience entry point from
opy-compiler.Compiler::compile_source+CompileError— zero callers repo-wide(including every other WrightKit repository; no cross-repo consumer
exists). The crate's own tests deliberately bypass it
(
opy_frontend::compile(...)+compiler.compile_hir(&hir)), so theadvertised front door was never executed anywhere, and
CompileErrorexisted only as its return type with no readers.
CompilationArtifact::link_reportfield — write-only; tests read thesame fact through the unchanged
Compiler::link_report()accessor, whichstays.
Nothing else in the crate's surface changes:
compile_hir,cross_check_manifest,LinkReport,IntegrationDiagnostic,IntegrationError,WORKSHOP_RS_VERSION, andCompilationArtifact'sremaining fields are untouched.
Tradeoff
A one-step "source in, artifact out" convenience is lost. It was an
untested promise rather than a capability; reintroduce it together with a
real consumer (e.g. a future compile CLI) so it is actually exercised.
Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features(all suites green)python3 -m unittest discover -s compatibility/tests(20 tests OK)rg compile_source|CompileErrorover the repo, docs, and compatibilitydata: zero stale references