mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-29 19:34:29 +01:00
A first version's public copy keeps out a short owner quote padded with spaces inside its quote marks (#4776)
A first version's public export now also redacts a short owner quote written with spaces just inside its quote marks, like `" water alerts "`. Why: those words reached the public copy and `validate --public` passed it; this closes the gap left open on #4772. Nothing to do: the change is one pattern in lib/autoplan-owner-words.ts. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
6b7714c3e8
commit
f3a89d2105
5 files changed
+10
-7
No files matched your search
@@ -0,0 +1 @@
|
||||
**A first version's public export now also keeps out a short owner quote written with spaces just inside its quote marks.** `gstack-autoplan export --public` matched a short plan quote only when its words touched the quote marks, so a bullet like `" water alerts "` kept those words in the public copy, and `validate --public` passed it. Now spaces inside the marks are allowed in the match.
|
||||
@@ -6029,8 +6029,8 @@ are one, compared across punctuation, line breaks, JSON escapes, entities, HTML
|
||||
Markdown markup, invisible format characters, contractions and case; replies
|
||||
of 1 or 2 words are not scanned for, and words the owner echoed from earlier
|
||||
text he didn't write are not his (the words a reply adds to an echo still are).
|
||||
A plan quote of any length is also one wherever it appears directly inside quote
|
||||
marks, and so is its `leave out:` reason after `leave out:`, `leave it out for
|
||||
A plan quote of any length is also one wherever it appears inside quote
|
||||
marks, spaces just inside them included, and so is its `leave out:` reason after `leave out:`, `leave it out for
|
||||
now:` or `reason to leave it out:`, in any case. See
|
||||
[the public copy](unattended.md#the-public-copy). `gstack-artifact validate --public <dir> --private
|
||||
<run>/run.json` reports each quote with file:line, and `gstack-autoplan export
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ owner's own words: nothing a person wrote leaves without their click (GST-1243).
|
||||
quote too. Replies of 1 or 2 words ("yes", "do it") are not scanned for:
|
||||
they are codes or grammar, and the field itself is already dropped. A quote
|
||||
under the plan's `### Owner's words` heading is redacted at any length
|
||||
wherever it appears directly inside quote marks, and the reason on its
|
||||
wherever it appears inside quote marks (spaces just inside them included), and the reason on its
|
||||
`leave out:` line wherever it follows `leave out:`, `leave it out for now:`
|
||||
or `reason to leave it out:`, in any case; a bare mention of a short quote's
|
||||
words outside quote marks stays. A quote
|
||||
|
||||
@@ -190,7 +190,7 @@ export function ownerIndex(replies: OwnerSource[], o: { deferred?: OwnerSource[]
|
||||
const placements = [
|
||||
...(o.deferred ?? []).flatMap(d => DEFERRAL_RENDERINGS(escape(d.text))),
|
||||
...(o.carried ?? []).map(w => `words=(${escape(JSON.stringify(w))})(?= by=|$)`),
|
||||
...(o.quoted ?? []).map(q => `["“](${escape(q)})["”]`),
|
||||
...(o.quoted ?? []).map(q => `["“]\\s*(${escape(q)})\\s*["”]`),
|
||||
].map(p => new RegExp(p, 'gd')).concat((o.reasons ?? []).map(r => new RegExp(`(?:leave out|leave it out for now|reason to leave it out)\\s*:\\s*(${escape(r)})`, 'gdi')));
|
||||
return { replies: indexed, placements };
|
||||
}
|
||||
|
||||
@@ -460,11 +460,12 @@ describe('every attribution, line and quote shape reads as the merge base read i
|
||||
|
||||
describe("short owner quotes and leave-out reasons stay out of a first-version export (GST-3646)", () => {
|
||||
const tag = (prefix: string, i: number) => `${prefix}${String.fromCharCode(97 + Math.floor(i / 26))}${String.fromCharCode(97 + (i % 26))}vel`;
|
||||
const QUOTES: Array<[string, (u: string) => string]> = [
|
||||
const QUOTES: Array<[string, (u: string) => string, string?]> = [
|
||||
['one word', u => u],
|
||||
['two words', u => `quimbly ${u}`],
|
||||
['an emoji and a word', u => `🚀 ${u}`],
|
||||
['CJK', u => `毎朝ベル${u}`],
|
||||
['two words padded inside the quote marks', u => `skelvy ${u}`, ' '],
|
||||
];
|
||||
const LINES: Array<[string, (r: string) => string, boolean]> = [
|
||||
['does it', () => ' → does it', false],
|
||||
@@ -478,10 +479,10 @@ describe("short owner quotes and leave-out reasons stay out of a first-version e
|
||||
['a choice and size in mixed case', () => ' → Choice; Size: one day', false],
|
||||
['a recommended reason in mixed case', r => ` → CHOICE; size: two days; Recommend Leave Out: ${r}`, true],
|
||||
];
|
||||
const ROWS = QUOTES.flatMap(([qName, quote], a) => LINES.map(([lName, line, hasReason], b) => {
|
||||
const ROWS = QUOTES.flatMap(([qName, quote, pad = ''], a) => LINES.map(([lName, line, hasReason], b) => {
|
||||
const i = a * LINES.length + b, reason = tag('rz', i);
|
||||
const words = quote(tag('qx', i));
|
||||
return { name: `${qName} / ${lName}`, bullet: `- The owner, 2026-11-20 08:${String(i).padStart(2, '0')}Z: "${words}"${line(reason)}`, words, reason: hasReason ? line(reason).replace(/^.*leave out\s*:\s*/i, '') : undefined };
|
||||
return { name: `${qName} / ${lName}`, bullet: `- The owner, 2026-11-20 08:${String(i).padStart(2, '0')}Z: "${pad}${words}${pad}"${line(reason)}`, words, reason: hasReason ? line(reason).replace(/^.*leave out\s*:\s*/i, '') : undefined };
|
||||
}));
|
||||
const plan = [
|
||||
'# Morning helper (synthetic first version)', '', '## Implementation plan', '',
|
||||
@@ -522,6 +523,7 @@ describe("short owner quotes and leave-out reasons stay out of a first-version e
|
||||
expect(validate().status).toBe(0);
|
||||
const ownerWordsAt = (added: string) => { fs.writeFileSync(record, before + added); return validate().stderr.includes('ARTIFACT_OWNER_WORDS'); };
|
||||
expect(ownerWordsAt(`The owner said “${ROWS[0]!.words}”.\n`)).toBe(true);
|
||||
expect(ownerWordsAt(`The owner said " ${ROWS[1]!.words} ".\n`)).toBe(true);
|
||||
expect(ownerWordsAt(`The plan's reason: leave out: ${ROWS[2]!.reason}\n`)).toBe(true);
|
||||
expect(ownerWordsAt(`A plain mention of ${ROWS[0]!.words} and ${ROWS[2]!.reason}.\n`)).toBe(false);
|
||||
fs.writeFileSync(record, before);
|
||||
|
||||
Reference in new issue
Block a user