Skip to content

Commit 2a2ff05

Browse files
committed
almanac: add capability planning anchor
1 parent 8ad36eb commit 2a2ff05

6 files changed

Lines changed: 57 additions & 2 deletions

File tree

‎almanac/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ collections.
2727

2828
For architecture boundaries, read [Architecture](architecture).
2929

30+
For provider feature checks, read
31+
[Capability Planning](architecture/capability-planning). It explains how agent
32+
and option requirements resolve to a concrete provider surface before execution.
33+
3034
For architectural choices that should not be reversed accidentally, read
3135
[Decisions](decisions). The most important ones are
3236
[Provider Surfaces Are First-Class](decisions/provider-surfaces-first-class)

‎almanac/architecture/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ the [Yoke Harness](../concepts/yoke-harness), [Runs And Sessions](../concepts/ru
2020
[CLI And Run Storage](../reference/cli-and-run-storage) pages into one
2121
execution path.
2222

23+
Read [Capability Planning](capability-planning) when a change adds or changes
24+
features that depend on the selected provider surface. It explains how agent
25+
and option requirements become a surface plan before provider execution starts.
26+
2327
Read [Provider Surfaces](../concepts/provider-surfaces) when runtime behavior
2428
depends on the exact Claude or Codex entrypoint. That concept page is the
2529
architecture-facing map for capability planning.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "Capability Planning"
3+
summary: "Capability planning is the harness step that turns agent and option requirements into a concrete provider surface plan before execution."
4+
topics: [architecture, runtime]
5+
sources:
6+
- id: capabilities
7+
type: file
8+
path: src/yoke/capabilities.py
9+
- id: surfaces
10+
type: file
11+
path: src/yoke/surfaces.py
12+
- id: models
13+
type: file
14+
path: src/yoke/models.py
15+
- id: options
16+
type: file
17+
path: src/yoke/options.py
18+
- id: capability-tests
19+
type: file
20+
path: tests/test_capabilities.py
21+
---
22+
23+
# Capability Planning
24+
25+
Capability planning is the runtime check that decides whether a [Yoke Harness](../concepts/yoke-harness) can perform the requested work on one concrete [Provider Surface](../concepts/provider-surfaces). It gathers feature requirements from the agent and the selected options, resolves or validates the surface, and returns a `Plan` before provider execution starts [@models]. This makes provider differences explicit: a Codex or Claude provider name is not enough to promise streaming, callbacks, goals, workflows, or native collaboration behavior.
26+
27+
## Inputs To The Plan
28+
29+
The feature language lives in `Feature` and `Support`. Features name things Yoke can reason about, such as one-shot runs, sessions, streaming, structured output, models, permissions, request events, goals, interrupts, workflows, native workflows, skills, plugins, MCP, and collaboration-agent tools [@capabilities]. Support values are `native`, `compiled`, `emulated`, `unsupported`, and `unknown` [@capabilities].
30+
31+
The harness builds its required feature set from two places. Agent definitions contribute features for goals, skills, subagents, workflows, and provider options, while run, session, goal-loop, and workflow options contribute runtime requirements such as structured output, event callbacks, sessions, goals, native workflows, or provider-specific permissions [@models] [@options].
32+
33+
## Surface Selection
34+
35+
Yoke keeps a profile for each known provider surface. A profile carries the provider, surface, broad channel, runtime, capability matrix, default status, and whether this package has a runnable adapter for that surface [@capabilities] [@surfaces].
36+
37+
When a harness has an explicit surface, planning validates that surface against the required features and reports missing support instead of silently switching surfaces [@models]. When the surface is omitted, planning can select the best known surface for the required features, optional channel, and runnable constraint [@models] [@surfaces].
38+
39+
Selection ranks candidate profiles by how well they satisfy the required features and by their total capability score [@surfaces]. Tests cover the important behavior: `run_event_callbacks` selects Codex app-server or Claude Python SDK automatically, explicit unsupported Codex surfaces fail before a run starts, native Claude workflow requests can select a non-runnable TypeScript SDK profile unless `runnable=True` is required, and unsupported feature sets raise diagnostics that list considered surfaces [@capability-tests].
40+
41+
## Why It Matters
42+
43+
Planning is the guardrail between product promises and provider mechanics. [Runtime Flow](runtime-flow) explains the execution path, but capability planning is the point where Yoke decides whether that path is allowed for the selected surface.
44+
45+
This is why [Provider Surfaces Are First-Class](../decisions/provider-surfaces-first-class) matters in day-to-day changes. Adding a new option, workflow shape, event callback, permission mode, or provider-native behavior should update the feature requirement and capability matrix together, then add tests that prove the harness selects, validates, or rejects the intended surfaces [@options] [@surfaces] [@capability-tests].

‎almanac/architecture/runtime-flow.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ features, then calls the adapter's `run(...)` method [@models] [@ports]. The
4141
adapter owns the provider protocol from that point: Claude SDK messages, Codex
4242
app-server notifications, Codex SDK events, and Codex CLI JSONL output all enter
4343
Yoke through adapter code rather than through product services [@ports].
44+
The surface selection and rejection rules for those feature checks are detailed
45+
in [Capability Planning](capability-planning).
4446

4547
Streaming follows the same boundary. `Harness.stream(...)` creates or resumes a
4648
session, asks the adapter to stream one turn, and yields normalized events

‎almanac/concepts/provider-surfaces.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When no explicit surface is set, `profile_for` uses provider defaults, and `sele
4141

4242
Capabilities are expressed as features with support levels. The `Feature` enum includes one-shot runs, sessions, streaming, structured output, model listing, login, permissions, request events, subagents, skills, plugins, hooks, MCP, goals, interrupts, forks, workflows, native workflows, and experimental APIs [@capabilities].
4343

44-
Each feature has a support value: `native`, `compiled`, `emulated`, `unsupported`, or `unknown` [@capabilities]. Reports can also include notes, lowering descriptions, recipes, and evidence for a feature on a surface [@surfaces].
44+
Each feature has a support value: `native`, `compiled`, `emulated`, `unsupported`, or `unknown` [@capabilities]. Reports can also include notes, lowering descriptions, recipes, and evidence for a feature on a surface [@surfaces]. The runtime selection rules are covered in [Capability Planning](../architecture/capability-planning).
4545

4646
Feature support also changes how Yoke explains product-facing promises. The README says skills may be native skill roots on the Codex app-server but compiled to files on other surfaces, Codex app-server subagents are compiled into guidance to use native `spawn_agent`, goals are native state only on the Codex app-server, and workflows are portable Yoke constructs across the listed surfaces [@readme]. These are not marketing distinctions; they are the support levels and lowering descriptions that `harness.explain()` exposes through the capability matrix [@surfaces].
4747

‎almanac/concepts/yoke-harness.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The constructor accepts compact provider specs such as `codex:app`, then normali
4444

4545
The harness asks the selected provider adapter to execute work. `ProviderAdapter` defines the boundary for readiness checks, login, runs, model listing, workflows, goal loops, session listing, session reads, session starts, sends, streams, goal mutation, interruption, compaction, renaming, tagging, forking, and close operations [@ports].
4646

47-
Before many operations, the harness resolves required features. `run`, `stream`, `start`, `workflow`, `models`, and session-management methods all call capability planning helpers before delegating to an adapter [@models]. This is where the harness connects to [Provider Surfaces](provider-surfaces): the selected surface must support the features implied by the agent and options. See [Workflows](workflows) for the split between portable Yoke orchestration and provider-native workflow artifacts.
47+
Before many operations, the harness resolves required features. `run`, `stream`, `start`, `workflow`, `models`, and session-management methods all call capability planning helpers before delegating to an adapter [@models]. This is where the harness connects to [Provider Surfaces](provider-surfaces): the selected surface must support the features implied by the agent and options. For the exact selection and validation flow, read [Capability Planning](../architecture/capability-planning). See [Workflows](workflows) for the split between portable Yoke orchestration and provider-native workflow artifacts.
4848

4949
The CLI is one concrete harness caller. It loads a folder collection, creates a harness for the selected provider surface, and stores run or workflow results after execution [@cli]; see [CLI And Run Storage](../reference/cli-and-run-storage) for that shell contract.
5050

0 commit comments

Comments
 (0)