Skip to content

SESSION_POPULATION_BINDING_MISMATCH when reviewing from inside the target workspace (Claude Code) #34

Description

@viper3-o

Summary

harness evidence-bundle fails deterministically with SESSION_POPULATION_BINDING_MISMATCH when the review is run from a Claude Code session whose own transcript lives in the target workspace's session directory. Both the sessionEvidence lane and the lead lane become unavailable, so the whole run stops per the skill contract.

Environment

  • better-harness 0.4.0 (marketplace clone @ 446bb27, 2026-07-31)
  • Host: Claude Code (platform claude)
  • OS: macOS (Darwin 25.3.0, arm64)
  • Node: v22.23.1

Reproduction

  1. Open Claude Code in a workspace that has in-window session history (in my case 131 eligible sessions / 527 task episodes in the last 30 days).
  2. Invoke /better-harness, which runs:
node scripts/better-harness.mjs harness evidence-bundle \
  --platform claude --workspace <target> --language zh \
  --depth normal --since 2026-07-01 --until 2026-07-31 --format json
  1. Bundle comes back status: failed:
    • lanes.sessionEvidence: unavailable, SESSION_POPULATION_BINDING_MISMATCH
    • lanes.projectHarness: available
    • lanes.agentCustomize: available
    • lead: unavailable, SESSION_POPULATION_BINDING_MISMATCH

Reproduced 4/4 times, across both normal and quick depths and different --until values (2026-07-31 and 2026-08-01).

What I checked

  • session-analysis facts with the same window works fine standalone (131 eligible sessions, 527 task episodes, candidates emitted) — the underlying session data is readable.
  • Re-running the analyzer with the bundle's own options (--selection all-eligible --limit 5 --episode-limit 5) returns eligibleSessions: 131, selectedSessions: 131.
  • Running the same bundle command against a workspace with zero sessions succeeds (sessionEvidence available, eligibleSessions: 0). So collection only breaks when real in-window sessions exist.

Hypothesis

The reviewing session itself is an active session inside the scanned directory (~/.claude/projects/<workspace>/). The frozen population count and the analyzer's all-eligible count appear to disagree over the active session, tripping the binding check in scripts/harness-analysis/evidence-bundle/session-evidence.mjs (eligibleCount !== population.binding.eligible.count || selectedCount !== population.binding.eligible.count).

Expected

Reviewing a workspace from a live session inside that same workspace is the primary usage path for the Claude Code host, so the population freeze and the analyzer should agree on how the active session is counted (both include it or both omit it), rather than failing closed.

Workaround (unverified)

Run the review from a Claude Code session in a different directory, targeting the workspace to review — consistent with the hypothesis that the in-workspace active session is what trips the check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions