Skip to content

The design language that makes your AI harness better at design.

JavaScript

Bind a native ship to every captured input; a post-ship fix asks for ship again (#933)

Paul Bakaus1d789ba16795
diff --git a/crates/comp-verbs/src/build_phase.rs b/crates/comp-verbs/src/build_phase.rs
index 8734d0eff..7ad4669ee 100644
--- a/crates/comp-verbs/src/build_phase.rs
+++ b/crates/comp-verbs/src/build_phase.rs
@@ -2300,6 +2300,15 @@ fn responsive_loop_verdict(state: &mut Value, gate: &Gate, viewport_accepted: bo
Some(format!("{lead} Stop iterating and present the first-viewport review (the assembled hero, stage hero, in component-review.md) with the current page, so the user judges the first viewport in context. An accepted review carries to desktop width while the desktop capture still matches the approved screenshot; displaced and missing regions still block. Until then this phase stays open; a finish recorded over it is an unfinished build, not a fix round."))
}
+/// The `{path, sha256}` rows of the manifest the last native responsive capture
+/// bound (`.impeccable/review/native/responsive/inputs.json`).
+fn native_capture_inputs(io: &Io) -> Option<Vec<Value>> {
+ let bytes = std::fs::read(abs(io, ".impeccable/review/native/responsive/inputs.json")).ok()?;
+ let report: Value = serde_json::from_slice(&bytes).ok()?;
+ let files = report.pointer("/manifest/files")?.as_array()?;
+ files.iter().map(|f| Some(json!({"path": f.get("path")?.as_str()?, "sha256": f.get("sha256")?.as_str()?}))).collect()
+}
+
fn hash_file(io: &Io, file: &str) -> Option<String> {
use sha1::{Digest, Sha1};
let data = std::fs::read(abs(io, file)).ok()?;
@@ -2758,6 +2767,15 @@ fn advance(io: &Io, state: &mut Value, force: bool, reason: Option<&str>, opts:
// ---- guidance strings ------------------------------------------------------
+/// What `finish --disposition ship` does with the current files, per capture policy.
+fn ship_recheck(io: &Io, state: &Value) -> &'static str {
+ if state["capturePolicy"] == "native-html-v1" || io.env("IMPECCABLE_NATIVE_CAPTURE") == Some("1") {
+ "ship re-captures the current files natively and must pass the responsive gate again"
+ } else {
+ "ship refuses while the frontend files differ from the responsive screenshots, so recapture desktop and mobile and advance responsive first"
+ }
+}
+
fn next_instruction(io: &Io, state: &Value) -> String {
let s = self_cmd(io);
let phase = state.get("phase").and_then(Value::as_str).unwrap_or("");
@@ -2766,8 +2784,12 @@ fn next_instruction(io: &Io, state: &Value) -> String {
{
let completion = crate::completion::report(&io.cwd, Some(state), None);
match completion.get("status").and_then(Value::as_str) {
- Some("complete") => return "Finish is recorded for the current entry. Repeat final review and finish if the entry or its dependencies change.".into(),
- Some("changed-after-finish") => return format!("The entry changed after finish. Repeat final review, then {s} build-phase finish --disposition <word> to validate the current artifact."),
+ Some("complete") => return format!("Finish is recorded for the current entry. Any later edit to a file the final check bound (the page, what it loads, the spec, the comp), a fix for a hook finding included, voids it: run {s} build-phase finish --disposition ship again before you stop; {}.", ship_recheck(io, state)),
+ Some("changed-after-finish") => {
+ let changed = completion["changedSinceFinish"].as_array().into_iter().flatten().filter_map(Value::as_str).take(6).collect::<Vec<_>>().join(", ");
+ let changed = if changed.is_empty() { String::new() } else { format!(" ({changed})") };
+ return format!("A file the final check bound changed after finish{changed}, so the recorded ship no longer covers the build. Repeat final review if the change goes beyond a fix it asked for, then run {s} build-phase finish --disposition ship again; {}.", ship_recheck(io, state));
+ }
Some("unverified") => return format!("The recorded finish cannot be verified against the entry. Check the artifact path and repeat final review before {s} build-phase finish --disposition <word>."),
_ => {}
}
@@ -2802,7 +2824,7 @@ fn next_instruction(io: &Io, state: &Value) -> String {
};
format!("Build the other viewports (mobile first if the surface is mobile). The first viewport must hold at common desktop widths (1280 to 1600), not only at the comp's exact size: fluid columns, no fixed-px grid that wraps 96px narrower, and sizes that scale with the viewport so nothing the comp shows in the first viewport is pushed below it. Settle or disable entrance motion before capturing (an element mid-animation reads as missing). {compared} Then {s} build-phase advance. When it fails, open the region crops it lists first; after three failed attempts it names the route to the user instead of more edits.")
}
- "review" => format!("Spawn the finish reviewer with the state file, the hero diff report, and the captures; record its disposition with {s} build-phase finish --disposition <word>."),
+ "review" => format!("Spawn the finish reviewer with the state file, the hero diff report, and the captures; record its disposition with {s} build-phase finish --disposition <word>. Make every fix before ship: {}, and any edit after it, a fix for a hook finding included, needs ship recorded again.", ship_recheck(io, state)),
_ => String::new(),
}
}
@@ -3467,6 +3489,24 @@ pub fn run_with_renderer(argv: &[String],io: &mut Io,organic_scan: OrganicScan,r
if let Some(hash) = crate::completion::artifact_hash(&io.cwd, &state) {
state["finish"]["artifactSha256"] = json!(hash);
}
+ // Bind the finish to every file the final native capture read, not
+ // only the entry: a font or stylesheet edited after ship changes the
+ // shipped page as surely as the HTML does.
+ if disposition == "ship" && state["capturePolicy"] == "native-html-v1" {
+ match native_capture_inputs(io) {
+ Some(files) => state["finish"]["captureInputs"] = json!(files),
+ None => {
+ // A ship that cannot name what it checked binds only the
+ // entry, so a later font or stylesheet edit would pass
+ // unseen. Refuse rather than record a weaker finish.
+ state["finish"] = json!({"disposition":"fix", "at":now(), "phaseAtFinish":phase,
+ "reason":"final native capture manifest unavailable"});
+ save_state(io, &state);
+ io.err("build-phase: finish --disposition ship refused: the final native capture's input manifest (.impeccable/review/native/responsive/inputs.json) is missing or unreadable, so the finish cannot bind the files it checked. Run finish --disposition ship again; if it is refused again, report that the native capture left no manifest.\n");
+ return 2;
+ }
+ }
+ }
if phase == "review" {
if let Some(rev) = state.pointer_mut("/phases/review").and_then(|v| v.as_object_mut()) {
rev.insert("status".into(), json!("closed"));
diff --git a/crates/comp-verbs/src/build_phase/integrity_tests.rs b/crates/comp-verbs/src/build_phase/integrity_tests.rs
index a1b8d314f..7b36af6a2 100644
--- a/crates/comp-verbs/src/build_phase/integrity_tests.rs
+++ b/crates/comp-verbs/src/build_phase/integrity_tests.rs
@@ -44,7 +44,7 @@ fn status_next_step_tracks_the_recorded_finish_and_later_entry_edits() {
assert!(!finished.contains("Spawn"));
ws.write("index.html", b"<main>Changed after finish</main>");
let changed = next_instruction(&io, &state);
- assert!(changed.contains("entry changed after finish"), "{changed}");
+ assert!(changed.contains("changed after finish (index.html)"), "{changed}");
assert!(changed.contains("build-phase finish"));
// Reporting status does not reopen phases or silently sign the new bytes.
assert_eq!(state["phases"]["review"]["status"], "closed");
@@ -1460,3 +1460,152 @@ fn responsive_next_names_the_frame_the_gate_actually_diffs() {
let saved = next_instruction(&io, &json!({"phase":"responsive","breakpoint":"1536x1024"}));
assert!(saved.contains("the first viewport of desktop.png (its top 1440x960"), "{saved}");
}
+
+/// A native renderer that binds the files it read, like the real one: its
+/// evidence report carries the `inputs.json` manifest of the current bytes.
+/// `changed_during` stands in for an edit landing while the capture ran.
+struct ManifestRenderer { desktop: Vec<u8>, changed_during: Option<&'static str> }
+struct ManifestCapture(crate::entry_capture::EntryEvidence, crate::entry_capture::ApprovedReference, Option<&'static str>);
+impl CapturedEntry for ManifestCapture {
+ fn approved_reference(&self) -> Option<&crate::entry_capture::ApprovedReference> { Some(&self.1) }
+ fn evidence(&self) -> &crate::entry_capture::EntryEvidence { &self.0 }
+ fn verify_current(&self) -> Result<(), String> {
+ self.2.map_or(Ok(()), |file| Err(format!("capture input changed: {file}")))
+ }
+}
+impl EntryRenderer for ManifestRenderer {
+ fn capture_entry(&self, request: &EntryRequest) -> Result<Box<dyn CapturedEntry>, String> {
+ let files: Vec<Value> = ["index.html", "fonts/face.ttf"].iter().map(|path| {
+ let bytes = std::fs::read(request.root.join(path)).unwrap();
+ json!({"path": path, "sha256": sha256_bytes(&bytes), "bytes": bytes.len(), "served": true})
+ }).collect();
+ let report = json!({"schema":"native-entry-capture-v1","inputSnapshot":"test",
+ "manifest":{"schema":"native-html-input-snapshot-v1","entry":"index.html","files":files}});
+ let frame = |name: &str| crate::entry_capture::FrameEvidence { name: name.into(), png: self.desktop.clone(), regions: vec![] };
+ Ok(Box::new(ManifestCapture(crate::entry_capture::EntryEvidence { report, frames: vec![frame("desktop"), frame("mobile")] },
+ crate::entry_capture::ApprovedReference { png: self.desktop.clone(), proof: json!({"schema": "test-review"}) }, self.changed_during)))
+ }
+}
+
+/// A comp-led native build with every phase closed and the review open, the
+/// page accepted at the first viewport so the final recheck passes on fidelity.
+fn finished_native_workspace() -> (Workspace, Vec<u8>) {
+ let ws = reviewed_desktop_workspace();
+ ws.write("fonts/face.ttf", b"font v1");
+ let mut state = json!({"phase":"review", "capturePolicy":"native-html-v1", "artifact":"index.html",
+ "comp":"comp.png", "sessionId":"owner", "startedAt":"build-one", "phases":{}});
+ for phase in PHASES { state["phases"][phase] = json!({"status":"closed", "attempts":1, "gate":{"ok":true}}); }
+ state["phases"]["review"]["status"] = json!("open");
+ save_state(&ws.io(), &state);
+ let desktop = png_io::encode_png(&reviewed_hero(true, false), &[]).unwrap();
+ (ws, desktop)
+}
+
+#[test]
+fn native_ship_binds_every_captured_input_and_a_later_edit_voids_it_until_recaptured() {
+ let (ws, desktop) = finished_native_workspace();
+ let renderer = ManifestRenderer { desktop, changed_during: None };
+ let mut io = ws.io();
+ let ship = ["finish", "--disposition", "ship"].map(String::from);
+ assert_eq!(run_with_renderer(&ship, &mut io, &no_organic_scan, Some(&renderer)), 0);
+ let state = load_state(&io).unwrap();
+ let inputs = state["finish"]["captureInputs"].as_array().unwrap();
+ assert_eq!(inputs.iter().map(|f| f["path"].as_str().unwrap()).collect::<Vec<_>>(), ["index.html", "fonts/face.ttf"]);
+ let report = crate::completion::report(&ws.path, Some(&state), Some("owner"));
+ assert_eq!(report["status"], "complete");
+ let next = next_instruction(&io, &state);
+ assert!(next.starts_with("Finish is recorded for the current entry.") && next.contains("a fix for a hook finding included, voids it")
+ && next.contains("build-phase finish --disposition ship again") && next.contains("re-captures the current files natively"), "{next}");
+
+ // A font the page loads changes after ship: the entry bytes are the same,
+ // but the shipped page is not the one the final capture saw.
+ ws.write("fonts/face.ttf", b"font v2");
+ let report = crate::completion::report(&ws.path, Some(&state), Some("owner"));
+ assert_eq!(report["status"], "changed-after-finish");
+ assert_eq!(report["changedSinceFinish"], json!(["fonts/face.ttf"]));
+ assert_eq!(report["canContinue"], true);
+ let next = next_instruction(&io, &state);
+ assert!(next.contains("A file the final check bound changed after finish (fonts/face.ttf)") && next.contains("build-phase finish --disposition ship again"), "{next}");
+ ws.write("index.html", b"<main><h1>Headline, fixed after ship</h1></main>");
+ let report = crate::completion::report(&ws.path, Some(&state), Some("owner"));
+ assert_eq!(report["changedSinceFinish"], json!(["index.html", "fonts/face.ttf"]));
+ // A deleted entry is a change the manifest names, not an unverifiable finish.
+ std::fs::remove_file(ws.path.join("index.html")).unwrap();
+ let report = crate::completion::report(&ws.path, Some(&state), Some("owner"));
+ assert_eq!(report["status"], "changed-after-finish");
+ assert_eq!(report["changedSinceFinish"], json!(["index.html", "fonts/face.ttf"]));
+ ws.write("index.html", b"<main><h1>Headline, fixed after ship</h1></main>");
+
+ // Recording ship again re-captures the current files and binds them.
+ assert_eq!(run_with_renderer(&ship, &mut io, &no_organic_scan, Some(&renderer)), 0);
+ let state = load_state(&io).unwrap();
+ assert_eq!(crate::completion::report(&ws.path, Some(&state), Some("owner"))["status"], "complete");
+ assert_eq!(state["phases"]["responsive"]["attempts"], 3);
+}
+
+#[test]
+fn native_ship_is_refused_when_an_input_changes_while_the_final_capture_runs() {
+ let (ws, desktop) = finished_native_workspace();
+ let renderer = ManifestRenderer { desktop, changed_during: Some("index.html") };
+ let mut io = ws.io();
+ let ship = ["finish", "--disposition", "ship"].map(String::from);
+ assert_eq!(run_with_renderer(&ship, &mut io, &no_organic_scan, Some(&renderer)), 2);
+ let state = load_state(&io).unwrap();
+ assert_eq!(state["finish"]["disposition"], "fix");
+ assert!(state["finish"]["captureInputs"].is_null());
+ assert_eq!(state["phase"], "responsive");
+ assert_eq!(state["phases"]["responsive"]["status"], "open");
+ let reasons = state["phases"]["responsive"]["gate"]["reasons"].as_array().unwrap();
+ assert!(reasons.iter().any(|r| r.as_str().unwrap().contains("capture input changed: index.html")), "{reasons:?}");
+}
+
+/// A native renderer whose capture leaves no input manifest.
+struct BareRenderer(Vec<u8>);
+impl EntryRenderer for BareRenderer {
+ fn capture_entry(&self, _: &EntryRequest) -> Result<Box<dyn CapturedEntry>, String> {
+ let frame = |name: &str| crate::entry_capture::FrameEvidence { name: name.into(), png: self.0.clone(), regions: vec![] };
+ Ok(Box::new(ManifestCapture(crate::entry_capture::EntryEvidence { report: json!({}), frames: vec![frame("desktop"), frame("mobile")] },
+ crate::entry_capture::ApprovedReference { png: self.0.clone(), proof: json!({"schema": "test-review"}) }, None)))
+ }
+}
+
+#[test]
+fn native_ship_is_refused_when_the_final_capture_leaves_no_manifest() {
+ let (ws, desktop) = finished_native_workspace();
+ let mut io = ws.io();
+ let ship = ["finish", "--disposition", "ship"].map(String::from);
+ assert_eq!(run_with_renderer(&ship, &mut io, &no_organic_scan, Some(&BareRenderer(desktop))), 2);
+ let state = load_state(&io).unwrap();
+ assert_eq!(state["finish"]["disposition"], "fix");
+ assert!(state["finish"]["captureInputs"].is_null());
+ assert_ne!(crate::completion::report(&ws.path, Some(&state), Some("owner"))["status"], "complete");
+}
+
+#[test]
+fn screenshot_policy_finish_binds_no_capture_manifest() {
+ let ws = Workspace::new();
+ ws.write("index.html", b"<main>Finished</main>");
+ ws.write(".impeccable/review/native/responsive/inputs.json", br#"{"manifest":{"files":[{"path":"index.html","sha256":"stale"}]}}"#);
+ let mut io = ws.io();
+ let mut state = json!({"phase":"review", "artifact":"index.html", "phases":{}});
+ for phase in PHASES { state["phases"][phase] = json!({"status":"closed"}); }
+ state["responsiveInputSha256"] = json!(crate::completion::input_hash(&ws.path));
+ save_state(&io, &state);
+ assert_eq!(run(&["finish", "--disposition", "ship"].map(String::from), &mut io, &no_organic_scan), 0);
+ let state = load_state(&io).unwrap();
+ assert!(state["finish"]["captureInputs"].is_null());
+ assert_eq!(crate::completion::report(&ws.path, Some(&state), None)["status"], "complete");
+ let next = next_instruction(&io, &state);
+ assert!(next.contains("recapture desktop and mobile and advance responsive first"), "{next}");
+}
+
+#[test]
+fn review_next_says_ship_rechecks_and_a_later_edit_needs_ship_again() {
+ let ws = Workspace::new();
+ let io = ws.io();
+ let native = next_instruction(&io, &json!({"phase":"review", "capturePolicy":"native-html-v1"}));
+ assert!(native.starts_with("Spawn the finish reviewer") && native.contains("Make every fix before ship: ship re-captures the current files natively")
+ && native.contains("needs ship recorded again"), "{native}");
+ let screenshots = next_instruction(&io, &json!({"phase":"review"}));
+ assert!(screenshots.contains("ship refuses while the frontend files differ from the responsive screenshots"), "{screenshots}");
+}
diff --git a/crates/comp-verbs/src/completion.rs b/crates/comp-verbs/src/completion.rs
index 514e69e54..5445ee37b 100644
--- a/crates/comp-verbs/src/completion.rs
+++ b/crates/comp-verbs/src/completion.rs
@@ -51,6 +51,50 @@ pub fn input_hash(root: &Path) -> Option<String> {
Some(format!("{:x}",hasher.finalize()))
}
+/// The files the final native capture bound (its `inputs.json` manifest), as
+/// `finish` recorded them. Returns the recorded paths whose bytes differ now (a
+/// deleted file counts as changed), or `None` when nothing was recorded or a
+/// recorded path is not a plain project-relative path.
+pub fn changed_capture_inputs(root: &Path, state: &Value) -> Option<Vec<String>> {
+ let files = state.pointer("/finish/captureInputs")?.as_array()?;
+ let root = root.canonicalize().ok()?;
+ let mut changed = Vec::new();
+ for file in files {
+ let relative = file.get("path")?.as_str()?;
+ let recorded = file.get("sha256")?.as_str()?;
+ let path = Path::new(relative);
+ if relative.is_empty() || !path.components().all(|c| matches!(c, std::path::Component::Normal(_))) {
+ return None;
+ }
+ let current = std::fs::read(root.join(path)).ok().map(|bytes| format!("{:x}", Sha256::digest(bytes)));
+ if current.as_deref() != Some(recorded) {
+ changed.push(relative.to_string());
+ }
+ }
+ Some(changed)
+}
+
+/// A fingerprint of everything the recorded finish is checked against now: the
+/// entry's bytes and each recorded capture input's current bytes. It moves when
+/// any bound file changes, not only the entry.
+pub fn bound_fingerprint(root: &Path, state: &Value) -> Option<String> {
+ let mut hasher = Sha256::new();
+ hasher.update(artifact_hash(root, state)?.as_bytes());
+ if let Some(files) = state.pointer("/finish/captureInputs").and_then(Value::as_array) {
+ let root = root.canonicalize().ok()?;
+ for file in files {
+ let relative = file.get("path").and_then(Value::as_str).unwrap_or("");
+ let path = Path::new(relative);
+ hasher.update([0]);
+ hasher.update(relative.as_bytes());
+ if !relative.is_empty() && path.components().all(|c| matches!(c, std::path::Component::Normal(_))) {
+ if let Ok(bytes) = std::fs::read(root.join(path)) { hasher.update(Sha256::digest(bytes)); }
+ }
+ }
+ }
+ Some(format!("{:x}", hasher.finalize()))
+}
+
pub fn open_phases(state: &Value, include_review: bool) -> Vec<&'static str> {
PHASES.iter().copied().filter(|phase| {
(include_review || *phase != "review") && !matches!(
@@ -75,6 +119,20 @@ pub fn report(root: &Path, state: Option<&Value>, session_id: Option<&str>) -> V
let current_hash = artifact_hash(root, state);
let recorded_hash = state.pointer("/finish/artifactSha256").and_then(Value::as_str);
let mut unchanged = recorded_hash.zip(current_hash.as_deref()).map(|(a,b)| a == b);
+ let mut changed_inputs: Vec<String> = Vec::new();
+ if unchanged == Some(false) {
+ if let Some(artifact) = state.get("artifact").and_then(Value::as_str) { changed_inputs.push(artifact.to_string()); }
+ }
+ if state.pointer("/finish/captureInputs").is_some() {
+ unchanged = match (unchanged, changed_capture_inputs(root, state)) {
+ (entry, Some(changed)) => {
+ for path in changed { if !changed_inputs.contains(&path) { changed_inputs.push(path); } }
+ // A deleted entry has no hash, but the manifest still names it as changed.
+ if !changed_inputs.is_empty() { Some(false) } else { entry }
+ }
+ _ => None,
+ };
+ }
if let Some(recorded) = state.pointer("/finish/artifactInputsSha256").and_then(Value::as_str) {
unchanged = match (unchanged,input_hash(root)) {
(Some(entry),Some(inputs)) => Some(entry && recorded == inputs),
@@ -93,9 +151,12 @@ pub fn report(root: &Path, state: Option<&Value>, session_id: Option<&str>) -> V
"sessionScope":scope, "sessionId":owner, "buildStartedAt":state.get("startedAt"),
"artifact":state.get("artifact"), "openPhases":phases,
"disposition":disposition, "artifactUnchangedSinceFinish":unchanged,
+ "changedSinceFinish":changed_inputs,
"canContinue":scope == "current-session" && current_hash.is_some()
&& matches!(status, "incomplete" | "changed-after-finish"),
- "verificationScope":if state["finish"]["artifactInputsSha256"].is_string() {"local frontend inputs and recorded phase status"} else {"entry artifact bytes and recorded phase status; dependencies retain their own gate evidence"}
+ "verificationScope":if state["finish"]["artifactInputsSha256"].is_string() {"local frontend inputs and recorded phase status"}
+ else if state["finish"]["captureInputs"].is_array() {"entry artifact and every file the final native capture bound, and recorded phase status"}
+ else {"entry artifact bytes and recorded phase status; dependencies retain their own gate evidence"}
})
}
diff --git a/crates/hook/src/build_completion.rs b/crates/hook/src/build_completion.rs
index f41fbee30..76e50ab20 100644
--- a/crates/hook/src/build_completion.rs
+++ b/crates/hook/src/build_completion.rs
@@ -1,5 +1,5 @@
//! Completion feedback for a build explicitly owned by this native session.
-use crate::hook_lib::{Cache, Runtime, ensure_session, persist_cache};
+use crate::hook_lib::{Cache, Runtime, ENVELOPE_PREFIX, ensure_session, persist_cache};
use impeccable_comp_verbs::completion;
use serde_json::{json, Value};
use std::path::Path;
@@ -30,6 +30,15 @@ pub fn gemini_shell_identity(rt: &Runtime, event: &serde_json::Map<String, Value
pub fn reminder(rt: &Runtime, cwd: &str, session: &str, active: bool, cache: &mut Cache) -> Option<String> {
if session == "unknown" || session.is_empty() { return None; }
+ // A continuation this hook started itself (findings shown over a recorded
+ // ship) is ours to follow up once: the fixes it asked for changed the build.
+ // The marker grants that one continuation and is spent on the first active
+ // Stop, so a later continuation another hook starts is never taken over.
+ let marker = if active {
+ let taken = ensure_session(cache, session).remove(FINDINGS_AFTER_FINISH);
+ if taken.is_some() && !persist_cache(rt, cwd, cache) { return None; }
+ taken.and_then(|v| v.as_str().map(String::from))
+ } else { None };
let root = Path::new(cwd);
let state: Value = serde_json::from_str(&std::fs::read_to_string(root.join(".impeccable/build/state.json")).ok()?).ok()?;
let report = completion::report(root, Some(&state), Some(session));
@@ -37,24 +46,46 @@ pub fn reminder(rt: &Runtime, cwd: &str, session: &str, active: bool, cache: &mu
let build = state.get("startedAt")?.as_str()?;
let artifact = state.get("artifact")?.as_str()?;
let key = format!("{build}:{artifact}");
- let current_hash = completion::artifact_hash(root, &state)?;
+ // Every bound file, not only the entry: a stylesheet-only edit is new work too.
+ let current_hash = completion::bound_fingerprint(root, &state)?;
let old = ensure_session(cache, session).get("buildCompletionNotice").cloned().unwrap_or(Value::Null);
let same_build = old["build"] == key;
let count = if same_build { old["count"].as_u64().unwrap_or(0) } else { 0 };
// Do not take over a continuation issued by another Stop hook. On a new
// turn, unchanged old work must not consume another reminder either.
- if count >= 3 || (active && count == 0)
- || (!active && same_build && old["artifactSha256"] == current_hash) { return None; }
+ let ours = marker.as_deref() == Some(key.as_str());
+ if count >= 3 || (active && count == 0 && !ours)
+ || (!active && same_build && old["boundSha256"] == current_hash) { return None; }
ensure_session(cache, session).insert("buildCompletionNotice".into(), json!({
- "build":key, "count":count+1, "artifactSha256":current_hash
+ "build":key, "count":count+1, "boundSha256":current_hash
}));
// Never emit an unbounded continuation if the counter cannot be saved.
if !persist_cache(rt, cwd, cache) { return None; }
let open = report["openPhases"].as_array()?.iter().filter_map(Value::as_str).collect::<Vec<_>>().join(", ");
- let evidence = if report["status"] == "changed-after-finish" {
- "The entry artifact changed after the recorded final review.".to_string()
- } else { format!("Open phases: {open}.") };
- Some(format!("Comp build for {artifact} is unfinished. {evidence} Complete the remaining checks and record the actual finish disposition. If work is blocked, report what remains unresolved. This is completion pass {} of 3; existing fidelity gates still apply.", count+1))
+ if report["status"] == "changed-after-finish" {
+ let changed = report["changedSinceFinish"].as_array().into_iter().flatten().filter_map(Value::as_str).take(6).collect::<Vec<_>>().join(", ");
+ let changed = if changed.is_empty() { String::new() } else { format!(" ({changed})") };
+ return Some(format!("Comp build for {artifact} is unfinished. A file the recorded finish bound changed after it{changed}, so that ship no longer covers the build. Run {} build-phase finish --disposition ship again before you stop: it rechecks the current files and must pass the responsive gate again. If it refuses, follow what it prints. If work is blocked, report what remains unresolved. This is completion pass {} of 3; existing fidelity gates still apply.", rt.self_command, count+1));
+ }
+ Some(format!("Comp build for {artifact} is unfinished. Open phases: {open}. Complete the remaining checks and record the actual finish disposition. If work is blocked, report what remains unresolved. This is completion pass {} of 3; existing fidelity gates still apply.", count+1))
+}
+
+const FINDINGS_AFTER_FINISH: &str = "findingsAfterFinish";
+
+/// When the Stop pass is about to show findings over a comp build this session
+/// already recorded as shipped, the note that tells the agent a fix voids that
+/// finish. It also marks the build, so the next Stop, a continuation this hook
+/// started, may ask for the finish again once the fixes changed the page.
+pub fn finished_build_note(rt: &Runtime, cwd: &str, session: &str, cache: &mut Cache) -> Option<String> {
+ if session == "unknown" || session.is_empty() { return None; }
+ let root = Path::new(cwd);
+ let state: Value = serde_json::from_str(&std::fs::read_to_string(root.join(".impeccable/build/state.json")).ok()?).ok()?;
+ let report = completion::report(root, Some(&state), Some(session));
+ if report["status"] != "complete" || report["sessionScope"] != "current-session" { return None; }
+ let build = state.get("startedAt")?.as_str()?;
+ let artifact = state.get("artifact")?.as_str()?;
+ ensure_session(cache, session).insert(FINDINGS_AFTER_FINISH.into(), json!(format!("{build}:{artifact}")));
+ Some(format!("{ENVELOPE_PREFIX} The comp build for {artifact} has finish --disposition ship recorded. A fix after it voids that finish: once the fixes are in, run {} build-phase finish --disposition ship again so the final check covers the current files.", rt.self_command))
}
/// Claude exposes a session-specific environment file at SessionStart. Store
diff --git a/crates/hook/src/hook.rs b/crates/hook/src/hook.rs
index 02dec40ba..224035a27 100644
--- a/crates/hook/src/hook.rs
+++ b/crates/hook/src/hook.rs
@@ -868,6 +868,12 @@ pub fn run_stop_hook(rt: &Runtime, stdin: &str) -> RunResult {
let text = if shows_unknown { format!("{attribution_note}\n\n{rendered}") } else { rendered };
let text =
append_design_system_note_once(rt, &text, scan, &mut cache, &session_id, &config);
+ // Findings shown over a comp build already recorded as shipped: a fix voids
+ // that finish, so say so with the findings, not after the agent stops.
+ let text = match crate::build_completion::finished_build_note(rt, &project_cwd, &session_id, &mut cache) {
+ Some(note) => format!("{text}\n\n{note}"),
+ None => text,
+ };
commit_footer_shown(rt, &mut cache, &session_id, &text);
persist_cache(rt, &project_cwd, &cache);
let all: usize = fresh_groups.iter().map(|g| g.findings.len()).sum();
diff --git a/crates/hook/src/hook_lib.rs b/crates/hook/src/hook_lib.rs
index 83cbfc13d..dec531a7b 100644
--- a/crates/hook/src/hook_lib.rs
+++ b/crates/hook/src/hook_lib.rs
@@ -217,6 +217,8 @@ pub struct Runtime<'a> {
/// The `HOOK_ADMIN_COMMAND` printed in the full footer
/// (JS: `node '<abs>/hook-admin.mjs'`; here `'<self>' hooks`).
pub hook_admin_command: String,
+ /// The engine as the printed commands spell it (`'<self>'`).
+ pub self_command: String,
pub html: &'a dyn HtmlEngine,
/// `process.platform === 'win32'` (command-arg quoting).
pub win32: bool,
@@ -237,6 +239,7 @@ impl<'a> Runtime<'a> {
env,
impeccable_command,
hook_admin_command: format!("{} hooks", quote_command_arg(self_cmd, win32)),
+ self_command: quote_command_arg(self_cmd, win32),
html,
win32,
canonical_cache: std::cell::RefCell::new(HashMap::new()),
diff --git a/crates/hook/tests/hook_tests.rs b/crates/hook/tests/hook_tests.rs
index 98abd8b95..b6da6dcf8 100644
--- a/crates/hook/tests/hook_tests.rs
+++ b/crates/hook/tests/hook_tests.rs
@@ -179,6 +179,107 @@ fn unfinished_comp_stop_is_owned_bounded_and_does_not_reopen_on_unrelated_turn()
assert!(hook::run_stop_hook(&r, &active).stdout.is_empty());
}
+/// A comp build this session recorded as shipped, the way `finish` leaves it.
+fn shipped_build(t: &Tmp) {
+ t.write("index.html", "<main>Shipped</main>");
+ let mut state = json!({
+ "tool":"build-phase", "version":2, "startedAt":"build-one", "phase":"review",
+ "sessionId":"owner", "artifact":"index.html", "capturePolicy":"native-html-v1", "phases":{}
+ });
+ for phase in ["comps", "spec", "plates", "hero", "sections", "motion", "responsive", "review"] {
+ state["phases"][phase] = json!({"status":"closed"});
+ }
+ let hash = impeccable_comp_verbs::completion::artifact_hash(std::path::Path::new(&t.path()), &state).unwrap();
+ state["finish"] = json!({"disposition":"ship", "phaseAtFinish":"review", "artifactSha256":hash,
+ "captureInputs":[{"path":"index.html","sha256":hash}]});
+ t.write(".impeccable/build/state.json", &state.to_string());
+}
+
+#[test]
+fn findings_over_a_shipped_build_say_a_fix_voids_the_finish_and_the_follow_up_asks_for_it_again() {
+ let t = Tmp::new();
+ t.write("package.json", "{}");
+ shipped_build(&t);
+ let file = t.write("card.css", SIDE_TAB_CSS);
+ let r = rt(&t.path());
+ hook::run_hook(&r, &edit_with_original(&t.path(), &file, "owner", ".card {}\n", ".card {}\n", SIDE_TAB_CSS));
+ // The finish holds, so the Stop pass shows the findings, with the note that a fix voids it.
+ let first = hook::run_stop_hook(&r, &stop_event(&t.path(), "owner"));
+ assert!(first.stdout.contains("side-tab") || first.stdout.contains("Side-tab"), "{}", first.stdout);
+ assert!(first.stdout.contains("The comp build for index.html has finish --disposition ship recorded. A fix after it voids that finish"), "{}", first.stdout);
+ assert!(first.stdout.contains("/opt/bin/impeccable") && first.stdout.contains(" build-phase finish --disposition ship again"), "{}", first.stdout);
+ // The agent fixes the page in the continuation those findings started.
+ t.write("index.html", "<main>Shipped, then fixed</main>");
+ let active = json!({"session_id":"owner","cwd":t.path(),"hook_event_name":"Stop","stop_hook_active":true}).to_string();
+ let follow_up = hook::run_stop_hook(&r, &active);
+ assert_eq!(follow_up.audit["kind"], "build-completion", "{:?}", follow_up.audit);
+ assert!(follow_up.stdout.contains("A file the recorded finish bound changed after it (index.html)"), "{}", follow_up.stdout);
+ assert!(follow_up.stdout.contains("build-phase finish --disposition ship again before you stop"), "{}", follow_up.stdout);
+}
+
+#[test]
+fn another_hooks_continuation_after_a_shipped_build_is_not_taken_over() {
+ let t = Tmp::new();
+ shipped_build(&t);
+ t.write("index.html", "<main>Changed by someone else's continuation</main>");
+ let active = json!({"session_id":"owner","cwd":t.path(),"hook_event_name":"Stop","stop_hook_active":true}).to_string();
+ let stop = hook::run_stop_hook(&rt(&t.path()), &active);
+ assert!(stop.stdout.is_empty(), "{}", stop.stdout);
+ // A new turn is still told the ship no longer covers the page.
+ let fresh = hook::run_stop_hook(&rt(&t.path()), &stop_event(&t.path(), "owner"));
+ assert!(fresh.stdout.contains("changed after it (index.html)"), "{}", fresh.stdout);
+}
+
+#[test]
+fn the_findings_marker_grants_one_continuation_not_the_build() {
+ let t = Tmp::new();
+ t.write("package.json", "{}");
+ shipped_build(&t);
+ let file = t.write("card.css", SIDE_TAB_CSS);
+ let r = rt(&t.path());
+ hook::run_hook(&r, &edit_with_original(&t.path(), &file, "owner", ".card {}\n", ".card {}\n", SIDE_TAB_CSS));
+ assert!(hook::run_stop_hook(&r, &stop_event(&t.path(), "owner")).stdout.contains("finish --disposition ship recorded"));
+ // The continuation the findings started changes nothing the finish bound.
+ let active = json!({"session_id":"owner","cwd":t.path(),"hook_event_name":"Stop","stop_hook_active":true}).to_string();
+ assert!(hook::run_stop_hook(&r, &active).audit.get("kind").is_none());
+ // A later continuation another hook started changes the page: not ours to take over.
+ t.write("index.html", "<main>Changed in another hook's continuation</main>");
+ let later = hook::run_stop_hook(&r, &active);
+ assert!(!later.stdout.contains("Comp build"), "{}", later.stdout);
+}
+
+#[test]
+fn a_bound_stylesheet_edit_after_a_reminder_earns_another() {
+ let t = Tmp::new();
+ t.write("site.css", "body{}");
+ shipped_build(&t);
+ let path = t.0.join(".impeccable/build/state.json");
+ let mut state: Value = serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
+ let css_hash = format!("{:x}", <sha2::Sha256 as sha2::Digest>::digest(b"body{}"));
+ state["finish"]["captureInputs"].as_array_mut().unwrap().push(json!({"path":"site.css","sha256":css_hash}));
+ std::fs::write(&path, state.to_string()).unwrap();
+ let r = rt(&t.path());
+ t.write("index.html", "<main>Edited after ship</main>");
+ assert!(hook::run_stop_hook(&r, &stop_event(&t.path(), "owner")).stdout.contains("Comp build"));
+ assert!(hook::run_stop_hook(&r, &stop_event(&t.path(), "owner")).stdout.is_empty());
+ // Only the stylesheet changes now; the entry bytes stay as the last reminder saw them.
+ t.write("site.css", "body{color:red}");
+ let stop = hook::run_stop_hook(&r, &stop_event(&t.path(), "owner"));
+ assert!(stop.stdout.contains("(index.html, site.css)"), "{}", stop.stdout);
+}
+
+#[test]
+fn findings_with_no_shipped_build_carry_no_finish_note() {
+ let t = Tmp::new();
+ t.write("package.json", "{}");
+ let file = t.write("card.css", SIDE_TAB_CSS);
+ let r = rt(&t.path());
+ hook::run_hook(&r, &edit_with_original(&t.path(), &file, "owner", ".card {}\n", ".card {}\n", SIDE_TAB_CSS));
+ let stop = hook::run_stop_hook(&r, &stop_event(&t.path(), "owner"));
+ assert!(!stop.stdout.is_empty());
+ assert!(!stop.stdout.contains("finish --disposition ship"), "{}", stop.stdout);
+}
+
#[test]
fn legacy_comp_state_never_implicitly_claims_the_current_session() {
let t = Tmp::new();
diff --git a/docs/CLI-CONTRACT.md b/docs/CLI-CONTRACT.md
index 205368765..1ea8ad458 100644
--- a/docs/CLI-CONTRACT.md
+++ b/docs/CLI-CONTRACT.md
@@ -475,6 +475,8 @@ Ported from the former `skill/scripts/{comp-spec,comp-diff,font-match,build-phas
`build-phase check-plate <region-id> --candidate <png> [--json]` runs the normal plate gate on a separate candidate, retaining the full spec for reference exclusions. Exit 0 means pass, 2 means gate failure, 1 means invalid input. It does not write files, select an asset, record an approval, or advance build state. JSON includes `ok`, `region`, `candidate`, `reasons`, `plates`, and `stateChanged: false`.
+ `build-phase finish --disposition ship` binds the finish to the page it checked. Under native capture (`capturePolicy: "native-html-v1"` or `IMPECCABLE_NATIVE_CAPTURE=1`) ship first re-runs the responsive gate with a fresh native capture of the current files (an input that changes while that capture runs fails it, reopens responsive and records `fix`), then records `finish.artifactSha256` and `finish.captureInputs`, the `{path, sha256}` rows of the manifest that capture bound (`.impeccable/review/native/responsive/inputs.json`: the entry, the static files the capture froze, the spec and the comp). When that manifest is missing or unreadable, ship is refused (exit 2, `finish` recorded as `fix` with reason `final native capture manifest unavailable`) rather than recorded with entry-only binding. Under the screenshot policy ship refuses while the frontend files differ from the responsive screenshots and records `finish.artifactInputsSha256`; no `captureInputs` is recorded. `build-phase completion` reports `status: "changed-after-finish"` when the entry or any recorded capture input differs from what finish bound (a deleted file counts as changed, the entry included, so a deleted entry reads `changed-after-finish` rather than `unverified`), and lists the changed paths, entry first, in `changedSinceFinish`. Printed `NEXT` lines: in the review phase, `Spawn the finish reviewer ... --disposition <word>. Make every fix before ship: <recheck>, and any edit after it, a fix for a hook finding included, needs ship recorded again.`; after a ship that still covers the page, `Finish is recorded for the current entry. Any later edit to a file the final check bound (the page, what it loads, the spec, the comp), a fix for a hook finding included, voids it: run <IMPECCABLE> build-phase finish --disposition ship again before you stop; <recheck>.`; after one that no longer does, `A file the final check bound changed after finish (<up to six changed paths>), so the recorded ship no longer covers the build. Repeat final review if the change goes beyond a fix it asked for, then run <IMPECCABLE> build-phase finish --disposition ship again; <recheck>.` `<recheck>` is `ship re-captures the current files natively and must pass the responsive gate again` under native capture and `ship refuses while the frontend files differ from the responsive screenshots, so recapture desktop and mobile and advance responsive first` otherwise.
+
---
## 2. Context and utility verbs
@@ -1151,6 +1153,10 @@ Candidates in order: `<scripts>/detector/detect-antipatterns.mjs` (built skill l
---
+#### Stop pass over a shipped comp build
+
+When the Stop pass shows findings while the session's own comp build has a `finish --disposition ship` that still covers the page (`build-phase completion` status `complete`, same session), it appends one line after the findings: `[impeccable@1] The comp build for <artifact> has finish --disposition ship recorded. A fix after it voids that finish: once the fixes are in, run <self> build-phase finish --disposition ship again so the final check covers the current files.` It also records the build under the session cache's `findingsAfterFinish`. The build-completion reminder normally stands down on a `stop_hook_active` Stop with no reminder issued yet, so it never takes over another hook's continuation; a continuation this pass started with those findings is its own, so the reminder may fire there. The marker grants that one continuation: the first `stop_hook_active` Stop removes it whether or not the reminder fires. The reminder's "unchanged since the last reminder" check fingerprints the entry and every recorded capture input, so a stylesheet-only edit after a reminder earns another (cache field `boundSha256`, which replaced `artifactSha256`). When a bound file changed after the finish, the reminder reads `Comp build for <artifact> is unfinished. A file the recorded finish bound changed after it (<changed paths>), so that ship no longer covers the build. Run <self> build-phase finish --disposition ship again before you stop: it rechecks the current files and must pass the responsive gate again. If it refuses, follow what it prints. If work is blocked, report what remains unresolved. This is completion pass N of 3; existing fidelity gates still apply.` The three-pass bound is unchanged.
+
#### Stop finding attribution (#522)
The Rust Stop pass still scans whole touched files; it does not infer causation from changed line ranges. It suppresses confirmed pre-existing text findings and marks remaining findings `[new]` or `[attribution unknown]`. Unknown findings remain visible, with a reminder not to treat them as regressions or broaden the task without asking. Explicit `detect` scans and per-edit/pre-edit output are unchanged.
diff --git a/skill/reference/new-work.md b/skill/reference/new-work.md
index 68e96aced..8e0b81422 100644
--- a/skill/reference/new-work.md
+++ b/skill/reference/new-work.md
@@ -153,4 +153,4 @@ Report the final verdict under the reviewer's own disposition word and at its ac
After the last correction, spawn the shipped documenter, `impeccable-documenter` (`impeccable_documenter` in codex), with the project root, artifact path, direction contract, PRODUCT.md, [document.md](document.md), and write boundary. Without subagents, load [degraded/documenter.md](degraded/documenter.md) and [document.md](document.md) before writing. Verify the outcome: new worlds and approved system changes require token-bearing DESIGN.md **and** `.impeccable/design.json`, not prose alone. Ordinary extensions compare the finished build against the incumbent system, preserve its files, and report the evidence checked; report pre-existing drift without repairing it unasked. Recheck after later edits. Finish only when review and documentation are complete. <!-- rule:skill-documenter-records-the-world -->
-On a comp-led build, record the final review disposition with `{{scripts_path}}/impeccable build-phase finish --disposition <ship|fix|rebuild|recapture>` before the final response. A refused `ship` is an unfinished build; report the outstanding phase with the verdict. Never record `fix` to end a run over an open gate: take the route the gate names, and when the user leaves it open, report that phase as open.
+On a comp-led build, record the final review disposition with `{{scripts_path}}/impeccable build-phase finish --disposition <ship|fix|rebuild|recapture>` before the final response. A refused `ship` is an unfinished build; report the outstanding phase with the verdict. Any edit after the last captured gate, a fix for a hook finding after `ship` included, voids that capture: run `finish --disposition ship` again before you stop, which rechecks the current files against the gate and names any recapture it needs. Never record `fix` to end a run over an open gate: take the route the gate names, and when the user leaves it open, report that phase as open.
diff --git a/tests/oracle/DELTAS.md b/tests/oracle/DELTAS.md
index 8ff625d71..3df38f8ae 100644
--- a/tests/oracle/DELTAS.md
+++ b/tests/oracle/DELTAS.md
@@ -313,3 +313,12 @@ New cases, recorded from the engine and reviewed by hand (no JS golden ever cove
- `build-phase-responsive-displaced`: a sign-off line pushed 40px below the first viewport by a growing column reads `displaced, not missing` with the offset and the visible share, the `LOOK FIRST` crop list and the displaced remedy line print, and the third failed `advance` leads with the three-attempt route to the first-viewport review.
- `build-phase-responsive-missing`: the same region absent from the capture still reads `at desktop width, region sign-off is missing`, now with its repair crop listed.
+
+## Recorded 2026-10-04: a native ship binds every captured input
+
+A comp-led run recorded `finish --disposition ship`, then fixed padding findings the Stop hook reported after it, and stopped: the shipped page no longer matched the final native capture. Native `finish --disposition ship` now records `finish.captureInputs`, the `{path, sha256}` rows of the manifest the final responsive capture bound, and `build-phase completion` reports `changed-after-finish` when the entry or any of those files changed, listing them in `changedSinceFinish`. The NEXT lines after review and after a recorded ship now say that a later edit, a hook finding's fix included, needs ship recorded again, and what ship does with the current files under each capture policy. No existing golden printed these lines, so none moved.
+
+New cases, recorded from the binary and reviewed by hand:
+
+- `build-phase-shipped-then-edited`: `status` over a native ship that still covers the page prints the `Finish is recorded for the current entry. Any later edit ...` NEXT; after a font the page loads changes (entry bytes unchanged), `status` prints `A file the final check bound changed after finish (fonts/face.ttf) ...` and `completion` reports `changed-after-finish` with `changedSinceFinish: ["fonts/face.ttf"]`.
+- `build-phase-review-next-native`: the review-phase NEXT under native capture, ending `Make every fix before ship: ship re-captures the current files natively and must pass the responsive gate again, and any edit after it, a fix for a hook finding included, needs ship recorded again.`
diff --git a/tests/oracle/cases/comp.mjs b/tests/oracle/cases/comp.mjs
index 0f43917f5..b6a77216a 100644
--- a/tests/oracle/cases/comp.mjs
+++ b/tests/oracle/cases/comp.mjs
@@ -18,6 +18,7 @@
import fs from 'node:fs';
import path from 'node:path';
+import crypto from 'node:crypto';
const WS = 'comp-basic';
@@ -119,6 +120,43 @@ const cases = [
args: ['advance', '--min', '0.1'], env: env(),
},
+ // build-phase after a native ship: the finish binds every file the final
+ // capture read (captureInputs), so a later font edit, entry bytes unchanged,
+ // voids it. status prints the NEXT line for each state; completion lists the
+ // changed paths. A review-phase status prints the review NEXT.
+ {
+ id: 'build-phase-shipped-then-edited', verb: 'build-phase', workspace: WS,
+ env: env(),
+ steps: [
+ {
+ setup: (ws) => {
+ const sha = (rel) => crypto.createHash('sha256').update(fs.readFileSync(path.join(ws, rel))).digest('hex');
+ write(ws, 'index.html', '<main><h1>Shipped</h1></main>\n');
+ write(ws, 'fonts/face.ttf', 'font v1');
+ const phases = Object.fromEntries(['comps', 'spec', 'plates', 'hero', 'sections', 'motion', 'responsive', 'review']
+ .map((p) => [p, { status: 'closed', attempts: 1, gate: { ok: true, summary: 'oracle' } }]));
+ write(ws, '.impeccable/build/state.json', JSON.stringify({
+ tool: 'build-phase', version: 2, startedAt: '2026-10-04T00:00:00.000Z', comp: 'comp.png', breakpoint: '768x512',
+ artifact: 'index.html', phase: 'review', capturePolicy: 'native-html-v1', sessionId: 'oracle-build', phases,
+ finish: { disposition: 'ship', at: '2026-10-04T00:00:00.000Z', phaseAtFinish: 'review', artifactSha256: sha('index.html'),
+ captureInputs: [{ path: 'index.html', sha256: sha('index.html') }, { path: 'fonts/face.ttf', sha256: sha('fonts/face.ttf') }] },
+ }, null, 2));
+ },
+ args: ['status'],
+ },
+ { setup: (ws) => write(ws, 'fonts/face.ttf', 'font v2'), args: ['status'] },
+ { args: ['completion', '--session-id', 'oracle-build'] },
+ ],
+ },
+ {
+ id: 'build-phase-review-next-native', verb: 'build-phase', workspace: WS,
+ setup: (ws) => write(ws, '.impeccable/build/state.json', JSON.stringify({
+ tool: 'build-phase', version: 2, startedAt: '2026-10-04T00:00:00.000Z', comp: 'comp.png', breakpoint: '768x512',
+ artifact: 'index.html', phase: 'review', capturePolicy: 'native-html-v1', phases: {},
+ }, null, 2)),
+ args: ['status'], env: env(),
+ },
+
// component-review plan: the v3 packet derives from the measured spec. The
// spec fixture has one plate region (art), one non-container chrome (top,
// a plan item) and one text region (body, a code region).
diff --git a/tests/oracle/golden/build-phase-review-next-native.json b/tests/oracle/golden/build-phase-review-next-native.json
new file mode 100644
index 000000000..5c13cdd15
--- /dev/null
+++ b/tests/oracle/golden/build-phase-review-next-native.json
@@ -0,0 +1,7 @@
+{
+ "stdout": "BUILD-PHASE REVIEW comp comp.png breakpoint 768x512\n comps \n spec \n plates \n hero \n sections \n motion \n responsive \n review \nNEXT Spawn the finish reviewer with the state file, the hero diff report, and the captures; record its disposition with impeccable build-phase finish --disposition <word>. Make every fix before ship: ship re-captures the current files natively and must pass the responsive gate again, and any edit after it, a fix for a hook finding included, needs ship recorded again.\n",
+ "stderr": "",
+ "exit": 0,
+ "signal": null,
+ "files": {}
+}
diff --git a/tests/oracle/golden/build-phase-shipped-then-edited.json b/tests/oracle/golden/build-phase-shipped-then-edited.json
new file mode 100644
index 000000000..d7cb819fe
--- /dev/null
+++ b/tests/oracle/golden/build-phase-shipped-then-edited.json
@@ -0,0 +1,23 @@
+{
+ "steps": [
+ {
+ "stdout": "BUILD-PHASE REVIEW comp comp.png breakpoint 768x512\n comps closed oracle\n spec closed oracle\n plates closed oracle\n hero closed oracle\n sections closed oracle\n motion closed oracle\n responsive closed oracle\n review closed oracle\n finish ship at <ISO>\nNEXT Finish is recorded for the current entry. Any later edit to a file the final check bound (the page, what it loads, the spec, the comp), a fix for a hook finding included, voids it: run impeccable build-phase finish --disposition ship again before you stop; ship re-captures the current files natively and must pass the responsive gate again.\n",
+ "stderr": "",
+ "exit": 0,
+ "signal": null
+ },
+ {
+ "stdout": "BUILD-PHASE REVIEW comp comp.png breakpoint 768x512\n comps closed oracle\n spec closed oracle\n plates closed oracle\n hero closed oracle\n sections closed oracle\n motion closed oracle\n responsive closed oracle\n review closed oracle\n finish ship at <ISO>\nNEXT A file the final check bound changed after finish (fonts/face.ttf), so the recorded ship no longer covers the build. Repeat final review if the change goes beyond a fix it asked for, then run impeccable build-phase finish --disposition ship again; ship re-captures the current files natively and must pass the responsive gate again.\n",
+ "stderr": "",
+ "exit": 0,
+ "signal": null
+ },
+ {
+ "stdout": "{\n \"tool\": \"build-completion\",\n \"version\": 1,\n \"status\": \"changed-after-finish\",\n \"sessionScope\": \"current-session\",\n \"sessionId\": \"oracle-build\",\n \"buildStartedAt\": \"<ISO>\",\n \"artifact\": \"index.html\",\n \"openPhases\": [],\n \"disposition\": \"ship\",\n \"artifactUnchangedSinceFinish\": false,\n \"changedSinceFinish\": [\n \"fonts/face.ttf\"\n ],\n \"canContinue\": true,\n \"verificationScope\": \"entry artifact and every file the final native capture bound, and recorded phase status\"\n}\n",
+ "stderr": "",
+ "exit": 0,
+ "signal": null
+ }
+ ],
+ "files": {}
+}