Commit cf1d727
committed
plan(super-domain-rbac-v1): §18 — empirical reality check via MedCare/MedCareV2 inspection
Inspected AdaWorldAPI/MedCareV2 + AdaWorldAPI/MedCare-rs@claude/csharp-
handoff-docs-L3DF0 via pygithub REST (token-quote-stripped per cca2a-sprint-
prompt-template guardrail). Major findings refine §15-§17 substantially.
Drift bridge already designed and partially scaffolded:
- MedCareV2/MedCare_2.0/LanceProbe/ contains 8 components mapping nearly 1:1
to my spec's DTOs (ParityClient → MetaBridge HTTP, ParityWitness →
DriftDetectionBridge + canonicalization, DriftSink → AuditSink async batch,
ParityPanel → admin UI, DiagnosisRedactor → FieldRedactionMask).
- M1 complete (scaffolding compiles, throws NotImplementedException);
M2-M6 pending Rust-side endpoints D-SDR-35..39.
- Coordination spec at MedCare-rs/docs/CSHARP_HANDOFF_PROMPT.md.
MedCareV2 is overlay-only, NOT reshapeable:
- Per docs/PARITY_TOOL_OVERVIEW.md: copy of MedCare + LanceProbe additions.
- Explicit constraint: "do NOT refactor... the diff must be additions only."
- §16.2 framing of MedCareV2 as "partial rewrite, reshapeable freely" CORRECTED.
CRITICAL crypto correction:
- The "3DES" in Crypt.cs:438-451 is broken security, not just outdated.
- 128-bit truncated key (TripleDESCryptoServiceProvider with CryptDeriveKey
yielding 16 bytes instead of 24) = cryptographically equivalent to single
DES with 56-bit effective strength (broken since late 1990s).
- Zero IV + ECB-equivalent + non-standard MD5+RC2 KDF + no salt.
- Password source: hardcoded 62-entry Passwort_Crypt[] array
(Crypt.cs:285-349); NOT user-input-derived.
- Ciphertext format: [1-char index prefix][base64(encrypted bytes)].
- Migration is NOT 3DES→AES-GCM rewrap; it's Argon2-backfill-on-login per
existing MedCare-rs/docs/AUTH_LEGACY_TRIPLEDES_MIGRATION.md plan.
D-SDR-27 scope reduces:
- Only u_pwd column on praxis_mitarbeiter uses the 3DES path; rest of the
schema is plaintext (likely no other EncryptMessage call sites).
- Pipeline: carry ciphertext forward as opaque blob; Argon2 backfill happens
on first successful user login (separate code path).
- Reduced from ~250 LOC + 4 tests to ~80 LOC + 2 tests.
- Removes the AES-GCM rewrap logic entirely (wrong for actual data shape).
Canonicalization rules concretized:
- §15.2 abstract 12-rule cross-language determinism table replaced by
6 concrete rules from CSHARP_HANDOFF_PROMPT.md lines 93-104:
geburtsdatum/p_birth (ISO date), werte (F4 InvariantCulture), pf_delete
(bool null/0→false), db_spez (tinyint→bool), u_pwd (byte-equivalent),
created_at/d_createdate/updated_at (second-truncated ISO).
- D-SDR-26 test surface drops to 6 named tests.
§17.3 Arrow Flight SQL is aspirational:
- Immediate path is HTTP+JSON over JWT (what LanceProbe already targets).
- Flight SQL convergence is Phase 5+ migration after JSON path is drift-clean.
5 new Rust-side deliverables (D-SDR-35..39) blocking LanceProbe M5/M6:
- D-SDR-35: POST /api/__parity/csharp ingest endpoint
- D-SDR-36: GET /api/__parity dashboard endpoint
- D-SDR-37: _dto_contracts.md stable JSON DTO contracts (blocks M2)
- D-SDR-38: legacy-tripledes-fallback feature flag (blocks M5a)
- D-SDR-39: /api/__parity/telemetry endpoint
Phase sequencing now concrete (replaces §17.2 abstract version):
- Phase 0: M1 done. Phase 1: M2 + D-SDR-31/37. Phase 2: M3+M4 + D-SDR-33.
- Phase 3: M5 + D-SDR-35/36. Phase 3a: M5a + D-SDR-38. Phase 4: M6 + D-SDR-39/30.
Resolved 7 prior open questions; added 3 new ones.
INTEGRATION_PLANS.md third correction line appended per APPEND-ONLY governance.1 parent b1b80cf commit cf1d727
2 files changed
Lines changed: 182 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
0 commit comments