Session Population Binding
Traceability
- Spec ID: 2026-07-30-session-population-binding
- Status: Implemented
- Issue: None; focused evidence-integrity maintenance discovered by a validated Better Harness report.
Intent
Make one evidence-bundle run derive Session facts and lead analysis from one frozen, privacy-filtered Session population. The binding must prevent an active Session from entering the lead after it was omitted from facts, without persisting or exposing the private inventory or weakening bounded lead selection.
Acceptance Scenarios
- AC-1: The bundle discovers the frozen Session population once, removes Qoder home-only sources and an exact explicit/provider active Session identity before either lane hydrates it, and supplies the same eligible snapshot to both collectors. With an explicit frozen
until, exact identity exclusion remains enabled while recency-window inference remains disabled. - AC-2: Public output contains only bounded, versioned bindings: frozen scope and omission policy/counts, eligible population count/fingerprint, Session all-eligible selection count/fingerprint, and lead bounded selection count/fingerprint with a parent-population assertion. It contains no raw Session IDs, source paths, prompts, commands, content, Memories, user-home payloads, reversible locators, or serialized snapshot.
- AC-3: Bundle validation fails closed with stable redacted error codes when a binding is missing or mismatched, a selected fingerprint is not a subset of its population, or admission counters do not reconcile. Session admission satisfies
taskEpisodes = candidateEpisodes + noRequest + selfAnalysis + lowSignal,candidateEpisodes = distinctRequests + duplicateRequests, anddistinctRequests = emittedCandidates + candidateBudget. - AC-4: Lead admission satisfies
projectedEpisodes = admittedEpisodes + zeroSignalDiscardedEpisodesandadmittedEpisodes = retained taskEpisodes. Selected fingerprints remain lane-specific for bounded strategies; cross-lane Episode totals are compared only when selected and projection-policy fingerprints match. Legitimate zero-signal filtering remains valid. - AC-5: Existing scoring, lead stratification and limits, raw-data exclusions, provider adapters, and standalone analysis commands remain unchanged.
Non-Goals
- Reading or migrating raw Sessions, Memories, user-home content, private plugin data, or unsanitized generated reports.
- Persisting the shared population snapshot or exposing private identity data.
- All-eligible lead hydration, larger limits, weaker stratification, synthetic Task Episodes, or score/weight changes.
- Renderer accessibility work, Core Change Watch work, report edits, installed plugin-cache changes, releases, merges, or production publication.
- Provider-adapter changes or a new dependency.
Plan And Tasks
Allowed files, copied verbatim from the approved Worker package:
docs/specs/2026-07-30-session-population-binding.mdscripts/session-analysis/session-population.mjsscripts/harness-analysis/evidence-bundle/contract.mjsscripts/harness-analysis/evidence-bundle/index.mjsscripts/harness-analysis/evidence-bundle/session-evidence.mjsscripts/harness-analysis/report-run.mjsscripts/harness-analysis/task-loop-source.mjstest/session-population.test.mjstest/better-harness-evidence-bundle.test.mjstest/task-loop-source.test.mjsCHANGELOG.mddocs/better-harness-doc-links.mmd
Tasks:
- Add sanitized fixtures for exact active-session exclusion, shared snapshot reuse, binding mismatch, admission reconciliation, and zero-signal filtering.
- Preserve a test-only red run that demonstrates active-session divergence and missing fail-closed binding before production edits.
- Implement the private population owner, public binding contract, shared orchestration, and bounded lead projection without persistence or new data authority.
- Regenerate the Markdown routing graph, update the changelog, run focused and full gates, and mark this spec Implemented only after evidence passes.
- Perform Review Readiness over the no-issue rationale, Spec, Tests, Risk, AI, Refs, generated files, and staged/unstaged boundaries before commit.
Test And Review Evidence
- Red run: six focused tests failed for the intended missing owner, unshared population, non-failing mismatch, and unavailable zero-signal accounting before production edits.
- Focused binding tests: nine population, binding, active-session, count contradiction, frozen-inventory, and zero-signal tests pass.
- Full Session/bundle/source compatibility: 61/61 tests pass across
test/session-population.test.mjs,test/better-harness-evidence-bundle.test.mjs,test/task-loop-source.test.mjs, andtest/harness-report-run.test.mjs. - Real target: a normal-depth Codex bundle for
database-cachingcompleted with both lanes available and the bindingbound. It recorded exact active identity availability, omitted one active Session, bound four eligible Sessions to the same parent fingerprint, and reconciled four projected Episodes as four explicit zero-signal discards and zero retained Episodes. - Privacy serialization audit: the focused bundle fixture proves neither the private inventory nor its Session IDs appear in serialized output; the real target inspection printed only versioned bindings and aggregate counters.
- Review hardening: the lead source path now skips a second
sourcesdiscovery when a frozen population is supplied, and the privacy regression checks specific fixture identities instead of rejecting macOS/private/tmppaths. - Review validation: the focused Session/report suite passed 123/123 tests, the repository gate passed 1006/1006 tests plus package verification, and browser QA confirmed complete progressbar semantics with no console errors or page overflow in the Chinese HTML fixture.
- Documentation: the canonical routing graph regenerated without drift and the six documentation checks pass.