Skip to content

refactor: route brand protocol tools through training agent#1618

Merged
bokelley merged 1 commit into
mainfrom
bokelley/brand-sandbox-to-adcp
Mar 22, 2026
Merged

refactor: route brand protocol tools through training agent#1618
bokelley merged 1 commit into
mainfrom
bokelley/brand-sandbox-to-adcp

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Brand sandbox tools (sandbox_get_brand_identity, sandbox_get_rights, sandbox_acquire_rights, sandbox_update_rights) were custom Addie tools with a bespoke interface that didn't match the AdCP protocol surface
  • Refactors them into standard AdCP tools (get_brand_identity, get_rights, acquire_rights, update_rights) that route through the training agent via agent_url, matching the pattern used by media buy, creative, signals, and governance tools
  • Learners now use the same tools they'll use in production, just pointed at a sandbox agent — one tool surface, two backends

Changes

  • New: server/src/training-agent/brand-handlers.ts — seed data + handlers (ported from deleted file)
  • New: server/src/db/migrations/313_c2_brand_tools_rename.sql — renames tool refs in C2 exercises
  • Modified: adcp-tools.ts — adds ADCP_BRAND_PROTOCOL_TOOLS with agent_url routing
  • Modified: task-handlers.ts — wires brand handlers into training agent dispatch
  • Modified: tool-sets.ts — updates certification + adcp_operations sets
  • Deleted: brand-sandbox-tools.ts + all references in bolt-app.ts, register-baseline-tools.ts
  • Bonus: fixes in-process shortcut hostname check (security review finding)

Test plan

  • 36 brand handler tests pass (Jest)
  • 179 training agent unit tests pass (vitest)
  • Full suite: 499 tests pass
  • Typecheck clean
  • Code review: all Must Fix and Should Fix items addressed
  • Security review: all findings addressed

🤖 Generated with Claude Code

Brand sandbox tools (sandbox_get_brand_identity, sandbox_get_rights,
sandbox_acquire_rights, sandbox_update_rights) were custom Addie tools
with a bespoke interface. This refactors them into standard AdCP tools
(get_brand_identity, get_rights, acquire_rights, update_rights) that
route through the training agent, matching the pattern used by media
buy, creative, signals, and governance tools.

- Move seed data and handlers to training-agent/brand-handlers.ts
- Add ADCP_BRAND_PROTOCOL_TOOLS to adcp-tools.ts with agent_url routing
- Wire brand handlers into training agent HANDLER_MAP and TOOLS
- Update tool-sets.ts (certification + adcp_operations)
- Migration to rename tool references in C2 exercise definitions
- Fix in-process shortcut hostname check (security review finding)
- Delete brand-sandbox-tools.ts and all references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit f0bac4a into main Mar 22, 2026
10 checks passed
@bokelley bokelley deleted the bokelley/brand-sandbox-to-adcp branch March 22, 2026 02:55
bokelley added a commit that referenced this pull request Mar 22, 2026
Resolve merge conflicts in task-handlers.ts:
- Incorporate proposal-based creation from main (#1618)
- Add proposal completion logic to handleGetProducts
- Fix type compatibility (Product vs Partial<Product>)
- Fix SpecialCategory type derivation for @adcp/client compat

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant