tech-debt-backlog §§7.21–7.24: hybrid-bridge cleanup + 2026-06-05 triage - #129
Merged
Conversation
Files the 2026-06-05 feedback triage (5 new items, §§7.21–7.25), then resolves the four hybrid-bridge entries: - §7.21 (friendly preflight for register_foreign_runner) — already shipped in PR #99: run_demo.py:86-91 checks hasattr(machine, "register_foreign_runner") and raises SystemExit with the README pointer. Marked done with a note that the hasattr target was adjusted (attribute lives on OrcaMachine, not the runtime_python module) from what the spec'd fix sketched. - §7.22 (2.348 vs 2.346 docstring typo) — already reconciled in PR #99's review-nits commit; 2.346 is correct (2·asin(√0.85)). - §7.23 (repo-escaping doc link) — drops the misleading HTML comment on examples/hybrid-bridge/README.md:10 that pointed readers at "../../../orca-lang/docs/...", a path only valid for one specific side-by-side checkout layout. The canonical upstream URL on the preceding line is now the single source of truth. - §7.24 (unguarded TARGET input) — already shipped in PR #99: run_demo.py:93-100 parses TARGET as a float and enforces 0.0 < TARGET < 1.0 (a probability bound; the angle clamp is a separate downstream invariant). §7.25 (ruff sweep of test files, ~13–18 pre-existing errors) is left open for a dedicated half-day pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jascal
commented
Jun 6, 2026
jascal
left a comment
Owner
Author
There was a problem hiding this comment.
Code Review — Claude Sonnet 4.6
Thorough, well-reasoned bookkeeping PR. It files the 2026-06-05 feedback triage (§§7.21–7.25) and closes the four hybrid-bridge follow-ups from the PR #99 review log, with one actual code change (the §7.23 README cleanup). I verified every substantive claim in the triage against the tree at examples/hybrid-bridge/run_demo.py and examples/hybrid-bridge/README.md — they hold up.
Verification of the triage claims
- §7.21 (preflight for
register_foreign_runner) — ✅ Confirmed.run_demo.py:86-91doesif not hasattr(machine, "register_foreign_runner")→raise SystemExit(...), and the message names both the missing attribute and theorca-runtime-python >= 0.1.28pin. The note correctly explains why thehasattrtarget moved from the originally-spec'druntime_pythonmodule to theOrcaMachineinstance — the actual call site ismachine.register_foreign_runner(...)atrun_demo.py:121, so checking the instance is the right preflight. - §7.22 (
2.348vs2.346) — ✅ Value is correct:2·asin(√0.85) = 2.3462, so2.346is right. Both copies agree. One nit: the citation says the value lives atREADME.md:60, butgrep -n "2.346"puts it atREADME.md:59(line 60 ismachine's 'target' context field). Therun_demo.py:48reference is spot-on. Given this whole document is built on precisefile:linecitations, the off-by-one is worth fixing for the next reader who jumps to the line. - §7.23 (repo-escaping doc link) — ✅ The diff cleanly drops the
<!-- ... ../../../orca-lang/docs/... -->HTML comment and leaves the canonical GitHub URL on the preceding line as the single source of truth. Good call — that relative path only resolved for one specific side-by-side checkout and was invisible-but-wrong on the GitHub web UI anyway. - §7.24 (unguarded
TARGET) — ✅ Confirmed atrun_demo.py:93-100: parses tofloat(rejecting non-numeric with a diagnostic that echoes the offending value) and enforces0.0 < TARGET < 1.0. The reasoning for tightening(0, 2π)→(0, 1)is sound and worth restating:TARGETis a target P(1), soθ* = 2·asin(√target) ∈ (0, π)fortarget ∈ (0, 1), which is exactly the band the downstream clampmin(π−0.01, max(0.01, …))atrun_demo.py:72operates in. Validating the probability at the entry point is the correct boundary.
Lint / tests (branch checked out)
.venv/bin/pytest -q→ 1274 passed, 8 skipped in ~22s — matches the test plan exactly..venv/bin/ruff check .→ 18 errors, all intests/(test_compiler.py×9,test_noise_model_section.py×5,test_verifier.py×2,test_qpc_convergence.py×1,test_examples.py×1). None touch the two files this PR modifies, so the PR introduces zero new lint. This is exactly the pre-existing surface that §7.25 leaves open as a tracked tech-debt item — consistent and correctly scoped out.
What looks good
- The triage doesn't just check boxes — it records what actually shipped vs. what was spec'd and why they diverged (§7.21's attribute relocation, §7.24's range tightening). That's the right altitude for a debt log; future readers won't have to re-derive the rationale.
- Honest about its own limits: the "Caveat on this run" note about the egress proxy blocking
api.github.comand the unenumerable #100/#111 nits is exactly the kind of provenance future-you will thank present-you for. - Leaving §7.25 unchecked rather than hand-waving it closed is the right move.
Minor / optional
README.md:60→:59in the §7.22 citation (and the same reference in the PR description) — small, but this doc trades on line precision.- Removing the HTML comment leaves two consecutive blank lines between the
[bridge-doc]:link and## What it does(markdownlint MD012). Purely cosmetic, not a blocker. - Out of scope but adjacent: the README version table at
README.md:69pinsorca-runtime-pythonas "post-PR #13" while the §7.21 error message says>= 0.1.28. Not contradictory, but a future reader reconciling the two would have to do some archaeology — perhaps a candidate for a later traceability nit if you're tracking that surface.
Verdict
No blockers. Claims verified, tests green, no new lint, change is minimal and well-justified. Recommend merge after the trivial README.md:59 citation fix (or merge as-is — it's a comment in a debt log, not load-bearing).
This review was posted automatically by Claude Sonnet 4.6.
This was referenced Jun 10, 2026
jascal
added a commit
that referenced
this pull request
Jun 16, 2026
#138) Three [XS] follow-ups, all surface-only wording fixes from prior PR review logs. - §7.27 — fix the line citation in §7.22's resolution note. `examples/hybrid-bridge/README.md:60` → :59. `2·asin√0.85 ≈ 2.346` actually sits on line 59 of that file; the PR #129 reviewer flagged the off-by-one and it persisted in the merged backlog body. - §7.28 — replace "class-level docstring" with "leading `#` comment on the class" in §7.12's resolution note. Verified against tests/test_mcp_server.py:181-188: the §7.12 rationale lives in a contiguous `#` comment block immediately above the `@pytest.mark.skip`, not a docstring (no `"""…"""` exists on the class). The prior wording would mislead a future reader using `pydoc` / `__doc__` to find it. - §7.29 — rewrite the below-atol-guard test's spectrum-recovery comment. PR #134's "CNOT inverse-permutation is unitary, so singular values propagate unchanged" framing was loose — an entry permutation is a row-dependent column swap that does not in general preserve a *reshaped* matrix's spectrum. New comment references the actual chain that does: exact inverse swap of _apply_cnot's forward swap, then a `full_matrices=False` SVD with every singular value kept (no truncation), so the reconstruction is exact and _apply_cnot's downstream SVD sees the singular values of M itself. Bundled because all three are XS doc-nits from review logs, matching the §§7.21–7.24 (PR #129), §§7.16/7.17 (PR #135), and §§7.18/7.19 (PR #137) bundling precedent. `pytest -q`: 1282 passed, 8 skipped (the §7.29 test fixture stays green; the §7.27/§7.28 edits are tasks.md-only and not referenced by any test). Tasks marked `[x]` with closing notes per §6.1. Co-authored-by: Claude Opus 4.7 <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.
Summary
Files the 2026-06-05 feedback triage for the seven-day window ending 2026-06-05 (5 new items, §§7.21–7.25), then resolves the four hybrid-bridge follow-ups from the 2026-05-30 PR #99 review log.
Three of the four were silently addressed inside PR #99 itself but never checked off in
tasks.md; this PR records that and closes the loop with annotated check marks. The fourth (§7.23) needed a one-line cleanup.register_foreign_runner) — already shipped in PR demo(hybrid-bridge): classical Orca ↔ quantum q-orca over the cross-tool bridge #99:run_demo.py:86-91checkshasattr(machine, "register_foreign_runner")and raisesSystemExitwith the README pointer + theorca-runtime-python >= 0.1.28pin. Marked done with a note that thehasattrtarget was adjusted (attribute lives on theOrcaMachineinstance, not theruntime_pythonmodule) from what the spec'd fix originally sketched.2.348vs2.346docstring typo) — already reconciled in PR demo(hybrid-bridge): classical Orca ↔ quantum q-orca over the cross-tool bridge #99's "address review nits" commit; bothrun_demo.py:48andREADME.md:60carry2.346, which is the correct value (2·asin(√0.85) ≈ 2.3462).examples/hybrid-bridge/README.md:10that pointed raw-markdown readers at../../../orca-lang/docs/cross-tool-invoke-and-returns.md, a path only valid for one specific side-by-side checkout layout. The canonical upstream GitHub URL on the preceding line is now the single source of truth.TARGETinput) — already shipped in PR demo(hybrid-bridge): classical Orca ↔ quantum q-orca over the cross-tool bridge #99:run_demo.py:93-100parsesTARGETas a float (with a diagnostic that names the offending value) and enforces0.0 < TARGET < 1.0. The accepted range was tightened from the originally-spec'd(0, 2π)to(0, 1)becauseTARGETis a target P(1) — a probability — not an angle; the GAIN≈Newton clamp downstream operates onθ ∈ (0.01, π−0.01), so the probability guard at the entry point is the correct boundary check.§7.25 (sweep the pre-existing ruff errors across
tests/) is left open for a dedicated half-day pass.Test plan
.venv/bin/pytest -q— full suite green (1274 passed, 8 skipped).venv/bin/pytest -q -k "hybrid or bridge"— all 10 hybrid-bridge / bridge tests pass