Files
archie/prompts/organisation-automation/03-organisation-ownership.md
T
2026-11-17 17:53:58 +11:00

3.1 KiB

Migrate automation resources to organisation ownership

Read 00-start-here.md and GUIDELINES.md. Work against archie-core-3z4fd.8. Read prior identity/connection changes before deciding what remains; do not duplicate their resources or migrations.

Outcome

Every automation resource resolves within its owning organisation and every instance resource remains an explicitly administered infrastructure capability. Existing settings retain their values, ownership and effective access.

Required scope

Inspect the control plane's instanceOnlyKinds, runtime layering, org model policy, provider/model selection, workflow definitions/enablement, schedules, channel settings, event sources/bindings, execution profiles and task/container policies. Inspect all runtime consumers and authorization paths before changing scope. Use the ownership table in 00-start-here.md as the approved target. Do not mechanically remove kinds from instanceOnlyKinds and declare completion.

Rules and implementation requirements

  1. Resolve organisational resources from the task/request's authoritative org context. Do not trust a submitted org field, retain a root context by accident, or query a different service's tables.
  2. Preserve the distinction between installed instance capability, organisation configuration and organisation permission to use shared infrastructure. Existing org model policy must remain effective. Instance infrastructure limits remain enforceable even when organisations configure automation.
  3. Keep workspace semantics narrow: group organisation work/resources and inherit organisation permission initially. Do not invent a second workspace policy system or weaken existing explicit restrictions.
  4. Establish deterministic ownership for existing records before migration. Preserve valid instance defaults only where the model explicitly allows inherited infrastructure defaults. Do not copy secrets or permissions into every tenant. Ambiguous ownership must be visible, never guessed.
  5. Make migrations safe to resume and maintain atomicity where records must agree. An interrupted migration must not silently lose settings or broaden access. Regenerate affected contracts and update every reader/writer/fixture.
  6. Saved org settings need functioning runtime consumers, apply status and dependency failure handling. Watches/caches must be keyed by organisation as well as resource/revision wherever shared processes consume multiple tenants.
  7. Remove superseded global paths after callers and data move. Do not maintain two independent sources of truth. Preserve accepted work while peers restart.

Acceptance evidence

Demonstrate two organisations with distinct effective resources using actual service/API paths. Verify configuration changes and restarts retain separation, and that requests/tasks cannot read or use another org's configuration. Verify migration of representative existing configuration without widened permissions, including interrupted/repeated migration semantics where applicable. Follow AGENTS.md for SQL/security regression tests and run the final project gate.