free-agent
Safe HaskellNone
LanguageGHC2024

Free.Agent.Meeting

Description

A pure meeting driver and the replay oracle (stage 5 of endgame-path).

A meeting is rounds over a roster: round 1 sees the seed, each later round sees the previous round's outputs. The log is the seed followed by the concatenated rounds — oldest first, exactly the shape cone and branches resolve against.

Replay is re-running the same meeting with one box swapped (different model, fixed prompt). The oracles pin:

  • a fresh identical roster reproduces the log exactly;
  • posts whose cone avoids the swapped name reproduce identically (unchanged);
  • posts downstream of the swap differ;
  • thread edges are now exact PostIds assigned positionally by the driver, so a same-named swap is visible as soon as it reaches a thread edge.

Approach taken: AgentBox now receives both the input posts and their positional ids for the current round. The driver assigns ids to the concatenated outputs after each round, so every post in the returned log carries the correct ids and every reply/synthesis can cite them.

Synopsis

Documentation

data AgentBox where Source #

Existential box around a pure batch agent, carrying its current state.

The agent input is a pair: the batch of posts and the positional ids the driver assigned to that batch. This lets agents thread replies/syntheses by exact reference without inventing ids.

Constructors

AgentBox :: forall s. s -> Agent (->) s ([Post Text], [PostId]) [Post Text] -> AgentBox 

quoter :: Name -> Text -> Agent (->) ([Post Text], [PostId], [Post Text], [PostId]) ([Post Text], [PostId]) [Post Text] Source #

A deterministic oracle agent: answers each batch with one honest synthesis post (synthesisPosts) whose body quotes what it saw. tag marks the "model" — swapping the box is swapping the tag.

Output depends only on the pre-input state (the Moore idiom of tape): the state carries the last batch and its ids seen, and the emit answers it.

runAgentBox :: AgentBox -> [Post Text] -> [PostId] -> ([Post Text], AgentBox) Source #

One batch step: absorb the input and its ids, emit the answer (iterateSystem semantics — output is read from the post-input state).

withIds :: Agent (->) s [Post Text] [Post Text] -> Agent (->) s ([Post Text], [PostId]) [Post Text] Source #

Lift an agent that ignores ids into one that accepts the boxed (posts, ids) input. This is the minimal adapter for existing agents that do not need provenance.

meet :: Int -> [AgentBox] -> [Post Text] -> [[Post Text]] Source #

Run n rounds over a roster. Every box sees the previous round's concatenated outputs (round 1 sees the seed). Returns the rounds.

meetLog :: Int -> [AgentBox] -> [Post Text] -> [Post Text] Source #

The full log of a meeting: seed followed by the rounds, oldest first. Ids are assigned positionally by the driver, so thread fields in the returned posts are valid ids against this log (indexToIdMap reproduces the same assignment).

unchanged :: [Name] -> [Post Text] -> [Post Text] Source #

The posts of a log whose ancestry cone avoids the given names — the subtrees a swap of those names cannot touch.