[travsr-plugin-host, travsr-daemon, travsr-mcp, travsr-cli] derive the Phase B warning classes from one source - #792
Open
ritikpal1122 wants to merge 2 commits into
Conversation
…e Phase B warning classes from one source Ten warning classes were written in one place and restated in three: the CLI status renderer, the MCP decoder, and the test meant to keep them in step. The test was a third hand-written list, so a class missing from both a consumer and that list was invisible to it. zero_nodes and needs_consent sat in that hole until Travsr-com#752 read the producer against the consumers by hand. An unhandled class is not a cosmetic loss. It falls through to the availability ladder and can surface as a terminal `done`, telling the user a language succeeded when it did not. PhaseBWarningClass is now the one definition. The daemon formats entries from it, and each consumer's guard iterates ALL and asserts that consumer handles every variant, so adding a class without teaching both fails the build and there is no third list to maintain. It lives in travsr-plugin-host because that is where the classes come from: every variant is one field of PhaseBOutcome, which this crate produces. It is also the only crate all three surfaces already depend on. travsr-daemon depends on travsr-mcp, so the daemon cannot hold a definition travsr-mcp reads. The ten tags are byte-identical to the strings the daemon wrote before, so stored phase_b_warnings meta from an existing index still decodes. scip_unification_misses is deliberately not a variant: it is a whole-index missed rate, not a language's status, and neither consumer treats it as one. Including it would force both guards to assert something false. Turning the CLI guard on found a live bug it now pins: needs_approval was downgrading the `semantic:` field to "not run" while printing no explanation, so the language was degraded with nothing on screen saying why.
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.
Closes #760.
What changed
Ten Phase B warning classes were written in one place and restated in three: the CLI status renderer, the MCP decoder, and the test meant to keep them in step.
PhaseBWarningClassis now the single definition; the daemon formats from it and each consumer's guard iteratesALL.Proof it works (the whole point)
Added an eleventh class to the producer and taught no consumer. Both guards fail:
Before this, that eleventh class would have been invisible: the guard was a third hand-written list with nothing to disagree with.
zero_nodesandneeds_consentreally sat in that hole until #752 read the producer against the consumers by hand.It found a live bug
Turning the CLI guard on immediately failed on an existing class:
needs_approvalwas downgrading thesemantic:field to "not run" while printing no explanation at all. Fixed and now pinned.Not a breaking change
The ten tags are byte-identical to what the daemon wrote before, so
phase_b_warningsmeta in an existing index still decodes:Why travsr-plugin-host holds it
Every variant is one field of
PhaseBOutcome, which that crate produces, and it is the only crate all three surfaces already depend on.travsr-daemondepends ontravsr-mcp, so the daemon cannot hold a definitiontravsr-mcpreads. No dependency invariant from CLAUDE.md is crossed and no cycle is introduced.Deliberately excluded
scip_unification_missesis a whole-index missed rate, not a language's status, and neither consumer treats it as one. Making it a variant would force both guards to assert something false.Verification
6 files, no unrelated changes.