Repository navigation
fix(mcp): spar.check_chain resolves a chain as latency does and reports a nested-spelling flow as invalid - #491
Merged
Merged
Conversation
…eaches, as latency resolves them, and reports a nested-spelling flow as invalid Follow-up to REQ-ANALYSIS-FLOW-SEGMENT-LEGALITY-001 and REQ-ANALYSIS-FLOW-THREAD-DESCENT-001 (#455 item 3), under REQ-MCP-001. The tool matched a requested thread against ANY dotted part of a flow's first and last segment, and its fixtures used the spelling the analysis now rejects. On `app.producer.f1 -> loop_back -> app.consumer.f2`, with source `producer` and sink `consumer`, it returned Ok with endpoints like `Sys/app.producer`, while `spar analyze` on the same model errors. `app` or `f1` would have matched too. Now: - legal flows resolve through `spar_analysis::latency::flow_components`, the single public entry point onto latency's own descent, so the tool and the analysis cannot disagree about which components a flow passes; - the source must be the first component reached and the sink the last; - endpoints are instance paths (`.../app/producer`); - `app`, a flow name, a feature name or reversed endpoints give CHAIN_NOT_FOUND; - a nested-spelling flow gives CHAIN_INVALID carrying flow_check's reason; - a valid match always wins over a rejected one, whichever is declared first. `expand_flow_steps` and `FlowStep` stay private. Fixtures converted to legal AADL: a flow path on the process, implemented through the threads. Six new in-process tests and a `flow_components` unit test. MUTATION, in-diff: 11 of 18 MISSED before the new tests; after, 11 caught, 5 unviable, 0 missed. Two redundant empty-needle guards were removed, because `required_string` already rejects empty input. Implemented by a Sonnet subagent under supervision. 3291 passed / 0 failed and the mutation counts were re-derived independently before this commit. VISIBLE CHANGE to MCP clients: the `endpoints` strings are now instance paths instead of `owner/segment`. NOT CLAIMED: to report CHAIN_INVALID, a nested flow is still recognised by any dotted part of its first and last segment. That path only produces the rejection and never a resolved chain, so an unrelated nested flow that mentions both names also reports invalid. Refs #455 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BnBWxgVEUPdsBTLNKtrA6Z
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Refs #455. Follow-up to #488, under REQ-MCP-001, aligning MCP
spar.check_chainwith REQ-ANALYSIS-FLOW-SEGMENT-LEGALITY-001 and REQ-ANALYSIS-FLOW-THREAD-DESCENT-001.Before
The tool matched a requested thread against any dotted part of a flow's first and last segment. Its fixtures used the nested spelling the analysis now rejects. On
app.producer.f1 -> loop_back -> app.consumer.f2, with sourceproducerand sinkconsumer, it returned Ok.spar analyzeerrors on that same model, andapporf1would have matched too.After
spar_analysis::latency::flow_components, the one public entry point onto latency's own descent. The tool and the analysis can't disagree about which components a flow passes.CHAIN_NOT_FOUND:app, a flow name, a feature name, or reversed endpoints.CHAIN_INVALID, carrying flow_check's reason.Visible to MCP clients
The
endpointsstrings are now instance paths, notowner/segment.Oracles
flow_componentsunit test.Implemented by a Sonnet subagent under supervision, and re-verified independently. The tree is byte-identical to the one verified.
Not claimed
To report
CHAIN_INVALID, the tool still recognises a nested flow by any dotted part of its end segments. That path only ever produces the rejection, never a resolved chain.🤖 Generated with Claude Code
https://claude.ai/code/session_01BnBWxgVEUPdsBTLNKtrA6Z