Module Development
New pt-arche-* modules are created using pt-arche-child-module-template — a skeleton repository paired with a Copilot coding agent that handles the entire creation workflow end-to-end.
The Arche Module Agent
The Arche Module Agent is a GitHub Copilot coding agent that creates new pt-arche-* repositories without requiring any local setup. It validates your identity, collects the module details, opens a PR on pt-logos to register the repo, and scaffolds all files once the repo exists.
How to invoke it
Clone the template repo and run the Copilot CLI from within it — then type /agent and select Arche Module Agent from the menu:
git clone https://github.com/osinfra-io/pt-arche-child-module-template
cd pt-arche-child-module-template
copilot --enable-all-github-mcp-tools
The agent opens pull requests through the GitHub MCP server. Start Copilot CLI with copilot --enable-all-github-mcp-tools so write tools are available.
What it does
-
Validates your identity — confirms your GitHub username maps to an
@osinfra.ioemail and that you are a member of theosinfra-ioorganization -
Collects module details — asks for the GCP or Kubernetes resource the module will manage, suggests a repository name following the
pt-arche-{provider}-{resource}convention, and confirms a description -
Asks about sub-modules — if the module needs a
regional/orzonal/subdirectory structure, it notes this and points topt-arche-google-kubernetes-engineas a reference (sub-module scaffolding is manual) -
Configures feature flags — presents the two Logos configuration flags with sensible defaults
Flag Default Purpose enable_datadog_secretsfalseAdds DD_API_KEY/DD_APP_KEYas repo secrets — enable only when the module's workflows call the Datadog API, such as OpenTofu defining Datadog monitors, dashboards, or syntheticsenable_google_wif_service_accountfalseOIDC Workload Identity Federation for GCP deploys -
Shows a preview — lists exactly what will be created before doing anything; loops back on request
-
Opens a PR on
pt-logos— repositories are created by Logos via OpenTofu, never directly via the GitHub API; the agent opens the registration PR and waits for you to confirm the repo exists -
Scaffolds the module files — once you confirm the repo was created, pushes all skeleton files in a single commit with
MODULE_*placeholders substituted
What gets scaffolded
Every new module starts with this complete file structure:
helpers.tofu # pt-arche-core-helpers pinned to current SHA
locals.tofu
main.tofu
outputs.tofu
providers.tofu
variables.tofu
README.md
SECURITY.md
.gitignore
.pre-commit-config.yaml
static-analysis.datadog.yml
tests/
default.tftest.hcl
fixtures/default/
main.tofu
variables.tofu
.github/
copilot-instructions.md
dependabot.yml
release.yml
workflows/
add-to-projects.yml
dependabot.yml
release.yml
test.yml
The helpers.tofu in the skeleton is pre-pinned to the current pt-arche-core-helpers SHA so the new module starts with an up-to-date foundational dependency.
Optional local integration tests
For complex application configuration changes, developers can choose to exercise Authentik, Istio, and agentgateway together before pushing to sandbox:
/platform-grouping:local-integration-testing
The platform-grouping plugin owns setup, credentials, browser sign-in, verification, and teardown for pt-pneuma/tests/integration/. Fixtures exercise checked-out modules; module repositories keep only mocked OpenTofu tests. This workflow is opt-in, not a mandatory pre-push or CI gate.
The target runtime is a dedicated Docker Desktop Kubernetes cluster using the Kind provisioner. All stack components, including Authentik and PostgreSQL, run in Kubernetes. Setup must reject existing unowned installations rather than overwrite them, and cleanup must not purge shared CRDs. Local PostgreSQL, upstream images, and local TLS replace cloud database, registry, and certificate infrastructure; successful local checks do not validate GCP load balancers, Cloud Armor, Workload Identity, or multi-region behavior.
Full end-to-end verification requires real Google browser sign-in; redirect checks alone are insufficient.
Repository naming convention
| Infrastructure type | Pattern | Example |
|---|---|---|
| GCP resource | pt-arche-google-{resource} | pt-arche-google-cloud-run |
| Kubernetes add-on | pt-arche-kubernetes-{addon} | pt-arche-kubernetes-cert-manager |
| Datadog integration | pt-arche-datadog-{service} | pt-arche-datadog-google-integration |
After creation
Once the scaffold is pushed:
- Add your resource code to
main.tofu,locals.tofu,variables.tofu, andoutputs.tofu - Update
tests/default.tftest.hclwith anymock_resourceoverrides for computed attributes - Tag a
v0.1.0release once the initial code is merged — the release workflow generates notes and publishes automatically
Components
Arche modules follow a two-sided contract between module authors and consumers.
Authors tag releases with semver after merging to main. The release workflow generates notes and publishes automatically:
git tag v1.2.3 && git push origin v1.2.3
Consumers never reference semver tags or branch names as ref values — they always pin to the post-merge commit SHA on main with an inline version comment:
module "google_project" {
source = "github.com/osinfra-io/pt-arche-google-project?ref=<40-char-sha>" # v1.2.3
}
The SHA must come from after the squash merge lands on main, not from the PR branch tip. Branch SHAs are unstable and can be rewritten; main SHAs are permanent.
Releasing the dependency chain
Use the platform-grouping plugin's release skill:
/platform-grouping:release-arche-modules
Release Core Helpers before its dependent Arche modules. Consumer updates are optional: confirm whether to update Corpus, Pneuma, both, or neither before changing their pins to the released post-merge SHAs.
For each confirmed consumer, update every deployment workspace, including regional workspaces and nested add-ons. Edit canonical shared files once so symlinks remain intact.
Core Invariant
Every module ref must point to a post-merge commit SHA on main — never a branch name or semver tag. This makes every deployment reproducible and auditable.