# @lssm-tech/lib.opportunity-runtime

Pure deterministic scoring, gate, simulation, and portfolio projections for autonomous-company opportunities.

## Source and release context

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

## Package metadata

```json
{
  "layer": "domains",
  "physicalArea": "opportunity",
  "primaryArea": "intelligence-and-research",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "runtime",
    "catalogKind": "library",
    "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/opportunity/runtime/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/opportunity/runtime/README.md",
  "blobSha": "486353a2f64ee94ad6aa6a26401526edb2f6a967",
  "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/lib.opportunity-runtime`

Pure deterministic scoring, gate, simulation, and portfolio projections for autonomous-company opportunities.

This package consumes `@lssm-tech/lib.opportunity-spec` contracts and provides input-only helpers for normalizing scorecards, computing weighted scores, projecting verdicts, summarizing simulation bottlenecks, and ranking portfolios.

## Scope

Use this package to:

- normalize `0..5` scores to `0..100`;
- verify the canonical opportunity score weights sum to `100%`;
- compute weighted opportunity scores;
- apply hard-gate and evidence-threshold verdict overrides;
- summarize autonomous-operation simulation bottlenecks;
- produce deterministic portfolio selections with explainable reasons.

## Boundary

This runtime is side-effect-free. It does not fetch research, synthesize claims with LLMs, call providers, persist data, mutate files, create CompanyOS/Builder workflows, contact customers, or execute production actions. It only projects over caller-provided spec objects.

## Public entrypoints

- `@lssm-tech/lib.opportunity-runtime` — root barrel
- `@lssm-tech/lib.opportunity-runtime/scoring` — normalization and weighted scoring helpers
- `@lssm-tech/lib.opportunity-runtime/gates` — verdict and bottleneck projections
- `@lssm-tech/lib.opportunity-runtime/portfolio` — deterministic portfolio ranking

## Distribution-first discovery (additive, experimental)

The `./discovery` entrypoint screens captured draft records with supplied catalog
IDs, profile and as-of date. `selfserve-first@1.0.0` applies prerequisite gates
before ranking; unavailable dimensions retain null subtotals. Product
attractiveness, distribution feasibility, evidence strength and experiment
priority remain separate. Families are consolidated before selection, and empty
or all-blocked draft inputs return an empty shortlist with explanations.

`SALES_ASSISTED_DISCOVERY_PROFILE` (`sales-assisted@1.0.0`) screens 1.1.0 waves
with the same ranking recipe; it scores `assisted_conversion` in place of
`selfserve_adoption`. `discoveryProfileById` returns either profile. Planned sales
minutes stay assumptions until an observed metric replaces them.

The mature `rankOpportunityPortfolio` API remains unchanged: it throws on empty
input and can return a blocked primary when no candidate is viable. New discovery
callers must use the empty-safe draft result rather than interpreting that legacy
behavior as eligibility.

The `./economics` entrypoint supplies scoped acquisition, contribution, funnel,
referral, sponsor/marketplace, cohort and payback projections. Unknown inputs never
become zero; scenario estimates and editorial priors never become customer
measurements. Cost allocation must count salaries, discounts, rewards and seed
acquisition once. Finite horizons and payer-aware denominators prevent inferred
renewals, infinite lifetime value and beneficiary-to-paying-customer confusion.

Generation, research, catalog/file access and exports belong to the local runner,
not these helpers. No provider or customer-facing action is performed here.

## Package verification

- `bun run test`
- `bun run typecheck`
- `bun run lint:check`
- `bun run build`


## Declared capabilities

### Lib Opportunity Runtime

Capability ID: `package.lssm.tech.lib.opportunity.runtime`

Pure deterministic scoring, gate, simulation, and portfolio projections for autonomous-company opportunities.

Use cases:

- Adopt pure deterministic scoring, gate, simulation, and portfolio projections for autonomous-company opportunities

Constraints:

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

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "lib",
    "opportunity",
    "runtime"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.opportunity-runtime",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.opportunity-runtime/gates",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.opportunity-runtime/portfolio",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.opportunity-runtime/scoring",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.opportunity-runtime/discovery",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.opportunity-runtime/economics",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "runtime",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./gates",
    "./portfolio",
    "./scoring",
    "./discovery",
    "./economics"
  ],
  "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.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime/gates",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime/portfolio",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime/scoring",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime/discovery",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.opportunity.runtime",
    "from": "@lssm-tech/lib.opportunity-runtime/economics",
    "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/lib.opportunity-runtime` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/opportunity/runtime/src/index.ts); verified source file.

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

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

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

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

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

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

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

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

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

- `@lssm-tech/lib.opportunity-runtime/scoring` — subpath `./scoring`
  - `unconditional`: `./src/scoring.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/opportunity/runtime/src/scoring.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",
    "AGENTS.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"
    },
    "./discovery": {
      "types": "./dist/discovery.d.ts",
      "browser": "./dist/browser/discovery.js",
      "bun": "./dist/discovery.js",
      "node": "./dist/node/discovery.js",
      "default": "./dist/discovery.js"
    },
    "./economics": {
      "types": "./dist/economics.d.ts",
      "browser": "./dist/browser/economics.js",
      "bun": "./dist/economics.js",
      "node": "./dist/node/economics.js",
      "default": "./dist/economics.js"
    },
    "./economics-acquisition": {
      "types": "./dist/economics-acquisition.d.ts",
      "browser": "./dist/browser/economics-acquisition.js",
      "bun": "./dist/economics-acquisition.js",
      "node": "./dist/node/economics-acquisition.js",
      "default": "./dist/economics-acquisition.js"
    },
    "./economics-capacity": {
      "types": "./dist/economics-capacity.d.ts",
      "browser": "./dist/browser/economics-capacity.js",
      "bun": "./dist/economics-capacity.js",
      "node": "./dist/node/economics-capacity.js",
      "default": "./dist/economics-capacity.js"
    },
    "./economics-costs": {
      "types": "./dist/economics-costs.d.ts",
      "browser": "./dist/browser/economics-costs.js",
      "bun": "./dist/economics-costs.js",
      "node": "./dist/node/economics-costs.js",
      "default": "./dist/economics-costs.js"
    },
    "./economics-retention": {
      "types": "./dist/economics-retention.d.ts",
      "browser": "./dist/browser/economics-retention.js",
      "bun": "./dist/economics-retention.js",
      "node": "./dist/node/economics-retention.js",
      "default": "./dist/economics-retention.js"
    },
    "./economics-values": {
      "types": "./dist/economics-values.d.ts",
      "browser": "./dist/browser/economics-values.js",
      "bun": "./dist/economics-values.js",
      "node": "./dist/node/economics-values.js",
      "default": "./dist/economics-values.js"
    },
    "./gates": {
      "types": "./dist/gates.d.ts",
      "browser": "./dist/browser/gates.js",
      "bun": "./dist/gates.js",
      "node": "./dist/node/gates.js",
      "default": "./dist/gates.js"
    },
    "./portfolio": {
      "types": "./dist/portfolio.d.ts",
      "browser": "./dist/browser/portfolio.js",
      "bun": "./dist/portfolio.js",
      "node": "./dist/node/portfolio.js",
      "default": "./dist/portfolio.js"
    },
    "./scoring": {
      "types": "./dist/scoring.d.ts",
      "browser": "./dist/browser/scoring.js",
      "bun": "./dist/scoring.js",
      "node": "./dist/node/scoring.js",
      "default": "./dist/scoring.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.opportunity-spec](https://lssm.co/docs/packages/lib.opportunity-spec/): `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:*`
- `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
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "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": "bun lint:fix",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "test": "bun test",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Lib Opportunity Runtime documentation](https://www.npmjs.com/package/%40lssm-tech%2Flib.opportunity-runtime) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Flib.opportunity-runtime",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/lib.opportunity-runtime.txt",
  "route": "/llms/lib.opportunity-runtime",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.opportunity-runtime.txt",
  "blobSha": "486353a2f64ee94ad6aa6a26401526edb2f6a967",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
