Skip to content

Team-scoped decisions are stored as is_global, so they still reach every project after #604 #611

Closed

Description

@cdeust

Symptom

On v4.23.0, a session opened in anthropic-partnership still receives decisions of japonais-2027, career-ops-fork and founder-os, in the "Team Decisions" block of session_start and through auto_recall. #604 / #606 added the project predicate, and the predicate works. These rows pass it because they carry is_global = TRUE.

Cause

mcp_server/core/team_scope.py (ADR-0200): a deliberate write with decision content under any agent_context is marked is_global. The docstring says the intent: "The team knows WHAT was decided regardless of WHO decided it". That is visibility across agents. is_global is then read by project_scope (ADR-1080) as visibility across projects. One flag carries two meanings, and the second one defeats the predicate for exactly the memories that matter most: deliberate decisions. A host rule that requires an agent_topic on every remember makes every recorded decision cross-project.

Evidence (local PostgreSQL store, 2026-09-17, plugin 4.23.0 from the cache)

  • 46,089 current non-benchmark memories, 160 with is_global, all 160 above the injection heat floor of 0.15.
  • By directory_context: japonais-2027 55, empty 47, anthropic-partnership/Cortex 13, harness-comparison 13, Developments/Cortex 10, others 22. 148 of the 160 were created in August and September 2026.
  • Reproduction, run from the 4.23.0 plugin directory:
    echo '{"hook_event_name":"UserPromptSubmit","prompt":"Score audit sessions completed through lance after commit","cwd":"/Users/cdeust/Developments/anthropic-partnership"}' | python3 scripts/launcher.py mcp_server.hooks.auto_recall
    injects memory 4353879, whose content starts with "HEAD 27d3ba2 japonais-2027 Score audit". Its row: is_global = t, directory_context = ''.
  • session_start with the same cwd lists 4353879, 4356519 and 4353744 under "Team Decisions". 4353744 has directory_context = /Users/cdeust/Developments/japonais-2027.

Proposed direction (owner decision, needs an ADR)

Separate the two meanings. A team decision is visible to every agent of the same project: keep the project predicate and drop the agent filter for it. is_global stays reserved for knowledge the writer declared cross-project (remember-global, the content detector in global_detector.py). The 160 existing rows need a one-off reclassification: rows with a concrete directory_context lose is_global unless the global detector confirms them; the 47 rows with an empty directory_context need a rule of their own, since an empty context never matches a project root.

Acceptance

The reproduction above injects nothing from japonais-2027 in a session whose root is anthropic-partnership, while the same prompt with cwd set to japonais-2027 still injects 4353879.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions