Git as the Source of Truth: Publishing Blueprints Through Connections

By Chirag Panchal · Founder & Lead Architect · · 8 min read

How a blueprint drafted in Blueprint Studio, by a person or by AI, reaches your repository as a pull request: Connections that report what a credential can actually do, a reviewed commit on a new branch, a secret check before anything leaves, and a blueprint that becomes Git-backed only after the merge. What the GitHub App can and cannot do, and the limits that remain.

Development Status & Architectural Evolution: InfraOrcinus is in active development. Architecture specifications, internal interfaces, and operational protocols described herein reflect our current engineering design and are continuously refined to make InfraOrcinus robust, resilient, and enterprise-grade.

Buyers of infrastructure tooling expect Git to be the source of truth, and they are right to. Git gives them version history and review, a copy of the code that survives the tool, portability if they ever leave, and their own policy on top: branch protection, required reviewers, CODEOWNERS.

For a long time InfraOrcinus could read from Git and report back to it, but a blueprint drafted in Blueprint Studio, including one drafted by AI, lived only inside the product. That fails every one of those tests. Git write-back closes the gap: a saved blueprint can be published to a repository as a pull request, and your review process applies to it like to any other code.

This feature is off by default. It is switched on with GIT_PUBLISH=true on the server, and this article describes how it works when it is.


1. Connections: What Can This Credential Actually Do?

Credentials for GitHub and Azure DevOps live on a Connections page, separate from the cloud credentials on the Secrets page. A connection is the credential plus what is known about it.

When you press Test connection, the result is not just "OK". It reports capabilities:

  • can it read repositories,
  • can it create repositories,
  • can it push a branch and open a pull request.

"Unknown" is a legitimate answer, because some providers hide token scopes, and the first publish settles it.

GitHub App is the recommended method, because it is not tied to one person's account and its access is limited to what it was installed for. A personal access token is allowed, with a warning that it is bound to a user. Azure DevOps uses a personal access token today.

An administrator sets publishing defaults per connection: the target organization or project, a repository name template (such as iac-{blueprint}), whether repositories may be created, and which roles may publish. Administrators always can.

Least privilege, per operation

For a GitHub App, InfraOrcinus does not use the installation's full access for every action. It mints a short-lived token limited to what that operation needs: browsing and cloning get read-only tokens, publishing gets contents and pull-request write limited to the one target repository, and the Administration permission is requested only when the connection is allowed to create repositories.

Limits the test now tells you about

The capability check is meant to catch the surprises that otherwise appear halfway through a publish:

  • An app installed on selected repositories only cannot use a repository it creates, because the new repository is not in its list. The check reports "create repositories: no" and the publish is refused before anything is created, instead of leaving an empty repository behind.
  • A fine-grained personal token limited to selected repositories has the same problem but cannot be detected in advance. If it happens, the error says why.
  • In a personal account, GitHub does not let an app create repositories at all. The connection can still publish into repositories that already exist.
  • A repository name that is not the naming template is treated as existing. If it does not exist, you get a clear "not found, only the template name is created automatically" message instead of a surprise.

2. Publishing: Review, Then One Commit

From a saved blueprint, Publish to Git works in two steps.

Review. The screen lists the files that would be published and a digest of the revision. Publishing is refused if the blueprint changed since the review, so what was reviewed is what is sent. It is also refused if any file looks like it holds a credential.

Publish. InfraOrcinus makes one commit on a new branch, named infraorcinus/<blueprint>-<revision>, opens a pull request into the repository's default branch, and records a durable publish job. A retry of the same revision reuses the branch and the review, and editing then publishing again opens a new review on a new branch.

What is published is deliberately narrow: source and documentation for the blueprint's engine only (Terraform and OpenTofu files, Bicep, CloudFormation, Pulumi programs and Pulumi.yaml). State, variable files and Pulumi stack configuration are never published. An optional folder puts the blueprint in a subdirectory, which supports a monorepo.

Nothing is pushed to the default branch, and the running blueprint does not change until the pull request is merged.


3. The Merge Is What Changes the Blueprint

When the pull request merges, the provider's webhook tells InfraOrcinus, and the blueprint becomes Git-backed: it records the merge commit and tracks the repository like any blueprint imported from Git. The inline copy is removed only after the first successful run from Git, so a bad merge cannot strand an environment without source.

For that to work the organization's webhook must be registered. Without it, a published blueprint stays "pull request open" until someone refreshes it by hand.

Once a blueprint is Git-backed, editing it creates a pull request, never a silent change. Review, branch protection and CODEOWNERS apply to the AI's code exactly as to anyone's.

A blueprint can also be moved to a different connection of the same provider, for example when a token is rotated into a new connection. The new connection must exist, be visible in scope, be of the same provider and have a token that resolves, and a blueprint that is not Git-backed cannot be switched.


4. The AI Path

After an AI draft is saved, Studio offers Publish to Git. It is never automatic. In the Operator chat, publishing is one more action that is prepared, reviewed and confirmed by a person in a separate request, as described in the article on the Troubleshooter and Operator, and it ends in a pull request, not a push to the default branch.

Everything is audited: requested, succeeded and failed publishes, and connection changes, with identifiers and outcomes only and no file contents.


5. Limits Today

  • Provider behaviour is covered by automated tests against simulated providers. Live acceptance against real GitHub and Azure DevOps accounts is still in progress, and the provider permissions listed in the setup guide should be verified against the providers' current documentation.
  • A pull request closed without merging is not tracked yet.
  • One review per revision. Publishing again after an edit opens a new review.
  • GitHub Enterprise Server and Azure DevOps Server are not supported. GitLab and Bitbucket are not part of this release.
  • Apply from a pinned ref only is not enforced yet. The model for "apply only from a merged ref" is designed but not complete.
  • Repository settings are out of scope. InfraOrcinus creates repositories but does not manage branch protection, teams or secrets in them. Those remain yours.

Summary

Connections report what a credential can really do, GitHub Apps are narrowed to the least access each operation needs, and a blueprint reaches Git as one reviewed commit on a new branch with a pull request, never a push to the default branch. Files that look like credentials block the publish, state and variables are never sent, and the blueprint becomes Git-backed only after the merge and loses its inline copy only after the first good run from Git.