Change Management Policy
| Owner | [Security Owner β to be named: founder/CTO] |
| Approved by | [signatory] |
| Effective date | [set on approval] |
| Review cadence | Annual |
| Version | 0.1 β DRAFT |
| TSC mapping | CC8.1 |
1. Purpose
Section titled β1. PurposeβEnsure that changes to the Ordermatic platform are reviewed, tested, and approved before reaching production, and that the path from code to production is restricted and auditable.
2. Branching & promotion model
Section titled β2. Branching & promotion modelβCode flows in one direction: feature branch β staging β main β production.
- All work happens on a feature branch. Direct commits to
stagingormainare prohibited. - Changes merge into
stagingonly via a pull request that passes the required CI checks (the non-bypassable automated gates). Review follows Β§3 β independent approval when a second engineer is available or the change is high-risk; documented self-review when operating solo. - Production images build from
main.mainis updated only by the automated promotion (.github/workflows/auto-deploy-main.yml), which fast-forwardsmainto a healthy, already-reviewedstagingvia a directgit push(not a PR merge). A human manually triggering that promotion (workflow_dispatch) is the production-release approval. The daily 2 AM cron runs a divergence check only β it never auto-promotes, and there is no automated release PR. .github/workflows/promotion-guard.ymlblocks any branch other thanstaging(or an explicitlyhotfix-labeled PR) from reachingmain.- Branch protection enforces this server-side via two staging rulesets: the
automated gates (required CI checks; no one, including admins, can bypass)
and the review rule (independent approval, admin-bypassable for the solo
path in Β§3), plus restricted push (see
../branch-protection-proposal.md).
3. Required controls on every change
Section titled β3. Required controls on every changeβ- Automated gates (non-bypassable): every change opens a PR and must pass
CodeQL, the supply-chain / dependency audit, tests, and the
Changeset requiredcheck β enforced by thestaging - automated gatesruleset that no one, including admins, can bypass. These are the primary, always-on control (CC8). - Independent human review: at least one approving review is required on
stagingwhenever a second engineer is available, and is mandatory for higher-risk changes (customer ERP-write paths, authentication, database migrations). When the company is operating with a single developer, the author performs a documented self-review (checklist below) and may merge once the automated gates pass; that merge-without-second-review is recorded by GitHub (ruleset bypass log) as the defined solo-developer exception, with the separate manual production promotion (Β§2) as the compensating checkpoint. Independent review resumes automatically as the team grows (βFormal Code Review Processβ). - Conventional commits:
feat:,fix:,docs:,chore:, etc. - Database changes: schema migrations are generated by Drizzle from
packages/db/src/schema/*.ts. Hand-written SQL migrations are prohibited. - ERP writes: any change that writes to a customer ERP is gated behind a feature flag.
- Shared data tables: writes to bronze Iceberg tables are append/merge-only
(
resolve_iceberg_write_disposition);replaceis prohibited (it would wipe other tenants).
Solo-developer self-review checklist (the author confirms before merging, when no independent reviewer is available): the diff does only what the PR describes; CI is green and tests cover the change; no secrets or credentials are added; any ERP-write / auth / migration change is flagged and double-checked; the changeset states the user-facing impact.
4. Emergency / hotfix changes
Section titled β4. Emergency / hotfix changesβProduction hotfixes follow the documented break-glass path (docs/branching.md):
a hotfix-labeled PR may target main directly; it still requires review and
is reconciled back into staging afterward so history does not diverge.
5. Separation of duties
Section titled β5. Separation of dutiesβAuthoring and releasing are separated. A change is written and merged to
staging, but reaching production requires a separate, manual promotion
(Β§2) β a deliberate second checkpoint distinct from writing the code. With a
second engineer, independent review adds approver-vs-author separation; operating
solo, separation is provided by the non-bypassable automated gates plus the
distinct promotion step β the author cannot both write code and silently ship
it to production without passing those gates and taking that deliberate release
action.
6. Review
Section titled β6. ReviewβReviewed at least annually by the Security Owner.