Metadata-Version: 2.4
Name: spec-kitty-runtime
Version: 0.4.3
Summary: Canonical mission runtime for deterministic next-step planning
Author: Spec Kitty Contributors
License: MIT License
        
        Copyright (c) 2026 Spec Kitty Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: jsonschema>=4.0
Requires-Dist: spec-kitty-events==3.0.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Dynamic: license-file

# spec-kitty-runtime

Canonical mission runtime for Spec Kitty.

## Scope (V1)

1. YAML mission template loading.
2. Deterministic mission discovery with precedence tiers.
3. Deterministic step planner and mission `next()` execution loop.
4. Prompt rendering for agent runtimes.

## Public API

1. `load_mission_template(path_or_key, context=None)`
2. `discover_missions(context)`
3. `start_mission_run(template_key, inputs, policy_snapshot, context=None, run_store=None)`
4. `next_step(run_ref, agent_id, result="success", policy_snapshot=None, actor_context=None, context=None)`
5. `render_prompt(decision, format="markdown")`

## Runtime Event Emitter API (v0.2.0a0)

`RuntimeEventEmitter` uses canonical payload-object methods aligned to
`spec-kitty-events` mission-next contracts:

1. `emit_mission_run_started(payload)`
2. `emit_next_step_issued(payload)`
3. `emit_next_step_auto_completed(payload)`
4. `emit_decision_input_requested(payload)`
5. `emit_decision_input_answered(payload)`
6. `emit_mission_run_completed(payload)`

`NullEmitter` is the default no-op implementation for local-first/offline flows.

## Step Context Contracts (V1)

Mission steps declare their context requirements using step context contracts:

- **requires**: Contexts that MUST resolve before execution
- **optional**: Contexts that may enrich but aren't blocking
- **emits**: Contexts produced/updated on completion

See `docs/contracts.md` for the complete reference, V1 baseline context types, and integration guide for spec-kitty 2.x.

## Mission Pack Layout (YAML-only)

```text
mission-pack.yaml
missions/<mission_key>/mission.yaml
missions/<mission_key>/templates/*.md
missions/<mission_key>/steps/*.yaml  # optional
```
