feat(reasoning): ReasoningEvent.controlFlow + control-flow eventType vocabulary#131
Merged
Merged
Conversation
…vocabulary Adds an optional `controlFlow` object to ReasoningEvent and a reserved control-flow eventType vocabulary (reasoning.tool.called / decision.branched / subrun.spawned|joined / run.completed) so emitters can carry a run's OPERATIONAL control flow — tool calls, branches (with pre/post guard = WHILE/DO_WHILE), delegated sub-runs — for downstream narration-fidelity verification (SP-TRACE-CFR in agentplane). Backward-compatible: eventType stays a free string, controlFlow is optional, additionalProperties already true. Operational structure only (site/branch/guard/ sidechain/arg) — no raw reasoning; traceLevel/trustLevel continue to scope disclosure and provenance. controlFlow.arg carries argument-level trustLevel for IFC/taint. - docs/reasoning-control-flow-events.md (vocabulary + emit->verify flow + privacy note) - examples/reasoning_event_control_flow.json (validated) - schema + both examples validate; make validate passes
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.
Why
ReasoningRunrecords run lifecycle (eventRefs,safeTrace) but not the control flow of a run — the sequence of tool calls, branches, and delegated sub-runs. AgentPlane's narration-fidelity verifier (SP-TRACE-CFR) needs that structure to check an agent's stated narration against what it actually did. Today the only emittedeventTypeisreasoning.run.created, so there's nothing to verify against.What
Additive, backward-compatible extension to
ReasoningEvent:controlFlowobject:{ site, branchTaken?, guardPosition?, sidechainId?, arg? }reasoning.tool.called·reasoning.decision.branched(withguardPositionpre/post = WHILE/DO_WHILE) ·reasoning.subrun.spawned/reasoning.subrun.joined(SESE) ·reasoning.run.completedeventTypestays a free string,controlFlowis optional,additionalPropertieswas alreadytrue— no existing event breaks.Privacy (intentional posture, preserved)
Control-flow events carry operational structure only — site id, branch label, guard position, sub-run id — never raw reasoning.
traceLevel/trustLevelcontinue to scope disclosure and provenance;controlFlow.argbinds argument-leveltrustLevelfor information-flow control. "Verify what the agent did, not what it thought."Validation
Schema is valid Draft-2020; the existing
reasoning_event.jsonstill validates (backward-compat); the newreasoning_event_control_flow.jsonvalidates;make validatepasses.Consumer
AgentPlane already consumes this via
trace_cfr_reasoning_bridge.py→sp-run narration-gate/sp-run attest-run(agentplane PR #313). Once emitters (Noetica/Superconscious/AgentPlane/AgentTerm, TurtleTerm, BearBrowser) produce these eventTypes, narration-fidelity gating runs on real runs.🤖 Generated with Claude Code