CLI universe
Surface |
Value |
|---|---|
Package |
|
Story harness |
Canonical: |
Stability |
evolving (Wave 1+: grow verbs as stories migrate) |
Role
Hand-built concrete capability graph for the host CLI/TUI — not a
GraphTemplate / Agentic Recipe. Commands are verb-led with optional params and
product defaults. Soft points stay the UI answer seam elsewhere; this graph
grows by adding hard nodes and instrumentor verbs as user stories migrate.
Concept |
Module |
|---|---|
Graph factory |
|
Infer runner |
|
Instrumentor |
Config-injected |
Recipe adapters |
|
Assertions |
Open |
Event stamps |
|
Event tap |
|
Production verbs stay lean (infer, judge / judge_route, tool_loop,
tool_lifecycle, run_recipe (incl. context_pack), instantiate_recipe,
tile_recipe, recipe_plan, assemble_context, diagnostics,
durable IoC start/answer/inspect/rebuild/list_recipes,
transactional_resume for DR-10 crash-window durable coding-job resume).
Test-only clocks and the probe verb join via TestHarnessCliConfig
(tests/stories/cli_probes). Story probes register on cli_probe_classes.
Probe stories load a human-readable plan under plans/
(probe: {path: plans/….yaml} with name + params + optional summary);
inline probe: {name: …} remains valid for tiny cases.
Recipe parameterization uses a human-readable
:class:~mechaharness.recipe_bind.RecipeBind document (story binds/ or
CLI path:) via instantiate_recipe — not a new verb per catalog id.
Authors list the soft decisions that matter; omitted soft points take catalog
defaults; unknown keys fail. cli_universe remains the host shell for infer /
durable IoC; recipe shape stories bind and expand a catalog recipe instead.
Grow cli_universe nodes when stories need product surface that isn’t there
yet — not one node per verb. If the graph never grows, stories aren’t covering
real host interaction.
Distinct from:
Agentic Recipes —
GraphTemplatesoft-point catalogs (verify_repair, …)Durable generator product API —
DurableGraphGenerator/ host kit; CLI verbs drive the same session through the instrumentor
Story layout (canonical acceptance)
Product CLI scripts stay verb-led (commands: / instrumentor). Story
acceptance is a separate harness wrapper: kind: user_story YAML with
environment → graph → steps → complete → cleanup that drives
those verbs (see tests/stories/scenarios/user_story_scenario.py). Legacy
kind: cli script scenarios remain until migrated.
One story may own many concise scenarios (one claim each):
stories/<id>/
story.json
scenarios/
event_types.yaml
event_timestamps.yaml
response.json # cassette when needed
kind: user_story
environment:
family: pass_through
backend: mock
graph: null
steps:
- do:
infer:
prompt: Say hello.
complete:
expect:
- kind: exactly
key: event_types
value: [core:access_check, core:graph_start, …]
- kind: positive
key: cost_units
- kind: equals
key: total_tokens
value: 5
cleanup: []
Inference-running verbs (infer, tool_loop, run_recipe that completes)
expose prompt_tokens / completion_tokens / total_tokens summed from
core:inference usage payloads so stories can set token ceilings with
kind: lte.
Graph executions expose budget_spent (node cost_units charges) and fold it
into observation cost_units (max of priced inference units and graph spend).
Scenarios that surface budget_spent must declare an lte / equals /
gte / positive expect on cost_units or budget_spent.
Durable IoC sessions use a scenario-level durable: block and per-command
expect / expect_error. Cassette vs live is harness/Config
(MECHA_STORY_BACKEND, MECHA_BASE_URL, MECHA_MODEL, MECHA_JUDGE_*),
not YAML. Live collects HTTP twins plus static infer / judge /
judge_route walks; cassette-exact token counts soften while behavioral
expects stay hard (tests/stories/live_capability.py).
Discovery = add a YAML under scenarios/. Prefer few reusable verbs + many
scenario files over bag-ops and per-test Python.
Intent check
Before migrating a story, re-read story.json footnotes, docs/inspiration/,
and REQUIREMENTS.md. Map normative claims → scenario files; do not copy
legacy soft expects blindly. See .cursor/skills/user-stories/SKILL.md.
Migration program
Convert every legacy request.json / op story onto kind: user_story
YAML (persona walk wrapping product CLI verbs; legacy kind: cli only while
migrating). Each wave adds only the CLI verb, probe, or universe node needed:
Observability / one-shot infer (OBS-*) — done
Former harness_runs / pass-through / tool-loop / cassettes / host DI / judge route — done
Graph execution — done (test probes +
probeverb)Durable IoC — done (CLI verbs; parallel harness removed)
Decision plane / remaining judge ops — done (
decision_planerunner removed)pure_api — done (library probes; runner removed)
context_management — done (library probes;
includes/gteasserts)evaluation_research — done (library probes; runner removed)
lifecycle_extensions — done (tool/graph lifecycle probes; runner removed)
access_authority — done (grant/authority probes;
containsasserts)graph_recipes — done (recipe/template probes; runner removed)
Migration complete: story acceptance is kind: cli only.
When a legacy family has zero stories left, delete its op-dispatch runner.
RecipeBind / instantiate_recipe (documentation surface)
Shape stories keep a human-readable bind file under binds/ and a thin
scenario that loads it. The bind is part of the user-story documentation: a
reader should see the recipe id, goal, acceptance, and the soft decisions that
matter. Omitted soft points take catalog defaults; unknown soft point keys fail.
stories/<id>/
story.json
binds/
verify_repair.yaml # prose comments + RecipeBind fields
scenarios/
verify_repair_recipe.yaml # path: binds/… + expect
# binds/verify_repair.yaml
name: verify_repair
summary: Tile verify-repair into a concrete plan with default runner kinds.
goal: ship artifact with verify gate
soft_bindings:
produce_kind: produce
verify_kind: verify
repair_kind: repair
complete_kind: complete
CLI hosts use the same file: instantiate_recipe with path:. One verb
covers all catalog ids.
Catalog id |
Story coverage |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tile_recipe loads a :class:~mechaharness.recipe_bind.RecipeTileBind
(binds/*_tile.yaml) for namespaced multi-instance composition
(fangore_recipe_namespace_tile).
recipe_plan loads a lifecycle plan under plans/ — one verb,
document-selected behavior via plan::
|
Coverage |
|---|---|
|
evolvable allowlist |
|
typed IO search |
|
registry-only compose |
|
versions / lineage / pointer |
|
held-out promotion gate |
|
trace → candidate → objective |
|
host policy vs library gates |
|
embed child graph as tool |
|
events → traversal records |
|
demoted template refuses expand |
run_recipe remains for execute adapters (harness_run,
backend_describe, conversational_tool_loop).
judge is the judge-lane twin of infer (typed questions over state via
JudgeProvider + cassette/live). judge_route adds JudgementPolicy.
context_pack Agentic Recipe (run_recipe) binds host RagRetriever then
packs with assemble_context_within_budget. assemble_context remains a
thin leaf verb for already-scored candidate lists.
tool_lifecycle runs a tool-loop or tiny graph with Config-bound
LifecycleExtension instances (no case: bag).
Experimental report verbs
These verbs accept caller-supplied observations and produce offline reports:
admit_authority:decisionsclassifies supplied claim labels;effectsreports exact resource/operation membership in the supplied ledger.ledger_matchrecords membership only;gate_statusremainsnot_evaluated. Hosts authenticate sources and enforce actual grants independently.layered_eval:<name>_taskand<name>_harnessrepeat the supplied verdicts with missing/infrastructure handling.<name>_attribution: caller_assertedmeans the caller asserted trace support; this verb does not read causal evidence.request_prefix_compare:<name>_cause: matchmeans selected hashed fields matched and the caller reported metric availability. It does not establish a provider cache hit. Changed tool names/schemas stayunknown.
See API contracts for executable examples and Trouble release status for missing runtime integrations.
Diagnostic input migration
repo_topology now requires files and revision, with an optional budget.
cache_layout_experiment requires policy_blocks, relevant, dynamic, and
enabled. context_observation_chain requires observations, a requested
observation id, summary, action sequences, and messages. derived_memory
requires events, an event boundary, and supplied record labels. Empty requests
fail clearly instead of running a canned demonstration.
evaluator_compose_run takes a versioned evaluator identity and typed claims;
its report is caller-supplied evidence. atk_research_reject requires a supplied
final_test with passing claims and matching final_test_hypothesis plus
final_test_candidate_digest before
reporting promotion. Missing or mismatched evidence returns a refusal. It does
not independently authenticate a recorded evaluator result. The response exposes
candidate_digests for binding a result to its candidate change set and frozen
protocol inputs; reusing a hypothesis label with changed code is refused.
verification_outcome requires the caller’s verification_passed boolean and
applies the completion policy to it. It does not run a synthetic passing oracle.
inspect_openai_request accepts an endpoint and CompletionRequest, plus an
optional compare_to request. It returns only normalized-body digests, omitted
field names, and provider_cache_observed=false. The injected provider policy
is shared with the actual HTTP adapter. No HTTP request is made by inspection.