Skip to Content
Recodocs

The model proposes the promotion; approval decides who files it

On 14 October the human-mode run called apply_ledger and the host denied it; the approved run never called it, and the host applied the ledger. The host renders the documents.

7 min read

Generating paperwork is not the same as approving the employment change described by it. Follow how the system binds a scenario to an employee, prepares a document and keeps consequential changes subject to review.

An operator runs the paperwork command with the intent "Generate promotion paperwork for Morgan Lee" and the --human flag. The model looks up the scenarios, reads the employee, binds the promotion scenario, checks the facts, prepares a preview, and proposes a ledger change and a notification. Then it reaches for apply_ledger. The host records that call as denied. The command result says needs_human_input. The outbox has zero rows, and Morgan Lee's open role is still Junior Data Engineer.

Run the same command with --scenario promotion instead and no model is opened. Three PDFs render, the ledger applies, and the notification is captured in 5.388 seconds.

The claim is that an HR paperwork assistant is trustworthy when the model may plan and propose, but apply_ledger and send_notification stay behind an approval gate the model does not control, and the host renders every document. Human mode can deny those two mutations. An approved run can still be finished by the model or by the host safety-net. A stronger instruction in the prompt does not substitute for a denied call you can find in a trajectory file. Employees such as Morgan Lee, ID RH-10042, are synthetic.

The argument

  1. Two entry points, two kinds of authority. --scenario is a deterministic workflow. --intent is the only model-driven path.
  2. Mutation is not a tool the model can finish unapproved. apply_ledger and send_notification sit behind approval; human mode leaves the proposal proposed, and an approved run can still be finished by the model or by the host safety-net.
  3. Documents are composed by code. Variables are validated before any template runs, and neither renderer calls a model.
  4. The recorded runs prove the gate, not the model. One approved run was completed by the host after the model stalled.

Who is allowed to decide

The usual description says that an agent writes the letter, sends the email and updates the role table. Here the agent does none of the three without approval: it proposes, and applying or sending waits on a gate it does not control. The migration notes draw the line plainly. The agent path is a model choosing tools. The host path is a workflow with no model.

Host path versus agent pathA CLI intent flag chooses either a deterministic scenario workflow with no model call, or a PydanticAI Agent that picks among ten tools. apply_ledger and send_notification sit behind approval gates on the agent path.Host path--scenarioNo model callDeterministic workflowRenders PDFs, mutates DBproof: deterministic_harnessHuman gate--human → approval_requiredNo apply until approvedAgent path--intentbuild_agent → gpt-6-lunaModel picks toolslist_scenarios … tick_pendingTyped ScribeOutcomeApproval-gatedapply_ledgersend_notificationHost renders; DB writes gatedDocumentEngineHost-owned render pathsame hostCaption: Scenario flag blocks model mutations; agent flag allows reads and proposals only until approval.

The figure splits at the command line. On the left, the host path has no model call, renders the PDFs, mutates the database, and labels its result deterministic_harness. On the right, --intent builds one PydanticAI agent on gpt-6-luna. That model chooses among ten tools and returns a typed outcome. The orange gate sits on two of those ten, apply_ledger and send_notification. Applying a change and sending mail both wait on a gate the model does not control.

The model can call prepare_preview inside the tool loop; the host owns the renderer. A document engine takes a template, a letterhead and a set of variables, and returns HTML or a PDF. HTML rendering runs the Node script; PDF rendering runs that Node script and then the Python script. The recorded system Chrome setting belongs to tools/render_pdf.py, which the notes keep separate from src/documents/runtime/. The agent may ask for a preview. It does not touch the code that produces the bytes.

DocumentEngine compose and renderOffer letter variables pass through a Pydantic model, a sandboxed Jinja subject line, then html or pdf renderers that call the letterhead runtime.Variablesdict inPydanticmodel_validateJinjaStrictUndefinedOutputhtml / pdfOfferLetterVariablesextra forbidsubject_templateautoescape onrender_html.mjsrender_pdf.pyletterhead keyCaption: Missing or extra fields fail before any Node or Chrome subprocess runs.

Read the figure left to right. Variables enter a Pydantic model, OfferLetterVariables. The subject line is then built by a sandboxed Jinja environment. The subject is rendered in compose; render then runs whichever one output was requested, passing the letterhead compose already loaded. The validation is strict in ways a model would not enforce on itself: extra keys are forbidden, every compensation row needs a positive amount, and probation cannot exceed 24 months. StrictUndefined and autoescape apply to the subject line; required offer-letter fields fail in OfferLetterVariables before any renderer runs. A second registration under the same key raises instead of silently replacing the first.

What the evidence shows

Three kinds of proof get mixed together: design documents, recorded smoke runs, and automated tests. They carry different weight. The tests were updated during the move to the shared kit but have not been run, so the recorded runs below do not rest on them. The runs below are recorded, one each, on 14 October 2026.

RunCommand shapeWhat the record shows
Host path--scenario promotioncompleted, deterministic_harness, 3 PDFs, ledger applied, outbox 1 captured, 5.388 s
Live, approved--intent ... --yesThe model proposed but never called apply_ledger. It asked for revised compensation. The host finished the run: host_completed_capture, model_drove_mutations: false
Live, human mode--intent ... --humanSeven tool calls, then apply_ledger denied. Proposal still proposed, 0 outbox rows, live_agentic_capture

The second row is the honest one. In the approved run the model stalled. It asked for compensation even though the fact check reported nothing missing, and the host safety net completed the paperwork. The label records this. The result passed, but the model did not drive the mutation. The gate and the label show the difference between that host-finished run and the denied human-mode run.

The third row is the claim in miniature. The model proposed the ledger and the notification, then asked to apply. The host recorded a denial. The read-back from the database confirms it: the proposal is proposed, the outbox is empty, and the open role is unchanged. The release oracle marked that run fail, because it expects applied state, and that failure is the intended outcome of a gated run.

Two gaps stay open. Paperwork facts in this build still come from synthetic fixtures in facts_util.py, so the gate protects writes, not the truth of the inputs. And the rules in AGENTS.md, which require the current role to be read from the employee directory before the first model request and forbid filling missing fields from an example, target the Slack flow and are not satisfied by this build. A host gate cannot make up for facts it was never given.

What would falsify the claim is a human-mode run that applied a ledger or sent a notification. The recorded read-backs show the opposite. What would strengthen it is running the updated tests on a throwaway database, and repeating the approved run enough times to see how often the model finishes the job itself.

The turn we ran

The human-mode run on 14 October is the right turn to examine. The trajectory records the seven tool calls and the denied apply_ledger, and the command result is needs_human_input. Per the record, the model called the same seven tools as in the approved run, then apply_ledger, which was denied. It never attempted send_notification.

Human-mode agent turnDocumented human-mode smoke: the model proposes ledger and notification, apply_ledger is denied, send_notification is not attempted, ledger stays proposed.Operator--human --intentCLIPydanticAI AgentSQLiteRequestGenerate promotion paperworkAgentbind_scenario, prepare_previewAgentpropose_ledger, propose_notificationToolapply_ledger → deniedHostneeds_human_inputproposal proposed0 outbox rowsCaption: Recorded smoke turn with approval_decision false and live_agentic_capture proof label.

The figure draws three lane headings, CLI, PydanticAI Agent and SQLite, and five cards in one centre column joined by short vertical arrows. The denied step is the card apply_ledger → denied; the figure does not draw an arrow from the agent to SQLite. Beside the SQLite lane the figure shows proposal proposed and 0 outbox rows, and the read-back says proposal 4 stayed proposed. The JSON returned to the operator says needs_human_input and approval_decision: false. Nine model calls were logged for the run, at 13,803 input tokens and 239 output tokens.

The turn is one observation of a mechanism. It does not show that the model will always plan this way, and it says nothing about quality of the letter, because no letter was applied. It does show where the line sits. The model got as far as asking, and the next step was not its to take.

The one check to copy

Copy the compose guard, not the promotion nouns. Any generated document that must not leak a template hole or a schema drift should validate its variables before templating, in this order:

validated = template.variables_model.model_validate(variables)
subject = self.jinja.from_string(template.subject_template).render(**context)

Validation runs first; the subject context is the validated variables plus the letterhead. The same idea applies to the database: a missing file raises FileNotFoundError with an instruction to reseed, and creates nothing. Both refuse before they make something that looks plausible.

When you add a paperwork field, add it to a Pydantic variables model that forbids extra keys, add a test that passes an illegal key, and only then teach the agent the name. The notes also record a useful probe: a stand-in model injected into the runner is labelled test with testmodel_stub, never as the production model id. Receipts should say what ran.

Close

Promotion paperwork tempts a story about an AI HR clerk. The recorded runs describe something narrower. The model plans, previews and proposes, and it may stop early to ask. The host renders every document. This package validates OfferLetterVariables before the offer template; the notes do not say that model covers every promotion field. Approval turns a refusal that could have lived in the prompt into a denied call you can read in a log.

To add the next scenario, extend the templates under host validation, keep ledger writes behind apply_ledger and notification sends behind send_notification, and record each smoke run with its status, its proof label, a database read-back and a file digest. Treat the synthetic employee as a fixture and each live turn as one sample of tool choice. The approved run above is the reminder: the label that says the host finished the job is the one worth keeping.

How is this page?

Last updated on