Repository navigation
[M2.3c3b2] Create and update organizations with atomic ownership and auditing - #86
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3c3b1-account-mutation-authority
branch
from
November 5, 2026 12:48
2c74fad to
f7d7a56
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3c3b1-account-mutation-authority
to
main
November 5, 2026 12:48
samuelmbabhazi
force-pushed
the
feat/m2.3c3b2-organization-commands
branch
from
November 5, 2026 12:48
e92e7fc to
80420d3
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
## Task M2.3c3c1, stacked on #86. Review in stack order; do not merge automatically. ## What changed and why Add project and environment creation/settings commands with live tenant authorization under the caller's account lock. New resources default to pull-request writes, protected environments and no failover. Settings replacement accepts only normalized fields and preserves resource ownership. Resource writes and their audits commit or roll back together. Project slugs are unique within an organization and environment names within a project. Concurrent collisions and conflicting renames return fixed resource-name errors. Environment-only administrators cannot change their parent project or create sibling environments. No resource deletion or HTTP endpoint is exposed in this slice; catalogs and HTTP wiring follow in M2.3c3c2/d. ## How it was tested - Ten restricted-PostgreSQL tests pass: all five roles plus outsiders, safe defaults, ownership injection, incorrect ancestry, environment-only administration, concurrent duplicate creation by two administrators, rename conflicts and audit rollback for all four commands. - New application commands have 100% statement, branch and function coverage. - API lint, typecheck, all 103 unit tests and production build pass. - The full 154-test integration suite, web/domain checks, Go tests and buf lint passed on the immediately preceding slice. CI runs the expanded full suite and browser acceptance. ## Security considerations Live scope checks precede writes within the same account/tenant transaction. Updates always include organization and parent-project predicates. Audit metadata contains supported settings only. No new dependency, shell invocation or credential exposure. CodeQL remains skipped by repository configuration; enabled security jobs run in CI. ## Checklist - [x] M2.3c3c1 acceptance met; PLAN/SPEC updated - [x] Relevant tests, lint, types and build pass - [x] Malformed input, cross-tenant access and concurrent collisions covered - [x] Every new mutation emits an atomic audit event - [x] No secrets or generated files edited manually
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
M2.3c3b2, stacked on #85. Review in order; no automatic merge.
What changed and why
Creating an organization now requires fresh password/configured MFA proof and commits its initial owner membership, ownership audit and security-version/session rotation together. Live owners/admins can update organization settings; removed memberships, outsiders and stale sessions fail closed. Globally occupied slugs return a fixed conflict without disclosing tenant metadata.
Preserve translated domain errors when a failed SQL statement also prevents transaction-context cleanup. This keeps a rename collision a stable conflict while rolling back its writes. Successful operations still fail if context cleanup fails.
These are application commands. Protected HTTP routes and the administration UI follow in M2.3d/f; no destructive resource endpoint is introduced.
How it was tested
Security considerations
Account locks serialize mutations against identity changes. Ownership cannot be supplied through input. Row isolation and explicit tenant predicates protect the commands. Audit or rotation failure rolls back all related state. No new dependency, shell invocation or secret exposure path. CodeQL remains skipped by repository configuration; enabled security checks run in CI.
Checklist