Include server.ts in CI typecheck; drop unused AgentContext fields - #3
Conversation
server.ts built AgentContext objects with sentiment, sentimentScore, entities, category, and urgency — none of which are declared on AgentContext or ever read by SmartAgent (agent-core.ts only touches complaintId, rawText, userName, and previousComments). Rather than widen the interface with fields nothing consumes, drop them from the two call sites in server.ts. Also add server.ts to tsconfig's include so CI's tsc --noEmit actually covers the Express entrypoint, and widen rootDir to "." since server.ts lives outside src/ (rootDir only affects emit layout; nothing in the build/Docker path reads dist/, so this is safe).
|
AI Evaluation & Safety Engineer — review verdict: GO Verified independently by cloning the PR branch and running
Dropping the 5 unused fields rather than widening Non-blocking note for a future ticket (not this one): Note: could not submit a formal GitHub "Approve" review — GitHub blocks self-approval since this PR and my review token share the same account ( |
Context
WID-214:
tsconfig.jsononly includessrc/**/*, soserver.ts(the Express entrypoint, ~1400 lines) was excluded fromtsc --noEmit. Running the compiler against it directly surfaced 2 pre-existing errors —server.tsbuildsAgentContextobjects withsentiment,sentimentScore,entities,category, andurgency, none of which exist on theAgentContextinterface.Resolution
Checked whether
SmartAgent(src/agent/agent-core.ts) actually reads any of those fields offcontext— it doesn't.processComplaint/makeDecisiononly touchcomplaintId,rawText,userName, andpreviousComments. So rather than widenAgentContextwith fields nothing consumes, this drops the 5 extra properties from the twoAgentContextliterals inserver.ts(/api/agent/processand/api/agent/process-all-new). The underlying sentiment/category/urgency data is untouched — it's still read directly offnodeDetailseverywhere else inserver.ts(breakdowns, CSV export, filters, etc.); it just isn't threaded through the agent's decision context, since the agent doesn't use it today.Also:
server.tstotsconfig.json'sincludeso CI'stsc --noEmitactually covers the app entrypoint.rootDirfrom./srcto.sinceserver.tslives outsidesrc/(TS6059 otherwise).rootDironly affects the emitteddist/output layout — nothing in the Dockerfile or npm scripts readsdist/(runtime usestsx server.tsdirectly), so this is safe.Test plan
npm test(=tsc --noEmit) passes clean withserver.tsincludedcontext.sentiment/.entities/.category/.urgencyoffAgentContextdist/isn't referenced by Dockerfile or package.json scripts🤖 Generated with Claude Code