Victor Contracts - Protocol definitions for vertical development
Project description
Victor Contracts
Protocol and type definitions for building Victor verticals without pulling in the Victor runtime.
Overview
Use the contracts package when you want to author or publish a vertical package.
Use victor-ai when you want to run a vertical inside the Victor host runtime.
The supported external authoring model is contract-first:
- vertical packages depend on
victor-contracts - verticals declare tools, capabilities, prompts, teams, and workflow metadata through the contracts package
victor-airemains responsible for runtime concerns such as agent creation, capability injection, and tool execution
Installation
Contract-only authoring
pip install victor-contracts
Runtime usage
pip install victor-ai
Stable Contract Surface
The core authoring surface is available from the top-level package:
from victor_contracts import (
CURRENT_DEFINITION_VERSION,
CapabilityIds,
CapabilityRequirement,
ToolNames,
ToolRequirement,
VerticalBase,
VerticalDefinition,
)
Key pieces:
VerticalBase: contract base class for external verticalsToolNames: canonical contract-owned tool identifiersCapabilityIds: canonical contract-owned runtime capability identifiersToolRequirement/CapabilityRequirement: typed requirement declarationsVerticalDefinition: validated serializable manifest returned byget_definition()
Quick Start
from victor_contracts import (
CapabilityIds,
CapabilityRequirement,
ToolNames,
ToolRequirement,
VerticalBase,
)
class SecurityVertical(VerticalBase):
name = "security"
description = "Security analysis and audit workflows"
version = "1.0.0"
@classmethod
def get_name(cls) -> str:
return cls.name
@classmethod
def get_description(cls) -> str:
return cls.description
@classmethod
def get_tool_requirements(cls) -> list[ToolRequirement]:
return [
ToolRequirement(ToolNames.READ, purpose="inspect code and configs"),
ToolRequirement(ToolNames.GREP, purpose="search for vulnerable patterns"),
ToolRequirement(ToolNames.SHELL, required=False, purpose="run scanners"),
ToolRequirement(ToolNames.WEB_SEARCH, required=False, purpose="look up CVEs"),
]
@classmethod
def get_capability_requirements(cls) -> list[CapabilityRequirement]:
return [
CapabilityRequirement(
capability_id=CapabilityIds.FILE_OPS,
purpose="read repository contents",
),
CapabilityRequirement(
capability_id=CapabilityIds.WEB_ACCESS,
optional=True,
purpose="fetch external security references",
),
]
@classmethod
def get_system_prompt(cls) -> str:
return "You are a security-focused assistant."
@classmethod
def get_prompt_templates(cls) -> dict[str, str]:
return {
"audit": "Audit the target for security issues and explain severity."
}
@classmethod
def get_task_type_hints(cls) -> dict[str, dict[str, object]]:
return {
"audit": {
"hint": "Start with read-first reconnaissance, then validate findings.",
"tool_budget": 12,
"priority_tools": [ToolNames.READ, ToolNames.GREP, ToolNames.SHELL],
}
}
@classmethod
def get_team_declarations(cls) -> dict[str, dict[str, object]]:
return {
"security_review_team": {
"name": "Security Review Team",
"formation": "pipeline",
"members": [
{
"role": "researcher",
"goal": "Inspect the target and identify likely risks.",
},
{
"role": "reviewer",
"goal": "Validate findings before escalation.",
},
],
}
}
definition = SecurityVertical.get_definition()
assert definition.definition_version == "1.0"
assert definition.tools == [ToolNames.READ, ToolNames.GREP, ToolNames.SHELL, ToolNames.WEB_SEARCH]
assert definition.team_metadata.teams[0].team_id == "security_review_team"
Definition Contract
VerticalBase.get_definition() is the preferred contract API. It returns a
validated VerticalDefinition manifest that contains:
definition_version- canonical tool identifiers
- typed tool and capability requirements
- system prompt text
- prompt metadata and task-type hints
- team metadata such as declarative team layouts and the default team identifier
- declarative stage definitions
- workflow metadata such as initial stage, provider hints, and evaluation criteria
Compatibility note:
get_config()still exists as a bridge for current victor-ai integrationsVerticalDefinition.to_config()/from_config()bridge the legacy config shapeVerticalDefinition.from_dict()supports serialized manifest round-tripping
Packaging
Register the vertical via the standard Victor entry point:
[project]
name = "victor-security"
version = "1.0.0"
dependencies = ["victor-contracts>=1.0.0"]
[project.entry-points."victor.plugins"]
security = "victor_security:plugin"
Discovery
Victor discovers external vertical packages through victor.plugins entry
points, then each plugin registers one or more contract vertical definitions:
from victor_contracts.discovery import get_global_registry
registry = get_global_registry()
verticals = registry.get_verticals()
Guides And Examples
- Vertical Development Guide
- Migration Guide
- Minimal contract-only example
- Repository external package example
Testing
pip install -e ".[dev]"
pytest victor-contracts/tests -q
To verify compatibility with the runtime as well:
pip install -e ".[dev]" victor-ai
pytest victor-contracts/tests/unit tests/integration/test_contracts_integration.py -q
Versioning
The package follows semantic versioning, and the manifest contract is versioned
separately via VerticalDefinition.definition_version. External verticals
should treat the contracts package as the source of truth for supported identifiers
and manifest fields.
Links
- Repository: https://github.com/vjsingh1984/victor
- Issues: https://github.com/vjsingh1984/victor/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file victor_contracts-0.7.2.tar.gz.
File metadata
- Download URL: victor_contracts-0.7.2.tar.gz
- Upload date:
- Size: 123.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa669951b755fd5b55291fa5daab8d33b11bb5fdbda201b0a1557454c1144af5
|
|
| MD5 |
920f8b66ab12f7aa1c85abee1d4c4911
|
|
| BLAKE2b-256 |
6ba57e4a7aa06b969ed627d9c4bf3ce5adc8895a44cffdec1c33a8ad0f3c2f74
|
Provenance
The following attestation bundles were made for victor_contracts-0.7.2.tar.gz:
Publisher:
release-contracts.yml on vjsingh1984/victor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
victor_contracts-0.7.2.tar.gz -
Subject digest:
fa669951b755fd5b55291fa5daab8d33b11bb5fdbda201b0a1557454c1144af5 - Sigstore transparency entry: 2073730012
- Sigstore integration time:
-
Permalink:
vjsingh1984/victor@57e854828f1e9910341f00daf5f1011dbb895a91 -
Branch / Tag:
refs/tags/sdk-v0.7.2 - Owner: https://github.com/vjsingh1984
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-contracts.yml@57e854828f1e9910341f00daf5f1011dbb895a91 -
Trigger Event:
push
-
Statement type:
File details
Details for the file victor_contracts-0.7.2-py3-none-any.whl.
File metadata
- Download URL: victor_contracts-0.7.2-py3-none-any.whl
- Upload date:
- Size: 165.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19ea1df4c340758bf151f63f0912fa387570ea69e483b2743b1807c229a935e1
|
|
| MD5 |
798702161c1e6790dbea737f00123782
|
|
| BLAKE2b-256 |
794faae508591a7764771eb960679de9285a9ea7b07ce7819d830b928a00ceb3
|
Provenance
The following attestation bundles were made for victor_contracts-0.7.2-py3-none-any.whl:
Publisher:
release-contracts.yml on vjsingh1984/victor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
victor_contracts-0.7.2-py3-none-any.whl -
Subject digest:
19ea1df4c340758bf151f63f0912fa387570ea69e483b2743b1807c229a935e1 - Sigstore transparency entry: 2073730127
- Sigstore integration time:
-
Permalink:
vjsingh1984/victor@57e854828f1e9910341f00daf5f1011dbb895a91 -
Branch / Tag:
refs/tags/sdk-v0.7.2 - Owner: https://github.com/vjsingh1984
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-contracts.yml@57e854828f1e9910341f00daf5f1011dbb895a91 -
Trigger Event:
push
-
Statement type: