fix(story-mode): a push in its own command is not a commit

From review round 6: commit, then push as a second command (the most
common way to ship) drew as "Claude saves the work in 2 commits and
uploads it." for one commit, and the commit's message was dropped. A
command's `commits` was only recorded above one, and the save panel then
counted every save command as one. It is now recorded whenever a command
commits and is the only thing counted: "Claude saves the work and uploads
it: "feat: add mode()"." A push of earlier commits reads "Claude uploads
the work."

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-18 13:33:41 +02:00
1 parent c36700a9c0
commit c5ee5aaf0a
4 files changed
+38 -13

No files matched your search

@@ -91,7 +91,7 @@
{
"kind": "save",
"ok": true,
"story": "Claude saves the work in 2 commits and uploads it, but a step after that fails.",
"story": "Claude saves the work and uploads it, but a step after that fails.",
"director": "git commit -q -F - · git push -u origin main · 1 error",
"balloon": null,
"tests": null,
+2 -1
View File
@@ -116,7 +116,8 @@ describe('Story Mode on real sessions', () => {
it('a push that went through, with a step after it that failed, says both', () => {
expect(panel('question-tests-first-push', 0, 'save')).toMatchObject({
ok: true,
story: 'Claude saves the work in 2 commits and uploads it, but a step after that fails.',
// One commit, then a push in a command of its own: one commit, not two.
story: 'Claude saves the work and uploads it, but a step after that fails.',
});
});
+16
View File
@@ -950,6 +950,22 @@ describe('buildStoryPage', () => {
expect(page.filesChanged).toBe(2);
});
it('a commit then a push in its own command is one commit, named; a push alone only uploads', () => {
const save = (lines: unknown[]) => pageOf(lines).panels.find((p) => p.kind === 'save')!.caption.story;
expect(
save([
prompt('ship it'),
...bash('b1', 'git commit -qm "feat: add mode()"', 'Commit', ''),
...bash('b2', 'git push origin main', 'Push', 'To ./origin.git\n f80bb31..3e0fb80 main -> main'),
end(1000),
])
).toBe('Claude saves the work and uploads it: "feat: add mode()".');
expect(save([prompt('push'), ...bash('b1', 'git push', 'Push', 'Everything up-to-date'), end(1000)])).toBe(
'Claude uploads the work.'
);
expect(pageOf([prompt('c'), ...bash('b1', 'git commit -qm x', 'Commit', ''), end(1000)]).events[1].commits).toBe(1);
});
it('a python or node script fed by a here-document: the files it opens for writing, never guessed', () => {
const files = (command: string) => heredocWrites(command, '/w').map((d) => d.file);
expect(