fix(missions): stop titling commits "phase phase work"
ci / gates (push) Failing after 5s
ci / rust (push) Skipped
ci / frontend (push) Skipped
ci / e2e (push) Skipped
ci / publish (push) Skipped

Mission 019fc4e0 pushed "clawmates: phase phase work" — the iteration
marker was interpolated into a slot whose default already said "phase".
A rerun read correctly ("pass 2 phase work"), so only the common case was
wrong. Cosmetic, but it lands in the operator's git history under their
own name now that delivery commits as them.

Subject is now "clawmates: phase work" and "clawmates: phase work
(pass 2)". The test covers both, since the bug lived only in the branch
the previous shape did not exercise.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
Omar Sobh
2026-08-02 16:56:29 -07:00
co-authored by Claude Opus 5
parent ddab8e35f5
commit 9bdc3cd89b
2 changed files with 38 additions and 3 deletions
+35
View File
@@ -793,3 +793,38 @@ async fn delivery_commits_under_its_own_identity() {
assertion above proves an override rather than an absence"
);
}
/// The commit subject must read as English on both the first pass and a rerun.
///
/// Mission `019fc4e0` pushed commits titled "clawmates: phase phase work" — the
/// iteration marker was interpolated into a slot that already said "phase".
/// Cosmetic, but it lands in the operator's git history under their own name.
#[tokio::test]
async fn commit_subjects_read_correctly_on_first_pass_and_rerun() {
let pool = cm_testkit::test_pool().await;
for (iteration, expected) in [(0, "clawmates: phase work"), (1, "clawmates: phase work (pass 2)")] {
let tmp = tempfile::tempdir().unwrap();
let mission = Uuid::now_v7();
let repo = seed_repo(tmp.path(), mission);
let (_, phase) = seed_mission_phase(&pool, mission).await;
std::fs::write(repo.join("SUBJECT_PROBE.md"), "PROBE\n").unwrap();
let commit = cm_api::mission_delivery::commit_phase_work(&repo, mission, phase, iteration)
.await
.unwrap()
.expect("committed");
let subject = Command::new("git")
.arg("-C")
.arg(&repo)
.args(["log", "-1", "--format=%s", &commit.sha])
.output()
.unwrap();
assert_eq!(
String::from_utf8_lossy(&subject.stdout).trim(),
expected,
"iteration {iteration} produced a malformed subject"
);
}
}