Skip to content
Back to skills

471 2026 01 26 Boundary Contracts Not Enforced 3ce89fbf

ASecurity

Boundary contracts between UI, core, and tools are partially implicit: several callbacks and tool entry points are typed as `Any` or use broad protocols, so the contract is not enforced by typing or tests. This makes boundary drift harder to detect and allows accidental coupling across layers.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 1, 2026
code-quality

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 1, 2026

npx -y skills add tools-only/X-Skills --skill 471-2026-01-26_boundary-contracts-not-enforced_3ce89fbf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 471 2026 01 26 Boundary Contracts Not Enforced 3ce89fbf?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 471 2026 01 26 Boundary Contracts Not Enforced 3ce89fbf
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-471-2026-01-26-boundary-contracts-not-enforced-3ce/badge)](https://www.skillsdirectory.com/skills/tools-only-471-2026-01-26-boundary-contracts-not-enforced-3ce)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
title: Boundary contracts are implicit across callbacks and tools
link: boundary-contracts-not-enforced
type: delta
path: src/tunacode/types/callbacks.py
depth: 0
seams: [A, M]
ontological_relations:
  - relates_to: [[architecture]]
  - affects: [[ui-core-boundary]]
  - affects: [[core-tools-boundary]]
tags:
  - architecture
  - boundaries
  - callbacks
  - protocols
created_at: 2026-01-26T03:09:30Z
updated_at: 2026-01-26T03:09:30Z
uuid: 278ae3c6-3c42-4c1c-94ff-b935c148aa21
ticket: t-69f0
---

## Summary

Boundary contracts between UI, core, and tools are partially implicit: several callbacks and tool entry points are typed as `Any` or use broad protocols, so the contract is not enforced by typing or tests. This makes boundary drift harder to detect and allows accidental coupling across layers.

## Context

Recent refactors established clean import direction and layer ordering, but contract surfaces (callbacks, tool factories, and state accessors) remain loosely typed in a few places.

## Root Cause

Contracts were defined informally via usage instead of explicit callback type aliases and minimal protocols. We missed it because there is no boundary-contract audit or type gate for these callback signatures; prevention is to encode contracts in `types/` and add a focused type/check step.

## Changes

- Pending: define explicit callback type aliases for tool results, plan approval, and streaming.
- Pending: narrow `StateManagerProtocol` into per-tool protocols (todo, plan approval, authorization).
- Pending: update tool factories and UI hooks to accept only the minimal protocols and callbacks.

## Behavioral Impact

**What users notice:**
- No immediate behavior change, but boundary leaks can manifest as subtle UI/core coupling and harder-to-debug callback misuse.

**What didn't change:**
- Runtime behavior and tool execution flow remain unchanged.

## Related Cards

- [[tool-registry-todo-alignment]]

Files in this skill

  • README.md1.2 KB
  • skill.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.