Explains how runtime job outputs become document-repository changes.
Only the worker's writer (services/orchestrator, ADR-0019) commits to the document repo. Callers (the API, runtime job completion) enqueue a document-write job; the writer handles one write per document repository at a time:
- Resolves the project's repository with role
documentand its server credential; fetches its mirror. - Validates the files: relative paths without
..,., empty or.gitsegments, no symbolic links; at most 500 files, 5 MiB per file, 50 MiB per write. A violation fails the write. - Commits paths matching
autoCommitPathsto the default branch, and the other paths tokintsugi/<agent-or-actor>/<job-id>(the write id when there is no job). A write markedreviewAll(theunderstandstage, whose unit-state proposals are linked to the specifications in the same pull request, ADR-0031) puts every path on the branch, auto-commit paths included. A file markedcreateOnly(the starter structure of a manifest publish) is dropped when the default branch already has it, so a write never replaces a person's document; a write whose files are all there already endsunchanged. - Pushes fast-forward only: on a rejection it fetches, rebases and retries (4 attempts in all); a rebase conflict fails the write. It never force-pushes and refuses any ref other than the default branch and
kintsugi/*. - Opens a pull request from the
kintsugi/*branch with the server's token: GitHub, GitHub Enterprise, GitLab, Gitea and Azure DevOps.plain-gitservers, servers authenticated by SSH key, and Bitbucket (no adapter yet) keep the pushed branch. - Records the outcome in
workflow.document_write:committed,pr-opened,unchanged(the files were already identical) orfailedwith a redacted error (data model). - Watches the review. A write on a
kintsugi/*branch is looked at every minute (pr-opened, orcommittedwith a branch and no pull request) until it ends:mergedwhen its branch commit is part of the default branch, or, for a pull request, when the server reports it merged (squash and rebase merges leave no ancestry in git);closedwhen the server reports it declined or abandoned. A write with no pull request can only be seen asmergedthrough git. A server that cannot be read leaves the write waiting.