Repository navigation
fix: withhold member briefing under temporary scope on all V1 paths - #21630
louisss1016 wants to merge 1 commit into
Conversation
255e7c0 to
0bf6be9
Compare
|
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. |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of 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
[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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix works at cause level: it removes the Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: a temporary (blank-slate) chat with a V1 member never gets that member's working-memory briefing — FIX.
[FIRST-PRINCIPLES-REVIEWED] 46687e1 Description read[DESCRIPTION-READ] 42f874580ba98c5d79609a54dbd3be8103005b16d15953421578020c90037527 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
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. |
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.
0bf6be9 to
46687e1
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
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)
|
[operator: bolichen97] Continuing this in #31791; thanks for the start. |
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.
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.
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.
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.
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.
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)
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_briefingat its defaultTrue, so the member's agent-writablebriefing.mdwas 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
[USER PROFILE](onboarding answers) injection in temporary sessions — that is a separate decision the issue defers.[MEMBER IDENTITY]variant for withheld desks — the issue lists it as lower priority.What changed (motivation → approach → change)
Observed symptom: a temporary dashboard chat with a V1 member carried
[CURRENT ASSIGNMENT]frombriefing.mddespite the no-memory-reads prefix. Root cause:_build_member_sectiongates the briefing withinclude_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 insession_start.pyandturn_message.pypassed onlydesk_withheldand letinclude_briefingdefault toTrue.blocks_readsalready foldsmemory_mode == "temporary"in viaresolve_turn_owner(plus the per-session mode inbuild_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 asinclude_briefingat all three V1 sites (config-scoped groups, the way every other memory block scopes them), withbuild_v2_essentialsnow reading the same predicate. One formula, four call sites.ContextBuilder._build_member_sectionnow takesinclude_briefingwith 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-levelbuild_member_sectionhelper 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 scopeplaceholder, 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 excludememory(memory.inject_memoryoff, or a spawn withinclude_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 amemory_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 ittest_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 tableEach 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)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.