WEB / WEB-22.03
Identity’den persistence ve jobs’a
Principal, object policy, business invariant, transaction, cache ve worker effect’i tek note değişiminde bağla.
1. Core · Mekanizma
Hareket olmadan bütün senaryoları oku
Commit ve job
- Owned update niyeti
Duru’nun rename-note/tea intent’i application’a ulaşmıştır: Local draft/revision 1 yerine Tea note istenir. Session lookup, owner policy ve transaction henüz değerlendirilmedi; bu akış yeni HTTP packet veya cookie verification değildir.
- Application intent
- Rename intent application’da
- Session/principal
- Principal henüz yok
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Session principal bağı
Supplied alias lookup active=true ve logical10<20 ile Duru principal’ı verir; gerçek authn cryptography çalışmaz.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Policy ve business rule
Owner Duru ve rename action izin verir; nonempty title ve expected rev1 authoritative transition koşullarıdır.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; old cache rev1 derived
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Pending transaction
SQLite writer note rev2 ve outbox1 hazırlar; independent reader COMMIT öncesi rev1/outbox0 görür.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; old cache rev1 derived
- SQLite/outbox
- Writer pending rev2/outbox1; reader rev1/0
- Worker projection
- Worker henüz yok
- Atomic commit görünür
Selected local COMMIT sonrası independent read note rev2 ile outbox1’i birlikte görür; broker delivery henüz yoktur.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; old cache rev1 derived
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Worker henüz yok
- Derived cache invalid
Commit sonrası own cache key silinir; bu local miss database rollback veya distributed ack değildir.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; cache key miss
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Worker henüz yok
- Worker effect commit
Own finite delivery projection event-id dedupe ile local effect1 commit eder; ack ayrı state olarak pending kalır.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; cache key miss
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Event processed; effect1; ack pending
- Worker ack kaydı
Selected adapter ack’i observed olur; note commit veya client response delivery bu ack’ten üretilmez.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session predicate true
- Policy/business/cache
- Authorized; cache key miss
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Effect1; ack observed; client not shown
Owner policy deny
- Owner policy niyeti
Ordinary note context owner Ekin taşır; requested actor Duru için sadece selected policy sonucu incelenir.
- Application intent
- Rename intent application’da
- Session/principal
- Principal henüz yok
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Principal tanınmış
Valid supplied session Duru principal’ını verir; session validity owner relation’a hak eklemez.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session valid
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Owner bağı izin vermedi
Selected owner policy Duru!=Ekin için denied üretir; bu authn failure veya endpoint bypass fixture değildir.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session valid
- Policy/business/cache
- Owner policy denied; no mutation
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Persistence untouched
Mutation başlamaz; independent note read Local draft/rev1 ve outbox0 kalır.
- Application intent
- Rename intent application’da
- Session/principal
- Duru recognized; session valid
- Policy/business/cache
- Owner policy denied; no mutation
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
Session expired
- Expiry kontrol niyeti
Supplied logical now20 ve expiry20 boundary’si seçilmiştir; gerçek süre veya session token kullanılmaz.
- Application intent
- Rename intent application’da
- Session/principal
- Principal henüz yok
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Session artık geçerli değil
Selected now<expiry predicate false olur; principal yoktur ve policy için verified caller türetilmez.
- Application intent
- Rename intent application’da
- Session/principal
- Expired; no principal
- Policy/business/cache
- Policy/cache bekleniyor
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Policy evaluation durdu
Missing principal mutation gate’i durdurur; unrelated owner relation hakkında yeni claim üretilmez.
- Application intent
- Rename intent application’da
- Session/principal
- Expired; no principal
- Policy/business/cache
- No principal; no mutation
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
- Committed state aynı
Own note rev1/outbox0 kalır; session expiry database rollback operation’ı olmuş sayılmaz.
- Application intent
- Rename intent application’da
- Session/principal
- Expired; no principal
- Policy/business/cache
- No principal; no mutation
- SQLite/outbox
- Committed rev1; outbox0
- Worker projection
- Worker henüz yok
Effect ve ack
- Committed event niyeti
Parent note ve outbox committed kabul edilir; finite worker branch yalnız derived effect ile ack’i inceler.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Worker henüz yok
- İlk delivery işlendi
Event-id marker ve projection update aynı owned SQLite transaction’da effect1 üretir.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Delivery1; effect1 committed
- Ack gözlemi eksik
Ack observed=false supplied’dır; effect zaten committed ve parent note rev2 geri alınmaz.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Effect1 committed; ack not observed
- Aynı event tekrar geldi
Own finite second delivery aynı event-id taşır; real broker redelivery veya attack replay çalışmaz.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Delivery2 same event-id; effect1
- Dedupe scope korundu
Persistent marker ikinci projection effect’ini engeller; selected effect count1 kalır, universal exactly-once değildir.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Delivery2 deduped; effect1
- İkinci ack kaydı
Selected second acknowledgement observed olur; unchanged parent note revision ve client delivery ayrı facts kalır.
- Application intent
- Rename intent application’da
- Session/principal
- Duru verified predicate supplied
- Policy/business/cache
- Cache invalidated
- SQLite/outbox
- Committed rev2/outbox1
- Worker projection
- Attempts2; effect1; ack observed
ROLLER · STATE · VERİ AKIŞI
Principal bilmek ile operation’a izin vermek ayrı
Duru kendi sentetik reading note’unun title’ını Local draft’tan Tea note’a değiştirmek istiyor. Request context’in application’a ulaştığı kabul edilir. sid-demo inert session alias’ıdır; store lookup, verilen active flag ve logical expiry ile principal Duru elde edilir. Örnek gerçek login, cookie parsing veya cryptographic session verification çalıştırmaz. Soru tanınmış context’in sonraki application kararlarında nasıl sınırlandığıdır.
Authentication/session principal’ı tanır; authorization principal’ın seçilen object/action ile ilişkisini değerlendirir. owner=Duru ve action=rename-note business policy koşullarıdır. Authentication bütün notes için write yetkisi vermez. Ekin’in note context’inde Duru tanınır ama owner policy deny verir. Expired session dalında principal oluşturulmaz. Bunlar aynı authentication failure değildir; ikisinde de persistence mutation başlamaz.
Business logic izinli intent’i geçerli state transition’a dönüştürür. Title boş olmayan string olmalı, expected revision authoritative revision ile uyuşmalı ve update hedef satırı değiştirmelidir. Bu koşullar form görünürlüğüne, client cache’e veya edge allow’a bırakılamaz. Request validation ile database constraint/transaction farklı katmanlardır. Router operation’ı seçer, service invariant’ı korur ve store commit boundary’sini yönetir.
Commit, cache invalidation ve job ack zinciri
Cache’de revision 1 için Local draft bulunması database’in hâlâ o state’te olduğunu kanıtlamaz. Cache derived state’tir; note version ve invalidation owner’ı açık olmalıdır. Normal örnekte parameterized UPDATE ile outbox INSERT aynı SQLite transaction içindedir. Bağımsız reader COMMIT öncesi Local draft/revision 1 ve outbox 0; COMMIT sonrası Tea note/revision 2 ve event 1 görür. Bu düzenli yerel observation seçilen atomic boundary’yi gösterir; bütün crash, storage veya replication koşullarını test etmez.
Transactional outbox note commit’i ile ayrı job notification arasındaki boşluğu yönetmek için event intent’ini aynı store transaction’a yazar. Outbox row broker delivery veya consumer completion değildir. Publisher committed intent’i sonra gönderebilir; relay retry duplicate delivery oluşturabilir. Buradaki queue gösterimi aynı process içinde iki ordinary delivery tutar; gerçek RabbitMQ, Kafka veya cloud queue çalıştırılmaz.
Worker projection effect’ini event ID kapsamında idempotent işler. Processed marker ile projection update aynı local transaction içindedir; ack ayrı adapter/transport state’idir. Effect commit edilmiş fakat ack gözlenmemişse aynı event’in yeniden delivery’si marker sayesinde ikinci effect üretmez. Bu bütün external side effect’ler için exactly-once garantisi değildir. Cache entry commit sonrasında invalidated olur. Worker ack note commit’ini geri almaz veya bütün cache’lerin synchronized olduğunu ilan etmez.
2. Red · Güven ve etki
Hareket olmadan bütün senaryoları oku
Session ve owner
- Duru intent’i
Intent rename-note object tea ve expectedRevision 1 taşıyor. Session alias sid-demo credential değil; active ve logicalNow 10 < expiry 20 yalnız verilmiş validity predicate’i.
- Intent/state ledger
- Duru / logical session active /rev1 intent
- Authority ve atomic boundary
- Henüz değerlendirilmedi
- Persistence/job sonucu
- Henüz değerlendirilmedi
- Owner denial
Denied branch principal Duru, owner Ekin ve authenticated true taşır. Authorized false olduğu için session’ın tanınması bu object üzerinde write yetkisi vermez.
- Intent/state ledger
- Duru / logical session active /rev1 intent
- Authority ve atomic boundary
- Authenticated Duru / owner Ekin / denied
- Persistence/job sonucu
- Henüz değerlendirilmedi
- Denied mutation yok
Denied commits 0, titleAfter Local draft ve outboxRows 0. Object denial session expiry’den farklı reason; değişmeyen title iki gate’i birbirine eşitlemez.
- Intent/state ledger
- Duru / logical session active /rev1 intent
- Authority ve atomic boundary
- Authenticated Duru / owner Ekin / denied
- Persistence/job sonucu
- Owner deny / note and outbox unchanged
- Expiry boundary
LogicalNow 20 expiry 20 olduğunda principal null ve authenticated false. Browser’da alias bulunması validity değil; equality sınırında application mutation başlamaz.
- Intent/state ledger
- now20 = expiry20 / principal null
- Authority ve atomic boundary
- Authenticated Duru / owner Ekin / denied
- Persistence/job sonucu
- Owner deny / note and outbox unchanged
- SQL data sınırı
Query shape parameterized UPDATE; Tea note, tea ve revision 1 bound data. Doğru binding identity veya owner policy’nin yerine geçmez; authorization mutation’dan önce değerlendirilir.
- Intent/state ledger
- now20 = expiry20 / principal null
- Authority ve atomic boundary
- Bound data / independent owner policy
- Persistence/job sonucu
- Owner deny / note and outbox unchanged
- Authn ve authz sonucu
Expired ve denied ikisi de commits/outbox 0, fakat nedenleri ayrı. Bu küçük owner policy bütün authorization modelleri veya gerçek cookie crypto için kanıt değildir.
- Intent/state ledger
- now20 = expiry20 / principal null
- Authority ve atomic boundary
- Bound data / independent owner policy
- Persistence/job sonucu
- Expiry ≠ owner denial / both no mutation
Commit ve ack
- Pending writer görünümü
WriterPending Tea note rev2 ve outboxRows 1; independentReaderBeforeCommit Local draft rev1/outbox0. Writer’ın local görünümü henüz committed shared state değildir.
- Intent/state ledger
- Writerrev2 / independent readerrev1
- Authority ve atomic boundary
- Henüz değerlendirilmedi
- Persistence/job sonucu
- Henüz değerlendirilmedi
- Rollback atomic sonucu
Rollback title Local draft, revision1 ve outbox0 korur; eventPublished false. Note ile event intent’i aynı transaction’da durmalı; notification’u commit öncesi başarı saymıyoruz.
- Intent/state ledger
- Writerrev2 / independent readerrev1
- Authority ve atomic boundary
- Rollback note+outbox / no event publication
- Persistence/job sonucu
- Henüz değerlendirilmedi
- Commit ile cache ayrımı
Normal afterCommit rev2/outbox1, cacheAfter null. Orderly invalidation commit sonrası; crash durability veya bütün distributed caches freshness burada doğrulanmıyor.
- Intent/state ledger
- Writerrev2 / independent readerrev1
- Authority ve atomic boundary
- Rollback note+outbox / no event publication
- Persistence/job sonucu
- Commitrev2 / derived cache invalidated
- Ack kaybı sonrası
İlk effect processedEffects 1 ve ackObserved false. BusinessRolledBack false; ack yokluğu committed effect’i otomatik silmez veya ikinci note write gerektirmez.
- Intent/state ledger
- Effect1 / ack false / business not rolled back
- Authority ve atomic boundary
- Rollback note+outbox / no event publication
- Persistence/job sonucu
- Commitrev2 / derived cache invalidated
- Effect-specific dedupe
İkinci delivery attempt aynı note-tea-rev2 event’i için effect1 tutar, ack true olur. Dedupe scope seçilen consumer effect’i; bütün external API/mail için exactly-once değildir.
- Intent/state ledger
- Effect1 / ack false / business not rolled back
- Authority ve atomic boundary
- Attempts2 / effect1 / ack true
- Persistence/job sonucu
- Commitrev2 / derived cache invalidated
- Başarı alanlarını ayır
Note commit, outbox intent, projection effect ve ack farklı facts. ClientResponseDelivered false; worker başarı bilgisini browser’ın sonucu gördüğü kanıtına taşımıyoruz.
- Intent/state ledger
- Effect1 / ack false / business not rolled back
- Authority ve atomic boundary
- Attempts2 / effect1 / ack true
- Persistence/job sonucu
- Commit/effect/ack known / client delivery separate
VARSAYIM · SINIR · KONTROL
Tanınmış session’dan sınırsız write hakkı çıkarmak
Normal davranış tanınmış principal’ın kendi note’unu değiştirmesidir. Yetki bağı principal, object owner ve operation policy arasında kurulur. Session lookup başarılı diye owner check’i atlamak başka object üzerinde izin dışı mutation’a yol açabilir. Örnek sıradan denial context’iyle bu ayrımı gösterir. Kapsam seçilen owner policy’dir; bütün authorization modellerinin aynı rule’u kullandığı söylenmez.
Her intent için authoritative object/action ilişkisi değerlendirilir. Principal yoksa veya policy unknown ise mutation başlamaz. Expiry verilen server-side clock’a göre kontrol edilir; cookie’nin browser’da durması validity kanıtı değildir. Yerel kontrol alias lookup ve logical expiry kararını ölçer. Secure identifier generation, rotation, password veya cryptography ölçümü üretmez. Audit için raw session değerleri yerine ret nedeni ve operation kapsamı kullanılır.
Job teslimini ve derived cache’i commit sanmak
Prepared write, COMMIT, outbox publication ve worker acknowledgment ayrı gözlemlerdir. Rollback durumunda title ve outbox birlikte eski kalmalıdır. Olmayan notification’ı yayımlanmış gibi göstermek downstream’i yanlış state’e bağlar. Normal dalda cache invalidation commit’ten sonra gelir. Process arada durursa cache stale kalabilir; gerçek recovery ve version policy ayrıca tasarlanır. Bu orderly fixture crash ölçmediğinden sürekli freshness garantisi vermez.
Ack kaybı sırasında business effect zaten commit edilmiş olabilir. Redelivery otomatik rollback veya ikinci update gerektirmez; idempotent marker aynı event’in effect kapsamını korur. Kontrol persistent dedupe ile atomic effect boundary’sini birlikte kullanır. External API veya mail gibi transaction dışı yan etkiler farklı tasarım gerektirir. Worker dedupe tablosu tek başına her sink için exactly-once sağlamaz.
3. Blue · Güvenli geliştirme ve savunma
Hareket olmadan bütün senaryoları oku
Version controls
- Intent correlation
Operation rename-note, object tea, expected rev1 ve owner Duru birlikte tutulur. Session validity, owner decision ve data validation ayrı results; raw credential gerekmez.
- Version/event ledger
- Operation/object/principal/revision bound
- Independent read review
- Henüz değerlendirilmedi
- Decision evidence
- Henüz değerlendirilmedi
- Independent reader kanıtı
Pending aşamada independent reader rev1/outbox0, commit sonrası rev2/outbox1 görür. Writer’a tekrar bakmak independent committed visibility kontrolünün yerine geçmez.
- Version/event ledger
- Operation/object/principal/revision bound
- Independent read review
- Pending vs committed reader views distinct
- Decision evidence
- Henüz değerlendirilmedi
- Olumsuz controls
Owner deny, expiry ve rollback ayrı nedenlerle zero commit/outbox verir. Rollback authorized true olabilir; authorization başarısı persistence başarısı değildir.
- Version/event ledger
- Operation/object/principal/revision bound
- Independent read review
- Pending vs committed reader views distinct
- Decision evidence
- Deny/expiry/rollback independently unchanged
- Derived cache evidence
CacheBefore Local draft rev1, cacheAfter null. Selected key invalidation gözlemi database rollback, broker delivery veya bütün cache instance’ları ack verdi sonucu değil.
- Version/event ledger
- Selected key removed / broader caches unknown
- Independent read review
- Pending vs committed reader views distinct
- Decision evidence
- Deny/expiry/rollback independently unchanged
- Event ve delivery ayrımı
EventId note-tea-rev2 revision2 ile note commit’ine bağlı; rowIsBrokerDelivery false. Outbox row committed intent, delivery attempt relay facts, processed marker effect facts’tir.
- Version/event ledger
- Selected key removed / broader caches unknown
- Independent read review
- Intent / attempts / processed marker distinct
- Decision evidence
- Deny/expiry/rollback independently unchanged
- Retry regression
İki attempt ve bir effect benign retry için beklenebilir. Ack false/true ayrı kontrol edilir; native finite store sonucu real broker veya browser return path kanıtını devralmaz.
- Version/event ledger
- Selected key removed / broader caches unknown
- Independent read review
- Intent / attempts / processed marker distinct
- Decision evidence
- Retry known / effect-specific bound / no broker claim
Commit kaydı eksik
- Writer-only görünüm
Review yalnız writer’daki Tea note rev2’yi görüyor; independent reader ve transaction sonucu yok. Pending writer bile aynı title/revision’ı gösterebilir.
- Version/event ledger
- Writerrev2 known / commit receipt missing
- Independent read review
- Henüz değerlendirilmedi
- Decision evidence
- Henüz değerlendirilmedi
- Job işareti tek kanıt değil
Outbox veya ack görünümü hangi transaction ve effect’e ait olduğu bilinmeden note commit kanıtı değildir. Expected event normal branch’i eksik receipt yerine kullanılamaz.
- Version/event ledger
- Writerrev2 known / commit receipt missing
- Independent read review
- Job marker ≠ bound authoritative commit
- Decision evidence
- Henüz değerlendirilmedi
- Commit’i açık bırak
Bu eksik olay için commit, cache invalidation ve projection effect UNKNOWN. Writer title korunur; client success veya business rollback nedeni eklenmiyor.
- Version/event ledger
- Writerrev2 known / commit receipt missing
- Independent read review
- Job marker ≠ bound authoritative commit
- Decision evidence
- Commit/cache/effect UNKNOWN
- Gerekli version bağı
Transaction sonucu, independent committed read, eventId/revision ve consumer marker gerekli. Comparison alanları yeterli; raw session veya private note body toplanmaz.
- Version/event ledger
- Needed: transaction/reader/event/effect binding
- Independent read review
- Job marker ≠ bound authoritative commit
- Decision evidence
- Commit/cache/effect UNKNOWN
- Durability sınırı
Connection reopen committed read sağlayabilir; hardware crash durability değildir. Aynı şekilde ack queue context’ine ait; external effect veya browser response teslimi ayrıca observer ister.
- Version/event ledger
- Needed: transaction/reader/event/effect binding
- Independent read review
- Committed read ≠ crash/client/broker proof
- Decision evidence
- Commit/cache/effect UNKNOWN
- Dar değerlendirme sonucu
Yeni kanıt hangi authoritative version ve effect’in oluştuğunu ayrı yanıtlamalı. Bu olay yalnız writer görüntüsünü bildirir; commit veya exactly-once başarısı eklemez.
- Version/event ledger
- Needed: transaction/reader/event/effect binding
- Independent read review
- Committed read ≠ crash/client/broker proof
- Decision evidence
- Retain writer view / collect independent receipts
UYGULAMA · GÜVENLİK KONTROLÜ · DOĞRULAMA
Principal’dan authoritative version’a kadar kanıt
Intent defteri operation, object ID, principal kararı, owner policy sonucu ve expected/actual revision’ı bağlar. Expired authentication, authorization denial, business validation failure ve store rollback ayrı nedenlerdir. Session token veya user body bütünüyle kaydedilmez; output’a uygun alanlar seçilir. Normal karşılaştırma owner Duru, mevcut revision 1 ve Tea note title ile sınırlıdır; gerçek credential veya öğrenci verisi içermez.
Writer’ın pending değeriyle bağımsız reader’ın committed view’unu ayır. Parameterized query’ye bind edilen title data’dır, interpreter code değildir; artifact SQL shape ve input alanlarını ayrı gösterir. SQLite connection reopen committed note’u okumayı sağlar, hardware crash durability’yi ölçmez. Invalidation sonrası key miss olması seçilen derived entry’nin silindiğini gösterir; database rollback veya bütün distributed cache’lerden acknowledgment değildir.
Outbox ve consumer sonucunu aynı alarmda ezme
Outbox committed intent’i, delivery attempt relay observation’ını, processed marker effect commit’ini ve ack queue state’ini anlatır. İki delivery ve tek projection effect benign retry için beklenen sonuç olabilir; otomatik incident verdict değildir. Note version ile event version’u eşleştir ve dedupe kapsamını operation/consumer ile belirt. Job delay note commit’ini invalid yapmaz; downstream freshness ayrıca gözlenir.
XPath authorized=false ile committed=true birlikteliğini seçer. Denied intent 0, tutarsız inert kayıt 1 eşleşme verir; eksik policy kaydı doğru enforcement kanıtı değildir. Yerel fixture normal commit, rollback, denial/expiry ve tekrarlanan worker projection sonuçlarını bağımsız okur. Kalıcı tasarım mutation öncesi authorization, atomic note/outbox transaction, versioned invalidation ve effect’e özgü retry koşullarıdır. Gerçek broker, cookie security veya browser return path bu sonuçlardan varsayılmaz.
ŞİMDİ VAKAYA UYGULA
Session, commit ve ack aynı başarı mı?
Duru rev1 Local draft note’unu Tea note yapıyor. Writer rev2 ve outbox row’u pending tutarken independent reader hâlâ rev1 görüyor; commit sonrası reader değişiyor. Ack kaybı iki delivery attempt doğurabiliyor, fakat effect-specific dedupe bir projection effect tutuyor.
Vakadaki accepted, delivery ve committed effect kayıtlarını farklı owner’lar üzerinden oku. Caller’ın bilinmeyen sonucunu business rollback olarak yeniden adlandırma.
Bağlı vaka dosyasını aç ↗ÖRNEĞİ BİRLİKTE OKUYALIM
Note commit ve worker effect kaydı
Bir alan seç; hangi sonucu desteklediğini ve nerede yetersiz kaldığını incele.
Ham kaydı ve alan açıklamalarını oku
{
"intent": {
"operation": "rename-note",
"objectId": "tea",
"sessionAlias": "sid-demo",
"newTitle": "Tea note",
"expectedRevision": 1,
"requestAlreadyAtApplication": true
},
"session": {
"principal": "Duru",
"active": true,
"logicalNow": 10,
"logicalExpiry": 20,
"secureToken": false,
"predicateNotAuthenticationRuntime": true
},
"policy": {
"owner": "Duru",
"action": "rename-note",
"authorized": true,
"titleRule": "nonempty string",
"notUniversalAuthorizationModel": true
},
"normal": {
"before": {
"title": "Local draft",
"revision": 1
},
"writerPending": {
"title": "Tea note",
"revision": 2,
"outboxRows": 1
},
"independentReaderBeforeCommit": {
"title": "Local draft",
"revision": 1,
"outboxRows": 0
},
"afterCommit": {
"title": "Tea note",
"revision": 2,
"outboxRows": 1
},
"cacheBefore": {
"title": "Local draft",
"revision": 1
},
"cacheAfter": null,
"processedEffects": 1,
"ackObserved": true,
"clientResponseDelivered": false
},
"query": {
"shape": "UPDATE notes SET title=?, revision=revision+1 WHERE id=? AND revision=?",
"parameters": [
"Tea note",
"tea",
1
],
"dataNotCode": true
},
"event": {
"eventId": "note-tea-rev2",
"kind": "note-renamed",
"noteId": "tea",
"revision": 2,
"rowIsBrokerDelivery": false
},
"denied": {
"principal": "Duru",
"owner": "Ekin",
"authenticated": true,
"authorized": false,
"commits": 0,
"titleAfter": "Local draft",
"outboxRows": 0,
"reason": "owner-policy-denied"
},
"expired": {
"logicalNow": 20,
"logicalExpiry": 20,
"principal": null,
"authenticated": false,
"authorized": false,
"commits": 0,
"outboxRows": 0,
"reason": "session-expired"
},
"rollback": {
"authorized": true,
"commits": 0,
"titleAfter": "Local draft",
"revisionAfter": 1,
"outboxRows": 0,
"eventPublished": false
},
"redelivery": {
"deliveryAttempts": 2,
"afterFirstEffect": {
"processedEffects": 1,
"ackObserved": false
},
"afterSecondEffect": {
"processedEffects": 1,
"ackObserved": true
},
"noteRevision": 2,
"businessRolledBack": false,
"exactlyOnceUniversal": false
},
"limits": {
"actualLoginCookieCrypto": false,
"realDbService": false,
"distributedCache": false,
"realBroker": false,
"externalSideEffect": false,
"crashDurability": false,
"httpBrowserDelivery": false,
"realCredentials": false
},
"selector": {
"language": "XPath",
"xml": "<audit><intent authorized=\"false\" committed=\"false\"/></audit>",
"xpath": "count(/audit/intent[@authorized='false' and @committed='true'])",
"expected": 0,
"positiveFixtureXml": "<audit><intent authorized=\"false\" committed=\"true\"/></audit>",
"positiveExpected": 1,
"scope": "Own inert decision observations, not real vendor logs.",
"missingFieldBehavior": "Missing observation is insufficient evidence, not a proven healthy or authorized result."
}
}- session / policy
- Inert session alias validity’si ile object/action ilişkisi ayrı kararlardır.
- query
- Parameterized query shape’i ile bind edilen title/id/revision data’sı.
- normal
- Pending writer, bağımsız committed view ve derived cache.
- event / redelivery
- Outbox intent, effect’e özgü dedupe ve ayrı acknowledgment.
Yerel SQLite transaction, bağımsız reader ve sınırlı worker projection kontrolleri kullanılır. Gerçek login/cookie cryptography, broker veya browser return çalıştırılmaz; crash/replication ve bütün external effect’ler için garanti verilmez.
İki yanlış kanı
Valid session varsa bu note’u yazabilirim.
Object/action policy her intent için ayrıca değerlendirilir; tanınmış principal otomatik owner değildir.
Queue ack veya outbox row bütün işin tamamlandığını gösterir.
Store commit, notification delivery, worker effect ve ack farklı boundary’lerdir; retry duplicate delivery üretebilir.
SIRA SENDE
Bu hikâyeyi sen çöz.
Sonucu tahmin et, kanıtın sınırını bul ve nedenini kendi cümlenle anlat.
Session aktif ve principal=Duru, fakat note owner=Ekin. Rename transaction’ı commit edilir mi?
- Hayır. authorized=false; commits=0 ve outboxRows=0.
- Evet. Aktif session bütün owner kayıtlarını değiştirebilir.
Gerekçeli cevabı oku
Hayır. authorized=false; commits=0 ve outboxRows=0. — owner-policy-denied sonucunda eski title korunur ve event row oluşturulmaz. Authentication write izni değildir.
Writer yeni title ve outbox row görüyor. Independent reader neden commit öncesinde hâlâ Local draft görüyor?
Dersten seçilen artifact alanları; öğretim örneği
- normal.writerPending
- {"title":"Tea note","revision":2,"outboxRows":1}
- normal.independentReaderBeforeCommit
- {"title":"Local draft","revision":1,"outboxRows":0}
- normal.afterCommit
- {"title":"Tea note","revision":2,"outboxRows":1}
- normal.clientResponseDelivered
- false
- Writer’ın gördüğü state bütün reader ve browser’lara anında geçer.
- Pending write henüz commit değil; reader eski revision=1 görür.
Gerekçeli cevabı oku
Pending write henüz commit değil; reader eski revision=1 görür. — Commit sonrasında title ve outbox row birlikte görünür. clientResponseDelivered=false olduğu için bu commit browser receipt kanıtı değildir.
İlk business effect sonrası ACK gözlenmedi; ikinci delivery sonrası effect hâlâ 1 ve ACK var. Outbox row, business commit ve broker ACK ilişkisini açıkla.
Gerekçeli cevabı oku
Note güncellemesi ile outbox row yerel transaction’da birlikte commit edilir; row tek başına broker delivery değildir. ACK kaybı business effect’i geri almaz. İkinci delivery’de aynı event’in işlendiği görüldüğü için effect tekrarlanmaz. Bu örneğin idempotency sonucu universal exactly-once veya external side-effect garantisi değildir. Session ve owner koşulları da gerçek login/crypto değil, verilen policy girdileridir.
□ Outbox row’u broker delivery saymadım.
□ ACK kaybını business rollback saymadım; dedupe kapsamını belirttim.
Uygulama konsolunu aç · request / response / browser
Request, URL, cookie ve DOM örneklerini ayrıca aç
Kaynaklar ve kapsam
- OWASP — Session ManagementSession ID Properties · Session Expiration · Manual Session Expiration
- OWASP — AuthorizationIntroduction · Deny by Default · Validate the Permissions on Every Request
- SQLite — Transaction control2. Transactions · 2.1. Read transactions versus write transactions · 2.3. Implicit versus explicit transactions
- SQLite — Atomic Commit3.12. Releasing The Lock · 4. Rollback
- Redis — selected invalidation example, client-side cachingThe Redis implementation of client-side caching · What tracking tracks
- AWS Prescriptive Guidance — Transactional outboxIntent · Issues and considerations · Implementation
- RabbitMQ 4.3 — Consumer Acknowledgements and Publisher ConfirmsThe Basics · Are Publisher Confirms Related to Consumer Delivery Acknowledgements? · When Consumers Fail or Lose Connection: Automatic Requeueing
- Python 3.14 — sqlite3 parameter bindingHow to use placeholders to bind values in SQL queries