Skip to content

fix: withhold the member briefing in temporary chats - #31791

Merged
bolichen97 merged 1 commit into
mainfrom
fix/21617-temporary-briefing
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/21617-temporary-briefing

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A temporary chat with a legacy crew member never carries that member's briefing, on any path that delivers the member section.

A temporary (blank-slate) dashboard chat opened as a legacy member's DM still injected the member's agent-writable briefing.md as [CURRENT ASSIGNMENT], even though the session prefix says no memory reads, and the agent used it in replies.

Builds on #21630 by @louisss1016.

Why it matters

The temporary prefix is a promise to the user about what the model can see. Breaking it silently hands the model the member's accumulated working memory in exactly the session the user opened to keep it out.

Not a goal

  • Incognito keeps the briefing: it blocks memory writes only.
  • No change to [USER PROFILE] in temporary sessions, to the [MEMBER IDENTITY] / item 6 wording when the briefing is withheld, or to the private-member (V2) path; the issue lists those as lower priority.
  • The legacy sites do not start honouring the memory context group (memory.inject_memory); only the temporary scope changes.

What changed (motivation → approach → change)

A temporary chat with a legacy member still showed the member its own working notes. The member section builder already knows how to withhold them (include_briefing), but only the private-member path asked it to. The three legacy delivery paths (session start, slim resume, post-compaction re-injection) left it at its default.

Each of those three sites now passes include_briefing=not blocks_reads. blocks_reads is already true exactly for a temporary turn at every one of them (the slot's or the execution record's temporary mode, plus the per-session mode). At the member's desk the section then shows the existing withheld by this turn's memory/privacy scope placeholder instead of the briefing. The context-management doc says so in one paragraph.

Backwards compatibility

Compatible: only temporary turns change; persistent and incognito turns build the member section exactly as before, and the briefing file itself is untouched.

Reader: src/kiro_crew/context_assembly/session_start.py:build_session_context -- chat -- a temporary member DM gets the withheld placeholder; test_temporary_session_withholds_the_briefing[fresh]
Reader: src/kiro_crew/context_assembly/turn_message.py:build_message -- chat -- slim resume and post-compaction re-injection, same; test_temporary_session_withholds_the_briefing[slim_resume], [post_compaction]

Tests

test/test_member_prompt.py::TestMemberSectionInjection::test_temporary_session_withholds_the_briefing, parametrized over the three legacy paths: a member with a non-empty briefing in a temporary (blocks_reads=True) turn gets the withheld placeholder and not the briefing body. Red on all three on the parent.

Proof: PROVEN test/test_member_prompt.py::TestMemberSectionInjection::test_temporary_session_withholds_the_briefing[fresh], test/test_member_prompt.py::TestMemberSectionInjection::test_temporary_session_withholds_the_briefing[slim_resume], test/test_member_prompt.py::TestMemberSectionInjection::test_temporary_session_withholds_the_briefing[post_compaction] (head 4bb8582)

Determinism: 20/20 runs at -n0; 10/10 at -n 4 --dist loadgroup --max-worker-restart=2 with test_member_turn_context.py and test_member_essential_context.py as co-tenants; the whole file in shuffled order (seed 25429, 82 passed).

Manual verification

N/A — unit coverage sufficient: the change is pure context assembly, and the test drives the same build_session_context / build_message entry points the dashboard calls with blocks_reads=slot.blocks_reads.

Screenshots / video

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

Related Issues

Closes #21617

Sibling sweep

Swept: git grep -n "_build_member_section(" -- src/
Sibling: src/kiro_crew/context_assembly/session_start.py:359 -- changed here
Sibling: src/kiro_crew/context_assembly/turn_message.py:435 -- changed here
Sibling: src/kiro_crew/context_assembly/turn_message.py:607 -- changed here
Sibling: src/kiro_crew/context_assembly/member.py:650 -- not affected -- the private-member path already passes include_briefing=reads, which is false on a temporary turn

Pattern harvest

Rule candidate: review-prompt
Pattern: a gating keyword with a permissive default (include_briefing=True) is passed at one call site and left at its default at sibling call sites

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.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 20:40
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 20:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 20:43
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 629265e214b37998efa2a09d9201dad48ecde84d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 629265e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 629265e214b37998efa2a09d9201dad48ecde84d false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 629265e214b37998efa2a09d9201dad48ecde84d 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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/21617-temporary-briefing branch from 4bb8582 to 8fd113a Compare November 7, 2026 00:59
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/context-management.md, src/kiro_crew/context_assembly/turn_message.py since this head went green (39717a0 -> f71f5dd); CI re-running.

The previous head's two shard-7 reds were not this change: test_only_the_allowed_workflows_use_pull_request_target is fixed on the new base, and test_the_scan_is_linear_not_quadratic is a timing flake (0.598s against a 0.5s bound) in a file this PR does not touch.

[operator: bolichen97]

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 629265e214b37998efa2a09d9201dad48ecde84d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: each legacy site now passes include_briefing=not blocks_reads, the same signal that already skips memory and lessons at those sites. It reuses the gate the private-member path already uses instead of adding a new one.

[DESIGN-REVIEWED] 629265e

Description read

[DESCRIPTION-READ] 54e7e07109e1042991c7b6b71313de48ebe41ee61b67c91117f574db69f9dc15

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 Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 629265e214b37998efa2a09d9201dad48ecde84d — 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

This is a mechanism-level fix. It covers every caller of the member-section builder, and it uses the existing include_briefing withhold instead of adding a new one.

What this change ships

Inventory (4 items) — 4 justified

Intent: in a temporary chat with a legacy crew member, the user wants the model never to see that member's agent-writable briefing. FIX (closes #21617; the new test fails on the parent on all three paths).

  1. A temporary member DM at session start shows the withheld placeholder instead of the briefing — justified
  2. Slim resume of a temporary member DM shows the withheld placeholder instead of the briefing — justified
  3. Re-injection after compaction in a temporary member DM shows the withheld placeholder instead of the briefing — justified
  4. A context-management doc paragraph stating that temporary turns withhold the briefing (layer 4) and incognito turns do not — justified

Sibling count: grepped _build_member_section\( under src/ and found 4 callers. This PR changes 3 of them. The fourth, member.py:650, is the private-member path, which already passes include_briefing=reads. That leaves 0 unfixed siblings.

[FIRST-PRINCIPLES-REVIEWED] 629265e

Description read

[DESCRIPTION-READ] 90522a8b40027ca763c70535dfc30f97978aabbe51dd9e928dbbe4e53c2e9f8b

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 Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 629265e214b37998efa2a09d9201dad48ecde84d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 629265e

Verdict parsed from the review's SHA-scoped output markers for commit 629265e214b37998efa2a09d9201dad48ecde84d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 629265e214b37998efa2a09d9201dad48ecde84d false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/21617-temporary-briefing branch from 8fd113a to d3e6302 Compare November 7, 2026 04:53
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, docs/architecture/resource-protection.md, src/kiro_crew/context_assembly/replay.py, src/kiro_crew/telegram/client.py, test/test_lesson_startup_embedding.py since this head went green (f71f5dd -> e4611c5); CI re-running.

The previous head's three reds (Dependency License Gate, Sensitive Change Review, Publish readiness signal) were the CI token's API rate limit, not this change. The diff is unchanged by the rebase.

[operator: bolichen97]

@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 Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/21617-temporary-briefing branch from d3e6302 to 86d6612 Compare November 7, 2026 07:52
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, docs/architecture/resource-protection.md, docs/architecture/security-deep-dive.md, scripts/crewmate_prompt_preview.py, src/kiro_crew/context_assembly/output_contract.py, test/test_crewmate_prompts.py, test/test_mate_conductor_parity.py, test/test_member_briefing_file_tools.py, test/test_memory_v1_golden.py since this head went green (e4611c5 -> 5f7f8d1); CI re-running.

The previous head's nine reds (Dependency License Gate, Sensitive Change Review, Publish readiness signal, PR Readiness and the five AI review lanes) were the CI token's API rate limit, not this change; every test job on that head passed. The diff is unchanged by the rebase.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The test red on this head is main's, not this PR's. test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget fails on Backend Tests shard 2 (Linux and Windows) because src/kiro_crew/security/ is 34855 lines on origin/main (0795ebc) against a budget of 34845, and this PR touches no file in that package. #32183 raises the budget; this PR waits for it to merge before re-running. The other reds on this head (dependency review, sensitive-change, readiness and the review lanes) failed reading the API when the shared CI token hit GitHub's rate limit, not on a finding.

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
bolichen97 force-pushed the fix/21617-temporary-briefing branch from 86d6612 to 629265e Compare November 7, 2026 12:36
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main (5f7f8d1 -> bab2387) to pick up main's fix for the security package line budget. The Backend Tests shard 2 red on the previous head (test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget, Linux and Windows) was main's, and a rerun would have reused the old merge ref, so it could not go green without a new base. This is not a freshness re-sync: main moved in none of this PR's files since 5f7f8d1, and the commit's patch is unchanged. The other reds on the previous head were CI API rate limits. CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: a temporary chat withholds the member briefing on every legacy delivery path (#21617). Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/architecture/context-management.md.

@bolichen97
bolichen97 merged commit 9b6af7a into main Nov 7, 2026
98 of 99 checks passed
@bolichen97
bolichen97 deleted the fix/21617-temporary-briefing branch November 7, 2026 14:07
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants