glas-harness/docs/channel-contract.md

41 lines
1.5 KiB
Markdown
Raw Normal View History

# Channel contract
2026-08-21 00:21:53 +02:00
A channel translates an external invocation into profile-driven gateway input;
it does not select a rein class or execute a provider itself.
```python
@dataclass
class GatewayInvocation:
2026-08-21 00:21:53 +02:00
harness_profile: str
repo: str
title: str
description: str
actor: str = "agt"
project: str = "glas-harness"
report_to_hub: bool = True
```
2026-08-21 00:21:53 +02:00
`CLIChannel` is the current implementation. The CLI requires
`--harness-profile <id[@version]>`; the old sandbox-only input is removed
because it could not identify the rein, model route, tool policy, or contract
revision. Channels may obtain a profile choice from their own approved
configuration, but must pass it explicitly and must surface resolution refusal
to their caller.
Channels pass `actor` as a governed sandbox consumer type: `adm`, `agt`, or
`atm`. A queue's concrete `worker_id` is not an actor and remains upstream
ownership metadata. For example, a worker named `rein-aharness@railiance01`
invoking ordinary governed agent work passes `actor="agt"`; it does not copy
its worker id into the actor field.
2026-08-21 00:21:53 +02:00
The channel renders the full direct `GatewayResult`. State Hub receives only
the compact `ExecutionEvidence` subset.
2026-08-21 00:21:53 +02:00
## Adding a channel
2026-08-21 00:21:53 +02:00
Implement `parse_invocation` and `render_result`, then call `run_execution`
with an `ExecutionRequest`. Carry any assignment/role/duty/goal/resource
references supplied by the upstream workforce system. Do not duplicate profile
resolution, sandbox coordination, leadership decisions, or rein construction in
the channel.