File size: 11,726 Bytes
2d70903
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
  "schema_version": "offline-clone.backend-model.v1",
  "site_id": "hmart",
  "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",
    "proofs": [
      {"obligation": "data-location", "status": "verified", "evidence": ["tests/site_backend/test_runtime_and_lifecycle.py::test_runtime_file_sets_site_root_and_safe_database_location", "materials/hmart/backend/runtime.json"]},
      {"obligation": "schema-migration", "status": "verified", "evidence": ["clone/backend/hmart_schema.py::migrate_v2", "clone/tests/test_schema_migration.py::test_v2_migration_backfills_legacy_catalog_and_fulfillment_state"]},
      {"obligation": "deterministic-reset", "status": "verified", "evidence": ["tests/site_backend/test_runtime_and_lifecycle.py::test_embedded_reset_clears_common_state_but_preserves_binding", "clone/backend/hmart_schema.py::seed"]},
      {"obligation": "restart-persistence", "status": "verified", "evidence": ["tests/local_clone_auth/test_local_clone_auth.py::test_mail_rate_limit_is_durable_across_store_instances", "clone/tests/test_stateful.py::test_location_cart_checkout_safe_stop_and_persistence"]},
      {"obligation": "backup-restore", "status": "verified", "evidence": ["tests/site_backend/test_runtime_and_lifecycle.py::test_backup_restore_integrity_and_cross_site_restore_rejection", "tests/local_clone_auth/test_local_clone_auth.py::test_complete_site_database_backup_restore_and_validation"]},
      {"obligation": "concurrency", "status": "verified", "evidence": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency", "tests/local_clone_auth/test_local_clone_auth.py::test_schema_wal_migration_and_session_token_digest_only"]}
    ]
  },
  "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": "none",
      "journey_ids": ["local-account-services"],
      "invariant_ids": ["local-auth-mail-only", "backend-lifecycle"],
      "proofs": {
        "evidence": {
          "valid": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_creates_account_only_after_verified_code_and_rotates_session"],
          "invalid": ["tests/local_clone_auth/test_local_clone_auth.py::test_invalid_codes_consume_persistent_attempt_budget"],
          "duplicate": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_duplicate_is_transactionally_rejected"],
          "stale": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_exact_retry_replays_pending_flow_without_new_effects"],
          "foreign-owner": ["tests/local_clone_auth/test_local_clone_auth.py::test_foreign_site_backup_is_rejected_before_live_database_replacement"],
          "unauthorized-role": ["tests/local_clone_auth/test_local_clone_auth.py::test_email_delivery_public_actor_cannot_transition_outbox"],
          "restart": ["tests/local_clone_auth/test_local_clone_auth.py::test_mail_rate_limit_is_durable_across_store_instances"],
          "migration": ["tests/local_clone_auth/test_local_clone_auth.py::test_schema_wal_migration_and_session_token_digest_only"],
          "concurrency": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency"]
        },
        "not_applicable": []
      }
    },
    {
      "id": "account-sign-in",
      "label": "Password-based site-local sign-in",
      "priority": "p1",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-account-sign-in-v1",
      "external_effect": "none",
      "journey_ids": ["local-account-services"],
      "invariant_ids": ["owner-isolated-commerce", "local-auth-mail-only"],
      "proofs": {
        "evidence": {
          "valid": ["tests/local_clone_auth/test_local_clone_auth.py::test_sign_in_uses_real_credentials_rotates_and_revokes", "clone/tests/test_stateful.py::test_local_account_favorites_orders_and_support"],
          "invalid": ["tests/local_clone_auth/test_local_clone_auth.py::test_sign_in_uses_real_credentials_rotates_and_revokes"],
          "duplicate": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_duplicate_is_transactionally_rejected"],
          "stale": ["tests/local_clone_auth/test_local_clone_auth.py::test_sign_in_uses_real_credentials_rotates_and_revokes"],
          "foreign-owner": ["tests/local_clone_auth/test_local_clone_auth.py::test_session_rotation_callback_and_site_reset_are_atomic"],
          "unauthorized-role": ["clone/tests/test_stateful.py::test_local_account_favorites_orders_and_support"],
          "restart": ["tests/local_clone_auth/test_local_clone_auth.py::test_mail_rate_limit_is_durable_across_store_instances"],
          "migration": ["tests/local_clone_auth/test_local_clone_auth.py::test_schema_wal_migration_and_session_token_digest_only"],
          "concurrency": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency"]
        },
        "not_applicable": []
      }
    },
    {
      "id": "session-lifecycle",
      "label": "Anonymous and authenticated browser sessions",
      "priority": "p0",
      "category": "authentication",
      "implementation_status": "verified",
      "semantic_profile": "local-session-lifecycle-v1",
      "external_effect": "none",
      "journey_ids": ["shopping-mainline", "local-account-services"],
      "invariant_ids": ["owner-isolated-commerce", "backend-lifecycle"],
      "proofs": {
        "evidence": {
          "valid": ["tests/local_clone_auth/test_local_clone_auth.py::test_sign_in_uses_real_credentials_rotates_and_revokes"],
          "invalid": ["tests/local_clone_auth/test_local_clone_auth.py::test_sign_in_uses_real_credentials_rotates_and_revokes"],
          "duplicate": ["tests/site_backend/test_runtime_and_lifecycle.py::test_initialize_twice_is_idempotent_and_wrong_site_open_fails_closed"],
          "stale": ["tests/local_clone_auth/test_local_clone_auth.py::test_reserved_smtp_claim_is_invalidated_after_restart"],
          "foreign-owner": ["tests/local_clone_auth/test_local_clone_auth.py::test_session_rotation_callback_and_site_reset_are_atomic"],
          "unauthorized-role": ["tests/local_clone_auth/test_local_clone_auth.py::test_email_delivery_public_actor_cannot_transition_outbox"],
          "restart": ["tests/local_clone_auth/test_local_clone_auth.py::test_mail_rate_limit_is_durable_across_store_instances"],
          "migration": ["tests/local_clone_auth/test_local_clone_auth.py::test_schema_wal_migration_and_session_token_digest_only"],
          "concurrency": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency"]
        },
        "not_applicable": []
      }
    },
    {
      "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": ["local-account-services"],
      "invariant_ids": ["local-auth-mail-only", "backend-lifecycle"],
      "proofs": {
        "evidence": {
          "valid": ["tests/local_clone_auth/test_local_clone_auth.py::test_password_reset_known_and_unknown_public_responses_are_identical"],
          "invalid": ["tests/local_clone_auth/test_local_clone_auth.py::test_invalid_codes_consume_persistent_attempt_budget"],
          "duplicate": ["tests/local_clone_auth/test_local_clone_auth.py::test_password_reset_known_and_unknown_public_responses_are_identical"],
          "stale": ["tests/local_clone_auth/test_local_clone_auth.py::test_reserved_smtp_claim_is_invalidated_after_restart"],
          "foreign-owner": ["tests/local_clone_auth/test_local_clone_auth.py::test_password_reset_known_and_unknown_public_responses_are_identical"],
          "unauthorized-role": ["tests/local_clone_auth/test_local_clone_auth.py::test_email_delivery_public_actor_cannot_transition_outbox"],
          "restart": ["tests/local_clone_auth/test_local_clone_auth.py::test_smtp_process_restart_preserves_hash_only_flow_but_not_outbox"],
          "migration": ["tests/local_clone_auth/test_local_clone_auth.py::test_legacy_plaintext_otp_column_is_dropped_without_copying_secret"],
          "concurrency": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency"]
        },
        "not_applicable": []
      }
    },
    {
      "id": "email-delivery",
      "label": "Truthful local verification and recovery mail outbox",
      "priority": "p1",
      "category": "communication",
      "implementation_status": "verified",
      "semantic_profile": "local-mail-delivery-v1",
      "external_effect": "local-only",
      "journey_ids": ["local-account-services"],
      "invariant_ids": ["local-auth-mail-only", "checkout-stops-before-submit"],
      "proofs": {
        "evidence": {
          "valid": ["tests/site_backend/test_mail.py::test_mail_claim_can_be_marked_sent_exactly_once"],
          "invalid": ["tests/site_backend/test_mail.py::test_mail_idempotency_conflict_and_sanitized_failure"],
          "duplicate": ["tests/site_backend/test_mail.py::test_mail_idempotency_conflict_and_sanitized_failure"],
          "stale": ["tests/local_clone_auth/test_local_clone_auth.py::test_reserved_smtp_claim_at_ceiling_fails_without_replay"],
          "foreign-owner": ["tests/site_backend/test_mail.py::test_caller_supplied_mail_connection_requires_active_transaction"],
          "unauthorized-role": ["tests/local_clone_auth/test_local_clone_auth.py::test_email_delivery_public_actor_cannot_transition_outbox"],
          "restart": ["tests/site_backend/test_mail.py::test_mail_claim_retry_crash_replay_and_terminal_failure"],
          "migration": ["tests/local_clone_auth/test_local_clone_auth.py::test_schema_read_does_not_fabricate_failed_mail_request"],
          "concurrency": ["tests/local_clone_auth/test_local_clone_auth.py::test_registration_and_mail_claims_are_serialized_under_concurrency"]
        },
        "not_applicable": []
      }
    }
  ]
}