# @lssm-tech/lib.economic-evidence

Provider-neutral economic evidence primitives for usage, cost, budget, replay, and projection refs.

## Source and release context

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

## Package metadata

```json
{
  "layer": "platform",
  "physicalArea": "governance",
  "primaryArea": "governance-and-approvals",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "sharedLibs",
    "catalogKind": "library",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

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

Primary area: [Governance, decisions and approvals](https://lssm.co/docs/areas/governance-and-approvals/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/platform/governance/economic-evidence/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/README.md",
  "blobSha": "08e49bd4ecff5b6db4082259d3f97bbb4661a064",
  "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.economic-evidence

Provider-neutral economic evidence primitives for ContractSpec applications.

This package is the neutral spine selected by Ultragoal G002 for usage-based and commission-based systems. It records replayable facts and refs for cost, usage, budget decisions, redaction, replay, and projection consumers without owning provider SDKs, BillingOS invoices/payments, FinanceOps advice, or observability implementations.

## Exports

- `@lssm-tech/lib.economic-evidence`
- `@lssm-tech/lib.economic-evidence/cost`
- `@lssm-tech/lib.economic-evidence/decimal`
- `@lssm-tech/lib.economic-evidence/dimensions`
- `@lssm-tech/lib.economic-evidence/ledger`
- `@lssm-tech/lib.economic-evidence/usage`
- `@lssm-tech/lib.economic-evidence/budget`
- `@lssm-tech/lib.economic-evidence/replay`
- `@lssm-tech/lib.economic-evidence/reconciliation`
- `@lssm-tech/lib.economic-evidence/seam-kind`
- `@lssm-tech/lib.economic-evidence/projection-policy`
- `@lssm-tech/lib.economic-evidence/projection-refs`
- `@lssm-tech/lib.economic-evidence/unit-economics`

## Reconciled Cost Truth

`EconomicLedgerEntryV1` models the append-only lifecycle `estimate → reservation → execution_usage → provider_actual → invoice_import → correction`. Corrections cite the entry they supersede; history is never deleted. `reconciliationKey` keeps successive observations of one economic fact from being double counted, while independent resources or usage lines remain independently additive.

Authoritative provider, invoice, reservation, and correction entries require exact minor-unit or decimal-string amounts. Estimated number-based compatibility records remain explicitly classified as estimates. Hard budget gates return `review_required` when cost evidence is unknown, stale, or unit-incompatible.

Allocation dimensions cover organization, tenant, workspace, environment, deployable, service, resource, capability, feature, contract/operation/version, endpoint, GraphQL, MCP, webhook, workflow, job, agent/tool invocation, provider/model, flag/variant, experiment, deployment, goal, and cost center. All calculations and canonicalization are deterministic and side-effect free.

## Boundary

Producer packages may emit or cite these records. Projection packages may cite refs. This package must remain side-effect free and must not import provider, billing, finance, observability, or runtime implementations.

## Projection And Seam Policy

Use `createStandardEconomicProjectionRefs()` from `@lssm-tech/lib.economic-evidence/projection-policy` to produce reference-only projections for BillingOS, FinanceOps, observability, and replay reports. Billing projections carry `not_an_invoice`; FinanceOps projections carry `not_accounting_export`; observability and replay projections are display-only.

## Monorepo Enforcement

Production declarations use `tsconfig.build.json`, which extends the strict source
configuration and excludes test and spec files. `bun run typecheck` continues to
use `tsconfig.json`, including source-only tests; the production build does not
change their typechecking requirements.

`src/adoption-enforcement.test.ts` guards the current vertical slice: cost-tracking, ai-providers, ai-agent, and builder-runtime must depend on the neutral evidence package; ai/chat/builder public evidence entrypoints must remain exported; and the neutral package must stay free of runtime, provider, billing, finance, observability, and payment dependencies.

The `seam-kind` bridge maps canonical `economic_*` evidence ref kinds into the short contract/runtime seam categories (`usage`, `cost`, `budget`, `replay`, `projection`). This keeps OperationSpec and runtime events compact while preserving the canonical neutral ref taxonomy for persisted evidence.

Published export maps include explicit browser conditions for the emitted browser
artifacts, alongside the existing Node and Bun conditions. A browser bundler can
select these without relying on the default server-runtime condition.


## Declared capabilities

### Lib Economic Evidence

Capability ID: `package.lssm.tech.lib.economic.evidence`

Provider-neutral economic evidence primitives for usage, cost, budget, replay, and projection refs.

Use cases:

- Adopt provider-neutral economic evidence primitives for usage, cost, budget, replay, and projection refs

Constraints:

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

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "contractspec",
    "economic-evidence",
    "cost",
    "usage",
    "budget",
    "replay",
    "typescript",
    "lib",
    "economic",
    "evidence"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.economic-evidence",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/budget",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/cost",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/decimal",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/dimensions",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/ledger",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/projection-policy",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/projection-refs",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/reconciliation",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/replay",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/seam-kind",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.economic-evidence/unit-economics",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "sharedLibs",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./budget",
    "./cost",
    "./decimal",
    "./dimensions",
    "./ledger",
    "./projection-policy",
    "./projection-refs",
    "./reconciliation",
    "./replay",
    "./seam-kind",
    "./unit-economics",
    "./usage"
  ],
  "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.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/budget",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/cost",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/decimal",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/dimensions",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/ledger",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/projection-policy",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/projection-refs",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/reconciliation",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/replay",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/seam-kind",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.economic.evidence",
    "from": "@lssm-tech/lib.economic-evidence/unit-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.economic-evidence` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/index.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/budget` — subpath `./budget`
  - `unconditional`: `./src/budget.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/budget.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/cost` — subpath `./cost`
  - `unconditional`: `./src/cost.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/cost.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/decimal` — subpath `./decimal`
  - `unconditional`: `./src/decimal.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/decimal.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/dimensions` — subpath `./dimensions`
  - `unconditional`: `./src/dimensions.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/dimensions.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/ledger` — subpath `./ledger`
  - `unconditional`: `./src/ledger.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/ledger.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/projection-policy` — subpath `./projection-policy`
  - `unconditional`: `./src/projection-policy.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/projection-policy.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/projection-refs` — subpath `./projection-refs`
  - `unconditional`: `./src/projection-refs.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/projection-refs.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/reconciliation` — subpath `./reconciliation`
  - `unconditional`: `./src/reconciliation.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/reconciliation.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/replay` — subpath `./replay`
  - `unconditional`: `./src/replay.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/replay.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/seam-kind` — subpath `./seam-kind`
  - `unconditional`: `./src/seam-kind.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/seam-kind.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/unit-economics` — subpath `./unit-economics`
  - `unconditional`: `./src/unit-economics.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/unit-economics.ts); verified source file.

- `@lssm-tech/lib.economic-evidence/usage` — subpath `./usage`
  - `unconditional`: `./src/usage.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/governance/economic-evidence/src/usage.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"
    },
    "./budget": {
      "types": "./dist/budget.d.ts",
      "browser": "./dist/browser/budget.js",
      "bun": "./dist/budget.js",
      "node": "./dist/node/budget.js",
      "default": "./dist/budget.js"
    },
    "./cost": {
      "types": "./dist/cost.d.ts",
      "browser": "./dist/browser/cost.js",
      "bun": "./dist/cost.js",
      "node": "./dist/node/cost.js",
      "default": "./dist/cost.js"
    },
    "./decimal": {
      "types": "./dist/decimal.d.ts",
      "browser": "./dist/browser/decimal.js",
      "bun": "./dist/decimal.js",
      "node": "./dist/node/decimal.js",
      "default": "./dist/decimal.js"
    },
    "./dimensions": {
      "types": "./dist/dimensions.d.ts",
      "browser": "./dist/browser/dimensions.js",
      "bun": "./dist/dimensions.js",
      "node": "./dist/node/dimensions.js",
      "default": "./dist/dimensions.js"
    },
    "./ledger": {
      "types": "./dist/ledger.d.ts",
      "browser": "./dist/browser/ledger.js",
      "bun": "./dist/ledger.js",
      "node": "./dist/node/ledger.js",
      "default": "./dist/ledger.js"
    },
    "./projection-policy": {
      "types": "./dist/projection-policy.d.ts",
      "browser": "./dist/browser/projection-policy.js",
      "bun": "./dist/projection-policy.js",
      "node": "./dist/node/projection-policy.js",
      "default": "./dist/projection-policy.js"
    },
    "./projection-refs": {
      "types": "./dist/projection-refs.d.ts",
      "browser": "./dist/browser/projection-refs.js",
      "bun": "./dist/projection-refs.js",
      "node": "./dist/node/projection-refs.js",
      "default": "./dist/projection-refs.js"
    },
    "./reconciliation": {
      "types": "./dist/reconciliation.d.ts",
      "browser": "./dist/browser/reconciliation.js",
      "bun": "./dist/reconciliation.js",
      "node": "./dist/node/reconciliation.js",
      "default": "./dist/reconciliation.js"
    },
    "./replay": {
      "types": "./dist/replay.d.ts",
      "browser": "./dist/browser/replay.js",
      "bun": "./dist/replay.js",
      "node": "./dist/node/replay.js",
      "default": "./dist/replay.js"
    },
    "./seam-kind": {
      "types": "./dist/seam-kind.d.ts",
      "browser": "./dist/browser/seam-kind.js",
      "bun": "./dist/seam-kind.js",
      "node": "./dist/node/seam-kind.js",
      "default": "./dist/seam-kind.js"
    },
    "./unit-economics": {
      "types": "./dist/unit-economics.d.ts",
      "browser": "./dist/browser/unit-economics.js",
      "bun": "./dist/unit-economics.js",
      "node": "./dist/node/unit-economics.js",
      "default": "./dist/unit-economics.js"
    },
    "./usage": {
      "types": "./dist/usage.d.ts",
      "browser": "./dist/browser/usage.js",
      "bun": "./dist/usage.js",
      "node": "./dist/node/usage.js",
      "default": "./dist/usage.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

No declarations in the inspected manifest.

### 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 Economic Evidence documentation](https://www.npmjs.com/package/%40lssm-tech%2Flib.economic-evidence) — declared link; destination not verified.

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

## Existing agent-guide projection

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