Skip to content

docs: propose cross-tool invocation — typed returns + q-orca bridge - #12

Merged
jascal merged 2 commits into
mainfrom
docs/cross-tool-invoke-and-returns
May 30, 2026
Merged

docs: propose cross-tool invocation — typed returns + q-orca bridge#12
jascal merged 2 commits into
mainfrom
docs/cross-tool-invoke-and-returns

Conversation

@jascal

@jascal jascal commented May 30, 2026

Copy link
Copy Markdown
Owner

Design-doc proposal (docs/cross-tool-invoke-and-returns.md) — the orca half of a matched cross-repo pair with q-orca-lang's add-cross-tool-bridge-protocol.

Proposes orca:

  1. Add a typed ## returns section (returns become declared + verifiable, not implicit {finalState, context}).
  2. Extend - invoke: with - returns: bindings and an optional shots: modifier for measurement-bearing (foreign quantum) children.
  3. 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, 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

jascal and others added 2 commits May 29, 2026 20:09
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>
@jascal
jascal merged commit 0ede0c9 into main May 30, 2026
3 checks passed
@jascal
jascal deleted the docs/cross-tool-invoke-and-returns branch May 30, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant