| [54941b4] | 1 | FLEXO ID Decision Flowchart
|
|---|
| 2 |
|
|---|
| 3 | We assume:
|
|---|
| 4 |
|
|---|
| 5 | flexo_base_id = logical identity
|
|---|
| 6 |
|
|---|
| 7 | flexo_version = content evolution
|
|---|
| 8 |
|
|---|
| 9 | lifecycle suffix = process state
|
|---|
| 10 |
|
|---|
| 11 | fingerprint = canonical JSON hash
|
|---|
| 12 |
|
|---|
| 13 | STEP 0 — What is happening?
|
|---|
| 14 |
|
|---|
| 15 | You must classify the operation into one of three categories:
|
|---|
| 16 |
|
|---|
| 17 | State transition
|
|---|
| 18 |
|
|---|
| 19 | Content modification
|
|---|
| 20 |
|
|---|
| 21 | Logical duplication / fork
|
|---|
| 22 |
|
|---|
| 23 | Everything falls into one of these.
|
|---|
| 24 |
|
|---|
| 25 | FLOWCHART
|
|---|
| 26 | START
|
|---|
| 27 | |
|
|---|
| 28 | |-- Is this operation creating a new independent lineage?
|
|---|
| 29 | | (copy into new catalog? fork? split ownership?)
|
|---|
| 30 | |
|
|---|
| 31 | |-- YES --> Generate NEW flexo_base_id
|
|---|
| 32 | | flexo_version = 1
|
|---|
| 33 | | lifecycle_state = Draft
|
|---|
| 34 | | origin_flexo_id = previous full ID
|
|---|
| 35 | | END
|
|---|
| 36 | |
|
|---|
| 37 | |-- NO
|
|---|
| 38 | |
|
|---|
| 39 | |-- Is canonical content different from last saved version?
|
|---|
| 40 | | (compare normalized JSON, excluding lifecycle metadata)
|
|---|
| 41 | |
|
|---|
| 42 | |-- YES --> flexo_base_id stays the same
|
|---|
| 43 | | flexo_version = previous_version + 1
|
|---|
| 44 | | lifecycle_state = Draft
|
|---|
| 45 | | END
|
|---|
| 46 | |
|
|---|
| 47 | |-- NO
|
|---|
| 48 | |
|
|---|
| 49 | |-- Is this a lifecycle transition?
|
|---|
| 50 | |
|
|---|
| 51 | |-- YES --> flexo_base_id stays the same
|
|---|
| 52 | | flexo_version stays the same
|
|---|
| 53 | | lifecycle_state changes
|
|---|
| 54 | | END
|
|---|
| 55 | |
|
|---|
| 56 | |-- NO
|
|---|
| 57 | |
|
|---|
| 58 | |-- No ID change required
|
|---|
| 59 | (metadata only, DB-only operation)
|
|---|
| 60 | END
|
|---|
| 61 | Now Let’s Make It Concrete
|
|---|
| 62 | 1️⃣ Logical Duplication (NEW BASE ID)
|
|---|
| 63 |
|
|---|
| 64 | Trigger conditions:
|
|---|
| 65 |
|
|---|
| 66 | Copy question into new catalog (independent evolution)
|
|---|
| 67 |
|
|---|
| 68 | Split catalog into two
|
|---|
| 69 |
|
|---|
| 70 | Fork domain for separate governance
|
|---|
| 71 |
|
|---|
| 72 | “Save as new” intentionally
|
|---|
| 73 |
|
|---|
| 74 | Effect:
|
|---|
| 75 |
|
|---|
| 76 | new_base_id = generate()
|
|---|
| 77 | version = 1
|
|---|
| 78 | state = Draft
|
|---|
| 79 | origin_flexo_id = previous full ID
|
|---|
| 80 |
|
|---|
| 81 | Strict rule:
|
|---|
| 82 |
|
|---|
| 83 | If future changes must not affect original lineage → new base ID.
|
|---|
| 84 |
|
|---|
| 85 | 2️⃣ Content Modification (VERSION BUMP)
|
|---|
| 86 |
|
|---|
| 87 | Trigger:
|
|---|
| 88 |
|
|---|
| 89 | Canonical JSON changed (after normalization).
|
|---|
| 90 |
|
|---|
| 91 | Examples:
|
|---|
| 92 |
|
|---|
| 93 | Question text edited
|
|---|
| 94 |
|
|---|
| 95 | Options reordered (if order matters)
|
|---|
| 96 |
|
|---|
| 97 | Points changed
|
|---|
| 98 |
|
|---|
| 99 | Domain description changed
|
|---|
| 100 |
|
|---|
| 101 | Exam layout changed
|
|---|
| 102 |
|
|---|
| 103 | Embedded question snapshot changed
|
|---|
| 104 |
|
|---|
| 105 | Effect:
|
|---|
| 106 |
|
|---|
| 107 | base_id unchanged
|
|---|
| 108 | version += 1
|
|---|
| 109 | state = Draft
|
|---|
| 110 |
|
|---|
| 111 | Strict rule:
|
|---|
| 112 |
|
|---|
| 113 | If fingerprint changes → version bump.
|
|---|
| 114 |
|
|---|
| 115 | No exceptions.
|
|---|
| 116 |
|
|---|
| 117 | 3️⃣ Lifecycle Transition (STATE ONLY)
|
|---|
| 118 |
|
|---|
| 119 | Trigger:
|
|---|
| 120 |
|
|---|
| 121 | Draft → Approved
|
|---|
| 122 |
|
|---|
| 123 | Approved → Signed
|
|---|
| 124 |
|
|---|
| 125 | Signed → Published
|
|---|
| 126 |
|
|---|
| 127 | Published → Obsolete
|
|---|
| 128 |
|
|---|
| 129 | Effect:
|
|---|
| 130 |
|
|---|
| 131 | base_id unchanged
|
|---|
| 132 | version unchanged
|
|---|
| 133 | state changes
|
|---|
| 134 |
|
|---|
| 135 | Strict rule:
|
|---|
| 136 |
|
|---|
| 137 | Lifecycle does not alter content version.
|
|---|
| 138 |
|
|---|
| 139 | Edge Case Handling
|
|---|
| 140 | Approved entity edited
|
|---|
| 141 |
|
|---|
| 142 | Flow:
|
|---|
| 143 |
|
|---|
| 144 | Content change detected
|
|---|
| 145 |
|
|---|
| 146 | Version bump
|
|---|
| 147 |
|
|---|
| 148 | State automatically reset to Draft
|
|---|
| 149 |
|
|---|
| 150 | So:
|
|---|
| 151 |
|
|---|
| 152 | BASE@001P → edit → BASE@002D
|
|---|
| 153 |
|
|---|
| 154 | Clean and auditable.
|
|---|
| 155 |
|
|---|
| 156 | Draft → Approved where draft ID is “temporary”
|
|---|
| 157 |
|
|---|
| 158 | Your earlier idea suggested generating new ID at approval.
|
|---|
| 159 |
|
|---|
| 160 | Under strict logic:
|
|---|
| 161 |
|
|---|
| 162 | That is unnecessary and breaks lineage.
|
|---|
| 163 |
|
|---|
| 164 | Instead:
|
|---|
| 165 |
|
|---|
| 166 | BASE@001D → BASE@001A
|
|---|
| 167 |
|
|---|
| 168 | Same logical identity.
|
|---|
| 169 |
|
|---|
| 170 | If you must isolate drafts operationally:
|
|---|
| 171 | Use different database tiers, not different IDs.
|
|---|
| 172 |
|
|---|
| 173 | * Decision Matrix Summary
|
|---|
| 174 |
|
|---|
| 175 | | Operation | New Base ID | Version++ | State Change |
|
|---|
| 176 | |-------------------------+-------------+------------+--------------|
|
|---|
| 177 | | Copy/fork | | reset to 1 | Draft |
|
|---|
| 178 | | Content edit | | | Draft |
|
|---|
| 179 | | State promotion | No | No | Yes |
|
|---|
| 180 | | Metadata-only DB change | | | |
|
|---|
| 181 |
|
|---|
| 182 | One Important Constraint
|
|---|
| 183 |
|
|---|
| 184 | Fingerprint must exclude:
|
|---|
| 185 |
|
|---|
| 186 | - lifecycle_state
|
|---|
| 187 | - owner_id
|
|---|
| 188 | - DB storage metadata
|
|---|
| 189 |
|
|---|
| 190 | Otherwise state transitions would falsely trigger version bump.
|
|---|
| 191 |
|
|---|
| 192 | Fingerprint must represent semantic content only !!!
|
|---|
| 193 |
|
|---|
| 194 | Final Integrity Principle
|
|---|
| 195 |
|
|---|
| 196 | There must never exist:
|
|---|
| 197 |
|
|---|
| 198 | - two different canonical JSONs with same base ID + version
|
|---|
| 199 | - two identical canonical JSONs with different base ID (unless forked intentionally)
|
|---|
| 200 |
|
|---|
| 201 | If those invariants hold, your identity system is mathematically clean.
|
|---|