Skip to content

feat(loop-context): add similarity-based stagnation detection#296

Merged
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
THRISHAL12345:feat-loop-context-similarity
Jul 16, 2026
Merged

feat(loop-context): add similarity-based stagnation detection#296
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
THRISHAL12345:feat-loop-context-similarity

Conversation

@THRISHAL12345

Copy link
Copy Markdown
Contributor

Summary

Replaces exact string matching for error signatures with a highly robust Character Trigram Jaccard Similarity algorithm in loop-context, ensuring the circuit breaker trips on semantically-similar failures even if the phrasing or wording morphs slightly across iterations.

Changes

  • New pattern or starter (followed templates/pattern-template.md + updated registry.yaml)
  • Doc / example improvement
  • Tool change (loop-context)
  • Story (includes real failure or surprise + lesson)

Checklist (from CONTRIBUTING)

  • All required sections present for patterns
  • Links work from README, patterns/README, starters/README, docs/index
  • No secrets, tokens, internal company URLs
  • STATE.md* examples use .example suffix
  • Safety-related content references docs/safety.md
  • Ran node tools/loop-audit/dist/cli.js . (or on the starter) and addressed findings

Testing / Dogfood

  • loop-audit passes on affected starters or this repo (Scored 100/100 L3)
  • Manual review of generated state / skill output (Fully tested with npm run test inside tools/loop-context - all 49 edge-case and algorithm tests pass cleanly).

Screenshots / Examples (if UI or command output)

Running loop-context on slightly morphed failures:

$ loop-context --check --stagnation 3 --similarity-threshold 0.85 < run.json
ESCALATE [stagnation] — Same error repeated 3× in a row (threshold 3): "Error: connection timeout on port #". Escalating instead of retrying.

@cobusgreyling cobusgreyling merged commit c160807 into cobusgreyling:main Jul 16, 2026
2 checks passed
@cobusgreyling

Copy link
Copy Markdown
Owner

Thanks @THRISHAL12345 — merged during scheduled maintenance. Similarity-based stagnation is a nice upgrade over exact-match signatures.

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