Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cascadeflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,22 @@
get_tool_risk_routing,
)

# NEW: Harness API scaffold (V2 core branch)
# NOTE: harness.agent is NOT re-exported here — it would shadow the
# cascadeflow.agent *module* and break dotted-path resolution
# (e.g. patch("cascadeflow.agent.PROVIDER_REGISTRY")).
# Use ``from cascadeflow.harness import agent`` instead.
from .harness import (
HarnessConfig,
HarnessInitReport,
HarnessRunContext,
init,
reset,
run,
get_harness_config,
get_current_run,
)

# ==================== MAIN AGENT & RESULT ====================


Expand Down Expand Up @@ -381,6 +397,15 @@
"ToolRiskClassification", # NEW: v0.8.0 - Classification result
"ToolRiskClassifier", # NEW: v0.8.0 - Tool risk classifier
"get_tool_risk_routing", # NEW: v0.8.0 - Routing by risk level
# ===== HARNESS API (V2 scaffold) =====
"HarnessConfig",
"HarnessInitReport",
"HarnessRunContext",
"init",
"reset",
"run",
"get_harness_config",
"get_current_run",
# ===== PROVIDERS =====
"ModelResponse",
"BaseProvider",
Expand Down
34 changes: 34 additions & 0 deletions cascadeflow/harness/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Core harness API scaffold for V2 planning work.

This module provides a minimal, backward-compatible surface:
- init(): global harness settings (opt-in)
- run(): scoped run context for budget/trace accounting
- agent(): decorator for attaching policy metadata

The implementation intentionally avoids modifying existing CascadeAgent behavior.
"""

from .api import (
HarnessConfig,
HarnessInitReport,
HarnessRunContext,
agent,
get_current_run,
get_harness_config,
init,
reset,
run,
)

__all__ = [
"HarnessConfig",
"HarnessInitReport",
"HarnessRunContext",
"init",
"run",
"agent",
"get_current_run",
"get_harness_config",
"reset",
]
Loading
Loading