Skip to content

Latest commit

 

History

History
209 lines (175 loc) · 11 KB

AGENTS.md

File metadata and controls

209 lines (175 loc) · 11 KB

Drycc Workflow — Agent Instructions

Workflow is the open-source integration repository. Read this file before changing cross-component architecture, charts, installation, or integration documentation. Do not describe target designs as already implemented.

Language

All repository-tracked text must be in English: commit messages, code and chart comments, design docs and implementation plans, installer log messages, and PR/issue text. Do not mix languages in tracked files; translate before committing. Conversation with the human partner may use whatever language they prefer.

Project Purpose

Drycc Workflow packages and documents the open-source CaaS platform. Individual components live in sibling repositories; this repository owns their integration chart, installation scripts, cross-repository architecture, and acceptance requirements.

Documentation Ownership

The authoritative global Organization integration documents are:

  • docs/superpowers/specs/2026-11-13-organization-billing-integration-design.md
  • docs/superpowers/plans/2026-11-13-organization-billing-integration.md

Ownership rules:

  1. Workflow owns cross-component designs, implementation plans, deployment wiring, and multi-cluster acceptance.
  2. Component repositories own their internal implementation designs, conventions, and project-specific AGENTS.md files.
  3. Controller owns its durable Usage delivery design in controller/docs/superpowers/specs/2026-11-18-controller-usage-outbox-design.md and its commercial status client design in controller/docs/superpowers/specs/2026-11-18-controller-commercial-status-design.md.
  4. Dashboard owns its closed-source Organization, Payment, Billing, Stripe, and commercial UI implementation design in dashboard/docs/superpowers/specs/2026-11-13-dashboard-payment-design.md, and its clickable commercial UI prototype design in dashboard/docs/superpowers/specs/2026-11-19-dashboard-commercial-ui-prototype-design.md.
  5. Do not keep duplicate copies of global designs in component repositories. Link to the authoritative document instead.
  6. Update the relevant global and component documents when architecture, repository structure, build commands, or integration contracts change.

Subsystem Design Registry

Every authoritative global cross-component design must contain a subsystem registry. The global document retains each subsystem's responsibility summary and links to the single authoritative component design file; it does not copy the component's internal implementation design.

Each registry row records an implementation status:

  • not implemented: the target design has not been implemented;
  • partially implemented: some target scope is implemented, and the notes must identify the remaining scope;
  • implemented: the target scope and its required component and integration verification are complete;
  • no change required: existing component behavior already satisfies the global design, so no separate component design or implementation is needed;
  • deferred: the scope is explicitly outside the current implementation, with a separate design link when one exists.

Status describes implementation, not the existence, approval, or completeness of a design document. The Workflow registry is the authoritative cross-component status index. When a subsystem implementation and its required verification are complete, update its registry status in the same delivery. If the component design also carries a status header, update it at the same time so the two never conflict. Do not mark a design implemented merely because code or a design file exists.

Related Sibling Projects

Read each project's own AGENTS.md before modifying it.

Project Role in the integration
../passport User identity and OAuth/OIDC. It is not a Workspace or Organization authority in this design.
../controller Per-cluster resource plane and authority for local Workspace, members, invitations, and resource authorization.
../controller-sdk-go Go SDK for Controller-compatible APIs and the CLI contract.
../workflow-cli End-user CLI with existing full cluster-scoped Workspace management.
../gateway Gateway API and hostname routing charts.
../dashboard Closed-source commercial control plane; owns Organization, WorkspaceBinding, Payment, Usage, Billing, and commercial UI implementation documents locally.
../manager v1 commercial control plane with existing Cluster registration, current-Cluster UI state, and URL-path Controller proxying. It is a multi-cluster reference, not a Dashboard v2 runtime dependency or billing model.
../builder, ../imagebuilder Source-to-image build components.
../database, ../valkey Persistence and cache infrastructure.
../registry, ../storage Registry and object storage components.
../grafana, ../victoriametrics, ../fluentbit, ../quickwit Metrics, logging, and observability components.

Global Organization Invariants

The target global design requires an explicit architecture review to change:

  • Dashboard Organization is only a commercial billing and resource-grouping entity. It is not an identity, membership, resource-authorization, or global Workspace lifecycle authority.
  • Each Controller remains the authority for its local Workspace, members, invitations, Apps, and resource permissions. Workspace tables are not moved to Passport or Dashboard.
  • Community deployments use Controller + Passport without Dashboard and retain existing Controller-compatible Workspace APIs and full CLI management.
  • Passport is shared by all Clusters. A commercial Controller's WORKFLOW_MANAGER_URL is Cluster-scoped and includes its Cluster ID, for example https://dashboard.example.test/v1/clusters/{cluster_uuid}. The Cluster-scoped route supplies the Cluster context and the shared Passport authenticates the service request. Usage payloads do not add a Cluster field; do not require per-Cluster Passport deployments or OAuth Applications merely to identify the Cluster.
  • One Dashboard Organization can bind multiple cluster-scoped Workspaces. The canonical external Workspace identity is (cluster_uuid, workspace_uuid).
  • A Cluster/Workspace pair has at most one open Organization binding. Binding history and accepted billing attribution are immutable.
  • Controller does not store Organization, Payment, Stripe, or Billing data. Dashboard resolves Usage attribution and Organization billing permissions do not grant Controller resource permissions.
  • Usage retains a stable event ID, Cluster UUID, Workspace UUID, and occurrence time. Dashboard deduplicates delivery and never silently discards unassigned or ambiguous Usage.
  • Organization archival, Workspace unbinding, and local Workspace deletion do not cascade to other Clusters. There is no global Workspace finalizer.
  • Dashboard v2 uses the current Dashboard UI as its product baseline and references Manager v1's existing Cluster registration, persistent current-Cluster UI state, and URL-path Controller proxying for Dashboard Web.
  • workflow-cli and controller-sdk-go connect directly to the selected Controller, not through Dashboard. Existing Controller authentication, resource APIs, WebSockets, and Builder behavior remain unchanged. Dashboard CLI proxying, X-Drycc-Cluster, mandatory CLI Cluster profiles, and a separate CLI builder_url contract are not required by this design.
  • Controller continues calling Dashboard through ManagerAPI for Usage and commercial User/App status. App status includes the Controller-local workspace_uuid so Dashboard can resolve the current WorkspaceBinding and Organization Payment without becoming a resource-permission authority.

Repository Structure

workflow/
  AGENTS.md                  # Integration context and document ownership
  README.md                  # Component index and documentation entry points
  charts/workflow/           # Umbrella Helm chart and component dependencies
  docs/superpowers/
    specs/                   # Global integration architecture
    plans/                   # Cross-repository implementation plans
  _scripts/                  # Repository/release helper scripts
  install.sh                 # Cluster installation; not a test command
  install-cli.sh/.ps1        # CLI installation helpers
  uninstall.sh               # Cluster removal; use only by explicit request

Verification and Development

There is no single root build or unit-test command. Verify the components changed by a task in their own repositories, then perform integration verification here.

Useful non-destructive checks:

bash -n install.sh install-cli.sh uninstall.sh

For chart changes, inspect charts/workflow/Chart.yaml and charts/workflow/values.yaml and run the appropriate Helm rendering/tests with release-provided values. The checked-in {{repository}} dependency placeholders are not a complete standalone release configuration.

Do not run install.sh or uninstall.sh against a real cluster unless the user explicitly requests that deployment operation.

Build and Release

Pushing to GitHub triggers automatic builds via Woodpecker (https://woodpecker.drycc.cc). Every component repository builds and publishes its own chart on push.

The workflow umbrella chart depends on the other component charts (gateway, controller, and so on). Because of that dependency ordering, after pushing a cross-repository change you may need to force a re-run of the workflow Woodpecker job once the other components' builds have completed — otherwise the umbrella chart can be built against stale dependency versions. Wait for the dependency charts to finish building, then re-run the workflow job so it picks up the freshly published dependency charts.

Common Mistakes to Avoid

  • Do not put the global cross-repository plan in Dashboard or another component repository.
  • Do not copy Dashboard's closed-source Organization, Payment, or Stripe implementation into the open-source global spec; retain only the open integration contract.
  • Do not assume Dashboard exists in community deployment or acceptance tests.
  • Do not design Dashboard Web multi-cluster management from scratch without reviewing Manager v1, and do not force workflow-cli or the SDK through that Web proxy. CLI/SDK direct Controller access and existing Builder behavior are intentional, not missing commercial routing work.
  • Do not move Workspace models to Passport or delete Controller Workspace tables under this design.
  • Do not treat Dashboard Organization as a unified member or resource permission authority, and do not synchronize Organization roles to Controller.
  • Do not attribute Usage by Workspace slug or solely by the binding current at delivery time, and do not silently treat unknown Usage as zero.
  • Do not cascade Organization archival or Workspace unbinding into resource deletion.
  • Do not treat installation scripts as harmless test commands.
  • Do not write commit messages, comments, or documentation in a language other than English (see Language above).