# @lssm-tech/lib.personal-health-runtime

Pure PersonalOS health authorization, normalization, reconciliation, and sync runtime.

## Source and release context

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

## Package metadata

```json
{
  "layer": "domains",
  "physicalArea": "personal-health",
  "primaryArea": "personal-and-learning",
  "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: [Personal workflows, learning and progress](https://lssm.co/docs/areas/personal-and-learning/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/domains/personal-health/runtime/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/personal-health/runtime/README.md",
  "blobSha": "74808463194608279648ac6b9e6fb49ac0618b9e",
  "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.personal-health-runtime`

Provider-neutral PersonalOS health runtime for consent authorization, strict
normalization, deterministic reconciliation, and lossless paginated sync state.
Hosts supply credentials, providers, durable storage, and effects through ports.

The additive strict runtime surface provides operation-level consent decisions,
provider sync/ledger/checkpoint ports, and structured quarantine. Checkpoints
carry durable cursor references and processed page references for replay-safe
recovery. No runtime path substitutes missing values, units, timestamps, time
zones, provenance, cursors, or provider health.

Reconciliation treats an exact provider digest as replay, a changed canonical
ID as an append-only correction, and an exact cross-provider metric/value/unit/
time interval as an explicit overlap. Both overlapping records and their source
evidence remain durable; disagreements stay separate rather than being merged.

`./wellbeing-goal` derives the complete draft/active/paused/completed/stopped/
revoked lifecycle from strict commands. It revalidates exact subject and
connection versions, provider-field evidence, consent-bound accepted records,
time windows, revisions, idempotency, command and state digests, receipt
binding, and verified guardrail pauses. Only the subject records an uncertain
outcome; the runtime never invents a causal or clinical interpretation.

`proposeSustainableRoutineV1` (workflow `health-routine-v1`) builds a
workload-aware routine proposal from goal-support-consented measurements and
self-reports, keeping assistant interpretations as a distinct, source-linked
type. It caps actions by workload, requires subject acceptance, and turns
symptom questions into proposed clinician follow-ups without diagnosis or
treatment change. `disclosePersonalHealthRoutineV1` returns detail only to the
subject; company briefs, employee views, commercial telemetry, coding-worker
prompts and support agents are withheld unless an exact scoped authority
exists, and then receive routine status only.


## Declared capabilities

### Lib Personal Health Runtime

Capability ID: `package.lssm.tech.lib.personal.health.runtime`

Pure PersonalOS health authorization, normalization, reconciliation, and sync runtime.

Use cases:

- Adopt pure personalos health authorization, normalization, reconciliation, and sync runtime

Constraints:

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

Other capability declarations:

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

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.personal-health-runtime",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/authorization",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/granular-authorization",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/normalization",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/ports",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/provider-ports",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/reconciliation",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/strict-normalization",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/sync",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.personal-health-runtime/wellbeing-goal",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "runtime",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./authorization",
    "./granular-authorization",
    "./normalization",
    "./ports",
    "./provider-ports",
    "./reconciliation",
    "./strict-normalization",
    "./sync",
    "./wellbeing-goal"
  ],
  "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.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/authorization",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/granular-authorization",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/normalization",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/ports",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/provider-ports",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/reconciliation",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/strict-normalization",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/sync",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.personal.health.runtime",
    "from": "@lssm-tech/lib.personal-health-runtime/wellbeing-goal",
    "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.personal-health-runtime` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/personal-health/runtime/src/index.ts); verified source file.

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

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

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

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

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

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

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

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

- `@lssm-tech/lib.personal-health-runtime/wellbeing-goal` — subpath `./wellbeing-goal`
  - `unconditional`: `./src/wellbeing-goal.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/domains/personal-health/runtime/src/wellbeing-goal.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"
    },
    "./authorization": {
      "types": "./dist/authorization.d.ts",
      "browser": "./dist/browser/authorization.js",
      "bun": "./dist/authorization.js",
      "node": "./dist/node/authorization.js",
      "default": "./dist/authorization.js"
    },
    "./granular-authorization": {
      "types": "./dist/granular-authorization.d.ts",
      "browser": "./dist/browser/granular-authorization.js",
      "bun": "./dist/granular-authorization.js",
      "node": "./dist/node/granular-authorization.js",
      "default": "./dist/granular-authorization.js"
    },
    "./normalization": {
      "types": "./dist/normalization.d.ts",
      "browser": "./dist/browser/normalization.js",
      "bun": "./dist/normalization.js",
      "node": "./dist/node/normalization.js",
      "default": "./dist/normalization.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"
    },
    "./provider-ports": {
      "types": "./dist/provider-ports.d.ts",
      "browser": "./dist/browser/provider-ports.js",
      "bun": "./dist/provider-ports.js",
      "node": "./dist/node/provider-ports.js",
      "default": "./dist/provider-ports.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"
    },
    "./strict-normalization": {
      "types": "./dist/strict-normalization.d.ts",
      "browser": "./dist/browser/strict-normalization.js",
      "bun": "./dist/strict-normalization.js",
      "node": "./dist/node/strict-normalization.js",
      "default": "./dist/strict-normalization.js"
    },
    "./sync": {
      "types": "./dist/sync.d.ts",
      "browser": "./dist/browser/sync.js",
      "bun": "./dist/sync.js",
      "node": "./dist/node/sync.js",
      "default": "./dist/sync.js"
    },
    "./wellbeing-goal": {
      "types": "./dist/wellbeing-goal.d.ts",
      "browser": "./dist/browser/wellbeing-goal.js",
      "bun": "./dist/wellbeing-goal.js",
      "node": "./dist/node/wellbeing-goal.js",
      "default": "./dist/wellbeing-goal.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.personal-health-spec](https://lssm.co/docs/packages/lib.personal-health-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:*`
- `@types/bun`: `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",
  "clean": "rimraf dist .turbo",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write .",
  "prebuild": "contractspec-bun-build prebuild",
  "test": "bun test",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

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

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

## Existing agent-guide projection

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