Gravity Keep

02 · Commit

Edit a candidate. Check it. Commit it. Take it back.

Every change, by a person, a pipeline, or the control plane itself, is a commit: atomic in the tree, checked before it lands, numbered, attributed, and kept forever. AWS is then brought into line, and the record proves what was done.

Two things, kept apart

A commit is a promise. Convergence is the proof.

On a router a commit is close to instant. AWS isn't: a database takes minutes, a request can fail halfway through, and anyone with console access can change things behind your back. So Gravity Keep separates what a router treats as one.

The commit is atomic: the active configuration moves to the next version in one transaction, or not at all. Convergence is eventual: AWS is made to match, resource by resource, and each outcome is recorded. Orbit covers convergence.

Say it, do it, prove it. Commit check says what will happen. Convergence does it. The record proves it.

The candidate

Private by default, and it outlives your laptop.

A session edits its own candidate: the active configuration as of a base commit, plus its changes. Others can't see it. configure exclusive also locks a subtree. A candidate is stored by the control plane, so a dropped connection loses nothing.

Conflicts are found, never overwritten. If a newer commit changed something you also changed, commit stops and names it; update brings the newer commit in, and you resolve the rest.

Commit check

Everything a commit would verify, in order.

  1. Syntax and schema, from the type's registry schema.
  2. Tree: names, placement, template versions and parameters.
  3. Resolution: every value resolved, every guardrail held.
  4. References: all resolve, and no cycles.
  5. Authority: who may commit here, and the review this needs.
  6. Plan: the difference from what AWS holds now.

Reach

Review follows what a commit changes, not where it was typed.

A default changed at /tidewater changes every log group in production. So a commit needs the review and confirmation of every namespace whose resolved configuration it changes, and the plan opens with its reach, counted by environment. A change high in the tree can't look like a small one.

Destructive lines come first and need an acknowledgment whose count matches the plan: commit acknowledge destructive 1. A pipeline passes the count it expects, usually zero.

alee@tidewater# commit check
configuration check succeeds
reach    /tidewater defaults logs.log-group retention-in-days 400 -> 731
         affects 201 resources: dev 49, staging 58, production 94
review   required: reaches /tidewater/lending/prod,
         /tidewater/payments/prod, /tidewater/support/prod
plan against observed state as of 2026-12-02 10:02:18:
  update 201   logs.log-group/*   (retention-in-days)
  replace  0
  delete   0
alee@tidewater# commit request comment "Two-year log retention (AUD-77)"
commit request 23 created (base COMMIT-62)

Commit confirmed

The change that would lock you out reverts itself.

A WAF rule that blocks the office, a security group that drops the bastion: the people who would fix it can no longer reach it. commit confirmed 10 commits as usual and starts a timer when convergence finishes. Confirm within ten minutes, or the control plane commits the previous configuration for you.

Policy can make it automatic: commit confirmed required [ ec2.security-group wafv2.ip-set iam.role ] minutes 10 turns any session commit or commit request that touches those types into a confirmed one. It refuses destructive changes, because a deleted database can't be put back by recommitting.

A timeline: commit, convergence, a ten-minute confirmation window. Confirmed, the change stays; not confirmed, a revert commit restores the previous configuration. COMMIT-2015:10:59 CONVERGING 10 MINUTES TO CONFIRM · THE TIMER STARTS WHEN AWS IS DONE CONFIRMED: STAYS COMMIT-21: REVERT the office is blocked; nobody needs console access or a second person to get it back
From session 5: a mistyped office address range on the shared WAF, reverted eleven minutes later because nobody confirmed it.

Going back

A rollback is a new commit.

rollback 3 puts an earlier configuration in your candidate; you review it and commit, so history stays a straight line. It restores configuration, never data, and the plan says so for every stateful resource. A resource that was retained when it left the tree is re-adopted, not recreated.

request revert commit 47 is the fast way back for on-call: it commits the configuration from before one commit, at once, for anyone granted revert. It needs no second person, because what it restores was already reviewed, and it raises an alarm like a hold.

sam@tidewater> request revert commit 47
COMMIT-47  lending 2.4.2 infrastructure (PR #224)
plan:
  update   1   .../ec2.security-group/intake-lambda  (egress)
revert complete: COMMIT-48 (by request of sam)
COMMIT-48 converged (1 resource, 4s)
Git: reverted on main as 61d0a9e
notified: lending-team, platform-engineers, #incidents

Review and Git

Two routes into a reviewed namespace.

Production namespaces are reviewed by default. A change gets in by one of two routes, and both end in the same kind of commit, with the route recorded.

From its Git source

The branch requires a reviewed pull request. The application's pipeline runs load source at the merged commit and commits. Loads only move forward: a re-run of an old pipeline can't load a commit that the last load has already passed.

Git changes are never confirmed by a timer, because nobody is at a terminal when a merged pull request converges. The pull request confirms the intent; a bad change is undone with request revert, whose revert commit is the control plane's one write to Git.

By a second person

In a namespace sourced in the control plane, commit request freezes the difference. Someone else with approve sees the same difference and a fresh plan, and the request becomes a commit. The author can never approve their own.

Whichever route, every commit's resolved configuration is copied to a store outside the control plane within minutes: Git by default, or a locked S3 bucket.

$ gkeep tidewater load source /tidewater/lending/prod at 4b07d1a
error: 4b07d1a does not descend from 9f3c2e1, the last commit loaded (CTL-053)
  loading it would undo PR #218; nothing changed

Who commits

Exactly one author, always.

AuthorHowFor example
A personSigns in with a passkey, opens a session, commits or requestsDevelopment changes; approvals; emergencies
A pipelineIts execution role calls the same API, loads its namespace's Git source, commitsProduction changes with an application release
The control planeItself, always naming on whose behalfAutomatic and requested reverts, learning, adoption

Gravity Keep doesn't check Gravity Standard development permits. A company that uses them checks them in the pipeline before it commits, where the Standard puts them.

The rules

Candidates, commits, sources, governance, history.

Candidate and commit

  1. CTL-021

    When a newer commit changed a statement the candidate also changed, commit stops and names the conflict, and nothing is overwritten.

  2. CTL-022

    A commit runs every step of commit check, and a configuration that fails any step is never committed.

  3. CTL-023

    The active configuration changes only by commit.

  4. CTL-024

    A commit is atomic, numbered, and immutable, and records its author, method, comment, base, source, difference, and check result.

  5. CTL-027

    A commit from a session or a commit request is made as commit confirmed when the person asks for it or when policy requires it for a type in its plan, and if it is not confirmed before its timer ends, or its convergence fails, it is reverted by a new commit that restores the previous configuration. A load from a Git source is never made as commit confirmed.

  6. CTL-028

    A destructive change is committed only with an acknowledgment whose count matches the plan, and never under commit confirmed.

  7. CTL-058

    request revert restores the configuration from before one commit beneath the paths it changed, is refused if a later commit changed those paths, is granted to directory groups as revert, and raises an alarm.

  8. CTL-074

    Deleting or replacing a resource is destructive when its type is stateful or identity-bearing in the type table; an identity-bearing type is one whose identity others hold and recreating can't restore.

Sources

  1. CTL-050

    Every namespace has exactly one source, the control plane or one file on one branch of one Git repository, and a source covers the namespace's whole subtree.

  2. CTL-051

    A namespace's source is declared by its parent, and a Git source file can't contain a source statement.

  3. CTL-052

    Beneath a Git-sourced namespace the configuration changes only by loading its declared file at a commit on its declared branch; session edits, other loads, commit requests, rollback, eviction by command, and ownership learning are refused.

  4. CTL-053

    A Git source is loaded only at a commit that is on its declared branch and descends from the last commit the control plane loaded from it or wrote to it.

  5. CTL-054

    The control plane writes to a Git source only to record a revert made by request revert; if that write fails, the namespace is out of step and its next load must be made by a person who acknowledges it.

  6. CTL-055

    Declaring or removing a source is a commit at the parent; declaring a Git source is refused unless the file resolves to the namespace's active configuration, and removing one raises an alarm.

  7. CTL-056

    Every commit's resolved configuration is written to a store outside the control plane, and a file written there is never loaded as a source.

  8. CTL-057

    The control plane's own namespace, which holds the pipeline roles and everything the Git route depends on, is always sourced in the control plane.

Access and governance

  1. CTL-036

    Who may view, edit, commit, approve, adopt, hold, and revert beneath a namespace is granted to directory groups, never to named people, and is enforced by Verified Permissions on every API call.

  2. CTL-037

    (retired 2026-11-23) Gravity Keep does not check Gravity Standard development permits. A company that uses permits checks them where the Standard puts them, in the pipeline before it commits.

  3. CTL-038

    A reviewed namespace accepts a commit only from its Git source, recorded by repository and commit, or, when it is sourced in the control plane, from a commit request approved by someone other than its author.

  4. CTL-073

    A commit needs the review and commit confirmed that every namespace whose resolved configuration it changes requires, not only the namespaces it edits; reaching a reviewed namespace from above needs a second person's approval, whatever that namespace's source.

Audit and history

  1. CTL-039

    Every change to the configuration has exactly one author and, when the author acts for someone, names that person.

  2. CTL-040

    Commit history, convergence records, corrections, holds, and adoptions are kept for at least as long as the longest retention any bound application declares, and are never edited.