8000 feat(agentcore): add turn planning and decision contracts by Fodesu · Pull Request #87 · felinics/twilight · GitHub
[go: up one dir, main page]

Skip to content

feat(agentcore): add turn planning and decision contracts - #87

Merged
Fodesu merged 1 commit into
feat/agent-runtime-core-13-chatlogfrom
feat/agent-runtime-core-14-turn-driver
Oct 3, 2026
Merged

Fodesu merged 1 commit into
feat/agent-runtime-core-13-chatlogfrom
feat/agent-runtime-core-14-turn-driver

Conversation

@Fodesu
@Fodesu Fodesu commented Oct 3, 2026 •
Copy link
Copy Markdown
Member

Summary

Introduces the Turn-facing decision and planning layer around a Run. The new turn, decision, history, inbox, preset, and run/plan packages separate logical Turn facts from Run execution facts and give the owner deterministic inputs for the next action.

Design

A Turn owns started, failed, and superseded events on a keyed inherited stream. Its surface joins those facts with chatlog.input_delivered and run_ended: the Run remains the authority for execution termination, while the Turn projection records ownership, input membership, settlement, replacement, and terminal status. Identity helpers derive plan, Run, cancellation, and Turn-related command IDs from stable canonical preimages.

AgentPreset freezes the decision identity: model, tool contracts, prompt-builder reference, scheduling, malformed-result retry budget, and system prompt. Registries retain digest-addressed versions and resolve only matching PresetRef values. decision.Builder returns a frozen request plus consumed input IDs, freshness token, and persisted tool specs; plan.Next interprets machine state into exactly one ephemeral action, including replanning when inputs arrive after preparation. Recovery planning turns lost model executions into withdrawal and lost tool executions into explicit unknown failures.

The durable inbox provides per-session sequence ordering, idempotent command IDs, conflict detection, pending enumeration, and one-shot resolution. History scans committed events to calculate Turn-inclusive and Turn-exclusive fork boundaries and active-at-commit checks.

Testing

Tests cover Turn projection and wire behavior, preset digest/registry behavior, inbox map conformance, and planning/recovery invariants.

@Fodesu
Fodesu added this pull request to stack #105 October 3, 2026 12:27
@Fodesu Fodesu changed the title feat/agent runtime core 14 turn driver feat(agentcore): add turn planning and decision contracts Oct 3, 2026
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-14-turn-driver branch from 9274835 to cf2d881 Compare October 3, 2026 14:43
@Fodesu
8000
Fodesu marked this pull request as ready for review October 3, 2026 14:46
@Fodesu
Fodesu removed this pull request from stack #105 October 3, 2026 16:13
@Fodesu
Fodesu added this pull request to stack #107 October 3, 2026 16:16
@Fodesu
Fodesu removed this pull request from stack #107 October 3, 2026 16:34
@Fodesu
Fodesu added this pull request to stack #108 October 3, 2026 16:37
@Fodesu
Fodesu removed this pull request from stack #108 October 3, 2026 16:51
@Fodesu
Fodesu added this pull request to stack #110 October 3, 2026 16:55
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-14-turn-driver branch from cf2d881 to 72fddd3 Compare October 3, 2026 17:04
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-14-turn-driver branch from 72fddd3 to f8eecb8 Compare October 3, 2026 17:11
@Fodesu
Fodesu merged commit d181220 into main Oct 3, 2026
8 checks passed
@Fodesu
Fodesu deleted the feat/agent-runtime-core-14-turn-driver branch October 5, 2026 07:35
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

0