# @lssm-tech/integration.meeting-intake-worker-postgres-http

Production PostgreSQL queue and protected HTTP execution composition for the OPA meeting intake worker.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `0.1.3`
- Package path: `packages/integrations/meeting-intake-worker-postgres-http`
- Manifest path: `packages/integrations/meeting-intake-worker-postgres-http/package.json`
- Manifest Git blob: `809addf6ba549f9fbad91a9e03a7b7384eaebf24`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/integration.meeting-intake-worker-postgres-http](https://lssm.co/docs/packages/integration.meeting-intake-worker-postgres-http/)
- 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/integrations/meeting-intake-worker-postgres-http)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.meeting-intake-worker-postgres-http.txt)

## Package metadata

```json
{
  "layer": "integrations",
  "physicalArea": null,
  "primaryArea": "company-and-work",
  "classification": {
    "privateDeclared": true,
    "catalogFamily": null,
    "catalogKind": null,
    "catalogStatus": null,
    "adoptionMode": null,
    "stability": null
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: true — workspace only.

Primary area: [Company, work and service operations](https://lssm.co/docs/areas/company-and-work/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/integrations/meeting-intake-worker-postgres-http/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/README.md",
  "blobSha": "e536dfa9e1aab5dda9ea8ade61f4022fe784fd83",
  "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.

# Meeting Intake Worker PostgreSQL/HTTP Composition

Production composition for `@lssm-tech/app.meeting-intake-worker`. It claims
the canonical owner-scoped PostgreSQL queue and invokes one protected HTTPS
execution service. Only opaque job, connection, and protected-configuration
references cross the boundary; provider credentials and meeting content do not.
The database lease token remains inside the worker and is never sent to the
execution service.

Configure:

- `OPA_MEETING_INTAKE_WORKER_COMPOSITION_MODULE=@lssm-tech/integration.meeting-intake-worker-postgres-http`
- `OPA_MEETING_INTAKE_DATABASE_URL`
- `OPA_MEETING_INTAKE_OWNER_SCOPES_JSON` with 1–100 unique exact five-axis scopes
- `OPA_MEETING_INTAKE_EXECUTION_URL` using HTTPS
- `OPA_MEETING_INTAKE_EXECUTION_TOKEN`, at least 32 UTF-8 bytes
- optional bounded SSL, interval, limit, lease, attempt, and timeout settings
- optional `OPA_MEETING_INTAKE_JOBS_JSON`, 1–100 declared jobs (see below)

A misconfigured worker fails at start with
`meeting_intake_worker_configuration_invalid: <KEY>,<KEY>`, naming every
missing or invalid key and never a value. `meetingIntakeWorkerReadiness()`
(`./config`) returns the same names without throwing.

## Declared jobs and provisioning ownership (`./jobs`)

`OPA_MEETING_INTAKE_JOBS_JSON` is for self-hosted or worker deployments. Each
entry names an `ownerScope` from the served scopes, a `jobRef`, a
`connectionRef` and a `protectedConfigRef` (opaque references, unique `jobRef`
and `connectionRef` per scope), an optional `scheduleIntervalSeconds`
(60–86400, default 900) and an optional `enabled` (default `true`). The worker
upserts the declared jobs of a scope once before its first claim, so a restart
re-enables a paused job.

When the variable is unset, the worker declares and provisions nothing. It
defers to the CompanyOS API provisioner and only claims jobs that already
exist in its served scopes.

A scope must have one provisioner. Before every claim of a scope with declared
jobs, the worker looks for an enabled job of the API owner opt-in provisioner
(`MEETING_INTAKE_API_OWNER_JOB_PREFIX`, `meeting-intake-job:auto:`). That
prefix is reserved: a declared `jobRef` using it makes
`OPA_MEETING_INTAKE_JOBS_JSON` invalid. If such a job exists, the worker skips
that scope and keeps serving the others:

- it claims nothing in the scope;
- it emits `meeting_intake.provisioning_blocked` (metric
  `opa_meeting_intake_provisioning_blocked_total`) once each time the scope
  becomes blocked;
- it still applies the scope's declared `enabled: false` jobs, because
  disabling a job cannot create a second provisioner.

A `connectionRef` belongs to one job row per scope (`unique(owner,
connection_ref)`), even a disabled one. When another row already holds a
declared job's `connectionRef` (for example after a `jobRef` rename), the
upsert's unique violation does not stop the worker: the scope is skipped the
same way with the blocker `meeting_intake_declared_job_conflict` and the
declared `jobRef`, and every later claim retries the write. The worker never
deletes or re-points the other row; a database operator does.

`provisioningBlockers()` on the composition lists the scopes skipped by their
latest claim, each with its readiness blocker
(`meeting_intake_api_provisioner_conflict` or
`meeting_intake_declared_job_conflict`); the worker app's `/readyz` reports
them and fails closed, answering `503` while any remains (its other scopes keep
running). PGlite tests run the provisioner check
and the `23505` connection conflict as `opa_app` under the 0041 FORCE RLS
policies. `findMeetingIntakeProvisioningBlocker()`
runs the owner-scoped API provisioner check, and
`MeetingIntakeProvisioningBlockedError` lets a host fail closed on a blocker.

## Reauthorization (`./reauthorization`)

The HTTP boundary keeps the execution service's closed, redacted error code
(for example `granola_auth_failed`) instead of `execution_http_<status>`. A
code in `MEETING_INTAKE_REAUTHORIZATION_CODES` (the three Granola credential
codes and `calendar_reauthorization_required`, the credential lapses the
CompanyOS API cron also recognizes) emits
`meeting_intake.reauthorization_required` (metric
`opa_meeting_intake_reauthorization_required_total`) and, for a job this worker
declared, pauses it (`SqlMeetingIntakeJobControl.pause`, owner-scoped, FORCE
RLS); a worker restart re-provisions and re-enables it. The worker never pauses
a job provisioned elsewhere (no declared jobs): that provisioner keeps control
and the alert reports `jobPaused: false`. Alerts carry opaque references and
closed codes only; the default sink writes one JSON line to stderr.

## Executor readiness (`./execution-readiness`)

`meetingIntakeExecutionReadiness(env, expectedPath)` names the API host keys
that are unset or unusable for the protected executor route: the execution
URL (HTTPS and the mounted path), the token (at least 32 bytes), the owner
scopes and protected configurations, and the Granola credential each
configured recorder transport needs. A calendar-only configuration (no
`recorder`, or `recorder: null`) needs no Granola credential. It never echoes
a value. The CompanyOS API serves it, with the in-process cron and calendar
sync readiness, on the service-authorized operator route
`GET /api/opa/meeting-intake/readiness` (key names and states only).

The operator runbook is `docs/operations/founder-ops-v2/meetings-enable.md`
(section 3).

The execution service must authenticate the worker, resolve the protected
configuration and provider credentials server-side, re-prove current owner and
provider authority, run calendar/recorder intake idempotently by
`executionRef`, persist occurrence/review/binding results, and return exactly:

```json
{
  "version": "v1",
  "requestRef": "request:opaque",
  "executionRef": "execution:opaque",
  "status": "completed",
  "providerReceiptRef": "receipt:opaque"
}
```


Non-200 responses fail closed. HTTP 408, 429, and 5xx are retryable; other 4xx
and malformed or mismatched receipts are terminal.

## Protected execution service

`./execution-service` provides the server side of this boundary as a
`Request -> Response` handler. It authenticates the worker token in constant
time, accepts only configured exact owner scopes, re-proves authority through
the host `authorize` port, executes once per `executionRef` (a replay returns
the stored receipt; a changed request under the same reference is `409`) and
returns the exact v1 receipt. Executor failures map to `503` (retryable) or
`422` (terminal) with a redacted code. Hosts compose `execute` from the
calendar/recorder evidence ingestion and governed binding; credentials are
resolved server-side from `protectedConfigRef` and never cross the boundary.


## Declared capabilities

This manifest does not declare a capability catalogue. Assess the package using its guide, import map and source.

## 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
[]
```

## 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/integration.meeting-intake-worker-postgres-http` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/index.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/composition` — subpath `./composition`
  - `unconditional`: `./src/composition.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/composition.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/config` — subpath `./config`
  - `unconditional`: `./src/config.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/config.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/execution-readiness` — subpath `./execution-readiness`
  - `unconditional`: `./src/execution-readiness.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/execution-readiness.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/execution-service` — subpath `./execution-service`
  - `unconditional`: `./src/execution-service.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/execution-service.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/http-boundary` — subpath `./http-boundary`
  - `unconditional`: `./src/http-boundary.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/http-boundary.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/jobs` — subpath `./jobs`
  - `unconditional`: `./src/jobs.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/jobs.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/postgres` — subpath `./postgres`
  - `unconditional`: `./src/postgres.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/postgres.ts); verified source file.

- `@lssm-tech/integration.meeting-intake-worker-postgres-http/reauthorization` — subpath `./reauthorization`
  - `unconditional`: `./src/reauthorization.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/meeting-intake-worker-postgres-http/src/reauthorization.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": null,
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./composition": {
      "types": "./dist/composition.d.ts",
      "bun": "./dist/composition.js",
      "node": "./dist/node/composition.js",
      "default": "./dist/composition.js"
    },
    "./config": {
      "types": "./dist/config.d.ts",
      "bun": "./dist/config.js",
      "node": "./dist/node/config.js",
      "default": "./dist/config.js"
    },
    "./execution-readiness": {
      "types": "./dist/execution-readiness.d.ts",
      "bun": "./dist/execution-readiness.js",
      "node": "./dist/node/execution-readiness.js",
      "default": "./dist/execution-readiness.js"
    },
    "./execution-service": {
      "types": "./dist/execution-service.d.ts",
      "bun": "./dist/execution-service.js",
      "node": "./dist/node/execution-service.js",
      "default": "./dist/execution-service.js"
    },
    "./http-boundary": {
      "types": "./dist/http-boundary.d.ts",
      "bun": "./dist/http-boundary.js",
      "node": "./dist/node/http-boundary.js",
      "default": "./dist/http-boundary.js"
    },
    "./jobs": {
      "types": "./dist/jobs.d.ts",
      "bun": "./dist/jobs.js",
      "node": "./dist/node/jobs.js",
      "default": "./dist/jobs.js"
    },
    "./postgres": {
      "types": "./dist/postgres.d.ts",
      "bun": "./dist/postgres.js",
      "node": "./dist/node/postgres.js",
      "default": "./dist/postgres.js"
    },
    "./reauthorization": {
      "types": "./dist/reauthorization.d.ts",
      "bun": "./dist/reauthorization.js",
      "node": "./dist/node/reauthorization.js",
      "default": "./dist/reauthorization.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.organization-planning-runtime](https://lssm.co/docs/packages/lib.organization-planning-runtime/): `workspace:^`
- [@lssm-tech/lib.organization-planning-spec](https://lssm.co/docs/packages/lib.organization-planning-spec/): `workspace:^`
- `postgres`: `^3.4.9`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- `@electric-sql/pglite`: `catalog:data`
- [@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 .",
  "test": "bun test",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

No additional documentation links are declared in the inspected catalogue.

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/integration.meeting-intake-worker-postgres-http.txt",
  "route": "/llms/integration.meeting-intake-worker-postgres-http",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.meeting-intake-worker-postgres-http.txt",
  "blobSha": "e536dfa9e1aab5dda9ea8ade61f4022fe784fd83",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
