Skip to content

fix: withhold member briefing under temporary scope on all V1 paths - #21630

Closed
louisss1016 wants to merge 1 commit into
kirodotdev:mainfrom
louisss1016:fix/21617-temporary-briefing-withheld
Closed

louisss1016 wants to merge 1 commit into
kirodotdev:mainfrom
louisss1016:fix/21617-temporary-briefing-withheld

Conversation

@louisss1016

@louisss1016 louisss1016 commented Oct 17, 2026 •

Copy link
Copy Markdown

Problem / Motivation

Goal: A temporary session never carries the member's briefing, on every path that injects the member section.

A temporary (blank-slate) session's own prefix promises "NO memory reads … Do NOT reference prior conversations or stored preferences". For a legacy V1 member, the three member-section delivery paths — session start (FRESH), slim resume, and post-compaction re-injection — left include_briefing at its default True, so the member's agent-writable briefing.md was injected as [CURRENT ASSIGNMENT] anyway, and the agent used it in replies. The Memory V2 essentials envelope already computed the memory-scope verdict and withheld the briefing; the V1 sites never asked for it.

Why it matters

The session prefix is a promise to the user about what the model can see. A turn that says "no memory reads" while carrying the member's accumulated working memory breaks that promise silently — nothing errors, and the briefing is exactly the kind of prior-conversation state a temporary session exists to exclude. Any operator granting a "coordination desk" style role in a temporary chat gets the member's durable memory in scope regardless.

Not a goal

  • Does not change the incognito scope: incognito blocks memory writes only, so it still reads the briefing, per the documented semantics.
  • Does not touch [USER PROFILE] (onboarding answers) injection in temporary sessions — that is a separate decision the issue defers.
  • Does not add the neutral [MEMBER IDENTITY] variant for withheld desks — the issue lists it as lower priority.
  • Does not change the V2 essentials path's behavior; it only shares the predicate with it.

What changed (motivation → approach → change)

Observed symptom: a temporary dashboard chat with a V1 member carried [CURRENT ASSIGNMENT] from briefing.md despite the no-memory-reads prefix. Root cause: _build_member_section gates the briefing with include_briefing, the V2 path computes it from the turn's memory scope (build_v2_essentials: not blocks_reads and memory group included), but the three V1 call sites in session_start.py and turn_message.py passed only desk_withheld and let include_briefing default to True. blocks_reads already folds memory_mode == "temporary" in via resolve_turn_owner (plus the per-session mode in build_message), so the verdict existed at every call site — it just was not consulted.

The change extracts that verdict as one owner — member.py → briefing_reads_allowed(blocks_reads, context_groups) — and passes it as include_briefing at all three V1 sites (config-scoped groups, the way every other memory block scopes them), with build_v2_essentials now reading the same predicate. One formula, four call sites. ContextBuilder._build_member_section now takes include_briefing with no default, so a future delivery path that leaves the verdict out fails to type-check instead of reading the briefing by default (the module-level build_member_section helper keeps its default for direct test callers; no production path calls it without the method).

Backwards compatibility

Removes nothing: the briefing layer is withheld (with the existing withheld by this turn's memory/privacy scope placeholder, already emitted by the V2 path) only on turns whose memory scope already blocks reads; every other turn — including incognito — injects the briefing exactly as before. One more change follows from sharing the V2 predicate: a V1 turn whose config-scoped groups exclude memory (memory.inject_memory off, or a spawn with include_memory=false) now withholds the briefing too, matching what the V2 envelope already did. The context-management doc states this, and a test pins it.

Tests

test/test_member_prompt.py::TestTemporaryScopeWithholdsBriefing — three regression tests, one per V1 delivery path, each seeding a non-empty briefing and building under a memory_mode="temporary" execution record:

  • test_fresh_session_start_withholds_the_briefing — build_session_context (FRESH)

  • test_slim_resume_withholds_the_briefing — build_message(resumed=True) (SLIM_RESUME)

  • test_post_compaction_reinjection_withholds_the_briefing — build_message(needs_reinjection=True) (WARM_REINJECTION)

  • test_excluded_memory_group_withholds_the_briefing — a normal turn with the memory group excluded withholds it

  • test_scopes_that_allow_reads_keep_the_briefing[""|incognito] — normal and incognito turns keep the briefing (nearby inputs)

  • test_briefing_reads_allowed_predicate — the predicate's truth table

Each withheld case asserts the placeholder is present and the briefing body absent. Red on the parent commit (all three failed on the missing placeholder), green on this branch.

Manual verification

N/A — unit coverage sufficient: the three paths are pure context assembly, and the existing suites covering them all pass unchanged (test_member_prompt.py, test_member_essential_context.py, test_member_turn_context.py, test_context_assembly_bindings.py, test_context_composition_contract.py, test_context_management_doc.py; ruff/black/isort/mypy clean on the touched files).

Screenshots / video

N/A — backend-only change; no user-visible frontend surface is touched.

Related Issues

Closes #21617

Pattern harvest

Rule candidate: review-prompt — Pattern: a per-turn policy verdict computed at one delivery family (the V2 essentials envelope) while sibling delivery paths default the same parameter (include_briefing=True); the fix is a single-owner predicate every site consults.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

AI assistance disclosure: prepared with an AI coding assistant (ZCode). The human author reviewed every line, validated the change locally on Windows 11 / Python 3.12 (red-on-parent / green-on-branch for the three new tests, plus the related suites and static checks listed above), and takes responsibility for the change.

@louisss1016
louisss1016 requested review from a team and KiroCrewCaptain as code owners October 17, 2026 15:58
@louisss1016
louisss1016 requested a review from buluoray October 17, 2026 15:58
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 17, 2026
@louisss1016
louisss1016 force-pushed the fix/21617-temporary-briefing-withheld branch from 255e7c0 to 0bf6be9 Compare October 19, 2026 03:55
@louisss1016

Copy link
Copy Markdown
Author

Pushed an amended commit that removes the four `(#21617)` references the Comment History Gate flagged in the added comments (kept the rationale, dropped the issue number). Verified locally with the repo's own `scripts/check_comment_history.py` against the same base: `comment-history gate passed`. Ready for a re-run of the gated workflows when you get a chance.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 46687e1d991a0dca3934f2776ff6735f2d22df12 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 46687e1d991a0dca3934f2776ff6735f2d22df12 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the one briefing-read predicate now reaches every member-section caller, and the required argument covers any future caller.

Notes

  • The PR also changes behaviour outside temporary scope: V1 turns that exclude the memory group (inject_memory off, or a spawn without include_memory) now lose [CURRENT ASSIGNMENT] too. The description and doc disclose this. It makes V1 match V2, and a revert undoes it cleanly.

[DESIGN-REVIEWED] 46687e1

Description read

[DESCRIPTION-READ] a53dec6f31c31168fb5b9e6cfe394c67f13379cd28f4a083776cb12ab9c58d4a

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 46687e1d991a0dca3934f2776ff6735f2d22df12 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix works at cause level: it removes the include_briefing=True default on the builder method, and all 3 V1 callers I grepped now pass the verdict.

Notes

  • Item 3 — rides along: a V1 turn with memory.inject_memory off, or a spawn with include_memory=false, now withholds the briefing. The Goal names only temporary scope. The description declares this and justifies it by symmetry ("matching what the V2 envelope already did"). The behaviour does follow from the meaning of the memory switch, so this stays a note. Subtraction: none needed if the memory-group switch is meant to cover the briefing.

What this change ships

Inventory (5 items) — 4 justified

Intent: a temporary (blank-slate) chat with a V1 member never gets that member's working-memory briefing — FIX.

  1. Temporary sessions withhold the member briefing at session start (FRESH) and show the withheld placeholder — justified
  2. Temporary sessions withhold the briefing on slim resume and on post-compaction re-injection — justified
  3. V1 turns with the memory group excluded now withhold the briefing — rides along, declared; symmetry with V2
  4. The builder's _build_member_section now requires include_briefing (default removed); briefing_reads_allowed predicate added, with 4 production consumers — justified
  5. The context-management doc gains a paragraph on the withheld briefing — justified

[FIRST-PRINCIPLES-REVIEWED] 46687e1

Description read

[DESCRIPTION-READ] 42f874580ba98c5d79609a54dbd3be8103005b16d15953421578020c90037527

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 46687e1d991a0dca3934f2776ff6735f2d22df12 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 46687e1

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 46687e1d991a0dca3934f2776ff6735f2d22df12 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 46687e1

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 19, 2026
@louisss1016

Copy link
Copy Markdown
Author

CI note: `Backend Tests (3.12, 2)` red is 3 whole-corpus scan timeouts in `test/test_facade_mirror_guards.py`, not a functional failure of this change — 29,635 tests passed on the shard.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 20, 2026
A temporary session's prefix promises no memory reads, but the three legacy
V1 member-section delivery paths (session start, slim resume, post-compaction
re-injection) left include_briefing at its default True, so the member's
agent-writable briefing rode a turn whose own prefix disclaimed memory. The
V2 essentials envelope already computed the memory-scope verdict; the V1
sites never asked for it.

Extract that verdict as briefing_reads_allowed() in context_assembly/member.py
-- blocks_reads (which resolve_turn_owner folds memory_mode == "temporary"
into) AND the config-scoped memory group -- and pass it as include_briefing at
all three V1 sites, so one predicate owns the briefing read everywhere.

Regression tests cover all three paths: the briefing body is absent and the
withheld placeholder is present.
@iamwhatever
iamwhatever force-pushed the fix/21617-temporary-briefing-withheld branch from 0bf6be9 to 46687e1 Compare October 26, 2026 06:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 26, 2026
@iamwhatever iamwhatever self-assigned this Oct 26, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one tracking gap. Separately, this PR needs a human reviewer.

The fix looks correct. briefing_reads_allowed is now the single predicate (member.py L359), all three V1 delivery paths pass it, and include_briefing no longer has a default (member_gates.py L114). The session-start path also receives the per-session temporary mode through build_message. CI is green.

Tracking gap: the PR closes #21617, and that issue lists two related items that this PR defers under Not a goal. One is a neutral [MEMBER IDENTITY] variant when the briefing is withheld. The other is an explicit decision on [USER PROFILE] in temporary sessions. Once #21617 closes, nothing tracks them. Please either handle them here, or open one issue per item and link both in the description.

Human review: the change decides what member working memory is withheld from the model's context on temporary turns, and on turns that exclude the memory group. Per this repository's review policy, a maintainer should sign off on that, even though I found no defect.

Reviewed head: 46687e1

— crew-pr-reviewer (r127)

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 26, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

[operator: bolichen97] Continuing this in #31791; thanks for the start.

bolichen97 added a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.
bolichen97 added a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.
bolichen97 added a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.
bolichen97 added a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.
bolichen97 added a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
buluoray pushed a commit that referenced this pull request Nov 7, 2026
A temporary chat promises no memory reads, but a legacy member's
session-start, slim-resume and post-compaction sections still read the
agent-writable briefing into [CURRENT ASSIGNMENT]. Pass
include_briefing=not blocks_reads at those three sites, as the
private-member envelope already does for temporary turns, so the section
carries the withheld placeholder instead.

Builds on #21630.

(cherry picked from commit 9b6af7a)
@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you for this work! As noted in the thread, it continued in #31791, which has now merged. Closing this one as superseded by #31791.

@iamwhatever iamwhatever closed this Nov 8, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporary session still injects V1 member briefing ([CURRENT ASSIGNMENT])

3 participants