Skip to content

Fix false-positive archetype classification and verification run count#95

Draft
cursor[bot] wants to merge 1 commit intofeat/session-workflow-fingerprintsfrom
cursor/workflow-profile-correctness-fea7
Draft

Fix false-positive archetype classification and verification run count#95
cursor[bot] wants to merge 1 commit intofeat/session-workflow-fingerprintsfrom
cursor/workflow-profile-correctness-fea7

Conversation

@cursor
Copy link

@cursor cursor bot commented Mar 13, 2026

Summary

Fixes three bugs in workflow_profile_service.py:

1. "doc" substring falsely matches "docker" (high severity)

_DOC_TEXT_HINTS contained "doc" which was matched via bare in substring check against lowercased text. This caused any session mentioning "docker", "docstring", etc. to be misclassified as "docs" archetype.

Fix: Replaced the hint tuple + substring matching with a compiled regex using word boundaries (\b). \bdocs?\b matches "doc" and "docs" as standalone words but not "docker" or "docstring".

2. "port" substring falsely matches "import" (medium severity)

_MIGRATION_TEXT_HINTS contained "port" which substring-matched "import", "export", "support", "report", etc. Combined with the weak file-count guard, many non-migration sessions would be incorrectly classified.

Fix: Same approach — compiled regex with \bport\b matches "port" as a standalone word but not when it appears inside other words like "import" or "export". Other migration stems use \w* suffix to preserve prefix-matching behavior (e.g., migrat\w* matches "migrate", "migration", "migrating").

3. Verification run count tallies types not actual runs (medium severity)

verification_run_count iterated over execution_types (a set of distinct type strings) instead of the full execution_evidence list. A session with 5 test runs would report count of 1 because the set collapses all "test" entries.

Fix: Changed iteration to loop over execution_evidence and extract each record's evidence_type, counting all matching records rather than just unique types.

Open in Web Open in Cursor 

- Use word-boundary regex for doc/migration text hint matching instead of
  bare substring checks. This prevents 'doc' from matching 'docker' and
  'port' from matching 'import'/'export'/'support'/etc.
- Fix verification_run_count to iterate over the full execution_evidence
  list instead of the deduplicated execution_types set, so it counts
  actual verification runs rather than distinct verification type categories.
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