Repository navigation
Conversation
The native Insights prompt (fr, es, it, pl) rendered every ground rule of the safety-contract matrix, including the Coach-only rule that asks for a ---KEYVALUES--- block after the reply. The model then wrote the block into the briefing paragraph and the hero showed it as text. Both native builders now take their rules from groundRuleKeysForSurface, which keeps the rules marked for the surface plus the shared ones. The Coach prompt is unchanged. The server also strips any evidence block, closed or not, from every model-written field with the Coach parser: in the commit gate before a reply is stored, in the briefing reader, and in the payload served for today, so briefings cached before the fix read clean. Refs #1761
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1761
The native Insights prompt (fr, es, it, pl) rendered every ground rule from the safety-contract matrix, including the Coach-only rule that asks for a
---KEYVALUES---block after the reply. The model then wrote the block intodailyBriefing.paragraph, which passed validation, and the hero rendered it as text. EN, DE and the EN-backed locales (ko, nl, pt-BR, ru) never carried the rule.Prompt
groundRuleKeysForSurface(locale, surface)insafety-contracts.tsreturns the rules marked for the surface plusboth, in matrix order. The native Coach and Insights builders both take their list from it. The Coach list is identical to the old hand-kept order, so the Coach prompt does not change; Insights loses the five Coach-only rules (2, 3, 5, 6, 16).ground-rule-surface-guard.test.ts: per locale and surface the rule set matches the matrix; no Insights prompt in any app locale carries the sentinel, while every Coach prompt still does; and the set of source files that spell the marker or render matrix rule bodies is frozen. Checked by pointing the Insights builder at the Coach rules: eight cases go red.Output
stripKeyValuesBlocks/stripKeyValuesBlocksDeepincoach/keyvalues.tscut each block viaparseKeyValuesSentinel(closed or unterminated, text after a closed block kept, untouched values keep their identity).gateBriefingBlocks(every model-written field before a reply is stored), inreadDailyBriefing/readTrendAnnotations(snapshot, today read, re-roll), and ininsightsPayloadForToday(the served advisor payload), so briefings cached before the fix are served clean.insightsPayloadForToday.Gates run locally: typecheck, eslint and prettier on the changed files, vitest over
src/lib/ai,src/lib/daily,src/lib/insights,src/app/api/insightsand the i18n guards (499 files, 9208 tests green).