# @lssm-tech/integration.opa-notification-bridge

Bridge implementing the organization-planning CommunicationSendAdapterPort + JobsScheduleAdapterPort over injected email (EmailOutboundProvider), SMS (SmsProvider), and durable job-queue (JobQueue) transports. Feature-flag gated, fail-closed, no secrets in code.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.5`
- Package path: `packages/integrations/opa-notification-bridge`
- Manifest path: `packages/integrations/opa-notification-bridge/package.json`
- Manifest Git blob: `a106485631154c4ceb02c5281e78308fadc323cf`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/integration.opa-notification-bridge](https://lssm.co/docs/packages/integration.opa-notification-bridge/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.opa-notification-bridge.txt)

## Package metadata

```json
{
  "layer": "integrations",
  "physicalArea": null,
  "primaryArea": "company-and-work",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "integrations",
    "catalogKind": "integration",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Company, work and service operations](https://lssm.co/docs/areas/company-and-work/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/integrations/opa-notification-bridge/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/README.md",
  "blobSha": "7fe2d259d4df9b8512ae2f0c87fddacad86a1434",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/integration.opa-notification-bridge

Binds the **organization-planning** communication + jobs adapter ports to
injected notification transports — without reimplementing any provider SDK:

- `CommunicationSendAdapterPort` (`sendConfirmation` / `sendReminder` /
  `sendFollowUp`) → an injected `EmailOutboundProvider` (gmail/postmark/resend)
  for email, or an injected `SmsProvider` (Twilio, …) for SMS.
- `JobsScheduleAdapterPort` (`scheduleReminder`) → an injected durable `JobQueue`
  (Scaleway SQS / GCP Cloud Tasks / Pub-Sub) — reminders are enqueued so delivery
  survives restarts; confirmations/follow-ups send immediately.

## Posture: feature-flag gated + fail-closed

- Email and SMS sends are gated behind `OPA_NOTIFY_EMAIL` / `OPA_NOTIFY_SMS`
  (`OPA_NOTIFY_FLAGS`), both defaulting **safe (off)**.
- An unconfigured channel — flag off, transport absent, missing recipient, or no
  resolved target — yields a **no-op receipt** (`success: true`,
  `outputRefs: ['opa-notify-noop:<reason>']`). It **never throws**.
- **No secrets in code.** Every transport is injected via the constructor.

## Usage

```ts
import { createOpaNotificationBridge, OPA_NOTIFY_FLAGS } from '@lssm-tech/integration.opa-notification-bridge';

const { communication, jobs } = createOpaNotificationBridge({
  email,            // e.g. GmailOutboundProvider / PostmarkEmailProvider
  sms,              // e.g. TwilioSmsProvider
  jobs: jobQueue,   // e.g. ScalewaySqsQueue / GcpCloudTasksQueue / MemoryJobQueue
  defaultFromEmail: 'noreply@yourdomain.example',
  flags: { [OPA_NOTIFY_FLAGS.EMAIL]: true, [OPA_NOTIFY_FLAGS.SMS]: false },
  resolveNotification: (handoff, kind) => ({
    channel: 'email',
    email: lookupRecipientEmail(handoff),
    body: renderBody(handoff, kind),
  }),
});

// worker-1 threads `communication` + `jobs` into buildOpaOps.
```


The host owns `resolveNotification` (recipient/PII derivation) — the bridge never
reads recipient data from the handoff itself.

Booking delivery uses `enqueueBookingNotification`. Its durable dedupe key is
derived from tenant, booking, lifecycle version, kind, and recipient digest.
Only manage access, approval, and reminder kinds are accepted: Google
`sendUpdates=all` owns generic auto-confirm create/change/cancel delivery.
Outbox payloads contain a protected delivery ref and recipient digest, never a
recipient address or manage bearer; the delivery worker dereferences protected
material only when sending.

Delivery adapters receive the tenant reference while resolving protected
material and receive the same tenant reference plus the durable dedupe key when
sending. Hosts must forward that key to the protected sender as its idempotency
key. The Postgres host atomically claims canonical outbox rows with an expiring
owner lease, then settles or retries only with the same tenant and owner fence.
Delivery claims are likewise expiring and token-fenced by tenant and dedupe key:
crashed claims are reclaimable, while stale workers cannot complete or release a
successor's claim. Immediately before provider dispatch, the host persists a
`dispatch_ambiguous` marker. A lost provider acknowledgement therefore stays
fail-closed instead of becoming retryable; an operator must reconcile the exact
tenant/dedupe-bound provider receipt before completion resumes without another
send.


## Declared capabilities

### Integration Opa Notification Bridge

Capability ID: `package.lssm.tech.integration.opa.notification.bridge`

Bridge implementing the organization-planning CommunicationSendAdapterPort + JobsScheduleAdapterPort over injected email (EmailOutboundProvider), SMS (SmsProvider), and durable job-queue (JobQueue) transports. Feature-flag gated, fail-closed, no secrets in code.

Use cases:

- Adopt bridge implementing the organization-planning communicationsendadapterport + jobsscheduleadapterport over injected email (emailoutboundprovider), sms (smsprovider), and durable job-queue (jobqueue) transports. feature-flag gated, fail-closed, no secrets in code

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/integration.opa-notification-bridge package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "integration",
    "opa",
    "notification",
    "bridge"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/integration.opa-notification-bridge",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-notification-bridge/booking-outbox",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-notification-bridge/bridge",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-notification-bridge/types",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "integrations",
  "kind": "integration",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./booking-outbox",
    "./bridge",
    "./types"
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.integration.opa.notification.bridge",
    "from": "@lssm-tech/integration.opa-notification-bridge",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.notification.bridge",
    "from": "@lssm-tech/integration.opa-notification-bridge/booking-outbox",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.notification.bridge",
    "from": "@lssm-tech/integration.opa-notification-bridge/bridge",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.notification.bridge",
    "from": "@lssm-tech/integration.opa-notification-bridge/types",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/integration.opa-notification-bridge` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/src/index.ts); verified source file.

- `@lssm-tech/integration.opa-notification-bridge/booking-outbox` — subpath `./booking-outbox`
  - `unconditional`: `./src/booking-outbox.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/src/booking-outbox.ts); verified source file.

- `@lssm-tech/integration.opa-notification-bridge/bridge` — subpath `./bridge`
  - `unconditional`: `./src/bridge.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/src/bridge.ts); verified source file.

- `@lssm-tech/integration.opa-notification-bridge/types` — subpath `./types`
  - `unconditional`: `./src/types.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-notification-bridge/src/types.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./booking-outbox": {
      "types": "./dist/booking-outbox.d.ts",
      "bun": "./dist/booking-outbox.js",
      "node": "./dist/node/booking-outbox.js",
      "default": "./dist/booking-outbox.js"
    },
    "./bridge": {
      "types": "./dist/bridge.d.ts",
      "bun": "./dist/bridge.js",
      "node": "./dist/node/bridge.js",
      "default": "./dist/bridge.js"
    },
    "./types": {
      "types": "./dist/types.d.ts",
      "bun": "./dist/types.js",
      "node": "./dist/node/types.js",
      "default": "./dist/types.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-integrations](https://lssm.co/docs/packages/lib.contracts-integrations/): `workspace:^`
- [@lssm-tech/lib.jobs](https://lssm.co/docs/packages/lib.jobs/): `workspace:^`
- [@lssm-tech/lib.organization-planning-spec](https://lssm.co/docs/packages/lib.organization-planning-spec/): `workspace:^`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/module.organization-planning](https://lssm.co/docs/packages/module.organization-planning/): `workspace:*`
- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@types/bun`: `catalog:types`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "dev": "contractspec-bun-build dev",
  "clean": "rimraf dist .turbo",
  "lint:check": "node ../../../scripts/biome.cjs check .",
  "lint:fix": "node ../../../scripts/biome.cjs check --write .",
  "test": "bun test",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Integration Opa Notification Bridge documentation](https://www.npmjs.com/package/%40lssm-tech%2Fintegration.opa-notification-bridge) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fintegration.opa-notification-bridge",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/integration.opa-notification-bridge.txt",
  "route": "/llms/integration.opa-notification-bridge",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.opa-notification-bridge.txt",
  "blobSha": "7fe2d259d4df9b8512ae2f0c87fddacad86a1434",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
