Open a changeset
POST /Platform/entities/changesets
Open a changeset. A changeset is a change request: this freezes the promote plan for review.
Runs the merge plan (dry-run), freezes membership + per-member head
pairs + diffs + conflict resolutions, and records the changeset in
status open. This is what an autonomous agent calls INSTEAD of
merging: a human reviews (changeset-review), then the merge
executes exactly the approved plan (changeset-merge).
Runtime-only branch entities (including drillable lab simulate
artifacts) are excluded and summarized in the frozen plan.
The whole review workflow, end to end:
-
Work on a feature branch (
entities edit/patch --branch feature/name) and validate there (lab simulate/lab replay). -
Open:
changeset-open --from-branch feature/namewith adescription,origin_ref(conversation/task provenance), andtest_evidencereferencing the lab runs. -
Review: the reviewer's inbox is
changeset-list --status open; the full view (frozen diffs + timeline + evidence) ischangeset-get. Verdicts viachangeset-review:approveunlocks the merge;request_changes+ comment is what the agent reads to continue. -
Iterate: fix the branch, attach fresh test runs, and
changeset-refresh— same changeset id, same conversation; approval is cleared. -
Merge:
changeset-mergeexecutes the frozen, approved plan (staleness-guarded). It deletes the feature branch when empty, or retains it when non-promotable runtime artifacts remain. Undo later withchangeset-revert. -
The ledger:
changeset-list --to-branch mainanswers what changed, when, why, tested how, approved by whom.
Refuses if the plan has conflicts or failures — resolve them (pass
resolutions) and open again. Resolutions are part of what gets
approved: changing them later requires a refresh (approval reset).
Body parameters
from_branch: str. Branch to promote FROM (the feature branch).to_branch: optional str. Branch to promote INTO (defaultmain).description: optional str. Why this change exists (shown in the review inbox).origin_ref: optional str. Provenance — conversation/task id that asked for it.resolutions: optional dict. Frozen conflict resolutions, keyed"EntityType/id"(same shape asmerge-branch).test_evidence: optional List[Any]. Structured test-run references, each{tool: "lab simulate"|"lab replay"|"agent_test"| "simulation_test"|"test_run"|"github_check", ref_id, branch, scenario, outcome}— references to real lab artifacts (forsimulation_testtheref_idis the SimulationTestRun id;test_runa sandboxed test run of the repository;github_checka linked repository's own CI), recorded astest_runevents.auto_approve: optional bool. Immediately approve after opening. Into a protectedmainthis requiresapprove_changesets(orbypass_branch_protection), the same gate aschangeset-review --verdict approve; without it the changeset is opened normally, staysopenand the response carriesauto_approve_ignored(seedocs_api(page='changesets')).
Returns
ChangesetResponse
changeset: dict. changeset_id, from_branch, to_branch, status, description, author, origin_ref, approver, resolutions, plan, code_ranges (one per repository: repo_id, repo_name, base_sha, head_sha, to_sha, merged_sha), created_at, merged_at, members (entity members and, as RepoFile members, the files each code range changes), events, test_evidence.auto_approve_ignored: optional str or null. Why auto_approve was ignored (main is protected and the caller holds no bypass).
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/changesets" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'