docs: teach the graph generator the CHAINED fused-dispatch spelling

ds-review-bot round-3 finding: agentEvents(ctx, agent).emit(...) has a
call-expression receiver the generator's identifier check missed, silently
dropping agent-loop as agent/session-start's producer. The generator now
recognizes a call receiver whose callee is agentEvents; graph regenerated
with the producer edge restored.
This commit is contained in:
Tianyi Cui
2026-07-09 06:06:17 +08:00
parent e5093244fb
commit 8819c71b81
2 changed files with 6 additions and 1 deletions

View File

@@ -519,6 +519,11 @@ function collectEventRelations(): Map<string, EventRelation> {
}
function isCordisContextReceiver(expr: ts.PropertyAccessExpression, sf: ts.SourceFile): boolean {
// The chained fused-dispatch spelling: `agentEvents(ctx, agent).emit(…)` —
// the receiver is a call expression, not an identifier.
if (ts.isCallExpression(expr.expression) && expr.expression.expression.getText(sf) === 'agentEvents') {
return true
}
const target = expr.expression.getText(sf)
if (target === 'ctx' || target === 'this.ctx') return true
// Scoped-dispatch spellings (the agent-scoping seam): the loop's fused