Context
A ct workspace may contain multiple independently managed processes. A process is identified by its root ct.config.ts. Today, each process also carries its own ct.envs.json, which defines the ChurchTools instances on which that process runs.
This is simple and keeps a process self-contained, but it duplicates host, protection, credential-reference and host-wide metadata when several processes target the same ChurchTools instances. It also leaves the relationship between a workspace-wide environment and process-specific state implicit.
This issue is a design discussion only. It does not request an immediate implementation, migration, or change to the current branches.
Candidate domain model
Model the workspace as containing shared environment identities and portable processes:
Workspace
├── Environments
└── Processes
└── environment-specific process state
- A workspace is the local coordination scope.
- A process is one portable lifecycle boundary rooted at
ct.config.ts.
- An environment identifies a ChurchTools target instance, including its host and protection policy.
- A process explicitly selects the subset of workspace environments it targets.
- State is process-specific and environment-qualified. It belongs in the process directory rather than in a central environment-owned
installations/ tree.
The process/environment relationship does not need to become a new first-class object named "installation" in the filesystem or user-facing terminology. Prefer language such as "process state for environment prod" unless implementation requirements demonstrate that a separate installation entity is necessary.
For example, ojbp may target test and prod, while another process targets only prod.
Data ownership and proposed layout direction
Workspace-environment data is shared by every process targeting that ChurchTools host:
- host URL;
- protection policy;
- credential/token reference, never the credential itself;
- host-wide permission catalog and similar host metadata.
Process-specific data remains below the process:
- desired configuration and blueprints;
- state;
- reports;
- backups;
- captured process-specific reference material.
Illustrative only:
workspace/
├── ct.envs.json
├── environments/
│ ├── prod/
│ │ └── permission-catalog.json
│ └── test/
│ └── permission-catalog.json
└── processes/
└── ojbp/
├── ct.config.ts
├── blueprint/
├── state/
│ ├── prod/
│ └── test/
├── reports/
│ ├── prod/
│ └── test/
└── backups/
├── prod/
└── test/
This layout is not yet a schema decision. It records the ownership boundary: shared host data belongs to the workspace environment; process lifecycle data stays with the process.
Why consider workspace-wide environments
- One environment name has one unambiguous ChurchTools host throughout the workspace.
- Host, protection and token-reference configuration is not repeated by every process.
- A host-wide permission catalog is captured once rather than copied into each process.
- Cross-process ownership checks can compare process states on the same host reliably.
- REST and UI clients can expose either
Workspace → Process → Environment or Workspace → Environment → Process as projections of the same model.
- Keeping state below the process preserves its lifecycle boundary and avoids turning the environment into an owner of process-specific artifacts.
Important trade-off
Process-local ct.envs.json currently makes a process independently executable and portable. Moving shared environment definitions to a workspace manifest could make a process unusable outside its original workspace unless standalone behavior, inheritance, export or an explicit override is defined deliberately.
Alternatives
1. Keep process-local environments
Each process continues to own ct.envs.json. This preserves current standalone behavior but accepts duplicated target configuration and requires ownership analysis to reconcile independently declared hosts.
2. Move environments and all associated data to the workspace
A workspace environment owns both shared host metadata and every process's state, reports and backups. This centralizes the environment-first projection but breaks the process ownership boundary and is not the preferred direction.
3. Workspace environment catalog with process-local environment bindings
The workspace owns shared environment definitions and host-wide metadata. Each process selects its target environments and retains its environment-qualified state, reports and backups locally. A defined compatibility mechanism preserves standalone process use.
This is the preferred direction for discussion, not yet an implementation decision.
Relationship to existing issues
Decisions required
This design issue is complete when we have agreed on:
- ownership, filename and schema of the workspace environment catalog;
- how a process selects the workspace environments it targets;
- which metadata is host-wide and which remains process-specific;
- the location and stable identity of process state for one environment;
- whether any first-class installation object is necessary, rather than assumed;
- behavior when a process is copied or run outside its original workspace;
- compatibility and migration for existing process-local
ct.envs.json files and .ct/permission-catalog.<host>.json captures;
- effects on CLI commands, REST/OpenAPI routes, the ChurchTools Extension and ownership analysis.
Non-goals
Sequencing: consolidate repository tools only after #166 and #168
Consumer repositories may currently carry local helpers for repository validation and plan-report rendering. Do not migrate or remove those tools while the environment owner and state layout are still unresolved: a validator implemented against the interim layout would immediately encode assumptions that #166 and #168 are intended to decide.
After both #166 and #168 have been implemented:
- provide canonical ct-cli validation for the resulting workspace, environment and process-state layout;
- define validation as an application operation and project it consistently through CLI and REST/OpenAPI rather than maintaining a repository-specific script;
- include detection of unregistered fallback states, invalid host/state associations, misplaced generated output and inconsistent environment metadata;
- update
ct init and the authoritative documentation to generate and validate the chosen structure;
- only then remove or replace corresponding local tools and duplicated documentation in consumer process repositories;
- remove legacy local plan renderers only as part of the same cleanup, using ct-cli's canonical Markdown plan projection.
Until then, existing repository tools remain compatibility tooling for the current on-disk model. No transitional directory migration should be introduced merely to modernize those scripts.
Context
A ct workspace may contain multiple independently managed processes. A process is identified by its root
ct.config.ts. Today, each process also carries its ownct.envs.json, which defines the ChurchTools instances on which that process runs.This is simple and keeps a process self-contained, but it duplicates host, protection, credential-reference and host-wide metadata when several processes target the same ChurchTools instances. It also leaves the relationship between a workspace-wide environment and process-specific state implicit.
This issue is a design discussion only. It does not request an immediate implementation, migration, or change to the current branches.
Candidate domain model
Model the workspace as containing shared environment identities and portable processes:
ct.config.ts.installations/tree.The process/environment relationship does not need to become a new first-class object named "installation" in the filesystem or user-facing terminology. Prefer language such as "process state for environment prod" unless implementation requirements demonstrate that a separate installation entity is necessary.
For example,
ojbpmay targettestandprod, while another process targets onlyprod.Data ownership and proposed layout direction
Workspace-environment data is shared by every process targeting that ChurchTools host:
Process-specific data remains below the process:
Illustrative only:
This layout is not yet a schema decision. It records the ownership boundary: shared host data belongs to the workspace environment; process lifecycle data stays with the process.
Why consider workspace-wide environments
Workspace → Process → EnvironmentorWorkspace → Environment → Processas projections of the same model.Important trade-off
Process-local
ct.envs.jsoncurrently makes a process independently executable and portable. Moving shared environment definitions to a workspace manifest could make a process unusable outside its original workspace unless standalone behavior, inheritance, export or an explicit override is defined deliberately.Alternatives
1. Keep process-local environments
Each process continues to own
ct.envs.json. This preserves current standalone behavior but accepts duplicated target configuration and requires ownership analysis to reconcile independently declared hosts.2. Move environments and all associated data to the workspace
A workspace environment owns both shared host metadata and every process's state, reports and backups. This centralizes the environment-first projection but breaks the process ownership boundary and is not the preferred direction.
3. Workspace environment catalog with process-local environment bindings
The workspace owns shared environment definitions and host-wide metadata. Each process selects its target environments and retains its environment-qualified state, reports and backups locally. A defined compatibility mechanism preserves standalone process use.
This is the preferred direction for discussion, not yet an implementation decision.
Relationship to existing issues
ct env add) depends on where the environment catalog ultimately lives and which scope owns mutations to it.Decisions required
This design issue is complete when we have agreed on:
ct.envs.jsonfiles and.ct/permission-catalog.<host>.jsoncaptures;Non-goals
Sequencing: consolidate repository tools only after #166 and #168
Consumer repositories may currently carry local helpers for repository validation and plan-report rendering. Do not migrate or remove those tools while the environment owner and state layout are still unresolved: a validator implemented against the interim layout would immediately encode assumptions that #166 and #168 are intended to decide.
After both #166 and #168 have been implemented:
ct initand the authoritative documentation to generate and validate the chosen structure;Until then, existing repository tools remain compatibility tooling for the current on-disk model. No transitional directory migration should be introduced merely to modernize those scripts.