mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-12-01 08:59:32 +01:00
feat(story-mode): a plain Simple caption on every panel
Story Mode gets a third reading level for someone who has never seen a terminal (a parent, a manager). Every panel now carries caption.simple: one short sentence in everyday words, with no file name, command, tool name, flag or jargon. The sentences are templates only, so nothing from the transcript (a path, a commit message, a branch) can reach them, and they are written from the same facts as the story caption: a failed check never reads as a pass, a failure you asked for says so, and a check that fails after one passed is a failure again. The final panel's simple caption is a plain summary: how the turn ended and roughly how long it took, how many files changed, whether the checks pass, whether the work is saved (only claimed "not saved" where saving is in play: you asked for it, or the turn used git), and what the reader must not miss (a problem left, a note, a question for them). test/story-plain-words.ts is the guard: the corpus test runs it over every panel of every page of the eleven sessions, and the unit tests cover the honest endings (failed check, catch, note, question, stopped, not done, to be continued, done for now) and the guard itself. The corpus expectations only gain "simple" lines. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ed6c89ff98
commit
b98deebafc
16 files changed
+738
-4
No files matched your search
@@ -11,6 +11,7 @@ import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildStoryPage, buildStoryTurns, createStoryReducer } from '../src/story-mode.js';
|
||||
import { plainWordsProblem } from './story-plain-words.js';
|
||||
|
||||
const DIR = join(import.meta.dirname, 'fixtures', 'story-corpus');
|
||||
const NAMES = readdirSync(DIR)
|
||||
@@ -46,6 +47,7 @@ function pagesOf(name: string) {
|
||||
kind: x.kind,
|
||||
ok: x.ok ?? null,
|
||||
story: x.caption.story,
|
||||
simple: x.caption.simple,
|
||||
unaskedSave: x.unaskedSave ?? false,
|
||||
director: x.caption.director,
|
||||
balloon: x.balloon?.text ?? null,
|
||||
@@ -63,6 +65,13 @@ describe('Story Mode on real sessions', () => {
|
||||
expect(NAMES.length).toBeGreaterThanOrEqual(11);
|
||||
});
|
||||
|
||||
// The Simple level is for a reader who has never seen a terminal: every caption of every page.
|
||||
it.each(NAMES)('%s reads plainly at the Simple level', (name) => {
|
||||
for (const [t, page] of pagesOf(name).entries())
|
||||
for (const [i, panel] of page.panels.entries())
|
||||
expect(plainWordsProblem(panel.simple), `turn ${t + 1}, panel ${i + 1}: ${panel.simple}`).toBeNull();
|
||||
});
|
||||
|
||||
it.each(NAMES)('%s draws as it did when it was checked by hand', (name) => {
|
||||
const pages = pagesOf(name);
|
||||
const file = join(DIR, `${name}.expected.json`);
|
||||
|
||||
Reference in new issue
Block a user