Repository navigation
Attribute case note edits and redactions to the current AI actor - #454
Conversation
LimaCharlie Cloud Security — code scanNo new code findings were introduced by this pull request. This check reports and never fails: no Scanned This comment is updated in place on every push to this pull request. |
|
/lc-review |
There was a problem hiding this comment.
AI Code Review Summary
No high or medium priority issues found. I read all 4 changed files.
General Feedback
- Rollout risk: Any process with
LC_AI_SESSION_IDset now sends a JSON body onPOST .../redact. Before this change, redaction always sent no body. If a backend that predates actor attribution rejects or mishandles a body on this endpoint, redaction from AI sessions will fail. The PR says publishing waits for backend verification. Keep that hold until both edit and redact are confirmed on staging and production. - Test isolation: The
orgfixture now clearsLC_AI_SESSION_ID, so the existing legacy-body assertions no longer depend on the developer's environment. The tests that usealt_rootstill depend onLC_CASES_API_ROOTbeing unset. That was already true before this PR and is not a new problem. - test-time-budget: No check run was found for this commit.
masterdoes not require the check in branch protection or rulesets, so this review is not blocked on it.
Blast Radius
- Public SDK:
Cases.edit_noteandCases.redact_notegain keyword-only parameters. Existing positional calls still work. - Behavior change: When
LC_AI_SESSION_IDis set, both methods addai_session_idto the request without being asked. This includes the CLI commandscase edit-noteandcase redact-note, and any tool built on the SDK that runs inside an AI session. When no markers are present, the request is the same as before.
This review was generated automatically by Claude Code.
|
Review read on 4a9c08d. Publishing remains held until both staging and production run the final backend source supporting editor and redactor attribution. The Release Chief must verify that exact source before tagging Python; merging this PR will not publish it. The pre-existing LC_CASES_API_ROOT test-environment dependency is unchanged. Fresh independent review of the pristine final head also approved with no findings. |
Case note edits and redactions now identify the AI actor performing the action instead of inheriting the original note author's attribution. Add optional keyword-only
ai_session_idandai_clienttoCases.edit_noteandCases.redact_note. The session falls back toLC_AI_SESSION_ID, matchingadd_note;ai_clientidentifies outside AI, such as MCP. People and automation send no AI marker and are classified by the backend from caller identity.Only nonempty markers are included. Without markers, edit requests still contain only
{content}and redaction still sends a POST with no body. The CLI inherits session attribution through the SDK without new flags. Documentation explains these rules and the tests cover wire payloads, environment fallback and explicit precedence, empty values, legacy request compatibility, organization/staging routing, response preservation, and both CLI commands' session forwarding.Validation:
pytest -q tests/unit/ tests/microbenchmarks/passes. Negative controls separately reverting redaction and edit SDK support each fail eight attribution cases while their legacy request control still passes. Runtime changes and documentation corrections are batched in this additive follow-up to merged PR #453.Publishing remains held until staging and production are verified on the final backend source supporting both editor and redactor attribution and the pending-status correction. Actor-aware source 58c43d9 is the minimum redaction baseline; earlier eb2c75a is insufficient, and 58c43d9 alone does not establish the later edit correction. No release or tag is included.
StarWatch cases XO via StarForge