Skip to content

Make convergence clustering threshold configurable #65

@that-github-user

Description

@that-github-user

Problem

The similarity threshold used to cluster agents into convergence groups is hard-coded at 0.3 in src/scoring/convergence.ts:

const SIMILARITY_THRESHOLD = 0.3;

This value was chosen without project-specific justification. For tasks with many small, similar solutions (e.g. adding a type annotation) a threshold of 0.3 clusters too aggressively. For tasks with large divergent rewrites, 0.3 may be too lenient. There is no way for users to tune this without editing source code.

Proposed solution

  • Add --convergence-threshold <0.0–1.0> flag to thinktank run (default: 0.3, preserving current behavior)
  • Thread it through RunOptionsanalyzeConvergence()
  • Document what the value means (higher = stricter grouping = more, smaller clusters)
  • Add a brief note in README or help text: --convergence-threshold 0.5 is good for refactoring tasks; 0.2 works for exploratory tasks.

Acceptance criteria

  • --convergence-threshold 0.7 changes clustering behavior visibly in output
  • Value validated: must be between 0.0 and 1.0 inclusive
  • Default is 0.3 (no change in behavior without the flag)
  • RunOptions type updated
  • Convergence tests updated to pass threshold explicitly (no test should rely on the hard-coded default)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions