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

Bridge mapping the canonical @lssm-tech/lib.personalization surfaces (preference-dimensions, preference-evolution, behavior-signals, adaptive-surface) onto OPA optimizer objective weights, the behavior→preference learning loop, and role-aware booking/UI adaptation. No ad-hoc preference state.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.5`
- Package path: `packages/integrations/opa-personalization-bridge`
- Manifest path: `packages/integrations/opa-personalization-bridge/package.json`
- Manifest Git blob: `ab464093755648311c2e7af2c34571de507b7348`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/integration.opa-personalization-bridge](https://lssm.co/docs/packages/integration.opa-personalization-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-personalization-bridge)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-personalization-bridge/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-personalization-bridge/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.opa-personalization-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-personalization-bridge/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-personalization-bridge/README.md",
  "blobSha": "08d49b89f940a4136b798fd08f664c36281b56b7",
  "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-personalization-bridge

Bridge between the canonical `@lssm-tech/lib.personalization` surfaces and
Organization Planning & Agenda (OPA). It exists so OPA never grows ad-hoc
preference state — all behaviour/preference logic flows through the
canonical personalization lib.

## Surfaces

- **`./objective`** — `mapPreferencesToObjective(dimensions)`: pure,
  deterministic mapping of the 7-dimension `PreferenceDimensions` model onto
  the OPA optimizer's `OptimizerObjectiveWeights` (focus defense, priority,
  deadline urgency, fragmentation, context switch). Deep-work preferences
  raise `focusDefenseWeight`; deadline-driven preferences raise
  `deadlineUrgencyWeight`.
- **`./learning`** — the behaviour → preference learning loop. OPA
  scheduling interactions (focus respected/broken, slot rescheduled,
  evidence expanded, guidance dismissed…) become canonical
  `PreferenceEvolutionObservation`s and canonical `BehaviorSignalModel`s,
  fed through `suggestPreferenceEvolution` so the objective weights adapt
  over time. Behaviour signals carry only interaction kinds, dimension ids,
  and opaque surface ids — **no PII**.
- **`./surface`** — `resolveOpaAdaptiveSurface(...)`: a typed accessor the
  host/UI consumes to adapt booking/planning per user preference AND role.
  RoleMorph/ACL boundaries are authoritative and fail closed (a read-only
  auditor never gets advanced controls). Its `reasons` trace resolves from the
  OPA catalog (`experience.personalization.reason.*`) in the optional
  `locale` (`en` by default).
- **`./opa-policy`** — `deriveObjectiveFromOpaPolicy(policy)`: maps the OPA
  spec's local policy enums onto canonical preferences, so the spec's
  `applyOpaPersonalizationPolicy` can delegate to the canonical mapping
  instead of maintaining a parallel scoring system.

## Privacy

Behaviour data is personal data and is minimised. Signals never include
actor identity, names, emails, titles, or free text — only stable ids and
dimension keys. `createBehaviorSignalModel` additionally fails closed on
unsafe behavioural labelling.

## Layering

This is an integration: it depends only downward on `lib.personalization`
and `lib.organization-planning-spec`. It owns no scheduling, persistence, or
optimizer logic (those live in spec/runtime).


## Declared capabilities

### Integration Opa Personalization Bridge

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

Bridge mapping the canonical @lssm-tech/lib.personalization surfaces (preference-dimensions, preference-evolution, behavior-signals, adaptive-surface) onto OPA optimizer objective weights, the behavior→preference learning loop, and role-aware booking/UI adaptation. No ad-hoc preference state.

Use cases:

- Adopt bridge mapping the canonical @lssm-tech/lib.personalization surfaces (preference-dimensions, preference-evolution, behavior-signals, adaptive-surface) onto opa optimizer objective weights, the behavior→preference learning loop, and role-aware booking/ui adaptation. no ad-hoc preference state

Constraints:

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

Other capability declarations:

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

Capability imports:

```json
[
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge/learning",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge/objective",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge/opa-policy",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge/surface",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.opa-personalization-bridge/types",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "integrations",
  "kind": "integration",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./learning",
    "./objective",
    "./opa-policy",
    "./surface",
    "./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.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-bridge",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-bridge/learning",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-bridge/objective",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-bridge/opa-policy",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-bridge/surface",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.opa.personalization.bridge",
    "from": "@lssm-tech/integration.opa-personalization-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-personalization-bridge` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-personalization-bridge/src/index.ts); verified source file.

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

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

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

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

- `@lssm-tech/integration.opa-personalization-bridge/types` — subpath `./types`
  - `unconditional`: `./src/types.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/opa-personalization-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",
      "browser": "./dist/browser/index.js",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./learning": {
      "types": "./dist/learning.d.ts",
      "browser": "./dist/browser/learning.js",
      "bun": "./dist/learning.js",
      "node": "./dist/node/learning.js",
      "default": "./dist/learning.js"
    },
    "./objective": {
      "types": "./dist/objective.d.ts",
      "browser": "./dist/browser/objective.js",
      "bun": "./dist/objective.js",
      "node": "./dist/node/objective.js",
      "default": "./dist/objective.js"
    },
    "./opa-policy": {
      "types": "./dist/opa-policy.d.ts",
      "browser": "./dist/browser/opa-policy.js",
      "bun": "./dist/opa-policy.js",
      "node": "./dist/node/opa-policy.js",
      "default": "./dist/opa-policy.js"
    },
    "./surface": {
      "types": "./dist/surface.d.ts",
      "browser": "./dist/browser/surface.js",
      "bun": "./dist/surface.js",
      "node": "./dist/node/surface.js",
      "default": "./dist/surface.js"
    },
    "./types": {
      "types": "./dist/types.d.ts",
      "browser": "./dist/browser/types.js",
      "bun": "./dist/types.js",
      "node": "./dist/node/types.js",
      "default": "./dist/types.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

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

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@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 Personalization Bridge documentation](https://www.npmjs.com/package/%40lssm-tech%2Fintegration.opa-personalization-bridge) — declared link; destination not verified.

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

## Existing agent-guide projection

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