> ## Documentation Index
> Fetch the complete documentation index at: https://wuweism.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrity and alignment audit

> Monitor scientific integrity status, submit signoffs, and retrieve alignment audit reports for your SCM usage.

Wu-Weism enforces scientific integrity at the API layer. The integrity endpoints let you inspect how your causal reasoning is holding up against the constraints of your registered SCMs, submit formal signoffs to your institutional record, and pull audit reports that trace alignment over time.

<Note>
  All endpoints on this page require authentication. Include your session token in the `Authorization` header.
</Note>

***

## Get integrity dashboard

```
GET /api/scm/integrity/dashboard
```

Returns an aggregated integrity status for your account's SCM usage. Use this to monitor whether your causal analyses are consistent with the structural constraints of your registered models — for example, whether your adjustment sets satisfy back-door criteria, or whether you have unresolved confounder warnings.

### Response fields

<ResponseField name="success" type="boolean" required>
  `true` when the request succeeds.
</ResponseField>

<ResponseField name="status" type="string" required>
  Overall integrity status. One of `"healthy"`, `"warnings"`, or `"violations"`.
</ResponseField>

<ResponseField name="summary" type="object" required>
  Counts of integrity events.

  <Expandable title="summary properties" defaultOpen={true}>
    <ResponseField name="totalAnalyses" type="number">
      Total number of causal analyses run in the current reporting period.
    </ResponseField>

    <ResponseField name="constraintViolations" type="number">
      Number of analyses that violated one or more SCM structural constraints.
    </ResponseField>

    <ResponseField name="openWarnings" type="number">
      Number of unresolved integrity warnings (e.g., missing confounders, unvalidated adjustment sets).
    </ResponseField>

    <ResponseField name="signoffsPending" type="number">
      Number of analyses that require a scientific integrity signoff but have not yet received one.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="recentEvents" type="object[]" required>
  List of recent integrity events, most recent first.

  <Expandable title="event properties">
    <ResponseField name="eventId" type="string">
      UUID of the integrity event.
    </ResponseField>

    <ResponseField name="modelKey" type="string">
      The SCM involved.
    </ResponseField>

    <ResponseField name="eventType" type="string">
      Type of event: `"constraint_violation"`, `"warning"`, `"signoff"`, or `"audit_pass"`.
    </ResponseField>

    <ResponseField name="message" type="string">
      Description of the event.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      ISO 8601 timestamp.
    </ResponseField>
  </Expandable>
</ResponseField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://wuweism.com/api/scm/integrity/dashboard \
    --header 'Authorization: Bearer <token>'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://wuweism.com/api/scm/integrity/dashboard', {
    headers: { 'Authorization': 'Bearer <token>' },
  });

  const dashboard = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://wuweism.com/api/scm/integrity/dashboard',
      headers={'Authorization': 'Bearer <token>'},
  )

  dashboard = response.json()
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "status": "warnings",
    "summary": {
      "totalAnalyses": 42,
      "constraintViolations": 0,
      "openWarnings": 3,
      "signoffsPending": 1
    },
    "recentEvents": [
      {
        "eventId": "e1a2b3c4-0001-4abc-9def-000000000001",
        "modelKey": "neural_topology_v1",
        "eventType": "warning",
        "message": "Adjustment set does not include all required confounders identified by the SCM. Missing: ['age'].",
        "timestamp": "2026-04-03T09:14:22Z"
      },
      {
        "eventId": "e1a2b3c4-0001-4abc-9def-000000000002",
        "modelKey": "alignment_bias_scm",
        "eventType": "audit_pass",
        "message": "Intervention validated. Back-door criterion satisfied.",
        "timestamp": "2026-04-02T16:45:00Z"
      }
    ]
  }
  ```
</ResponseExample>

***

## Submit a scientific integrity signoff

```
POST /api/scm/integrity/signoff
```

Submit a formal scientific integrity signoff for a specific model version. Signoffs record that you have reviewed the causal assumptions and constraint compliance for an analysis and attest to its validity. Signoffs are appended to your account's integrity ledger and are immutable.

### Request body

<ParamField body="modelKey" type="string" required>
  The SCM you are signing off on.
</ParamField>

<ParamField body="version" type="string" required>
  The model version you are signing off on (e.g., `"1.0.0"`).
</ParamField>

<ParamField body="signoffNote" type="string">
  Optional free-text note explaining the basis for your signoff. Recommended for institutional records.
</ParamField>

### Response fields

<ResponseField name="success" type="boolean" required>
  `true` when the signoff is recorded.
</ResponseField>

<ResponseField name="signoffId" type="string" required>
  UUID of the created signoff record. Store this if you need to reference the signoff in downstream systems.
</ResponseField>

<ResponseField name="timestamp" type="string" required>
  ISO 8601 timestamp at which the signoff was recorded.
</ResponseField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://wuweism.com/api/scm/integrity/signoff \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "modelKey": "neural_topology_v1",
      "version": "1.0.0",
      "signoffNote": "Reviewed back-door criterion compliance for cortisol → hippocampal_volume pathway. Adjustment set confirmed sufficient."
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://wuweism.com/api/scm/integrity/signoff', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <token>',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      modelKey: 'neural_topology_v1',
      version: '1.0.0',
      signoffNote: 'Reviewed back-door criterion compliance for cortisol → hippocampal_volume pathway.',
    }),
  });

  const { signoffId } = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://wuweism.com/api/scm/integrity/signoff',
      headers={'Authorization': 'Bearer <token>'},
      json={
          'modelKey': 'neural_topology_v1',
          'version': '1.0.0',
          'signoffNote': 'Reviewed back-door criterion compliance.',
      },
  )

  signoff_id = response.json()['signoffId']
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "signoffId": "sf-9a3e1b72-cc4d-4f1a-b802-d6e7f3a0c291",
    "timestamp": "2026-04-05T11:08:33Z"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Model version '2.0.0' does not exist for model 'neural_topology_v1'."
  }
  ```
</ResponseExample>

***

## Get alignment audit reports

```
GET /api/scm/alignment-audit
```

Returns alignment audit reports for your account. Each report summarises how your causal reasoning over a given period held up against the structural constraints of your SCMs — including which constraints were satisfied, which were violated, and how reasoning drifted or improved over time.

Alignment audit reports are generated automatically by Wu-Weism on a rolling basis as you use the platform.

### Response fields

<ResponseField name="success" type="boolean" required>
  `true` when the request succeeds.
</ResponseField>

<ResponseField name="reports" type="object[]" required>
  List of audit reports, most recent first.

  <Expandable title="report properties" defaultOpen={true}>
    <ResponseField name="reportId" type="string">
      UUID of the audit report.
    </ResponseField>

    <ResponseField name="periodStart" type="string">
      ISO 8601 timestamp for the start of the audited period.
    </ResponseField>

    <ResponseField name="periodEnd" type="string">
      ISO 8601 timestamp for the end of the audited period.
    </ResponseField>

    <ResponseField name="modelsAudited" type="string[]">
      List of `modelKey` values audited in this report.
    </ResponseField>

    <ResponseField name="alignmentScore" type="number">
      Aggregate alignment score for the period, from `0.0` (no alignment) to `1.0` (full constraint compliance).
    </ResponseField>

    <ResponseField name="constraintCompliance" type="object">
      Per-constraint compliance breakdown. Keys are constraint names; values are compliance rates (0.0–1.0).
    </ResponseField>

    <ResponseField name="drift" type="string">
      Direction of alignment change versus the previous period: `"improving"`, `"stable"`, or `"degrading"`.
    </ResponseField>

    <ResponseField name="generatedAt" type="string">
      ISO 8601 timestamp when the report was generated.
    </ResponseField>
  </Expandable>
</ResponseField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://wuweism.com/api/scm/alignment-audit \
    --header 'Authorization: Bearer <token>'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://wuweism.com/api/scm/alignment-audit', {
    headers: { 'Authorization': 'Bearer <token>' },
  });

  const { reports } = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://wuweism.com/api/scm/alignment-audit',
      headers={'Authorization': 'Bearer <token>'},
  )

  reports = response.json()['reports']
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "reports": [
      {
        "reportId": "ar-4f2e9c10-bb3a-4d8e-a917-c1d0f2b3e456",
        "periodStart": "2026-03-01T00:00:00Z",
        "periodEnd": "2026-03-31T23:59:59Z",
        "modelsAudited": ["neural_topology_v1", "alignment_bias_scm"],
        "alignmentScore": 0.91,
        "constraintCompliance": {
          "back_door_criterion": 0.95,
          "acyclicity": 1.0,
          "no_unmeasured_confounding": 0.87
        },
        "drift": "improving",
        "generatedAt": "2026-04-01T02:00:00Z"
      },
      {
        "reportId": "ar-1a0b8d22-ff1c-4e9a-b055-a2c3d4e5f678",
        "periodStart": "2026-02-01T00:00:00Z",
        "periodEnd": "2026-02-28T23:59:59Z",
        "modelsAudited": ["neural_topology_v1"],
        "alignmentScore": 0.84,
        "constraintCompliance": {
          "back_door_criterion": 0.88,
          "acyclicity": 1.0,
          "no_unmeasured_confounding": 0.79
        },
        "drift": "stable",
        "generatedAt": "2026-03-01T02:00:00Z"
      }
    ]
  }
  ```
</ResponseExample>
