OSAC-1422: Separate session files from repo config to prevent .ai-bot.preserve/ leakage#30
OSAC-1422: Separate session files from repo config to prevent .ai-bot.preserve/ leakage#30adalton wants to merge 1 commit into
Conversation
….preserve/ leakage The .ai-bot/ directory served dual purposes: repo-owned config files and ephemeral session files. The AI provider confused the two, copying config files to .ai-bot.preserve/ which leaked into PRs because the commit exclusion only matched the exact .ai-bot/ prefix. Two fixes: - Move session files (task.md, issue.md, pr.md, etc.) to .ai-session/, keeping .ai-bot/ purely for repo-owned config - Change commit exclusion to prefix-match .ai-bot and .ai-session (no trailing slash), catching .ai-bot.preserve/ and any other variant Assisted-by: Claude claude-opus-4-6 (1M) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (18)
WalkthroughAll ephemeral AI session artifact paths are renamed from ChangesSession directory rename: .ai-bot → .ai-session
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
.ai-bot/to.ai-session/, keeping.ai-bot/purely for repo-owned config.ai-botand.ai-session(no trailing slash), catching.ai-bot.preserve/,.ai-session.preserve/, and any other variantProblem
The
.ai-bot/directory served dual purposes: repo-owned config files (config.yaml, instructions.md, workflows, container.json) and ephemeral session files (task.md, issue.md, pr.md, session-output.json, etc.). The AI provider running inside the container saw both types mixed together and copied config files to.ai-bot.preserve/, which leaked into PRs because the commit exclusion only matched the exact.ai-bot/prefix.Live examples: fulfillment-service PR #676, osac-installer PR #270
After this change
Breaking change
Workflow files in target repos (
.ai-bot/new-ticket-workflow.md,.ai-bot/feedback-workflow.md) and profile config overrides that reference.ai-bot/task.md,.ai-bot/pr.md, etc. must be updated to.ai-session/. The imported ai-workflows repo is unaffected (uses.artifacts/internally).Test plan
go test -race ./...— all tests passmake lint— no new issues (3 pre-existing gosec false positives).ai-bot/session-file references remain in production code.ai-bot.preserve/,.ai-bot-extra/,.ai-session.preserve/Resolves OSAC-1422
Assisted-by: Claude noreply@anthropic.com
Packages Affected
Core packages:
IssueFilePath,TaskFilePath,PRDescriptionPath,AttachmentsDirPath,SessionContextPath,CommentResponsesPath) to reference.ai-session/instead of.ai-bot/executor.go,pipeline.go,script.go,session.go) to use.ai-session/directory; includes test updates.ai-botand.ai-sessionprefixes (catching variants like.ai-bot.preserve/)No changes to: scanner/, container/, workspace/, jobmanager/, tracker/, projectresolver/, repoconfig/, commentfilter/, recovery/, costtracker/, models/
Execution Pipeline Impact
All three major workflows affected:
.ai-bot/task.mdto.ai-session/task.md.ai-session/pr.mdinstead of.ai-bot/pr.md.ai-session/comment-responses.json; session context in.ai-session/session-context.mdJira attachments are now downloaded to
.ai-session/attachments/directory.Configuration and Deployment
Configuration updates:
config.example.yaml- Updated workflow instructions to reference.ai-session/pathsservices/github.go- ModifiedbuiltinExcludesto exclude both.ai-botand.ai-sessionusing prefix matching (without trailing slash) to catch directory variants and prevent accidental commits of temporary filesDocumentation updates:
.ai-session/pathsAGENTS.md- Updated to read PR descriptions from new locationBreaking Changes
Existing workflows in target repositories that reference
.ai-bot/task.md,.ai-bot/pr.md, and similar session file paths must be updated to use.ai-session/equivalents.