# @lssm-tech/module.community-intelligence

Governed, provider-neutral community analytics, coaching views, and Kaizen digests.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.4`
- Package path: `packages/domains/community/module`
- Manifest path: `packages/domains/community/module/package.json`
- Manifest Git blob: `8bba26b1e7027dd6152a86c2944345ef1134cc19`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/module.community-intelligence](https://lssm.co/docs/packages/module.community-intelligence/)
- 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/domains/community/module)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/module.community-intelligence.txt)

## Package metadata

```json
{
  "layer": "domains",
  "physicalArea": "community",
  "primaryArea": "intelligence-and-research",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "solutions",
    "catalogKind": "module",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

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

Primary area: [Intelligence, research and applications](https://lssm.co/docs/areas/intelligence-and-research/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/domains/community/module/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/README.md",
  "blobSha": "235f8d7ebd5208dd0926ddcea08c67c9192ad36e",
  "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/module.community-intelligence`

Provider-neutral community intelligence for multiple Discord guilds or other
community sources. It converts normalized, tenant-scoped events into per-source
and cross-source recurring-question, pain/friction, response, moderation,
stable-user journey, coaching, and weekly Kaizen projections.

The module is observation-only. Raw provider ingestion, credentials, storage,
moderation actions, and LLM SDKs stay behind host-owned ports. Before optional
external analysis, content is redacted and actors are pseudonymized. The
analysis boundary accepts only EU-resident, training-disabled providers; an
unavailable or non-compliant provider produces the deterministic local fallback.

Individual staff scorecards require `community.staff-scorecards.read` authority.
Default projections are team-level and deliberately contain no leaderboard,
rank, employment recommendation, or automated HR decision fields.

```ts
import { CommunityIntelligenceService } from "@lssm-tech/module.community-intelligence";

const service = new CommunityIntelligenceService();
const projection = await service.analyze({
  scope: {
    tenantId: "tenant-1",
    workspaceId: "workspace-1",
    trustZone: "managed-community",
  },
  sources,
  events,
  identityLinks,
  authority: { capabilities: [] },
  window: { from: "2026-08-10T00:00:00.000Z", to: "2026-08-17T00:00:00.000Z" },
});
```


Hosts remain responsible for durable encrypted evidence, retention enforcement,
row-level security, and resolving evidence references under authorization.

## Discord analysis rules

`@lssm-tech/module.community-intelligence/discord-analysis` owns the pure
Discord rules hosts apply to gateway payloads before persistence:
actor-role classification (bot, then moderator, then staff role IDs),
transient analysis drafts that keep only `DefaultCommunityRedaction` output,
question and pain signals (`COMMUNITY_PAIN_SIGNALS`), and derived event kinds
(`staff.replied`, `moderation.action` for auto-moderation and audit actions
20/22/24/72/73, `moderation.reversed` for action 23). The keyed actor
pseudonymizer and its secret stay in the host.

`@lssm-tech/module.community-intelligence/discord-intelligence-records` builds
the seven-day insight, staff-scorecard, portfolio-insight and Kaizen-digest
records from redacted analysis events. All sources must share tenant,
workspace and trust zone. Cross-source aggregates and the digest stay in the
`staff` zone only for staff sources; every other zone is downgraded to
`portfolio`. Hosts map the records to their own storage.

`DefaultCommunityRedaction` replaces mentions, URLs, emails, phone numbers,
keyword-prefixed tokens and opaque 32+ character tokens.


## Declared capabilities

### Community Intelligence

Capability ID: `package.lssm.tech.module.community.intelligence`

Evidence-backed multi-community insights, coaching views, and Kaizen digests.

Use cases:

- Analyze recurring community needs and staff response patterns across governed sources

Constraints:

```json
{
  "platforms": [
    "server",
    "web"
  ],
  "runtimes": [
    "node",
    "browser"
  ],
  "avoidWhen": [
    "Raw provider ingestion or automated employment decisions are required."
  ],
  "requires": [
    "Normalized community events",
    "Tenant-scoped authority"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "community analytics",
    "discord analytics",
    "kaizen",
    "staff coaching"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/module.community-intelligence",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "solutions",
  "kind": "module",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server",
    "web"
  ],
  "runtimes": [
    "node",
    "browser"
  ],
  "entrypoints": [
    ".",
    "./contracts",
    "./discord-analysis",
    "./discord-intelligence-records",
    "./privacy",
    "./service",
    "./ui",
    "./view-model"
  ],
  "examples": [],
  "replacements": [],
  "visualTesting": {
    "status": "deferred",
    "owner": "@contractspec-core",
    "targetWave": "wave-3-react-packages",
    "rationale": "Foundational Storybook adoption establishes shared catalogs and guardrails before this package migrates."
  }
}
```

## 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.module.community.intelligence",
    "from": "@lssm-tech/module.community-intelligence",
    "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/module.community-intelligence` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/index.ts); verified source file.

- `@lssm-tech/module.community-intelligence/analysis-preparation` — subpath `./analysis-preparation`
  - `unconditional`: `./src/analysis-preparation.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/analysis-preparation.ts); verified source file.

- `@lssm-tech/module.community-intelligence/contracts` — subpath `./contracts`
  - `unconditional`: `./src/contracts.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/contracts.ts); verified source file.

- `@lssm-tech/module.community-intelligence/digest` — subpath `./digest`
  - `unconditional`: `./src/digest.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/digest.ts); verified source file.

- `@lssm-tech/module.community-intelligence/discord-analysis` — subpath `./discord-analysis`
  - `unconditional`: `./src/discord-analysis.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/discord-analysis.ts); verified source file.

- `@lssm-tech/module.community-intelligence/discord-intelligence-records` — subpath `./discord-intelligence-records`
  - `unconditional`: `./src/discord-intelligence-records.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/discord-intelligence-records.ts); verified source file.

- `@lssm-tech/module.community-intelligence/findings` — subpath `./findings`
  - `unconditional`: `./src/findings.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/findings.ts); verified source file.

- `@lssm-tech/module.community-intelligence/metrics` — subpath `./metrics`
  - `unconditional`: `./src/metrics.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/metrics.ts); verified source file.

- `@lssm-tech/module.community-intelligence/ports` — subpath `./ports`
  - `unconditional`: `./src/ports.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/ports.ts); verified source file.

- `@lssm-tech/module.community-intelligence/privacy` — subpath `./privacy`
  - `unconditional`: `./src/privacy.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/privacy.ts); verified source file.

- `@lssm-tech/module.community-intelligence/projections` — subpath `./projections`
  - `unconditional`: `./src/projections.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/projections.ts); verified source file.

- `@lssm-tech/module.community-intelligence/service` — subpath `./service`
  - `unconditional`: `./src/service.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/service.ts); verified source file.

- `@lssm-tech/module.community-intelligence/ui` — subpath `./ui`
  - `unconditional`: `./src/ui/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/ui/index.ts); verified source file.

- `@lssm-tech/module.community-intelligence/ui/CommunityIntelligenceDashboard` — subpath `./ui/CommunityIntelligenceDashboard`
  - `unconditional`: `./src/ui/CommunityIntelligenceDashboard.tsx` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/ui/CommunityIntelligenceDashboard.tsx); verified source file.

- `@lssm-tech/module.community-intelligence/view-model` — subpath `./view-model`
  - `unconditional`: `./src/view-model.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/community/module/src/view-model.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"
    },
    "./analysis-preparation": {
      "types": "./dist/analysis-preparation.d.ts",
      "browser": "./dist/browser/analysis-preparation.js",
      "bun": "./dist/analysis-preparation.js",
      "node": "./dist/node/analysis-preparation.js",
      "default": "./dist/analysis-preparation.js"
    },
    "./contracts": {
      "types": "./dist/contracts.d.ts",
      "browser": "./dist/browser/contracts.js",
      "bun": "./dist/contracts.js",
      "node": "./dist/node/contracts.js",
      "default": "./dist/contracts.js"
    },
    "./digest": {
      "types": "./dist/digest.d.ts",
      "browser": "./dist/browser/digest.js",
      "bun": "./dist/digest.js",
      "node": "./dist/node/digest.js",
      "default": "./dist/digest.js"
    },
    "./discord-analysis": {
      "types": "./dist/discord-analysis.d.ts",
      "browser": "./dist/browser/discord-analysis.js",
      "bun": "./dist/discord-analysis.js",
      "node": "./dist/node/discord-analysis.js",
      "default": "./dist/discord-analysis.js"
    },
    "./discord-intelligence-records": {
      "types": "./dist/discord-intelligence-records.d.ts",
      "browser": "./dist/browser/discord-intelligence-records.js",
      "bun": "./dist/discord-intelligence-records.js",
      "node": "./dist/node/discord-intelligence-records.js",
      "default": "./dist/discord-intelligence-records.js"
    },
    "./findings": {
      "types": "./dist/findings.d.ts",
      "browser": "./dist/browser/findings.js",
      "bun": "./dist/findings.js",
      "node": "./dist/node/findings.js",
      "default": "./dist/findings.js"
    },
    "./metrics": {
      "types": "./dist/metrics.d.ts",
      "browser": "./dist/browser/metrics.js",
      "bun": "./dist/metrics.js",
      "node": "./dist/node/metrics.js",
      "default": "./dist/metrics.js"
    },
    "./ports": {
      "types": "./dist/ports.d.ts",
      "browser": "./dist/browser/ports.js",
      "bun": "./dist/ports.js",
      "node": "./dist/node/ports.js",
      "default": "./dist/ports.js"
    },
    "./privacy": {
      "types": "./dist/privacy.d.ts",
      "browser": "./dist/browser/privacy.js",
      "bun": "./dist/privacy.js",
      "node": "./dist/node/privacy.js",
      "default": "./dist/privacy.js"
    },
    "./projections": {
      "types": "./dist/projections.d.ts",
      "browser": "./dist/browser/projections.js",
      "bun": "./dist/projections.js",
      "node": "./dist/node/projections.js",
      "default": "./dist/projections.js"
    },
    "./service": {
      "types": "./dist/service.d.ts",
      "browser": "./dist/browser/service.js",
      "bun": "./dist/service.js",
      "node": "./dist/node/service.js",
      "default": "./dist/service.js"
    },
    "./ui": {
      "types": "./dist/ui/index.d.ts",
      "browser": "./dist/browser/ui/index.js",
      "bun": "./dist/ui/index.js",
      "node": "./dist/node/ui/index.js",
      "default": "./dist/ui/index.js"
    },
    "./ui/CommunityIntelligenceDashboard": {
      "types": "./dist/ui/CommunityIntelligenceDashboard.d.ts",
      "browser": "./dist/browser/ui/CommunityIntelligenceDashboard.js",
      "bun": "./dist/ui/CommunityIntelligenceDashboard.js",
      "node": "./dist/node/ui/CommunityIntelligenceDashboard.js",
      "default": "./dist/ui/CommunityIntelligenceDashboard.js"
    },
    "./view-model": {
      "types": "./dist/view-model.d.ts",
      "browser": "./dist/browser/view-model.js",
      "bun": "./dist/view-model.js",
      "node": "./dist/node/view-model.js",
      "default": "./dist/view-model.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.communication-spec](https://lssm.co/docs/packages/lib.communication-spec/): `workspace:^`
- [@lssm-tech/lib.design-system](https://lssm.co/docs/packages/lib.design-system/): `workspace:^`
- `react`: `catalog:`

### 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/react`: `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",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "test": "bun test",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Community Intelligence module documentation](https://www.npmjs.com/package/%40lssm-tech%2Fmodule.community-intelligence) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fmodule.community-intelligence",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/module.community-intelligence.txt",
  "route": "/llms/module.community-intelligence",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/module.community-intelligence.txt",
  "blobSha": "235f8d7ebd5208dd0926ddcea08c67c9192ad36e",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
