Skip to content

IsaAlign: per-install approval phrases for restate answers (#2595) - #2679

Closed
drpaulobernardy wants to merge 1 commit into
danielmiessler:mainfrom
drpaulobernardy:isaalign-approval
Closed

drpaulobernardy wants to merge 1 commit into
danielmiessler:mainfrom
drpaulobernardy:isaalign-approval

Conversation

@drpaulobernardy

Copy link
Copy Markdown

Note

🤖 Paulino (AI assistant) responding on behalf of Dr. Paulo

Carries #2595, under the conditions you set there.

What changes

LifeOS/install/LIFEOS/TOOLS/IsaAlign.ts:

  • CLEAN_YES is unchanged. restateIsClean now also accepts an answer that is made only of this install's own approval phrases.
  • The phrases live in LIFEOS/USER/CONFIG/approval-phrases.txt, one per line, with # starting a comment. With no file there are no extra phrases, so an install without one behaves exactly as today.
  • Answers and phrases are compared after NFD folding (marks dropped), with case, quotes and commas ignored, so "é isso", "e isso" and "É ISSO." are the same answer.
  • Every sentence of the answer must be a listed phrase. "sim. aceito." passes when both are listed. "sim, mas o L2..." stays unclean, because "sim mas o l2" is not a phrase. A question mark is kept, so "sim?" never matches "sim".
  • A missing file means no phrases. Any other read error is thrown, never read as an empty list.

restateIsClean(body, phrases?) takes the set as an optional second argument so tests can pass one. The callers in alignmentStatus are unchanged.

Tests

LifeOS/install/LIFEOS/TOOLS/IsaAlign.approval.test.ts has 15 tests, one group per condition: CLEAN_YES unchanged, phrases from the file (missing file, comments, a read error), NFD folding both ways, and approval plus a request kept unclean. All 15 fail on main (the new exports do not exist) and pass on this branch. The release tree ships no test directory, so the file sits next to the module. Move it wherever you keep tests.

Checked against real answers

On one Portuguese install, the 31 restate answers from its own tests (23 approvals such as "Ok seguimos", "sim, por favor", "Aprovo todos."; 8 that must not approve, such as "Sim. E faça issue ao autor.") were run through this rule with a 19-line phrase file. All 23 approve, and none of the 8 do, the same verdicts as the local patch this replaces.

🤖 Generated with Claude Code

…ssler#2595)

A restate answered in another language never counted as a clean yes. CLEAN_YES stays as it is; extra
approval phrases come from USER/CONFIG/approval-phrases.txt, one per line. Answers compare after NFD
folding, so accents and case do not matter, and every sentence of the answer must be a listed phrase,
so approval plus a request ("sim, mas o L2...") stays unclean. No file, no change in behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014YTdW6sTViEVVK8c3DeQVC
@danielmiessler

Copy link
Copy Markdown
Owner

Note

🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @drpaulobernardy, your PR let restateIsClean accept answers made only of per-install approval phrases from USER/CONFIG/approval-phrases.txt, in LIFEOS/TOOLS/IsaAlign.ts. We re-landed the change in our source tree rather than merging the PR, because the public repo is generated from that tree at each release, and credit stays with you. It ships in the next public release after 8.761.0.

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.

2 participants