# @lssm-tech/module.company-metrics

Governed CompanyOS metric definitions, deterministic aggregation, collection, alerts, digests, and publications.

## Source and release context

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

## Package metadata

```json
{
  "layer": "domains",
  "physicalArea": "company",
  "primaryArea": "company-and-work",
  "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: [Company, work and service operations](https://lssm.co/docs/areas/company-and-work/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/domains/company/company-metrics/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/company/company-metrics/README.md",
  "blobSha": "48993a543c00417c4406546c3c2b75b536aa03ca",
  "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.company-metrics`

CompanyOS-owned, provider-neutral metrics domain. It defines deterministic comparison windows, core templates, source and persistence ports, governed discovery, polling safety, alerts, digests, access grants, immutable publications, and Pactena's scope-bound peer contract.

AI may propose mappings and explain referenced snapshots. It never calculates values, changes approved bindings, or authorizes collection. Raw provider payloads, credentials, prompts, SQL, shell fragments, and direct personal identifiers are outside this package.

The feature is guarded by `company-metrics-v1`. Consumers must require fresh CompanyOS authority and one of `metrics.read_live`, `metrics.manage`, `metrics.collect`, `metrics.publish`, `metrics.deliver`, or `metrics.audit`.

Browser projection consumers can import `companyMetricsMessages` from the existing
`/peer-client` subpath (en/fr/es: title, unavailable, provisional, stale, growthNew,
configure, evidence, denied). It reuses the canonical display catalogs without importing
server governance or persistence. The root export remains compatible.

The `/ui` subpath is the reusable executive dashboard for hosts and bundles:
`createCompanyMetricsBrowserClient({ basePath })` is the typed same-origin
operation client (credentialed dashboard read; mutations send one idempotency
key in the `idempotency-key` header and body plus a correlation id; 401/403 map
to `denied`, any other failure to `unavailable` without inferring values), and
`CompanyMetricsLiveDashboard({ client, locale })` renders the live projection,
core-template enablement and governed discovery with en/fr/es copy
(`companyMetricsLiveMessages`). Hosts keep only the route base path.


## Declared capabilities

### Module Company Metrics

Capability ID: `package.lssm.tech.module.company.metrics`

Governed CompanyOS metric definitions, deterministic aggregation, collection, alerts, digests, and publications.

Use cases:

- Adopt governed companyos metric definitions, deterministic aggregation, collection, alerts, digests, and publications

Constraints:

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

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "module",
    "company",
    "metrics"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/module.company-metrics",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.company-metrics/peer-client",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.company-metrics/persistence",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "solutions",
  "kind": "module",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./peer-client",
    "./persistence",
    "./ui"
  ],
  "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.module.company.metrics",
    "from": "@lssm-tech/module.company-metrics",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.company.metrics",
    "from": "@lssm-tech/module.company-metrics/peer-client",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.company.metrics",
    "from": "@lssm-tech/module.company-metrics/persistence",
    "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.company-metrics` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/company/company-metrics/src/index.ts); verified source file.

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

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

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

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

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

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

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

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

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

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

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

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

- `@lssm-tech/module.company-metrics/windows` — subpath `./windows`
  - `unconditional`: `./src/windows.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/company/company-metrics/src/windows.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"
    },
    "./aggregation": {
      "types": "./dist/aggregation.d.ts",
      "bun": "./dist/aggregation.js",
      "node": "./dist/node/aggregation.js",
      "default": "./dist/aggregation.js"
    },
    "./alerts": {
      "types": "./dist/alerts.d.ts",
      "bun": "./dist/alerts.js",
      "node": "./dist/node/alerts.js",
      "default": "./dist/alerts.js"
    },
    "./calculation": {
      "types": "./dist/calculation.d.ts",
      "bun": "./dist/calculation.js",
      "node": "./dist/node/calculation.js",
      "default": "./dist/calculation.js"
    },
    "./collection": {
      "types": "./dist/collection.d.ts",
      "bun": "./dist/collection.js",
      "node": "./dist/node/collection.js",
      "default": "./dist/collection.js"
    },
    "./delivery": {
      "types": "./dist/delivery.d.ts",
      "bun": "./dist/delivery.js",
      "node": "./dist/node/delivery.js",
      "default": "./dist/delivery.js"
    },
    "./governance": {
      "types": "./dist/governance.d.ts",
      "bun": "./dist/governance.js",
      "node": "./dist/node/governance.js",
      "default": "./dist/governance.js"
    },
    "./i18n": {
      "types": "./dist/i18n.d.ts",
      "bun": "./dist/i18n.js",
      "node": "./dist/node/i18n.js",
      "default": "./dist/i18n.js"
    },
    "./peer-client": {
      "types": "./dist/peer-client.d.ts",
      "bun": "./dist/peer-client.js",
      "node": "./dist/node/peer-client.js",
      "default": "./dist/peer-client.js"
    },
    "./persistence": {
      "types": "./dist/persistence.d.ts",
      "bun": "./dist/persistence.js",
      "node": "./dist/node/persistence.js",
      "default": "./dist/persistence.js"
    },
    "./runtime": {
      "types": "./dist/runtime.d.ts",
      "bun": "./dist/runtime.js",
      "node": "./dist/node/runtime.js",
      "default": "./dist/runtime.js"
    },
    "./templates": {
      "types": "./dist/templates.d.ts",
      "bun": "./dist/templates.js",
      "node": "./dist/node/templates.js",
      "default": "./dist/templates.js"
    },
    "./ui": {
      "types": "./dist/ui/index.d.ts",
      "bun": "./dist/ui/index.js",
      "node": "./dist/node/ui/index.js",
      "default": "./dist/ui/index.js"
    },
    "./windows": {
      "types": "./dist/windows.d.ts",
      "bun": "./dist/windows.js",
      "node": "./dist/node/windows.js",
      "default": "./dist/windows.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

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

### Peer dependencies

- `react`: `catalog:`

### 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`
- `@types/node`: `catalog:types`
- `@types/react`: `catalog:types`
- `react-dom`: `catalog:`
- `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",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Module Company Metrics documentation](https://www.npmjs.com/package/%40lssm-tech%2Fmodule.company-metrics) — declared link; destination not verified.

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

## Existing agent-guide projection

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