# Permanent Security Identifier Mapping

> Scoped, Effective-Dated Crosswalks

`D02-F03-A01` · Corporate Actions and Security Master Data → Identity Continuity · archetype `row-classify` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/identity-continuity/permanent-security-identifier-mapping/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { resolveIdentifier } from "fintech-algorithms/corporate-actions-and-security-master-data/identity-continuity/permanent-security-identifier-mapping";
```

## Signature

```ts
resolveIdentifier(data)
```

Resolves a vendor or exchange identifier to a permanent internal key. Tickers are recycled and vendor ids are reassigned; anything keyed on them corrupts its own history without ever raising an error.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ query: { identifier: string; validAt: string; knowledgeAt: string }; assertions: Assertion[] }` | yes | `validAt` is when the identifier was in use and `knowledgeAt` when you are asking — the two differ whenever a mapping is corrected after the fact. `assertions` is the evidence set the resolution draws on. |

## Returns

`{ status, canonicalId, candidateCanonicalIds, confidence, evidence, … }`

The resolved key with its confidence and the evidence behind it — and, when the identifier is genuinely ambiguous, every candidate rather than an arbitrary pick.

## Errors

- When the query is missing an identifier or a time — throws

## Complexity

Time `O(assertions)`, space `O(candidates)`.

## Worked example

This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

### Input

`data`:

```json
{
  "query": {
    "source": {
      "scheme": "TICKER",
      "value": "alp",
      "entityLevel": "trading_line",
      "venueMic": "xnas"
    },
    "validAt": "2024-06-15T14:30:00Z",
    "knowledgeAt": "2024-06-20T12:00:00Z"
  },
  "assertions": [
    {
      "assertionId": "SYN-MAP-001",
      "revision": 1,
      "source": {
        "scheme": "TICKER",
        "value": "ALP",
        "entityLevel": "trading_line",
        "venueMic": "XNAS"
      },
      "target": {
        "canonicalId": "SYN-LINE-ALPHA-XNAS-USD",
        "entityLevel": "trading_line"
      },
      "validFrom": "2024-01-02T14:30:00Z",
      "validTo": "2024-07-01T13:30:00Z",
      "observedAt": "2023-12-20T18:00:00Z",
      "availableAt": "2023-12-20T18:05:00Z",
      "status": "active",
      "confidence": "authoritative",
      "checkDigitStatus": "not_applicable",
      "assignmentAuthority": "SYNTHETIC EXCHANGE NOTICE SERVICE",
      "sourceDocumentId": "SYN-NOTICE-100-R1"
    },
    {
      "assertionId": "SYN-MAP-001",
      "revision": 2,
      "source": {
        "scheme": "TICKER",
        "value": "ALP",
        "entityLevel": "trading_line",
        "venueMic": "XNAS"
      },
      "target": {
        "canonicalId": "SYN-LINE-BETA-XNAS-USD",
        "entityLevel": "trading_line"
      },
      "validFrom": "2024-01-02T14:30:00Z",
      "validTo": "2024-07-01T13:30:00Z",
      "observedAt": "2024-06-25T09:00:00Z",
      "availableAt": "2024-06-25T09:05:00Z",
      "status": "active",
      "confidence": "authoritative",
      "checkDigitStatus": "not_applicable",
      "assignmentAuthority": "SYNTHETIC EXCHANGE NOTICE SERVICE",
      "sourceDocumentId": "SYN-CORRECTION-100-R2"
    },
    {
      "assertionId": "SYN-MAP-002",
      "revision": 1,
      "source": {
        "scheme": "TICKER",
        "value": "ALP",
        "entityLevel": "trading_line",
        "venueMic": "XNAS"
      },
      "target": {
        "canonicalId": "SYN-LINE-GAMMA-XNAS-USD",
        "entityLevel": "trading_line"
      },
      "validFrom": "2024-07-01T13:30:00Z",
      "validTo": null,
      "observedAt": "2024-06-10T16:00:00Z",
      "availableAt": "2024-06-10T16:03:00Z",
      "status": "active",
      "confidence": "authoritative",
      "checkDigitStatus": "not_applicable",
      "assignmentAuthority": "SYNTHETIC EXCHANGE NOTICE SERVICE",
      "sourceDocumentId": "SYN-NOTICE-101-R1"
    }
  ]
}
```

### Call

```ts
resolveIdentifier(data)
```

### Returns

object with 9 fields: status, source, validAt, knowledgeAt, canonicalId, candidateCanonicalIds, confidence, evidence, …

```json
{
  "status": "resolved",
  "source": {
    "scheme": "TICKER",
    "value": "ALP",
    "entityLevel": "trading_line",
    "venueMic": "XNAS"
  },
  "validAt": "2024-06-15T14:30:00Z",
  "knowledgeAt": "2024-06-20T12:00:00Z",
  "canonicalId": "SYN-LINE-ALPHA-XNAS-USD",
  "candidateCanonicalIds": ["SYN-LINE-ALPHA-XNAS-USD"],
  "confidence": "authoritative",
  "evidence": [
    {
      "assertionId": "SYN-MAP-001",
      "revision": 1,
      "availableAt": "2023-12-20T18:05:00Z",
      "assignmentAuthority": "SYNTHETIC EXCHANGE NOTICE SERVICE",
      "sourceDocumentId": "SYN-NOTICE-100-R1",
      "confidence": "authoritative",
      "checkDigitStatus": "not_applicable"
    }
  ],
  "reason": "Exactly one canonical entity is supported at both requested clocks."
}
```

## Verification and provenance

Tier: **verified** (via input-expected).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/corporate-actions-and-security-master-data/identity-continuity/permanent-security-identifier-mapping/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/corporate-actions-and-security-master-data/identity-continuity/permanent-security-identifier-mapping/impl.ts
- Standalone repository: https://github.com/IslamBaraka90/Fintech-Permanent-Security-Identifier-Mapping-Corporate-Actions-algorithm
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/llms.txt
