Skip to content

feat(reasoning): ReasoningEvent.controlFlow + control-flow eventType vocabulary#131

Merged
mdheller merged 1 commit into
mainfrom
feat/reasoning-control-flow-events
Jul 4, 2026
Merged

feat(reasoning): ReasoningEvent.controlFlow + control-flow eventType vocabulary#131
mdheller merged 1 commit into
mainfrom
feat/reasoning-control-flow-events

Conversation

@mdheller

@mdheller mdheller commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Why

ReasoningRun records 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 emitted eventType is reasoning.run.created, so there's nothing to verify against.

What

Additive, backward-compatible extension to ReasoningEvent:

  • optional controlFlow object: { site, branchTaken?, guardPosition?, sidechainId?, arg? }
  • a reserved control-flow eventType vocabulary: reasoning.tool.called · reasoning.decision.branched (with guardPosition pre/post = WHILE/DO_WHILE) · reasoning.subrun.spawned / reasoning.subrun.joined (SESE) · reasoning.run.completed

eventType stays a free string, controlFlow is optional, additionalProperties was already true — 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/trustLevel continue to scope disclosure and provenance; controlFlow.arg binds argument-level trustLevel for information-flow control. "Verify what the agent did, not what it thought."

Validation

Schema is valid Draft-2020; the existing reasoning_event.json still validates (backward-compat); the new reasoning_event_control_flow.json validates; make validate passes.

Consumer

AgentPlane already consumes this via trace_cfr_reasoning_bridge.pysp-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

…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
@mdheller mdheller merged commit 7522254 into main Jul 4, 2026
3 checks passed
@mdheller mdheller deleted the feat/reasoning-control-flow-events branch July 4, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant