File size: 21,769 Bytes
187ef74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
{
  "schema_version": "offline-clone.backend-model.v1",
  "site_id": "ioby",
  "status": "verified",
  "profile": "offline-benchmark",
  "database": {
    "engine": "sqlite",
    "location_policy": "runtime-data-outside-candidate",
    "concurrency_model": "wal-transactional-single-writer",
    "migration_strategy": "versioned-forward-migrations",
    "deterministic_reset": true,
    "restart_persistence": true,
    "site_isolation": "one-database-per-site",
    "database_identity": "site_id ioby with runtime filename ioby.sqlite3",
    "data_path_contract": {
      "root_policy": "runtime-data-outside-candidate",
      "database_file": "ioby.sqlite3",
      "override_environment_variable": "WEBSITEBENCH_SITE_BACKEND_DATABASE"
    },
    "proofs": [
      {
        "obligation": "data-location",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_runtime_identity_and_payment_profile_are_site_specific"]
      },
      {
        "obligation": "schema-migration",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_business_migration_is_idempotent"]
      },
      {
        "obligation": "deterministic-reset",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_backup_reset_restore_and_deterministic_reset", "clone/tests/test_payment_scope.py::test_confirmed_payment_survives_restart_backup_reset_and_restore"]
      },
      {
        "obligation": "restart-persistence",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_restart_persists_site_business_state", "clone/tests/test_payment_scope.py::test_payment_snapshot_is_opaque_persistent_and_rotates"]
      },
      {
        "obligation": "backup-restore",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_backup_reset_restore_and_deterministic_reset", "clone/tests/test_payment_scope.py::test_confirmed_payment_survives_restart_backup_reset_and_restore"]
      },
      {
        "obligation": "concurrency",
        "status": "verified",
        "evidence": ["clone/tests/test_backend_lifecycle.py::test_concurrent_writers_create_distinct_drafts", "clone/tests/test_payment_scope.py::test_concurrent_confirmation_converges_on_one_atomic_result"]
      }
    ]
  },
  "auth_semantics": {
    "account_database_scope": "site-isolated",
    "credential_storage": "salted-scrypt-hash",
    "session_storage": "opaque-cookie-digest-at-rest",
    "registration_account_creation": "after-email-verification",
    "verification_challenge_storage": "salted-hash",
    "password_reset_enumeration": "indistinguishable-public-response",
    "mail_default": "LOCAL_ONLY",
    "mail_statuses": ["LOCAL_ONLY", "SMTP_PENDING", "SMTP_SENT", "SMTP_FAILED"],
    "smtp_activation": "explicit-complete-config-only",
    "smtp_delivery_ceiling": 3,
    "rejected_secret_journaling": "forbidden",
    "legacy_write_policy": "read-compatible-write-rejected"
  },
  "common_capabilities": {
    "account_registration": "account-registration",
    "account_sign_in": "account-sign-in",
    "session_lifecycle": "session-lifecycle",
    "password_recovery": "password-recovery",
    "email_delivery": "email-delivery"
  },
  "capabilities": [
    {
      "id": "account-registration",
      "label": "Verified local account registration",
      "priority": "p1",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-account-registration-v1",
      "external_effect": "local-only",
      "journey_ids": ["auth.registration-local"],
      "invariant_ids": ["account.site-isolated", "runtime.local-only"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_registration_uses_local_outbox_and_creates_account", "clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "duplicate": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "stale": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart", "clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_registration_completion_is_serialized_under_concurrency"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "The local registration surface has no privileged role; authenticated sessions are not a separate role authorized to create another account."}
        ]
      }
    },
    {
      "id": "account-sign-in",
      "label": "Password-based local account sign-in",
      "priority": "p0",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-account-sign-in-v1",
      "external_effect": "none",
      "journey_ids": ["auth.entries-local", "account.history-manage-local"],
      "invariant_ids": ["account.site-isolated"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_sign_in_history_and_idempotent_recurring_cancel", "clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "duplicate": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "stale": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "Sign-in authenticates credentials but exposes no role-granted or administrative operation."}
        ]
      }
    },
    {
      "id": "session-lifecycle",
      "label": "Anonymous and authenticated local sessions",
      "priority": "p0",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-session-lifecycle-v1",
      "external_effect": "none",
      "journey_ids": ["auth.entries-local", "validation.permissions"],
      "invariant_ids": ["account.site-isolated", "runtime.local-only"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_sign_in_history_and_idempotent_recurring_cancel"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "duplicate": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "stale": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "foreign-owner": ["clone/tests/test_donation_and_account.py::test_foreign_browser_cannot_read_anonymous_receipt", "clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_sign_in_and_session_negative_duplicate_stale_restart_and_concurrency"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "The session lifecycle has anonymous and authenticated states but no privileged role transition."}
        ]
      }
    },
    {
      "id": "password-recovery",
      "label": "Enumeration-resistant local password recovery",
      "priority": "p1",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-password-recovery-v1",
      "external_effect": "local-only",
      "journey_ids": ["auth.recovery-local"],
      "invariant_ids": ["account.site-isolated", "runtime.local-only"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_password_recovery_public_response_and_local_code", "clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "duplicate": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "stale": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix", "clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_password_reset_requests_serialize_to_one_active_mail"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "Password recovery has no privileged role; possession of the session-bound challenge and code is the only completion authority."}
        ]
      }
    },
    {
      "id": "email-delivery",
      "label": "Truthful ioby local-only mail outbox",
      "priority": "p1",
      "category": "communication",
      "implementation_status": "verified",
      "semantic_profile": "local-mail-delivery-v1",
      "external_effect": "local-only",
      "journey_ids": ["auth.registration-local", "auth.recovery-local"],
      "invariant_ids": ["runtime.local-only", "receipt.truthful-local"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_registration_uses_local_outbox_and_creates_account", "clone/tests/test_donation_and_account.py::test_password_recovery_public_response_and_local_code", "clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "duplicate": ["clone/tests/test_backend_capability_matrix.py::test_registration_invalid_duplicate_foreign_stale_and_restart"],
          "stale": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_recovery_and_local_mail_matrix"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_auth_schema_and_credentials_are_site_isolated"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_password_reset_requests_serialize_to_one_active_mail"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "The configured adapter is LOCAL_ONLY and exposes no provider worker or privileged delivery role."}
        ]
      }
    },
    {
      "id": "donation-checkout",
      "label": "Atomic local-sandbox donation and receipt",
      "priority": "p0",
      "category": "commerce",
      "implementation_status": "verified",
      "entities": [
        {"name": "donation-draft", "identity": "server-generated opaque donation id", "owner_scope": "session", "persistence": "durable"},
        {"name": "payment-flow", "identity": "site-backend flow id bound to owner and opaque snapshot", "owner_scope": "session", "persistence": "durable"},
        {"name": "payment-attempt", "identity": "site-backend attempt id", "owner_scope": "session", "persistence": "durable"},
        {"name": "local-receipt", "identity": "server-generated local receipt number", "owner_scope": "session", "persistence": "durable"},
        {"name": "project-total", "identity": "server-owned project slug", "owner_scope": "global", "persistence": "durable"}
      ],
      "state_machine": {
        "kind": "entity-lifecycle",
        "states": ["collecting", "payment-open", "approved", "confirmed", "canceled"],
        "transitions": [
          {"from": "collecting", "to": "payment-open", "trigger": "validated amount and donor details"},
          {"from": "payment-open", "to": "payment-open", "trigger": "declined or retryable local-sandbox result"},
          {"from": "payment-open", "to": "approved", "trigger": "configured opaque sandbox-approved scenario"},
          {"from": "approved", "to": "confirmed", "trigger": "atomic approval consumption, donation, receipt, recurring plan when applicable, and project-total commit"},
          {"from": "collecting", "to": "canceled", "trigger": "local flow is abandoned"}
        ]
      },
      "server_authorities": [
        "Project, USD currency, amount in minor units, owner, snapshot token, flow id, and receipt id are server-owned.",
        "The browser may submit only one configured opaque scenario id and never payment credentials or server facts.",
        "Approval consumption, confirmation, receipt, recurring plan when selected, and project-total update share one site-bound transaction."
      ],
      "external_effect": "local-only",
      "journey_ids": ["donation.core-768", "donation.retry-local", "validation.permissions"],
      "invariant_ids": ["donation.amount-and-project", "payment.local-sandbox", "donation.atomic-idempotent", "receipt.truthful-local", "runtime.local-only"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_core_768_approved_creates_exactly_one_receipt"],
          "invalid": ["clone/tests/test_donation_and_account.py::test_required_amount_and_detail_validation", "clone/tests/test_payment_scope.py::test_browser_payment_rejects_credentials_and_server_facts"],
          "duplicate": ["clone/tests/test_payment_scope.py::test_concurrent_confirmation_converges_on_one_atomic_result"],
          "stale": ["clone/tests/test_payment_scope.py::test_idempotency_conflict_and_final_fact_mismatches_fail_closed"],
          "foreign-owner": ["clone/tests/test_donation_and_account.py::test_foreign_browser_cannot_read_anonymous_receipt", "clone/tests/test_payment_scope.py::test_idempotency_conflict_and_final_fact_mismatches_fail_closed"],
          "restart": ["clone/tests/test_payment_scope.py::test_confirmed_payment_survives_restart_backup_reset_and_restore"],
          "migration": ["clone/tests/test_backend_lifecycle.py::test_business_migration_is_idempotent"],
          "concurrency": ["clone/tests/test_payment_scope.py::test_concurrent_confirmation_converges_on_one_atomic_result"]
        },
        "not_applicable": [
          {"obligation": "unauthorized-role", "rationale": "The donation capability has no privileged role; every actor remains constrained by the site-bound session/account owner checks."}
        ]
      }
    },
    {
      "id": "recurring-management",
      "label": "Local recurring donation management",
      "priority": "p1",
      "category": "commerce",
      "implementation_status": "verified",
      "entities": [
        {"name": "recurring-plan", "identity": "server-generated plan id bound to donation and account", "owner_scope": "account", "persistence": "durable"}
      ],
      "state_machine": {
        "kind": "entity-lifecycle",
        "states": ["active", "canceled"],
        "transitions": [
          {"from": "active", "to": "canceled", "trigger": "owning local donor cancels"},
          {"from": "canceled", "to": "canceled", "trigger": "duplicate cancellation remains idempotent"}
        ]
      },
      "server_authorities": ["Only the bound account can list or cancel a recurring plan.", "Cancellation is local, durable, and idempotent."],
      "external_effect": "local-only",
      "journey_ids": ["account.history-manage-local"],
      "invariant_ids": ["account.site-isolated", "runtime.local-only"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_sign_in_history_and_idempotent_recurring_cancel"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"],
          "duplicate": ["clone/tests/test_donation_and_account.py::test_sign_in_history_and_idempotent_recurring_cancel", "clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"],
          "migration": ["clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_recurring_invalid_foreign_duplicate_restart_migration_and_concurrency"]
        },
        "not_applicable": [
          {"obligation": "stale", "rationale": "Cancellation accepts no client revision or fingerprint; a previously canceled plan is the explicitly tested duplicate-idempotent case."},
          {"obligation": "unauthorized-role", "rationale": "Recurring management has an owning account boundary but no privileged role."}
        ]
      }
    },
    {
      "id": "saved-projects",
      "label": "Account-bound saved projects",
      "priority": "p1",
      "category": "personalization",
      "implementation_status": "verified",
      "entities": [
        {"name": "saved-project", "identity": "account id and project slug", "owner_scope": "account", "persistence": "durable"}
      ],
      "state_machine": {
        "kind": "idempotent-set",
        "states": ["absent", "saved"],
        "transitions": [
          {"from": "absent", "to": "saved", "trigger": "owning account saves project"},
          {"from": "saved", "to": "absent", "trigger": "owning account removes project"}
        ]
      },
      "server_authorities": ["The authenticated account id comes only from the site-bound session.", "Signed-out actors are redirected before any favorite mutation."],
      "external_effect": "none",
      "journey_ids": ["project.save-share", "validation.permissions"],
      "invariant_ids": ["account.site-isolated"],
      "proofs": {
        "evidence": {
          "valid": ["clone/tests/test_donation_and_account.py::test_saved_project_persists_for_local_donor", "clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"],
          "invalid": ["clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"],
          "duplicate": ["clone/tests/test_donation_and_account.py::test_saved_project_persists_for_local_donor", "clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"],
          "foreign-owner": ["clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"],
          "restart": ["clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"],
          "migration": ["clone/tests/test_backend_lifecycle.py::test_business_migration_is_idempotent"],
          "concurrency": ["clone/tests/test_backend_capability_matrix.py::test_saved_project_invalid_duplicate_foreign_restart_and_concurrency"]
        },
        "not_applicable": [
          {"obligation": "stale", "rationale": "Saved state is an idempotent target set with no client revision; repeated target state is covered by duplicate evidence."},
          {"obligation": "unauthorized-role", "rationale": "Saved projects are account-owned and expose no privileged role."}
        ]
      }
    }
  ]
}