Skip to content

fix(advisor): include scope in versioned answer-cache identity #279

Description

@bearmug

Audit baseline: aa595438650cfbaa6db310792929c6219cc003b2 (origin/main at audit start).

Problem

Advisor answer caching hashes model, question, and context inputs but omits scope, even though scope changes the generated prompt. Identical questions asked under architecture/security/etc. can return a cached answer generated for the wrong scope.

Acceptance criteria

  • Include normalized scope and every prompt-affecting option in a versioned cache key.
  • Different scopes miss; identical complete requests hit.
  • Namespace/invalidate legacy unscoped entries.
  • Add regression tests with includeRecentWork: false for deterministic isolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions