Technical Debt — Centralized Personal Information Store Gaps

By Engineering Team•October 1, 2026•4 min read
Metadata Details
System Centralized Personal Information Store
Document ID TD-2026-PII-001
Author Engineering Team
Status Open

This document tracks known implementation gaps in pii-service and its consumers as first-class, ongoing debt items. SR-010 links here rather than restating gap detail, so the requirement text itself doesn’t quietly read as an already-met guarantee.


TD-01 — inventory-service’s compensating delete is best-effort, not retried

  • Status: Open
  • Severity: Medium — a correctness gap on a rare failure path, not a routine occurrence.
  • Affected component: inventory-service — internal/service/warehouse/warehouse_crud.svc.go’s CreateWarehouse.
  • Evidence: CreateWarehouse inserts the warehouse’s Postgres row first, then calls pii.UpsertAttributes. If that call fails, it calls repo.DeleteWarehouseByID to roll back the row it just inserted — but if the compensating delete itself fails, the error is only passed to log.LogErrorWithTrace, never retried or surfaced to the caller beyond the original UpsertAttributes error.
  • Impact: A warehouse row can be left orphaned in Postgres with no corresponding PII attributes in pii-service — the warehouse exists with no contact name/phone number ever retrievable against it, and nothing besides a log line records that this happened.
  • Remediation direction: Either retry the compensating delete with backoff before giving up, or reconcile orphaned rows out-of-band (a periodic job comparing inventory-service’s warehouse table against pii-service’s entity_type="warehouse" rows). A distributed-transaction/saga pattern is not warranted for a single compensating step — this is a reliability gap in the existing compensation, not a case for a new orchestration mechanism.
  • Related requirement: SR-010 NFR-03

TD-02 — notification-service misattributes every pii-service call to user-secure-engine

  • Status: Open
  • Severity: High — every affected audit-log entry is factually wrong, not just incomplete.
  • Affected component: notification-service — src/src/infra/pii_client.rs, consumed by notification-service’s own live UserService gRPC surface (wired via app_config.rs’s PiiClient::connect → UserModule::build, confirmed registered as UserServiceServer::with_interceptor(...) and reachable through state.rs’s UserModule field — not dead code).
  • Evidence: notification-service/src/src/infra/pii_client.rs is a byte-for-byte copy of user-secure-engine’s own pii_client.rs, including a hardcoded const CALLER_SERVICE: &str = "user-secure-engine";. Every upsert_attributes/get_attributes/delete_attributes call notification-service makes through its live UserService handler sends this literal string as caller_service.
  • Impact: Every row_attribute_audit_log entry written by a real notification-service PII call is attributed to user-secure-engine instead. An auditor answering “which system accessed this person’s data” (BRD-009’s BR-03) gets a wrong answer for every one of these calls, and a security review of user-secure-engine’s own access pattern is polluted with calls it never made.
  • Remediation direction: Change the hardcoded constant in notification-service/src/src/infra/pii_client.rs to "notification-service" — a one-line fix, since the rest of the copied client’s behavior (metadata propagation, method shapes) is correct and does not need to change.
  • Related requirement: SR-010 NFR-04

TD-03 — No central registry or enforcement preventing entity_type collisions

  • Status: Open
  • Severity: Low today — no known collision has occurred; the risk grows as more services adopt pii-service.
  • Affected component: pii-service’s UpsertAttributes/GetAttributes/DeleteAttributes — entity_type is accepted as free-form text with no validation against a known set.
  • Evidence: Today’s three in-use values ("warehouse", "user_personal", "user_address") avoid collision only because each consuming team happened to pick a distinct string — there is no shared enum, registry file, or server-side check in pii-service stopping a future consumer from reusing one of these values for unrelated data. user-secure-engine’s own user_svc_impl.rs documents a real near-miss of this exact risk: it standardized its entity_type from "user" to "user_personal" specifically to match user-preference-service’s literal, after the two values had drifted independently.
  • Impact: Two unrelated services choosing the same entity_type for different data would have their attributes interleaved under the same namespace with no structural error — a silent data-modeling collision, not a crash, making it hard to detect until someone notices unexpected attribute keys on a read.
  • Remediation direction: Maintain a single source-of-truth list of in-use entity_type values (this document’s Components table and Architecture-00009 are the closest thing today) and require a new consumer to check it before picking a value; a stronger fix would add a lightweight server-side registry check in pii-service itself, rejecting an entity_type that’s new but syntactically resembles an existing one, though this is not yet justified by actual collision incidents.
  • Related requirement: SR-010 NFR-05