Skip to content

buildAlignmentMessages

buildAlignmentMessages(context): BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/shell/alignment.ts:562

The four-role assembly — the whole hypothesis of [[EXT-127]], in one function.

The order is: our instructions (system), the user’s mandate (user), then every earlier round replayed as the checker’s own turns and their tool results, then — for a later round — our own framing of what changed. The pending command is deliberately absent from all of it: it arrives only when the model calls ALIGNMENT_TOOL_VIEW, which is what makes “the agent’s command is a tool result” a property of the assembly rather than a convention.

Exported and returning plain messages so a test can assert on the PLACEMENT of each value rather than on its presence somewhere — a test that merely checks a string is present does not test this.

AlignmentContext

BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]