Expand description
The standards-review shadow run: its request, the patch it covers, its one HTTPS call and the result it appends. What: The standards-review shadow run: its request, the patch it covers, its one HTTPS call and the result it appends. Why: The review is optional and self-contained, so its modules sit together.
In TS you’d write (pseudocode):
// standards_review/index.ts: one `export * from './file'` per module below.Modules§
- standards_
review_ append - The standards-review shadow run: appending an entry to the shared log without a lock, once per commit, with repair.
What:
How the service adds a review entry to the repository’s live shadow log, which every worktree’s service instance
appends to at the same time: one whole-entry write on an append-mode descriptor, once per commit, creating the
directory and the file when missing.
Why:
The live log is an untracked file in the common repository directory (
cli-git/standards-review-shadow.md), and no lock may be taken. One write of the whole entry on anO_APPENDdescriptor lands at the end of the file in one step, so two instances (threads or processes, each with its own descriptor) cannot interleave their entries. Nothing else edits this file, so the protection a tracked, session-edited log needed is gone: the per-worktree spool of delivered entries, the bounded repair that appended again an entry another writer’s whole-file rewrite had lost, and the rule that the service never creates the log. A write the operating system cuts short (a signal, a full disk) is continued with the rest of the same entry, so an entry is whole unless the disk refuses it. - standards_
review_ client - The standards-review shadow run: the in-process HTTPS call to the decisions gateway, with a total deadline.
What:
The one HTTPS call of the standards-review shadow run, made in-process and ended only when it shows no sign of work.
Why:
The root
mise.tomltaskshadow-reviewcallsfetchwith a 30 s signal. This port calls the same endpoint from the wrapper itself, so nonodeormiseis started. A call that keeps moving bytes is never cut off for being slow (owner, 2026-11-03: “Stop only on no progress”; pick 9 ofdoc/planning/cli-git-shipped-limits-audit.md, the coordinator’s under the owner’s delegation and open to the owner’s veto). The transport’s own idle timeouts do the judging: resolving, connecting, and each read and each write of the connection (TLS handshake, request, response head and body) may stay silent for the quiet window and no longer, and one ceiling covers the call as a whole (owner, 2026-11-04, “Silence plus a ceiling (Recommended)”;wait_ceilings.rs,REVIEW_CALL_CEILING). The longest quiet gap of every call is measured beside the call and kept in the ledger (quiet_ledger.rs,thread_quiet.rs). The trust roots are a parameter: production uses the roots embedded in the binary, a test passes the fixture authority of its local TLS server. - standards_
review_ entry - The standards-review shadow run: log entry rendering and appending.
What:
The log entries of the standards-review shadow run, rendered as the root
mise.tomltaskshadow-reviewwrites them. Why:doc/audit/standards-review-gate-shadow.mdalready holds that task’s entries, and readers and scorers parse them, so the port writes the same lines;standards_review_append.rsappends each entry, whole, to the live log. - standards_
review_ input - The standards-review shadow run: which commits get an entry, and the capped model input.
What:
The pure part of the standards-review shadow run: which landed commits get an entry, and the capped model input
built from the commit’s patch and the excerpts of its changed code files.
Why:
This is the root
mise.tomltaskshadow-reviewafter its Git reads: the no-entry, no-code-files and review cases, the 2000-line patch cap, the eight-file and 4000-line excerpt caps, and the 24000-unit input cap. Taking the patch and the file contents as plain values lets the caps be tested without Git, a network or a clock. - standards_
review_ patch - The standards-review shadow run: a file’s changed old-side ranges read from the patch.
What:
Reading one file’s changed new-side line spans out of a
git show --patchtext, so the review needs nogit diff -U0start per excerpted file. Why: The script runsgit diff -U0 <sha>^ <sha> -- <name>for each of up to eight files. A hunk of the three-line-context patch is a list of change runs, and each run is one zero-context hunk, so the same spans follow from the patch the review already holds. The spans are on the new side because the excerpt is cut from the new-side file. - standards_
review_ request - The standards-review shadow run: the Decisions API request body and the answer reading.
What:
The Decisions API request body the standards-review shadow run sends, and the reading of the gateway’s answer into
the verdict and the
Findings keptline. Why: The rootmise.tomltaskshadow-reviewbuilds this body withJSON.stringifyand reads the answer withJSON.parse; the body must keep its key order and escaping so the same input sends the same bytes, and the answer text must print numbers and failures the way the log’s readers already know. - standards_
review_ run - The standards-review shadow run, end to end, and its bounded runner. Nothing calls it yet.
What:
The standards-review shadow run, end to end and in-process: classify the landed commit’s names, read the commit,
build the capped input, call the gateway, and append the one log entry. Also a runner that contains a panic of any of it.
Why:
This replaces the root
mise.tomltaskshadow-review(its Luna route; theSHADOW_REVIEW_ALLOW=1route startspiand is not ported). The review must never delay or fail a landing, so nothing here panics or returns a failure the landing would act on. No wall-clock budget covers the run (owner, 2026-11-03: “Stop only on no progress”; pick 9 ofdoc/planning/cli-git-shipped-limits-audit.md, the coordinator’s under the owner’s delegation and open to the owner’s veto): each step of it ends on no progress by itself, the Git reads under the watch ofchild_watch.rsand the gateway call under the idle timeouts ofstandards_review_client.rs. The one step with no judge is the local write of the log entry. - standards_
review_ source - The standards-review shadow run: the two real-Git reads (patch and file texts) of a landed commit.
What:
The Git reads of the standards-review shadow run, in as few real-Git starts as the data allows: one
git showfor the patch and onegit cat-file --batchfor the new-side text of the excerpted code files. Why: The rootmise.tomltaskshadow-reviewstarts Git twenty-odd times per landing (rev-parse,log,show,diff-tree, thenshowanddiff -U0for each of up to eight files). The landing already knows the commit name, its message and the changed names, so the subject and the names need no start, the zero-context ranges come out of the patch, and the file texts come in one batch. A commit with no code files costs no start at all. - standards_
review_ text - The standards-review shadow run: JavaScript text behaviors the log depends on (UTF-16 lengths, number text).
What:
The few text behaviors of the standards-review log that JavaScript defines and Rust does not share:
UTF-16 lengths and prefixes,
Numberto text,toFixed(1)of a duration, and Git’s%ssubject. Why: The rootmise.tomltaskshadow-reviewmeasures and cuts text in UTF-16 code units and prints numbers the way ECMAScript does, and its log is compared entry by entry with this port’s, so the same text must give the same counts and the same bytes.