Changing what is live

main is what real callers and customers get. A change reaches it in three moves: you make it on a feature branch, you check it there, and you promote the branch through a changeset, a frozen plan of the change that an approver reviews before it merges, with the evidence that it was tested. This guide walks through that flow call by call, then covers trying a change on a share of real contacts before it merges, undoing a change, the ledger of everything that changed on main, and what to do when a change is refused or does not show up.

The flow at a glance

  1. Change entities on a feature branch, such as feature/new-hours.
  2. Check the result on that branch: diff it against main, preview the agent's context, simulate a conversation, and if simulations are not enough, try it on a capped share of real contacts.
  3. Open a changeset from the branch into main, with a description and the test runs as evidence.
  4. Review: an approver reads the frozen diffs and evidence, then approves or requests changes.
  5. Iterate if changes were requested: fix the branch and refresh the same changeset.
  6. Merge: exactly the approved plan is applied to main, and the feature branch is deleted.

Every changeset merged into main, and every whole-branch promotion made without one, is recorded as a merged changeset, so the list of merged changesets is the history of what went live, when, why and on whose approval. Merging or fast-forwarding single entities into main is not in that list.

Make the change on a feature branch

A branch needs no setup: the first write to a new name creates it. Change the existing entities by id; do not copy them. Promotion preserves ids, so references from other entities keep working.

curl -X POST "https://api.hilus.ai/Platform/entities/Agent/patch" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": "agt_123",
  "branch": "feature/new-hours",
  "commit_message": "greet with the new opening hours",
  "ops": [
    {
      "op": "replace",
      "path": "/initial_message",
      "value": "Thanks for calling. We are open Monday to Saturday."
    }
  ]
}'
curl -X POST "https://api.hilus.ai/Platform/entities/Document/edit" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": "doc_123",
  "branch": "feature/new-hours",
  "anchor": "lines",
  "old": "Saturday, 9am to 1pm.",
  "new": "Saturday, 9am to 2pm.",
  "commit_message": "longer Saturday hours"
}'

Until the branch is merged, nothing a real caller sees has changed. Entities and branches covers the writers in detail.

Check the change on the branch

First confirm the branch holds what you think it holds. diff_branches compares it with main, type by type:

curl -X POST "https://api.hilus.ai/Platform/entities/diff-branches" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "entity_types": [
    "Agent",
    "Document"
  ],
  "branch": "main",
  "compare_branch": "feature/new-hours"
}'

Response:

{
  "results": {
    "Agent": {
      "only_in_base": [],
      "only_in_compare": [],
      "diverged": [
        {
          "entity_id": "agt_123",
          "changed_fields": [
            "initial_message"
          ],
          "diff": "-initial_message: Thanks for calling.\n+initial_message: Thanks for calling. We are open Monday to Saturday.\n"
        }
      ],
      "identical_count": 3
    },
    "Document": {
      "only_in_base": [],
      "only_in_compare": [],
      "diverged": [
        {
          "entity_id": "doc_123",
          "changed_fields": [
            "lines"
          ],
          "diff": "-  Saturday, 9am to 1pm.\n+  Saturday, 9am to 2pm.\n"
        }
      ],
      "identical_count": 11
    }
  }
}

Then check behaviour, not only configuration. render_context shows what the agent's model would receive on the branch, with no model call and no cost:

curl -X GET "https://api.hilus.ai/Platform/lab/render-context?agent_id=agt_123&branch=feature%2Fnew-hours" \
  -H "Authorization: Bearer $HILUS_API_KEY"

simulate plays a whole conversation against the branch with a simulated caller. Tools that write or cannot be undone are mocked, reads answer from the live system unless you mock every tool, nothing is written, and each agent turn carries an llm_request_id you can cite as evidence.

curl -X POST "https://api.hilus.ai/Platform/lab/simulate" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "agt_123",
  "branch": "feature/new-hours",
  "scenario": "A caller asks whether the office is open on Saturday afternoon.",
  "requirements": [
    "States the Saturday hours as 9am to 2pm"
  ]
}'

Saved tests and workflow scenarios run with run_tests on the same branch; each run is stored, so its id is a durable reference.

[!NOTE] Simulations and test runs are real model calls and cost money. Run what your change touches, on the branch you changed. See testing.

Try a change on real contacts

A simulation shows how a change behaves with a made-up caller. To see how it does with real ones before it merges, send a share of live contacts to the branch and compare them with the contacts who stayed on main: an experiment. Each inbound contact (a caller's number, a sender's address, a chat visitor) is assigned by a stable hash, so the same person always lands on the same side. A contact assigned to the branch is handled with the branch's routing, agents, workflows and documents; everyone else is handled by main as usual.

[!WARNING] An experiment reaches real contacts within seconds, before anyone has reviewed the branch, and so does every edit you make to the branch while it runs. Starting, changing or stopping one therefore needs the approve-changesets permission (or the bypass permission) whether or not main is protected, and every change is recorded in the organization's audit log.

Start it. set_branch_traffic sends a percentage of eligible contacts to a branch that already holds your change. condition says when the experiment applies, as a routing condition (here, phone calls only; unset means always). max_contacts caps how many people it may take, so a risky change reaches only a few. description says what it tests, wherever it is listed.

curl -X POST "https://api.hilus.ai/Platform/entities/branch-traffic" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "branch": "feature/short-greeting",
  "percent": 10,
  "condition": {
    "event_type": "voice"
  },
  "max_contacts": 50,
  "description": "A shorter greeting that asks for the reason for the call first."
}'

Response:

{
  "branch": "feature/short-greeting",
  "percent": 10,
  "from_percent": 0,
  "to_percent": 10,
  "condition": {
    "event_type": "voice"
  },
  "description": "A shorter greeting that asks for the reason for the call first.",
  "started_at": "2026-11-16T15:00:00Z",
  "ended_at": null,
  "max_contacts": 50,
  "contacts": 0
}

list_branch_traffic shows what is running: each experiment's share, condition, description, start and, for a capped one, the people taken so far.

curl -X GET "https://api.hilus.ai/Platform/entities/branch-traffic" \
  -H "Authorization: Bearer $HILUS_API_KEY"

Where the records go. Everything an experiment's contacts produce (calls, conversations, messages) is written to main, not to the branch, and stamped with the side that handled it: the branch name for the experiment group, main for the control group (contacts that met a running experiment's condition but were not sent to any experiment), and nothing for contacts in no experiment. get returns a record's stamp as read_branch. A contact never writes the branch's own configuration to main; that reaches main only when the branch merges.

Compare the two groups. The conversations report and the report on calls alone take read_branch: the branch name for the experiment group, main for the control group. Run the same report for each side over the experiment's dates:

curl -X GET "https://api.hilus.ai/Platform/reporting/conversations?since=2026-11-16T00%3A00%3A00Z&until=2026-11-23T00%3A00%3A00Z&read_branch=feature%2Fshort-greeting" \
  -H "Authorization: Bearer $HILUS_API_KEY"
curl -X GET "https://api.hilus.ai/Platform/reporting/conversations?since=2026-11-16T00%3A00%3A00Z&until=2026-11-23T00%3A00%3A00Z&read_branch=main" \
  -H "Authorization: Bearer $HILUS_API_KEY"

Both groups hold only contacts the condition let in, so they are comparable; they differ in size by the share, so compare rates (answered, resolved, handed off, time to answer, topics), not counts. When several experiments run at once, they share one control group.

Stop it. Set percent to 0. The experiment stays listed, with when it ran, when you pass include_ended, so its results can still be compared, and setting a share again resumes it with the same contacts. Pass forget with percent 0 to remove it from the list. Deleting or merging the branch also ends it and removes it from the list. The stamped records stay on main in every case, so the reports above still compare the two groups afterwards.

curl -X POST "https://api.hilus.ai/Platform/entities/branch-traffic" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "branch": "feature/short-greeting",
  "percent": 0
}'
curl -X GET "https://api.hilus.ai/Platform/entities/branch-traffic?include_ended=true" \
  -H "Authorization: Bearer $HILUS_API_KEY"

What it means for review. An experiment does not replace a changeset: the branch handles real contacts before it is approved, which is why starting one takes an approver's permission. Keep the branch's edits to what you are testing while it runs, since each one reaches those contacts at once. When the results are good, take the branch to main as usual: open a changeset from it and put the comparison in its description; merging gives the change to every contact and ends the experiment. To audit who started, changed or stopped an experiment, filter the organization's audit log with get_audit_log by its action:

curl -X GET "https://api.hilus.ai/Platform/admin/orgs/Example%20Co/audit-log?action=branch_traffic" \
  -H "Authorization: Bearer $HILUS_API_KEY"

If it is refused. A 403 ("Sending live traffic to a branch requires the approve_changesets permission") means you lack the approve-changesets permission; ask an organization admin. A 400 names the reason: the branch does not exist yet ("make the change on it first"), it is main, a lab/ branch or pinned to a point in time, or the share does not fit beside running experiments ("Only N% of live traffic is free"; "can't grow … without moving its callers"), in which case lower another experiment's share, or set this one to 0 and start it again.

Open a changeset

changeset_open runs the promotion as a dry run, freezes the result (which entities, at which commits, with which diffs) and records the changeset as open. description says why the change exists; origin_ref points at the conversation or ticket that asked for it; test_evidence lists the runs that show it works.

curl -X POST "https://api.hilus.ai/Platform/entities/changesets" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from_branch": "feature/new-hours",
  "to_branch": "main",
  "description": "Saturday hours extend to 2pm; the greeting mentions Saturday.",
  "origin_ref": "conv_789",
  "test_evidence": [
    {
      "tool": "lab simulate",
      "ref_id": "llmreq_5f2a9c",
      "branch": "feature/new-hours",
      "scenario": "Caller asks about Saturday afternoon",
      "outcome": "passed"
    }
  ]
}'

Response:

{
  "changeset": {
    "changeset_id": "cs_3f9e2a7b1c4d5e6f7a8b",
    "from_branch": "feature/new-hours",
    "to_branch": "main",
    "status": "open",
    "description": "Saturday hours extend to 2pm; the greeting mentions Saturday.",
    "plan": {
      "member_count": 2,
      "counts": {
        "merged": 0,
        "fast_forwarded": 2,
        "up_to_date": 0,
        "conflicted": 0,
        "failed": 0
      }
    }
  },
  "auto_approve_ignored": null
}

Each evidence item is {tool, ref_id, branch, scenario, outcome}, where tool is one of lab simulate, lab replay, agent_test or simulation_test and ref_id references the real run, not a transcript. Runtime records on the branch (calls, conversations, stored simulations) are never promoted; the plan lists them as skipped.

A changeset refuses to open when the plan has conflicts: the same field changed differently on the branch and on main. Resolve them with resolutions, keyed by entity, choosing ours (the main side), theirs (the branch side), base, or an explicit value, and open again:

curl -X POST "https://api.hilus.ai/Platform/entities/changesets" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from_branch": "feature/new-hours",
  "to_branch": "main",
  "description": "Saturday hours",
  "resolutions": {
    "Agent/agt_123": {
      "/initial_message": "theirs"
    }
  }
}'

Review a changeset

Open changesets are the reviewer's inbox:

curl -X GET "https://api.hilus.ai/Platform/entities/changesets?status=open&to_branch=main" \
  -H "Authorization: Bearer $HILUS_API_KEY"

changeset_get shows one changeset in full: the frozen per-entity diffs, the evidence as references to real lab runs, and the timeline of the review conversation.

curl -X GET "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b" \
  -H "Authorization: Bearer $HILUS_API_KEY"

changeset_review records a verdict. approve unlocks the merge; request_changes blocks it, and its comment is what the author reads to continue; comment only adds to the timeline, which is also how more evidence is attached mid-review.

curl -X POST "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b/review" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "verdict": "request_changes",
  "comment": "The greeting should also mention Sunday closure."
}'
curl -X POST "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b/review" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "verdict": "approve",
  "comment": "Checked the diff and the simulation."
}'

Who may approve: into a protected main, anyone holding the approve-changesets permission (organization admins hold it implicitly), and the author may approve their own changeset. Protection blocks direct writes to main; it does not require a second person. auto_approve on open applies the same rule; when the caller may not approve, the changeset still opens and the response says why in auto_approve_ignored.

Iterate with refresh

After changes are requested, fix the branch and call changeset_refresh. It re-plans the same changeset (same id, same timeline), clears any approval and returns it to open. Attach the new runs as you refresh:

curl -X POST "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b/refresh" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "test_evidence": [
    {
      "tool": "lab simulate",
      "ref_id": "llmreq_8c1d4e",
      "branch": "feature/new-hours",
      "scenario": "Caller asks about Sunday",
      "outcome": "passed"
    }
  ]
}'

Merge

changeset_merge applies exactly the approved plan. It is all or nothing, and it refuses a stale plan: if any member's head moved on the branch or on main since the plan was frozen, or the branch gained or lost entities, it stops and asks for a refresh and a new approval.

curl -X POST "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b/merge" \
  -H "Authorization: Bearer $HILUS_API_KEY"

On success the changeset is merged and the feature branch is deleted (pass keep_branch to keep it); the changeset keeps the plan, the diffs, the evidence and the conversation. If a write fails midway, the changeset is partially_merged and each member records whether it landed; refresh to finish, or revert what was written.

Undo a change

changeset_revert undoes a merged changeset as a new changeset. Entities that existed on main before are restored to their previous commit (a new commit, never a rewrite); entities the merge added are taken off main. It refuses when someone has edited a member since, unless you pass force.

curl -X POST "https://api.hilus.ai/Platform/entities/changesets/cs_3f9e2a7b1c4d5e6f7a8b/revert" \
  -H "Authorization: Bearer $HILUS_API_KEY"

A changeset that should never merge is closed with changeset_abandon.

Read the ledger

Merged changesets into main answer what changed, when, why, how it was tested and who approved it:

curl -X GET "https://api.hilus.ai/Platform/entities/changesets?to_branch=main&status=merged&limit=20" \
  -H "Authorization: Bearer $HILUS_API_KEY"

For one entity, its history shows every commit on main, including the merge commits a changeset wrote.

Promote without review

For low-risk solo work where main is not protected, or for holders of the bypass permission, merge_branch promotes a whole branch in one call. It previews by default: dry_run is true unless you set it false, and the preview is the same computation the real run starts with.

curl -X POST "https://api.hilus.ai/Platform/entities/merge-branch" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from_branch": "feature/new-hours",
  "to_branch": "main",
  "dry_run": true,
  "include_diff": true
}'
curl -X POST "https://api.hilus.ai/Platform/entities/merge-branch" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from_branch": "feature/new-hours",
  "to_branch": "main",
  "dry_run": false,
  "commit_message": "Saturday hours"
}'

The real run is all or nothing unless you pass partial, orders children before the parents that reference them, and is recorded as a merged changeset whose id comes back as changeset_id. For one entity at a time, merge and fast_forward do the same per entity.

[!WARNING] A direct promotion skips review. Use it only where that is the intended process; everyone else opens a changeset.

When a change is not live or was refused

Start from what you observe.

The agent still behaves the old way. The change is probably still on its branch. Real conversations run on main, so an edit on feature/new-hours is invisible to callers until it merges. Check whether the changeset merged (changeset_list with your from_branch), and compare the branch with main using diff_branches. If the changeset is merged and behaviour is still old, render the agent's context on main to see what the model actually receives; the entity you changed may not be the one the agent uses.

A write was refused with "main is protected in this organization". The error (code BRANCH_PROTECTED, status 403) means the target was main, not that the change was wrong. Make the same write on a feature branch and open a changeset. Only holders of the bypass permission write to a protected main directly, and each such write is audited. If the write is data that changes on its own schedule, such as a list a scheduled job recomputes for other agents to read, do not review every update: put it in a document, add the document to the integrations of the agent that recomputes it and of the agents that read it, and promote that setup once. The maintaining agent then rewrites the document with its editing tools on every run, straight on main, and the document's history records each update and when it happened. Background work shows the schedule side.

Approval was refused with "Approving changesets requires the approve_changesets permission". The caller lacks the approve-changesets permission for a changeset into a protected main. Ask an organization admin, or anyone holding that permission, to review it. Feature-branch targets need no permission.

Open returned auto_approve_ignored. The changeset opened and is waiting for review; nothing was lost. An approver approves it as usual.

Merge was refused with "Stale plan; refusing to merge". Something moved after the plan was frozen: a commit on the branch, a commit on main, or an entity added to or removed from the branch. The message lists the drift. Refresh the changeset, check the new diffs, and get it approved again. This is the guard doing its job: what merges is exactly what was reviewed.

Open was refused with "Cannot open changeset" and conflicts. The same thing changed differently on the branch and on main. Read the conflicts in the error, choose a side per path with resolutions, and open again. "has no entity commits to promote" means the branch holds no changes, often because the edits went to another branch name.

Merge was refused because another changeset is mid-execution. Merges into the same branch run one at a time. Retry once the other merge finishes.

Next steps