feat(cd): add changeWindow subject and events - #324
Open
sol-duara wants to merge 1 commit into
Open
Conversation
A changeWindow is a bounded interval during which changes to a target are governed by a window policy. The window is the gate: these events report that a gate exists, when it is in force, and when it stops being in force. Window-governed change control is common and has no representation in the vocabulary. environment.modified says a mutation happened; it cannot say whether that mutation was permitted or whether a restriction was violated, and those are different audit facts. A window is either permissive, where changes are allowed only inside it, or restrictive, where changes are forbidden inside it. windowType carries which, and the audit reading of every event on this subject depends on it, so it is present on all of them. Arriving at the gate is a separate occurrence from the gate existing. access reports a change presented to the window and the result, carrying the same status values as the approval subject's closed event so consumers handle both alike. breached is not an access result: it reports a change that took effect without passing the gate at all. Seven predicates: created, opened, access, breached, modified, revoked and closed. modified carries the window's complete resulting state rather than a description of what moved, so a consumer is not left to diff two events. revoked and closed together account for the window ceasing to exist, so there is no separate deletion predicate. Event versions start at 0.1.0-draft. Signed-off-by: Dadisi Sanyika <dadisi@solduara.com>
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.
Changes
Adds a
changeWindowsubject to the Continuous Deployment vocabulary, withcreated,opened,access,breached,modified,revokedandclosedpredicates.A
changeWindowis a bounded interval during which changes to a target are governed by a window policy. The window is the gate: these events report that a gate exists, when it is in force, and when it stops being in force.Why a new subject
Window-governed change control is common and has no representation in the vocabulary. Organizations restrict when production may be touched, then need to demonstrate afterward that the restriction held.
environment.modifiedsays a mutation happened. It cannot say whether that mutation was permitted, or whether a restriction was violated. Those are different audit facts, and the difference between them is the entire point of having windows at all.Polarity
A window is either permissive — changes are allowed only inside it, as with a maintenance or deployment window — or restrictive, where changes are forbidden inside it, as with a freeze.
windowTypecarries which. An earlier draft enumeratedmaintenance,deployment,freezeandemergency, and that was reduced deliberately: those name why a window was created, and a motive does not change what a window does. An emergency window still grants passage, and calling it an emergency tells a consumer nothing it can route on. What varies between windows is polarity, so that is whatwindowTypecarries; the motive belongs inreason.Because the audit reading of every event on this subject depends on polarity,
windowTypeis present on all of them.The gate and the passage are separate occurrences
This is the main structural decision in the proposal.
The window existing is one fact. A change arriving at the window and being let through, or not, is a different fact — and conflating them into a single event would make the subject describe two unrelated things.
accessreports a change presented to the window and the result.statuscarries that result, using the same values as theapprovalsubject'sclosedevent —approved,rejected,cancelled,expired— so a consumer handling authorization results handles both alike.breachedis deliberately not an access result. It reports a change that took effect without passing the gate at all: nothing was presented and nothing was decided. Which changes constitute a breach depends on polarity — a change outside apermissivewindow is a breach, and a change inside arestrictivewindow is a breach.An earlier shape had three separate predicates for passage, blocking and violation. Modelling the first two as one
accesspredicate with a status enum follows the precedent already set byapproval, which represents rejection as astatusvalue rather than as a distinct event type.How this relates to
approvalThe two compose rather than compete.
approvalcovers an accountable authorization decision made by a responder whose decision could have gone differently. A change window is not that: it is a standing temporal condition, decided once when the window is created and thereafter true or false as a function of the clock. No responder decides per change.A change may require both an approval and an open window, and each is its own occurrence. Reusing
approval'sstatusvalues onaccessis what keeps them consistent for consumers without merging the two concepts.Design decisions
createdand the operational lifecycle are both present, and that is intentional. Bringing a window into existence is an action someone performed at a time, with bounds they chose, and it is the receipt an auditor asks for first. It is separate from the window later becoming active, which is whatopenedreports.modifiedcarries the window's complete resulting state — the resultingnotBefore,notAfter,windowTypeandtarget— rather than a list of what moved. A consumer reading a singlemodifiedevent knows the window's current bounds without holding an earlier event to compare against. A field list would tell a consumer what changed but still require the earlier event to know what it changed to.There is no
deletedpredicate.revokedandclosedalready account for a window ceasing to exist, and each says something a generic deletion would not: whether an actor cut the window short, or whether it simply ran out. A third terminal predicate would give producers two ways to report the same ending.targetcarries atypealongsideidandsource, so consumers can route on the kind of resource governed, and so target references are shaped consistently across subjects.typeis a free string —environment,cluster,service— rather than a closed enum.changeis reused unchanged from the existingchangesubject. No new common objects are introduced.Out of scope
approvalcovers accountable authorization decisions; see above for how a window differs.Notes on this change
Event versions start at
0.1.0-draft.schemas/_defs/entries andx-cdevents-semanticsare not included here. The predicate definitions this subject would need overlap with those already being added by #319 and with further subjects we are proposing; adding them here would collide. We will follow up with them once #319 lands.Separately, and not addressed by this PR: the
approvalsubject has schemas underschemas/but no vocabulary documentation in any of the stage.mdfiles, so there is no anchor to link to. This PR names it in prose rather than linking. Happy to open a separate issue for that if useful.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
approval's status values0.1.0-draft; the spec version is unchanged