# Lucent: agent guide

> An optional Ardent extension for studying how an agent selects evidence, testing its predictions, and carrying a scoped belief into a later task. It starts off, and a strategy the agent writes for itself passes a safety screen or waits for an operator.

[Agent index](https://hivemagnus.com/llms.txt) · [Repository](https://github.com/ChefTaco/Lucent) · [README at 0.3.0](https://github.com/ChefTaco/Lucent/blob/v0.3.0/README.md) · [Acceptance ledger](https://github.com/ChefTaco/Lucent/blob/v0.3.0/ACCEPTANCE.md) · [Changelog](https://github.com/ChefTaco/Lucent/blob/v0.3.0/CHANGELOG.md)

## Responsibility

Lucent (`@hivemagnus/lucent`) is a plugin for [Ardent](https://hivemagnus.com/guides/ardent.md). It runs controlled studies on the agent's own model, records what the agent predicted and what happened, and keeps an append-only self-model of beliefs. Ardent owns the task journal and the policy pointer. [HiveMem](https://hivemagnus.com/guides/hivemem.md#self-knowledge-and-developmental-memories) stores private projections of development records. Identity, profile administration, tool grants and task cancellation stay with their host owners: Lucent's settings never grant tools, scopes, approvals or policy.

Lucent is young. Its acceptance ledger separates what has run live from what has fixture coverage only; see [Limits](#limits) before relying on a part of it.

## In a Hive installation

Lucent is not a component of the Hive manifest and has no container. [Magnus](https://hivemagnus.com/guides/magnus.md#lucent-for-ardent-agents) installs it on a fleet host as part of an Ardent agent:

- Hive 3.22.0 pins Magnus 4.4.0, whose host agent stages Ardent 3.9.0 and offers the reviewed Lucent 0.3.0. Installing staged Ardent 3.8.4 replaces a stopped profile’s reviewed Lucent 0.2.2 in place.
- In [HiveXUI](https://hivemagnus.com/guides/hivexui.md#lucent-and-the-cognitive-lab) 0.21.0, **Enable Lucent** is on the Model step of Magnus's New Agent, in the Magnus section and behind **New agent** in Studio. It is offered on a node that reports the reviewed package. Magnus checks the package's version, npm archive integrity and package-tree digest in the preflight and in the install, and the node keeps the reviewed package across profile restarts.
- The operator's view is the Cognitive Lab, a Studio area beside Team, Room and Agents, served by [Ardent Project Studio](https://hivemagnus.com/guides/ardent-studio.md) 0.12.0 through Magnus's allow-listed Lucent relay. The relay needs a node agent that reports Studio level 7, which the Magnus 4.2.0 host agent and later do. The Lab's changes (mode, policy rollback, review decisions) run as a linked Magnus administrator.
- A stopped profile with Lucent 0.2 counts as idle, so that native backups and upgrades can run, only from Ardent 3.8.3.

## Prerequisites

- Ardent 3.8.0 or later in the 3.x line (peer dependency `^3.8.0`). Lucent declares plugin capability version 2.
- Node.js 24.22.3+ in the 24 series or 26.13.1+ in the 26 series.
- A model the profile can call. The study harness and the sampled self-predictions use the profile's llama.cpp-compatible provider.
- With a reasoning model on llama.cpp, set `providers.llamacpp.thinking: false` on the profile (Ardent 3.8.2 or later), or study calls spend their time and tokens on reasoning.

## Add it to an Ardent profile

In the suite, use **Enable Lucent** in New Agent. On a standalone Ardent profile, install the package where the profile resolves its packages, with the same Ardent SDK instance as its runtime, then append it to the profile's plugins and restart the profile gateway. Keep any plugins already listed.

```yaml
plugins:
  - '@hivemagnus/lucent'
```

To build and check the package from source, use the Node.js version in the repository's `.nvmrc`:

```bash
git clone --branch v0.3.0 https://github.com/ChefTaco/Lucent.git
cd Lucent
npm ci
npm test
npm pack --dry-run
```

## Modes

Lucent starts in `off`. A person raises the mode, in the Cognitive Lab or with the agent's own Ardent CLI and its profile-local management credential; Lucent never raises it for itself.

| Mode | Ordinary direct tasks |
| --- | --- |
| `off` | Bypasses Lucent observation and control. Stops a running study and preserves its partial journal. |
| `observe` | Records supported model-boundary evidence and, when monitoring is configured, sampled self-predictions, outcomes, discrepancies and attention fidelity. Never regulates and never changes a request. Scheduled reflection only proposes hypotheses. |
| `advise` | Also records an applicable strategy proposal when a scoped policy exists, and may ask the host for one bounded regulation (`reconsider`, `retrieve` or `flag_uncertainty`). Reflection may screen an authored strategy and queue a study. |
| `automatic-within-policy` | May also supply a matching historical belief as untrusted context and admit a host-defined or screened authored strategy that the study gate promoted. |

```bash
ardent --profile lab lucent status
ardent --profile lab lucent mode observe
```

Replace `lab` with the profile's name. Management requests use the profile's own API and never need a Hive-wide administrator token.

## Run a study

```bash
ardent --profile lab lucent calibrate
ardent --profile lab lucent study
ardent --profile lab lucent evidence TASK_ID
```

- `calibrate` runs the baseline alone, on a seed separate from the promotion corpus, and saves the difficulty level where the configured model scores closest to the middle of the 50 to 75 percent band. Later studies for the same caller and model use it.
- `study` runs suite `evidence-selection/2`. It freezes its corpus, difficulty, decision rule and call ceiling before model discovery. Evidence-selection packets carry three to six sources, such as an operating register, signed amendments, superseded amendments, unsigned drafts and future amendments; multi-hop lookup packets chain two to four directory tables. Held-out and regression packets run under a baseline, generic advice and the candidate strategy.
- Each batch commits its per-packet forecasts before solving. A missing forecast stays in the coverage denominator.
- `evidence TASK_ID` pages through the study's immutable events: predictions, answers, source references, model identity and usage. The Cognitive Lab shows the same evidence.

A candidate is promoted only if it beats both comparators by at least two held-out answers with no additional regression losses, and beats each under an exact one-sided McNemar test at p ≤ 0.05. If any arm scores 95 percent or more on held-out packets, the report is flagged `ceiling` and a failed comparison is `insufficient` rather than `unsupported`. Promotion also requires complete forecasts, identified single-model metered usage, a matching configured model, the same profile generation and automatic mode.

A study records its worst-case call count, 87, within a per-run ceiling of 96, and there is one admitted study per profile. From 0.2.1 a study has a wall clock of 150 minutes and a calibration 60. A restart interrupts unfinished studies. Study calls go to the configured backend directly and have receipts separate from ordinary Ardent model calls.

Other profile commands: `challenge`, `memory STUDY_ID`, `discrepancies`, `fidelity`, `feedback TASK_ID correct` or `incorrect`, `study-requests`, `beliefs`, `review list pending`, `cancel TASK_ID` and `rollback REVISION`, which restores the prior policy.

## The self-model and the safety screen

Beliefs are append-only lineages. Each revision carries a confidence, a status (`proposed`, `testing`, `validated`, `refuted` or `retired`), a task-family scope from the host allowlist, supporting and contradicting evidence references and its test history. Only a pre-registered test can validate or refute a belief; reflection and evidence counts never change its status.

A strategy the agent writes for itself (at most 400 characters) is screened once per revision before any trial arm or live task can use it:

1. Deterministic checks reject references to tools, permissions, grants, approvals, credentials, security policy, the evaluator or the screen, instruction-override phrasing, URLs and exfiltration patterns, persona rewrites and hidden characters.
2. An independent model screen then runs in a fresh context with a fixed, host-owned rubric. Name a different model for it with `plugins_config.lucent.screen`.
3. Only `safe` makes a revision eligible for experiments. A `dangerous` or `uncertain` verdict, a screen error or a missing screen model opens an operator review instead.

Every verdict is recorded immutably with the screen version, rubric digest, model identity and reasons. An operator's approval permits experimentation only. A strategy reaches live tasks only through a policy that the study gate promoted, and it is still delivered as optional, untrusted context. With no screen model configured, every authored strategy waits in the review queue.

## Monitoring ordinary work

Everything here is off until the profile's `plugins_config.lucent` enables it, and nothing runs while the mode is `off`. Invalid settings fail closed and `GET /status` lists the issues.

- **Monitoring** (observe and above): a sampled direct task gets one prospective self-prediction, an extra model call in a separate context that sees only the request. Outcomes feed four monitor rules: high-confidence error, repeated failures, confidence drift and prediction and outcome mismatch streaks. Each finding is an immutable discrepancy.
- **Regulation** (advise and above): at most one request per step through Ardent's `regulate` hook, from fixed templates that name only the task family. No belief, strategy or task text reaches the model through regulation.
- **Scheduled reflection**: one plugin-scheduled job that reads new discrepancies and asks the agent's model for one falsifiable hypothesis. In observe mode it stops at the proposal.
- **Attention fidelity**: compares the sources the agent says influenced an answer with a bounded replay that withholds them, using [Emberfold](https://hivemagnus.com/guides/emberfold.md#context-dispositions-and-the-attention-manifest)'s record of what was fitted. It measures context selection, not neural attention.

Sampling rates, daily budgets and thresholds are in the README's [settings](https://github.com/ChefTaco/Lucent/blob/v0.3.0/README.md#discovery-from-ordinary-work) section; a sampling rate of 0, the default, keeps monitoring off.

## Study concurrency and safety screening

Lucent 0.3.0 can run up to four study or calibration batches concurrently. The default is one. Set `plugins_config.lucent.study.concurrency` and ensure the llama.cpp server has at least that many parallel slots. The `lucent-screen/2` rubric screens strategies for safety. Experiments still measure whether a strategy helps, and existing reviews retain their original rubric and evidence.

## Limits

The [acceptance ledger](https://github.com/ChefTaco/Lucent/blob/v0.3.0/ACCEPTANCE.md) at 0.3.0 records, among others:

- Modes, journaling of forecasts before answers, the study's records after a restart, HiveMem projection and the HiveXUI study flow have live and fixture coverage.
- The safety screen, ordinary-task monitoring, regulation, scheduled reflection and attention fidelity have fixture coverage only: the ledger says no live authored strategy has been screened, no live ordinary task has been sampled and no live reflection has run.
- The ledger lists the design revision 3 corpus and difficulty calibration as not yet run live. The changelog's 0.2.1 and 0.2.2 entries describe fixes found in later live runs, which the ledger at this tag does not yet record.
- Live studies on the earlier corpus were at ceiling, so their Brier scores carry no information, and no naturally eligible live policy has been reversed.

Treat Lucent as a way to gather evidence about an agent, starting in `observe`, not as a control you can leave unattended.

## Full instructions

Follow the [README](https://github.com/ChefTaco/Lucent/blob/v0.3.0/README.md) for the study design, every setting and the integration points for embedding hosts (`@hivemagnus/lucent/core`, `/study`, `/comparison`, `/style`, `/journal`, `/monitor` and `/corpus`). For the suite side, see the [Magnus](https://hivemagnus.com/guides/magnus.md#lucent-for-ardent-agents), [HiveXUI](https://hivemagnus.com/guides/hivexui.md#lucent-and-the-cognitive-lab), [Ardent](https://hivemagnus.com/guides/ardent.md) and [Ardent Project Studio](https://hivemagnus.com/guides/ardent-studio.md) guides.

## Source review

Release update, 2026-12-01: [Hive 3.21.0](https://github.com/ChefTaco/hive/releases/tag/v3.21.0) pins Magnus 4.3.0, which offers [Lucent 0.3.0](https://github.com/ChefTaco/Lucent/releases/tag/v0.3.0), commit `c39c59a35caef1b92fa0cb419dc5581b9b985523`. The tagged README, acceptance ledger, changelog and package manifest were reviewed. This documentation review ran no installation or study commands.

Earlier releases are covered in the [Lucent release records](https://github.com/ChefTaco/HiveMagnus/blob/main/docs/release-records/lucent.md). What each Lucent release changed is in its [changelog](https://github.com/ChefTaco/Lucent/blob/main/CHANGELOG.md).
