Repository navigation
feat(runtime): surface FunctionPolicy category over /v0 capabilities - #228
Merged
Merged
Conversation
CameronBrooks11
force-pushed
the
feat/surface-category-actuate
branch
2 times, most recently
from
July 28, 2026 03:41
abd96ea to
d73947c
Compare
The runtime dropped the protocol's FunctionPolicy.Category at
build_capabilities, so nothing downstream could tell which device
functions actuate. Retain it on FunctionSpec, populate it from
function.policy().category() (proto3 yields CATEGORY_UNSPECIFIED when
absent), and emit it as `category` plus a fail-closed `actuating` flag
over GET /v0/devices/{p}/{d}/capabilities.
Add registry::is_actuating(): a function is actuating unless it
explicitly declares CATEGORY_READ, so UNSPECIFIED (untagged, e.g.
third-party providers), CONFIG, and any unknown future category all fail
closed. This is the shared dependency for the /v0/estop safe-state
command and the actuator half of the refuse-hookless install gate.
Untagged functions are warned at discovery. The formal "every ADPP
function MUST declare a category" conformance rule is a follow-up in
anolis-protocol.
Closes #218
CameronBrooks11
force-pushed
the
feat/surface-category-actuate
branch
from
July 28, 2026 03:47
d73947c to
bc64efe
Compare
Merged
CameronBrooks11
added a commit
that referenced
this pull request
Jul 30, 2026
Ships the safety spine + health-staleness work that has accumulated on main since v0.1.38: - #228 surface FunctionPolicy category over /v0 capabilities (is_actuating) - #229 POST /v0/estop software safe-state + actuation latch - #230 install.sh --variant selection + verify-inert boot-inert - #231 refuse-hookless: veto MANUAL->AUTO without safe-state hooks - #234 cadence-derived device-liveness staleness (D7 phase 1) - #235 per-signal quality/freshness into health, new FAULT state (D7 phase 2) Bumps CMakeLists project VERSION + vcpkg.json, rolls CHANGELOG [Unreleased] into [0.1.39] (adds the missing phase-2 entry), and updates the runtime_version in the runtime-http contract examples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #218.
Problem
The runtime dropped the protocol's
FunctionPolicy.Categorywhen flattening device capabilities (build_capabilitiesdidn't readfunction.policy().category(), the flattenedFunctionSpecretained no policy, andencode_function_specnever emitted it). So no consumer could tell which device functions actuate hardware — the missing foundation for a software safe-state command and a refuse-hookless install gate.Change (3-step plumbing + fail-closed classifier)
FunctionSpecretainscategory(core/registry/device_registry.hpp), defaulting toCATEGORY_UNSPECIFIED.build_capabilitiespopulates it fromfunction.policy().category()(proto3 yieldsUNSPECIFIEDwhen policy is absent — the fail-closed default) and logs a warning for any untagged function.encode_function_specemits two new fields overGET /v0/devices/{provider}/{device}/capabilities:category— enum string (UNSPECIFIED/READ/CONFIG/ACTUATE)actuating— fail-closed bool via newregistry::is_actuating()Fail-closed rule: a function is actuating unless it explicitly declares
CATEGORY_READ. SoUNSPECIFIED(untagged, e.g. a third-party provider),CONFIG(persistent effect), and any unknown/future enum value all count as actuating. This is the locked D6 decision — an untagged provider must not be able to silently defeat the safety gates.is_actuating()is the single classifier the future consumers must use rather than checking== CATEGORY_ACTUATE.Consumers (separate issues, not in this PR)
/v0/estopruntime safe-state command (anolis#219) — enumerates actuating outputs to drive them safe.Tests & verification (local)
UNSPECIFIED/actuating) and added a mapping test coveringACTUATE/READ/CONFIGplus an out-of-range enum (99) →UNSPECIFIED/actuating, which guards against anyone narrowingis_actuatingand keeps the JSON schema-valid.category/actuatingadded to theFunctionSpecschema (required) and the capabilities example fixture./v0conformance: 19/19 — the runtime emits the fields and the bundled sim's tags validate against the enum.Follow-ups (tracked elsewhere)
FunctionPolicy.Category" conformance rule belongs in anolis-protocol (deferred, pairs with this).