mirror of
https://github.com/garrytan/gstack.git
synced 2026-12-01 20:34:25 +01:00
v1.103.1.0 First versions: a ruled-out owner line counts only when he said it (GST-3646) (#4789)
A first version's plan can now mark a quote `ruled out : ""`, and that line beats a reviewer only when one of the owner's recorded replies holds the ruling. Why: the line is written by whoever wrote the plan, so a misremembered ruling could hide a real gap; when the ruling isn't on record, the owner is asked once, with the ruling and the finding side by side and his ruling recommended. Nothing to do: plans without a ruled-out line read exactly as before. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=specialist-batched Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team
This commit is contained in:
1 parent
f34b7aac22
commit
5278bb4e1a
16 files changed
+166
-46
No files matched your search
+25
-14
@@ -20,7 +20,7 @@ import * as path from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { branchKey, captainApprovalsDir } from './approval-record';
|
||||
import { readVersionedSlugCache, sanitizeSlug } from './bin-context';
|
||||
import { cutDrops, cutQuote, isFirstVersion, parseCuts, parseDayOne, parseOwnerWords, quoteGaps, quoteWhen, wordKey, type DayOneTable, type OwnerQuote, type OwnerWordsSection } from './autoplan-owner-text';
|
||||
import { cutDrops, cutQuote, isFirstVersion, parseCuts, parseDayOne, parseOwnerWords, quoteGaps, quoteWhen, wordKey, type CheckedQuote, type DayOneTable, type OwnerQuote, type OwnerWordsSection } from './autoplan-owner-text';
|
||||
import { SETTLEABLE_CHANGES } from './autoplan-reconcile';
|
||||
import { readDecisions, readJournal, type RunState } from './autoplan-state';
|
||||
import { resolveStateRoot } from './state-root';
|
||||
@@ -29,8 +29,9 @@ import type { FindingRow } from './headless-artifacts';
|
||||
|
||||
export type ChallengeRow = FindingRow & { user_challenge?: boolean; changes?: string; settled_by?: string; owner_quote?: number; narrows_quote?: number; resolves?: string };
|
||||
export type NewItem = Omit<GateItem, 'id'> & { idKind: 'd' | 'uc'; key: string };
|
||||
export interface GateOwnerWords { status: OwnerWordsSection['status']; quotes: Array<OwnerQuote & { verified: boolean }>; reason?: string; fix?: string }
|
||||
export interface OwnerContext { words: OwnerWordsSection; verified: Set<number>; dayOne: DayOneTable; cuts: string[]; app: boolean; lean: boolean; firstVersion: boolean }
|
||||
export interface GateOwnerWords { status: OwnerWordsSection['status']; quotes: Array<CheckedQuote & { verified: boolean }>; reason?: string; fix?: string }
|
||||
/** `verified`: quotes whose words are in a recorded owner reply; `ruled`: ruled-out lines whose ruling is (GST-3646). */
|
||||
export interface OwnerContext { words: OwnerWordsSection; verified: Set<number>; ruled: Set<number>; dayOne: DayOneTable; cuts: string[]; app: boolean; lean: boolean; firstVersion: boolean }
|
||||
|
||||
/**
|
||||
* The owner's words in this repository's approvals record for the branch checked out at `cwd` (lib/approval-record.ts
|
||||
@@ -75,13 +76,20 @@ export function ownerContext(state: RunState, recorded: string[] = recordedOwner
|
||||
try { text = fs.readFileSync(state.active_plan, 'utf8'); } catch { /* no plan text: nothing is quoted */ }
|
||||
const words = parseOwnerWords(text);
|
||||
const keys = recorded.map(wordKey);
|
||||
const verified = new Set(words.quotes.filter(q => keys.some(k => k.includes(wordKey(q.text)))).map(q => q.n));
|
||||
return { words, verified, dayOne: parseDayOne(text), cuts: parseCuts(text), app: !!state.scope?.ui, lean: !!state.lean,
|
||||
const said = (text: string) => keys.some(k => k.includes(wordKey(text)));
|
||||
const verified = new Set(words.quotes.filter(q => said(q.text)).map(q => q.n));
|
||||
const ruledBy = (q: OwnerQuote) => {
|
||||
if (q.line?.kind !== 'ruled_out') return false;
|
||||
const key = wordKey(q.line.ruling);
|
||||
return key.trim().split(/\s+/).length >= 3 && !wordKey(q.text).includes(key) && said(q.line.ruling);
|
||||
};
|
||||
const ruled = new Set(words.quotes.filter(ruledBy).map(q => q.n));
|
||||
return { words, verified, ruled, dayOne: parseDayOne(text), cuts: parseCuts(text), app: !!state.scope?.ui, lean: !!state.lean,
|
||||
firstVersion: isFirstVersion(text, !!state.scope?.first_version) };
|
||||
}
|
||||
|
||||
export function gateOwnerWords(ctx: OwnerContext): GateOwnerWords {
|
||||
return { status: ctx.words.status, quotes: ctx.words.quotes.map(q => ({ ...q, verified: ctx.verified.has(q.n) })),
|
||||
return { status: ctx.words.status, quotes: ctx.words.quotes.map(q => ({ ...q, verified: ctx.verified.has(q.n), ...(q.line?.kind === 'ruled_out' ? { ruling_verified: ctx.ruled.has(q.n) } : {}) })),
|
||||
...(ctx.words.reason ? { reason: ctx.words.reason, fix: ctx.words.fix } : {}) };
|
||||
}
|
||||
|
||||
@@ -156,14 +164,14 @@ export function dayOneItems(ctx: OwnerContext, narrowed: ChallengeRow[] = []): N
|
||||
items.push({ idKind: 'uc', key: 'owner-words', kind: 'approval', recommended: 'a', item_class: 'owner_words', changes: 'scope', cost: `a ${reopen}`,
|
||||
title: 'This is a first version, but the plan quotes none of your messages that ask for it',
|
||||
why: 'a first version is checked against your own words for the job, not against the plan: each quoted message, with its time, gets a line saying what this version does with it',
|
||||
options: [{ key: 'a', text: "add it: an ### Owner's words section quoting each message that states the job, with its time and a line each (does it or choice), then revise", changes_plan: true },
|
||||
options: [{ key: 'a', text: "add it: an ### Owner's words section quoting each message that states the job, with its time and a line each (does it, choice or ruled out), then revise", changes_plan: true },
|
||||
{ key: 'b', text: 'approve without it', changes_plan: false }] });
|
||||
}
|
||||
const gaps = ctx.firstVersion ? ctx.words.quotes.filter(q => quoteGaps(q).length) : [];
|
||||
if (gaps.length) {
|
||||
items.push({ idKind: 'uc', key: `owner-lines:${gaps.map(q => q.n).join(',')}`, kind: 'approval', recommended: 'a', item_class: 'owner_words', changes: 'scope', cost: `a ${reopen}`,
|
||||
title: `${gaps.length} of your quoted messages ${gaps.length === 1 ? 'has' : 'have'} no time or no line saying what this version does with ${gaps.length === 1 ? 'it' : 'them'}: ${gaps.map(q => `“${q.text}” (missing ${quoteGaps(q).join(' and ')})`).join('; ')}`,
|
||||
why: 'on a first version every quote says when it was said and whether this version does it or leaves it as a lettered choice',
|
||||
why: 'on a first version every quote says when it was said and whether this version does it, leaves it as a lettered choice, or follows your own ruling against it',
|
||||
options: [{ key: 'a', text: 'add the time and the line to each, then revise', changes_plan: true }, { key: 'b', text: 'approve without them', changes_plan: false }] });
|
||||
}
|
||||
if (ctx.app && ctx.dayOne.status !== 'ok') {
|
||||
@@ -181,20 +189,23 @@ export function dayOneItems(ctx: OwnerContext, narrowed: ChallengeRow[] = []): N
|
||||
const left = new Map<number, string[]>();
|
||||
const note = (q: OwnerQuote, why: string) => left.set(q.n, [...(left.get(q.n) ?? []), why]);
|
||||
for (const q of ctx.words.quotes) if (q.line?.kind === 'choice') note(q, "the plan's line for it says this version doesn't do it yet");
|
||||
const quoteCuts = ctx.cuts.filter(c => cutQuote(c, ctx.words.quotes));
|
||||
for (const cut of quoteCuts) note(cutQuote(cut, ctx.words.quotes)!, `the plan cuts it: "${cut}"`);
|
||||
for (const f of narrowed) { const q = ctx.words.quotes.find(x => x.n === f.narrows_quote); if (q) note(q, `a reviewer (${f.voice}) says the plan narrows it: ${f.title}`); }
|
||||
for (const q of ctx.words.quotes) if (q.line?.kind === 'ruled_out' && !ctx.ruled.has(q.n)) note(q, `the plan says you ruled it out on ${q.line.date}: “${q.line.ruling}”, but no recorded reply of yours says that`);
|
||||
const open = ctx.words.quotes.filter(q => !(q.line?.kind === 'ruled_out' && ctx.ruled.has(q.n)));
|
||||
const quoteCuts = ctx.cuts.filter(c => cutQuote(c, open));
|
||||
for (const cut of quoteCuts) note(cutQuote(cut, open)!, `the plan cuts it: "${cut}"`);
|
||||
for (const f of narrowed) { const q = open.find(x => x.n === f.narrows_quote); if (q) note(q, `a reviewer (${f.voice}) says the plan narrows it: ${f.title}`); }
|
||||
for (const q of ctx.words.quotes.filter(x => left.has(x.n))) {
|
||||
const choice = q.line?.kind === 'choice' ? q.line : undefined;
|
||||
const ruling = q.line?.kind === 'ruled_out' ? q.line : undefined;
|
||||
const blocking = narrowed.find(f => f.narrows_quote === q.n && (f.severity === 'Critical' || f.severity === 'High'));
|
||||
const leave = blocking ? undefined : choice?.leave_out;
|
||||
const size = choice?.size ? `about ${choice.size}` : 'size not stated';
|
||||
items.push({ idKind: 'uc', key: `quote:${q.n}`, kind: 'approval', recommended: leave ? 'b' : 'a', item_class: 'owner_choice', changes: 'scope',
|
||||
recommended_basis: blocking ? `your own words asked for it, and a ${blocking.severity} finding says the plan falls short of them` : leave ? `the plan's reason to leave it out: ${leave}` : 'your own words asked for it, and only your words are direction',
|
||||
items.push({ idKind: 'uc', key: `quote:${q.n}`, kind: 'approval', recommended: leave || ruling ? 'b' : 'a', item_class: 'owner_choice', changes: 'scope',
|
||||
recommended_basis: ruling ? `your ruling as the plan quotes it; it isn't in your recorded replies, so this asks you${blocking ? ` beside the ${blocking.severity} finding` : ''}` : blocking ? `your own words asked for it, and a ${blocking.severity} finding says the plan falls short of them` : leave ? `the plan's reason to leave it out: ${leave}` : 'your own words asked for it, and only your words are direction',
|
||||
cost: `a adds ${size} to this version and ${reopen}`,
|
||||
title: `Your words${quoteWhen(q) ? ` (${quoteWhen(q)})` : ''}: “${q.text}”, which this version doesn't fully do`,
|
||||
why: left.get(q.n)!.join('; '),
|
||||
options: [{ key: 'a', text: `build it in this version (${size})`, changes_plan: true }, { key: 'b', text: `leave it out for now${leave ? `: ${leave}` : ''}`, changes_plan: false }] });
|
||||
options: [{ key: 'a', text: `build it in this version (${size})`, changes_plan: true }, { key: 'b', text: ruling ? `leave it out, as your ruling says: “${ruling.ruling}”` : `leave it out for now${leave ? `: ${leave}` : ''}`, changes_plan: false }] });
|
||||
}
|
||||
const rest = ctx.cuts.filter(c => !quoteCuts.includes(c));
|
||||
const rowTargets = ctx.dayOne.rows.flatMap(r => [r.action, r.feature]).filter(Boolean);
|
||||
|
||||
+13
-2
@@ -27,6 +27,7 @@ import { applyCapChoices, pendingDeltas, releaseUndispatched, roundCap, roundOf
|
||||
import { evaluateCarry, gateEvidence, voidPendingCheck } from './autoplan-carry';
|
||||
import { buildEli5, capyRelayLine } from './captain-brief';
|
||||
import { FINDING_ORIGIN, openEarlier, previousReview, reviewRows, settledIds } from './autoplan-confirm';
|
||||
import { lineText } from './autoplan-owner-text';
|
||||
import { blockingProposal, confirmDirectionItem, dayOneItems, directionIsOwners, gateOwnerWords, heaviestChanges, narrowedQuoteOf, ownerContext, ownerQuoteOf, proposalItem, type ChallengeRow, type NewItem } from './autoplan-gate-items';
|
||||
import { phaseClose } from './autoplan-timing';
|
||||
import { agentWords, ANSWERED_BY_RE, applyReply, autoDefault, decisionId, decisionRows, keepDirection, legacyRecHash, parseReply, pendingHint, recHash, replyShape, validateGateList, type GateChoice, type GateItem, type GateList, type GateOption, type ParsedReply } from './gate-list';
|
||||
@@ -252,9 +253,19 @@ export function buildGate(state: RunState, gateRev: number): GateList {
|
||||
const twinOf = (id: string) => twins.get(id) ?? [...twins].find(([, out]) => out === id)?.[0];
|
||||
for (const f of [...native, ...outside, ...carried] as ChallengeRow[]) {
|
||||
if (challenged.has(f.id) || f.settled_by) continue;
|
||||
if (narrowedQuoteOf(owner, f)) { challenged.add(f.id); narrowed.push(f); continue; }
|
||||
const twin = twinOf(f.id) ? byId.get(twinOf(f.id)!) as ChallengeRow | undefined : undefined;
|
||||
const narrows = narrowedQuoteOf(owner, f) ?? narrowedQuoteOf(owner, twin);
|
||||
if (narrows) {
|
||||
const rows = [f, ...(twin && !twin.settled_by && !challenged.has(twin.id) ? [twin] : [])];
|
||||
rows.forEach(r => challenged.add(r.id));
|
||||
if (!(narrows.line?.kind === 'ruled_out' && owner.ruled.has(narrows.n))) { narrowed.push(...rows.map(r => ({ ...r, narrows_quote: narrows.n }))); continue; }
|
||||
const ids = rows.map(r => r.id);
|
||||
push({ id: `d${++d}`, title: `${f.title} [${ids.join(' + ')}]`, kind: 'auto', recommended: 'a', phase, item_class: 'challenge1', ...(heaviestChanges(rows) ? { changes: heaviestChanges(rows) } : {}),
|
||||
why: `${rows.map(r => r.voice).join(' + ')} say${rows.length > 1 ? '' : 's'} the plan does less than your words “${narrows.text}”, but ${lineText({ ...narrows, ruling_verified: true })}`,
|
||||
cost: `b reopens ${phase}${phase === 'eng' ? '' : ' and eng'}`, options: [KEEP('keep your ruling'), { key: 'b', text: 'accept the change', changes_plan: true }] }, ids.join('+'));
|
||||
continue;
|
||||
}
|
||||
if (quoted && (f.changes || f.user_challenge) && !ownerQuoteOf(owner, f)) {
|
||||
const twin = twinOf(f.id) ? byId.get(twinOf(f.id)!) as ChallengeRow | undefined : undefined;
|
||||
propose(twin && !twin.settled_by && !ownerQuoteOf(owner, twin) && !narrowedQuoteOf(owner, twin) ? [f, twin] : [f], carried.includes(f));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
* cuts. Read by the gate builder and the owner and captain briefs. On a first
|
||||
* version each Owner's words bullet also carries a line after an arrow saying
|
||||
* what this version does with those words: `does it`, `choice` (a lettered
|
||||
* gate choice, optionally `; size: …` and `; leave out: <reason>`) (GST-3608).
|
||||
* gate choice, optionally `; size: …` and `; leave out: <reason>`) or
|
||||
* `ruled out <date>: "<their ruling>"`, which the gate checks against the owner's
|
||||
* recorded replies (GST-3608, GST-3646).
|
||||
*/
|
||||
import { findSection } from './markdown-sections';
|
||||
|
||||
@@ -19,7 +21,7 @@ export const DAY_ONE_TITLES = ['Day one', 'Day-one page', 'Day one page'];
|
||||
export const CUTS_TITLES = ["What it won't do yet", 'What it will not do yet', "Won't do yet"];
|
||||
export const DAY_ONE_COLUMNS = ['action', 'frequency', 'source', 'feature', 'route', 'first build', 'check'] as const;
|
||||
|
||||
export type OwnerLine = { kind: 'does' } | { kind: 'choice'; size?: string; leave_out?: string };
|
||||
export type OwnerLine = { kind: 'does' } | { kind: 'choice'; size?: string; leave_out?: string } | { kind: 'ruled_out'; date: string; ruling: string };
|
||||
export interface OwnerQuote { n: number; who: string; text: string; line?: OwnerLine }
|
||||
export interface OwnerWordsSection { status: 'none' | 'ok' | 'malformed'; quotes: OwnerQuote[]; reason?: string; fix?: string }
|
||||
export interface DayOneRow { action: string; frequency: string; source: string; feature: string; route: string; first_build: string; check: string; assumed: boolean }
|
||||
@@ -27,6 +29,7 @@ export interface DayOneTable { status: 'none' | 'ok' | 'malformed'; rows: DayOne
|
||||
|
||||
const BULLET = /^\s*[-*+]\s+(.*)$/;
|
||||
const QUOTED = /[“"](.+)[”"]/;
|
||||
const RULED = /^ruled out\s+([^“"]+?)\s*:\s*[“"](.+)[”"]\s*$/i;
|
||||
|
||||
const count = (s: string, c: string) => s.split(c).length - 1;
|
||||
const paired = (s: string) => count(s, '"') % 2 === 0 && count(s, '“') === count(s, '”');
|
||||
@@ -48,9 +51,11 @@ export function splitLine(bullet: string): { left: string; line?: string } {
|
||||
return arrow ? { left: bullet.slice(0, close + arrow.index).trimEnd(), line: bullet.slice(close + arrow.index + arrow[0].length).trim() } : { left: bullet };
|
||||
}
|
||||
|
||||
/** A bullet's line: `does it` or `choice[; size: …][; leave out: …]`; undefined when it reads as neither. */
|
||||
/** A bullet's line: `does it`, `choice[; size: …][; leave out: …]` or `ruled out <date>: "<ruling>"`; undefined when it reads as none of them. */
|
||||
export function parseLine(line: string): OwnerLine | undefined {
|
||||
if (/^does it\W*$/i.test(line)) return { kind: 'does' };
|
||||
const ruled = RULED.exec(line);
|
||||
if (ruled) return { kind: 'ruled_out', date: ruled[1]!.trim(), ruling: ruled[2]!.trim() };
|
||||
if (!/^choice\b/i.test(line)) return undefined;
|
||||
const out: { kind: 'choice'; size?: string; leave_out?: string } = { kind: 'choice' };
|
||||
for (const part of line.replace(/^choice\b[^;]*/i, '').split(';').map(p => p.trim()).filter(Boolean)) {
|
||||
@@ -86,20 +91,27 @@ export function parseOwnerWords(planText: string): OwnerWordsSection {
|
||||
quotes.push({ n: i + 1, who: left.slice(0, m.index).replace(/[\s:,-]+$/, '').trim() || 'unattributed', text: m[1]!.trim(), ...(parsed ? { line: parsed } : {}) });
|
||||
});
|
||||
const reasons = [...(bad.length ? [`bullet ${bad.join(', ')} quotes no words`] : []),
|
||||
...(badLine.length ? [`bullet ${badLine.join(', ')} has a line that is not does it or choice`] : [])];
|
||||
return reasons.length ? { status: 'malformed', quotes, reason: reasons.join('; '), fix: badLine.length ? fix + ' → does it | choice' : fix } : { status: 'ok', quotes };
|
||||
...(badLine.length ? [`bullet ${badLine.join(', ')} has a line that is not does it, choice or ruled out <date>: "<ruling>"`] : [])];
|
||||
return reasons.length ? { status: 'malformed', quotes, reason: reasons.join('; '), fix: badLine.length ? fix + ' → does it | choice | ruled out <date>: "<their ruling>"' : fix } : { status: 'ok', quotes };
|
||||
}
|
||||
|
||||
/** What a first version still owes on a quote: when it was said, and a line. Empty when both are there. */
|
||||
export const quoteGaps = (q: OwnerQuote): string[] => [...(quoteWhen(q) ? [] : ['when it was said']), ...(q.line ? [] : ['a line (does it or choice)'])];
|
||||
export const quoteGaps = (q: OwnerQuote): string[] => [...(quoteWhen(q) ? [] : ['when it was said']), ...(q.line ? [] : ['a line (does it, choice or ruled out)'])];
|
||||
|
||||
/** The quote a cut drops, by its words (cutDrops), or undefined. */
|
||||
export const cutQuote = (cut: string, quotes: OwnerQuote[]): OwnerQuote | undefined => quotes.find(q => cutDrops(cut, q.text));
|
||||
|
||||
/** A quote as the gate shows it: whether its words, and a ruled-out line's ruling, were found in the owner's recorded replies. */
|
||||
export type CheckedQuote = OwnerQuote & { verified?: boolean; ruling_verified?: boolean };
|
||||
|
||||
/** A ruled-out line whose ruling was found in the owner's recorded replies: it stands without asking him again. */
|
||||
export const ruledByOwner = (q: CheckedQuote): boolean => q.line?.kind === 'ruled_out' && q.ruling_verified === true;
|
||||
|
||||
/** A quote's line in the owner's words. */
|
||||
export function lineText(q: OwnerQuote): string {
|
||||
export function lineText(q: CheckedQuote): string {
|
||||
if (!q.line) return 'no line yet: asked below';
|
||||
if (q.line.kind === 'does') return 'does it';
|
||||
if (q.line.kind === 'ruled_out') return `you ruled it out on ${q.line.date}: “${q.line.ruling}”${q.ruling_verified === false ? ' (not found in your recorded replies: asked below)' : ''}`;
|
||||
return 'not in this version yet: a lettered choice below';
|
||||
}
|
||||
|
||||
@@ -145,9 +157,9 @@ export const FIRST_USE_LINE = "Before you're asked to try it, an agent from anot
|
||||
* this version does with them, then the day-one table, then what it won't do yet. A cut that drops a quoted line is asked
|
||||
* beside that quote as a lettered choice, never listed under "What it won't do yet". Empty when the plan has none of them.
|
||||
*/
|
||||
export function renderOwnerPage(planText: string, quotes: Array<OwnerQuote & { verified?: boolean }> = [], o: { firstVersion?: boolean } = {}): string[] {
|
||||
export function renderOwnerPage(planText: string, quotes: CheckedQuote[] = [], o: { firstVersion?: boolean } = {}): string[] {
|
||||
const day = parseDayOne(planText);
|
||||
const cuts = parseCuts(planText).filter(c => !cutQuote(c, quotes));
|
||||
const cuts = parseCuts(planText).filter(c => !cutQuote(c, quotes.filter(q => !ruledByOwner(q))));
|
||||
const out: string[] = [];
|
||||
if (quotes.length) out.push('### Your words this plan follows', '', ...quotes.map(q => `- ${q.who}: “${q.text}”${q.verified === false ? ' (not found in your recorded replies)' : ''} → ${lineText(q)}`), '',
|
||||
'A reviewer who wants to change one of these needs your answer. Anything else in the plan was written by the planning agent, so a reviewer\'s change to it is recommended below.', '');
|
||||
|
||||
@@ -293,7 +293,8 @@ export function ownerWords(state: Pick<RunState, 'out' | 'phases' | 'gate' | 'ca
|
||||
let names: string[] = [];
|
||||
try { names = fs.readdirSync(out).filter(f => f === FILES.active || /^plan-source.*\.md$/.test(f) || /^plan-at-gate\.r\d+\.md$/.test(f) || /^plan-file\..+\.md$/.test(f)).sort(); } catch { /* no run directory */ }
|
||||
const planQuotes = names.flatMap(f => parseOwnerWords(read(f) ?? '').quotes);
|
||||
for (const text of new Set(planQuotes.map(q => q.text))) note(text, undefined, false);
|
||||
const planWords = [...new Set(planQuotes.flatMap(q => [q.text, ...(q.line?.kind === 'ruled_out' ? [q.line.ruling] : [])]))];
|
||||
for (const text of planWords) note(text, undefined, false);
|
||||
|
||||
const deferred = new Map<string, string | undefined>();
|
||||
for (const r of journal) if (r.event === 'phase_deferred' && r.by === 'human' && typeof r.reason === 'string') deferred.set(r.reason, deferred.get(r.reason) ?? String(r.ts));
|
||||
@@ -302,7 +303,7 @@ export function ownerWords(state: Pick<RunState, 'out' | 'phases' | 'gate' | 'ca
|
||||
return ownerIndex([...byText].map(([text, r]) => ({ text, parsed: r.parsed, prior: prior(r.at) })), {
|
||||
deferred: [...deferred].map(([text, at]) => ({ text, prior: prior(at) })),
|
||||
carried: state.carry?.words ? [state.carry.words] : [],
|
||||
quoted: [...new Set(planQuotes.map(q => q.text))],
|
||||
quoted: planWords,
|
||||
reasons: [...new Set(planQuotes.flatMap(q => (q.line?.kind === 'choice' && q.line.leave_out ? [q.line.leave_out] : [])))],
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -58,7 +58,7 @@ export interface GateList { schema_version: 1; run: string; gate_rev: number; it
|
||||
/** The plan's plain-language ask, read from the reviewed plan (lib/captain-brief.ts `buildEli5`); printed first. */
|
||||
eli5?: GateEli5;
|
||||
/** The plan's `### Owner's words` (lib/autoplan-owner-text.ts): the quotes a challenge must name to keep the plan's direction; `verified` when a recorded owner reply holds it. */
|
||||
owner_words?: { status: 'ok' | 'malformed' | 'none'; quotes: Array<{ n: number; who: string; text: string; verified: boolean; line?: OwnerLine }>; reason?: string; fix?: string };
|
||||
owner_words?: { status: 'ok' | 'malformed' | 'none'; quotes: Array<{ n: number; who: string; text: string; verified: boolean; ruling_verified?: boolean; line?: OwnerLine }>; reason?: string; fix?: string };
|
||||
/** A first version (a Day one section or `--first-version`): the owner brief adds the gstack-first-use line. */
|
||||
first_version?: boolean;
|
||||
/** The one-reviewer check of an unreviewed post-cap delta before a carry (lib/autoplan-carry.ts). */
|
||||
|
||||
@@ -208,7 +208,7 @@ export const CAPY_RESULT_CODES = {
|
||||
FIRST_USE_PLAN_UNREADY: {
|
||||
anchor: 'first-use-plan-unready',
|
||||
summary: 'the plan has no usable ### Day one table or ### Owner\'s words to freeze (missing, malformed, fewer than five complete rows, a row still marked assumed or citing no quote, or a quote with no time or line)',
|
||||
fix: 'quote the owner\'s messages that state the job under ### Owner\'s words (who, when, "words" → does it | choice), cite them from the five ### Day one rows as owner words <n>, then run start again',
|
||||
fix: 'quote the owner\'s messages that state the job under ### Owner\'s words (who, when, "words" → does it | choice | ruled out <date>: "<ruling>"), cite them from the five ### Day one rows as owner words <n>, then run start again',
|
||||
},
|
||||
FIRST_USE_PLAY_SPEC_INCOMPLETE: {
|
||||
anchor: 'first-use-play-spec-incomplete',
|
||||
|
||||
Reference in new issue
Block a user