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’sCreateWarehouse. - Evidence:
CreateWarehouseinserts the warehouse’s Postgres row first, then callspii.UpsertAttributes. If that call fails, it callsrepo.DeleteWarehouseByIDto roll back the row it just inserted — but if the compensating delete itself fails, the error is only passed tolog.LogErrorWithTrace, never retried or surfaced to the caller beyond the originalUpsertAttributeserror. - 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 againstpii-service’sentity_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 bynotification-service’s own liveUserServicegRPC surface (wired viaapp_config.rs’sPiiClient::connect→UserModule::build, confirmed registered asUserServiceServer::with_interceptor(...)and reachable throughstate.rs’sUserModulefield — not dead code). - Evidence:
notification-service/src/src/infra/pii_client.rsis a byte-for-byte copy ofuser-secure-engine’s ownpii_client.rs, including a hardcodedconst CALLER_SERVICE: &str = "user-secure-engine";. Everyupsert_attributes/get_attributes/delete_attributescallnotification-servicemakes through its liveUserServicehandler sends this literal string ascaller_service. - Impact: Every
row_attribute_audit_logentry written by a realnotification-servicePII call is attributed touser-secure-engineinstead. 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 ofuser-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.rsto"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’sUpsertAttributes/GetAttributes/DeleteAttributes—entity_typeis 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 inpii-servicestopping a future consumer from reusing one of these values for unrelated data.user-secure-engine’s ownuser_svc_impl.rsdocuments a real near-miss of this exact risk: it standardized itsentity_typefrom"user"to"user_personal"specifically to matchuser-preference-service’s literal, after the two values had drifted independently. - Impact: Two unrelated services choosing the same
entity_typefor 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_typevalues (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 inpii-serviceitself, rejecting anentity_typethat’s new but syntactically resembles an existing one, though this is not yet justified by actual collision incidents. - Related requirement: SR-010 NFR-05
Related Documents
- BRD-009 — Centralized Personal Information Store
- SR-010 — Centralized Personal Information Store System Requirements
- ADR-00018 — Row-Based Encrypted Attribute Model, Value-Level Encryption, and the Address-Snapshot Exception
- ADR-00019 — Dedicated pii-service vs. Duplicated Per-Service PII Handling
- Architecture: Centralized Personal Information Store
- pii-service
- inventory-service