wai-quantum: the person's rules for proposals, checked change by change #494
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-locks-r2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature 7 of the co-design report: region-scoped edits with locks and keep/avoid marks. A proposal from a model, an outside agent or an engine rewrite must keep the person's rules, and the engine checks it change by change. A change that breaks a rule is named with the rule and cannot be taken.
Supersedes #487: its two commits on current main (after #492's zstd and avx2 fixes), pushed once. #487 ran green except for checks every pull request was failing then: the repository check (four new zstd advisories) and the avx2 leg on the
linuxlabel's new framework runner.Two commits:
wai-quantum mcp: an agent is told atinitializeto record its changes withhistory_commitand keep the person's rules.The rules:
engine::locks// @lockand// @unlock, so they travel with it to a model, an agent and a file.gates: the only gates a change may add;qubits: the qubit declarations held;avoid_gatesandavoid_text: what no change may add;region: the lines a rewrite must keep to.checknames each change (versions::changes) and the rules it breaks.briefstates the rules for a model,held_opsgives the held gates for the diagram, andcallis the JSON dispatch for hosts.versions::Reviewkeeps the blocked changes (History::propose_with). A change both blocked and accepted is refused there and byHistory::verify. A review with nothing blocked has the digest it had before.The command line and MCP
wai-quantum locks check prog.qasm theirs.qasmexits 1 if any change breaks a rule;wai-quantum locks brief prog.qasmprints the rules as a model is told them;prog.locks.json.history changesnames each change's breaches;history proposerefuses a blocked change, and--accept alltakes the allowed ones;history logshows how many were blocked.history_commitrefuses an agent's edit that breaks a rule, with the rule.history_changesshows each change's breaches and the rules as sentences.The Studio: Rules for proposals
ask, Improve and Explore.A fix found on the way
versions::call'sblame, andlocks::check, reported an unreadable program in a field callederror. A page's worker treats any answer witherroras a failed call. So an unreadable draft lost its lines' authors, and a proposal that did not read never reached the review. The field is nowunread.Checked on the build host
--features full,engine::): 89 tests pass, including the rules' and the blocked-review tests. Clippy reports nothing inlocks.rsorversions.rs.-D warningsis clean.locks brief;locks checkon three changes, two breaking a rule, which exits 1;history changeswith the breaches;history propose --accept 0, refused;--accept all, which takes 1 of 3 with 2 blocked;history verify.quantum_engine::): 9 of 9 tests pass, including the rules in the page.wai-web-wasm.ymlnow counts 9.scripts/check-public-names.shis clean.🤖 Generated with Claude Code
Feature 7 of the co-design report: region-scoped edits with locks and keep/avoid marks. - engine::locks: - held blocks marked in the program between // @lock and // @unlock; - the gates a change may add, the qubit declarations held, gates and text to avoid, and the region a rewrite must keep to; - check names each change of a proposal and the rules it breaks. Only what a change adds is judged, and a generator's gates are read at its inputs; - brief states the rules for a model; held_ops gives the held gates; call is the JSON dispatch for hosts. - versions: a review keeps the changes the rules blocked (propose_with), and a change both blocked and accepted is refused there and by verify. A review with nothing blocked has the digest it had before. - The command line: locks check | brief, prog.locks.json beside the program. history changes names the breaches; history propose refuses a blocked change, and --accept all takes the allowed ones. - MCP: history_commit refuses an agent's edit that breaks a rule, with the rule; history_changes shows the breaches and the rules. - The Studio's Rules: - hold the selected lines (shaded in the editor, gates marked on the diagram), the gates allowed, the qubit declarations, what to avoid, and a region for the next proposal; - in the review a breaking change is shown with its rule and cannot be taken, and the version records it as blocked; - Alternatives leaves out a candidate whose every change breaks a rule, and the model is told the rules with every request. - Bindings: engine_locks in the page, locks in the desktop app. - versions::call's blame and locks::check name an unreadable program `unread`, not `error`, which a page's worker read as a failed call. - CI: wai-web's native engine tests count 9. Co-Authored-By: Claude Opus 5.5 <[email protected]>