feat(training-agent): add /si tenant for Sponsored Intelligence lifecycle (#3940)#3952
feat(training-agent): add /si tenant for Sponsored Intelligence lifecycle (#3940)#3952bokelley wants to merge 3 commits into
Conversation
…ycle (#3940) Adds a new `si` training-agent tenant at `/si/mcp` serving the full SI session lifecycle (si_get_offering, si_initiate_session, si_send_message, si_terminate_session). Fixes the S5 capstone and C3 exercises that returned `Unknown tool: si_initiate_session` due to no tenant serving si_* tools. Stub handlers simulate the BRAND-AGENT side of the protocol so a learner can practice as the HOST. Nova Brands training fixture. In-memory session state (same pattern as other training-agent state). Also bundles education-expert findings from issue review: - Migration 465: backfills tenant_ids for A3, C3, S5; fixes C3 c3_ex2 phantom tool (connect_to_si_agent → si_initiate_session); appends stable criterion IDs to S5 s3_ex1 for recertification. - Updates tool-catalog drift test to include si tenant. Storyboard floors in .github/workflows/training-agent-storyboards.yml left for human follow-up (agent infra, off-limits per policy). https://claude.ai/code/session_01SAU73ibxYgk3pdvmMJNjcF
…ation 465 - Add si_get_offering and si_terminate_session to S5 s5_ex1 sandbox_actions before the _append_criterion calls — ASTM E3416-24 requires all criterion referenced behaviors to be prompted actions in the assessment. - Clarify S5 tenant_ids comment: explains why brand was excluded. - Improve C3 c3_ex2 guidance text to connect response inspection to the pedagogical point (SI personalization vs impression-based formats). https://claude.ai/code/session_01SAU73ibxYgk3pdvmMJNjcF
- tenant-smoke.test.ts: add 'si' to expected agent IDs list - si_terminate_session: add required `terminated: true` field per schema - si_get_offering: restructure response to schema shape (offering object, matching_products array with name/product_id, offering_token at top level) - si_send_message: return SESSION_TERMINATED (not SESSION_NOT_FOUND) after terminate by marking sessions terminated rather than deleting from map - registry.ts: update module comment from "Six" to "Seven" tenants - makeSessionId: use crypto.randomUUID() instead of Date.now()+Math.random() https://claude.ai/code/session_01SAU73ibxYgk3pdvmMJNjcF
|
Holding for rebase. The Hard conflict:
Soft conflicts (likely):
Failing CI: Recommended path: re-trigger via |
Summary
Fixes #3940. Adds the
/sitraining-agent tenant so learners can practice the full Sponsored Intelligence session lifecycle against a deterministic training brand (Nova Brands).tenants/si.ts+v6-si-platform.ts): registers all four SI tools via thecustomToolsmerge seam (same pattern asupdate_rights/creative_approvalin the brand tenant — SDKDecisioningPlatformhas no SI interface field yet)tenants/tool-catalog.ts): addssi_get_offering,si_initiate_session,si_send_message,si_terminate_sessionunder['si']tenants/registry.ts): registers the SI tenant alongside the existing six; updates module comment from "Six" to "Seven"db/migrations/465_si_tenant_module_pins.sql): pinstenant_idsfor A3, C3, and S5 (left NULL in migration 464 pending this tenant); fixes phantom toolconnect_to_si_agent→si_initiate_sessionin C3'sc3_ex2; appends missingsi_get_offering/si_terminate_sessionsandbox actions to S5'ss5_ex1; stamps stable criterion IDss5_ex1_sc_session_lifecycleands5_ex1_sc_offering_integrationvia_append_criteriontests/integration/training-agent-tool-catalog-drift.test.ts): adds'si'toTENANT_IDStenants/tenant-smoke.test.ts): adds'si'to expected agent IDsImplementation notes
si_get_offeringresponse matches the JSON schema shape:{ available, offering_token, offering: { offering_id, title, summary }, matching_products: [...] }si_terminate_sessionmarks sessions asterminated: truein-map (does not delete) so a subsequentsi_send_messagereturnsSESSION_TERMINATEDrather than the misleadingSESSION_NOT_FOUNDsi_terminate_sessionresponse includes the requiredterminated: truefield persi-terminate-session-response.jsonschemacrypto.randomUUID()for sufficient entropyHuman task required
.github/workflows/training-agent-storyboards.ymlstoryboard floor assertions are not updated by this PR — agent policy prohibits editing.github/**. A human should add SI storyboard floors once the tenant is exercised in CI.Test plan
pnpm test --filter server -- training-agent-tool-catalog-drift— drift detection passes for all 7 tenantspnpm test --filter server -- tenant-smoke— smoke test passes withsiin the agent listtools/liston/si/mcpand verify four SI tools appearsi_get_offering→si_initiate_session(passingoffering_token) →si_send_message→si_terminate_session; verifyterminated: truein responsesi_send_messageafter terminate returnsSESSION_TERMINATEDerror codetenant_idsare populatedc3_ex2no longer referencesconnect_to_si_agents5_ex1sandbox_actions includes all four SI toolshttps://claude.ai/code/session_01SAU73ibxYgk3pdvmMJNjcF
Generated by Claude Code