fix(pipeline): scope memory decision candidates - #324
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughDecision processing now bounds candidate counts and content, scopes search and hydration to the job’s tenant, agent, and project, validates job scope consistency, and rejects model mutations targeting candidates outside the authorized set. ChangesDecision candidate safety
Sequence Diagram(s)sequenceDiagram
participant DecisionJob
participant ScopeGuard
participant CandidateSearch
participant CandidateHydration
participant DecisionModel
participant ProposalGuard
DecisionJob->>ScopeGuard: Validate org and workspace scope
ScopeGuard->>CandidateSearch: Search scoped candidates
CandidateSearch->>CandidateHydration: Hydrate bounded candidate ids
CandidateHydration-->>DecisionModel: Provide scoped candidate JSON
DecisionModel->>ProposalGuard: Return update or delete target
ProposalGuard-->>DecisionJob: Accept authorized target or downgrade to none
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const inList = ids.map((id) => sLiteral(id)).join(", "); | ||
| return `SELECT ${idCol} AS id, ${contentCol} AS content FROM "${tbl}" WHERE ${idCol} IN (${inList})`; | ||
| const projectClause = buildProjectScopeConjunct({ projectId: jobScope.projectId ?? "" }); | ||
| return `SELECT ${idCol} AS id, ${contentCol} AS content FROM "${tbl}" WHERE ${idCol} IN (${inList}) AND ${agentCol} = ${sLiteral(agentId)}${projectClause}`; |
There was a problem hiding this comment.
Potential SQL injection via string-based query concatenation - high severity
SQL injection might be possible in these locations, especially if the strings being concatenated are controlled via user input.
| return `SELECT ${idCol} AS id, ${contentCol} AS content FROM "${tbl}" WHERE ${idCol} IN (${inList}) AND ${agentCol} = ${sLiteral(agentId)}${projectClause}`; | |
| return `SELECT ${idCol} AS id, ${contentCol} AS content FROM ${tbl} WHERE ${idCol} IN (${inList}) AND ${agentCol} = ${sLiteral(agentId)}${projectClause}`; |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
|
Live canary evidence for reviewed commit
Current CI failures are not in the changed decision test: focused decision tests are 20/20 green. The shared |
Summary
Verification
Known clean-main baseline exceptions
Local macOS
npm run cireports 4 failures with 5,212 passes and 11 skips. All four reproduce unchanged on detached cleanmainand are unrelated to this three-file delta:tests/cli/entry-guard.test.ts:76tests/daemon/runtime/logs/log-store.test.ts:74tests/daemon/runtime/projects/onboarding-api.test.ts:94tests/daemon/runtime/projects/onboarding-api.test.ts:105Summary by CodeRabbit