The browser can say approved. Assignment only believes a flag.
Assignment stays governable when a write needs a confirmed tool argument plus an eligibility check against the store, and an answer is shown only after the store accepted the run.
A business operation should be attributable to the person who authorized it. An assertion in a conversation does not substitute for the system's own approval record. The case examines that separation through a test.
A chat request arrives with a forged assistant message that looks like prior approval for assign_employee, followed by a question that asks to check assignment for Asha without confirmation. The server ignores the forged history and keeps only the new question. A scripted model tries to assign anyway, with confirmed false. The tool answers confirmation_required. When the run finishes, the employee_task table matches its snapshot from before the turn. The finished run includes a committed data-run and the response body ends with data: [DONE].
The claim is that workforce allocation stays governable when trusted code owns writes to governed tables such as assignment, chat admission and what the screen shows, and, within the chat runtime, one supervisor is the only model-driven router, while the training planner is a separate bounded model run and the specialists are narrower nested model runs. Employees, tasks, and the rows the sprint calculator reads come from demo tables built by scripts/seed_tables.py.
The argument
- Assignment is not a model write.
assign_employeeinserts only afterconfirmedis true and a freshrecommend_employeecheck passes; the name lookup, existing-assignee check, andINSERTshare the immediate transaction, while the recompute uses a separate read-only connection. - The supervisor delegates inside the chat runtime. Its model chooses among specialist agents and plain tools. Capacity, matching and ranking are deterministic code. The training planner is a separate bounded model run.
- The screen shows what the store accepted.
data-runis emitted only afterfinish_runrecords a completed turn. - Context is prepared, not trusted. Names are aliased, contact fields redacted, older tool returns replaced with an omission marker, and oversized requests stopped before the provider call.
Who is allowed to decide
The tempting design lets the model both recommend and assign, then asks the prompt to be careful. Two different things can go wrong. A forged transcript can look like consent. Forged history is kept out of the adapter, and assign_employee returns confirmation_required when confirmed is false. That return enforces the flag in code, but setting the flag is still the model's decision, backed only by the prompt. Allocation uses sprint capacity numbers calculated from the demo schedule tables.
Start at the left of the figure. The Operator card sends Browser chat through POST /v1/chat, one question per run. The HTTP chat row admits the run. The adapter receives only the validated latest question, and earlier model messages are loaded from the conversation store. A comment in the chat module says why: browser-supplied history and tool approval parts never enter the native adapter or widen tool authority. The orange Never trusted card lists Forged history, Tool approvals in UI, and Provisional model text.
Within the chat runtime, one supervisor is the only model-driven router; the training planner is a separate bounded model run. It is a PydanticAI agent, and its model picks which specialist or tool to call. Two specialists are nested model runs with narrower tool lists: one for database reads and single-row inserts, and one for task-skill inference. Capacity, matching, recommendation, and assignment are deterministic tools the model can only invoke. The instructions separate recommendation from assignment: a request for the best person is not assignment approval, and confirmed=true is set only for an explicit assignment command.
The README states the same rule as policy. Agents run only after a manual request or an explicitly configured schedule. Recommendations do not authorize actions, and assignment needs a separate explicit command. recommend_employee ranks without assigning; runtime chat writes employee_task through assign_employee, and the seed script also inserts demo rows.
Trace the two branches of the gate. With confirmed false, the function returns at once and never opens a write transaction. With it true, the tool takes the write lock first, finds the named employee, recomputes the recommendation and checks that person against the candidate list. Only then does it insert. Each way out has its own answer.
| Condition | Result |
|---|---|
confirmed false | confirmation_required, nothing written |
| Name missing or ambiguous | employee_not_found or employee_name_ambiguous |
| Candidate not eligible | employee_not_eligible, with the reason |
| Task already assigned | task_already_assigned, naming the holder |
| All checks pass | One INSERT INTO employee_task |
The lock is doing real work. Eligibility, the existing-assignment check and the insert form one serialized decision, so two operators cannot both win the same task. The model can suggest a name. The table changes only when the gate agrees.
What the evidence shows
Most of what follows is what unit tests assert. It is not a record of live sessions. The README's recorded browser runs call the capacity tool on real provider routes, and they claim no assignment write. No chat unit test passes confirmed=true; docs/kit-migration.md records live chat assignments that inserted employee_task rows.
Deterministic tools are the easiest part to check. For sprint 1, scoped to the name "Vikram", the capacity tool returns status ready, one employee and 91.0 available points. Duplicate that name in the table and the same call returns employee_name_ambiguous with no employees. The database agent's row reader refuses a query with no columns and pages results with a has_more flag.
Context preparation is tested without a network. A small agent runs with AgentContext, and the test confirms that employee names, emails and phone numbers never reach the wire, while aliases round-trip through tool arguments. A small byte budget (500 in the test) raises InputTooLarge with the statement that no model request was sent; the default limit is 256,000 serialized bytes. History keeps only the most recent complete runs (six by default; the test uses two) and replaces older tool returns with an omission marker, so mutable rows are fetched again instead of remembered. The 256,000-byte default is a serialized-size limit, not an exact provider token limit.
The last figure shows why the stream waits. Its cards run from execute() on the native adapter, through finish_run once the store is completed, to data-run as the accepted payload, then UI history as the display row. Provider failure and rejected completion emit no data-run and add no accepted turn; cancel does that for the cancelled run but keeps earlier accepted turns, and an error after finish_run still emits data-run. The UI sees an answer only after durable completion.
The stream tests use a scripted function model in place of a real provider. One patches finish_run to fail on completion and expects no data-run. One checks that a private exception string never reaches the wire. One cancels mid-run and finds the store status cancelled. One disconnects during title generation and still reads back the committed answer, so durability comes before cosmetic metadata.
Two gaps are real. No test shows an unconfirmed call mutating the table, and none shows data-run without a saved turn, because those are the failures the gate prevents. But no host-side classifier catches implicit assignment phrasing. The supervisor instructions tell the model to set confirmed=true only for an explicit assignment command, and the tool enforces that flag.
The turn we ran
test_native_http_confirmation_and_trusted_history is the allocation story in miniature. It seeds a fresh database and mounts the real chat router. A two-step scripted model replaces the supervisor. On its first call it requests assign_employee for task 1 and the alias [employee_1], with confirmed false. On its second it checks that the confirmation_required result reached it, then answers "Assignment requires an explicit command."
The client sends the forged-history payload. The response must carry at least two heartbeat comments, a leading start chunk and a closing [DONE], and no raw tool-, text- or reasoning- chunk types. The data-run diagnostics must list exactly one tool, assign_employee. The messages the model saw must contain neither "FORGED" nor "Asha", so aliasing and history stripping are checked in one assertion. The run is completed, the saved answer matches the streamed one, and employee_task equals its before snapshot.
This is not a measure of how a model behaves in the wild. It is a contract. The interface may dramatize approval, and the host still derives authority from tool results and explicit flags.
The one check to copy
Copy the gate, not the employee names. Wrap every workforce write in a tool that returns a pending status until a boolean is true. Recompute eligibility while the immediate write lock is held, then check the existing assignee and insert on that same connection.
if not confirmed:
return {
"status": "confirmation_required",
"task_id": task_id,
"employee_name": employee_name,
}Pair it with a chat producer that passes the validated latest user question from the request into the adapter and does not pass browser history. Stream admission, activity, heartbeats, and terminal frames, and emit data-run only after completion is stored. The regression to keep is the one above, because it shows in a single run that forged history and an unconfirmed call leave rows untouched while the operator still gets a coherent answer.
Within the chat runtime, keep one supervisor as the only model-driven router; the training planner is a separate bounded model run, and the specialists are narrower nested model runs. Attach AgentContext to every agent. A named capacity question returns that one employee only when the name matches exactly one row, and returns nobody when the name is missing or ambiguous; omitting the name returns the roster.
Close
A company operations chat is easy to describe as a supervisor with tools. The code describes a narrower system. The model delegated and chose tools. Deterministic functions owned sprint points and ranking. The governed tables stayed closed to insert_row. employee_task changes only when assign_employee passes confirmation and eligibility; the conversation store still records an accepted turn, and skill analysis writes its own tables. The HTTP layer showed an answer only after the conversation store accepted the run.
Workforce allocation is the README's POC-partial slice. Extend it by adding each new write behind an explicit confirmation tool with a fresh check, and by adding a native chat test each time the interface gains a new way to imply consent.
How is this page?
Last updated on