Specification compliance review

From AtlasOmnia/hermes-custom-pack · View interactive version

Specification compliance review is an AI agent skill from the GitHub repository AtlasOmnia/hermes-custom-pack. specification-compliance-review — Audit partial or passing implementations against an explicit task specification, proving each requirement with code, tests, and execution evidence.

How to use this skill

Skill file

Specification-Compliance Review

Overview

Use this skill when an implementation is described as partial, passing, or complete and the task is to determine whether it actually satisfies an explicit specification. This is not a generic code review and not a re-run of the test suite. The central question is: does every normative requirement have both a correct implementation path and a meaningful proof?

A green build proves syntax, compilation, and perhaps the tested examples. It does not prove race behavior, cancellation semantics, exact backpressure policy, integration parity, or compliance with explicit non-goals.

Workflow

1. Establish the review baseline

Read, in order:

  1. The task specification and surrounding plan/release gates.
  2. Repository guidance (AGENTS.md, README, project instructions).
  3. The changed files and their callers.
  4. The tests added or claimed as evidence.
  5. Git status/diff and recent relevant history.

Create a requirement matrix with one row per normative clause:

| Requirement | Production evidence | Proving test | Execution result | Status |

|---|---|---|---|---|

| Exact behavior | path:lines | test name + fixture | command/output | pass/fail/unknown |

Keep unknown distinct from fail. A test that could not run is not a passing test.

1B. Preflight implementation plans for load-bearing assumptions

When the artifact under review is an implementation plan rather than completed code, identify every external behavior that several downstream tasks assume: server-owned tool execution, plugin loading, request-context propagation, restart/reload ownership, stable host identity, or update/rollback semantics.

Do not let later RED tests encode an unproven API contract. Insert the smallest real-runtime spike before dependent work, capture the exact request/event/context contract, and gate downstream tasks on it. If the plan routes opaque identifiers through model-visible prompt text, require a deterministic metadata/session channel or explicitly stop for the missing platform capability; model copying is not a trusted transport.

Apply the plan's stated threat model before calling a security concern blocking. In particular, do not pretend Origin headers or current-user secret storage defend against hostile code already running as that OS user, and do not move a server-side secret into JavaScript merely to satisfy an authentication requirement.

1C. Trusted context and server-owned tool binding

For server-owned agent/plugin integrations, treat any identifier that selects a workbook, document, tenant, user, or session as security-sensitive request context. A UUID embedded in model-visible prompt text is only a hint: the model can omit, alter, replay, or substitute it. Require an out-of-band, server-recognized binding such as request metadata, a trusted header propagated by the gateway, a server-issued capability, or a validated context object. Trace the value through the actual server implementation and plugin handler; do not infer support from client tests or comments.

When a plugin receives a caller-supplied target ID, inspect whether plugin authentication authorizes the whole service rather than the specific target. If so, a wrong-but-valid ID can become cross-workbook or cross-tenant access. Add an adversarial test with two active targets: deliver a valid target A, make the model/plugin attempt target B, and assert the server rejects it or rewrites it to A before any side effect. Tests that only assert the ID appears in a prompt are vacuous for this requirement.

For OpenAI-compatible gateways, inspect the gateway source or run a real request spike to verify which body fields, headers, and tool schemas reach the native agent loop. Caller tools/tool_choice may be accepted for fingerprinting yet ignored for execution; similarly, custom context fields may be discarded. Record the exact supported transport before designing the client seam.

For localhost-only private deployments, audit proxy topology end-to-end: a loopback listener is not sufficient if its configured upstream host can be remote. Require loopback validation for the upstream as well, or classify the deployment as a separately documented remote mode; never send an injected gateway key over plain HTTP to an arbitrary API_SERVER_HOST.

When a review runs alongside another agent or an external process, capture the candidate SHA and review git show <sha>:<path> content if the worktree becomes dirty. Do not silently review concurrent edits as part of the candidate, and do not revert them without authorization.

2. Decompose the specification

Classify each clause as one or more of:

Give special attention to words such as exactly, only, latest, must, never, preserve, cancellable, and no refactor. These are acceptance criteria, not descriptive prose.

3. Inspect implementation and seams

Trace each requirement from its public entry point through state ownership and asynchronous boundaries. For concurrency work, identify:

After an extraction or refactor, compare the old path and new path for behavior parity. Common regressions occur in normalization, language mapping, configuration defaults, error formatting, and interruption handling rather than in the extracted core.

4. Audit tests for meaningfulness

A test proves a requirement only when its setup actually creates the required condition and its assertion observes the specified invariant. Reject vacuous coverage such as:

Review test helper semantics too. An actor, lock, continuation, or deferred cleanup task can make a test appear deterministic while failing to measure the intended interval.

5. Verify in increasing strength

Run the smallest useful focused test first, then the complete relevant suite, then a clean build. Also run static searches for forbidden mechanisms or explicit non-goals (for example, semaphore-based blocking, direct credentials, or an unintended framework refactor).

Record command, target, destination, and result. If infrastructure prevents execution, report the exact limitation and downgrade the verification status; do not convert a prior passing claim into independently verified evidence.

6. Report findings

Lead with the verdict: PASS, PASS WITH GAPS, or FAIL.

For every finding include:

Then include:

Do not bury a failed acceptance criterion under a long list of passing tests.

Concurrency-specific checklist

For a single-worker latest-pending pipeline, prove all of the following independently:

Pitfalls

Provider-session safety addendum

For provider-backed audio/TTS sessions, treat these as separate acceptance criteria rather than one generic “cleanup” requirement:

When validating Swift concurrency implementations, compile after each lifecycle change. Actor-isolated helper calls require await; deferred tracker updates and fire-and-forget cleanup can make a green-looking test observe the wrong interval. Prefer deterministic await-based helper accounting.

A focused iOS verification should use an actually available simulator destination and then run the complete test target. Record the exact destination and distinguish “unverified due to unavailable destination” from a source or test defect. A generic destination such as generic/platform=iOS is valid for compilation but not for XCTest execution; discover a concrete simulator with xcodebuild -project <project> -scheme <scheme> -showdestinations (or xcrun simctl list devices available) and rerun tests against that destination. If xcrun reports it cannot find simctl, re-point command-line tooling with sudo xcode-select -s /Applications/Xcode.app/Contents/Developer (or the active Xcode bundle path) and retry discovery before declaring the test layer unverified. If no concrete destination is available, report tests as unverified rather than treating a different device as equivalent.

When validating compile-time release/debug policy, do not rewrite both policy tests to assert the current configuration. Keep configuration-specific assertions honest: use separate Debug and Release build/test invocations, or expose a pure injectable policy factory for unit tests while retaining #if DEBUG as the production compile-time gate. A test named for Release must not pass merely because it was compiled in Debug.

Milestone acceptance versus whole-product completion

When development is staged, never promote a milestone-level PASS into a whole-product verdict. A tested native launch, clean Git synchronization, or verified shortcut proves only that the accepted artifact runs; it does not prove that later milestones, prototype controls, user-reachable CRUD, settings, packaging, or persistence paths exist.

Before declaring a milestone-built product complete:

  1. Inventory every normative specification clause and meaningful prototype control.
  2. Trace each through UI, controller, native/backend seam, persistence, relaunch, tests, and native evidence.
  3. Report milestone acceptance and whole-product acceptance separately.
  4. Treat user-confirmed expectations that resolve specification ambiguity as explicit requirements.
  5. If the user chooses phased execution, produce only the requested bounded phase and stop at its gate; do not resend the entire campaign.

Support files

Provider enqueue-task adversarial pattern

When a provider uses a task bag to bridge a synchronous callback into an async pipeline, review the bag as a lifecycle component rather than as incidental bookkeeping. The proof should cover the linearization point of add versus stop: once stopping begins, a later add must be rejected atomically; a task already accepted must be cancelled and awaited; reset must create a clean generation. An actor is usually the clearest ownership model because the stop/add/reset decisions serialize naturally without manually reasoning about a lock around task creation.

For transport pipelines, cleanup belongs before worker completion. Do not clear the current transport or release the worker slot before cancel() has returned; otherwise a handoff can construct a second transport while the first is still alive. The strongest regression test gates the old transport's cancellation, starts enqueue for the next request, asserts no second transport has been created, opens the cleanup gate, then asserts the next transport becomes active and the global maximum active lifetime is one.

Integration-review lessons from iOS provider pipelines

For a provider extraction that passes focused concurrency tests, perform one final caller-seam audit before declaring approval:

  1. Trace every lifecycle requirement back through the public provider and ViewModel, not only the extracted pipeline. In particular, verify that output interruption, session stop, provider failure, and audio-engine shutdown all reach the same cancellation path when the specification requires it.
  2. Distinguish implemented and tested, implemented but untested, and not wired. A green pipeline suite proves the seam in isolation; it does not prove that the production integration emits or consumes the relevant event.
  3. Check project hygiene as part of integration quality: duplicate/unreferenced source files, generated project drift, and untracked artifacts should be reported even when the build succeeds. A passing Xcode build can still include an accidental duplicate file outside the target.
  4. Run both the generic unsigned device build and the actual simulator test destination, recording the exact destination and test count. Treat static searches such as DispatchSemaphore and secret-pattern scans as separate evidence, not as substitutes for runtime tests.

When a broad requirement such as “output interruption cancels TTS” has no provider event path, report it as an unproven integration gap unless source tracing demonstrates a concrete defect. Do not overstate a gap as a failing acceptance criterion without an observable execution path.

Session review template: iOS mode/job clarity + localization-harness audits

For iOS translator-style reviews where the feature spans consumer-job UX, localization catalogs, and lifecycle behavior, follow this sequence before final verdict:

  1. Read ios/AGENTS.md plus the relevant feature doc (README, OPERATOR_GUIDANCE, and any active .md plan for the feature).
  2. Confirm the review scope from git: current branch, recent commits (for example, the feature head commit and any immediate follow-up), and git status cleanliness.
  3. Inspect ConsumerOnboarding, LiveInterpreterView, TranslatorViewModel, localization catalog(s), and their tests together; never review one file family in isolation.
  4. Add a requirement matrix row for each normative promise in onboarding copy, routing, direction selection, persistence, and release policy.
  5. Run at least one targeted test set for changed contracts and one broader integration test set (same toolchain/simulator session) and report exact counts.
  6. For iOS simulator evidence, use a concrete destination and include the exact destination string in the evidence.

If a concrete simulator destination is unavailable, explicitly report that subset as unverified (environmental) and continue with source-level proof for the remaining requirements.

Specific pitfalls for this domain

Record this as a short post-review note in (or equivalent) with:

Consumer onboarding and UX review addendum

For onboarding plus consumer-facing UX changes, audit the feature as a complete launch-to-first-session path rather than approving the coordinator and unit tests in isolation. Build a matrix for each normative UX promise and trace it through persistence, app-root routing, the completed consumer surface, and the ViewModel/provider seam.

Prove separately:

Classify each item as implemented and tested, implemented but untested, not wired, or confirmed failure. This prevents overcalling a missing proof as a source defect while still exposing dead policy objects and inaccessible recovery controls.

When the requested simulator/device is unavailable, enumerate actual destinations, rerun on a compatible available destination, and record both the failed attempted destination and the successful exact destination. Do not stop at the first destination error or silently treat a different device as equivalent.

Integration lessons for SwiftUI consumer flows

For SwiftUI consumer flows that combine persisted onboarding, job selection, release policy, and a live ViewModel, treat these as four separate seams and prove each one:

  1. Persistence after onboarding: A persistence test that only covers onboarding completion is incomplete. Exercise a job change from the completed state, verify the backing store changes, then construct a fresh coordinator from that same store and verify the selected job is restored.
  2. Live ViewModel protection: Do not prove live rejection with a pure configuration helper alone. Give the ViewModel an injectable/test-only initial live status, call the real configureForJob seam, and assert every relevant field (selected job, mode, direction, input route, output route) is unchanged.
  3. Authoritative release policy: A policy object is authoritative only when production start logic gates on a capability such as canStartTranslation, rather than an incidental UI flag such as showsAdvancedSettings. Keep Debug and Release values semantically distinct (developerConfigured versus notConfigured) and test the compile-time branches honestly.
  4. Release affordance: If Release cannot start the service, remove or replace every Start action in the compiled Release view. A disabled-looking or misleading Start button is not compliant; expose a non-actionable unavailable state and ensure the error/service state agrees with the UI.
  5. Binding side effects: When a SwiftUI Picker changes a consumer job, apply the ViewModel mapping first and persist only after an .applied result. A live rejection must leave both runtime configuration and durable selection unchanged.

The focused suite should be followed by both Debug and Release generic-device builds and a concrete simulator test run. A successful Release build is necessary to prove #if DEBUG UI exclusion, while simulator tests prove runtime integration in the available configuration; neither replaces the other.

Release test-target caveat: If tests use @testable import, a Release app build may succeed while Release XCTest compilation fails because the app module was built without -enable-testing. Treat this as a test-configuration defect, not evidence that the production Release app is broken. Either configure the testable Release app/test target deliberately, or verify Release policy with a production Release build plus static/source inspection and run runtime XCTest coverage in Debug. Record the exact limitation rather than claiming Release tests passed.

Reset/lifecycle seam: Any production reset control that returns the app to onboarding or clears persisted session configuration must also account for an active ViewModel/provider/audio session. Trace reset through the real app root and lifecycle owner; guard reset while live or stop and await the session before changing onboarding state. The reset affordance should be serialized or disabled while shutdown is in progress so repeated taps cannot race teardown. A coordinator-only persistence reset test is insufficient if live work can continue after the UI returns to onboarding. Add an integration-level regression test or, when hardware/provider execution is unavailable, a lifecycle-focused unit test that proves the reset path awaits an idempotent stop operation before clearing state.

Consent ownership seam: Consent must have one authoritative owner across onboarding, persistence, and session startup. Do not keep a separate view-local @State copy that is only copied into the coordinator on Continue; bind the control directly to the coordinator's published consent and persist changes through the coordinator. Session startup must read the authoritative consent state, including after relaunch/restored-completed routing. Tests should cover toggle/persistence ownership and the restored-completed path, not only the initial onboarding happy path.

Readability without testability regression: When cleaning up onboarding code, prefer explicit multiline switches, bindings, and lifecycle helpers over compressed one-line declarations. Preserve compile-time Debug/Release policy boundaries and verify the generated build commands: ENABLE_TESTABILITY should remain Debug-only unless the task explicitly requires a separately configured Release test target. A successful Release app build is not Release XCTest evidence; record physical-device signing or simulator availability limitations separately from source correctness.

Deterministic start-vs-stop/reset race proof

For any async session lifecycle where start can suspend before ownership is published (permission, authorization, provider connect, engine startup), treat pending start as a separate lifecycle phase from an already-live session. An isLive check alone is insufficient because a suspended start may observe idle state and resume after reset.

Late-callback gating is a separate requirement. Generation checks only at suspension boundaries do not protect against provider/audio callbacks that were queued before stop and execute afterward. Every callback closure installed for a session must capture that session's generation or identity, and the handler must discard the event unless it still matches the current generation/owner. Audit status, error, transcript, audio-output, interruption, and route callbacks independently. A stale provider event must not overwrite a newer session's status/error/transcript or send audio through the newer engine. The regression test should enqueue or hold a stale callback, stop the session, start a new generation, deliver the old callback, and assert the new session state and output remain unchanged.

Require a monotonically increasing session generation/token owned by the lifecycle owner:

  1. Increment and capture a generation at the beginning of each accepted start.
  2. Invalidate the generation before stop/reset teardown begins, not after awaiting cleanup.
  3. Re-check the captured generation after every suspension point that can acquire or publish ownership.
  4. Before assigning provider/audio ownership, starting the engine, changing live status, or reporting a start error, reject stale generations.
  5. Stale continuations must clean only their local resources; they must not clear or stop resources belonging to a newer generation.
  6. Keep the dependency injectable so tests can suspend permission/connect deterministically without hardware or network timing.

The regression test must hold the first start at a real async boundary, invoke stop/reset while it is suspended, verify the lifecycle returns to idle, release the boundary, await the original start, and assert that no provider/audio session is resurrected and no stale error/status overwrites the reset state. A test that only calls stop after start has completed does not prove this race.

Bounded JavaScript/TypeScript schema-validator reviews

For recursive validators that accept unknown JavaScript values, audit the runtime object model separately from the JSON-schema logic:

Release verification boundary

When the user explicitly accepts a Release verification boundary, record it narrowly and do not overclaim it. A successful Release generic-device/app build proves the production Release compilation path and #if DEBUG exclusion; it does not prove Release XCTest execution when ENABLE_TESTABILITY=NO, nor does it prove runtime lifecycle behavior. Run Debug XCTest on a concrete simulator for runtime evidence, run Debug and Release generic-device builds separately, and report the exact boundary in the verdict.

For onboarding/reset work, an awaited stopSession() is only sufficient if it covers all in-flight lifecycle phases. Audit the start path for suspension points before provider/audio ownership is assigned. A reset can observe isLive == false while startSession() is awaiting permission, provider connection, or engine startup, then the suspended start may resume after onboarding state has been cleared and recreate a session. Require an explicit start/stop generation or lifecycle gate: reset/stop must invalidate the pending start before awaiting cleanup, and the start path must re-check that generation before assigning ownership or starting audio. Add an adversarial test that suspends start during connection, invokes reset/stop, releases the connection, and asserts no provider/audio session is resurrected.

Keep this distinct from a normal “stop awaits provider cleanup” test: that test covers an already-owned live session, while the pending-start race covers work that has not yet been published into isLive ownership.

Bounded renderer security, accessibility, and code-quality reviews

For a read-only review of concurrent Electron/React renderer work, capture the exact candidate and inspect changed names/focused diffs before broad source reads. Review untracked files explicitly. Trace every renderer readiness/consent/preflight boolean through preload and IPC to the final model, filesystem, network, or mutation sink: a renderer gate is UX, not authorization. Require a main-process re-check immediately before powerful work when the requirement is security-sensitive or the renderer state can become stale.

Treat text-only and optional-voice flows as complete user journeys, not state flags. A callback that prepares a packet and writes “ready” to a transcript does not prove a usable lesson; verify that the packet is rendered, learner input is accepted, progression/persistence is wired, and the path is reachable without the optional voice dependency. For async preflight/cancellation, construct the stale-result scenario (cancel old run, start new run, deliver old result) and require generation/request identity checks around every state update, not just cleanup of a request ref.

For accessibility, inspect the rendered path for route-entry focus, focus restoration, keyboard reachability, live status/error announcements, reduced-motion behavior, and approximately 44px actionable targets. Classify evidence honestly: static markup and pure helper tests prove structure/logic only; they do not prove clicks, bridge wiring, IPC authority, focus behavior, or races. A test script named test:a11y is not accessibility proof unless it exercises the relevant interaction semantics.

Desktop tray/controller integration reviews

For WinForms, Qt, or similar background tray-controller candidates, review the production artifact and the UI-independent command seam separately. A passing cross-platform command suite does not prove the Windows UI is wired, renders the required fields, or exercises the production factory.

Use this checklist:

Electron process-supervisor lifecycle addendum

For Electron tray apps that spawn and supervise child processes (plugin/agent launchers, PowerShell wrappers), apply the tray/controller checklist above plus these process-lifecycle gates:

Electron packaging and release-readiness reviews

For non-Electron installer packaging (PowerShell side-by-side version contracts, manifest/hash validation, atomic pointer publication, rollback/reapply safety)

For Electron packaging commits, treat the packaged application—not the source tree—as the artifact under specification review. Build a requirement matrix covering identity, platform targets, clean-checkout icons, stable userData, OS credential storage, license/SBOM scope, signing/notarization, packaged smoke, architecture selection, installer lifecycle, and CI artifact publication.

Apply these gates:

Additional Electron acceptance traps

For a final read-only packaging acceptance review, add these checks rather than trusting structural tests or a green local run:

When concurrent edits appear during the review, preserve the candidate SHA and use git show <sha>:<path> for the verdict; report later worktree drift separately rather than silently including it.

Desktop speech-bridge / TTS lifecycle review addendum

For Electron speech bridges that combine a renderer session state machine, a main-process provider WebSocket, preload IPC, streaming PCM playback, and browser fallback, review the whole lifecycle rather than approving the transport class in isolation:

For final candidate-review traps covering exact duplicate finals, pending-start ownership, awaited TTS shutdown, pre-decode base64 bounds, and browser telemetry boundaries, For dirty read-only Electron multi-provider audio reviews, see for exact provider headers, cross-provider backpressure, aggregate SSE/PCM bounds, terminal reader cancellation, stream/full-buffer cancellation parity, and meaningful adversarial test coverage.

Phase-1 fixture-corpus and plan-contract reviews

When reviewing an implementation plan whose Phase 1 deliverable is a synthetic fixture corpus plus hygiene tests, treat the corpus contract as the artifact under review—not as a runtime parser implementation.

  1. Capture the candidate SHA, parent SHA, branch/status, and exact changed paths before reading semantics. If the worktree is dirty, use git show <candidate>:<path> for candidate evidence and report later drift separately.
  2. Read the repository guidance and canonical schema/tool definitions before judging fixture semantics. Distinguish a future WorkbookPlan contract from the current direct tool schema; do not reject a fixture solely because a planned normalized operation intentionally differs from today's adapter name or argument nesting.
  3. Build a coverage matrix from the normative list: exact fixture count, every named failure/acceptance class, both transports, metadata fields, provenance, sensitive-data hygiene, and explicit non-goals. Verify representative fixtures semantically, not only by filename or failureClass.
  4. For accepted transport fixtures, inspect the envelope shape and nested payload. A transport enum alone is not proof that an “accepted XML fallback” or OpenAI tool-call case actually represents the claimed envelope. Flag contradictory descriptions/notes and cases that combine more drift than their description admits.
  5. Inspect the loader's test meaningfulness. JSON.parse in beforeAll is valid evidence for fixture JSON validity, but structural corpus tests must not be presented as proof of parser/kernel execution. Check for .skip/.todo, vacuous assertions, and inventory filters that could omit in-scope artifacts.
  6. Recompute the committed manifest independently from raw fixture bytes: exact sorted file list, each SHA-256, and the aggregate algorithm. Confirm the manifest has no timestamp or forbidden transport and no extra/missing entries.
  7. Treat TDD recovery evidence separately from final green evidence. A controlled mutation should make the old candidate fail a contract assertion, and the candidate must then pass focused/full tests plus static/type/diff gates. If dependencies are unavailable in the review environment, do not install or fabricate a rerun; use supplied controller output and independently verify deterministic static/hash evidence, labeling local execution unverified.

Independent Phase-1 code/test-quality gate

After specification compliance passes, run a separate quality review before approving a fixture corpus. Keep this review distinct from deferred Phase-5 runtime behavior, but do not treat "hygiene-only" as permission for semantically vague fixtures or vacuous structural tests:

  1. Inspect accepted transport fixtures beyond their enum labels. An OpenAI case must expose the expected tool_calls/function envelope and a parseable plan payload; an XML/native fallback case must contain either the actual XML/native envelope or a clearly documented structured representation whose shape is asserted. A field named xml_fallback alone is not proof of XML transport. The OpenAI test must actually parse the argument string and assert the accepted normalized-plan shape; checking only typeof function.arguments === "string" leaves malformed accepted payloads unproved. Scope parseability assertions to accepted cases so intentionally malformed/rejected fixtures remain meaningful.
  2. Run an adversarial transport mutation independently of the manifest: replace an accepted OpenAI argument string with malformed JSON and replace an XML/native wrapper with an arbitrary object while preserving metadata. The structural tests must fail for the semantic reason, not only because a committed hash changed; a mutation that requires a deliberate manifest update is still useful for evaluating whether the corpus assertions catch the underlying drift.
  3. Reconcile each fixture's description, failure class, expected disposition, and nested payload. A case must not claim a tool-name drift while only changing properties, or claim correct properties while using an alias. Do not combine multiple drift classes unless the description explicitly says so.
  4. Ensure hygiene tests are JSON-aware. Regexes such as /token[=:]/ do not match ordinary JSON keys like "token":"..."; check quoted keys and values deliberately. Validate metadata types and relationships, including accepted disposition versus failureClass: null, rather than checking only property presence. Treat a toHaveProperty-only check as insufficient even when the current corpus is valid: a controlled metadata mutation (for example, changing an accepted fixture's failureClass from null to a known rejected class) must be expected to fail without relying on a manifest hash mismatch. If the production test does not enforce these relations, report the gap against the exact test lines; do not silently treat valid current data as proof of fail-closed hygiene.
  5. Hash the actual bytes used by the manifest. Read fixture files as Buffer values for SHA-256 and separately decode them for JSON parsing; hashing a decoded UTF-8 string does not literally protect raw bytes.
  6. Test meaningful structural invariants without claiming parser/kernel execution: envelope shape, nested argument syntax where applicable, required plan fields, and the intended malformed/accepted distinction. A non-null modelOutput object plus a matching manifest hash is insufficient.
  7. Report controller-supplied RED/GREEN and full-suite evidence separately from independently executed static/hash/diff checks. In a read-only review, do not modify fixtures or regenerate the manifest to make a test pass.

Candidate-bounded decisive final reviews

When reviewing a named candidate commit in a read-only session, establish and preserve the review boundary before judging behavior:

  1. Capture HEAD, candidate SHA, parent SHA, branch/status, and changed paths before running tests or other tooling. Verify the candidate object directly; a later commit, concurrent agent, or generated dependency directory can change the worktree during review. If HEAD moves, do not silently switch candidates: continue with git show <candidate>:<path> / object-based scripts and report the boundary drift.
  2. Treat git status as evidence, not as permission to clean up. Never delete an untracked node_modules, generated output, or another agent's artifact during a read-only review. Distinguish tracked-tree/index cleanliness from untracked environmental drift, and report when the requested clean-before/after condition could not be established.
  3. Read repository guidance, the candidate diff, changed production files, their callers, and the relevant tests. Do not silently review generated dist/ output or later edits as candidate evidence.
  4. For fixture-corpus repairs, reconcile each fixture's prose and payload against the actual canonical schema at the production direct-tool seam and, separately, any future normalized plan contract. Do not infer that a model-visible tool name is canonical from a normalized operation name: for example, a planned create_table operation does not make a direct insert_table schema alias canonical. A fixture claiming one isolated drift must not silently combine tool-name drift with property drift; cite the schema and fixture lines and classify the contradiction as an open finding.
  5. For async transport teardown, trace the complete ownership chain: request start → active transport registry → terminal/cancel path → socket close/onclose or bounded close timeout → caller/IPC Promise. Prove that replacement construction waits for the old ownership release, that stale callbacks are detached/ignored, and that terminal delivery cannot precede the required teardown boundary.
  6. Check both streaming and legacy/full-buffer paths; do not infer parity from one implementation. Include exact-generation cancellation, completion/error/cancel single-settlement, pending-start supersession, timeout shutdown, and pre-first-audio fallback behavior in the matrix.
  7. If the user explicitly forbids build/test execution, remain read-only: use source, diff, static checks, and test inspection as evidence, label runtime verification unexecuted, and do not claim tests pass.
  8. For any API-backed create/write followed by read-back verification, audit the post-side-effect error boundary separately from ordinary request failure. The created identity must be captured before verification, and transport, decode, malformed-shape, mismatch, and local-persistence failures after the write must converge on a created-unverified result that preserves the returned identity. Do not assume catching the client’s usual RuntimeError covers JSONDecodeError, invalid UTF-8, null, list-shaped, or otherwise malformed successful responses. Add adversarial seam tests for at least one transport failure and one malformed successful response; assert both the distinct status/exit contract and identity output, with no automatic retry.
  9. For a decisive final verdict, report only PASS or actionable HIGH/MEDIUM findings with exact file:line ranges. Omit style and low-severity observations. Keep the summary concise while naming the unverified execution boundary.

Multi-provider Electron audio review lessons

When reviewing a multi-provider Electron voice feature, audit the direct/full-buffer TTS IPC path separately from the renderer streaming path. A coordinator may internally track {generation, requestId} while the public tts:cancel API still accepts only generation; that is not exact identity safety. Trace synthesize → collect → cancel → transport teardown end to end, and add a same-generation stale-cancel test where request A cannot cancel newer request B.

Treat provider setup-frame sends as a distinct start failure path. socket.send() in onopen can throw synchronously before the session is marked ready; it must immediately enter the normal redacted fail/close/settle path. A start timeout technically bounds the promise but is not prompt lifecycle correctness. Test setup-send failure separately from post-ready audio-send failure for every realtime provider.

Renderer credential-status booleans are UX preflight only, never authoritative authorization or readiness. If the selected provider can change or its credential can disappear after the renderer check, require an authoritative main-process preflight before allocating session resources. Trace the missing-credential error through preload and the renderer state machine; fixed IPC redaction must still leave a clear actionable state rather than silently returning to listening. Add a negative test for each selected provider with no credential.

For SSE/parser bounds, reject an oversized incoming decoded transport chunk before concatenating it into parser state. Checking Buffer.byteLength(buffer) only after buffer += chunk permits a transient allocation beyond the declared bound. Test both aggregate multi-chunk overflow and a single oversized chunk.

User-facing labels containing “fallback” require a semantic audit whenever automatic provider fallback is forbidden. Rename compatibility display/audio-mode labels so they cannot be mistaken for a secondary provider or browser voice path, and add a source/UI regression assertion for the forbidden wording.

Cross-provider TTS handoff gate

When the main process caches one TTS session but permits the selected provider to change, inspect the provider-switch branch separately from same-provider replacement. A synchronous dispose() that launches asynchronous WebSocket close or HTTP reader cancellation without returning an awaited promise does not release transport ownership. The replacement provider must not be constructed until the old transport has reached its close/reader-cancellation boundary; otherwise a delayed close can leave two active transports and stale callbacks during handoff. Require a delayed-close fake test that starts provider A, holds teardown, requests provider B, asserts B is not constructed, releases A, then asserts B starts.

Pending cancellation is a separate handoff invariant. A transition queue that serializes start and dispose does not automatically make cancel safe. If provider A is still disposing and provider B's start is queued, a direct cancel(B) may inspect A as the current owner, become a no-op, and allow B to be constructed after cancellation. Track pending request identity and either serialize cancellation with the transition or atomically invalidate the queued start before teardown completes. Add an adversarial test that holds A teardown, queues B, cancels B, verifies B is never constructed or started, then releases A.

Pre-reader HTTP ownership must be tracked. Aborting a fetch and returning from disposal when no body reader exists does not prove the old request is gone. Retain the pending open()/fetch promise and, if a response arrives after supersession, await or explicitly bound body-reader cancellation before releasing the transport slot. Otherwise the replacement can start while the old fetch later installs a reader. Reader cancellation itself also needs a deliberate liveness policy: either await it with a tested bounded timeout or document why it is guaranteed to settle; an unbounded await can permanently block provider handoff.

Coordinator cancellation must interrupt provider start, not only transport teardown. A bounded dispose()/cancel() is insufficient when a serialized provider coordinator is awaiting session.startStream(): if that start awaits a non-cooperative HTTP open promise, the coordinator transition remains blocked forever and the queued cancellation/dispose operation never runs. Review the start/cancel interleaving at the coordinator boundary, including cancellation before the lifecycle publishes its active request. Require one of: a start promise that settles on cancellation, an explicit cancellation race owned by the coordinator, or a deliberately non-blocking start with late-response cleanup. A direct lifecycle test that proves disposal returns while start() remains pending does not prove production handoff safety.

Final non-cooperative HTTP review gate. Verify separately that the coordinator's serialized transition covers provider selection/teardown but does not await the provider's non-cooperative start; that pending request identity is registered before the first suspension and atomically invalidated by exact cancellation; and that the provider lifecycle bounds both open settlement and reader cancellation. Trace the late-response path after the bound: it must cancel an uninstalled body/reader, reject stale sink callbacks by stream identity, and avoid installing a replacement-owned reader. For queued-completion cancellation, inspect the lifecycle directly—not only the outer coordinator—and require cancellation to discard queued PCM and terminal completion while preserving a newer exact identity. Use deferred open/reader fakes and a delayed provider handoff; fixed sleeps or a test that only checks the cancellation flag are insufficient.

Terminal cancellation parity must be checked across transports. If a provider can queue audio before publishing completion, exact cancellation after completion must discard queued audio and suppress the terminal event, matching the established transport contract. Do not rely only on an outer coordinator’s cancelled-request guard; test the provider session/lifecycle directly as well, because direct or future callers can otherwise observe stale PCM after cancellation.

Before finalizing:

Public support files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.