Skip to content

fix(agent): treat curly apostrophes as negations in click-claim checks - #500

Merged
itsskofficial merged 1 commit into
existence-master:mainfrom
mangeshraut712:cursor/curly-apostrophe-negation-5c35
Oct 24, 2026
Merged

itsskofficial merged 1 commit into
existence-master:mainfrom
mangeshraut712:cursor/curly-apostrophe-negation-5c35

Conversation

@mangeshraut712

@mangeshraut712 mangeshraut712 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Click-claim checks only treated a straight apostrophe as a negation, so a reply like "No, the Subscribe button wasn’t clicked" still got a redundant correction. Curly apostrophes are now folded to straight ones before every negation pattern in outcomes.py is matched.

Fixes #498

Tested with .venv/bin/python -m pytest -q -p no:warnings -n auto --timeout=300 (2802 passed, 4 skipped) and .venv/bin/ruff check sentient tests packaging (clean). No model was involved: the check is deterministic, and the new tests cover wasn't, didn't, hasn't, and haven't with both apostrophes, plus a real click claim that still gets a correction.

Open in Web Open in Cursor 

Note

Low Risk
Small, deterministic text normalization in outcome/click-correction logic with targeted tests; no auth, data, or API surface changes.

Reviewed by Cursor Bugbot for commit bae7b2e. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected how responses handle negated browser-click statements containing curly apostrophes, so they are not mistaken for claims that a click succeeded.
    • Improved recognition of error messages with curly apostrophes, while preserving their original text.

Co-authored-by: Mangesh Raut <mangeshraut712@users.noreply.github.com>
@github-actions github-actions Bot added the area: engine Agent loop, models, approvals, storage, gateway label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the area: tasks Long-running, scheduled, triggered and watcher tasks label Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c772824b-93df-419e-b27b-e64ad7e49f3e
📥 Commits

Reviewing files that changed from the base of the PR and between 195a244 and bae7b2e.

📒 Files selected for processing: 4
  • changes/498.fixed.md
  • sentient/agent/outcomes.py
  • tests/tasks/test_outcome_checks.py
  • tests/test_agent_loop.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Outcome checks now normalize curly apostrophes before matching error text and negated browser-click claims. Tests cover straight and curly apostrophes, including negated and affirmative click statements.

Changes: Outcome checks

Layer / File(s) Summary
Normalize apostrophes in outcome checks
sentient/agent/outcomes.py, tests/tasks/test_outcome_checks.py, tests/test_agent_loop.py, changes/498.fixed.md
A shared helper converts curly apostrophes to straight apostrophes before error-text and negated-click matching. Tests cover both apostrophe forms and click-claim corrections. The change note describes the curly-apostrophe correction behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: syedmustafan

Merge Risk: ⚪ Minimal · up to bae7b

The normalization change preserves existing outcome behavior while preventing redundant corrections for the covered apostrophe forms.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: treating curly apostrophes as negations in click-claim checks.
Linked Issues check Passed Issue #498 requires straight and curly apostrophes in all relevant negation patterns in sentient/agent/outcomes.py, plus tests for wasn’t, didn’t, hasn’t, and haven’t. The PR adds `_straight…
Out of Scope Changes check Passed The changed production code normalizes apostrophes in outcome text matching. The added tests cover click-claim negations and related error-text matching. These changes support issue #498 and do not sh…
Full details: Linked Issues check

Explanation

Issue #498 requires straight and curly apostrophes in all relevant negation patterns in sentient/agent/outcomes.py, plus tests for wasn’t, didn’t, hasn’t, and haven’t. The PR adds _straight_apostrophes and applies it before _NEGATED_BROWSER_CLICK matching. Tests cover all four forms with both apostrophes and verify that an affirmative click claim still receives correction. The same normalization is applied before _ERROR_TEXT matching and is tested for Couldn’t.

Full details: Out of Scope Changes check

Explanation

The changed production code normalizes apostrophes in outcome text matching. The added tests cover click-claim negations and related error-text matching. These changes support issue #498 and do not show an unrelated feature, API change, or data change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each click with care,
Curly marks and straight ones there.
“Wasn’t clicked” stays understood,
“Clicked” gets corrected as it should.
The page’s error keeps its name,
Two apostrophes, checks the same.
Then hops away, its work complete.

Comment @coderabbitai help to get the list of available commands.

@itsskofficial

Copy link
Copy Markdown
Contributor

Thanks @mangeshraut712, and welcome! Three people sent a fix for #498 within an hour. Yours came first and is complete (tests plus a changelog entry), so we'll go with it. One thing only you can do: the CLA check is waiting for you, so please post a comment with "I have read the CLA Document and I hereby sign the CLA". We'll test it end to end in the meantime.

@mangeshraut712

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA.

@mangeshraut712

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 23, 2026

@itsskofficial itsskofficial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mangeshraut712! We tested this on a real engine with qwen3:8b. After a declined click, "No, the Subscribe button wasn’t clicked." and the hasn’t/haven’t forms are now left alone (main corrects them), and a false "I clicked the Subscribe button." is still corrected. Approved. It merges as soon as the CLA is signed: just post a comment saying "I have read the CLA Document and I hereby sign the CLA".

@itsskofficial
itsskofficial added this pull request to the merge queue Oct 24, 2026
Merged via the queue into existence-master:main with commit ad56ddf Oct 24, 2026
9 of 10 checks passed
azmi2409 added a commit to azmi2409/Sentient that referenced this pull request Oct 25, 2026
…im correction further

Message claims need a recipient or an app name (chat replies are not message sends); file names need a known extension, 'file', or 'saved to' (a.m./e.g./example.com/3.5 do not count); event words do not cover a task reminder or a booked appointment with a person; this turn tried it means tried it for what the sentence names; curly-apostrophe claims are seen via existence-master#500's _straight_apostrophes helper (now in main); a stored server refusal reads 'couldn't send', not 'couldn't confirm'; changelog line softened and em dash removed. Tests for all of these in tests/test_agent_loop.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: engine Agent loop, models, approvals, storage, gateway area: tasks Long-running, scheduled, triggered and watcher tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Click-claim negation checks miss the curly apostrophe (wasn’t, didn’t)

2 participants