Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex r3): gate mood on an atmospheric participle, not just a preposition
[._.]/ Adam Eivye3c7916ebeec
diff --git a/server/lib/editorial/proseTics.js b/server/lib/editorial/proseTics.jsindex 08a1344154..0bb7420631 100644--- a/server/lib/editorial/proseTics.js+++ b/server/lib/editorial/proseTics.js@@ -304,16 +304,23 @@ function isPastParticiple(lower) {return lower.length >= 4 && lower.endsWith('ed');}-// Atmospheric prepositions that introduce the "what it was rendered into/with"-// complement of a mood image ("the sky was streaked WITH red", "the room was-// bathed IN light"). A setting subject ALONE is not enough — "the room was-// searched" shares the subject but is a genuine action passive — so `mood`-// classification additionally requires one of these right after the participle.-const MOOD_PREPOSITIONS = new Set(['with', 'in']);+// Atmospheric "rendering" participles (#1593). These describe a setting being+// visually rendered into a mood — "the sky was STREAKED with red", "the room was+// BATHED in light", "the street was LINED with trees". A setting subject ALONE is+// not enough ("the room was searched" / "the city was attacked" share the subject+// but are genuine action passives), so `mood` requires the participle itself to be+// one of these atmospheric verbs.+const MOOD_PARTICIPLES = new Set([+ 'streaked', 'bathed', 'lined', 'dotted', 'washed', 'tinged', 'tinted',+ 'cloaked', 'veiled', 'shrouded', 'framed', 'dappled', 'draped', 'filled',+ 'painted', 'suffused', 'flooded', 'blanketed', 'carpeted', 'studded',+ 'wreathed', 'gilded', 'edged', 'rimmed', 'crowned', 'swathed', 'illuminated',+ 'silhouetted', 'bordered', 'fringed', 'speckled', 'splashed', 'drenched',+ 'soaked', 'coated', 'covered', 'wrapped', 'softened', 'muffled', 'hushed',+]);-// How far past the participle to look for a "by <agent>" phrase (allowing an-// intervening adverb/complement, "decorated elaborately by Mira") and for the-// mood-image preposition ("streaked faintly with red").+// How far past the participle to look for a "by <agent>" phrase, allowing an+// intervening adverb ("decorated elaborately by Mira").const PASSIVE_LOOKAHEAD = 3;// Whether the subject governing a be-verb at token index `i` is a setting noun.@@ -336,9 +343,9 @@ function hasSettingSubject(tokens, i) {* - `'stative'` — a predicate-adjective state of being ("she was exhausted"),* not an action done to the subject — the dominant FP class.* - `'mood'` — a setting/weather/atmosphere image: a setting subject AND an- * atmospheric complement ("the sky was streaked WITH red", "the- * room was bathed IN light"). A setting subject alone is not- * enough ("the room was searched" stays `'weak'`).+ * atmospheric rendering participle ("the sky was STREAKED",+ * "the room was BATHED in light"). A setting subject alone is+ * not enough ("the room was searched" stays `'weak'`).* `byAgent` is true when an explicit "by <agent>" follows the participle (allowing* an intervening adverb, "decorated elaborately by Mira").*@@ -360,11 +367,10 @@ export function findPassiveVoice(text) {const start = tokens[i].index;const end = tokens[j].index + tokens[j].word.length;const participle = tokens[j].lower;- // Small window just past the participle, where a "by <agent>" or an- // atmospheric "with/in <…>" complement would sit. Stop at a sentence/line- // boundary so the next sentence ("…exhausted. By morning…") can't leak a- // false agent in — tokenizeWords drops punctuation, so the boundary is- // detected from the raw text gap between adjacent tokens.+ // Small window just past the participle, where a "by <agent>" phrase would+ // sit. Stop at a sentence/line boundary so the next sentence ("…exhausted.+ // By morning…") can't leak a false agent in — tokenizeWords drops+ // punctuation, so the boundary is read from the raw text gap between tokens.const after = [];for (let k = j + 1; k < tokens.length && after.length < PASSIVE_LOOKAHEAD; k += 1) {const prev = tokens[k - 1];@@ -378,13 +384,10 @@ export function findPassiveVoice(text) {const byAgent = byPos !== -1 && after.length > byPos + 1;let classification = 'weak';if (!byAgent) {- // A mood image needs BOTH a setting subject and an atmospheric complement- // ("with/in <…>") right after the participle, allowing one intervening- // adverb ("streaked faintly with red") — a setting subject alone- // over-suppresses real action passives ("the room was searched").- const moodComplement = after.some((t, k) =>- MOOD_PREPOSITIONS.has(t.lower) && (k === 0 || isLyAdverb(after[k - 1].lower)));- if (moodComplement && hasSettingSubject(tokens, i)) classification = 'mood';+ // A mood image needs BOTH a setting subject AND an atmospheric rendering+ // participle — a setting subject alone over-suppresses real action+ // passives ("the room was searched", "the city was attacked").+ if (MOOD_PARTICIPLES.has(participle) && hasSettingSubject(tokens, i)) classification = 'mood';else if (STATIVE_PARTICIPLES.has(participle)) classification = 'stative';}out.push({ index: start, anchor: text.slice(start, end), be: tokens[i].lower, participle, classification, byAgent });diff --git a/server/lib/editorial/proseTics.test.js b/server/lib/editorial/proseTics.test.jsindex bcf8bbd8fb..8b5d1300ed 100644--- a/server/lib/editorial/proseTics.test.js+++ b/server/lib/editorial/proseTics.test.js@@ -181,9 +181,11 @@ describe('findPassiveVoice', () => {expect(hit.classification).toBe('weak');});- it('keeps an action passive with a setting subject but no atmospheric complement as weak', () => {- const [hit] = findPassiveVoice('The room was searched.');- expect(hit.classification).toBe('weak');+ it('keeps an action passive with a setting subject as weak (no atmospheric participle)', () => {+ expect(findPassiveVoice('The room was searched.')[0].classification).toBe('weak');+ // A "with"/"in" complement on a non-atmospheric verb must not read as mood.+ expect(findPassiveVoice('The room was searched with dogs.')[0].classification).toBe('weak');+ expect(findPassiveVoice('The city was attacked in winter.')[0].classification).toBe('weak');});it('does not read a "by" from the next sentence as the agent', () => {