Skip to content
ContractSpec
Start here

Package manual · integrations

·Company, work and service operations

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.

integrationsintegrationv2.0.5experimentalservernode
@lssm-tech/integration.opa-personalization-bridge
bun add @lssm-tech/integration.opa-personalization-bridge
Package source ↗Manifest ↗

Manifest declarations describe the current workspace; they do not verify registry publication or runtime execution.

Package guide

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

  • ./consent-gate — Layer 8 consent-gated behavioral signal ingestion, pseudonymized telemetry emission, mid-session withdrawal, and idempotent candidate-private erasure (createConsentGatedOpaSignalCollector, createInMemoryOpaCandidateSignalStore, probeOpaSignalAuthorityNonEscalation). Enforces zero tracking before consent, strict (tenantId, productApplicationId, candidatePrincipalRef) isolation, clean purge on erasure, and authority: 'presentation-only' / canGrantAuthority: false.
  • ./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 PreferenceEvolutionObservations and canonical BehaviorSignalModels, 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).

Relationships

THIS PACKAGEintegration.opa-personalization-bridge7 import paths

Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.

2 declarations

Declared capabilities

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.

Scripts

  • buildcontractspec-bun-build build
  • build:bundlecontractspec-bun-build transpile
  • build:typescontractspec-bun-build types
  • devcontractspec-bun-build dev
  • cleanrimraf dist .turbo
  • lint:checknode ../../../scripts/biome.cjs check .
  • lint:fixnode ../../../scripts/biome.cjs check --write .
  • testbun test
  • prebuildcontractspec-bun-build prebuild
  • typechecktsgo --noEmit