Skip to content

Fix: explicit N/10 ratings silently dropped by SatisfactionCapture#1421

Open
rrittich wants to merge 1 commit into
danielmiessler:mainfrom
rrittich:fix/explicit-n-over-10-ratings
Open

Fix: explicit N/10 ratings silently dropped by SatisfactionCapture#1421
rrittich wants to merge 1 commit into
danielmiessler:mainfrom
rrittich:fix/explicit-n-over-10-ratings

Conversation

@rrittich

@rrittich rrittich commented Jul 4, 2026

Copy link
Copy Markdown

Problem

parseExplicitRating() in LifeOS/install/hooks/SatisfactionCapture.hook.ts returns null for the natural N/10 rating form — 10/10, 9/10, thanks, 8 out of 10. The reject-on-slash guard treats the / right after the leading number as invalid input:

const afterNumber = trimmed.slice(match[1].length);
if (afterNumber.length > 0 && /^[/.\dA-Za-z]/.test(afterNumber)) return null; // "10/10" hits this

So every explicit N/10 rating silently falls through to the sentiment-inference path and is recorded with source: "implicit" — a guess — instead of the score the user actually gave. Bare-number and word ratings (8, ten) work; the fraction form does not.

Fix

Add an N/10 / N out of 10 branch before the generic parser (ahead of the reject-on-slash guard), reusing a hoisted SENTENCE_STARTERS guard so a work phrase like 2/10 items done is still correctly not treated as a rating.

Behavior

input before after
10/10, thank you null (→ implicit guess) {rating: 10, comment: "thank you"}
9/10 null {rating: 9}
8 out of 10 null {rating: 8}
2/10 items done null null (guarded, not a rating)
8, ten thanks unchanged unchanged

No change to existing bare-number or word-form ratings. Single-file, no new dependencies.

parseExplicitRating() returned null for '10/10', '9/10', '8 out of 10': the
reject-on-slash guard treated the '/' after the number as invalid, so every
explicit N/10 rating silently degraded into a sentiment-inferred guess.

Add an N/10 (and 'N out of 10') branch before the generic parser, reusing a
hoisted SENTENCE_STARTERS guard so a work phrase like '2/10 items done' is
still correctly NOT treated as a rating.
@rrittich

rrittich commented Jul 4, 2026

Copy link
Copy Markdown
Author

Discovered that when I wanted to give my DA a 10/10 rating, it didn't seem to elevate that to a preference in later chats. So I asked it to investigate and it discovered this issue in the PAI harness' logic. I'm not a programmer, and I have only a faint idea of what it is talking about here, but hopefully it helps and makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant