docs: propose cross-tool invocation — typed returns + q-orca bridge - #12
Merged
Conversation
Design-doc proposal (matched pair with q-orca-lang's add-cross-tool-bridge-protocol): adopt a typed ## returns section, extend - invoke: with return bindings + an optional shots: modifier for measurement-bearing foreign children, and implement q-orca's bridge protocol (descriptor / invocation / result envelopes over process+JSON via run --json) so a classical orca trainer can drive a q-orca quantum forward pass. Backward compatible; no shared AST (decision 1b). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…contract, worked example PR #12 review revisions: - Inline 'returns:' form on the invoke bullet (common case one-liner) + multi-line. - Name-collision rule for declared returns vs parent context fields. - measurement_bearing determination (child property, from measurement effects — not shots). - protocol_version note; error-handling contract (child-error vs bridge-error -> on_error). - Safety note (pipe not shell-interp, validate args vs descriptor, import-root path resolution). - Worked hybrid Trainer -> QForward example; answered both open questions; precise q-orca spec link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Design-doc proposal (
docs/cross-tool-invoke-and-returns.md) — the orca half of a matched cross-repo pair with q-orca-lang'sadd-cross-tool-bridge-protocol.Proposes orca:
## returnssection (returns become declared + verifiable, not implicit{finalState, context}).- invoke:with- returns:bindings and an optionalshots:modifier for measurement-bearing (foreign quantum) children.run --json) so a classical orca trainer can drive a q-orca quantum forward pass, and orca machines can be invoked by q-orca.Keeps orca's bullet syntax (enriched, not replaced); fully backward compatible; no shared AST. Should land together with the q-orca side so the protocol has both endpoints.
🤖 Generated with Claude Code