fix(missions): stop titling commits "phase phase work"
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:
co-authored by
Claude Opus 5
parent
ddab8e35f5
commit
9bdc3cd89b
@@ -529,7 +529,7 @@ pub async fn commit_phase_work(
|
|||||||
// the author line carries a person's name: without it, autonomous
|
// the author line carries a person's name: without it, autonomous
|
||||||
// work would be indistinguishable from hand-written commits in
|
// work would be indistinguishable from hand-written commits in
|
||||||
// `git log`. Keep it on any change to this message.
|
// `git log`. Keep it on any change to this message.
|
||||||
"clawmates: {} phase work\n\
|
"clawmates: phase work{}\n\
|
||||||
\n\
|
\n\
|
||||||
Mission: {mission_id}\n\
|
Mission: {mission_id}\n\
|
||||||
Phase: {phase_id}\n\
|
Phase: {phase_id}\n\
|
||||||
@@ -537,9 +537,9 @@ pub async fn commit_phase_work(
|
|||||||
Committed by the ClawMates delivery pipeline from the agents' \
|
Committed by the ClawMates delivery pipeline from the agents' \
|
||||||
working tree. Authored by agents, not by the named committer.",
|
working tree. Authored by agents, not by the named committer.",
|
||||||
if iteration > 0 {
|
if iteration > 0 {
|
||||||
format!("pass {}", iteration + 1)
|
format!(" (pass {})", iteration + 1)
|
||||||
} else {
|
} else {
|
||||||
"phase".to_string()
|
String::new()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
git(repo, &["commit", "--no-verify", "-m", &message]).await?;
|
git(repo, &["commit", "--no-verify", "-m", &message]).await?;
|
||||||
|
|||||||
@@ -793,3 +793,38 @@ async fn delivery_commits_under_its_own_identity() {
|
|||||||
assertion above proves an override rather than an absence"
|
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"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user