# kya-os-engine

Verification engine for the KYA-OS ecosystem. Every TS / .NET / Go / Python /
Cloudflare-Workers host wrapper is a thin shim around the WASM or WASI build of
this crate. ADR-001 (Engine-Centric Consolidation) is the architectural
decision; the locked public API contract is tracked in D-design
([issue #2484][issue]) and mirrored at
[`docs/architecture/D-design-ratification.md`][ratification].

`kya-os-engine` is the root of the dependency graph. It depends on
nothing from `@kya-os/*`, `agentshield-*`, or `checkpoint-*`; the
direction is the other way.

The public surface is one function (`verify`), one decision vocabulary (`Decision`
with five variants — `Permit`, `Block`, `Challenge`, `Redirect`, `Instruct`),
five dependency-injection traits (`DidResolver`, `StatusListCache`,
`ReputationOracle`, `PolicyEvaluator`, `Clock`), and one canonical-signing-payload
helper (`canonical_signing_payload`, RFC 8785 / JCS).

This is the **Layer 1 API lock** (D-design, [issue #2484][issue]). The body of
`verify()` is `todo!()`; trait methods are stubbed. D-impl
([issue #2485][impl]) satisfies the contract.

## Reduced edge profile (delegation depth)

The engine formally verifies **single-hop** delegation only. A multi-hop
delegation chain (`delegation_chain.len() > 1`) fails closed to
`Block(PolicyDenied)` instead of flattening every hop's granted scopes — the
deliberately-reduced edge profile of [issue #2904][issue-2904]. Cascading
revocation, per-hop attenuation, and chain integrity are deferred to the
Layer-2 tenant `PolicyEvaluator` (reference semantics in xmcp-i `mcp-i-core`),
never duplicated in the engine. See the "Reduced edge profile" section of
[`docs/architecture/D-design-ratification.md`][ratification] and the conformance
suite `tests/delegation_conformance.rs`.

[issue-2904]: https://github.com/Know-That-Ai/checkpoint/issues/2904
[issue]: https://github.com/Know-That-Ai/checkpoint/issues/2484
[impl]: https://github.com/Know-That-Ai/checkpoint/issues/2485
[ratification]: ../../../docs/architecture/D-design-ratification.md
