> For the complete documentation index, see [llms.txt](https://docs.labs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.labs.ai/reference/changelog/2026-11.md).

# November 2026

> Archived entries for November 2026, newest first. For recent work see [the live changelog](https://docs.labs.ai/reference/changelog.md).

***

## 💶 chore: funding.json manifest (2026-11-15)

**Repo:** EDDI (`chore/funding-json`)

### What changed

* `funding.json` (repo root): a [funding.json](https://fundingjson.org/) v1.1.0 manifest, the format FLOSS/fund and similar programmes read. It names EDDI Solutions (organisation, owner, `gregor.jarisch@eddi.solutions`, commercial website <https://eddi.solutions>), the EDDI project (described as the open-source AI agent management system, Apache-2.0, <https://eddi.technology>, `https://github.com/labsai/EDDI`), one bank-transfer channel and two plans of any amount in EUR (one-time and monthly). Validated against `https://fundingjson.org/schema/v1.1.0.json` with `jsonschema`.

### Design decisions

* **No bank details in the repo.** The channel's `address` is empty and its description says to ask `gregor.jarisch@eddi.solutions`; an IBAN in a public file is scraped and never goes away.
* **Same host as the repository.** The manifest lives in `labsai/EDDI`, so `repositoryUrl` needs no `wellKnown` proof.
* **The web pages are on other hosts**, so both `webpageUrl` entries carry a `wellKnown` URL: `https://eddi.solutions/.well-known/funding-manifest-urls` (entity) and `https://eddi.technology/.well-known/funding-manifest-urls` (project). Each file lists `https://github.com/labsai/EDDI/blob/main/funding.json` and is live: it was added in `labsai/website-eddi-solutions` PR 11 and `labsai/EDDI-LABS-AI-Website` PR 19, both merged and deployed.

### What's next

* The listed manifest URL points at `main`, so the two proofs resolve to a real file once this PR is merged. Submitting the manifest to FLOSS/fund is a separate step for the maintainers.

***

## 🔒 chore(security): allowlist #1372's dummy echo fixtures in .gitleaksignore (2026-11-15)

**Repo:** EDDI (`feat/rag-document-delete`, carried by PR #1299)

### What changed and why

PR #1372 (redacting encoded echoes of a substituted secret from API-call responses) reports three Gitleaks `generic-api-key` findings in its first commit, all in `ApiCallExecutorEncodedEchoRedactionTest`: the base64 form of a hex-word placeholder secret, held in a constant named after a secret, and the base64 of the text "fake-token" under a `token` key, once in a body string and once in a map. Every value decodes to placeholder text and nothing authenticates against anything. A later commit of that PR renamed two of them, but Gitleaks scans the whole commit range and reads `.gitleaksignore` from the base branch, so the PR cannot allowlist itself and its history cannot be rewritten (no force-push). The three fingerprints are added in a `# PR #1372` block that does not quote the values.

The findings were located by replaying Gitleaks' default `generic-api-key` rule (regex plus the 3.5 entropy threshold; the repo has no `.gitleaks.toml`) over the PR's non-merge commits, because the CI log redacts them. The replay finds exactly three, matching the CI count.

### Design decisions

* The repository owner decided to fold these entries, together with #1410's entries for #1304, into PR #1299, which is already approved and merges next, because #1410's reviewer is away. #1410 is closed as superseded once #1299 merges.

**Files:** [`.gitleaksignore`](https://github.com/labsai/EDDI/tree/main/.gitleaksignore/README.md)

***

## Live links move from eddi.labs.ai to eddi.technology (2026-11-15)

**Repo:** EDDI · **Branch:** `fix/redact-encoded-secret-echoes` (#1372, carried here by the owner's decision)

**What changed:** the project site moved to `eddi.technology`, and `eddi.labs.ai` only redirects there now. The live links now point at the new domain directly:

* Docs: `GOVERNANCE.md` and `docs/rag.md` (the `README` itself has no `eddi.labs.ai` link).
* The installers' closing message (`install.sh`, `install.ps1`) and the startup `banner.txt`.
* The OpenAPI contact URL in `application.properties`, with `BrandedOpenApiRouteTest` updated to match.
* The image label in `src/main/docker/Dockerfile`.
* The crawler's default User-Agent (`EDDI-Crawler/1.0 (+https://eddi.technology)`), documented in `docs/rag.md`.
* The "Website" link in the Docker-pull Slack notice.
* The Helm chart's `home`, and its `icon`, which was broken: `eddi.labs.ai/img/eddi-logo.png` redirected to a 404. It now points at `https://eddi.technology/eddi-icon.png`. The chart version moves from 2.14.1 to 2.14.2, with `EXPECTED_CHART_VERSION` in `DeploymentManifestsTest`.

**Left alone on purpose:**

* `AGENTS.md` and `planning/docs-site-migration-plan.md`, which describe the redirect itself.
* The monthly changelog archives.
* Tests that use the old URL only as arbitrary test data.
* The Umami analytics `hostname` in `docker-pull-notify.yml`: changing it would split the project-metrics history across two hostnames.
* `docs.labs.ai`, the `labsai` GitHub and Docker names, and `labs.ai` e-mail addresses. They are different things, and the docs-site cutover is planned separately.

***

## 🐛 fix(operator): no literal braces in the system prompt, so Qute renders it again (2026-11-15)

**Repo:** EDDI (`fix/operator-prompt-qute-braces`)

### What broke

\#1318 added `(metric eddi_parser_semantic_fallback_total{outcome: match, no_match})` to the Platform Operator's system prompt. The backend renders that prompt as a Qute template on every turn, and `{outcome: match, no_match}` reads as an expression in an `outcome` namespace that has no resolver. The render failed, so the model received the prompt unrendered and the `Operator Activation E2E` job went red on `main`.

The PR's own CI did not stop it: that job is not a required check, and no unit test looked for namespace-style braces in the whole prompt.

### What changed

* `ui/manager/src/lib/operator/system-prompt.ts`: the metric is written as `eddi_parser_semantic_fallback_total, tagged outcome=match or no_match`, with no braces.
* `ui/manager/src/lib/operator/__tests__/system-prompt.test.ts`: a guard test builds the whole prompt body (read-only and read-plus-write grants) and fails on any `{name: ...}` whose namespace is not `vault`, `connection` or `caller`, so this fails a unit test instead of only the e2e job.
* `operator-revision.json`: revision 64 to 65 (the prompt text changed), new fingerprint.

### Design decisions

* The guard checks the namespace pattern rather than banning all braces: the prompt legitimately carries `{#if context.screen}`, `{context.x}` and a few literal `{...}` examples that Qute leaves alone.

***

## 🐛 fix(groups): approved-result actions — stale cancel fenced, unreadable config refuses the approval, FAIL\_TASK at discussion end (2026-11-15)

**Repo:** EDDI (`feat/group-approved-result-actions`)

Review follow-ups on PR #1375.

### What changed and why

* **A stale cancel can no longer overwrite a claim.** A cancel on another pod reads the running discussion, the leg then writes its `RUNNING` claim, and the cancel's compare-and-set (state `IN_PROGRESS`, no pause) still matched — its stale `PENDING` record was settled `NOT_SENT` while the leg sent the request, whose outcome write then failed against `CANCELLED`. `SharedTaskList` now carries `approvedActionsRevision`, which `GroupApprovedResultActions` changes with every claim and outcome (and restores when that write fails). A conditional write in `GroupConversationStore` (`updateIfState`, `updateIfStateAndPause`) that *settles* owed records also requires `taskList.approvedActionsRevision` to be what the writer read, through the existing `storeIfFieldsEqual` dotted-path CAS on MongoDB and PostgreSQL. The stale cancel loses (`409`); a cancel that read the claim lands and reads it `OUTCOME_UNKNOWN`. Writes that settle nothing keep the plain state CAS.
* **An approval is not consumed when the group configuration cannot be read.** `GroupHitlCoordinator` refused the approval only through strict plan binding; a decision with the matching `planHash` completed the task and persisted the decision without the action record it owed. A TASK-pause decision that would approve a task now throws `ResourceStoreException` before anything is mutated — the pause and its awaiting tasks stay; a timeout's `AUTO_APPROVE` retries through `RetryLaterException`. Rejections still apply (they owe no action).
* **Nor when the paused phase drifted.** With the configuration read but the bookmarked phase renamed, moved or removed, `recordApprovedResultActions` skipped the record while the task completion persisted with the resume CAS; the resumed leg's drift guard then restored the pause but not the task, so a retry after the fix found nothing awaiting and the action never ran. The same refusal now fires first, through one `bookmarkedPhaseDrift` check that recording also uses.
* **Dashboard panel id.** The *Approved-result actions by outcome* panel moved from id `447` (taken on `main` by the *Input Parser* row) to `449`; the k8s split copy was regenerated with `scripts/sync-monitoring-assets.py`.
* **`FAIL_TASK` at discussion end.** `SharedTaskList.settleOwedApprovedActions` turned an orphaned `RUNNING` claim into `OUTCOME_UNKNOWN` but left its task `COMPLETED`. It now applies the same `onFailure` rule as the live leg, through one shared `applyFailurePolicy`, stamping the discussion's end time so repeated reads agree.
* **Docs** (`docs/group-approved-result-actions.md`): a store outage leaves an `IN_PROGRESS` discussion with a `PENDING` record (not an ended one), and the update endpoint is `PUT /groupstore/groups/{id}?version=`. Operator prompt: the refused approval, the cancel `409` and `OUTCOME_UNKNOWN` failing the task (fingerprint only).

### Tests

`GroupApprovedResultActionsStaleCancelTest` replays cancel read → claim write → cancel write → send against an in-memory CAS storage; `GroupConversationStoreApprovedActionsTest` covers the fence and terminal `FAIL_TASK` / `KEEP_COMPLETED`; the Mongo and PostgreSQL container tests run the stale and current cancel on real backends; `GroupHitlCoordinatorApprovedActionsTest` covers the refused approval (unreadable configuration, renamed and removed paused phase).

***

## Review fixes: percent-encoded widget routes and CJK glyph precedence (2026-11-15)

Branch `chore/ui-npm-workspaces` (PR #1274), UI only.

* `ui/chat/src/location.ts`: the literal `chat` and `managed` segments are now percent-decoded before they are compared, as the router this parser replaced did, so `/%63hat/production/agent-1` and `/chat/%6danaged/support/user-7` resolve to their intended routes. Regression cases added to `location.test.tsx`.
* `ui/manager/src/index.css`: `:root:lang(ja|ko|zh|zh-Hant|...)` rules put the active locale's CJK family first in `--font-sans`, so a Han glyph both families cover no longer keeps the glyph form of an earlier-loaded locale after a language change. `locale-fonts.test.ts` pins the ordering.

***

## AGENTS.md: no merge without a completed CodeRabbit review (2026-11-14)

**Repo:** EDDI · **Branch:** `docs/agents-coderabbit-required`

**What changed:** `AGENTS.md` §2 rule 4 gains a merge gate. A PR may only be merged once CodeRabbit has reviewed its current head, every CodeRabbit finding (inline, nitpick and outside-diff) is fixed or answered, and every CodeRabbit thread is resolved. A "Review limit reached" / "Review rate limited" reply counts as not reviewed. A human approval, green CI and an agent's own review are required as well, but none of them replaces CodeRabbit. Only the user can waive the rule, for a named PR.

**Why:** on 2026-11-12 seventeen PRs (#1272 #1296 #1298 #1320 #1321 #1322 #1326 #1329 #1330 #1337 #1338 #1339 #1347 #1350 #1353 #1362 #1373) were squash-merged by an assistant session that treated a human approval plus its own review as sufficient, while CodeRabbit was rate limited on all of them. Those merges are being reviewed after the fact. Writing the rule into `AGENTS.md` makes it binding on every session and assistant, not only the one that was told.

**Design decisions:** the rule sits next to the push discipline and the `ship-pr` pointer, which is where every assistant reads before opening or merging a PR. It names the two CodeRabbit commands for re-requesting a review rather than restating the skill's full command table.

***

## AGENTS.md: never merge into a red main, never merge in bulk (2026-11-14)

**Repo:** EDDI · **Branch:** `docs/agents-coderabbit-required`

**What changed:** a second merge gate in `AGENTS.md` §2 rule 4:

* Check `main`'s latest `CI/CD` run before every merge, and merge nothing while it is red.
* Merge through the merge queue once `main` has one.
* Without a queue, merge one PR at a time and re-test a PR after `main` changed under it, or test-compile the whole set together before landing several.
* Watch `main`'s run after each merge and revert or fix a red one first.

**Why:** "Require branches to be up to date" is off on `main`, so a PR's green CI only covers the `main` it was tested on. On 2026-11-12, #1352 renamed `ResourceAccessGuard.callerIsAdmin()` to `isAdmin()` and #1345 added a test calling `callerIsAdmin()`. Both were green and were merged minutes apart, and `main` stopped compiling its tests (fixed by #1407). Seventeen more PRs were merged while `main` was red.

**Design decisions:** the rule points at a merge queue as the real fix: a separate PR adds the `merge_group` trigger to `ci.yml`, and an admin enables the queue. It does not ask for "require branches to be up to date", which would make every open PR re-run CI after each merge, too slow for this repository's CI capacity.

***

## Manager first-load budget raised to 650 KB (2026-11-14)

**Repo:** EDDI · **Branch:** `fix/alert-rule-cap` (#1357)

**What changed:** in `ui/bundle-budget.json`, the first-load budget of the Manager pages (`manage.html`, `workforce.html`, `welcome.html`) goes from 630 KB to 650 KB gzip. The chat widget's budget stays at 170 KB (it measures 160.6 KB).

**Why:** #1272 set 630 KB, measured against a `main` that did not yet include the UI PRs merged alongside it. Once all of them were in, the Manager pages measured 641.1 KB and the `Bundle budget` step in UI Manager Checks failed. Main's own CI never showed it, because its run stopped earlier, at the broken test compile. The budget file says raising a budget is a decision, not a fix; the repository owner made it, choosing to raise the budget rather than shrink the bundle now.

**Design decisions:** 650 KB leaves about 9 KB of headroom over the measured 641.1 KB, still roughly 94 KB below the 743.8 KB phase-0 baseline. Work to get back under 630 KB (lazy-loading whatever grew the first load) is left to the frontend-unification plan.

***

## 🔒 chore(security): allowlist #1304's dummy PEM fixtures in .gitleaksignore (2026-11-12)

**Repo:** EDDI (`chore/gitleaksignore-1304-fixtures`)

### What changed and why

PR #1304 (OAuth2 JWT-bearer and `private_key_jwt`) tripped the Gitleaks `Secret Scanning` check with `private-key` findings in one early commit. They are PEM armour lines written as literals in a Javadoc comment, a constant and some tests, with empty, placeholder or runtime-generated bodies. Gitleaks scans every commit of a PR range and reads `.gitleaksignore` from the base branch, so the PR cannot allowlist itself, and the branch history cannot be rewritten (no force-push). The commit's fingerprints are therefore added here, in the established per-PR block. Later commits on that branch already build the armour at runtime. No key material is involved and nothing authenticates against anything.

**Files:** [`.gitleaksignore`](https://github.com/labsai/EDDI/tree/main/.gitleaksignore/README.md)

***

## fix(test): McpScheduleParityTest compiles again on main (2026-11-12)

**Repo:** EDDI (`fix/mcp-schedule-parity-test-compile`)

Two merges crossed: #1352 removed `ResourceAccessGuard.callerIsAdmin()`, a duplicate of `isAdmin()` (both return `ownershipValidator.isAdmin(identity)`), and #1345 added `McpScheduleParityTest`, which stubs `callerIsAdmin()`. Each was green on its own branch, but together the test sources on `main` no longer compiled, so `Build & Test` failed on `main` and on every pull request merged against it. The test now stubs `isAdmin()`. No production code changed.

***

## 🐛 fix(engine): `setup-api/sync` and "latest version" MCP reads failed with "does not define how its version info is authorized" (2026-11-11)

**Repo:** EDDI (`fix/setup-api-sync-current-version`)

### What broke

`POST /administration/agents/{agentId}/setup-api/sync` answered HTTP 500 on 6.7.0 before it wrote anything, dry run included: `API agent sync failed: Access denied: this store does not define how its version info is authorized`. The same refusal came back from every MCP admin tool that resolves "the latest version" when no version is given (`read_workflow` without `version`, reproduced on a live 6.7.0; also the other resource reads in `McpAdminTools`), and the same lookup in `AgentSetupService` and `AgentCascadeService`. Callers that inject a store bean directly (`McpConversationTools`, `McpGroupTools`) were never affected.

### Cause

Those callers reach the stores through `IRestInterfaceFactory`, a MicroProfile REST client over loopback. `getCurrentVersion` is a `default` method of the `IRestVersionInfo` mixin, and a REST client runs a default method as plain Java in the caller, never as a request. The store beans override `requireCurrentVersionAccess` with their VIEW check, but the client proxy does not, so the mixin's fail-closed default (#1161) refused everyone. Before #1161 the next default, `getCurrentResourceId`, threw `IllegalStateException` instead, so this path never worked through a client; sync (#1270) was the first caller that could not do without it.

### Fix

`RestInterfaceFactory` wraps every store client it builds (`CurrentVersionRouting`): `getCurrentVersion` is sent to the store's own `GET /{id}/currentversion` endpoint over HTTP, with the same loopback caller filter, and every other method goes to the client unchanged. The endpoint keeps its role check and the store's VIEW check, so nothing is authorized that was not before; one place fixes every caller, and a new caller cannot fall into it again.

The `currentversion` client is shared: callers never close the clients the factory hands out, so building one per call would leave one more behind each time. The loopback factory method (`get(Class)`) builds it once per store address and trust level (with or without the caller credential) and reuses it; this is safe because the filter reads the caller per request, not when the client is built. The two-argument method (`get(Class, serverUrl)`) does not cache, since a cache keyed by arbitrary `serverUrl`s would be unbounded. `redirectToLatestVersion` is not routed (it answers a 303 that a client would follow, and no in-process caller uses it). The wrapper is a `java.lang.reflect.Proxy`, which a future native image build has to register.

**Files:** [`CurrentVersionRouting.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/client/factory/CurrentVersionRouting.java), [`RestInterfaceFactory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/client/factory/RestInterfaceFactory.java), [`CurrentVersionRoutingTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/runtime/client/factory/CurrentVersionRoutingTest.java), [`LoopbackCurrentVersionIT.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/integration/LoopbackCurrentVersionIT.java)

### Verification

The unit test reproduces the refusal on a client-like store and checks the routing. `LoopbackCurrentVersionIT` (integration phase, CI only) makes the real call: the injected factory resolves the latest version of a stored resource against the running application, and a JDK `HttpServer` on an ephemeral loopback port shows the request is `GET /{id}/currentversion`, carries the caller's bearer token on the loopback client and none on a named remote instance. It was not run locally. After the release, check `setup-api/sync` with `dryRun: true` and `read_workflow` without a version on staging.

***

## 🐛 test(cluster): NatsTlsHandshakeTest race that failed unrelated PRs, mutual-TLS test re-enabled (2026-11-10)

**Repo:** EDDI (`fix/nats-tls-test-race`)

### What changed and why

`NatsTlsHandshakeTest` failed `Build & Test` intermittently on the Linux CI runner with `expected: <CONNECTED> but was: <CLOSED>`, on branches that touch neither NATS nor TLS (`acceptsACertificateWhoseOnlySanIsTheConfiguredHostName` most often, `presentsTheJvmDefaultClientCertificateWhenNoEddiKeyStoreIsConfigured` once). `presentsTheClientCertificateToABrokerThatRequiresMutualTls` had been quarantined with `@Disabled` for 6.7.0 for the same symptom.

The cause was the test's own `connect(...)` helper. It opened the connection with `Nats.connect(manager.buildOptions())` and shut the manager down in a `finally`. `buildOptions()` installs the manager's connection listener, and jnats delivers CONNECTED to it on its own executor thread. Whenever that event arrived before `shutdown()` ran, the listener adopted the connection (`connection = conn`, `status = CONNECTED`), so `shutdown()` no longer took its "never started" early return and drained and closed the very connection the test was about to assert on. Faster machines usually ran `shutdown()` first, which is why it passed locally.

* The helper keeps each manager alive and `@AfterEach` shuts the managers down after the test has asserted on and closed its connection, then stops the fake servers.
* The helper now waits until the manager reports `isConnected()` before it returns, so the listener has always adopted the connection by the time a test asserts. The race outcome that used to fail now and then is the one every run takes: putting the old `manager.shutdown()` back into the helper fails all three CONNECTED tests every time (checked locally), instead of rarely. If the wait fails, the helper closes the connection itself, since the manager never stored it and `@AfterEach` could not reach it.
* `presentsTheClientCertificateToABrokerThatRequiresMutualTls` is re-enabled.

`NatsConnectionManager` is unchanged: in production its listener is installed only through `start()`, and closing the connection that listener adopted is exactly what `shutdown()` must do. Only a test that builds the options without `start()` could be surprised by it.

**Files:** [`NatsTlsHandshakeTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/cluster/NatsTlsHandshakeTest.java)

***

## 🐛 fix(audit): agent signatures on audit entries honour revocation, and an unprovable one is no tampering alarm (2026-11-08)

**Repo:** EDDI (`fix/audit-agent-signature`, review round on the same branch, now merged with the review round of `feat/agent-signing-key-provisioning`)

* Review round: an erasure no longer rewrites a row without its agent signature when the agent store fails (the row is left unredacted and counted failed), and a permanent agent delete drops the cached agent versions even with no live deployment.

### What changed and why

A whole-feature review of agent signing found that the audit half signed with keys it should not have used, reported a routine agent delete as tampering, and could not see a stripped signature.

* **Signing only with a key that is usable and matches.** `AuditAgentSigner` signs with the producing agent version's newest key only while that key is not revoked and is inside its `validFromMs`/`validUntilMs` window at the entry's own timestamp (the ledger's, covered by the HMAC). Each new signature is checked against the public key that version declares before it is stored: a version saved before keys were engine-owned can declare a hand-typed key that a later "Generate signing key" filled in the vault with a different key, and every entry it signed then read as forged. Such an entry is left unsigned and an ERROR is logged.
* **Nothing escapes signing.** An unchecked store failure (a driver timeout) while reading the agent version escaped `AuditLedgerService.submit` after the entry's chain position was taken: the entry was lost and the gap was reported as a deletion (`ChainStatus.BROKEN`). Every failure now leaves the entry unsigned, with a WARN.
* **A GDPR erasure no longer launders a forged row.** The reseal re-made the agent signature of every row whose HMAC verified. A row whose agent signature is the finding — `AGENT_SIGNATURE_INVALID`, or `AGENT_SIGNATURE_MISSING` (a row forged by someone holding the audit HMAC key) — came out of the erasure carrying a genuine signature by the agent, and verified `VALID`. Such a row now keeps what it carried and reports the same verdict after the erasure; if the agent store cannot be read, the resealed row is left unsigned rather than signed on trust.
* **Verification accepts exactly what the ledger writes.** A signature by another key than the version's newest, outside that key's window, or on a version with signing off, is `AGENT_SIGNATURE_INVALID`. The stored form `v<n>:` takes every version up to `AgentPublicKey.MAX_VERSION` and no leading zero.
* **Three new verdicts, none of them tampering.** The HMAC proves the entry's content; these say only that the agent's signature cannot vouch for it. They count in a new report field, `agentSignatureUnproven`, not in `invalid`: the sweep is not `intact`, and `tamperingSuspected` stays false.
  * `AGENT_KEY_REVOKED`: the agent revoked the key since, or its newest version no longer declares it. A revoked key is trusted for nothing, whenever it signed, as for group messages.
  * `AGENT_SIGNATURE_MISSING`: no signature on an entry its agent version would have signed (a stripped signature used to verify `VALID`). Reported only while `eddi.audit.agent-signing-enabled` is on.
  * `AGENT_KEY_UNAVAILABLE`: the agent was deleted permanently. This used to be `UNKNOWN_KEY`, counted in `invalid`, so an owner deleting their own signing agent raised `tamperingSuspected` for every entry it had signed. `UNKNOWN_KEY` is again only an HMAC key the deployment no longer holds.
* **A soft delete no longer takes a revocation back.** Verification read the revocation from the agent's *current* version, and a soft delete leaves none on either backend (MongoDB moves the row out of the current collection, PostgreSQL out of `resources`). Revoking a leaked key and then deleting the agent — the ordinary response to a compromise — turned every `AGENT_KEY_REVOKED` entry back into `VALID`, and a stripped one into `AGENT_SIGNATURE_MISSING`. It now reads the agent's newest version, soft-deleted or not, through a new `IAgentStore.getNewestVersionIncludingDeleted` (`HistorizedResourceStore`: the current version, otherwise the newest history row, which after a soft delete is the deleted version). Only a permanently deleted agent has nothing newer, and its signed entries are `AGENT_KEY_UNAVAILABLE` already.
* **One WARN after a revoke, not one per entry.** Revoking the newest key deletes it from the vault while the deployed version still names it, so every audit entry of that version went unsigned with its own WARN until a redeploy — about a thousand lines a minute on a busy agent, during the incident. `AuditAgentSigner` now logs one WARN per agent version and key that says a redeploy is what fixes it, and the repeats within ten minutes at DEBUG.
* **A signature in the form 6.7.0 and earlier wrote is checked, instead of read as forged.** Those releases signed every audit entry of an agent whose vault held its unversioned key `agent-signing-key:{agentId}`, whatever the agent's settings, over the bare HMAC, as plain Base64 with no `v<n>:`. No release could put that key there: the secrets API's key names allow no `:`, and the key generators had no caller (the old `signInterAgentMessages` validator asked operators to store it, which no API allowed). Such rows exist only where the key was written into the vault outside EDDI's API, and the check is for them. Verification accepted only the new form, so each such authentic row reported `AGENT_SIGNATURE_INVALID`, counted in `invalid`: `tamperingSuspected` for the whole history, also with `eddi.audit.agent-signing-enabled` off, and a GDPR erasure kept the rows as evidence, so they never recovered. `AuditAgentSigner` now checks a plain-Base64 signature against the legacy key the entry's own agent version declares (`identity.publicKey`), over the bare HMAC and whatever the agent's flags: `VALID`, `AGENT_KEY_REVOKED` when that key was revoked since, `AGENT_SIGNATURE_INVALID` when it does not verify. With no declared legacy key, or no agent version on the entry, it is `AGENT_KEY_UNAVAILABLE` (unproven, not tampering). An erasure re-signs a verified legacy row in the current form, and no longer signs afresh a row whose signature nothing could check (`AGENT_KEY_UNAVAILABLE`): any Base64 written by someone holding the audit HMAC key would otherwise have become a genuine agent signature at the next erasure.
* **Architecture page.** [Cryptographic agent identity](https://docs.labs.ai/architecture-and-concepts/architecture.md#cryptographic-agent-identity), key rotation and revocation, no longer says audit entries carry no agent signature: they are signed as `v<n>:<signature>`, checked by `/auditstore/verify`, revocation applies, and signatures written by 6.7.0 and earlier are checked against the legacy key.
* **What `AGENT_SIGNATURE_MISSING` detects, stated correctly.** The docs said it protects against a forger holding a separate `eddi.audit.hmac-key`. It does not: whether a row should carry a signature is decided by its `agentVersion` and `timestamp`, which that forger writes and HMACs, so naming a version with signing off (every signing agent has a version 1 created with signing off) or a time before the key's `validFromMs` makes an unsigned forged row verify `VALID`. `MISSING` shows a signature stripped by someone who can edit rows but lacks the HMAC key; a `VALID` agent signature is what an HMAC-key holder without the vault cannot fake. [Audit ledger](https://docs.labs.ai/security-and-compliance/audit-ledger.md#agent-signatures) and the `AuditAgentSigner` Javadoc now say so; the verification logic is unchanged.
* **The verify endpoints' Javadoc** in `IRestAuditStore` no longer calls the check HMAC-only: both verify agent signatures and count the unprovable ones in `agentSignatureUnproven`.
* **Docs and API text.** [Audit ledger](https://docs.labs.ai/security-and-compliance/audit-ledger.md#agent-signatures): audit entries are signed by the agent version a conversation runs, so they need a deployed version with the key and the flag (group messages are signed from the newest stored version at once); the verdicts; and that the agent signature adds protection only where `eddi.audit.hmac-key` is separate from the vault master key. The OpenAPI text of `POST /agentstore/agents/{id}/signing-keys` scopes "no redeploy needed" to group messages. [Cryptography](https://docs.labs.ai/security-and-compliance/cryptography.md) mentions revocation.
* **Manager.** The audit page no longer says an entry with a forged agent signature had its content changed: it shows "N agent signature(s) do not verify — the content is intact" next to the content line, and the row chip reads "Agent signature does not match". `agentSignatureUnproven` makes the verdict "Not fully verified" with its own reason. Three keys in all 11 locales.
* **Operator.** The prompt says audit entries need a deployed version, how the new verdicts are counted, and that a plain-Base64 signature written by 6.7.0 or earlier is checked against the legacy `identity.publicKey`.
* **Revocation does not stop signing at once.** `audit-ledger.md` now says so: the vault delete is best effort and another node keeps a loaded private key for up to 60 seconds, so the deployed version can go on signing with the revoked key for a while. Those entries are `AGENT_KEY_REVOKED` as well, and the missing-key WARN appears only once signing finds no key. The audit page's banner lines and row chip carry `data-testid`/`data-problem`/`data-reasons`, and the verification tests assert those instead of English copy.

### Design decisions

* **Revocation is absolute for audit entries too.** The plan preferred keeping entries signed before the revocation valid, judged by the ledger's timestamp. Rejected: the revocation records no time, and anyone able to forge an audit row holds the HMAC key and so writes the timestamp too; a "signed before" rule cannot tell their back-dated rows from honest ones. The entry "identity is engine-owned, keys can be revoked, and generating one no longer breaks the agent's descriptor" already makes a revoked key valid at no time, whenever an entry claims it signed. The cost is that honest older entries lose their agent signature's vouching (`AGENT_KEY_REVOKED`), never their HMAC proof.
* **Revocation is read from the agent's newest version, soft-deleted ones included.** Revoking writes a new version, so the entry's own immutable version never shows it. One version lookup per checked entry of a signing agent (a second, indexed history read only for a soft-deleted agent); the version itself comes from `AgentConfigurationCache`. Rejected: a time-based cache of the newest version (revocation would show late, and tests could not see it without a clock seam); probing `readIncludingDeleted` upward from the entry's version (one read per version, per entry, and it relies on versions being contiguous); and treating every soft-deleted agent's entries as unproven (honest entries of a deleted agent would lose their vouching).
* **The new store method sits on `HistorizedResourceStore`, `AbstractResourceStore` and `IAgentStore`, not on `IResourceStore`.** Every configuration store inherits it, but only the agent store declares it: the conversation-memory stores that also implement `IResourceStore` have no version history to answer from, and only audit verification needs it.
* **A signature in the old form is checked with the legacy key alone, outside the new rules.** The old ledger ignored `signInterAgentMessages` and key windows, so judging its rows by `signingIdentity` would still call them forged. Rejected: mapping every unversioned signature to unproven without checking it (honest rows would lose their proof); trying every key the version declares (the old vault key's public half was documented as `identity.publicKey`; an undeclared pairing is reported unproven instead).
* **Unprovable is its own count.** Rejected: mapping them to the HMAC status (a stripped signature would stay `VALID`), and counting them in `invalid` (a routine delete becomes a tampering alarm).
* **Self-check by verifying the fresh signature**, as `GroupSigningGuard` does, rather than a cached `checkSigningKey` per (agent, version, key): no state, and the cost is one Ed25519 verify per signed entry.

**Files:** [`AuditAgentSigner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditAgentSigner.java), [`AuditLedgerService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditLedgerService.java), [`AuditVerificationStatus.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditVerificationStatus.java), [`AuditVerificationReport.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/model/AuditVerificationReport.java), [`RestAuditStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/RestAuditStore.java), [`IRestAuditStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/IRestAuditStore.java), [`HistorizedResourceStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/HistorizedResourceStore.java), [`AbstractResourceStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/AbstractResourceStore.java), [`IAgentStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/IAgentStore.java), [`IRestAgentStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/IRestAgentStore.java), [`audit-ledger.md`](https://docs.labs.ai/security-and-compliance/audit-ledger.md), [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md), [`cryptography.md`](https://docs.labs.ai/security-and-compliance/cryptography.md), [`audit.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/audit.tsx), [`audit-verify.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/api/audit-verify.ts), [`system-prompt.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/operator/system-prompt.ts).

***

## fix(signing): every prompt a verifying member receives is built from its verified view (2026-11-08)

**Repo:** EDDI (`fix/group-signing-every-prompt`, on top of `fix/group-signing-verification`)

### What changed and why

`security.requirePeerVerification` filtered a member's phase prompt and its `groupTranscript` context, and nothing else. Every prompt the engine composes itself for a role turn quoted the transcript, or records built from it, as stored: the convergence judge, a dissenter, the facilitator's briefing, the vote tie-breaker, the task-force execute, verify and bid prompts, a follow-up's `groupTranscript`, and a nested group's question. In a task force the flag protected only the side channel: a verifying executor saw a dependency's unsigned result in full, while its `groupTranscript` showed the same result withheld. The engine's own records (the negotiation table, the vote tally, a retrospective's lessons) also counted unverified entries and then quoted their text back to verifying members, and several entries the engine writes for an agent were recorded unsigned under its id, so verifying peers saw them withheld even when every agent signs.

* **One view, everywhere.** `GroupSigningGuard.View` now answers per stored entry (`of`, `trusts`) as well as for the whole transcript, and `GroupSigningGuard.viewOf(guard, reader, gc)` is how every engine reads the transcript for an agent. `PhaseExecutionEngine`, `FacilitatorEngine`, `TaskForceEngine` and `GroupLifecycleOps` get the guard by setter, as `GroupContextBuilder` already did; without one they read the transcript as stored.
* **Role turns.** The moderator judge's input is built from the round as the moderator sees it; the `SERVICE` judge, which is no agent but whose verdict ends the phase for everyone, reads it through the group's records view (below). Each dissenter reacts to the synthesis as it sees it, and one for which this round's synthesis does not verify is not asked. The facilitator's excerpt is the latest contribution it may take as written.
* **Task records** (`TaskRecordView`). A result is quoted to a verifying reader only when a trusted entry of the assignee holds exactly that text, so an unsigned result or one edited in the store reads `[withheld: this text could not be verified]`, the reader's own results included when it signs (one that does not sign trusts its own entries, so it still sees its result); a result an approver edited (`SharedTaskList.reviewerEdits`) is the reviewer's text and is shown. A subject and description are withheld when an untrusted `PLAN` entry parses to them and no trusted one does, or when another member's task tool wrote them and that member does not sign verifiably (no key, signing off, key revoked or outside its window: `View.vouchesFor`). The engine records a tool-filed task under the member whose turn filed it (`createdByAgentId`), so a signing member's task is its text and a verifying assignee does it. A verification note is withheld when an untrusted `VERIFICATION` entry holds it and no trusted agent entry does. A verifying member whose own task's text does not verify fails the task without being asked; a bidder is announced only the tasks it may see. A verifying verifier is given only the tasks whose text and result it may see (`TaskRecordView.showsWork`); the rest stay `COMPLETED` with an engine note giving their count, and with none left it gets no turn. Before, every withheld task carried one shared placeholder, so its verdict matched no task and fell through to the fail-open path that marked every task `VERIFIED`.
* **Follow-ups** pass the member's view as `groupTranscript`, and the answer is signed.
* **Nested groups.** A `GROUP` speaker reads the parent transcript as strictly as its strictest reader: its agent members, its moderator and its facilitator (the set `readersOf` counts for the records), groups nested in it included; a group that cannot be read counts as verifying. Its prompt becomes the question each of them works from. The guard reads the group store itself (a constructor argument), so no separately wired resolver can be dropped.
* **Member tools.** `listGroupTasks` lists each subject as the calling member may see it (`GroupSigningGuard.taskSubjectsSeenBy`); the running discussion's guard reaches the tools through `LiveDiscussionRegistry.register(gc, guard)`. Shared artifacts are not signed, so the artifact tools are not assembled for a member that requires verification or whose setting cannot be read.
* **Cadence feedback.** A standing team's cadence wrote a failed task's raw result or verification note into the backlog description, which the next run shows as configured task text. It now writes the task as the group's records count it (`GroupConversationService.recordedTask`). A rework that did not run keeps the verifier's own feedback as the task's note (the engine says the rework did not run in a note of its own), so the note still traces to the verifier's entry; it used to be suffixed with " (the rework did not run)", which no entry held, and passed. The verification summary renders the verdict array the engine applied before any other array, so a reply carrying a second array still shows the decoded feedback the note is traced by. A note is traced by its text without surrounding whitespace, since the summary is trimmed: feedback ending in a newline or a space was not found in it and passed. The ends cut are the union of what `String.strip()` and `String.trim()` remove, since the summary's `trim()` also drops control characters: feedback ending in an ESC was not found either and passed. The feedback is no longer appended to the backlog task's description: it is kept beside it in `GroupWorkspace.backlogFeedback` (`BacklogFeedback`: task id, run id, text, the agent that wrote it, and whether a reader verified when it was kept; `GroupSigningGuard.recordedFeedback`), and each run quotes it after the description, in the question and the tasks it plans, only if `GroupSigningGuard.recordsTrustFeedback` passes for the readers as they stand then: no agent wrote it (a HUMAN member, an approver's edit, the engine), no reader verifies, or it was verified when kept and its author still signs verifiably. Otherwise it is counted as withheld, as concessions are. So feedback an agent wrote while nobody verified is not quoted once a verifying member joins (the description of a task a person filed is still pulled), which the description text could not express. A task keeps its last 8 runs' feedback (`MAX_FEEDBACK_PER_TASK`) and none once it is verified, approved as done or gone from the backlog. The field is optional, so older workspaces load with none; feedback they already appended to a description has no provenance and stays part of the description, as it was written under the rule of its time.
* **Handoffs.** An `AUTO` tool handoff filed another team's agent's text into the backlog with no creator, and the cadence turned it into configured task text. The backlog task now records the agent that wrote it (`TeamHandoffService`, `TaskItem.filedBy`); `TaskDefinition` carries it as an engine-only `createdByAgentId` (`@JsonIgnore`: never written to or read from a stored config) and the run's task keeps it, so `View.vouchesFor` applies. The per-discussion cap `maxAgentAddedTasksPerDiscussion` counts the tasks members file with the task tool (`SharedTaskList.agentFiledTaskCount`, persisted with the discussion), no longer every task with a creator, so the handed-off tasks a run starts with do not use up the members' budget. `onDecision` handoffs and inbox items a person accepts name no agent; the docs and the operator recommend `REVIEW` intake for a team whose members verify, since those still reach the run as configured text. A team with a verifying reader never runs a handed-off task it could not verify: `TeamHandoffService` files an `AUTO` tool handoff from an agent that does not sign verifiably to the intake inbox, as `REVIEW` would, and `TeamCadenceService` does not pull a backlog task whose agent stopped signing (it waits on the backlog, and each fire that leaves it logs why at INFO), so no member fails it unasked on every run, is charged a `tasksFailed` for it or is quoted it in the cadence question. A fire such tasks leave with nothing to run is skipped with a reason that says so, naming the agents and how to free the tasks (a signing key again, or delete and re-file), instead of "No executable backlog tasks"; and every team-cadence skip now records its reason in the fire log's `errorMessage` (`ScheduleFireExecutor.fireTeamCadence`), as a `SKIPPED` conversation fire does, so the schedule's fire history says why a team did nothing. Both ask `GroupConversationService.recordsTrustAgentText` (`GroupSigningGuard.recordsTrustAgentText`: no reader verifies, or the agent signs verifiably; an unreadable group counts as verifying).
* **User memories.** A group- or global-visible user memory whose value another agent wrote is not loaded as a property (`Conversation.loadUserProperties`) or returned by the memory tool's recall, search and forget (`UserMemoryTool`) for an agent that requires peer verification, in any conversation. The flag rides from the deployed agent (`Agent.setPeerVerificationRequired`) onto every turn's memory, like the continuation policy. A global entry keeps its creator as owner when another agent writes it, so each entry now records its last writer (`lastWriterAgentId` in MongoDB, `last_writer_agent_id` in PostgreSQL, added by `ALTER TABLE ... ADD COLUMN IF NOT EXISTS`; `""` for the user's or an admin's write, absent on older entries, which read as written by their owner), and `UserMemoryEntry.writtenByAgentOtherThan` reads it. The stores leave those entries out in the query (`getVisibleEntriesForVerifyingReader`), before `maxRecallEntries`, so other agents' entries no longer take the places of the reader's own and the user's. A team's lessons (`group:<groupId>`, written by the engine as `retro`) are kept. The stores record the writer an entry names (`lastWriterAgentId`; the 13-argument constructor names its owner), so the writes made for an agent other than the row's owner name both: an undo or redo of a turn (`ConversationService.syncLongTermChanges`) records the conversation's agent, not the global row's creator, which had relabelled one agent's value as another's, and a REST `PUT` that names no writer records its `sourceAgentId` (`UserMemoryWriteRules.withDefaults`). A Dream consolidation (`DreamService`) takes the merged entry's writer from the originals' writers, not their owners: none when no agent wrote any, the one agent that did, otherwise the housekeeping agent, so a merge of the user's keys an agent overwrote is no longer stored as no agent's. A verifying agent's `longTerm` property for a global key is written as any agent's (last writer wins) and makes it the value's writer: an earlier version of this change dropped it when another agent had last written the key, which lost a fact the user had just given the agent, on every turn and for good, since the agent was never shown the stored value. The Manager's "Require peer verification" description (11 locales) says this applies in every conversation.
* **The engine's records** (`GroupSigningGuard.recordView`, `recordedEntries`). Once any member, the moderator or the facilitator requires verification, the `SERVICE` judge's input, the negotiation table, an arbitration verdict, the vote's options and ballots and a retrospective's lessons count only entries that verify for every reader (no reader's own entries are exempt). The ballot prompt now takes its options from the voter's own view, which reverses the previous PR's choice of the stored transcript: an unverified synthesis offers no options, and the vote does not run on it. A `HUMAN_DECIDES` tie resumed by the person or the timeout moderator is rebuilt from the same records (`HumanTieBreakEngine.rebuildOutcome` takes `PhaseExecutionEngine.recordsOf`), a facilitator's `CALL_VOTE` is refused once a reader verifies unless the facilitator signs verifiably, and a facilitator that is switched off is no reader (`readersOf`).
* **Entries written for an agent.** The readable verification summary, the facilitator's notes (an escalation dropped for an approval gate or for a tie-break included) and the recruitment note are signed for the agent and named by it, as a `DISSENT` or `BID` already is: each carries the agent's own text. The tie-break note was an engine entry quoting the facilitator, and the recruitment note an unsigned entry named `System` under the recruiter. The task-failure note is the engine's own (`system`, with the member as its target). The rework note (*"Returned for rework (1/2): — the verifier's feedback is on the task"*) no longer quotes the verifier: every member is shown it as the engine's, and the feedback reaches the reworking member through the task, whose note the records trace to the verifier's entry. The rework and task-failure notes name the task's subject as the group's records count it (`TaskForceEngine.noteSubject`, via `GroupSigningGuard.recordedTask`): once a reader verifies, a subject from a plan or task tool that does not verify for every reader is `[withheld: this text could not be verified]` in the stored note, since a verifying member is shown the note as the engine's text; a group nobody in which verifies gets the subject as before. `recordTaskFailure` takes the group configuration for that (the old signature passes none, which counts as a verifying reader). A verifying facilitator's briefing no longer quotes the latest convergence note: it is recorded under the engine's name, but its text is the judge's reply, written from what the judge was shown.
* **Deleted facilitators.** A `FACILITATION` note under an agent id counts as an agent's (`GroupSigningGuard.writtenAsAnAgent`), so a facilitator that was never a member, and runs its turns under a key of its own, keeps its unsigned notes withheld after it is deleted. That was the one deleted agent the rule missed.
* **Review fixes (PR #1367).** A task a verifying assignee cannot verify fails before a turn is reserved: it takes nothing from `maxTurns`, fires no speaker events, and under `onAgentFailure: ABORT` fails only itself, since the member was never asked (`TaskForceEngine.executeTaskExecutionPhase`). A bid counts only on a task its bidder was announced, so a verifying bidder cannot win one it was not shown and then fail it (`runBidRoundIfNeeded`). A HUMAN member named as moderator is no reader of the group's records (`GroupSigningGuard.readersOf`), so a store failure reading its id cannot make them filter for everyone. `PostgresUserMemoryStore.upsertIfOwnedBy` records the entry's writer, as the Mongo store does, instead of always the owner.

Docs: [group-conversations.md](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md#signed-contributions) lists every prompt and record covered, and its "Not yet supported" row now names only what is still unsigned. [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md#cryptographic-agent-identity) item 8 describes the combined behaviour of the signing changes: every prompt filtered, own entries checked when the member signs, the reserved names, withheld engine-named syntheses, the ballot taken from the voter's view and the group-wide records rule; the "Not filtered yet" sentence is gone. Item 8, the `GroupSigningGuard` class Javadoc and group-conversations.md call it opt-in per receiving member, not fail-closed (the wording #1366 settled on): a member without `requirePeerVerification` is shown the stored transcript, and entries no agent wrote reach a verifying member relabelled but unauthenticated. The `Verdict` enum keeps #1366's one-constant-per-line form, with `NOT_IN_TRANSCRIPT` (a record quoting an entry that is not in the view's transcript: withheld) added. The Platform Operator's prompt names the same rules and the two failure messages an admin will ask about (`The vote could not run: only 0 option(s) were available`, `Its task text could not be verified, and this member requires peer verification`); operator revision bumped. The Manager's "Require peer verification" description (all 11 locales) now says the records rule is group-wide and that a verifying agent gets no artifact tools. [user-memory.md](https://docs.labs.ai/architecture-and-concepts/user-memory.md) says what such an agent loads and recalls; [team-handoff.md](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-handoff.md) and the Dynamic Agents section say what peer verification means for handoffs and for agents `create_sub_agent` makes, which cannot sign.

* **Review round 5.** A HUMAN assignee's task prompt is built from the task records as stored (`TaskForceEngine.taskRecords` passes no guard for a reader `GroupHumanTasks.isHumanAssignee` names): a person has no `requirePeerVerification` setting, and looking its id up as an agent and then as a nested group turned a group-store failure into an unknown requirement that withheld its dependency results. `LiveDiscussionRegistry` now keeps a discussion and its signing guard in one entry (`Registration`), and `ArtifactToolsProvider` and `GroupTaskTools.listGroupTasks` read both from one lookup: read separately, a cleanup between the two left the discussion found and the guard absent, which reads as "show everything" and handed a verifying member the artifact tools.

### Design decisions

* Readers reach the guard through setters with a `null` default (unfiltered), the existing `GroupContextBuilder.setSigningGuard` pattern, rather than through `MemberTurnExecutor`, which about ten test classes mock and whose mock would return no view.
* Task records carry no provenance, so a field is traced to the entry it came from (equal content for results, a re-parse for plans, containment for notes) instead of adding a source field to the persisted `TaskItem`.
* The records rule is group-wide, not per reader: a negotiation table or a vote is one record for everyone, and showing different tables to different members would split the discussion. A verifying member that does not sign therefore loses its own proposals, ballots and (as moderator) synthesis from the records once anyone verifies; the docs say an agent that verifies should sign.
* A tool-filed task is trusted by its creator, not by a signature over its text. The engine sets `createdByAgentId` from the turn that called the tool, so the text is that member's exactly as its signed entries are; what a verifying reader must not take is text from a member it could not verify. A store edit to the task text is not detected, the boundary configured and plan-derived task text already has (descriptions are taint rules). Rejected: a signed transcript entry per filed task (a synthetic entry in every prompt, appended mid-turn into the transcript the phase loop indexes) and a signature field on `TaskItem` (a persisted record with dozens of construction sites, re-signed on every cadence append).
* Artifacts are gated by absence for verifying members rather than filtered by last editor: a version merges earlier text, so the last editor says nothing about who wrote what.
* A user memory is judged by its last writer, a field written on every write, not by its owner: the owner has to stay the creator (the global-key ownership guard and `upsertIfOwnedBy` read it), and a memory entry holds one value, unlike an artifact version. The filter runs in the store's query so the recall limit counts only what the reader is shown; over-fetching by a constant factor still fails once peers write more than that factor allows. Rejected: dropping every global entry for a verifying reader (its own and the user's would go too).
* A handed-off task a verifying team cannot verify goes to the intake inbox at filing and waits on the backlog if its agent stops signing later, rather than being pulled and failed: a person vouches for inbox text by accepting it, and nothing in the receiving team can make an unsigned agent's text verify. Why it waits is said in the fire history, not on the task: a note or status on the task would be a second workspace write in the pull and would have to be cleared once the agent signs again.
* A verifying agent's global property write is not refused. Rejected: dropping it when another agent last wrote the key (a fact the user just gave is lost, for good, since the agent is never shown the stored value and so never becomes its writer), and writing it only when it differs from a configured default (the agent never loaded the hidden value, so there is nothing to compare with). A property setter that sets a default for a global key every turn overwrites other agents' values whether the agent verifies or not; the docs say to use `self` for such keys.

### Not done

* The note that a HUMAN-assigned task is not reworked (`GroupHumanTasks.withoutHumanAssignees`) still quotes the task's subject as stored. Listed in the docs.
* The cadence question quotes the pulled tasks under the user's name, and `onDecision` handoffs and inbox items a person accepted name no agent; documented, with `REVIEW` intake recommended.
* A key revoked between a cadence pull and the task's turn still fails that task once (and charges its assignee), before the next fire leaves it on the backlog.
* Lessons another team shares, and those the scorecard tool returns, were checked only against the storing team's records rule. Documented, not filtered.
* The negotiation table's concession ledger is checked against the current records view as well: once a verifying reader joins, concessions by an author that does not sign verifiably (or that has an unverified entry) are withheld, with a count.
* The Manager's workspace page shows each backlog task's cadence retry feedback (`GroupWorkspace.backlogFeedback`) under the task as plain text, with a badge for feedback that was verified when kept; before, it showed only the description, which no longer carries new feedback. Workforce renders no workspace backlog.
* Retained cadence feedback (`BacklogFeedback`) now records the version of the author's key that verified it (`authorKeyVersion`, optional in stored JSON). A later run whose readers verify quotes it only while that key is not revoked, so provisioning a replacement key does not revive text a revoked key vouched for; agent feedback with no recorded version is withheld.
* The cadence retry text a run shows (`descriptionsForRun`) now reserves room for the task's own description first and drops the OLDEST quoted feedback to fit the 4,000-character cap, keeping the withheld-count note; before, it trimmed from the front of the combined text, so eight full-length feedback items cut the task's instruction off.

***

## 🐛 fix(audit): agent signatures on audit entries are versioned and verified (2026-11-07)

**Repo:** EDDI (`fix/audit-agent-signature`, on top of `feat/agent-signing-key-provisioning`)

### What changed and why

The audit ledger wrote an agent signature (`agentSignature`) that nothing could use. It always signed with the agent's unversioned key, which key provisioning never writes, so a provisioned agent's entries were never signed. It ignored the agent's own signing setting, signed the entry id when the deployment had no HMAC key (which says nothing about the content), stored no key version, and `/auditstore/verify` never checked the signature.

* **Signing** moved to a new `AuditAgentSigner`. The agent version that produced the entry signs when it has `security.signInterAgentMessages` on and declares a key, with its newest key, and only when the entry carries an HMAC. The signed bytes are `eddi-audit-entry:` followed by the HMAC, and the stored value is `v<keyVersion>:<Base64 signature>`. A key that cannot be used leaves the entry unsigned and logs a WARN naming it.
* **Verification**: `/auditstore/verify` checks the agent signature of every entry whose HMAC verified, against the public key the entry's own agent version declares. A new status, `AGENT_SIGNATURE_INVALID`, counts towards `invalid` and raises `tamperingSuspected`. An entry whose agent version no longer exists (the agent was deleted permanently) reports `AGENT_KEY_UNAVAILABLE`, which is not counted as tampering (see the 2026-11-08 entry); a soft-deleted agent's entries keep verifying, because the version is read including deleted ones. If the agent store cannot be read, the sweep fails.
* **GDPR erasure** still decides whether to re-sign a row from its HMAC alone, so deleting an agent cannot leave redacted rows unverifiable.
* `AgentSigningService.sign` and `signIfKeyPresent` take the key version.
* Manager: an `AGENT_SIGNATURE_INVALID` entry is marked "Signature does not match", like an `INVALID` one. The operator prompt says how audit entries are signed (revision bump).

### Design decisions

* The key version lives in the `agentSignature` value, not in a new column. The two are only meaningful together, and so they cannot be stored, redacted or dead-lettered apart. No schema change was needed on either backend.
* The trust anchor is the entry's own agent version, which is immutable, rather than the agent's current configuration. Editing the agent later cannot make an old entry verify against a different key.
* Signing follows `signInterAgentMessages`, the one setting whose save checks the key can sign.
* A signature removed from a row cannot be covered by the HMAC, which is computed first; the 2026-11-08 entry reports it as `AGENT_SIGNATURE_MISSING` where the agent version would have signed. See the [audit ledger page](https://docs.labs.ai/security-and-compliance/audit-ledger.md#agent-signatures).

**Files:** [`AuditAgentSigner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditAgentSigner.java), [`AuditLedgerService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditLedgerService.java), [`AuditVerificationStatus.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/AuditVerificationStatus.java), [`RestAuditStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/RestAuditStore.java), [`AgentSigningService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/AgentSigningService.java), [`audit-ledger.md`](https://docs.labs.ai/security-and-compliance/audit-ledger.md), [`cryptography.md`](https://docs.labs.ai/security-and-compliance/cryptography.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md).

***

## 🐛 fix(setup): opaque 500 with a correlation id; every setup write goes through one writer (2026-11-07)

**Repo:** EDDI (`fix/setup-small-defects`)

### What changed and why

**The setup endpoints no longer echo an unexpected exception's message.** `POST /administration/agents/setup`, `/setup-api` and `/{agentId}/setup-api/sync` answered any failure their 4xx arms did not map with `500 {"error": "Agent setup failed: " + e.getMessage()}`. Such a message is not written for the caller: a MongoDB timeout names the replica it waited for (`… waiting for a server: mongo-0.internal:27017`), a REST proxy failure the store it could not reach. The three arms now share one helper, `opaqueServerError`, that logs the full exception under a fresh UUID and answers `500 {"error": "Agent setup failed (correlationId: <uuid>)"}` — the contract `ResourceStoreExceptionMapper` and `RestAgentManagement` already follow. The `error` key stays, because the Manager reads it. The 4xx arms (validation, forbidden, not found, dangling references) still carry their author-facing text.

**`setupAgent` writes through the same `ResourceWriter` as `createApiAgent`.** It created its parser, behaviour rules, LLM config, MCP-calls configs, output set, workflow and agent with seven hand-written copies of create, read `Location`, record for rollback, patch the descriptor name; `createApiAgent` ran the same steps through the writer but still inlined its agent write, and the MCP-calls loop existed twice (live and dry run). There was no behavioural drift, but a step added later could miss the rollback record or the descriptor name at one call site without any test noticing. `ResourceWriter.createDescribed` now does create, record and describe in that order in one place; every document of both setup paths goes through it except `createApiAgent`'s per-group httpcalls, which are recorded as one list before their loop and named `<agent> - <group>`, and so keep `create` and `describe`. The two MCP loops are one (`ResourceWriter.mcpCalls` is gone), and `setupAgent` rolls back through `writer.rollback`. Behaviour, `resources` keys and rollback order are unchanged.

### Design decisions

* **Correlation id in the `error` text, not a new field.** It matches the other opaque 500s (`… (correlationId: …)`) and needs no client change. A shared cross-class helper was rejected for now: the three existing copies answer in different shapes (JSON body, `text/plain`, SSE event).
* **No `AgentRef` record for the agent write.** The agent is created through `createDescribed` like the rest, and its id and version are read from the returned location — two lines, instead of a record and a method.
* **No `dryRun` on `SetupAgentRequest`.** That changes the REST and MCP contract and its docs; with `setupAgent` on the writer it is now a one-line `writerFor(request.dryRun())` follow-up.

**A failure the setup service wraps is a 500 now, not a 400 — caller-visible.** `setupAgent` and `createApiAgent` wrapped anything their own `try` caught as `AgentSetupException("Failed to set up agent: " + e.getMessage())`, the sync as `"Sync failed: " + e.getMessage() + …`, and the named-vault-key paths appended the provider's message (`Could not read vault key 'x': <provider text>`). The REST layer answers `AgentSetupException` with `400`, so a store timeout or a vault backend error was reported as the caller's fault, with the internal text attached. These sites now throw `AgentSetupInternalException` (a subclass) through `AgentSetupInternalException.internalFailure(safeMessage, cause)`: it logs the full cause at ERROR under a fresh correlation id, keeps the cause attached, and its message is the safe sentence plus `(correlationId: <uuid>)`, never the cause's text. `RestAgentSetup` answers it with `500 {"error": "Failed to set up agent (correlationId: <uuid>)"}` on all three endpoints; the sync message keeps "Agent X was NOT changed (still version N)" and the orphaned versions it wrote. The two vault-write failures that already withheld the provider's text ("could not be stored in the secrets vault … Refusing to store it in plaintext") are the same kind of failure and also answer 500 now. **Clients that branched on `400` for these see `500`;** the Manager does not (the wizard shows `error`, operator activation only checks 404/409). A validation `AgentSetupException` raised inside the same `try` (an unparseable spec, a rejected `maxToolIterations`) still passes through unchanged as `400` with its own message. The MCP setup tools and `create_sub_agent` show `e.getMessage()` for any `AgentSetupException`, so they now show the safe sentence and the id instead of the cause.

### Not changed

The MCP twins of these endpoints, `setup_agent` and `create_api_agent` in `McpSetupTools`, answer an unmapped failure with `errorJson("Failed to set up agent", e)`, which carries the cause's message. They could use `McpToolUtils.toolFailure`, which describes a caller-facing failure and logs anything else under a reference id; that is a separate change to a separate surface.

**Files:** [`RestAgentSetup.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/rest/RestAgentSetup.java), [`AgentSetupService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/setup/AgentSetupService.java), [`ApiAgentSyncService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/setup/ApiAgentSyncService.java), [`AgentSetupHardeningTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/setup/AgentSetupHardeningTest.java), [`AgentSetupVaultKeyReuseTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/setup/AgentSetupVaultKeyReuseTest.java), [`RestAgentSetupTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/rest/RestAgentSetupTest.java) (new), [`AgentSetupServiceTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/setup/AgentSetupServiceTest.java)

***

## 🐛 fix(engine): a conversation start refused by the agent's configuration answers 422, and unresolved vault references name their tenant (2026-11-09)

**Repo:** EDDI (`fix/conversation-start-config-errors`) — external security review finding B5 (low)

### What changed and why

An httpcall on `CONVERSATION_START` that EDDI refused — a `${vault:…}` reference naming no secret, a secret sent to a host its `allowedHosts` does not list — reached `POST /agents/{agentId}/start` as an opaque `500 Failed to start conversation`: `ApiCallExecutor` wraps the refusal in a `LifecycleException`, the pipeline wraps that again, and `ConversationService` turns it into a `ResourceStoreException`. A client (the Manager, the Chat UI, the Platform Operator) could not tell "fix the agent" from "the server broke".

* **New marker,** [**`AgentConfigurationRefusal`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/lifecycle/exceptions/AgentConfigurationRefusal.java), implemented only by exceptions that certainly mean "this configuration cannot run", with a bounded, cycle-safe `find(Throwable)` over the cause chain.
* [**`RestAgentEngine`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentEngine.java): when a start fails and the chain holds such a refusal, it answers **`422`** `{"error": "agent_misconfigured", "message": "...", "retryable": false}` — the flat envelope this endpoint already uses for its `503`, which the Manager's `apiErrorFromResponse` reads as code + sentence with no change. The message is the refusal's own (names only), passed through `SecretRedactionFilter` again and capped at 1000 characters; no stack trace. Everything else stays a `500`.
* [**`SecretResolver`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/SecretResolver.java): `diagnoseUnresolved` says why a reference stayed unresolved (`VAULT_NOT_CONFIGURED`, `RESERVED`, `NOT_FOUND`, `PROVIDER_FAILED`) from one metadata read on the failure path, never the value; `unresolvedReferenceFailure` builds the error — a `MisconfiguredVaultReferenceException` (an `IllegalArgumentException`, as before) for the first three, a plain `IllegalArgumentException` for a vault outage. `requireResolved` (LLM parameters) and the "not found" log line now name the tenant too.
* [**`SecretReference.describe`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/model/SecretReference.java): `${vault:name} (no tenant given, so tenant 'default')` / `${vault:acme/name} (tenant 'acme')`. A not-found short-form reference adds that it always looks in `default` and how to write `${vault:<tenant>/name}` — the tester's `${vault:name}` for a secret stored in tenant `eddi`.
* [**`ApiCallExecutor`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutor.java): `resolveSecrets` throws the diagnosed failure; `buildRequest` prefixes a refusal with `API call '<name>':` so the 422 says which call. Two small hunks.
* [**`VaultHostAllowlist`**](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/VaultHostAllowlist.java): new `HostRefusedException extends HostNotAllowedException` for the missing-secret, not-on-`allowedHosts` and plaintext-transport refusals. The "allowed hosts could not be read" case keeps the parent type and stays a `500`.
* **Platform Operator**: the test-drive section explains a `422 agent_misconfigured` start; revision bumped.
* **Docs**: [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md#errors) (422 row), [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md#when-a-reference-does-not-resolve) (new "When a reference does not resolve"), [`troubleshooting.md`](https://docs.labs.ai/getting-started/troubleshooting.md).

### Design decisions

* **422, not 409.** The request is well-formed and nothing about the target's *state* conflicts (409 is what this API uses for an awaiting-approval or busy conversation); what cannot be processed is the agent the request addresses, and repeating it fails the same way until the configuration changes. `WebhookEventHandler` already answers 422 for "the routed target cannot run".
* **A marker, not message matching or a blanket `IllegalArgumentException` rule.** The SSRF validator, a bad URL and many genuine bugs all throw plain `IllegalArgumentException`; only exceptions written for a configuration refusal opt in. A vault that could not be read, and an `allowedHosts` list that could not be read, are deliberately left out: calling an outage a misconfiguration sends an admin to fix a config that is fine.
* **The message reaches the caller.** It already did on a say turn (the same sentence lands in `taskErrors`); the start path now matches. It carries reference names, hosts and the call name — never a value.

### Not done

* **The httpcall SSRF refusal at run time is still a 500.** `UrlValidationUtils` throws a plain `IllegalArgumentException`, and "Cannot resolve hostname" (DNS, possibly transient) shares that type, so it has no clean signal; another branch is moving the httpcall SSRF check to deploy time (`ApiCallsTask`). A run-time refusal type that implements `AgentConfigurationRefusal` would get the 422 with no further change here.
* **Only `POST /agents/{agentId}/start`** maps the refusal. A say turn still reports it as `TURN_FAILED` in the snapshot's `taskErrors`; MCP, A2A, `/v1` and the other start paths are unchanged.
* An unresolved reference in **LLM parameters** (`UnresolvedSecretReferenceException`) now names its tenant but is not marked: `requireResolved` cannot tell a missing secret from a vault outage.
* **Two paths keep the marker through redaction and forEach**: `ApiCallExecutor.withoutSecrets` re-marks its secret-free copy of a refusal (the cause is still dropped), and a forEach step with `onItemFailure: "fail"` carries the first refusal behind an item whose request was not built, so both still answer 422.

***

## ✨ feat(groups): a human-approved backlog task can count as done at cadence writeback (2026-11-09)

**Repo:** EDDI (`feat/cadence-approved-counts-as-done`)

### Why

`TeamCadenceService.writebackCompleted` kept a pulled backlog task done only when the matching discussion task was `VERIFIED`; everything else went back to `PENDING` with feedback appended (the cross-run retry loop). A task approved by a person at a TASK-granularity HITL gate becomes `COMPLETED`, not `VERIFIED`, so a standing team that uses human approval instead of a VERIFY phase had every approved task pulled and executed again on its next run — for a team that publishes, the same post twice. The only workaround was an extra VERIFY phase with a verifier agent.

### What changed

* **New switch `hitlConfig.approvalCompletesBacklogTask`** (boolean, default `false`) on the group configuration ([`AgentGroupConfiguration.HitlConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/AgentGroupConfiguration.java)). With it on, the writeback also keeps a task done when a person approved it: the backlog task lands `COMPLETED` (not `VERIFIED`, `verified=false`) with the approved result — the approver's edit when `review.allowResultEdits` was used — and no retry feedback is appended.

  ```json
  "hitlConfig": { "granularity": "TASK", "timeoutPolicy": "WAIT_INDEFINITELY", "approvalCompletesBacklogTask": true }
  ```
* **A durable approval marker.** The task list had no record of *how* a task became `COMPLETED`. [`SharedTaskList`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/SharedTaskList.java) gains a side map `approvals: taskId → TaskApproval(decidedBy, at, edited)`, written by `approveTask(taskId, decidedBy)` and `approveTaskWithEditedResult`, cleared by `resetFromAnyToAssigned` (a new attempt supersedes the approval, as it already superseded the reviewer edit). `GroupHitlCoordinator` now passes the decision's `decidedBy` on both approval paths (explicit `taskApprovals` and the approve-all / timeout path).
* **Metrics.** `WorkspaceMetrics.tasksApproved` and `MemberStats.tasksApproved` count these tasks; `tasksVerified` is left meaning verified. Before, an approved task counted as a `tasksFailed` for its member.
* **Docs:** [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md#standing-teams-i13) (Standing Teams, new "Human approval as done" paragraph), [`hitl.md`](https://docs.labs.ai/conversations-and-orchestration/hitl.md) (group config table).
* **Manager:** a checkbox with help text in the group HITL editor, shown at TASK granularity; `GroupHitlConfig.approvalCompletesBacklogTask` in the API types; two i18n keys in all 11 locales.
* **Platform Operator:** a bullet explaining the writeback rule and the switch; revision bump.

### Design decisions

* **Where the switch lives — `hitlConfig` on the group, not the cadence.** It qualifies the approval gate, so it sits next to `granularity` and `onTaskRejection` where that gate is configured, and it is versioned with the group. A cadence-level flag would have needed the workspace to record which cadence started the running discussion (it does not), and the workspace is deliberately unversioned. The writeback reads it from the group's **current** version (field-injected `IAgentGroupStore`, like `teamBudgetService`); an unreadable config falls back to the default rule, logged.
* **How "approved by a person" is told from "merely COMPLETED".** The outcome must be `COMPLETED` (a later VERIFY that failed it leaves it `FAILED`) **and** carry an approval record whose `decidedBy` is not a `system:*` actor. A task completed in an ungated phase has no record. A side map rather than a 16th `TaskItem` component, following `reviewerEdits`, `awardedBids` and `reworkCounts`: no positional-constructor churn, and the map is persisted with the discussion by the same Jackson document path on MongoDB and PostgreSQL. A document written before it reads back with an empty map (such tasks simply do not count as approved).
* **Timeouts do not count.** `timeoutPolicy: AUTO_APPROVE` approves with `decidedBy=system:timeout`; that is a decision nobody made, so its tasks return to `PENDING` as before — the same line earned-autonomy evidence draws (`TIMEOUT`/`SYSTEM` refused). `system:` is a reserved principal prefix, so no caller can claim it. A `null` decider (auth disabled) is a person, consistent with the coordinator's existing fresh-turn-budget rule.
* **A distinct counter**, `tasksApproved`, rather than crediting `tasksVerified`.

### Tests

`TeamCadenceApprovalWritebackTest` (new): default and explicit `false` unchanged; approved task stays done with its result and counts; edited approval keeps the edit; ungated completion still returns to PENDING; timeout approval does not count; unnamed approver counts; approved-then-failed VERIFY retries; VERIFIED untouched; unreadable config and missing store fall back to the default. `SharedTaskListHitlTest.Approvals` (new): marker recorded/cleared, `byPerson`, old JSON without `approvals` loads, round-trip. `GroupConversationServiceHitlTest`: the timeout approve-all path records `system:timeout`. Manager: `group-hitl-editor.test.tsx`.

### Not done

The workspace page does not display `tasksApproved` yet (it is in the workspace JSON).

***

## ✨ feat(mcp): admin tools for prices, the tenant quota, team cadences and vault names — looser spend waits for a human (2026-11-09)

**Repo:** EDDI (`feat/mcp-admin-spend-tools`)

### What changed and why

An administrator's AI client operating EDDI over MCP could not set the model price catalog, the tenant monthly cost quota or a team's cadences, so it had to drive the Manager in a browser. Those writes were left off MCP on purpose — an MCP client is often a model, and lowering a price to $0 or raising a quota is raising a budget, which is exactly what a prompt injection wants. This change adds the tools without giving that up: **a write that only makes spending stricter applies at once; a write with any loosening part applies nothing and becomes a pending change that an `eddi-admin` approves in the Manager**, with the approver as actor. See [Spend-Control Changes](https://docs.labs.ai/security-and-compliance/tenant-quotas/spend-control-changes.md).

* **12 new MCP tools** (108 → 120). Admin only: `read_tenant_quota`, `update_model_prices`, `update_tenant_quota`, `list_spend_control_changes`, `withdraw_spend_control_change`, `list_vault_keys`. Author tier (`eddi-admin`, `eddi-editor`, as REST): `list_team_cadences`, `create_team_cadence`, `delete_team_cadence`, `read_lesson_consolidation`, `schedule_lesson_consolidation`, `unschedule_lesson_consolidation`. No tool approves or rejects.
* **Classifier** ([`SpendControlDiff`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/spendcontrol/SpendControlDiff.java)), conservative by construction: a removed entry, any lower or cleared price, a looser policy, a raised or disabled quota loosen; a new entry is stricter only under `ALLOW` and only if it costs at least every existing entry of the same provider (or of provider `*`) — whatever the two model patterns. Unset prices are compared as metering charges them: an unset long-context cache price is the base cache price if set, else the tier's input price (not the base input price, which made a cut from 20 to 15 read as a raise from 10).
* **Pending changes** ([`SpendControlChangeService`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/spendcontrol/SpendControlChangeService.java)): stored with the whole proposed document and its base (catalog revision / stored quota); approval applies it only while the base is unchanged (else `STALE`, nothing applied). At most 20 pending, 7-day expiry, 90-day retention, idempotent repeat. MongoDB `spendcontrolchanges`, PostgreSQL `spend_control_changes`. REST `/administration/spend-control-changes` (admin): list, read, approve, reject.
* **Approval claims, then writes.** `PENDING → APPLYING` by compare-and-set (of two concurrent approvals one wins, the other is `ALREADY_DECIDED`), then the write, then `APPLIED`, `STALE` or `FAILED`. A write that throws makes the change `FAILED` (terminal; the outcome text names only the exception type), not `PENDING` again. A change still `APPLYING` was interrupted mid-write (a crash): its outcome is unknown, it is never re-applied and retention keeps it.
* **Approval is human-only, and four-eyes with authentication.** Only an `eddi-admin` identity applies anything, and not the principal that proposed the change (`403 SELF_APPROVAL`, case-insensitive) — an MCP client acts with its user's credential, so this stops a steered model approving its own proposal over REST. Without authentication every caller is `anonymous` and the single operator still approves. The approve/reject paths join the `AGENT_ORIGINATED` request filter and the self-ungating guard; both now match the path without matrix parameters (`/spend-control-changes;x=1/c1/approve` routes to the same method), which also closes that gap for the existing `/hitl/samples`, `/hitl/autonomy` and `/hitl/analytics/rebuild` guards.
* **Compare-and-set for quotas.** `ITenantQuotaStore.compareAndSetQuota`, atomic in the MongoDB (filter on every stored field), PostgreSQL (one conditional statement) and in-memory stores; the MCP side reads a `fingerprint`. Creating the first quota of a tenant on MongoDB is an upsert keyed on `tenantId` alone with `$setOnInsert`, true only when it inserted — like every other write there that may insert.
* **Audit.** Every direct write, proposal and decision writes a `taskType: spendcontrol` ledger entry naming actor, reason, changes and the loosening parts.
* **Manager:** a *Pending changes* panel on Model Prices and Quotas (admins only) with Approve / Reject behind a confirmation; 11 locales. A failed first read shows an error with Retry (not an empty page); a selected change that someone else decided is dropped, so its dialog cannot reopen for a later proposal; on Quotas, Approve is disabled while the quota form has unsaved edits (Save sends the whole form, so it would overwrite the approved quota).
* **`list_team_cadences`** reports `"schedule": "missing"` only when the schedule does not exist; a schedule store failure fails the call instead of reading as a cadence that never fires.
* **Platform Operator:** may read `GET /administration/spend-control-changes` (never decide) and its prompt explains why a proposed price did not take effect. Revision 62 (61 is taken by three open PRs).
* **Claude Code plugin:** the `eddi-admin` skill teaches the new tools and the PROPOSED outcome.

### Design decisions

* **A new price under strict mode is a proposal.** The brief said "adding an entry applies"; under `REFUSE` / `REFUSE_WHEN_BUDGETED` a price *admits* calls refused today (even a $0.0001 price), so that is loosening. Under `ALLOW` a new entry still has to be at least as expensive as every entry of its provider — an exact cheap entry under a dear wildcard lowers that model's price, and so does an entry whose pattern overlaps nothing: a call is priced by the reported model name before the requested one, so a cheap `gpt-4o-2024*` takes over calls that the `gpt-4o` entry prices today. (Pattern-overlap detection was dropped for this reason.)
* **A failed write is `FAILED`, not `PENDING` again.** Whether it took effect is unknown; a later approval of a re-opened change would answer "nothing was applied", which may be false.
* **Four-eyes needs authentication.** With `authorization.enabled=false` principals cannot be told apart, so the check is skipped rather than blocking the single-operator deployment. With authentication, give the MCP client an account of its own, or have a second administrator approve.
* **Position is a price.** `ModelPriceMatcher` breaks a tie between same-provider globs of equal literal length by catalog order (`abc*` before `*xyz` prices `abcxyz`), and removing an entry and upserting it again moves it to the end. So `SpendControlDiff` also compares the relative order of kept globs whose order decides a match, and any such move is loosening — a note-only re-upsert can be a proposal for that reason alone. Two prefixes (or two suffixes) of equal length share no model unless equal, so their order is not judged.
* **Long-context prices are compared on every change of a tiered entry**, not only when the tier record changed: an unset tier cache price falls back to the base cache price, so setting only a base cache price (input 10, tier input 20, base cache read 15) lowers long-context cache reads from 20 to 15.
* **Approve and reject wait for the refetch.** The Manager's decision mutations return the invalidation promises, so the dialog stays open until the Quotas and Model Prices pages hold the approved document; a Quotas form edited in the gap would otherwise save the pre-approval quota over it.
* **Mixed writes are proposed whole**, not split, so an approver sees one coherent document and nothing half-applies.
* **Cadences need no proposal**: a run is skipped when the team budget is spent and charged to the tenant budget; consolidation is capped at $5 per run. Over MCP a cadence must still carry `maxCostPerRun` (≤ $100), narrower than REST.
* **Vault:** names, grants and references only (the existing REST listing, which already drops value and checksum); writing secrets stays off MCP.

### Not done / next

* No Slack or e-mail notification of a pending change yet (logged at `WARN`, metric `eddi.spendcontrol.changes`); the HITL Slack channel is conversation-bound and needs its own card type.
* The change stores have a shared contract (`SpendControlChangeStoreContract`: round trip, status filter and order, CAS under contention, retention), run in memory as a unit test and against real databases by `MongoSpendControlChangeStoreIT` / `PostgresSpendControlChangeStoreIT` in CI. The quota CAS still has no real-database test.
* The Manager shows only `PENDING` changes; an `APPLYING` or `FAILED` one is visible over REST and `list_spend_control_changes`, not yet on the page.
* Review fixes: the `eddi.spendcontrol.changes` series are pre-registered at zero so the first change after startup shows in the panel's `rate()`; `TenantQuotaService.quotaFor` publishes a cache fill only if no invalidation happened since it began, so a CAS tightening cannot be undone by an overlapping stale fill.

**Files:** [`engine/spendcontrol/`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/spendcontrol/README.md), [`McpSpendControlTools`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpSpendControlTools.java), [`McpTeamCadenceTools`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpTeamCadenceTools.java), [`McpVaultTools`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpVaultTools.java) (tested by `McpVaultToolsTest`), [`docs/spend-control-changes.md`](https://docs.labs.ai/security-and-compliance/tenant-quotas/spend-control-changes.md), [`docs/mcp-server.md`](https://docs.labs.ai/protocols-and-integration/mcp-server.md).

***

## 🔍 feat(tools): Brave Search API as the `websearch` paid provider; Google Custom Search deprecated (2026-11-09)

**Repo:** EDDI (`feat/websearch-paid-provider`)

### Why

The built-in `websearch` tool had one paid provider, `google`, which calls Google's Custom Search JSON API. Google [closed that API to new customers and shuts it down on 2027-01-01](https://developers.google.com/custom-search/v1/overview), so a new deployment could not get a key. The other provider, `duckduckgo`, calls DuckDuckGo's Instant Answer API. It needs no key, but it returns an abstract and related topics, not a ranked results page, which is too thin for research agents. (The docs said it did "HTML scraping"; it never did. Corrected.)

### What changed

* **`WebSearchTool`** gains `eddi.tools.websearch.provider=brave`, which calls the Brave Search API web endpoint (`https://api.search.brave.com/res/v1/web/search`) through `OutboundHttp` (same `HOPS_ONLY` SSRF policy, 15 s timeout and 2 MB body cap as the other providers). The key, `eddi.tools.websearch.brave.api-key`, may be plain or a `${vault:...}` reference resolved by `SecretResolver`. A reference the vault cannot resolve fails the search and is never sent. The key goes in the `X-Subscription-Token` header, never in the URL. Results come back in the same shape as Google's (`N. title / snippet / url`), with Brave's `<strong>` highlighting and entities stripped. The query is cut to Brave's 400-character limit.
* **`OutboundHttp.SENSITIVE_HEADERS`** now includes `x-subscription-token`, so a cross-origin redirect drops the Brave key. This covers httpcalls too.
* **Startup WARNs** (`WebSearchTool.configurationWarnings`, observed on `StartupEvent`): `provider=google` names the 2027-01-01 shutdown and the replacement. A paid provider without its key names the missing property and says searches go to DuckDuckGo. An unknown provider value is named. `google` itself still works for existing keys.
* **Default price** (`ToolCostTracker.defaultPriceOf`): `websearch` costs $0.005 per call when the configured provider is `brave` or `google` (both list $5 per 1,000 requests), and stays at $0.001 for `duckduckgo`. A per-agent `toolPricing` still wins. The price follows the *configured* provider, so a paid provider that fell back for lack of a key is still charged as paid. That errs on the safe side for budgets.
* **Price is configurable.** `eddi.tools.websearch.price-per-call` (dollars per call, empty by default) replaces the provider default, so a deployment on a different plan corrects the price without a rebuild; an invalid value (negative, non-finite, non-numeric) falls back to the provider default with a startup WARN. Per-agent `toolPricing` still wins over both. The `google` price rise ($0.001 to $0.005) is called out in [Upgrading](https://docs.labs.ai/deployment-and-infrastructure/upgrading-from-6.5.md#changes-after-670), with how to keep the old price.
* **Docs:** `langchain.md` (Web Search Tool section rewritten: provider table, Brave setup, terms note, Google deprecation; default-price line), `configuration-reference.md`, `docker.md`, `developer-quickstart.md`, `security.md` (pricing line), `README.md` feature table.
* **Platform Operator:** a web-search bullet in `system-prompt.ts` (provider property, what DuckDuckGo returns, Brave key, Google deprecation, default prices). The operator revision is bumped.
* **Tests:** `WebSearchToolProviderTest` (provider selection, the Brave request (header, URL, no key in the URI), result shape, the `maxResults` cap, query truncation, non-200, vault resolve and refuse, startup warnings before and after the shutdown date) and `ToolCostTrackerTest.WebSearchProviderPrice`. HTTP is mocked at `OutboundHttp`.

### Design decisions

* **Brave over Tavily, Exa and SerpAPI.** Prices checked 2026-11-09:

  * Brave *Search*: $5 per 1,000 requests, $5 of free usage a month ([brave.com/search/api](https://brave.com/search/api/)). Brave runs its own index and authenticates with a header key. Its terms allow use inside the customer's application, but forbid storing results beyond "transient storage required for operation" and training on them.
  * Tavily: $0.008 per credit pay-as-you-go, 1 credit per basic search, 2 per advanced search ([docs](https://docs.tavily.com/documentation/api-credits)).
  * Exa: $7 per 1,000 for Auto/Fast search, $4 for Lite/Instant ([exa.ai/pricing](https://exa.ai/pricing)).
  * SerpAPI resells scraped Google results, which carries its own terms risk.

  Brave is the cheapest of these with an independent index, and its response maps one-to-one onto the shape the tool already returns.
* **The conversation memory keeps tool results.** Whether that counts as "storage" under Brave's terms depends on how long a deployment keeps conversations. The docs say so and point at Brave's storage-rights plans, rather than EDDI dropping search results from memory.
* **Fallback stays silent at call time but loud at startup.** This matches how `google` already behaved without credentials. Failing every search on a missing key would break agents on a config typo.

### Next

* `searchNews` still appends " news" to a web search. Brave has a dedicated news endpoint, which could back `searchNews` when `provider=brave`.

### Review follow-up (2026-11-15)

* A Brave query is now cut to 75 words as well as 400 characters, so a short query with many one-letter words stays inside the API contract.
* `docker-compose.yml` passes `EDDI_TOOLS_WEBSEARCH_PROVIDER` and `EDDI_TOOLS_WEBSEARCH_BRAVE_API_KEY` into the container (documented in `.env.example` and the developer quickstart); before, setting them on the host left Compose on DuckDuckGo.
* The Platform Operator prompt now says that search pricing follows the configured provider even when a missing key makes the search run on DuckDuckGo, and states the precedence: the agent's `toolPricing`, then `eddi.tools.websearch.price-per-call`, then the provider default.

***

## ✨ feat(groups): approved-result actions — `phase.onApproved` runs one call with each human-approved task (2026-11-09)

**Repo:** EDDI (`feat/group-approved-result-actions`)

### What changed and why

A member agent's approval-gated tool call is auto-rejected inside a group turn (`inGroupTurns: REJECT`), so a team that may publish only human-approved text could not gate the posting call. The workaround was a separate "Publisher" member re-posting the approved text in a later phase: an extra LLM turn per post, a judge to check it did not reword the text, and phase plumbing to file publish tasks after the approval (a TASK pause resumes in the same phase). The gate now sits where it belongs — on the draft — and the group itself makes the call:

```json
{ "name": "Draft", "type": "EXECUTE", "requiresApproval": true,
  "onApproved": { "action": { "type": "HTTPCALL",
                              "uri": "eddi://ai.labs.apicalls/apicallstore/apicalls/<id>?version=1",
                              "call": "postIssueComment" },
                  "onFailure": "FAIL_TASK" } }
```

* **Model** (`AgentGroupConfiguration`): `DiscussionPhase.onApproved` (`OnApprovedConfig` → `ApprovedAction` `{type, uri, call}`, `ApprovedActionFailurePolicy` `FAIL_TASK` default | `KEEP_COMPLETED`). A 13-argument compatibility constructor keeps every existing call site; the two full-copy sites (facilitator EXTEND\_PHASE, NEGOTIATION arbitration repair) carry the field. `null` = nothing runs.
* **Record** (`SharedTaskList.approvedActions`, taskId → `ApprovedActionRecord`): status `PENDING` / `RUNNING` / `SUCCEEDED` / `FAILED` / `OUTCOME_UNKNOWN` / `SKIPPED` / `NOT_SENT`, target, `onFailure`, approver, edit flag, idempotency key, timestamps, HTTP code, `html_url`/`url` of the response, a short redacted summary. Persisted with the discussion; old MongoDB/PostgreSQL documents load with an empty map.
* **Runner** (`GroupApprovedResultActions`, wired into `GroupHitlCoordinator` by a setter like the tie-break pauses): `recordApprovals` runs inside `resumeDiscussion` after the task approvals and before the resume CAS, for the tasks that went AWAITING\_APPROVAL → COMPLETED in the paused phase; `runOwed` runs on the resumed leg (approval and human-input resumes) after the drift guards and **before** `executeDiscussion`, so a dependent never starts before its dependency's publish settled.
* **Executor:** the existing `IApiCallExecutor` (`ApiCallExecutor`), the path httpcall rules and httpcall LLM tools use — vault resolution, the reference guard, redaction, response caps, the agent-test mock registry — with a throwaway `ConversationMemory` (a group has no conversation of its own). Template data is `task.*`, `group.*`, `action.idempotencyKey`, nothing else. MCP-tool actions are not in v1 — one executor done properly, and the `type` field leaves room.
* **Validation** (`ApprovedResultActionValidation`, called from `AgentGroupStore.create/update`, `400` with the phase index and the fix): EXECUTE phase, `requiresApproval`, `hitlConfig.granularity: TASK`, `uri` an httpcalls URI with an explicit version, the call exists and makes one request (no fire-and-forget, batch, forEach), it has no `preRequest.propertyInstructions` (the executor would rebuild the template data from memory and drop `task.*`/`group.*`/`action.*`), the saver holds USE access to the httpcalls configuration, every `${vault:...}` is granted to all agents (`ServiceJudgeVaultGrants`, its message now names approved-result actions too) — checked on each field and on the URL as the executor joins it, so a reference split across `targetServerUrl` and the path is caught — and `${connection:}`, `${caller:}`, `${context:}` are refused. The reference half is re-checked before every send.
* **Audit/metrics:** with the audit ledger enabled, one ledger entry per settled action (`group.approved_action`, approver, target, status, result SHA-256 and length, HTTP code, URL); counter `eddi_group_approved_action_total{outcome}` on every settled action.
* **Docs:** new `docs/group-approved-result-actions.md` (in `SUMMARY.md`) with a Content Studio example posting an approved GitHub comment; pointers from `group-conversations.md` (per-phase controls), `hitl.md` (group config table, Group members) and `hitl-review-and-audit.md` (edited results). Platform Operator prompt gained the field (revision bump). Manager: the `DiscussionPhase` type declares `onApproved`; the phase editor already spreads unknown fields through, so a save keeps it — editing it stays JSON-only. MCP: `update_group` takes the full config JSON already; `create_group` builds phases from a style and needs nothing.

### Design decisions

* **At most once, honestly named.** The record is created in the approval's own state+pauseId CAS write (a retried approval loses it), claimed as RUNNING and persisted *before* the send, and a RUNNING record found later becomes OUTCOME\_UNKNOWN and is never resent — the tool-call execution journal's contract. `{action.idempotencyKey}` lets a deduplicating target make it effectively once across a crash. The claim is a CAS on the discussion still being IN\_PROGRESS, so a cancel stored first makes it fail; a claim that cannot be written sends nothing and settles the record SKIPPED (a cancel seen on this pod or read back from the store) or FAILED, rather than leaving it PENDING for a leg that may not come. The metric always counts that outcome; an audit entry carries it only when the audit ledger is enabled and its submission succeeds; the stored record shows it only if the follow-up write succeeds — a cancelled discussion refuses it, and then the next rule settles it.
* **An ended discussion owes nothing** (`GroupConversationStore.settleOwedApprovedActionsIfEnded` → `SharedTaskList.settleOwedApprovedActions`): on every read and write of a document in a terminal state (COMPLETED, FAILED, REJECTED, CANCELLED, CLOSED) a PENDING record becomes `NOT_SENT` with the state it ended in, and an orphaned RUNNING claim becomes OUTCOME\_UNKNOWN. In the store because it is the one place every ending passes — the leg's own terminal writes, cancels by another pod, cadence reclaims and crash recovery (#1326) — on MongoDB and PostgreSQL alike. Never sent afterwards: a crash must not turn an approval into a publish nobody watched. No audit entry or metric for these (no leg is running). A read settles without persisting, so an ended document that is never written again is settled anew on every read: the finish time is the discussion's own `lastModified` (falling back to the record's claim or approval time), never `now()`, so every read — and the write that finally persists it — shows the same record; a read logs at DEBUG (the Manager polls), a write at INFO. Rejected: auto-sending on recovery (breaks at most once); calling a settle hook at each of the nine terminal-transition sites (one missed site, or #1326's, leaves it stuck).
* **A task is approved once per discussion; a re-approval, should one happen, owes a new attempt only when nothing was published.** In the configuration `onApproved` requires (TASK granularity, gated EXECUTE phase) no engine path returns an approved task to approval: `onTaskRejection: RETRY` resets only a task rejected while AWAITING\_APPROVAL (`GroupHitlCoordinator` refuses a decision on any other status), and VERIFY rework is skipped when the EXECUTE phase gates tasks (`TaskForceEngine`). So a task whose action FAILED under `FAIL_TASK` stays FAILED for the rest of the discussion; the way to publish it after all is by hand, or — on a standing team — through the backlog in a later discussion. The docs, the failed-claim summary and the Platform Operator prompt used to say "send the task back (retry or rework) and approve it again", which no path does; they now say what works. `recordApprovedAction` still replaces a record whose status `allowsNewAttempt()` — FAILED, SKIPPED, NOT\_SENT — and keeps every other: PENDING/RUNNING (still owed or in flight), SUCCEEDED (never sent twice), OUTCOME\_UNKNOWN (never resent), and the new attempt reuses the **earlier record's idempotency key** rather than recomputing it, so a workspace that was unreadable at the first approval and readable at the second cannot give the same publish two keys.
* **Idempotency key from the stable identity.** A cadence discussion's task pulled from the standing team's backlog is keyed `sha256("backlog/" + groupId + "/" + backlogTaskId)` — the backlog task found the way writeback matches it (by subject among the workspace's `pulledTaskIds`, while `runningDiscussionId` is this discussion) — so a task that returns to the backlog after a FAILED or OUTCOME\_UNKNOWN publish offers the target the same key in its next discussion. Only when the subject match is unambiguous on both sides — exactly one pulled backlog task and exactly one task of the discussion have it — since two publishes sharing a key would let a deduplicating target drop one. Other tasks (an ambiguous subject, an unreadable workspace) keep `sha256(conversationId + "/" + taskId)`. The workspace is read once per approval decision, and only when it records a task. At most once remains per discussion; across discussions only a deduplicating target makes it once (documented). The Platform Operator prompt says the same (revision 61, fingerprint updated).
* **"Approved by a person"** is one private helper, `approvedByPerson`, whose comment names the sibling PR #1374's `TaskApproval.byPerson()`: whichever merges second unifies the two.
* **Only human approvals publish.** A `system:*` approval (timeout `AUTO_APPROVE`) records SKIPPED.
* **Identity:** the call runs as the group (`runAs: group:<groupId>` in the audit entry) with author-written, all-agents secrets only; the approver is recorded, never impersonated.
* **Cost:** an HTTP call; tool pricing, tool rate limits and the cost ceiling do not apply (documented); bounded by one call per approved task.
* **Cadence writeback** (`TeamCadenceService`, not modified): under `FAIL_TASK` a failed publish leaves the task FAILED, so the run does not count it done; under `KEEP_COMPLETED` it stays COMPLETED.

### Rolling upgrade

No schema bump: the fields are additive. A pod older than this release ignores `onApproved` (approvals publish nothing on it) and drops `approvedActions` when it re-saves a discussion, which can lose an owed (PENDING) action but never sends one twice.

### Open

* A pod crash after the approval but before the claim leaves the record PENDING while the discussion stays IN\_PROGRESS; it is sent only if a later leg runs, and reads NOT\_SENT once the discussion ends (crash recovery cancelling it included).
* Retries configured on the referenced call (`postResponse.retryApiCallInstruction`) still apply and can repeat a request the target processed.
* No in-discussion way to retry a publish that ended FAILED: whether a person should be able to send such a task back for another approval (and how that interacts with at most once) is a product decision not taken here.

***

## 🐛 fix(httpcalls): a literal target the SSRF check refuses fails at deploy, not on the first turn (2026-11-09)

**Repo:** EDDI (`fix/httpcall-target-check-at-deploy`)

### What changed and why

External security review, finding B1 (real, low). With `eddi.security.ssrf-protection.enabled=true`, an httpcall whose literal `targetServerUrl` the SSRF check refuses (`http://127.0.0.1:7070/...`) saved with 201, deployed with 200, and only failed when the first conversation started: `ApiCallExecutor.buildRequest` threw and `POST /agents/{id}/start` answered a bare 500. At deploy, `ApiCallsTask.configure` only refused templated hosts.

* **One decision, two callers.** The SSRF block of `buildRequest` is extracted unchanged into `ApiCallExecutor.checkOutboundTarget(URI, HostResolver)`; `buildRequest` calls it with the JDK resolver, so runtime behaviour is the same. The new `IApiCallExecutor.rejectRefusedLiteralTarget` runs it at deploy on the scheme and authority of `targetServerUrl` and of every absolute `request.path` (`ApiCallsTask.rejectRefusedTargets`, formerly `rejectTemplatedHosts`). A refusal is a `WorkflowConfigurationException` naming the host, the `host:port` entry to add to `eddi.security.ssrf-protection.allowed-hosts`, and the alternative of a public address. A cloud-metadata target fails to deploy whatever the flag, with the metadata message (the allow-list cannot admit it, so the advice would be wrong).
* **Skipped at deploy:** a templated host (still handled by `rejectTemplatedAuthority`) and a `${vars:…}`/`${vault:…}` host — both are only known per call, where the same check runs.
* **DNS:** a host that does not resolve at deploy is logged, not refused. The execution path still refuses it with protection on; but a failed lookup at deploy is as likely a transient resolver problem (agents auto-deployed at startup) as a wrong name, and an unresolvable name cannot be reached anyway. A blocked name (`localhost`, `*.internal`, `*.local`) is refused without a lookup, as at execution.
* **DNS lookups are bounded.** The check resolves the host (deploy and, as before, every call), and `InetAddress.getAllByName` has no timeout: a black-holed name server would hold the deploying or turn thread for the OS default. Both now go through `BoundedHostResolver` (small bounded daemon pool, deadline `eddi.security.ssrf-protection.dns-timeout`, default `5s`). A timeout or a full pool is an `UnknownHostException`, i.e. "does not resolve": refused at execution with protection on, logged at deploy, never allowed. No default of any security flag changes. New property documented in `configuration-reference.md`; `BoundedHostResolverTest` covers fast, slow, failing and saturated.
* **Upgrade note** added to `upgrading-from-6.5.md` (Changes after 6.7.0).
* **No self exception for httpcalls — documented, not changed.** The `application.properties` comment on `eddi.self.base-url` claimed loopback was always refused with protection on; it now says that `OutboundTargetPolicy` targets accept the self URL while httpcalls need the host on the allow-list. `OutboundTargetPolicy`'s Javadoc no longer says it applies the flag "the way ApiCallExecutor" does without naming that difference, and the LLM httpcall tool's refusal message (`HttpCallToolsProvider.describeToolFailure`) now names the allow-list as well as `eddi.self.base-url`.

The Platform Operator needed no change: its prompt and allow-list say nothing about SSRF, and a refused deploy surfaces through the deployment status it already reads.

**Files:** [`ApiCallExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutor.java), [`IApiCallExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/IApiCallExecutor.java), [`BoundedHostResolver.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/net/BoundedHostResolver.java), [`ApiCallsTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallsTask.java), [`OutboundTargetPolicy.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/httpclient/OutboundTargetPolicy.java), [`HttpCallToolsProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/HttpCallToolsProvider.java), [`application.properties`](https://github.com/labsai/EDDI/tree/main/src/main/resources/application.properties), [`security.md`](https://docs.labs.ai/security-and-compliance/security.md), [`httpcalls.md`](https://docs.labs.ai/agent-configuration/httpcalls.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [`ApiCallTargetDeployCheckTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/apicalls/impl/ApiCallTargetDeployCheckTest.java), [`ApiCallsTaskTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/apicalls/impl/ApiCallsTaskTest.java)

***

## 🐛 fix(apicalls): redact encoded echoes of a substituted secret (2026-11-09)

**Repo:** EDDI (`fix/redact-encoded-secret-echoes`)

### What changed and why

External security review finding B11 (low). Response redaction for httpcalls is by value: the executor knows every plaintext it substituted into a request and removes it from the response before the response reaches conversation memory, template data, the tool result or the log. It removed exact occurrences only. A server that echoed the secret header back verbatim was redacted; URL-encoded it was redacted only because the tester's value was alphanumeric; **base64-encoded it was stored in conversation memory as it came**.

`SecretEncodings` (new, next to `SecretValueScrubber`) expands a set of secrets into the needle set the scrubbers search for: every value of at least the minimum length also contributes its base64 (standard and URL-safe, padded and unpadded), percent-encoding (`+` or `%20`, upper or lower hex, `~` escaped or literal, and the characters `URLEncoder` leaves literal — `*` `-` `.` `_` — left alone, only `*` escaped as `%2A`/`%2a`, or all four escaped), JSON string escaping (`/` escaped or not, non-ASCII literal or `\u`-escaped in either case) and HTML entity forms, and a whole `Basic <base64>` credential also contributes its decoded `user:password` and password. The set is built once per redaction and handed to the existing scrubber, so the walk itself is unchanged.

`ApiCallExecutor` uses it in four places, each a one-line change in the helper section: the success text and the long-secret tree pass (floor 8, `MIN_SUCCESS_BODY_REDACTION_LENGTH`), the short-secret exact pass (floor 4, `MIN_SEARCHED_SECRET_INPUT_LENGTH` — whole-value matches only), response header values and the error body (floor 8 for the encoded forms; the plaintext itself is still redacted at every length there).

The error body goes through one helper, `redactErrorBody`, for a single call **and** for every `forEach` item. The item path used to redact its error body with the plaintexts only, so an item whose 401 echoed the key base64- or URL-encoded was stored with the echo while the same response to a single call was redacted; `ApiCallExecutorForEachTest` now covers both forms and asserts the two paths store the same text.

### Design decisions

* **Same floor for the forms as for the value.** Every encoded form is at least as long as the value it encodes, so the 8-character floor that keeps a short username from being rewritten inside ordinary text also bounds its encodings. A short secret's forms are matched only where a JSON value *is* one — the rule its plaintext already follows.
* **Not covered, documented instead:** reversed or transformed values, hex/base32/double encoding, and a secret inside a longer base64 blob (`base64(user:secret)` does not contain `base64(secret)`). The redaction protects later readers of a conversation from an accidental echo; it is not a defence against the target server.
* **Follow-up (review):** the per-call response log line (`RequestRedactor.safeResponseLog`: status message, body and headers) and the non-2xx status-message fallback now use the same encoded-form needles as the error-body path.
* The change lives in a new helper rather than in `SecretValueScrubber` or `SecretScrubber`, and the `ApiCallExecutor` edits stay in its helper section, away from open PRs touching those files.

**Files:** [`SecretEncodings.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/SecretEncodings.java), [`ApiCallExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutor.java), [`SecretEncodingsTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/memory/SecretEncodingsTest.java), [`ApiCallExecutorEncodedEchoRedactionTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutorEncodedEchoRedactionTest.java), [`ApiCallExecutorConfigReferenceTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutorConfigReferenceTest.java), [`ApiCallExecutorForEachTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutorForEachTest.java), [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md)

***

## 🐛 fix(spaces): a space id that matches none of the caller's spaces no longer says "not a member" (2026-11-09)

**Repo:** EDDI (`fix/space-errors-and-descriptor-patch`)

### What changed and why

External security review, findings B9 and B10 — both message-only. The checks themselves are unchanged: still exact, still fail-closed.

* **B9 — `?space=` on `/spacestore/**`.** Space ids are opaque and may contain `%` (group `a|b` is `team:a%7Cb`). Sent raw, the id is decoded once by the container and arrives as `team:a|b`, which matches none of the caller's spaces — and the 403 told a member "You are not a member of that space." It now quotes the id as received (sanitised, capped at 200 characters) and says to send the id exactly as `GET /workspaces` lists it, URL-encoded with `encodeURIComponent` — what the Manager already does.
* **B10 — `X-EDDI-Space`.** The header is compared exactly and case-sensitively (Keycloak group names are case-sensitive), so `TEAM:engineering` or `team:engineering/` is refused — correctly — with "You are not a member of the space …". The refusal now says the value matches none of the caller's spaces, that the comparison is exact and case-sensitive with only surrounding whitespace ignored, and points at `GET /workspaces`.

Both texts live in one new class, `SpaceRefusals`. Neither lists the caller's spaces: `GET /workspaces` already does, and an error body ends up in client logs. The OpenAPI 403 descriptions on `IRestSpaceResources` say the same. `docs/workspaces.md` documents the exact header match and the encoding of `space`.

The Platform Operator quotes neither message (checked `ui/manager/src/lib/operator/`), so its prompt and allow-list are unchanged.

**Files:** [`SpaceRefusals.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/SpaceRefusals.java), [`SpaceHeaderFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/SpaceHeaderFilter.java), [`RestSpaceResources.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/rest/RestSpaceResources.java), [`IRestSpaceResources.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/rest/IRestSpaceResources.java), [`SpaceHeaderTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/security/spaces/SpaceHeaderTest.java), [`SpaceResourcesTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/security/spaces/SpaceResourcesTest.java), [`workspaces.md`](https://docs.labs.ai/security-and-compliance/workspaces.md)

***

## 🐛 fix(descriptors): PATCH refuses a document that sets anything but name and description (2026-11-09)

**Repo:** EDDI (`fix/space-errors-and-descriptor-patch`)

### What changed and why

External security review, PATCH side note. `PATCH /descriptorstore/descriptors/{id}` applies `name` and `description` only, and answered 204 to a document that also set `visibility`, `spaceId`, `grants` or anything else — so a client making an agent private was told it had, while its visibility stayed as it was. It now answers **400** and writes nothing. The message names every unsupported field and where it is changed instead: visibility, space, owner and grants under `/descriptorstore/descriptors/{id}/shares/…`; `deleted` by a DELETE on the resource's own store; `resource`, the timestamps, `originId`, `syncedVersion` and `accessIndex` are maintained by EDDI. A DELETE patch is held to the same rule, since it would not clear those fields either.

**How "set" is detected.** A declared field counts when it is non-null — `deleted`, a primitive, when it is `true`; none of the others has a deserialisation default, and every in-process caller builds its patch from an empty `DocumentDescriptor`. A key the model does not declare at all (the review's `resourceVisibility`) was dropped by the REST mapper's `FAIL_ON_UNKNOWN_PROPERTIES=false`, so `DocumentDescriptor` gained a `@JsonAnySetter` that records such keys — names only, capped at 100, never serialised or stored, values still discarded — exposed as `unmodeledFields()`. Stored descriptors with legacy fields load exactly as before. Undeclared keys are echoed quoted, sanitised, shortened to 64 characters and at most ten (`N more` for the rest). `callerLevel` and `ownerName` are read-only, and Jackson hands such a property to the any-setter rather than dropping it; they are skipped there, so a client echoing them is not refused for it.

**Caller audit.** Every PATCH of the descriptor store sends name and/or description only: the Manager's `updateDescriptor` (nine call sites, the operator marker among them), MCP `create_agent` / `update_agent`, `AgentSetupService`, and `src/main/docker/seed-demo-agent.sh`. The Chat UI sends none, and the Platform Operator's prompt says nothing about this body — its write canary renames the operator, a name-only patch — so neither the prompt nor the allow-list changes. `updateDescriptor`'s parameter type also allowed a `resources` key no caller used and the server never had; it is gone. Unknown keys elsewhere in EDDI are unaffected: the recording is on this model only, and only this endpoint reads it.

**Files:** [`DocumentDescriptor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/descriptors/model/DocumentDescriptor.java), [`RestDocumentDescriptorStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/descriptors/rest/RestDocumentDescriptorStore.java), [`IRestDocumentDescriptorStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/descriptors/IRestDocumentDescriptorStore.java), [`RestDocumentDescriptorStoreTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/configs/descriptors/rest/RestDocumentDescriptorStoreTest.java), [`descriptors.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/api/descriptors.ts), [`developer-quickstart.md`](https://docs.labs.ai/getting-started/developer-quickstart.md)

***

## 🐛 fix(openai-compat): the /v1 shared key works with OIDC on (2026-11-09)

**Repo:** EDDI (`fix/v1-shared-key-under-oidc`)

### What changed and why

Security review finding B7. With `quarkus.oidc.tenant-enabled=true` (for example `docker-compose.auth.yml`) and the default `eddi.openai-compat.http-policy=permit`, every `/v1` request carrying the shared key (`Authorization: Bearer sk-…`) got `401` with a `WWW-Authenticate` challenge from the OIDC layer, and `OpenAiAuthFilter` never ran. Requests without an `Authorization` header did reach the filter. Open WebUI cannot mint per-user OIDC tokens, so Keycloak + Open WebUI, the main production setup, could not work, although [the docs](https://docs.labs.ai/protocols-and-integration/open-webui-integration.md) said it did.

**Cause.** `/v1/*` has its own `permit` permission so the key can reach the filter, but Quarkus authenticates proactively. Read from the Quarkus 3.40.1.1 sources (the version `pom.xml` pins): `HttpSecurityRecorder.AuthenticationHandler` runs `HttpAuthenticator.attemptAuthentication` before any permission policy is consulted, and an `AuthenticationFailedException` from it goes to `DefaultAuthFailureHandler`, which sends the challenge and a `401` whatever the policy says. `OidcAuthenticationMechanism` hands the bearer value to its bearer mechanism, which cannot verify `sk-…` as a token and throws. Without a header it returns no identity instead, which is why only that case got through.

**Fix.** A new `OpenAiPermitModeAuthMechanism` (an `HttpAuthenticationMechanism` bean). `HttpSecurityConfiguration.getMechanisms` sorts mechanisms by descending priority, and `HttpAuthenticator.createSecurityIdentity` stops at the first one that returns an identity when inclusive authentication is off. The new mechanism ranks one above `quarkus.oidc.priority` (default 1001) and, for a `/v1` request in permit mode, returns the anonymous identity. That is the identity `HttpSecurityRecorder` assigns to a request that carried no credential at all. OIDC is never asked about the key, the `permit` policy admits the request, and `OpenAiAuthFilter` checks the key: the right key is served, a wrong one or a JWT gets the adapter's `401 invalid_api_key`. The mechanism verifies nothing and grants nothing; anyone can be anonymous by leaving the header out.

It fails closed. It returns no identity, and OIDC runs as before, unless all of these hold: the adapter is enabled; `eddi.openai-compat.http-policy` **and** the effective `quarkus.http.auth.permission.openai-compat.policy` are both `permit`; `quarkus.http.auth.inclusive` is off; the method is one the permission lists; and both path forms Quarkus matches permissions against (the router's `normalizedPath()` and `HttpSecurityUtils.normalizePath` of it) are `/v1` or below it. With `http-policy=authenticated` nothing changes: OIDC validates the JWT and the filter checks the role. No other path's authentication changes, and proactive authentication stays on.

`OpenAiStartupGuard` now warns at startup when OIDC is on, the adapter is in key mode, and the mechanism cannot be active (inclusive authentication, an overridden `/v1` permission, or an unknown `http-policy`). In those cases every shared-key request would still get the OIDC `401`.

### Design decisions

* **Not an OIDC tenant.** A `TenantConfigResolver` returning a disabled tenant for `/v1`, or a named disabled tenant chosen by a `TenantResolver`, would also stop the verification (`OidcAuthenticationMechanism.authenticate` returns no identity for a disabled tenant). But in quarkus-oidc either one changes how the *default* tenant starts. `TenantContextFactory.createTenantContext` silently disables a default tenant with no `auth-server-url` once a `TenantConfigResolver` bean or a named tenant exists, where that is a startup failure today. A named static tenant is also selected by `DefaultStaticTenantResolver` for any request path with a segment equal to its id.
* **Not a per-path `auth-mechanism`.** It would need a config value that switches between this mechanism and `bearer` with `http-policy`, and a mechanism that names a credential transport.
* **The key is not checked in the mechanism.** The filter already checks it, in constant time, and answers in the OpenAI error envelope. A second check would mean two places to keep in step.

### Tests

* `OpenAiPermitModeAuthMechanismTest`: activation (each fail-closed condition on its own), path and method matching including disagreeing normalizations, the anonymous identity, no challenge, priority above OIDC, a chain that reproduces `HttpAuthenticator`'s ordering and shows the OIDC mechanism is never called for a `/v1` key request, and a pin on the shipped `openai-compat` permission in `application.properties`.
* `OpenAiStartupGuardTest`: the new warning condition.
* The Keycloak Auth E2E tier (`ui/manager/docker-compose.integration-keycloak.yml`) now enables the adapter with a shared key. [`e2e/auth/openai-compat.spec.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/e2e/auth/openai-compat.spec.ts) covers: the key is served on `/v1/models`; a full chat completion runs end to end; a wrong key, no key and a Keycloak JWT each get the adapter's `401 invalid_api_key` with no challenge; the key on a non-`/v1` path still gets OIDC's `401`. These are the regression tests against a real OIDC provider.

**Files:** [`OpenAiPermitModeAuthMechanism.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/OpenAiPermitModeAuthMechanism.java), [`OpenAiStartupGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/OpenAiStartupGuard.java), [`OpenAiAuthFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/OpenAiAuthFilter.java) (Javadoc), [`application.properties`](https://github.com/labsai/EDDI/tree/main/src/main/resources/application.properties) (comments), [`open-webui-integration.md`](https://docs.labs.ai/protocols-and-integration/open-webui-integration.md), the two test classes, the E2E spec and compose file.

The Platform Operator needs no change: neither its prompt nor its allow-list covers the `/v1` adapter, which is deployment configuration.

***

## ♻️ refactor(llm): one AbandonableStreamCall for both streaming skeletons (2026-11-08)

**Repo:** EDDI (`refactor/abandonable-stream-call`)

### What changed and why

The legacy streaming path (`StreamingLegacyChatExecutor`) and the tool loop's streaming bridge (`ToolLoopStreamingChatModel`) each carried their own copy of the same concurrency skeleton: a latch per call, an `abandoned` gate, a lock that makes recording, forwarding and abandoning mutually exclusive, and the await with a timeout. The legacy copy was marked "KEEP IN SYNC" with the other, which is the only thing that kept a concurrency fix in one from missing the other.

* **New `AbandonableStreamCall`** — the one implementation. A fresh instance per call is the provider's `StreamingChatResponseHandler`; `await(seconds)` abandons the call before it returns on a timeout or an interrupt, `abandon()` covers a retried error, `forwardedText()` reads under the lock, and `runUnlessAbandoned` covers the legacy path's single-chunk fallback emit. Both callers keep their own policy: what an interrupt means (legacy salvages or throws, the tool loop throws), the timeout metric, the separator between tool-loop rounds, and the log wording.
* **The below-backstop `timeout` warning is no longer static state.** Its warn-once key set moved into an instance helper owned by the executor (one executor per `LlmTask`, shared with the cascade, so still once per process in production), and the two test-only static hooks (`shortTimeoutWarningCount`, `resetShortTimeoutWarnings`) are gone — the tests count the WARN lines instead.
* **`resolveTimeoutSeconds` got its Javadoc back.** The precedence rules for `timeout` against `streamingTimeoutSeconds` sat above a second Javadoc block and documented nothing. The static method is now the pure resolution (the cascade's step margin uses it and logs nothing); requests go through the instance method `backstopSeconds`, which also warns. `LlmTask`'s tool-loop bridge uses `backstopSeconds`, so that path still warns as before.

Behaviour is unchanged: the same text reaches the sink and memory, the same exceptions, metadata, metrics and log lines.

**Files:** [`AbandonableStreamCall.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/AbandonableStreamCall.java), [`StreamingLegacyChatExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/StreamingLegacyChatExecutor.java), [`ToolLoopStreamingChatModel.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopStreamingChatModel.java), [`LlmTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmTask.java), [`AbandonableStreamCallTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/impl/AbandonableStreamCallTest.java), [`StreamingLegacyChatExecutorTimeoutTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/impl/StreamingLegacyChatExecutorTimeoutTest.java)

### Design decisions

* **A handler object, not a template method.** The two callers differ in everything after the await (retry and salvage versus a thrown exception the tool loop's retry classifies), so the shared part is the call's state and its gate, and each caller keeps its control flow.
* **`abandoned` is a plain field under the lock.** Both copies only ever read and wrote the `AtomicBoolean` inside the lock, so the atomic added nothing.
* **Not unified here:** the timeout counter is still incremented from the executor's injected `MeterRegistry` on one path and from `Metrics.globalRegistry` on the other. Moving the tool loop onto the injected registry changes which registry a deployment sees the `tool_loop` series in, which is a behaviour change for a separate PR.

***

## 🧪 refactor(llm): chat/streaming parity test for every provider builder (2026-11-08)

**Repo:** EDDI (`refactor/builder-option-appliers`)

Every provider builder configures two langchain4j clients, a synchronous one and a streaming one, and the two builder types share no supertype, so each builder applied its parameters twice, in two method bodies that differed only in the retry setting. Nothing failed when one of them was edited and the other was not: only Anthropic had a test comparing the two, and the whole builder package was excluded from the coverage gate.

### What changed and why

* **`ProviderChatStreamingParityTest`** builds both clients of every provider (OpenAI, the eight OpenAI-compatible presets, Anthropic, Mistral, Ollama, Gemini, Azure OpenAI and Bedrock) from parameter maps that together set every key the builder recognises, and asserts that the two report equal `defaultRequestParameters()` and send the same first request: URL, headers, JSON body without the streaming switch, and client timeouts. A key added to `recognisedParameters()` without a value in the test fails it, so the check cannot silently fall behind. Bedrock's AWS client cannot be intercepted offline and is compared on its request parameters only.
* **Streaming test seams** for OpenAI, Mistral and Ollama (`buildStreaming(…, HttpClientBuilder)`), matching the ones Anthropic and Gemini already had, and an `HttpClientProvider` seam for both Azure clients. Production passes the same clients as before.
* **`RecordingHttpClient`** records the connect and read timeouts the provider client configures, so the timeout is compared too.
* **JaCoCo** now excludes only the two builders whose clients cannot be built offline (Vertex: GCP credentials; OCI: `~/.oci/config`), instead of the whole package on the stale ground that it had no logic and needed live keys. The package holds the parameter catalog, the value parsing and the bounded HTTP client, all unit-tested.
* The OpenAI and Azure Javadoc no longer claims the two clients "cannot drift"; the test is what checks it.

**Files:** [`ProviderChatStreamingParityTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/impl/builder/ProviderChatStreamingParityTest.java), [`RecordingHttpClient.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/impl/builder/RecordingHttpClient.java), [`OpenAILanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/OpenAILanguageModelBuilder.java), [`MistralAiLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/MistralAiLanguageModelBuilder.java), [`OllamaLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/OllamaLanguageModelBuilder.java), [`AzureOpenAiLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/AzureOpenAiLanguageModelBuilder.java), [`pom.xml`](https://github.com/labsai/EDDI/tree/main/pom.xml)

***

## ♻️ refactor(llm): provider request parameters built once for both clients (2026-11-08)

**Repo:** EDDI (`refactor/builder-option-appliers`)

With the parity test in place, the request-level settings of each provider builder are now built once, into langchain4j's own request-parameter type for that provider, and handed to the synchronous and the streaming client through `defaultRequestParameters(...)`. langchain4j starts every request from those, so the two clients cannot send different sampling, token, stop, seed, caching or thinking settings any more; what each client builder still receives on its own is the short list of options that are not part of a request (endpoint, credentials, timeout, logging, headers) or that the library only accepts there.

### What changed and why

* **OpenAI** (and through it the OpenAI-compatible presets): `OpenAiChatRequestParameters` carries model, sampling, token limits, stop, seed, logit bias, reasoning effort, service tier, parallel tool calls, store, metadata, user, prompt cache key and the custom body fields. `strictTools`, `strictJsonSchema` and the `json_object` response format stay on the client builders.
* **Anthropic**: `AnthropicChatRequestParameters` carries model, `maxTokens`, sampling, stop, thinking type and budget, the thinking switches, the cache flags and TTL, `disableParallelToolUse` and `userId`. `thinkingDisplay`, `strictTools`, version, beta and the custom body fields stay on the client builders, which are the only place langchain4j takes them.
* **Mistral**: `MistralAiChatRequestParameters` carries everything except `strictJsonSchema` and the connection options.
* **Ollama**: the two hand-kept `applyTo` twins are gone; the parameters are read once into a `Settings` record whose `OllamaChatRequestParameters` carries the sampling and context options, `think` and `truncate`.
* **Gemini**: the two `applyExtras` twins are replaced by one `read` into a `Settings` record, so the thinking-config and media-resolution parsing (and their warnings) is written once instead of twice. Model, sampling, token limit, stop and the cached-content name travel as `GoogleAiGeminiChatRequestParameters`; the rest (seed, thinking config, tools, safety settings, media resolution) are options only the client builders take.
* **Azure OpenAI**: Azure has no request-parameter type of its own, so the common sampling settings travel as `DefaultChatRequestParameters` and the Azure-specific ones stay on the client builders.
* **Bedrock** is unchanged: it already built one `BedrockChatRequestParameters` for both clients.

No configuration key, default or wire field changes. The requests both clients send, and the models' default request parameters, were compared field by field before and after the change for every provider, with a full and a minimal parameter map, and are identical.

**Files:** [`OpenAILanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/OpenAILanguageModelBuilder.java), [`AnthropicLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/AnthropicLanguageModelBuilder.java), [`MistralAiLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/MistralAiLanguageModelBuilder.java), [`OllamaLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/OllamaLanguageModelBuilder.java), [`GeminiLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/GeminiLanguageModelBuilder.java), [`AzureOpenAiLanguageModelBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/builder/AzureOpenAiLanguageModelBuilder.java)

***

## 🐛 fix(configs): one endpoint-parameter rule; brand SVG refuses CSS escapes (2026-11-08)

**Repo:** EDDI (`fix/endpoint-params-brand-svg`)

### What changed and why

**One answer to "does this parameter name an endpoint?"** Five places asked it, each with its own list, and the lists had drifted. The LLM registry knew Vertex's `apiEndpoint`; the embedding check knew `apiBase`, `api_base` and `apiUrl`; the export merge (`ScrubbedSecrets`) knew neither `apiEndpoint` nor `apiBase`. The merge's list matters most: it decides whether a target's hidden literal credential is put back into a synced config, and it withholds the credential when the config's destination changed. A synced config that changed only `apiEndpoint` or `apiBase` therefore had the target's literal key restored next to an endpoint the editor chose. No shipped builder reads either key together with an `apiKey` today (Vertex uses ADC), so this was latent, but the next builder that does would have opened it.

[`EndpointParameters.isEndpointKey`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/utils/EndpointParameters.java) is now the one rule: case-insensitive, any key ending in `url`, plus `uri`, `endpoint`, `apiEndpoint`, `apiBase`, `api_base`, `host` and `hostname`. The rule is the union of the old lists. `ScrubbedSecrets`, `ChatModelRegistry` (the `allowedHosts` check), `EmbeddingParameters` (refusing an endpoint the provider ignores) and `EmbeddingModelFactory` (its `allowedHosts` check) and `LlmTask` (which parameters a conversation summary on a different provider may not inherit) all use it.

Behaviour changes, all in the refusing direction:

* **Agent sync / upgrade:** a change to any of these keys now keeps the `${vault:REDACTED}` placeholder instead of restoring the target's literal credential.
* **LLM `allowedHosts`:** every endpoint parameter that is set is checked against a referenced secret's list. That covers `apiBase`, `hostname`, `uri` and any `…Url`, not only the six keys listed before.
* **Embedding parameters:** an endpoint parameter the provider does not honour is refused under more spellings (`apiEndpoint`, `hostname`, `uri`, `proxyUrl`, …), and with a restricted secret it is reported as an `allowedHosts` refusal first, as the factory's comment already said.
* **Conversation summary on another provider:** every endpoint parameter of the task is withheld from the summarizer, not only `baseUrl`, `endpoint` and `apiEndpoint`, so a summary provider that reads, say, `apiBase` never sends its own key to the task provider's host.

**Brand SVGs refuse backslashes.** [`BrandAssetValidator`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/branding/BrandAssetValidator.java) checked `url(` and `@import` as literal text. CSS decodes escapes, so `u\72l(http://…)` and `@\69mport "…"` load external resources while matching neither check. Any backslash now refuses the SVG. The check covers the whole document, not only `<style>` and `style="…"`, because every presentation attribute (`fill`, `filter`, `mask`, …) is parsed as CSS too. Finding where an element really ends would also need a parser that agrees with the browser's (CDATA, end tags). `image-set()` is refused as well, since it loads an image from a plain string without `url()`. An editor that writes a Windows path into its metadata (Inkscape's `inkscape:export-filename`) now trips the check, and the refusal message says to export a plain or optimized SVG.

**Upgrade note:** the images in `eddi.branding.assets-dir` go through the same checks at startup, and a refused file fails startup. A seeded SVG containing a backslash (or `image-set(`) that started before this change now stops the deployment from starting, with an error naming the file; re-export it as a plain or optimized SVG before upgrading. An SVG already uploaded through the API is not re-checked.

**Docs:** [White-labeling](https://docs.labs.ai/deployment-and-infrastructure/white-labeling.md), [Agent sync](https://docs.labs.ai/conversations-and-orchestration/agent-sync-guide.md) and [Secrets vault](https://docs.labs.ai/security-and-compliance/secrets-vault.md) list the new rules.

### Tests

`EndpointParametersTest`; `ScrubbedSecretsDestinationTest` (every endpoint spelling is a destination; an ordinary parameter is not); `ChatModelRegistryAllowedHostsTest` (`apiBase`, `hostname` and `proxyUrl` are checked); `EmbeddingParametersBranchTest` (`apiEndpoint` on Vertex, `hostname` on Bedrock); `LlmTaskSummaryCredentialIsolationTest` (every endpoint spelling stays with the task's provider); `VaultAllowedHostsCoverageTest` (an unsupported endpoint key is judged by `allowedHosts`); `BrandAssetValidatorTest` (escaped `url(`/`@import` in `<style>`, CDATA, `style` and presentation attributes; `image-set()`; editor metadata refused with the way out).

***

## fix(signing): peer verification withholds unverified agent entries and binds the conversation, position and key version (2026-11-08)

**Repo:** EDDI (`fix/group-signing-verification`, on top of `feat/agent-signing-key-provisioning`)

### What changed and why

`security.requirePeerVerification` verified earlier speakers' signatures and then handed the receiving agent the transcript anyway: every failure was a log line. A signature also proved less than it seemed. It covered only the content and the phase name, so a signed entry copied into another discussion, into another phase or round of the same one, or retyped, still verified; the verifier checked no nonce, so a duplicated entry verified twice; and key validity windows were never enforced.

* **Withheld, for a member that verifies.** `GroupSigningGuard.viewFor` gives one verdict per transcript entry (`VERIFIED`, `NOT_AGENT_AUTHORED`, `RECEIVERS_OWN`, `UNSIGNED`, `UNKNOWN_KEY`, `REVOKED`, `OUT_OF_WINDOW`, `BAD_SIGNATURE`, `WRONG_ROUND`, `DUPLICATE`, `ENGINE_SYNTHESIS`, `NO_SUCH_AGENT`). For a member that requires peer verification, every agent entry that must verify and does not is replaced, in place, by a `[withheld: ... because ...]` placeholder before that member's phase prompt (`GroupContextBuilder.buildPhaseInput`) and its `groupTranscript` context (`MemberTurnExecutor`) are built. In place, so the raw indices window summaries are keyed on stay aligned. The placeholder names the speaker by its agent id and has no phase name, since the stored display name and phase name are as unverified as the content. Each withheld entry is logged at ERROR the first time per conversation, then at DEBUG. A record with no content (a skip, an error, a pass; verdicts `STATUS_RECORD` and `NON_AGENT_STATUS_RECORD`) is unsigned by design, so it keeps its place, speaker id, type, phase index and target but loses its error reason, display name and phase name, which a store writer could otherwise fill under a member agent's id for a verifying member's `groupTranscript` to carry. This is not fail-closed in general, and is not described so any more: a member without `requirePeerVerification` (the default, unchanged) gets the stored transcript with nothing checked and nothing logged; for a verifying member, entries no agent wrote (`NOT_AGENT_AUTHORED`) and its own when it does not sign (`RECEIVERS_OWN`) are shown, and the engine's other prompts and a follow-up still quote the stored transcript (see "Not filtered yet" below). An agent entry that is unsigned or names an undeclared key is withheld only from that member's phase prompt and `groupTranscript`. The `Verdict` enum now has one constant per line, each with a Javadoc line saying whether an entry with it is shown or withheld.
* **The member's own entries** are checked like a peer's when it signs: every honest one is signed, and REVISION and DEFENSE quote its latest entry from the group transcript as the answer it revises or defends, so an answer planted under its id, or its own signed answer edited in the store, is withheld instead. A verifying member that does not sign (the validator allows it; a moderator is the usual case) has nothing to check them against and is shown them as stored, `RECEIVERS_OWN`; without that it was being asked to revise or defend a placeholder.
* **What the signature covers.** The payload is built in one place for signing and verification: the group conversation id, the round (stored on the entry as the new `signatureRound`), the phase index and name, the entry type, the content, the speaker's display name, the target agent, the error reason and the key version (the envelope's own `keyVersion` is outside its canonical form). A reply the engine records as a `DISSENT` or a `BID` is signed again as that type (`MemberTurnExecutor.sign`). Unpaired UTF-16 surrogates become U+FFFD before signing, and text holding one never verifies: Java's UTF-8 encoder writes one as `?`, so it signed the same bytes as the text with `?`, and a store writing real UTF-8 turned an honest entry into a failure.
* **Replay.** A nonce is accepted once per transcript; only an occurrence that verifies claims it, so a forgery carrying a genuine nonce cannot get the genuine entry withheld. Rounds only grow along the transcript, and the current round starts at `roundStartTranscriptIndex`, so an entry moved into another round is withheld (`WRONG_ROUND`). Moving one between repeats of a phase within a round is not detected. An entry signed before its conversation began (30 s skew) is withheld; that rule rests on the stored `created` time.
* **Revocation and windows.** A key revoked through the new admin endpoint (see the entry "identity is engine-owned, keys can be revoked, and generating one no longer breaks the agent's descriptor") vouches for nothing, whatever time an entry claims (`REVOKED`); the signer does not sign with a revoked newest key. A `validFromMs`/`validUntilMs` window is enforced on both sides, but against the time the signer wrote, so it limits honest use and does not stop a leaked key. Revocation applies to every prompt built after it; what a member was already shown stays in its own conversation history, which its model sees again until the history window drops it (documented; a new discussion clears it).
* **Deleted agents.** Whether a speaker is an agent was decided by whether the agent store had a current version of it. A soft delete (MongoDB throws, PostgreSQL returns null) or a permanent one therefore turned every entry of that agent into a non-agent's: shown relabelled instead of withheld. So revoking a compromised agent's key and then deleting it, the ordinary response, put its revoked entries back in front of verifying members. Now an entry under an id with no current agent is withheld (`NO_SUCH_AGENT`) when it carries a signature, which only agents give, or when an agent turn of the discussion ran under that id (its member conversation is recorded under it); a human member's or a nested group's entry still passes labelled. The placeholder names the id followed by `(not an agent, unverified)`: the id is whatever the entry was stored under, which no agent store vouches for, so a planted one cannot put unlabelled text in the speaker's place. A deleted agent's genuine signed entries are withheld too: the trust anchor is the speaker's current configuration, and a deleted agent has none.
* **Non-agent entries.** Which entries must verify is decided by the speaker id, while a prompt shows the display name; a store writer could put any text under an agent's name by giving it a non-agent id. A verifying member now sees such entries as `User`, `System` or `<name> (not an agent, unverified)`, and a group save refuses those names for an agent member. Under `ANONYMOUS` scope (Delphi's later rounds), where every speaker is `Anonymous`, such an entry is `Anonymous (not an agent, unverified)` in the prompt and in `groupTranscript`; before, the scope dropped the label and a store writer's `system` opinion read like a verified peer's. Group saves also refuse two members with the same display name (ignoring case), and an agent member named `Moderator` while the moderator is not a member or `Facilitator` while an enabled facilitator is another agent, the names the engine signs those roles' entries under; so two verified voices never share one name either.
* **Synthesis under the engine's name.** A synthesis is looked up by its type and quoted without its speaker (the dissent prompt, the vote's options), so the relabelling did not reach it. The engine never records one under `system`, `user` or no speaker, and a verifying member now has such an entry withheld (`ENGINE_SYNTHESIS`). A reviewer's edit and a human or nested-group moderator's synthesis are unsigned by nature and still shown.
* **Summary and ballots.** The stored window summary is free text no signature covers, so a verifying member gets the truncation marker instead. A ballot lists the options the tally counts, resolved from the stored transcript: a verifying voter from whom the synthesis was withheld got no options, could not cast a parseable ballot, and counted against quorum. (Superseded by the entry "every prompt a verifying member receives is built from its verified view": a ballot now lists the options as the voter sees them, and a vote on a synthesis that does not verify does not run.)
* **Unreadable receiver.** If a member's configuration cannot be read, the setting this node last read for it applies; if it never read one, the member's turn is recorded `SKIPPED` instead of running on a transcript filtered for a setting nobody knows. Before, every member, verifying or not, was treated as verifying. The check runs before the member conversation is started, since the first turn with a conversation is the one that is given the discussion's attachments.
* **Cost.** Each Ed25519 check is remembered (Caffeine, by SHA-256 of key, signature and signed bytes), so a verifying member no longer re-runs it over the whole transcript twice per turn; the revocation and window are re-checked each time. Agent configurations are read per version through an `AgentConfigurationCache`. The per-conversation log de-duplication is a bounded cache, so a conversation that pauses on one node and ends on another no longer leaks its entry.
* **Signer.** `signOutgoingMessage(...)` became `sign(gc, entry)`. It no longer registers its own nonce with `NonceCacheService`: a freshly minted UUID can never collide, and with `eddi.cluster.degraded.nonces=reject` a NATS outage silently turned signing off. Nothing calls that service any more, so its two `eddi.a2a.signing.nonce.*` properties do nothing ([configuration reference](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md) and [clustering](https://docs.labs.ai/deployment-and-infrastructure/clustering.md) say so); deleting the class is a follow-up. A signing agent that cannot sign now logs at ERROR, since peers that verify will withhold the entry.
* **Docs, Manager, operator.** [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md#cryptographic-agent-identity) (signing, replay, revocation, peer verification; "non-repudiation" dropped, since the deployment holds every key; the RFC 8785 claim corrected) and a [Signed contributions](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md#signed-contributions) section. The Manager's "Require peer verification" description no longer says failures are only logged (all 11 locales). The revoke dialog says again that peers stop trusting every message signed with the revoked key: the base branch's copy says peer verification does not refuse a revoked versioned key yet, which this branch makes untrue; its best-effort vault delete and legacy-v0 wording stay (all 11 locales). The Platform Operator's prompt says what a verifying agent sees and who must sign (operator revision bumped).

No release could provision a signing key (that lands with the entry "admins provision an agent signing key end to end; the validator checks the key is usable"), so a group entry was signed only where an agent's legacy key had been written into the vault outside EDDI's API, and the change of the signed bytes needs no migration. Such an entry was signed over the old payload: it no longer verifies and is withheld from verifying members. What that agent signs after the upgrade verifies.

### Upgrading

A group whose members share a display name, or with an agent member named `User`, `System` or `... (not an agent, unverified)`, or `Moderator` / `Facilitator` as above, is refused on its next save until the names change; stored groups still load and run. A verifying member in a windowed discussion no longer gets the rolling summary. A member that both signs and verifies has its own unsigned entries (a signing failure, or answers from before signing was switched on) withheld from itself, as its verifying peers already do. A continued discussion withholds from verifying members every entry of a member agent that has since been deleted.

### Not filtered yet

The prompts the engine writes itself for role turns (convergence judge, facilitator briefing, vote tie-break, dissent round, task-force plan, execute, verify and bid) quote the round just run, task records or a short excerpt directly. Agent follow-up answers, facilitator interventions and the reformatted task-force verification entry are recorded unsigned, so a verifying member sees them withheld. The entry "every prompt a verifying member receives is built from its verified view" filters those prompts and signs those entries for their agent.

A follow-up (`followUpWithMember`) is not filtered either: the member it asks gets the stored transcript unfiltered in its `groupTranscript` context, even when it requires peer verification, so an entry altered by someone with write access to the store reaches it as written.

The [group-conversations](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md#signed-contributions) page now names these limits too: an entry's stored `timestamp` is not covered by its signature, an earlier round's signed entry can be moved past a later round's question without being detected, and a group saved before display names had to be unique keeps loading with its duplicate names until it is saved again. The operator prompt merged from the key-provisioning branch said peer verification ignores revocation; on this branch it does not, and the prompt says so.

**Files:** [`GroupSigningGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupSigningGuard.java), [`GroupContextBuilder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupContextBuilder.java), [`MemberTurnExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/MemberTurnExecutor.java), [`PhaseExecutionEngine.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/PhaseExecutionEngine.java), [`TaskForceEngine.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/TaskForceEngine.java), [`GroupConversation.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/GroupConversation.java), [`AgentGroupStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/mongo/AgentGroupStore.java), [`GroupConversationService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/GroupConversationService.java), [`SignedEnvelope.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/crypto/SignedEnvelope.java), [`JacksonCanonicalizer.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/crypto/JacksonCanonicalizer.java); tests `GroupSigningRoundTripTest` (real Ed25519), `GroupSigningGuardTest`, `MemberTurnExecutorTest`, `PhaseExecutionEngineTest`, `TaskForceEngineTest`, `AgentGroupStoreTest`, `GroupConversationTest`.

***

## 🐛 fix(manager): saves and previews do not overwrite edits made while in flight (2026-11-08)

**Repo:** EDDI (`fix/manager-form-state`)

### What changed and why

Four Manager forms let the admin keep working while a request was running, then applied the reply (or, for the transfer dialog, a Cancel) to whatever the form had become by then.

* **Quotas** — a successful save replaced the form with the server's copy and cleared the dirty flag, so a limit typed during the PUT vanished and the unsaved-changes guard stopped protecting it. The page now counts edits; the server copy is taken only when nothing was edited since sending, otherwise the form keeps the edit and stays dirty.
* **Connection detail** — the same on success, plus a second loss: following the new version reset the form and re-seeded it from the cache. The save now moves the baseline to what it stored, keeps the draft when the form (or uncommitted chip text) changed since sending, and tells the route-change reset to leave that draft alone for exactly the version it created. The edit stays unsaved and the next save goes against the new version. Text typed into a parameter row that has no name yet counts as a change too, though such a row is not part of the document.
* **Agent sync** — a batch preview landed on rows whose target or "Create new" choice had changed during the request (a diff for one target shown under another, with Sync armed to send the new one), or that a reconnect had relisted at a newer source version, and a row ticked mid-flight was marked "Preview failed". A preview now applies only to a row still checked and still naming the source version and target it was sent with.
* **Team budget transfer** — Cancel always started a fresh `Idempotency-Key` and an empty form, so after a 5xx or network error (which may have moved the money) re-entering the same transfer could move it twice. After such an error, or when the dialog is closed while the transfer is still running, closing keeps the values, the error and the key; a success or a 4xx starts a new transfer. The table's dead `initialFromId` prop is gone (its only opener passed `""`), and its open state is a boolean.

### Design decisions

* Snapshot-and-compare rather than locking the fields while saving: the forms stay usable, and nothing typed is thrown away. Quotas uses an edit counter because a half-typed number changes the dirty flag without changing the form.
* No new component or hook; each fix stays in the file that owns the state.

**Files:** [`quotas.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/quotas.tsx), [`connection-detail.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/connection-detail.tsx), [`sync-page.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/sync-page.tsx), [`team-budget-dialogs.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/quotas/team-budget-dialogs.tsx), [`team-budgets-table.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/quotas/team-budgets-table.tsx), [`team-budgets.md`](https://docs.labs.ai/security-and-compliance/tenant-quotas/team-budgets.md)

***

## 🐛 fix(rag): storage collision check refuses on unreadable neighbours; cluster-shared ingestion status (2026-11-08)

**Repo:** EDDI (`fix/rag-store-guards`)

### What changed and why

**The explicit-location collision check now fails closed when another knowledge base cannot be read.** `KnowledgeBaseStorageGuard` refuses an explicit `table` / `collectionName` / `indexName` that another knowledge base already uses unless the caller may edit that one too. It already failed closed when the scan ran past its page budget, but a neighbour whose document could not be read (a `ResourceStoreException` or any runtime error while loading it) was logged at debug level and skipped. The neighbour that cannot be read may be the very one that owns the location, so a transient read error let an editor point their knowledge base at another knowledge base's table. Such a save now fails with the same `IllegalStateException` the descriptor-listing failure already raised (a 500), naming the knowledge base that could not be read. A neighbour that is gone (`ResourceNotFoundException`, deleted since it was listed) still owns no location and is still skipped.

**Ingestion status is shared across a cluster.** `RagIngestionService` kept the status and warning of each `POST /ragstore/rags/{id}/ingest` in two private Caffeine caches, so with `eddi.messaging.type=nats` a poll of `GET …/ingestion/{ingestionId}/status` that a load balancer sent to another node answered 404 "no ingestion with this id is known" for an ingestion that was running or done. Both now live in one cache from `ICacheFactory`, `rag-ingestion-status` (one-hour TTL, sized 20,000: a status and at most one warning per ingestion), which `CacheFactory.SHARED_BUCKETS` maps to the new `RAG_INGESTION` KV bucket. A single node behaves exactly as before.

**A value written while NATS was down no longer reads back as the older shared value, and never overwrites a newer one.** `SharedKvCache.get()` only consulted the node-local copy when the bucket answered empty, so a key written `processing` with NATS up and `completed` during an outage kept reading `processing` after recovery, even on the writing node. A degraded write now remembers the bucket revision this node last saw for the key (or that the key was absent, or that it is unknown), and the next read of the key publishes the local value **by compare-and-set** against that revision (`update`, or `create` for an absent key). If another node wrote or deleted the key meanwhile, the bucket's state wins, the marker and the stale local copy are dropped and nothing is overwritten or resurrected; an unknown revision yields to a present bucket value and creates an absent one. A value the bucket refuses as too large (`ClusterValueRefusedException`, a subclass of `ClusterUnavailableException` thrown by `NatsSharedKv` for a payload or message size refusal) is tracked apart and never retried, so the read path costs no failed network write: it behaves as before, answering from the local copy only while the bucket holds nothing. Republishing starts a new bucket TTL (the KV API cannot preserve the original expiry), so a status written during an outage can stay readable for up to about twice its TTL after the last update; the writing node's own copy expires after one TTL, so nothing older is ever republished. Applies to all shared caches.

### Design decisions

* **One cache and one bucket, two key kinds.** The status is kept under `status:` plus the ingestion id and the warning under `warning:` plus the id, so neither can overwrite the other in the bucket, and an id polled as `warning:<id>` finds no status. Two caches in two buckets would add a JetStream stream for a handful of strings per ingestion.
* **A status is bound to its knowledge base.** The status endpoint checks access on the RAG configuration in its path, but an ingestion id is global, so an editor of knowledge base B holding an id of A could poll it through B and read A's document name or failure message (on any node, once the cache is shared). Both keys now carry the RAG configuration id (`status:<ragConfigId>:<id>`), so an id polled through another knowledge base is unknown (404). No extra NATS writes.
* **No retry timer after a NATS outage.** If NATS is unreachable while the terminal status is written, that write stays on the originating node, like every other non-fail-closed shared cache. It is published when that node next reads the key (compare-and-set, see above); no background retry is added here.
* **500, not 400, for an unreadable neighbour.** The request is not wrong; the server could not check it. It matches the listing-failure path right beside it, and a retry succeeds once the store answers.
* **Not in this PR:** serialising the check and the write (two editors saving the same new location at the same moment both pass). A per-JVM lock does not serialise a cluster, the import and upgrade paths write outside `RestRagStore`, and in the per-id layout, which every new knowledge base gets, chunks in a shared table are still filtered by knowledge-base id (a knowledge base still in the 6.5.0 name layout is not filtered, so for one of those the race is a real read). Injecting the guard into `RestRagStore` instead of constructing it is only a step toward that lock, so it waits for it. The replace locks in `RagIngestionService` stay per instance, as their Javadoc says.

**Files:** [`KnowledgeBaseStorageGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/rag/rest/KnowledgeBaseStorageGuard.java), [`RagIngestionService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/rag/RagIngestionService.java), [`CacheFactory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/CacheFactory.java), [`SharedKvCache.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/SharedKvCache.java), [`ClusterValueRefusedException.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterValueRefusedException.java), [`rag.md`](https://docs.labs.ai/agent-configuration/rag.md), [`clustering.md`](https://docs.labs.ai/deployment-and-infrastructure/clustering.md); tests in `KnowledgeBaseStorageGuardTest`, `RagIngestionServiceTest`, `SharedKvCacheTest` and `CacheFactoryTest`.

***

## fix(datastore): Mongo id queries fetch only id and version; deletes lock per id instead of per store (2026-11-08)

**Repo:** EDDI (`fix/resource-storage-small`)

### What changed and why

* **MongoDB id queries project `_id` and `_version` only.** `MongoResourceStorage.findResources` returns `(id, version)` pairs. The listings read the documents again by id (descriptor listings through `readMany`, the group conversation and shared artifact listings through `read`), and the GDPR erasure loops only need the ids. Without a projection, every match crossed the wire and was decoded for nothing, whole transcripts and artifact bodies included, and a listed one was decoded twice. `findResources`, `findResourceIdsContaining` and `getCurrentVersion` now project `{_version: 1}` (`_id` comes back unless excluded), and `findHistoryResourceIdsContaining` projects `{_id: 1}`, the composite id that carries the version. `getCurrentVersion` is behind `HistorizedResourceStore.getCurrentResourceId`, which has about 150 callers. Filtering and sorting still run on the server over the full documents. The PostgreSQL twin already selected only these columns.
* **`readHistoryLatest` makes one round trip instead of two.** It ran `countDocuments` and then the same filter as a sorted `limit(1)` find. The find returns null on its own when there is no history row, so the count is gone. The history document is still read in full, because callers of `IHistoryResource` can call `getData()`.
* **`HistorizedResourceStore` locks per resource id instead of per store.** `delete` and `deleteAllPermanently` were `synchronized` on the store, and there is one store instance per resource type, so on one node every delete of that type (for example the GDPR erasure loop over conversation descriptors) waited for the one in progress, which held the monitor across several majority-acknowledged round trips. The monitor was not useless, though: on MongoDB without a transaction it was the only thing on a node that kept a `delete` from reading a resource, losing the CPU while `deleteAllPermanently` erased it, and then upserting its tombstone (the erased data) into the emptied history after the erasure had reported success. It did not cover the same race through `update`, which archives the predecessor before its version-checked replace and was never locked. Now `update`, `delete` and `deleteAllPermanently` take one of 64 `ReentrantLock` stripes, chosen by `Math.floorMod(id.hashCode(), 64)`, for their whole read-then-write sequence. Same-id sequences on a node run one after the other, different ids contend only when they share a stripe, and each call holds one stripe and calls only the storage under it, so stripes are never nested. **What it does not guarantee:** the lock is per JVM, so a delete or update on one node and an erasure of the same id on another can still meet on MongoDB, exactly as they could under `synchronized`; `ModifiableHistorizedResourceStore.set` is not locked (its writes are version-checked replaces with no upsert, so they cannot write into an erased id); and stores that call `IResourceStorage.removeAllPermanently` directly (group conversations, shared artifacts, workspaces, agent test runs) bypass it. Two deletes of the same id, and update against delete, are decided by the storage's version checks either way.

### Design decisions

* `readHistoryLatest` keeps reading the full document (no projection), since the history resource it returns is a data accessor.
* A striped lock rather than no lock or a map of per-id locks: removing the monitor outright reopened the MongoDB erasure race on a single node, and a `ConcurrentHashMap` of locks grows with every id ever touched. 64 stripes are a fixed 64 locks per store.
* **PostgreSQL `storeHistoryAndRemove` now deletes first and writes the tombstone only if the delete removed the row.** The old order (tombstone, then delete) let a `deleteAllPermanently` that finished between a delete's read and its write be undone: the tombstone was upserted over the erased id, and the "no live row, a concurrent delete won" branch committed it, leaving the erased resource's data in `resources_history`. The monitor used to prevent that on one node, and the per-id lock still does; ordering the statements prevents it on every node, because the delete takes the row lock (an erasure waits for it and then also deletes the tombstone, or it has run first and the delete writes nothing). The same reordering means a refused delete (an update moved the resource on) never writes a tombstone to roll back.
* **MongoDB keeps tombstone-then-delete and has a known residual window.** Without a transaction the tombstone write and the check that the row still exists cannot be one step, and "row gone" cannot tell a concurrent delete from an erasure. The `MongoResourceStorage.storeHistoryAndRemove` Javadoc states the limit; on one node the per-id lock closes it, across nodes it stays open, and a repeated erasure removes the orphan row.

**Files:** [`MongoResourceStorage.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/mongo/MongoResourceStorage.java), [`PostgresResourceStorage.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/postgres/PostgresResourceStorage.java), [`HistorizedResourceStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/HistorizedResourceStore.java), [`PostgresResourceStorageTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/datastore/postgres/PostgresResourceStorageTest.java), [`MongoResourceStorageTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/datastore/mongo/MongoResourceStorageTest.java), [`MongoResourceStorageBranchTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/datastore/mongo/MongoResourceStorageBranchTest.java), [`HistorizedResourceStoreTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/datastore/HistorizedResourceStoreTest.java)

***

## feat(signing): identity is engine-owned, keys can be revoked, and generating one no longer breaks the agent's descriptor (2026-11-08)

**Repo:** EDDI (`feat/agent-signing-key-provisioning`, review round on the same branch)

### What changed and why

A whole-feature review of agent signing found the provisioning endpoint broke the agent it provisioned, and that the keys it wrote were not the trust anchor they looked like.

* **Generating a key keeps the descriptor in step.** `createSigningKey` wrote the new agent version in process and answered `201`. `DocumentDescriptorFilter` takes a POST answered `201` for a creation: it tried to create a second descriptor for the agent, failed on the duplicate key and answered 500 — with the key stored and the agent already at the new version. The descriptor stayed at the old version, so every later save answered 404 and a conversation on any newer deployed version could not start. The endpoint now moves the descriptor itself (as `UpgradeExecutor.bumpDescriptor` does) and answers `200` with `Location`.
* **`identity` is engine-owned.** Any `eddi-editor` could `PUT` `identity.keys[]` — plant a key whose private half they hold (a second `v1` placed first wins the version lookup), delete a revocation, or drop the identity so a permanent delete swept nothing — while only minting was admin-only. `RestAgentStore.updateAgent` now keeps the stored `identity` for every caller (a `PUT`, an import merge, a sync, the cascade, autonomy), as it already did for `dynamicOrigin`, and `createAgent` stores none. Keys change only through the admin endpoints.
* **New: `POST /agentstore/agents/{id}/signing-keys/{keyVersion}/revoke?version=N`** (`eddi-admin`). Marks every entry of that version `revoked: true` (a new field on `AgentPublicKey`, default `false`; a revoked key is valid at no time) in a new compatible version, moves the descriptor, then deletes the private key from the vault. `keyVersion` 0 removes the legacy `identity.publicKey` and its vault entry, and revokes an `identity.keys` entry declared as version 0 (malformed, but what a peer checks a v0 signature against). A negative version, which no vault entry can have, deletes nothing: it used to be read as the legacy key, whose private half the agent may still need. Already revoked: `200`, nothing written, but the private key is still deleted — that delete is best effort after the write, so revoking again is how a key a degraded vault kept is retried. A write whose outcome is unknown (a socket error or a lost acknowledgement, which can arrive after the write was applied) is handled as generating a key handles it: the agent is read again, and if its current version no longer trusts the key the revoke landed — the descriptor moves, the private key is deleted and the answer is `200`. Otherwise the failure is rethrown and the key kept, since it is still declared.
* **The save-time check covers every declared key.** With `signInterAgentMessages` on, a save is refused (400) when a key that is not revoked is malformed (version outside 1 to 1 000 000, a version declared twice, not an Ed25519 public key), or when the newest key is revoked or outside its `validFromMs`/`validUntilMs` window. Versions outside that range are ignored when numbering, so a declared `Integer.MAX_VALUE` no longer wraps the next key to v1, and `generateKey` can no longer overflow its search into a 503 that blamed the vault.
* **A config write whose outcome is unknown no longer discards a key that landed.** Only a refusal (`ResourceModifiedException`, `ResourceNotFoundException`) discards at once; after any other failure the agent is re-read, the key is kept and the call answers as a success if the current version declares it, and it is kept if the agent cannot be read.
* **Import and sync never carry signing onto an agent that cannot sign.** The target's identity is never replaced, so a merge import or sync that would write `signInterAgentMessages: true` onto an agent whose own newest key is not usable writes it off instead of being refused and rolled back, and says so: `X-Agent-Signing-Turned-Off: <reason>` on an import (also on a create, whose new agent has no key), `warnings` in the sync's `UpgradeResult` (a new, normally absent field). New non-endpoint `IRestAgentStore.signingKeyProblem(id)` answers the question for both. The Manager shows both: the import dialog stays open on its result step with the reason, and the Sync page lists each agent's `warnings` under the result (before, both reported a plain success while the agent ran unsigned).
* **A cascade keeps the store's status.** `AgentCascadeService` mapped a refused agent save to `FAILED`, i.e. a 500 whose message never reached the body. A 400 stays a 400, and a 503 is the new `UNAVAILABLE` kind (503); the message carries the store's response body, since the loopback client reports only the status line. The OpenAPI texts of the cascade and `updateResourceUri` name both.
* **Manager.** A **Revoke** button per key (admins only, with a confirmation), a *Revoked* badge, the DID shown read-only, the page test for a known non-admin that the review found missing, and MSW audit fixtures in the backend's `v<n>:<Base64>` form. The legacy key (v0) keeps its row and its Revoke once generated keys exist (generating a key keeps `identity.publicKey`, which peers trust for v0 signatures; the row used to disappear). The "a save with signing on is refused" warning also shows when the newest key is revoked, and the revoke dialog says saves are refused until a new key exists or signing is off. It also says deleting the private key is best effort, that revoking the legacy v0 key removes it, and that a revoked versioned key is not yet refused by peer verification. Copy in all 11 locales.
* **Operator.** The system prompt explains revocation, that `identity` cannot be edited through a save, the cascade's signing 400/503, and the import/sync report; revision bumped.

### Upgrading: agents already stored with these flags

Before this change the save-time check accepted `signInterAgentMessages` or `requirePeerVerification` whenever `identity` held any non-blank string, and no EDDI API could put a private key in the vault. So an agent stored with `signInterAgentMessages: true` signs nothing (unless the private half of its legacy `identity.publicKey` was written into the vault outside the API, as `agent-signing-key:{agentId}`, and the legacy key is the one it signs with: `identity.keys` holds no key, revoked or not, with a version from 1 to 1,000,000, since the newest such version is selected over v0 whether or not the vault holds its private half. That agent keeps signing with the legacy key, and its saves pass as long as every other non-revoked key in `identity.keys` is well-formed), and after the upgrade **every save of such an agent is refused (400)** (an agent that keeps signing with its legacy key, above, is not one of them) — a person's save, a workflow cascade, an autonomy change, an API sync — until an admin either generates a key (**Generate signing key** in the Manager, or `POST /agentstore/agents/{id}/signing-keys?version={current}`) or turns the flag off. Find them with a query on `security.signInterAgentMessages: true` in the agents collection (or table). An import or a sync onto such an agent turns the flag off and reports it, rather than failing. Any `identity.keys` entry a person pasted before this change is a key whose private half someone outside EDDI may hold, and peers trust it until it is revoked: review the keys of every agent a `requirePeerVerification` agent checks, and revoke every entry EDDI did not generate — the legacy `identity.publicKey` (v0) included, which generating a key does not remove.

**Agents stored with `security.requirePeerVerification: true`.** Until now peer verification only logged a failure. With group-signature verification, which builds on this change, such an agent receives every peer entry that does not verify as a `[withheld ...]` placeholder — and since no release could provision a key, that is every entry another agent wrote, apart from what an agent signing with such a legacy key writes after the upgrade. One such agent among a group's members, moderator or facilitator also makes the group's records count only entries that verify for every reader: the vote finds no options and records that it could not run, the negotiation table stays empty, and the SERVICE judge and the retrospective see only signed entries — for every member of that group. The only trace is ERROR logs. Find these agents with a query on `security.requirePeerVerification: true`. To recover, generate a key and turn on `signInterAgentMessages` for every agent that writes into those groups (members, moderator or synthesizer, facilitator), or turn the flag off.

### Design decisions

* Identity is kept for **every** caller, admins included, not only for non-admins: one rule, and the endpoints that change keys are where the audit trail and the vault write are.
* Revocation is a flag, not a deletion of the entry: a verifier must recognise and refuse an entry signed under the key, which an unknown version would only report as "unknown key". The group verifier in this change does not read the flag yet; until it does, the deleted private key is what stops EDDI signing anything new with it (best effort; it does not stop anyone holding another copy of that private key). (Superseded by the entry "peer verification is fail-closed and binds the conversation, position and key version", 2026-11-08: a revoked key vouches for nothing.)
* The newest key being revoked stops signing rather than falling back to an older key, matching the signer's rule for a key outside its window. `GroupSigningGuard` reads the flag before it signs, so this holds when the vault delete failed and the private key is still there. "Newest" is `AgentIdentity.signingKeyVersion()`, the newest version within `1..MAX_VERSION`, the same rule the validator applies: a legacy entry outside that range, revoked or not, neither picks the signing key nor silences a usable one.
* A malformed key that is revoked no longer blocks a save, so revoking is the way out for an agent stored with a planted entry.
* The import/sync report is a header and an `UpgradeResult` field, shown verbatim by one Manager component on the import dialog and the Sync page: the texts are EDDI's own and already name the way back, and `warnings` is a general list, not a signing flag.
* Generate and revoke treat a write whose outcome is unknown the same way, through one helper that reads the agent again and asks whether the change is there; only what to do when it is not differs (a generated key is discarded, a revoked one kept). Without it, a revoke that landed unacknowledged left the descriptor behind, every later save answered 404, and revoking again could not repair it. When the descriptor write itself fails, the endpoint answers 500 naming the new version, and a key change retried at that version (the version a 409 for the old one hands back) first moves a descriptor left exactly one version behind, then carries on. Only that shape is repaired; a missing descriptor, or one further behind, fails as before. An ordinary agent save at the new version does not repair it: retry the key change.

### Tests

`RestAgentStoreTest` (`IdentityIsEngineOwned`, `SigningKeyRevocation`, new `SigningKeyProvisioning` and validator cases), `AgentPublicKeyTest`, `AgentSigningServiceTest`, `AgentCascadeServiceTest`, `RestAgentStoreCascadeTest`, `UpgradeExecutorSyncTest`, `RestImportServiceCompatibleTest`, `RestImportServiceRollbackAndCleanupTest` (including the first-promotion sync's `warnings`), the Manager section, page, import-dialog, Sync-page and API tests, and a new [`AgentSigningKeyIT`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/integration/AgentSigningKeyIT.java) that runs generate, save, sign-on, deploy, converse and revoke through the HTTP stack, response filters included.

***

## refactor(hitl): one GuardText for the self-ungating heuristics (2026-11-08)

**Repo:** EDDI (`refactor/self-ungating-guard-text`)

### What changed and why

The two server-side guards around an approved tool call decided "does this request name an id?" with two different decodings. `SelfUngatingGuard` percent-decoded the raw arguments and also walked them as parsed JSON, a few levels into JSON-in-a-string. `ApprovedCallScope.targetsConversation`, which backs the self-conversation rule, percent-decoded the text and ran a hand-written JSON unescape over it. Given the same arguments, the two disagreed, and each one missed spellings the other caught:

* **Self-conversation rule missed:** an id inside a document carried as a JSON string (escaped once per level, so one unescape pass leaves the escape in place), and a JSON escape that was itself percent-encoded (`%5Cu0034`).
* **Self-ungating rule missed:** an escaped id in arguments that only a lenient parser accepts (single quotes, for example, or a leading comment). Its strict parse failed, or never started because the text did not begin with a bracket or a quote, so only the raw-text test ran.

Both now go through one package-private `GuardText` in `engine/hitl/tools`. It has three parts. `decodeLower` percent-decodes and lower-cases, and keeps the raw text when an escape is malformed. `containsId` does a trimmed, case-insensitive containment test. `haystack` builds the decoded raw text plus every key and string value from a JSON walk, and follows nested JSON strings up to four levels. The walk parses with every `JsonReadFeature` enabled: a parse can only add text to the haystack, so the most lenient parse is the safe one. It parses any text that starts with a character such a document can start with, comments (`/*`, `//`, `#`) and single quotes included, not only `{`, `[` and `"`. `ApprovedCallScope.jsonUnescaped` and `urlDecoded` are deleted. The lenient parse covers what `jsonUnescaped` covered for non-strict JSON. The only thing it no longer catches is unparseable text such as truncated JSON, and no receiver accepts that either.

Also fixed: `SelfUngatingGuard.collectNonEmptyKeyPaths` carried two stacked Javadoc blocks. The first one described `collectKeyPaths`, which had none, so it now sits on that method.

### Behaviour

Behaviour only gets stricter, in two places. The self-conversation rule (on resume and in the live tool loop through `ToolLoopResumer.uriTargetsConversation`) now refuses the two spellings listed above. The raw-argument self-ungating test now refuses escaped ids and keys in lenient JSON, including JSON that starts with a comment. No config, endpoint, MCP tool or default changed.

### Tests

`GuardTextTest` (new). Decoding: malformed percent escapes, a JSON-escaped key, the nested-string depth bound, non-JSON text and `containsId`. Agreement: `SelfUngatingGuard.refusalFromArguments` and `ApprovedCallScope.targetsConversation` must both see an id in seven escaped or encoded spellings, and both must miss another id. Before the change, 5 of the 7 spellings failed, in both directions. The existing `SelfUngatingGuard*Test`, `ApprovedCallScopeTest` and `ToolLoopResumerSelf*Test` pass unchanged.

**Files:** [`GuardText.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/tools/GuardText.java), [`SelfUngatingGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/tools/SelfUngatingGuard.java), [`ApprovedCallScope.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/tools/ApprovedCallScope.java), [`GuardTextTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/hitl/tools/GuardTextTest.java)

### Next

`ToolLoopResumer.argumentsTargetConversation` still runs its own JSON walk (`appendStrings`) after `uriTargetsConversation`. `uriTargetsConversation` already searches the full haystack, so that second pass is now redundant and can be removed. It was left in place because this PR is scoped to the two guard classes. Splitting the JSON-pointer and patch helpers out of `SelfUngatingGuard` into a `PatchGate` remains an optional follow-up.

***

## 🐛 fix(a2a): tool names within 64 characters, never empty; card cache keyed by credential (2026-11-07)

**Repo:** EDDI (`fix/a2a-tool-names`)

### What changed and why

* **A2A tool names over 64 characters.** The agent name and the skill id were each bounded at 64 characters, then joined, so a tool name reached 129. OpenAI, Anthropic and Gemini refuse a function name over 64, and one such name fails every request of the agent, not just the call to that tool: a 40-character configured agent name next to a 50-character peer skill id was enough, and a hostile peer card could do it on purpose. `A2AToolProviderManager` now makes every tool name in one place (`toolName`): each part sanitized, the whole cut to 64 with a short hash of the uncut name — the hash suffix `distinctNamePart` already used for skill ids, now shared — so two long ids that share a prefix stay two tools.
* **Empty A2A tool names.** Sanitizing keeps only `[a-z0-9_]`, so an agent named in a script other than Latin (`検索エージェント`) gave an empty name. `ToolSpecification` does not check the name, so the blank name reached the provider, which refuses it, and every request of the agent failed. With skills, the name lost its agent part, so two such peers collided on `lookup` and the second was skipped. A part that sanitizing empties now becomes `a2a_<hash of the original>` (`skill_<hash>` for a skill id).
* **A blank configured `name` now falls back to the card's name**, as an absent one always did. The Manager writes `""` once a typed name is cleared; that gave an empty or agent-less tool name before, and the shared `a2a` fallback after the change above, so a second such peer was skipped as a name collision.
* **Agent cards cached by URL alone.** A card fetched with one config's credential — possibly an authenticated card listing skills the peer shows only to that caller — was served for five minutes to every config naming the same URL with another credential or none, and its skills became their tools. The cache is now keyed on the URL plus a SHA-256 digest of the *unresolved* `apiKey`, as `McpToolProviderManager.cacheKey` does for MCP clients; configs naming one vault reference still share a card. An unauthenticated fetch keeps the bare URL as its key.
* The discovery branch for a credential or malformed-config failure now logs `A2A agent at … skipped: <reason>` instead of claiming every such failure was a credential problem (a card naming an endpoint on another origin lands there too).

### Design decisions

* **The 64-character cap is on the whole name, the per-part 64 stays.** The part bound exists for memory (an unbounded agent name was copied into every skill's tool name); the whole-name cap is what providers enforce. Each does its own job.
* **Fallback with a hash, not a bare `a2a`.** A bare fallback makes every non-Latin peer collide, and the second is silently skipped as a duplicate.
* **The digest helper is local, not a shared `RemoteCacheKey`.** Extracting one would edit `McpToolProviderManager`, outside this change; the codebase already keeps such SHA-256 helpers local to their class.

**Files:** [`A2AToolProviderManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/A2AToolProviderManager.java), [`A2AToolProviderManagerTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/impl/A2AToolProviderManagerTest.java), [`a2a-protocol.md`](https://docs.labs.ai/protocols-and-integration/a2a-protocol.md)

***

## fix(signing): private-key cache expires; unused provisioning and rotation methods removed (2026-11-07)

**Repo:** EDDI (`fix/agent-signing-key-cache`)

### What changed and why

* **The loaded private key now expires after 60 s.** `AgentSigningService` kept a loaded agent signing key in a plain map for the life of the process. Only this node's own generate and delete paths evicted it, so a key replaced or removed in the vault any other way — on another node, or outside the service — was never picked up: the node kept signing with the old key, inter-agent self-verification against the new public key failed (the message went out unsigned), and audit entries carried signatures that no longer verified. The "no key" answer already expired after 60 s; the "found" answer now does too. Both live in one Caffeine cache (`expireAfterWrite` 60 s, 10,000 entries) on the existing test clock, replacing the two hand-rolled maps and the clear-everything size bound. The TTL constant is renamed `KEY_CACHE_TTL_NANOS` since it no longer covers only misses.
* **`generateKeyPair`, `generateKeyPairVersioned` and `rotateKey` are deleted**, with the eviction counter that guarded a race between a vault lookup and one of them. None had a production caller — `RestAgentStore.validateSecurityFlags` already said so — and [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md#cryptographic-agent-identity) claimed keys were "provisioned as part of agent creation", sending operators looking for a step that does not exist. The section now says what is true: nothing in EDDI provisions or rotates an agent signing key, the secrets API cannot write an `agent-signing-key:` name (its key-name pattern has no `:`), and an agent without a vault key signs nothing. `deleteKeyPair` and its version sweep stay. The deleted generators were the only code able to write such an entry, so making signing keys provisionable means bringing key generation back behind an admin operation. (Superseded by the entry "admins provision an agent signing key end to end; the validator checks the key is usable", 2026-11-07: an admin endpoint now provisions and rotates versioned keys.)
* [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md) `eddi.audit.agent-signing-enabled`: the 60 s re-check now covers a replaced or removed key, not only a missing one.
* Comments that named the deleted methods now say what is true: `RestAgentStore.validateSecurityFlags`, `RestAgentStoreTest`, and `planning/manager-ui-handoff.md`, whose proposed "Generate Keypair" button now notes that it needs an admin endpoint first.
* **A vault outage now reaches signing after 60 s.** A loaded key used to outlive any vault failure; now, once it expires, a vault that cannot answer makes signing fail, so inter-agent messages go out unsigned (WARN) and audit entries carry no agent signature until the vault answers again. Nothing else changes: a vault error is never cached, and the vault shares the configuration database.

### Design decisions

* **Deletion over wiring an admin endpoint.** The alternative was a REST and MCP operation (`eddi-admin`) that calls the generators. That is a new capability surface — a route, an MCP tool, the operator prompt, docs — for a feature nobody has asked to provision yet; the methods were removed and later recovered once before (2026-05) without ever gaining a caller. The deletion is its own commit, so it can be reverted alone if the endpoint is wanted.
* **One cache for hits and misses** rather than a Caffeine cache beside the existing miss map: one TTL, one size bound, one eviction call, and `signIfKeyPresent`'s fast path is a single lookup.
* **Not `Cache.get(key, loader)`.** The vault read stays outside the cache's compute, as before, so a slow vault does not hold a map bin lock that blocks unrelated agents.

### Tests

`AgentSigningServiceTest`: a key replaced in the vault signs after the TTL and the old one no longer does; inside the TTL the cached key signs with no second vault read; a key removed from the vault elsewhere stops signing after the TTL; a key added for an agent just found keyless (unversioned and rotated) signs after the TTL. The generator and rotation tests are gone; the remaining tests provision keys by writing the vault entry directly, which is all the service reads.

**Files:** [`AgentSigningService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/AgentSigningService.java), [`AgentSigningServiceTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/configs/agents/AgentSigningServiceTest.java), [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [`RestAgentStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/rest/RestAgentStore.java), [`manager-ui-handoff.md`](https://github.com/labsai/EDDI/tree/main/planning/manager-ui-handoff.md)

***

## 🐛 fix(alerts): cap alert rules per agent; numeric match type selectable on empty values (2026-11-07)

**Repo:** EDDI (`fix/alert-rule-cap`)

### What changed and why

* **Alert rules per agent are capped.** `AlertRuleValidator` bounded the fields of one rule, but nothing bounded the number of rules, and every rule watching an agent is evaluated on each of its ratings and failed turns. New property `eddi.alerts.max-rules-per-agent` (default `50`, at least `1`): a create or update that would give an agent more rules listing it — enabled or not — is refused with 409 `RULE_LIMIT_REACHED`, naming the agent (an every-agent rule: the every-agent count) and the property. The rules over every agent have a limit of the same size of their own (`IAlertRuleStore.countAllAgents`, in the MongoDB and PostgreSQL stores), so at most twice the limit watch one agent.
* **Only what a save adds is counted.** An agent the stored rule already listed, or an every-agent rule that already was one, is not counted again, so after the limit is lowered the existing rules stay editable and only new ones are refused. The check runs after the access checks, so a caller without `EDIT` learns nothing about another agent's rule count, and a test send is never counted.
* **Manager:** the rule editor shows the server's sentence for `RULE_LIMIT_REACHED`, as it does for `INVALID_RULE` (no new strings).
* **Manager: Number could not be chosen as an `OUTPUT_MATCH` value type on an empty value.** `OutputMatchBuilder` read the type back from the value; an unset number is `null`, which reads as Text, so choosing Number snapped back, and clearing a number field or typing a lone `-` flipped it to Text mid-edit. The chosen type is now held by the builder; a non-null value of another type (a stored rule opened in the editor, or the text value a switch to the actions source leaves) still decides it.
* **Platform Operator:** the alert section names the limit and the refusal; operator revision bumped.

### Design decisions

* One limit for both pools rather than counting the every-agent rules into each agent's total: an every-agent save would otherwise have to check every agent. The worst case per agent (twice the limit) is bounded and documented.
* A count before the insert, not a transactional reservation: two saves at the same moment can each pass once. Only editors and administrators write rules and evaluation runs on the alert worker, so the soft edge is not worth a lock.

**Files:** [`RestAlertRules.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/alerts/rest/RestAlertRules.java), [`AlertSettings.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/alerts/AlertSettings.java), [`IAlertRuleStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/alerts/IAlertRuleStore.java), [`output-match-builder.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/alerts/output-match-builder.tsx), [`alerts.md`](https://docs.labs.ai/conversations-and-orchestration/alerts.md#operating-alerts), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md#alerts)

***

## 🐛 fix(apicalls): preRequest updates template data in place; final-attempt failure keys; fire-and-forget batch continues (2026-11-07)

**Repo:** EDDI (`fix/api-call-executor-defects`)

### What changed and why

**`preRequest.propertyInstructions` no longer wipe the call's template data.** `PrePostUtils.executePreRequestPropertyInstructions` ran the instructions and then rebuilt the template data from conversation memory, returning a fresh map. Everything the caller had put in the map was gone: the arguments an LLM tool call merged in (`DELETE /items/{id}` went out as `DELETE /items/`), and in a rule-triggered batch the `{responseObjectName}`, `…Error`, `…HttpCode` and header values the call wrote, which the next call of the turn could no longer template. An empty `propertyInstructions: []` list did the same. The method now works like `runPostResponse`: the instructions update the caller's map in place (each one already refreshed `{properties}` there), a plaintext a `scope: "secret"` instruction vaulted is scrubbed from it, and the same map is returned. `McpCallsTask`, which assigns the return value the same way, is fixed by the same change; `LlmTask` ignored the return value, so it kept its map all along and now also gets the scrub. `PrePostUtils` no longer needs `IMemoryItemConverter`; the constructor parameter is gone. The HITL pinning predicate (`canExecuteDivergeFromResolve`) is unchanged — a call with pre-request instructions stays unpinnable — and its Javadoc now gives the real reason.

**A retried call's failure keys come from its final attempt.** On a non-2xx response with `saveResponse`, every attempt wrote `{name}Error` and `{name}HttpCode` to memory and to the template data, and nothing removed them: a `503` followed by a successful retry left `weatherHttpCode=503` and the 503 body next to a good `weather`, where `postResponse`, output templates and the next call of the turn all saw a failure. A `503` with a body followed by a `500` with a blank one paired the first body with the second code. Now the template data holds the current attempt's failure keys only (they are removed before the next attempt, so a `responseValuePathMatchers` entry on `{name}Error` still judges the response it decides about), and memory records the final attempt's failure once, after the loop — as the `forEach` path does. A matcher that reads the same keys through memory (`memory.current.httpCalls.{name}HttpCode`) used to see each attempt because every attempt was written to the live step output; the retry decision now gets a copy of the template data with the attempt's failure keys under that path, so it still sees the attempt it decides about while memory stays final-only.

**One failed request of a fire-and-forget batch no longer drops the rest.** A `fireAndForget` call with `preRequest.batchRequests` sends its requests as one background task. With `executeCallsSequentially`, a request that threw (a timeout, a connection reset) ended that task, so every later request was never sent; the only trace was a generic runtime error naming neither the call nor the item. In the concurrent mode the same happened when a dispatch threw synchronously. Each request is now sent on its own: a failure is logged with the call name, its position (`request 2 of 5`) and a redacted reason, the rest of the batch still goes out, and a summary line counts the failures. An interrupted batch thread stops sending and says how many were left.

### Behaviour changes

* A `preRequest` property instruction with a `toObjectPath` now writes into the template data the request renders from; the rebuild used to discard it.
* Nothing a template read through the rebuilt map is lost: `{properties.x}` is refreshed in place by every instruction, and `{memory.current…}` is a live view of the current step, which already shows the property just set (under `memory.current.properties`) without a rebuild.
* A retry request can no longer template the previous attempt's `{name}HttpCode` / `{name}Error`. That was undocumented, and it is the divergence between the previewed and the sent request that the HITL pinning guard warns about.
* Memory gets one `{name}Error` / `{name}HttpCode` entry per call instead of one per failed attempt, written after the response headers rather than before.

**Files:** [`PrePostUtils.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/PrePostUtils.java), [`ApiCallExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutor.java), [`httpcalls.md`](https://docs.labs.ai/agent-configuration/httpcalls.md) (`executeCallsSequentially` and `retryApiCallInstruction.maxRetries` rows); tests `PrePostUtilsTest`, `PrePostUtilsDeepBranchTest`, `PrePostUtilsSecretScopeTest`, `ApiCallExecutorTest`, `ApiCallExecutorPreRequestTest` (new), `ApiCallExecutorFireAndForgetBatchTest` (new), and the constructor call in the other `PrePostUtils` users.

***

## 🐛 fix(channels): the channelId uniqueness check fails closed like the name check (2026-11-07)

**Repo:** EDDI (`fix/channel-id-uniqueness`)

### What changed and why

Two channel integrations must not bind the same `channelType:channelId`: the router keys its routing map on it, so a second one silently takes over the first one's channel. `validateUniqueChannelId` enforced that, but it swallowed every failure: an entry it could not read was skipped at debug level, and a scan that could not run at all logged "allowing save". One store timeout while reading the integration that held `C12345` was enough to store a second integration bound to `C12345`. The name check right below it already failed closed (503) and skipped only a missing or undeserialisable document.

The three near-identical descriptor scans (channelId check, name check, and the copy-name collector of `duplicateChannel`) are now one private walker, `forEachOtherIntegration`, with the name check's error policy:

* a descriptor whose integration no longer exists is skipped;
* a stored document that no longer deserialises is skipped, so one corrupt entry cannot block every channel write;
* anything else (descriptors cannot be listed, an entry cannot be read right now) refuses the save with **503**, "Could not verify that the channel integration channelId is unique. Please retry."

### Behaviour changes

* Creating or updating an integration with a `channelId` answers 503 instead of saving when the uniqueness scan hits a transient store failure. Retrying succeeds once the store answers.
* Duplicating an integration answers 503 one step earlier (while picking the copy's name) on the same failure; the name check that followed already answered 503 for it.

### Known limit

The scan and its lock serialise saves on one node only; two nodes saving the same `channelId` at the same moment can still both pass. Recorded in the walker's Javadoc.

**Files:** [`RestChannelIntegrationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/channels/rest/RestChannelIntegrationStore.java), [`RestChannelIntegrationStoreCrudTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/configs/channels/rest/RestChannelIntegrationStoreCrudTest.java), [`slack-integration.md`](https://docs.labs.ai/protocols-and-integration/slack-integration.md)

***

## 🐛 fix(deployment): cluster wait never enters the sweep; tracking derived from the registry (2026-11-07)

**Repo:** EDDI (`fix/deployment-tracking`)

### What changed and why

Two defects in `AgentDeploymentManagement`, both in cluster mode.

* **A request waited behind the whole deployment sweep.** When a request reached a node before that node had deployed an agent another node had just deployed, `awaitClusterDeployment` ran the full sweep under its lock before it started its 15 s wait. The request queued behind any running sweep, deployed every other agent the node was missing before its own, and a burst of requests ran one full sweep each. A version whose deployment had failed on the node cost every request the full 15 s, because it never became ready. The wait now starts its clock first, reads the deployment records and this node's registry once, and submits a deployment of just the missing versions of the requested agent to the runtime executor. Requests that arrive while that deployment is queued or running do not submit it again. A version in `ERROR` on this node is neither retried nor waited for, since the sweep owns retries and their backoff. While the startup migrations run or are deferred, nothing is deployed on demand, as before.
* **A version this node undeployed itself stayed "tracked".** The sweep kept a private list of the deployments it had confirmed READY and skipped them from then on. Only an undeploy that arrived as an event from another node removed an entry. A REST undeploy on this node, the daily retirement, the delete cascade and sub-agent teardown left the entry in place. When the same version was deployed again by a request on another node, this node's sweep found it tracked and never deployed it, and that node's share of the traffic waited 15 s and was answered as not ready until a restart. The sweep now starts by dropping every tracked row this node's registry does not hold READY. A registry that cannot be read drops nothing. The tracked set is a concurrent set, so an undeploy event no longer takes the sweep lock: one undeploy arriving during a long sweep used to stall every later cluster event on the node, cache invalidations included. The sweep reads the registry before the deployment records, so an undeploy (registry first, record second) that lands while the sweep runs is not taken for a deployment that went missing.
* **An undeploy-only teardown now marks the deployment record undeployed.** `teardown_agent` without `delete`, and the end-of-discussion cleanup when it only undeploys (`lifecyclePolicy: UNDEPLOY_ONLY`, or an agent whose origin cannot be verified), removed the sub-agent from this node's registry and left its record saying deployed. Once tracking follows the registry, the next sweep would deploy it again within about ten seconds; before, it came back at the next restart, and other nodes in a cluster never undeployed it. Both paths now flip the agent's `production` records to undeployed, as a REST undeploy does, so every node's sweep undeploys it too.

### Design decisions

* Tracking is derived from `IAgentFactory.getAllDeployedAgents` on every sweep instead of hooking every local undeploy path. The registry is the fact; the list was a second copy of it, the same lesson `AgentFactory` records for its `eddi_agents_deployed` gauge.
* The on-demand path reads the registry with `getAllDeployedAgents`, not `getAgent`, which blocks up to 60 s on a deployment in progress.
* Rejected: running `checkDeployments()` asynchronously from the request. It would still deploy every other missing agent before this one and still queue one sweep per request.

**Files:** [`AgentDeploymentManagement.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/AgentDeploymentManagement.java), [`IAgentDeploymentManagement.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/IAgentDeploymentManagement.java), [`AgentDeploymentManagementClusterTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/runtime/internal/AgentDeploymentManagementClusterTest.java), [`AgentDeploymentManagementBranchTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/runtime/internal/AgentDeploymentManagementBranchTest.java), [`GroupLifecycleOps.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupLifecycleOps.java), [`TeardownAgentTool.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/TeardownAgentTool.java), [`clustering.md`](https://docs.labs.ai/deployment-and-infrastructure/clustering.md), [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md)

***

## Documentation review: docs, root and UI guides, inline Javadoc (2026-11-07)

**Repo:** EDDI · **Branch:** `docs/documentation-review`

Checked every line of the 100 pages under `docs/` (not `archive/` or the changelog), the root guides (`AGENTS.md`, `README.md`, `CONTRIBUTING.md`, `GOVERNANCE.md`, `PRIVACY.md`, `SECURITY.md`) and the `ui/chat` / `ui/manager` guides against the code, `pom.xml`, `application.properties`, the workflows, the Dockerfile and `helm/`. Swept the Javadoc, OpenAPI text and tool descriptions of `src/main/java` for comments that contradict the code. Wrong claims were fixed in place, and missing config fields, endpoints, defaults and limits were added where a page already covers the feature.

**Notable corrections**

* MCP tool counts: 108 tools across 16 classes, 354 arguments of which 145 required (was 96 / 303 / 129 in `AGENTS.md`, `README.md`, [MCP server](https://docs.labs.ai/protocols-and-integration/mcp-server.md), [MCP client](https://docs.labs.ai/protocols-and-integration/mcp-client.md)).
* Building the image: `-Dquarkus.container-image.build=true` looks for a `Dockerfile.jvm` that no longer exists. The docs and the `mise` `docker-build` task now run `docker build -f src/main/docker/Dockerfile`, the same as CI.
* The Dev UI is at `/q/dev-ui` on Quarkus 3.
* [LLM parameters](https://docs.labs.ai/agent-configuration/langchain/llm-parameters.md): the generator (`scripts/gen-llm-parameters-doc.py`) now renders each rule's `when`/`unless` condition and writes boolean defaults as `true`/`false`. Before this, conditional rejections read as unconditional.
* [Behavior rules](https://docs.labs.ai/agent-configuration/behavior-rules.md): the "Welcome" API example could never fire. `tagMatches` reads `agent:tags`, which nothing writes, and the page now warns about it.
* CI and release pages: when Trivy, Gitleaks, CodeQL, the SBOM and fuzzing actually run; release candidates do not move `latest`; tags are not signed; the SBOM is a workflow artifact, not a release asset.
* Javadoc: broken `{@link}`/`@see` targets fixed, Javadoc blocks that had drifted off their members moved back, stale "package"/"LangChain"/`SafeHttpClient`/`@DefaultBean` wording updated, and MCP tool descriptions now say "workflow".
* `ConfigurationReferenceCoverageTest` now allows `EDDI_BACKEND_URL`, the Manager dev-server proxy variable that is now documented.

**Found, not fixed (code issues)**

* `DeploymentContextCondition.tagMatches` can never match: no code writes `agent:tags`.
* `DreamConfig.batchSize` / `maxUsersPerRun` and `ScheduleConfiguration.allowSelfScheduling` / `tenantId` are stored but never read.
* `IParserExtensionProvider` casts `lookupIfKnown` to `String`, so a JSON boolean would throw; it is also missing from the correction providers' `ExtensionDescriptor`.
* `helm/eddi/values.yaml` still says `nats.buildProfileImage` stopped being read with chart "< 2.5"; it was 2.7.0. Left alone, because a change under `helm/` needs a chart version bump.
* `McpConversationTools.buildConversationResponse` builds `agentResponse` only from output items that are `Map`s with a `text` key. Whether a live turn's snapshot still holds `TextOutputItem` objects (so the field would be missing) was not verified; `docs/mcp-server.md` keeps documenting the field.

***

## Full Java comment review: every file in src/main/java (2026-11-07)

**Repo:** EDDI · **Branch:** `docs/javadoc-full-review` (stacked on `docs/documentation-review`)

The earlier documentation review swept Javadoc by package and only partly covered it. This pass reads all of `src/main/java`, 1,811 files and about 6.7 MB of comments. The files were split into 24 slices of equal comment volume and each slice went to its own reviewer. Every comment line, Javadoc block and documentation string was checked against the code it describes: OpenAPI `@Operation`/`@Parameter`/`@APIResponse`, langchain4j `@Tool`/`@P`, MCP `@Tool`/`@ToolArg`, and `ExtensionDescriptor` text. Wrong comments were fixed. Four slices had read their largest files through a filtered comment view, and those 132 files went to eight more reviewers for a full read.

**What changed:** about 400 comment fixes across 384 files. A lexer-level comparison that strips comments from the old and new sources shows that no code changed: a draft also corrected 31 files' description and message strings, but those were taken out again in review (see below), so the branch changes comments only. Typical fixes:

* Javadoc that had drifted onto the wrong member (onto a constant, a field, or stacked on another block) moved back to the member it describes.
* `{@link}`/`@see` targets that no longer exist, or that named the wrong signature.
* Stale names:
  * `AgentOrchestrator.*` methods now in `ToolLoopRunner`, `ToolObjectReflector`, `ToolApprovalGateSupport` and the `*ToolsProvider`s;
  * `ConversationCoordinator`, `SafeHttpClient`, `dataFactory.createData`;
  * `@DefaultBean`/`@LookupIfProperty` wording where `DataStoreProducers` now selects the store.
* Wrong defaults, limits and counts, for example:
  * the tool sources now number eight with `team`;
  * Slack retries on 429/500/502/503/504;
  * the connection cache TTL is one minute, not five;
  * there are seven discussion presets, not six;
  * the `PostgresStartupSchemaLock` key decodes to `EDDISCHG`.
* Stale vocabulary: package→workflow and "LangChain"→LLM in comments.
* `@since 6.6.0`→`6.7.0` on the alert stores, which first shipped in tag 6.7.0.

**Strings left for a follow-up.** The draft also rewrote OpenAPI `@Operation`/`@APIResponse` descriptions, MCP `@Tool`/`@ToolArg` descriptions, langchain4j `@P`/`@Tool` texts, and log and error messages in 31 files (for example `list_conversations` listing all six states, `approve_group_phase` naming `taskApprovalsJson`, `delete_user_data` listing what the cascade deletes, the team-cadence 400 message naming `/groupstore/groups/{groupId}/workspace/cadences`). Those strings are code: the model and API clients read them. The review took them out so that this branch stays comment-only, which a lexer comparison against `main` now proves. They belong in their own PR.

**Review fixes (CodeRabbit was waived by the repository owner for this PR, which it skips as too large):** comments that the rewrite got wrong or left incomplete. `ConversationHitlService` (it never calls `say` on the facade), `GroupHitlCoordinator` (`planHashStrict`), `HitlConfigValidation` (pause-reason length, `maxRevisionsPerTurn` range), `GdprComplianceService` (where the conversation ids are resolved, and which steps use them), `UserDataExport` (attachment metadata covers all of the user's conversations), `SharedKvCache` (RAG ingestion statuses), `NatsConnectionManager`, `JetStreamEventBus` (`CACHE_CLEAR` lane), `ClusterConversationCoordinator` (when the forwarder runs), `HighValueSurfaceGuard` (the k8s auth overlay and Helm), `DisabledAuthController` (`authorization.enabled` follows OIDC), `VaultMasterKeyStrength` (`eddi.vault.allow-weak-master-key`), `GroupSigningGuard` (WARN versus ERROR), `DirectoryUser`, `IRestResourceSharing`, `RestAuditStore`, `RemoteApiResourceSource` (no plain `RuntimeException` exists), `GroupConversationEventSink` (nothing produces an award decision yet), `LegacyDocumentMigrations` (import skips the memory transform), `EmailOwnerNotifier` and `SecretValueScrubber`.

**Merged with `main` (2026-11-17).** Files only the stacked docs commit touched take `main`'s final #1342 version. In the 14 conflicting Java files `main`'s code was kept exactly, with this branch's comment only where it still describes that code. Comments `main`'s newer code had made stale were corrected in `Conversation` (eight bookmark fields), `TeamCadenceService`, `TaskForceEngine`, `GroupConversation`, `RestImportService`, `RagIngestionService`, `UpgradeExecutor`, `PiiRedactionGuardrail` (it also runs on tool-call arguments), `DreamService`, `RestAgentEngineStreaming` (`tool_result` carries `ok` and a redacted summary since #1285) and `GroupHitlCoordinator` (`announceUserEvents`). With comments stripped, the branch's Java is identical to `main`'s.

**Left alone:**

* The LLM task's `"Lang Chain"` descriptor label and a "package" log line in `RestAgentStore`, both asserted by tests.
* The `DeploymentContextCondition` comments, which labsai/EDDI#1337 rewrites.

**Code bugs found by this pass** are fixed test-first on the separate branch `fix/docs-review-findings`, not here:

* `LifecycleInterruptedException` drops its cause.
* The `ClusterConfig.redactUserInfo` regex uses `"\s"`, which in a Java string is a literal space, not "any whitespace".
* `ContractedWordNormalizer` expands "won't" to "would not".
* `RemoteApiResourceSource` returns 500 instead of 502 for an unlisted agent.
* The vault reset hint omits `?confirm=true`.
* `AgentStoreClientLibrary` uses the wrong logger category.
* `CounterweightService` never reaches its unknown-level warning.
* Suspected, still to be checked: `PostgresHealthCheck` activation on MongoDB deployments, and a layout inconsistency in the classifier guardrail's `TOOL_CALL` phase.

***

## 🐛 fix(email): pseudonymised audit, constructor-injected collaborators, bounded reply cache, one retry policy (2026-11-07)

**Repo:** EDDI (`fix/email-channel`)

### What changed and why

* **Audit entries name a mail address only by its keyed pseudonym.** A refused inbound mail (`email.inbound`) wrote `senderHash` and a sent, failed or bounced reply (`email.reply`) wrote `recipientHash`: an unkeyed SHA-256 next to the address's domain, in a write-once ledger erasure cannot reach. Anyone holding a list of candidate addresses at that domain could hash them and tell whose mail it was. Both entries now carry `senderPseudonym` / `recipientPseudonym` from `GdprPseudonymizer` — the keyed token HITL notifications (`email.notify`) already wrote under that name — and the bounce-suppression log line names the address the same way. The suppression list keeps its SHA-256: it is a lookup key, not audit output. Entries written before this change keep their `*Hash` field. The token is keyed with the audit ledger's key, or salted per deployment; only a deployment with neither falls back to an unsalted hash.
* **`EmailInboundProcessor` takes every collaborator through its constructor.** The reply sender and the audit ledger were field-injected and documented as "null in tests, and then no reply is ever attempted"; production code branched on `replies != null` three times, so a construction site that forgot them silently turned conversation-mode replies, group replies and bounce handling off. They are final constructor parameters now, with the pseudonymizer, and the null branches are gone; whether an integration replies is still `settings.replies()`.
* **The group-reply cache is bounded without forgetting everything.** A group reply's rendered request lives in the node's memory for its retries. The map was cleared wholesale once it reached 1,000 entries, and entries left only when the row ended on this node, so a row another node's sweep finished stayed forever; in a cluster the map filled until a clear dropped every reply still mid-retry, and each of those ended `FAILED (CONTENT_UNAVAILABLE)`. It is a Caffeine cache now: past 1,000 one entry is evicted, and an entry expires once its row cannot be retrying any more (`(lease + max backoff) × max-attempts`).
* **One retry policy for the email ledger's outbound rows.** The capped exponential backoff was copied into the HITL notifier, the reply sender and the mailbox poller, and the "fail, or reschedule and count a retry" branch four times; the copies had drifted — an unexpected (non-SMTP) reply failure was rescheduled but never counted in `eddi.email.outbound{kind=reply,outcome=retry}`. `LedgerRetry` holds the backoff and that branch; the three classes use it, and the reply sender now counts that retry.

### Design decisions

* `LedgerRetry` is a small instance (ledger, max attempts, base) rather than static helpers with nine parameters: it also owns the `max-attempts` / `retry-backoff` defaults both senders normalised separately. The send flows around it (retention, the pending gauge, content rebuilding) differ and stay in their classes — one shared worker would be a template method over two unlike flows.
* The cache's expiry is per write, not per access: the bound is "the longest a row can stay retryable", which is a property of the row's age, and a direct executor makes size eviction happen on the writing thread.

**Files:** [`LedgerRetry.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/ledger/LedgerRetry.java), [`EmailInboundProcessor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/EmailInboundProcessor.java), [`EmailReplySender.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/reply/EmailReplySender.java), [`HitlEmailNotifier.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/notify/HitlEmailNotifier.java), [`EmailMailboxPoller.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/EmailMailboxPoller.java), [`email-integration.md`](https://docs.labs.ai/protocols-and-integration/email-integration.md)

### What's next

* `EmailInboundSweeper` still field-injects its `EmailReplySender` the same way; it was outside this change.

***

## 🐛 fix: findings from the documentation and comment reviews — dead config fields, `lookupIfKnown`, vault messages, counterweight metrics, classifier tool-call layout (2026-11-07)

**Repo:** EDDI (`fix/docs-review-findings`)

### What changed and why

A documentation review turned up five places where the code did not do what its config surface, Javadoc or comments said. Each is fixed test-first.

**1. `dream.batchSize` / `dream.maxUsersPerRun` — removed from the model, still accepted on input.** Nothing ever read them. They describe a sweep over all users in batches, which was never built: a dream fire consolidates exactly the one user its schedule names, so there is no batch to size and no per-run user count to cap. Wiring them up would mean inventing that sweep. They are no longer fields of `DreamConfig`; `@JsonIgnoreProperties({"batchSize", "maxUsersPerRun"})` keeps a stored agent or an imported ZIP that still carries them deserializing, including through the strict mapper that REST writes use, and the next save drops them. The Manager's agent editor offered a "Batch Size" input that wrote to the dead field; it is gone, along with the two fields in its `DreamConfig` type. The i18n key stays in the locale files (the i18n check flags orphans and missing keys, not unused ones).

**2. `ScheduleConfiguration.tenantId` / `allowSelfScheduling` — deprecated, kept.** Neither has ever been read by a fire, and neither the Javadoc nor `scheduling.md` promised a behaviour — they only described the PUT carry-over. `tenantId` has no tenant model to plug into on the fire path, and self-booking is already governed by the LLM task whitelisting `schedule_followup`, so a second switch on an existing schedule would only be a second place to look. Unlike the Dream fields these are real columns (PostgreSQL) and indexed fields (MongoDB) with explicit PUT carry-over semantics, so removing them means schema churn for no gain. They are marked `@Deprecated` on the field with Javadoc on the accessors saying they are stored and not read; the field table in `scheduling.md` now lists both as deprecated and not read.

**3. `lookupIfKnown` threw `ClassCastException` on a JSON boolean.** `IParserExtensionProvider.extractLookupIfKnownParam` cast the value to `String`, so `"lookupIfKnown": true` failed the parser workflow. It now accepts a `Boolean` as is and reads anything else by its trimmed string form (`"true"`, case-insensitive). Both providers that read it, Damerau-Levenshtein and phonetic, now advertise it in their `ExtensionDescriptor` (`BOOLEAN`, optional, default `false`); the phonetic provider had no descriptor entries at all. `semantic-parser.md` documents the key.

**4. Helm `values.yaml` named the wrong chart version.** It said `nats.buildProfileImage` stopped being read "from chart < 2.5"; the release that made it so (775edae28) moved the chart from 2.6.0 to 2.7.0, which is what `NOTES.txt` says. Fixed to 2.7.0, and a test now asserts the two copies agree. Chart `version` 2.14.0 → 2.14.1 (comment-only change, so a patch) with `EXPECTED_CHART_VERSION`.

**5. `GET /secretstore/secrets/health` reported the ArC client proxy.** `RestSecretStore` took `getClass().getSimpleName()` of the injected `@ApplicationScoped` `ISecretProvider`, which under Quarkus is `VaultSecretProvider_ClientProxy`, not the documented `VaultSecretProvider` — the released 6.7.0 image answers exactly that. It now unwraps the proxy with `ClientProxy.unwrap` before naming the class.

### From the Java comment review

**6. `LifecycleInterruptedException(message, cause)` dropped the cause.** It called `super(message)`; now `super(message, e)`. `RetryConfiguration`'s interrupted back-off is the caller, so the interrupt now stays on the stack trace.

**7. `ClusterConfig.redactUserInfo` — `\s` kept, made explicit, guarded.** In a Java string `"\s"` is the space escape, so the class `[^/@\s]` excluded only spaces. The suggested fix, the regex `\\s`, would have been a regression: a tab or newline *inside* the userinfo would then end the match before the `@`, and the credentials would be logged in clear. The class is now spelled with a literal space (same behaviour, no ambiguity), and a test pins that a tab or newline in the userinfo is still redacted.

**8. `ContractedWordNormalizer` mapped "won't" to "would not".** Now "will not"; the existing test asserted the wrong expansion and is corrected. The other entries are right (the `'s` forms are ambiguous between "is" and "has"; "is" is kept).

**9. `RemoteApiResourceSource.resolveLatestAgentVersion` threw a bare `RuntimeException`** for an agent the remote does not list. It is now a `RemoteReadException` like every other source-read failure. The only caller (`readAgent`) already wrapped it in one, so the HTTP status (502) was right; the cause type and message were the inconsistency.

**10. The vault's DEK-failure recovery hint named `POST …/reset` without `?confirm=true`,** which that endpoint refuses with 400. All three hints (two exception messages and the master-key adoption warning) now carry it.

**11. `AgentStoreClientLibrary` logged under `AgentFactory`'s category.** Now its own.

**12. `CounterweightService` counted an unknown `level` as `normal`.** An unknown level resolves no preset, and the early "no injection" return ran before the switch whose `default` arm warns and counts `unknown`, so that arm was unreachable and a typo such as `"stirct"` looked like a healthy normal activation. The level is classified first: unknown warns and counts `unknown` (only), and `normal` with custom instructions — which also fell into the `default` arm — counts `normal`.

**13. `ClassifierGuardrail` without a `promptTemplate` sent tool-call arguments as the user's message.** `buildMessages` chose the conversation layout on `phase == OUTPUT`, while `GuardrailModelClient.templateData` uses `phase != INPUT`. With a template, tool-call arguments fill `{output}` (as `tool-call-guardrails.md` documents); without one they went out as a plain user message, so the classifier judged the model's own tool call as if the user had typed it. Both now treat every non-input phase as model output: the user's last message, then the arguments as the assistant's turn.

**14. The vault-disabled banner and the compliance check misstated audit signing.** The banner said audit entries "will NOT have HMAC integrity signatures", but `eddi.audit.hmac-key` signs the ledger without a master key. It now says entries are signed only if `EDDI_AUDIT_HMAC_KEY` is set. The compliance check's logic was already right (it warns only when both keys are missing); its banner and its startup failure now say "neither … nor" and list both ways to enable signing.

**Review follow-ups.** The four `ScheduleConfiguration` accessors for `tenantId` and `allowSelfScheduling` are now `@Deprecated(since = "6.8.0")` too, not just the fields. `CounterweightService.resolveInjection` lowercased with the default locale, so under a Turkish locale `"STRICT"` became `"strıct"` and the preset was silently skipped; it now uses `Locale.ROOT` on the already-normalised level (new test under `tr-TR`). The vault-disabled banner names the property `eddi.audit.hmac-key` and gives `EDDI_AUDIT_HMAC_KEY` as the env example.

**Checked and left alone:**

* `PostgresHealthCheck` does not mark readiness DOWN on the MongoDB default. Probed against the released `labsai/eddi:6.7.0` image: on MongoDB and on PostgreSQL alike, `/q/health/ready` lists no "PostgreSQL connection" check at all — the `@DefaultBean` is never selected, since other `HealthCheck` beans exist. PostgreSQL readiness is covered by Agroal's own "Database connections health check", which is present and UP on both. So the suspected failure does not happen; the class is dead code, left for a follow-up rather than changed here.
* `ScheduleFireExecutor.creatorUseCheck` and lesson-consolidation schedules: such a schedule cannot carry both an `agentId` and a creator snapshot. `RestGroupLessons` sets neither, REST create and ZIP import refuse a body with the lesson marker (`rejectLessonConsolidationBody`), and a PUT carries over the stored null `creatorTeams`, which skips the check. Not reachable.

### Tests

New: `LookupIfKnownConfigTest`; `RestSecretStoreTest` (proxied and unproxied provider name); `AgentConfigurationTest` (legacy Dream fields deserialize strictly and are not written back); `DeploymentManifestsTest#buildProfileImageRemovalVersionAgrees`; `LifecycleInterruptedExceptionTest`; `JetStreamDeadLetterStoreTest` (tab/newline userinfo); `RemoteApiResourceSourceMissedBranchTest` (unlisted agent); `AgentStoreClientLibraryLoggerTest`; `CounterweightServiceTest` (unknown level, normal with custom instructions); `ClassifierGuardrailTest` (tool-call phase, no template); `VaultStartupBannerTest`; assertions added to `ComplianceStartupChecksTest`, `VaultKeySafetyTest`, `VaultSecretProviderBranchTest` and `ContractedWordNormalizerTest`. Each failed with its fix reverted, except the `redactUserInfo` guard, which passes on the old code by design and fails against the suggested `\\s` change.

**Files:** [`AgentConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/model/AgentConfiguration.java), [`ScheduleConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/schedule/model/ScheduleConfiguration.java), [`IParserExtensionProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/extensions/IParserExtensionProvider.java), [`DamerauLevenshteinCorrectionProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/extensions/corrections/providers/DamerauLevenshteinCorrectionProvider.java), [`PhoneticCorrectionProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/extensions/corrections/providers/PhoneticCorrectionProvider.java), [`RestSecretStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/rest/RestSecretStore.java), [`values.yaml`](https://github.com/labsai/EDDI/tree/main/helm/eddi/values.yaml), [`Chart.yaml`](https://github.com/labsai/EDDI/tree/main/helm/eddi/Chart.yaml), [`LifecycleException.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/lifecycle/exceptions/LifecycleException.java), [`ClusterConfig.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterConfig.java), [`ContractedWordNormalizer.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/extensions/normalizers/ContractedWordNormalizer.java), [`RemoteApiResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RemoteApiResourceSource.java), [`VaultSecretProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/impl/VaultSecretProvider.java), [`AgentStoreClientLibrary.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/client/agents/AgentStoreClientLibrary.java), [`CounterweightService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/CounterweightService.java), [`ClassifierGuardrail.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/impl/ClassifierGuardrail.java), [`VaultStartupBanner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/VaultStartupBanner.java), [`ComplianceStartupChecks.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/compliance/ComplianceStartupChecks.java), [`scheduling.md`](https://docs.labs.ai/conversations-and-orchestration/scheduling.md), [`semantic-parser.md`](https://docs.labs.ai/agent-configuration/semantic-parser.md), [`tool-call-guardrails.md`](https://docs.labs.ai/agent-configuration/langchain/tool-call-guardrails.md), `ui/manager` agent editor and API types.

***

## fix(groups): atomic budget cap sets and exact outcome caps on both stores (2026-11-07)

**Repo:** EDDI (`fix/group-atomic-stores`)

### What changed and why

* **Setting a team's monthly cap is a compare-and-set.** `TeamBudgetService.setCurrentMonthCap` read the month, computed `delta = capUsd - cap` and `$inc`'d the adjustment by it. Two sets racing on a cap of 50 — to 100 and to 80, say an administrator and an approved `TeamBudgetProposalTool` proposal — stored 50 + 50 + 30 = 130, a cap nobody asked for, while the audit said 50 → 100 and 50 → 80. `ITeamBudgetStore` gains `setAdjustment(expected, new, …)` with a new `AdjustOutcome.CONFLICT`: MongoDB applies it as one `findOneAndUpdate` whose filter carries the expected adjustment and the "cap stays at or above the spend" predicate, PostgreSQL under the row lock it already took for transfers. The service re-reads and retries a conflict up to three times (the later set wins, and its audit entry names the cap it actually replaced), then answers 503. Transfers keep `applyAdjustment`: a delta is the right meaning there.
* **The per-subject outcome cap holds under concurrent posts.** `OutcomeEventService.record` counted the subject and inserted in two steps, so N concurrent posts at `maxPerSubject - 1` all stored. `IOutcomeEventStore.insertIfAbsent` becomes `insert(event, maxPerSubject)` answering `INSERTED` / `DUPLICATE` / `FULL` (a duplicate wins over full, so a retried webhook on a full subject still gets 200). PostgreSQL counts and inserts in one transaction behind a per-subject `pg_advisory_xact_lock`, as `PostgresAttachmentStore` does. MongoDB has no transactions in EDDI, so each event claims the lowest free `slot` of its subject under a new unique partial index `idx_outcome_subject_slot (groupId, subjectId, slot)`: two writers that read the same subject pick the same slot and only one stores. The service's own count, now redundant, is gone.
* **Dead code removed:** `OutcomeEventService.retroDigestProvider()` (the RETRO digest is wired through `retroDigest` directly), `SharedTaskList.findTasksForAgent` (only its own two tests called it) and `IOutcomeEventStore.countBySubject` with both store implementations (its one caller was the service's count).

### Design decisions

* **Slots rather than insert-then-check on MongoDB.** Inserting and then deleting the event if it is not among the subject's oldest `maxPerSubject` over-admits whenever an event that sorts earlier is inserted after a later one's check — under eight racing writers, often. The slot index makes the cap exact for a constant `maxPerSubject`; after a lowered cap, or for rows written before this change (none in a release: outcomes are new in 6.8.0), the up-front count still refuses sequentially.
* **Three attempts, then 503** for a set that keeps losing: a set that conflicts has a fresh snapshot to retry with, and three consecutive losses mean sustained contention an administrator should retry, not a loop to spin in.

**Files:** [`ITeamBudgetStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/ITeamBudgetStore.java), [`MongoTeamBudgetStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/MongoTeamBudgetStore.java), [`PostgresTeamBudgetStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/PostgresTeamBudgetStore.java), [`TeamBudgetService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/TeamBudgetService.java), [`IOutcomeEventStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/outcomes/IOutcomeEventStore.java), [`OutcomeEventService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/outcomes/OutcomeEventService.java), [`MongoOutcomeEventStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/outcomes/mongo/MongoOutcomeEventStore.java), [`PostgresOutcomeEventStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/postgres/PostgresOutcomeEventStore.java), [`SharedTaskList.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/SharedTaskList.java); docs [`team-budgets.md`](https://docs.labs.ai/security-and-compliance/tenant-quotas/team-budgets.md), [`team-learning-loop.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-learning-loop.md).

***

## 🐛 fix(mcp): schedule tools go through the REST schedule store under the caller's identity (2026-11-07)

**Repo:** EDDI (`fix/mcp-schedule-tools-authz`)

### What changed and why

The six MCP schedule tools (`create_schedule`, `list_schedules`, `read_schedule`, `delete_schedule`, `fire_schedule_now`, `retry_failed_schedule`) addressed `IScheduleStore`, `ScheduleFireExecutor` and `SchedulePollerService` directly and kept their own copy of the parts of `RestScheduleStore` someone had remembered to copy. The copy had drifted:

* `create_schedule` ran none of REST's validation, so a conversation strategy such as `sometimes` and a `userId` in the agent-test namespace were stored, and an unknown time zone or a cron that never matches answered an internal error instead of the reason.
* It never stamped `createdBy`, `creatorTeams` or `creatorAdmin`. With `createdBy` null, `ScheduleFireExecutor` skips the fire-time re-check of the creator's access to the agent for every fire of that schedule.
* `fire_schedule_now` refused only HITL timeouts and continuations. REST also requires `EDIT` on the knowledge base, integration or group an ingestion, email-poll, team-cadence or lesson-consolidation schedule drives, refuses a marker that names none (400), and runs its owner and manage checks.

The tools are admin-only, so this was drift rather than a bypass reachable today. They are now thin adapters over the in-process `IRestScheduleStore` bean, which reads the request's `SecurityIdentity` (the MCP caller), the pattern `McpAlertTools` and `McpRatingTools` already use. `McpAdminTools` loses its three schedule dependencies, the `eddi.schedule.min-interval-seconds` copy and the duplicated create and fire logic.

`McpToolUtils.responseJson` now keeps a plain-text response body as the message (the schedule resource answers its refusals as text, which used to degrade to "The request failed (HTTP 409)") and maps 504 to `errorCode: TIMEOUT`.

### Behaviour changes

* Refusals carry REST's text and code: `invalid_schedule` for a schedule REST would not create, `CONFLICT`/`FORBIDDEN`/`BAD_REQUEST`/`TIMEOUT` on a manual fire, `SYSTEM_SCHEDULE` on deleting the server's own schedule.
* An unset `timeZone` on `create_schedule` takes `eddi.schedule.default-timezone`; the tool argument no longer defaults to `UTC` itself.
* A `heartbeatIntervalSeconds` makes a schedule a heartbeat even with `triggerType: CRON`, as over REST. An unknown `triggerType` is refused with `invalid_schedule`.
* `list_schedules` is paged: new `offset` (default 0) and `limit` (default 100, max 500) arguments. It fetches one row more than the page, so `truncated: true` (with `nextOffset`) is reported only when more schedules really exist; an exactly-full last page is not truncated. `cronDescription` now also describes heartbeats.
* `delete_schedule` on an id that does not exist succeeds, as `DELETE` does over REST.

**Files:** [`McpAdminTools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpAdminTools.java), [`McpToolUtils.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpToolUtils.java), [`McpRoles.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpRoles.java), [`McpScheduleParityTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/schedule/rest/McpScheduleParityTest.java), [`McpScheduleToolsTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/mcp/McpScheduleToolsTest.java), [`mcp-server.md`](https://docs.labs.ai/protocols-and-integration/mcp-server.md#schedule-management-tools-6)

### Next

Widening the schedule tools from admin-only to REST's admin/editor tier is now a decision about the tier alone, since REST's owner rules apply to the MCP caller. Left for a separate change.

***

## 🐛 fix(migration): migrated Slack channels get descriptors; the legacy migration loses its fake running guard (2026-11-07)

**Repo:** EDDI (`fix/migration-descriptors`)

### What changed and why

* **Migrated channels were invisible.** [`ChannelConnectorMigration`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/migration/ChannelConnectorMigration.java) turned the deprecated `channels` list on an agent into channel integrations with `channelStore.create` and wrote no descriptor. Everything that finds a channel integration lists `ai.labs.channel` descriptors — the Slack router, the REST and MCP listings, and the migration's own duplicate check — and `DocumentDescriptorFilter` runs only for HTTP responses. So the router kept routing through the legacy connector, the integrations appeared nowhere, and a re-run after one failed channel created every channel again. Each created channel now gets its descriptor, with the access index built (`DescriptorAccess.rebuildIndex`), named like the config, and owned and filed like the agent it routes to by default. That agent's visibility is copied only when it is `private`; anything wider becomes `space`, since a channel holds the bot's credentials. A descriptor that cannot be written fails that channel (no completion flag) and removes the document again, so the retry does not duplicate it. An agent with no descriptor leaves its channel unowned, as the agent is; an agent descriptor that cannot be *read* aborts the run instead (no completion flag), since an unowned channel is open to everyone under the default legacy policy and an unknown owner is not an absent one.
* **A failed duplicate check no longer creates duplicates.** When the channel listing itself failed, the run went on "but may create duplicates". It now aborts and retries on the next start.
* **Back-fill.** The completion flag is renamed to `channel-connector-migration-v2-complete`, so a deployment that finished the first run migrates once more and gets visible integrations; Slack then routes through them. The documents the first run created stay in the database unreferenced: no API lists or reads them. Noted in [Upgrading from 6.5](https://docs.labs.ai/deployment-and-infrastructure/upgrading-from-6.5.md#slack-channels-still-declared-on-an-agent).
* **The document migrations run on one node at a time.** [`AgentDeploymentManagement.runDocumentMigrations`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/AgentDeploymentManagement.java) (Qute, channel connector, workspace access index) had no cluster-wide exclusion: each migration reads its flag, works, then writes the flag, so replicas starting together all ran the pass. The in-place rewrites converge, but the channel migration *creates* a configuration under a fresh id, and its duplicate check cannot see what another node is creating at that moment, so each channel was migrated once per node — now visible ones, and the renamed flag makes every existing cluster run it again on upgrade. The pass now holds the cluster lease `migration.documents` (the existing `IConversationLeaseManager`; NATS KV in cluster mode, granted at once on a single node). A waiting node gets it when the holder is done and finds every flag set; a crashed holder loses it after the lease TTL. A node still without it after 15 minutes, or refused it while NATS is unreachable under `degraded.turns=reject`, skips the pass with a WARN and starts as before; what is left is retried on the next start.
* **`MigrationManager` drops `isCurrentlyRunning`.** [`startMigrationIfFirstTimeRun`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/migration/MigrationManager.java) is `synchronized`, so the flag could only ever be seen by a call from inside its own callback — which it then skipped without running that caller's callback. Nothing calls back in today; the two tests named "concurrent calls guarded" made two sequential calls, and are renamed to say so.
* **`V6RenameMigration` counts a failed agent rewrite.** The `packages` → `workflows` pass over `agents` called `replaceOne` bare and counted the document migrated whatever came back; it now goes through `saveDocument`, like the history pass beside it, so a replace that matched nothing (or threw) keeps the migration incomplete and it retries.

### Tests

`ChannelConnectorMigrationTest`: the descriptor's resource URI, name, owner, space, narrowed visibility and index; a private agent's channel stays private; an agent without a descriptor gives an unowned channel, and an unreadable one aborts the run; a re-run after a partial failure creates only the failed channel (stores that remember the first run's writes); a descriptor write failure removes the document and leaves the flag unset; a listing failure creates nothing; the first run's flag does not skip the second. `MigrationManagerTest`: a call from inside the completion callback runs its own callback. `V6RenameMigrationTest`: an agent rewrite that matched nothing leaves the completion log unwritten, and one that matched writes it. `AgentDeploymentManagementMigrationLeaseTest`: the lease acquired runs the three migrations inside it and releases it; held elsewhere, refused while degraded, or unanswered past the wait, the pass is skipped and startup still deploys; a migration that throws still releases the lease.

***

## 🔒 fix(outbound): one cross-origin header allow-list; redirect errors without query strings (2026-11-07)

**Repo:** EDDI (`fix/outbound-header-allowlist`)

### What changed and why

**One allow-list for cross-origin redirect hops (SEC-5).** EDDI had two rules for the headers a redirect to another origin may carry. The httpcalls client (`HttpClientModule`) kept only a short allow-list of content-negotiation headers, because a credential can sit in any header name. The `OutboundHttp` facade used a deny-list instead: ten fixed credential names, the W3C trace context and the headers a request had marked as caller-derived. Every other header was replayed, so a request carrying `Ocp-Apim-Subscription-Key` or `X-Subscription-Token` that met a `302` to another host sent the key there. No facade caller follows redirects with such a header today, but `Profile.APICALLS` follows five hops and httpcalls are planned to move onto the facade.

* `OutboundHttp` now owns `CROSS_ORIGIN_SAFE_HEADERS` (`Accept`, `Accept-Encoding`, `Accept-Language`, `User-Agent`, `Content-Type`, `Content-Language`, `Cache-Control`, `Pragma`), moved from `HttpClientModule`. `redirectHeaders` keeps only those on a cross-origin hop. Credentials and trace context drop out with everything else. Same-origin hops still keep every header.
* `OutboundHttp.SENSITIVE_HEADERS` is removed. So is `OutboundRequest.Builder.callerDerivedHeader` with its record component: no production code called it, and the allow-list already covers what it marked.
* `HttpClientModule.stripCredentialsIfCrossOrigin` reads the facade's list. Its explicit removal of the fixed names and the trace headers was redundant with the allow-list sweep and is gone.

**Redirect errors without the query string (SEC-6).** "Too many redirects … for URL:" and "Redirect … without Location header from:" quoted the full URI, query included. A tool hands these messages to the model and to the log, and an API key in `?key=` went with them. Both now use `withoutQuery`, like every other message the facade builds. The per-tool redaction in `WeatherTool` and `WebSearchTool` stays: the engines rethrow transport messages the facade does not build.

### Behaviour change

A facade request that follows a redirect to another origin now sends only the headers listed above on that hop. Before this change it also sent any custom header not on the deny-list. Same-origin redirects are unchanged, and httpcalls behave exactly as before.

**Files:** [`OutboundHttp.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/httpclient/outbound/OutboundHttp.java), [`OutboundRequest.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/httpclient/outbound/OutboundRequest.java), [`HttpClientModule.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/httpclient/bootstrap/HttpClientModule.java), [`OutboundHttpTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/httpclient/outbound/OutboundHttpTest.java)

***

## feat(signing): admins provision an agent signing key end to end; the validator checks the key is usable (2026-11-07)

**Repo:** EDDI (`feat/agent-signing-key-provisioning`, on top of `fix/agent-signing-key-cache`)

### What changed and why

Agent signing could not be switched on. Nothing wrote an `agent-signing-key:` vault entry (the secrets API's key names allow no `:`), yet a save with `signInterAgentMessages` on succeeded as long as `identity` held any non-blank string. From then on every group turn logged a WARN and wrote an unsigned transcript entry while the configuration said the agent signed.

* **One generator, behind an admin endpoint.** `POST /agentstore/agents/{id}/signing-keys?version=N` (`@RolesAllowed("eddi-admin")`; whoever mints a key can sign as the agent) calls the new `AgentSigningService.generateKey`, which creates an Ed25519 key pair and stores the private key under `agent-signing-key:{id}:v{n}` with `storeIfAbsent`, never an upsert, skipping to the next version if one is taken. The endpoint appends the public key to `identity.keys` as version `max + 1` and saves a new, compatible agent version (200, Location = that version, body = the new key). A stale `version` is refused with 409 before the vault is touched; a failed config write takes the key back out of the vault (`discardKey`); a vault failure answers 503 and writes nothing. Older keys stay, so entries they signed still verify by the version they declare.
* **The validator is honest.** `RestAgentStore.validateSecurityFlags` now checks that the agent can sign: the version that would sign (`AgentIdentity.signingKeyVersion()`, the signer's rule) has a public key, it is an Ed25519 public key, and the vault key signs as it (`AgentSigningService.checkSigningKey`, a sign-and-verify probe that leaves the verify metrics alone). Each failure is a 400 that names the endpoint; a vault that cannot answer is a 503. On update the check runs after the edit-access check, since it asks the vault about the agent. Creating an agent with signing on is refused (a new agent has no key yet), and `requirePeerVerification` no longer demands a key of the agent's own: verifying uses the speakers' keys.
* **Duplicating an agent drops its identity and turns its signing off, and so does a ZIP import that creates a new agent** (`RestImportService.createNewAgent`). The original's keys live under the original's id, so the new agent could never sign with them and would have published the original's public keys as its own; with the honest validator, every later save of it (a workflow cascade included) would also have been refused. An import *merge* keeps the local agent's identity (see the 2026-11-08 entry: `identity` is engine-owned).
* **The crypto inventory lists `KeyPairGenerator`** **`Ed25519` again** (`CryptoInventoryTest`, [`cryptography.md`](https://docs.labs.ai/security-and-compliance/cryptography.md)): the entry "private-key cache expires; unused provisioning and rotation methods removed" dropped it with the unused generators, and `generateKey` uses it.
* **Manager.** A "Generate signing key" button in Security & Identity (admins only; disabled with a reason while there are unsaved edits or an older version is open) that follows the version the key was saved as. The copy that said signing is "not yet available" and that the backend rejects any save with these flags is gone, with its confirmation dialog; a warning now appears only when signing is on and no key is declared. The `signMcpInvocations` toggle, a field the backend removed, is gone. All 11 locales.
* **Operator.** The endpoint stays off the allow-list (`tool-scopes.ts` says why); the system prompt says how keys are provisioned and sends the administrator to the Manager. Revision bumped.
* **Docs.** [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md#cryptographic-agent-identity) describes provisioning, the save-time check and rotation as they now are; [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md) corrects `eddi.audit.agent-signing-enabled` (provisioning writes versioned keys only, so audit entries still carry no agent signature) and the `eddi.a2a.signing.nonce.*` rows (they govern group-transcript entries; A2A requests are not signed). `AgentConfiguration` and `IRestAgentStore` Javadoc no longer say identities are generated on creation or that no endpoint can regenerate a key. (Superseded for `eddi.audit.agent-signing-enabled` by the entry "agent signatures on audit entries are versioned and verified", 2026-11-07: audit entries are signed with the newest versioned key.) (Superseded for the nonce rows by the entry "peer verification is fail-closed and binds the conversation, position and key version", 2026-11-08: the signer no longer registers nonces, so those two properties do nothing.)

### Design decisions

* Versioned keys only: the legacy unversioned `agent-signing-key:{id}` is still read and checked but not written, so there is one way to provision.
* No MCP tool: the plan called it optional, and an MCP tool would widen who can mint keys beyond the REST role gate this change pins.
* Validity windows and verification outcomes are untouched here: enforcing `validUntilMs`, a fail-closed verdict per entry and binding the conversation into the signed bytes are the entry "peer verification is fail-closed and binds the conversation, position and key version" (2026-11-08); audit signatures (still on the unversioned key) are left to a later change.

### Tests

`AgentSigningServiceTest` (generator, discard, every `checkSigningKey` outcome), `RestAgentStoreTest` (endpoint against a real signing service and in-memory vault, validator outcomes, duplicate, admin-only gate), new `GroupSigningRoundTripTest` (provision through the REST method, enable through a save, sign with the real `GroupSigningGuard`, verify for a receiver; tampering and rotation), and the Manager section, page and API tests.

***

## 🐛 fix(rules): refuse unsupported deployment tags, quick-reply templating, property and dependency fixes (2026-11-07)

**Repo:** EDDI (`fix/rules-output-property`)

### What changed and why

* **Templated quick replies are now shown templated.** The output task stores each quick reply twice: in the `quickReplies:<action>` data entry and in the conversation output the client receives. `OutputTemplateTask` rendered only the data entry, so the client showed `Call {properties.agentName}` while the next turn's dictionary, built from the data entry, held `Call Ava`. A click on the button the user saw matched nothing. The rendered quick replies now replace the raw ones in the conversation output too, as rendered output texts already did. Quick replies sent in `context` are still shown as they arrived.
* **`deploymentContext` refuses `tagMatches`.** The condition read agent tags from an `agent:tags` memory key that nothing writes, and `AgentConfiguration` has no tags field, so a rule with `tagMatches` never fired. That included the Javadoc's own example, a safety rule meant to make production agents cautious. A non-blank `tagMatches` is now refused when the ruleset is read, with an error that names the rule and points to `contextmatcher`. The Manager's default for a new `deploymentContext` condition no longer carries the field. **Behaviour change:** a stored ruleset that uses `tagMatches` now fails to save or deploy until the field is removed. Such a rule never matched, so removing the field changes nothing at runtime.
* **A property instruction runs once per turn.** `PropertySetterTask` collected and applied instructions separately for each of the turn's actions. An instruction under `"*"`, or under two of the turn's actions, therefore ran once per action. For `scope: secret`, every run wrote a new vault slot. Only the last reference reached the step history, and conversation deletion sweeps only what the history holds, so the other slots stayed in the vault until a GDPR sweep of the user. Instructions are now collected across all of the turn's actions, without duplicates, and then applied once each.
* **`dependency` survives unnamed rules and requires `reference`.** It called `getName().equals(reference)` on every rule in the set, so a single unnamed rule anywhere caused a NullPointerException, and the turn failed, whenever any dependency was evaluated. `Rule.equals` had the same problem. Both comparisons are now null-safe. A `dependency` without a `reference`, which could only fail, is now refused when the ruleset is read. Rule names stay optional, and duplicate names stay supported.
* **Matcher semantics are pinned.** New `@Nested Semantics` tables in `ActionMatcherTest` and `InputMatcherTest` run the matchers against a real conversation memory. They pin that a comma list is an ordered, adjacent sublist, plus `empty`, `lastStep` on the first step, `anyStep` and `never`. The existing tests stubbed every lookup and asserted SUCCESS only, so they kept passing with `indexOfSubList` replaced by `containsAll`.

### Design decisions

* `tagMatches` is refused rather than implemented. Agent tags would be a new feature with no model field, UI or storage behind them, and a value the client sends can already be matched with `contextmatcher`.
* Instructions are collected first and then applied, instead of being remembered as applied across actions. Each runs at its first selection: the turn's actions, then `setOnActions`. The only order change is that a repeat no longer runs again later in the turn. With `[{"actions":["*"], x="default"}, {"actions":["greet"], x="hello"}]`, a turn with the actions `[greet, other]` used to end with `x="default"`, because the `"*"` entry ran again for `other`. It now ends with `x="hello"`, the same as a turn with `greet` alone.

**Files:** [`OutputTemplateTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/templating/OutputTemplateTask.java), [`DeploymentContextCondition.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/rules/impl/conditions/DeploymentContextCondition.java), [`Dependency.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/rules/impl/conditions/Dependency.java), [`Rule.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/rules/impl/Rule.java), [`PropertySetterTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/properties/impl/PropertySetterTask.java), [`rules-editor.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/editors/rules-editor.tsx), [`behavior-rules.md`](https://docs.labs.ai/agent-configuration/behavior-rules.md), [`properties.md`](https://docs.labs.ai/architecture-and-concepts/properties.md)

***

## 🐛 fix(schedules): the poller's claim re-checks due-ness; leases judged by the database clock (2026-11-07)

**Repo:** EDDI (`fix/schedule-claim-correctness`)

### What changed and why

Two ways the cluster-wide schedule claim let the same slot fire twice.

**A re-armed schedule could be claimed again.** A poll reads its batch once and then claims the rows one by one. The claim was a compare-and-set on state alone (`enabled` and `fireStatus`), with no `nextFire` term. If another instance claimed, fired and re-armed a row before this instance's loop reached it, the row was PENDING again with a future `nextFire`, the claim matched, and the slot fired a second time. The second fire carried a new `fireId`, because the id is keyed on the claim time, so nothing downstream could tell the two apart. A fast rule-only turn and a batch of up to `eddi.schedule.poll-batch-size` (100) claim round trips are enough for this to happen.

`IScheduleStore.tryClaim` now also requires `nextFire <= now`, the condition `findDueSchedules` already reads. A manual fire (`POST /schedules/{id}/fire`, `fire_schedule_now`) may fire before the due time, so it claims through the new `tryClaimAnyTime`, which has the same conditions without the due check. The existing method became the safe one, so any future batch caller gets the check by default.

**A fast clock could steal a live lease.** `claimedAt` was written from the claiming instance's clock and compared with `now - lease` from the reading instance's clock. With the default 10-minute lease against a 5-minute fire timeout plus 30 s grace, an instance whose clock ran more than 4.5 minutes ahead took over claims whose fires were still running. Both stores now write `claimedAt` with the database's clock and measure a lease's age against that same clock: MongoDB through a pipeline update with `{$toLong: "$$NOW"}` and an `$expr` comparison, PostgreSQL through `(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000)::bigint`. `tryClaim` and `findDueSchedules` take the lease as a `Duration` instead of a precomputed expiry instant. The instance's own `now` still decides due-ness and retry readiness and keys the `fireId`; skew there only shifts when a schedule fires on that instance, it does not duplicate a fire.

**Files:** [`IScheduleStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/schedule/IScheduleStore.java), [`MongoScheduleStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/schedule/mongo/MongoScheduleStore.java), [`PostgresScheduleStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/postgres/PostgresScheduleStore.java), [`SchedulePollerService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/SchedulePollerService.java), [`ScheduleConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/schedule/model/ScheduleConfiguration.java) (the `fireId` comment said "scheduleId + fireTime"; it is the claim time), [`scheduling.md`](https://docs.labs.ai/conversations-and-orchestration/scheduling.md#cluster-awareness).

### Design decisions

* **Change `tryClaim`, add `tryClaimAnyTime`**, rather than adding a poller-only due-checked claim next to the old one: the unsafe variant is the one that has to be asked for by name.
* **The same tests run on both backends.** The container-backed `PostgresScheduleStoreTest` and `datastore/mongo/MongoScheduleStoreTest` each gained "a re-armed row is not claimed again (but Fire now still claims it)" and "a fast clock does not steal a live lease"; both failed on `main`.
* **`CURRENT_TIMESTAMP` rather than `clock_timestamp()`** in PostgreSQL: the value is fixed for the statement, so the write and the comparison in one claim use the same instant, and it matches the existing `PostgresConnectionNameClaimStore`.

### Behaviour changes

* A schedule that another instance fired and re-armed between a poll's read and its claim is no longer fired a second time.
* Instances whose clocks disagree no longer take over each other's running fires. An existing CLAIMED row written by an older version carries an application-clock `claimedAt`; after the upgrade its lease is judged against the database clock, which differs from it only by the skew this fix exists for.
* MongoDB: a CLAIMED schedule with no `claimedAt` now counts as an expired lease and is reclaimed (recorded as a failed attempt and retried), where it used to stay CLAIMED and never fire. No claim produces such a row, but `createSchedule` stores the caller's `fireStatus` as given, so a REST create that sends `"fireStatus": "CLAIMED"` could. PostgreSQL always inserts PENDING, so it never holds one.

***

## 🔒 fix(secrets): bearer redaction in any case, fail-closed export scrub, legacy KEK removed, loud grant-check errors (2026-11-07)

**Repo:** EDDI (`fix/secret-redaction`)

### What changed and why

* **`SecretRedactionFilter` redacts a bearer token whatever the scheme's case.** The shape rule matched only `Bearer` with a capital B, the explicit-scheme rule listed `Basic|Token|Digest` but not bearer, and the name-bound rules stop a value at the space after the scheme word, which at six characters is under their floor. So `authorization: bearer <token>` and `Authorization: BEARER <token>` went through `redact()` unchanged, and so did a canonical `Authorization: Bearer <token>` with a token under 20 characters. The bearer rule is now case-insensitive and starts at a word boundary (`forbearer …` is prose, as for the `sk-` rules), except that the second character of an escape does not count: in serialized text a line break before the scheme is `\n`, and the canonical rule, which had no boundary, matched there. Its replacement stays `Bearer <REDACTED>`, the spelling the already-redacted checks recognise, so a second pass changes nothing. The explicit `authorization:` rule now lists `bearer` too, with no length floor, like `Basic`. `redact()`'s Javadoc, orphaned above `redactCredentialShapes`, is back on `redact()`.
* **`SecretScrubber.scrubJson` fails closed.** It caught every exception and returned the input — credentials included — with a WARN. Serializer output can still fail to parse (Jackson's read constraints, such as the 1,000-level nesting limit, do not bind the writer), and a bug in the scrub walk failed open the same way. It now throws `IllegalStateException` on a parse or write failure, carrying neither the input nor Jackson's exception (whose message quotes source text), and lets any other exception propagate. `containsCredential` already failed closed on the same input. At the callers the export aborts, or stops writing the snippet or schedule section at that document. An agent sync's remote source skips the document (the sync fails when it is the agent itself), and `RemoteApiResourceSource` remembers the refusal like a failed read, so a document several steps name is not fetched again for each of them.
* **The legacy fixed-salt KEK path is gone from `EnvelopeCrypto`.** `deriveKeyFromString(String)` (deprecated since 6.0.2), its `LEGACY_SALT` and `sha256Hex` had no caller in main code: the provider derives every KEK with the salted overload, `VaultSaltManager` holds the only live copy of the legacy salt, and `VaultChecksum.legacy` is the production legacy checksum. The four tests that built legacy checksum fixtures use `VaultChecksum.legacy`. `EnvelopeCryptoTest` now runs its encryption tests on random DEKs (no PBKDF2) and covers the salted overload's salt-length guard, which nothing tested.
* **The deploy-time grant check says when it could not check.** `VaultGrantChecker.isGranted` treated every metadata-read exception as granted and logged it at DEBUG — right for a secret that does not exist yet, but identical for a vault-store outage or a corrupt row. The resolver checks no grants, so that agent kept access to a restricted secret until its next deploy, with no trace. A not-found secret and an unparseable reference stay quiet; any other failure now logs a WARN naming the secret and the agent. It is still let through, as the class contract chooses. Documented in [secrets-vault.md](https://docs.labs.ai/security-and-compliance/secrets-vault.md#what-counts-as-granted).

### Design decisions

* **No new counter for the skipped grant check.** A store failure is already counted by `eddi.vault.errors.count` inside `VaultSecretProvider.getMetadata`; the WARN line names which agent and secret went unchecked, which a counter cannot.
* **The preflight's `checked` stays `true` when a grant could not be read.** Reporting `false` needs the checker to return the count of unverifiable references alongside the violations, which changes the method every gate test mocks. Left as a follow-up; the page says so.
* **The scrubber's exception drops its cause.** A parse error's message quotes the token it stopped at, which can be the credential, and a cause is printed with the stack trace that logs the exception. The exception class name is kept.

**Files:** [`SecretRedactionFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/SecretRedactionFilter.java), [`SecretScrubber.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/SecretScrubber.java), [`EnvelopeCrypto.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/crypto/EnvelopeCrypto.java), [`VaultGrantChecker.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/VaultGrantChecker.java), [`RemoteApiResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RemoteApiResourceSource.java), [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md), and their tests.

***

## 🐛 fix(tenancy,connections): agent quota outage pre-registered, authorize needs a per-user connection, UTC grant timestamps (2026-11-07)

**Repo:** EDDI (`fix/tenancy-connections-small`)

### What changed and why

* **The first agent-count outage now fires `EddiQuotaStoreUnavailable`.** `TenantQuotaService` registers `eddi.tenant.quota.unavailable` at 0 for the default tenant so that Prometheus' `increase()` sees the first refusal. The list it registered held `conversation`, `api_call` and `cost` but not `agent`, which the deploy gate also records, so that series was born at 1 and the first agent-count outage, the case the pre-registration exists for, never alerted. `agent` is now on the list ([`TenantQuotaService`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/tenancy/TenantQuotaService.java)).
* **`POST /connections/{name}/authorize` refuses a connection that cannot take a per-user grant.** It checked only `authType == OAUTH2_AUTHORIZATION_CODE`, while the callback also requires `binding: PER_USER` and refuses before redeeming the code. Since 6.4.0 a write cannot store that combination, but validation runs only on the write path, so a connection saved earlier with the default `SERVICE` binding still loads: the user went through the provider's consent screen and came back to `?error=exchange_failed`. `authorize` now answers **400** naming the binding and the fix, and issues no state and no cookie ([`RestConnectionAuthorization`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/connections/rest/RestConnectionAuthorization.java), [`connections.md`](https://docs.labs.ai/protocols-and-integration/connections.md#per-user-accounts)).
* **PostgreSQL grant and OAuth-state timestamps are UTC wall clocks.** The columns are `TIMESTAMP` without time zone. `refresh_lease_expires_at` was already written and read as UTC. `expires_at`, `created_at`, `updated_at` and `last_refresh_at` in `connection_grants`, and `created_at`, `expires_at` and `consumed_at` in `connection_oauth_states`, went through the JDBC driver's default, the JVM's zone, and the SQL stamps used `CURRENT_TIMESTAMP`, which a `TIMESTAMP` column takes in the session's zone, also set from the JVM. Replicas in different zones therefore moved every access-token expiry by their offset (a refresh hours early, or a dead token served as live), and in a daylight-saving zone the repeated autumn hour could put a ten-minute OAuth state's expiry before its creation, so `claim()` refused a valid callback. Every bind and read now goes through the new [`PostgresTimestamps`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/postgres/PostgresTimestamps.java) with a UTC `Calendar`, and every SQL stamp is `(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')`. The grant insert now names `created_at`, because an existing table keeps its old column default.
* **Hygiene.** `TurnCostMeter` takes `SpendSinks` as a constructor argument instead of a field that tests left null and the code null-checked; tests pass `SpendSinks.NONE`. `ResourceAccessGuard.callerIsAdmin()` duplicated `isAdmin()` and is removed; its two callers use `isAdmin()`.

### Upgrade note

On a PostgreSQL deployment whose JVM did **not** run in UTC (the container image does unless `TZ` is set), the existing grant rows hold local wall clocks. They are now read as UTC, so each grant's `expires_at` is off by the zone's offset until its next refresh rewrites it. East of UTC an expired access token can be presented for up to that many hours and the provider rejects it; unlinking and relinking the account clears it at once. West of UTC the token is refreshed early, which is harmless. OAuth states live ten minutes, so only a link in progress during the upgrade is affected, and the user starts it again. MongoDB stores instants and is not affected.

### Design decisions

* **A UTC `Calendar` rather than migrating the columns to `TIMESTAMPTZ`.** `TIMESTAMPTZ` is the cleaner type, but the change is an `ALTER COLUMN ... TYPE` in `createSchema()`, which rewrites the table under an exclusive lock on every replica that boots, and converts existing rows through whichever zone that replica runs in. The lease column had already settled on the UTC wall clock; one rule for the whole table is easier to keep right than two.
* **One helper, in `datastore/postgres`.** Other PostgreSQL stores write `TIMESTAMP` columns the same way. They are out of scope here; the helper is where they would go.

***

## 🐛 fix(llm): tool history reports what the trace records (2026-11-07)

**Repo:** EDDI (`fix/tool-history-outcomes`)

### What changed and why

`GET /llm/tools/history/{conversationId}` reported every tool call as a success. `RestToolHistory` set `success=true` on each `tool_call` entry of the stored trace and only ever copied a `tool_result` onto the last call when the tool names matched. It ignored every `tool_error` (budget, tenant quota, argument schema, approval-pause cap), the repeat-guard, call-cap and LAZY-activation refusals and a blocked tool result, so a call refused before it ran did not appear at all, and an HTTP 500 result read as a success. The totals were computed from `executionTimeMs`, `error` and `cost` fields that nothing set, so `totalExecutionTimeMs`, `hasErrors` and `totalCost` were always `0`, `false` and `0`. The `callId` the trace has recorded since the tool loop gained call identity was ignored, so two calls of the same tool could not be told apart.

The endpoint now builds its answer from the trace as written:

* A `tool_call` opens a call; its `tool_result` or `tool_error` closes it, found by `callId`, or, in an older trace without call ids, as the earliest open call of the same tool.
* A result's outcome comes from `ToolOutcomeClassifier`, the definition the repeat guard, the `tool_result` event status and the `toolQuotas` give-back already use. The class, its `Outcome` enum, `classify` and `isFailure` are now public for that.
* A `tool_error` with no open call, the `tool_repeat_refused`, `tool_not_activated` and `tool_call_capped` refusals, and the gated calls the HITL resume settles without running them (`hitl_rejected`, `hitl_not_executed`, `hitl_request_changed`, `hitl_self_conversation`, `hitl_self_ungating`, `hitl_outcome_unknown`) become failed calls of their own. A `tool_result_guardrail` with `action: block` fails the call it follows. A call the trace opened but never closed is reported as `success: false, error: "no_result"`, not as a success.
* Still not listed, because the trace cannot identify them: a call a `toolCallGuardrails` entry refused (one entry per finding, no call id) and an approved call replayed from the HITL journal (no result in the trace).

### What this breaks

**Breaking REST response shape.** A client of `GET /llm/tools/history/{conversationId}` that reads `totalCost`, `totalExecutionTimeMs`, `cacheHits`, `cacheMisses`, `toolMetrics` or a call's `executionTimeMs`, `cost`, `fromCache` or `timestamp` no longer finds it (those fields were always zero or empty). The upgrade guide ([Changes after 6.7.0](https://docs.labs.ai/deployment-and-infrastructure/upgrading-from-6.5.md#changes-after-670)) says so.

### Response shape (a REST client notices)

The body is now `{"toolCalls": [...], "hasErrors": bool}`, each call `{toolName, callId, arguments, result, success, error}`. Removed, because the trace never records them and they were always zero or empty: `totalExecutionTimeMs`, `totalCost`, `cacheHits`, `cacheMisses`, `toolMetrics`, and per call `executionTimeMs`, `cost`, `fromCache` and `timestamp`. `callId` is new. A conversation's tool spend is still served by `GET /llm/tools/costs/conversation/{conversationId}`. Neither the Manager nor the Platform Operator calls the history endpoint.

`ToolExecutionTrace` (and its unused accumulator, `ToolMetrics` and `ToolExecutionTraceTest`) is replaced by the `ToolHistory` record.

### Design decisions

* **The classifier, not a second rule.** Reading `success` from `ToolOutcomeClassifier` keeps one definition of a failed call; a local rule would drift from the repeat guard's.
* **Refusals always get their own entry.** `tool_repeat_refused`, `tool_not_activated`, `tool_call_capped` and the `hitl_*` refusals are only ever written for calls that never got a `tool_call`, so pairing them by tool name with an open call could only attach them to the wrong one.
* **No invented numbers.** Timing and cost would have to be added to the trace first; until then the history reports neither.

**Files:** [`RestToolHistory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/rest/RestToolHistory.java), [`ToolHistory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/ToolHistory.java), [`ToolOutcomeClassifier.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolOutcomeClassifier.java), [`RestToolHistoryTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/llm/rest/RestToolHistoryTest.java), [`metrics.md`](https://docs.labs.ai/deployment-and-infrastructure/metrics.md#rest-api-endpoints)

***

## 🐛 fix(openai): abandoned stateless streams end their conversation; mapping deletes match (2026-11-07)

**Repo:** EDDI (`fix/v1-bridge`)

### What changed and why

Three defects in the OpenAI-compatible `/v1` adapter, found in the whole-codebase review.

* **A stateless stream refused a concurrency permit left its conversation open.** `prepare()` starts a stateless turn's throwaway conversation before the response is returned, and only `bridge.stream()` ended it. The streaming body takes its own permit; when it could not get one, it wrote the in-band `429` error event and returned without calling `stream()`, so every such request under `max-concurrent-requests` load left an open conversation behind. The new `OpenAiConversationBridge.abandon(turn)` ends a stateless turn's conversation (a stateful turn's belongs to its chat and is left alone), and the refused body calls it before writing the error.
* **Mapping deletes were unconditional, so concurrent requests could split a chat.** When a chat's mapped conversation had ended, Open WebUI's completion and title requests both found the stale mapping; the slower one's `deleteUserConversation` removed the fresh mapping the faster one had just written, and the chat continued in a second conversation while the first stayed open and orphaned. Every mapping delete in the bridge now goes through `deleteUserConversationIfMatches` with the conversation the request found unusable — the same primitive Slack and the webhook handler already use — so the slower delete is a no-op, its create collides, and the existing insert-conflict re-read adopts the winner.
* **Model resolution probed access by exception, and a failed catalogue was cached.** `AgentModelResolver.mayUse` caught `requireAgentUseAccess`, which logs a WARN and builds a `ForbiddenException` per hidden agent; `GET /v1/models` is polled, so a deployment with many private agents filled the log on every listing. It now asks `ResourceAccessGuard.hasAccess(id, USE)`, which answers the same. Separately, a failed `getAllLatestAgents` produced an empty catalogue that Caffeine stored for `model-cache-seconds`, so one store error made every model unknown for 30 s; the loader now returns `null` on failure (not cached) and the call that saw it gets an empty view.

### Design decisions

* `abandon` is a bridge method rather than an `endConversation` call in the adapter: the bridge owns the stateless-turn lifecycle (`say` and `stream` end it in their `finally`), so the adapter never needs to know which turns own a throwaway conversation.
* The conversation-id response header and the prepare-time start are kept, so a stateless streamed turn still names its conversation.
* A body that never runs at all is **not** covered. RESTEasy Reactive skips every remaining cancellable handler once the connection closes (`ResteasyReactiveRequestContext.isHandlerCanceled`), and `ResponseWriterHandler`, which invokes the `StreamingOutput`, is cancellable. So a client that disconnects after `prepare()` has started a stateless conversation but before the response is written still leaves that conversation open, until the idle sweep (`maximumLifeTimeOfIdleConversationsInDays`) ends it. Closing that window needs a response-completion hook on the Vert.x response, which cannot be checked without a live server; it is left as a follow-up rather than guessed at.

### What's next

* End a stateless streamed turn's conversation when its response is disposed without the body having run (the disconnect window above).

**Files:** [`RestOpenAiAdapter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/RestOpenAiAdapter.java), [`OpenAiConversationBridge.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/OpenAiConversationBridge.java), [`AgentModelResolver.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/openai/AgentModelResolver.java), [`open-webui-integration.md`](https://docs.labs.ai/protocols-and-integration/open-webui-integration.md); tests in `RestOpenAiAdapterTest`, `OpenAiConversationBridgeTest`, `OpenAiBridgeSessionAndErrorTest`, `AgentModelResolverTest`.

***

## 🐛 fix(a2a): shard the per-principal task index; cache removal reports the cluster result (2026-11-06)

**Repo:** EDDI (`fix/a2a-index-shards`)

### Why

* **The A2A index outgrew a NATS message.** `CachedA2ATaskStore` kept one index value per principal: up to 10,000 task ids and 10,000 context ids, every one of them caller-chosen and up to 256 characters. At that size the value is about 5 MB, and NATS refuses anything over its payload limit (1 MB by default). The shared cache then kept the index on the writing node only, so a GDPR erasure or export that ran on another node no longer reached the records of that principal. Every save also rewrote the whole value with a compare-and-set, so a principal with many writers fought over one key.
* **Erasure on a node that did not write the record counted 0.** `SharedKvCache.remove` answered with the node-local mirror's value. A node that never wrote the key deleted it from the bucket but answered null, and the `a2aTasks` entry of the GDPR erasure result is the sum of those answers. The existing two-node test modelled both nodes over one plain map, so it could not see this.
* **`ICache` views could change entries that nobody else heard about.** A removal through `keySet()`, `values()` or `entrySet()` of `ClusterInvalidatingCache` changed the local copy without the eviction announcement every other mutation makes. Through `SharedKvCache` it skipped the bucket delete. `CacheImpl.put` and `remove` read first and wrote second, so a write that landed in between was replaced while the caller was told about the value before it. No caller relied on either yet.

### What changed

* **`CachedA2ATaskStore`:** the index is 16 values per principal. The key is `principalPrefix(principal) + "#" + shard`, and `floorMod(id.hashCode(), 16)` picks the shard for each task id and each context id. Each shard keeps at most 625 ids per list, oldest dropped first, which is about 330 KB at the 256-character id limit. A principal still holds at most 10,000 of each. A save updates one shard. A sweep or export reads all 16 shards, plus the bare principal key that the previous release wrote. Nodes of that release write it during a rolling upgrade, and it lives for `eddi.a2a.task-ttl` after that. The Javadoc of `indexKeysOf` says to drop that key one release later. The value class is unchanged, so `SharedKvCache`'s value allow-list is unchanged.
* **`SharedKvCache.remove`:** reads the bucket's value before the delete and answers with it, or with the node-local copy when the bucket holds none (or is unreachable). That costs one extra bucket read per removal; removals are invalidations and erasures, not a hot path. `put` documents that it always answers null.
* **Read-only views:** `CacheImpl`, `ClusterInvalidatingCache` and `SharedKvCache` return `keySet()`, `values()` and `entrySet()` through `Collections.unmodifiableMap`, which also refuses `Entry.setValue`. `ICache`'s new class Javadoc states the contract. `CacheImpl.put` and `remove` delegate to Caffeine's atomic `asMap()` operations, so the casts and their `@SuppressWarnings` are gone.
* **Review fixes:** a save and the eviction it triggers now run under a per-shard lock (64 stripes, taken inside the erasure read lock), so a writer that evicted an id and paused cannot delete the record another writer saved again meanwhile; the eviction also re-reads the shard and skips an id it names again, which narrows the same window across nodes (not closed there, like the erasure lock). A re-save whose ids are unchanged still writes its shard (compare-and-set to the same value), so the shard's expiry renews with the record's instead of lapsing first.
* **Docs:** `clustering.md` describes the shards of `A2A_INDEX`, the erasure count, and the read of the previous release's index value.

### Design decisions

* **16 shards chosen by hash, not one value per id.** A key per id would make an export read thousands of keys and a sweep list keys the bucket cannot enumerate. With 16 shards, an export reads 17 keys and a shard stays about a third of the payload limit. Eviction is FIFO within a shard. Ids are spread by hash, so the first evictions start somewhat before 10,000 ids (around 9,400 for evenly spread hashes); the documented bound is an upper bound and stays true.
* **The previous release's index value is still read, not reset.** In a rolling upgrade, old nodes keep writing the single value. Ignoring it would make an erasure on a new node miss their records until the TTL ran out. The converse cannot be fixed from this side: an erasure that runs on a not-yet-upgraded node reads only the single value, so it misses what upgraded nodes wrote. `clustering.md` says so.
* **Read-only views, not views that announce.** No caller changes a cache through a view, and announcing views would mean reimplementing `Set`, `Collection` and `Iterator` for both cluster wrappers. `CacheImpl` refuses too, so a one-node deployment fails exactly where a cluster would.

### Tests

`CachedA2ATaskStoreTest` (a 10,000-task principal with 256-character ids keeps every index value under 512 KB; two nodes over `SharedKvCache` + `InMemorySharedKv` erase and count each other's records; the previous release's index is reached; per-shard FIFO cap; total cap; concurrent writers), `SharedKvCacheTest` (cross-node remove answer, degraded remove, read-only views), `CacheImplTest` (put and remove report what they really replaced; read-only views), `ClusterInvalidatingCacheTest` (read-only views, only the put announced).

**Files:** [`CachedA2ATaskStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/a2a/CachedA2ATaskStore.java), [`SharedKvCache.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/SharedKvCache.java), [`CacheImpl.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/CacheImpl.java), [`ClusterInvalidatingCache.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/ClusterInvalidatingCache.java), [`ICache.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/ICache.java), [`clustering.md`](https://docs.labs.ai/deployment-and-infrastructure/clustering.md)

***

## 🐛 fix(audit): admin-only endpoints under a data-plane root are recorded as administrative actions (2026-11-06)

**Repo:** EDDI (`fix/admin-action-audit`)

### What changed and why

`AdminActionAuditFilter` decided what is administrative by the first path segment alone, so every mutating request under `/agents`, `/userconversationstore` and the other data-plane roots went unrecorded — including the endpoints there that only an admin may call. Resetting a stuck conversation's state (`PATCH /agents/{conversationId}/state`, `@RolesAllowed("eddi-admin")`) and creating or deleting a user's managed-conversation mapping (`POST`/`DELETE /userconversationstore/userconversations/{intent}/{userId}`, admin-only at class level) left no record of who did it. The test that was meant to pin the exclusion listed three paths no endpoint serves (`/userconversationstore/x/say`, `/a2a/agent1`, `/connections/abc/callback`).

The path rule stays, and one rule decided by the matched endpoint joins it: a mutating request on a data-plane path is still administrative when the endpoint's effective `@RolesAllowed` does not admit `eddi-user`. The roles are already declared on every endpoint, so a new admin-only endpoint under those roots needs nothing remembered. The lookup follows Quarkus: a method's own `@RolesAllowed`, `@PermitAll` or `@Authenticated` before its class's, the implementation before the interface that declares the method (`ResourceInfo` returns the implementation method, and Java does not inherit interface annotations — which is where EDDI declares its roles). The answer is cached per resource method, so the reflection runs once per endpoint, not on every chat turn.

The data-plane test now uses real paths and a resource method that admits `eddi-user`, so it still exercises the path rule.

**Files:** [`AdminActionAuditFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/AdminActionAuditFilter.java), [`AdminActionAuditFilterTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/audit/rest/AdminActionAuditFilterTest.java), [`audit-ledger.md`](https://docs.labs.ai/security-and-compliance/audit-ledger.md#administrative-actions)

***

## 🐛 fix(audit): an erasure or export through MCP records who asked for it (2026-11-06)

**Repo:** EDDI (`fix/admin-action-audit`)

### What changed and why

The MCP tools `delete_user_data` and `export_user_data` call `GdprComplianceService` directly, so `AdminActionAuditFilter` never saw them, and the service's own `GDPR_ERASURE` / `GDPR_EXPORT` event names the subject's pseudonym but no actor. The ledger therefore showed that user X was erased, but not by whom — while the same erasure through `DELETE /admin/gdpr/X` was recorded with the caller. Who erased a user is the first reason the administrative-action log exists.

The record-building half of the filter is now `AdminActionRecorder` (`@ApplicationScoped`, constructor injection, never throws, switched by the same `eddi.audit.admin-actions.enabled`). The filter delegates to it, and the two MCP tools record every call through it in a `finally`: method `MCP`, path `/mcp/<tool>/<pseudonym of the subject>`, the MCP caller as actor, and as status what the REST surface answers for the same outcome — `200`, `207` (incomplete erasure or export), `400`, `403` (role refusal; the `ForbiddenException` still propagates) or `500`. The subject is pseudonymised whole rather than matched against path segments, so an id containing `/` cannot leave part of itself behind. The recorder's and the filter's failure WARNs name the method and endpoint, no longer the request path or the exception message (the filter logs the exception type only), which could hold the raw id the record pseudonymises. A REST path parameter that contains `/` (sent as `%2F`) is now pseudonymised whole in the recorded path too.

The entry tests moved from `AdminActionAuditFilterTest` to the new `AdminActionRecorderTest`; the filter test now runs a real recorder over a mocked ledger and checks what reaches it.

**Files:** [`AdminActionRecorder.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/AdminActionRecorder.java), [`AdminActionAuditFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/audit/rest/AdminActionAuditFilter.java), [`McpGdprTools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpGdprTools.java), [`AdminActionRecorderTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/audit/rest/AdminActionRecorderTest.java), [`McpGdprToolsTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/mcp/McpGdprToolsTest.java), [`audit-ledger.md`](https://docs.labs.ai/security-and-compliance/audit-ledger.md#administrative-actions)

**Next:** the Manager's administrative-actions method filter offers `POST`/`PUT`/`PATCH`/`DELETE` only, so an MCP row is listed under "All methods" but not under a method; and a REST `GET /admin/gdpr/{userId}/export` is a read, which the filter does not record, so a REST export still has no actor on record.

***

## 🐛 fix(manager): the agent page waits for the current version before showing or deploying one (2026-11-06)

**Repo:** EDDI (`fix/agent-detail-version-load`)

### What changed and why

* **No version before the current one is known.** The agent detail page fell back to version 1 while its version list loaded (`version ?? versions?.[0]?.version ?? 1`), and `useAgent` was enabled on the id alone, so it read v1 straight away. The list needs `currentversion` and then one descriptor read per version, so v1 was on screen first: its deployment status, a Deploy button that deployed v1, and sections that edited it. An edit made in that window built its draft from v1, the page then jumped to the latest version without resetting the draft, and Save wrote the v1-based document as the new version, undoing every change since v1. If the version list failed, the page showed v1 as current with no error. Now `useAgent` runs only with a version above 0, the page uses 0 for "not known yet" (the deployment hooks already skip it), shows the spinner until the list is in, and shows the error panel when the list cannot be read; *Retry* reads the list again.
* **One Limits and one Human-in-the-Loop section after a version switch.** Both carried the key `${id}-${version}` as siblings. On a version change React kept the old Limits card in the DOM beside the new one and logged "two children with the same key". They now carry `limits-` and `hitl-` prefixes, like `continuation-`.
* **Viewers get a read-only page.** A `VIEW` grantee was offered Save, Deploy and Undeploy (header and per environment), Deploy & Chat, Add workflow, and the per-row workflow update and remove buttons; the backend refuses all of them (EDIT). As on the workflow page, `readOnly = !access.canEdit` now hides those controls, keeps the status pill, disables every section through its own `disabled` prop (not the fieldset, which would also disable the headers a viewer needs to open a section), and `editAgent` ignores edits so no draft or Save can arise. About 25 fields in the sections never read that prop (the memory and Dream settings, the capability confidence and skill search, the identity DID, the HITL reason and timeout, the checkpoint cap, the review notice, the A2A description and skills): they had relied on the fieldset, which only a save in flight disabled. They now take it too, so a viewer sees every field disabled rather than one that silently drops what they type. Duplicate, Export and Chat stay.

### Tests

New [`agent-detail-load-order.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/__tests__/agent-detail-load-order.test.tsx), with agent1 at v3 (the default mock answers v1, the old fallback, which is why no existing test saw this): no agent read and no Deploy while the version list is held; the error panel and a working Retry when it fails; one section of each kind after switching to v2, with no duplicate-key warning; the viewer page's controls; that with every setting switched on and every section opened, no field is left a viewer can change; and that Ctrl+S after typing writes nothing. Each was seen failing on `main` and mutation-checked against its line of the fix.

**Files:** [`use-agents.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-agents.ts), [`agent-detail.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/agent-detail.tsx), [`agent-config-sections.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/editors/agent-config-sections.tsx), [`conversation-review-section.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/editors/conversation-review-section.tsx), [`agent-manager-gui.md`](https://docs.labs.ai/getting-started/agent-manager-gui.md)

***

## 🐛 fix(llm): a model cascade keeps the agent's workflow and MCP tools (2026-11-06)

**Repo:** EDDI (`fix/cascade-workflow-tools`)

### What changed and why

A task whose tools come only from its workflow — an `httpcalls` or `mcpcalls` step, with the task's own `tools`, `enableBuiltInTools` and `a2aAgents` unset (for example an agent built by `setup_agent` with `mcpServerUrls` and built-in tooling off) — gets those tools on the single-model path, because the tool loop offers everything its assembly finds. With a `modelCascade` it got none: the cascade decided tool mode from `Task.isAgentMode()`, which sees only the task's own configuration, so every step ran as a plain chat and the model answered without the tools it was written for. The same predicate made `enableInAgentMode: false` not skip the cascade for such a task, sized the opt-in cost reservation at one round instead of `1 + maxToolIterations`, and decided whether a spend refusal's fallback is shown.

* **One answer per turn.** `IAgentOrchestrator.offersTools(task, memory)` (new; `AgentOrchestrator` answers from `buildToolSetup`, the assembly the loop itself runs on) says whether the task has a tool other than the `answerMode: "tool"` reply tool. `LlmTask` computes `taskHasTools` once — the config check first, the orchestrator only when a cascade is configured or the reservation is on, so a plain chat agent pays nothing — and uses it for the cascade's tool decision (new `taskHasTools` argument on the `CascadingModelExecutor.execute` overload `LlmTask` calls), for `skipCascade`, for `ModelCallBound.phaseMaxUsd` (now takes `toolLoop`) and for a spend refusal's `usedToolMode` (which asks the orchestrator itself when the plan did not need to).
* **Config-time copy folded.** `CompatibilityRules` and `EmailAgentToolsInspector` carried the same "own tools or workflow httpcalls/mcpcalls" expression; it is now `Task.usesTools(hasHttpCalls, hasMcpCalls)`. `Task.isAgentMode()`'s Javadoc says what it is (the task's own tools) and points at both.

**Behaviour change.** An existing cascade on a task with workflow-only tools now runs the tool loop in each step: its answer streams as one chunk, and `structured_output` confidence is downgraded to `judge_model` / `heuristic`, as for any agent-mode cascade. With `enableInAgentMode: false` such a task now takes the single-model path. A cost reservation for a workflow-tool task, or an `answerMode: "tool"` task, now holds `1 + maxToolIterations` rounds.

**Files:** [`IAgentOrchestrator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/IAgentOrchestrator.java), [`AgentOrchestrator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/AgentOrchestrator.java), [`LlmTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmTask.java), [`CascadingModelExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/CascadingModelExecutor.java), [`ModelCallBound.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ModelCallBound.java), [`LlmConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/LlmConfiguration.java), [`CompatibilityRules.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/compat/CompatibilityRules.java), [`EmailAgentToolsInspector.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/EmailAgentToolsInspector.java), [`model-cascade.md`](https://docs.labs.ai/agent-configuration/model-cascade.md#agent-mode).

### Design decisions

* **Ask the assembly, do not re-derive it.** Widening `isAgentMode()` (or a new config predicate) would have been a second copy of the discovery rules that cannot see attachments, LAZY placeholders or runtime MCP discovery, and would drift. `offersTools` is the loop's own answer.
* **Asked once, only when it matters.** The answer is computed in `LlmTask` and passed down, not asked again inside the cascade; a task with no cascade and no reservation never triggers the extra assembly.
* **The reply tool does not count** as a tool of the task: a cascade already runs the loop for `answerMode: "tool"` regardless of `enableInAgentMode`, and that rule stays.

### Tests

`LlmTaskCascadeWorkflowToolsTest` (real cascade inside `LlmTask`, mocked orchestrator: the loop runs for workflow tools, `enableInAgentMode: false` skips the cascade, no tools keeps the legacy cascade, a plain task never asks, the reservation holds four rounds, a spend refusal shows its fallback), `AgentOrchestratorOffersToolsTest` (real assembly plus a stubbed workflow spec), `ModelCallBoundTest` (round count follows `toolLoop`).

***

## ✨ feat(ui): readable tool calls and edit-on-approve for gated calls in every chat (2026-11-06)

**Repo:** EDDI (`feat/chats-670-tool-display-and-hitl`)

### What changed and why

Every chat surface and approval card named tools by their identifier (`getAgentDescriptors`, `add_issue_comment`) and showed gated-call arguments as a JSON blob, and none of them used what 6.7 sends with a live tool call: the SSE `tool_call` event now carries the designer's `toolDisplay` label (`displayName`) and up to three allow-listed values (`display`), and a `tool_result` event follows each call. Amending a gated call's arguments meant retyping the whole object.

* **One helper per app.** [`tool-labels.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/tool-labels.ts) (Manager) and [`tool-labels.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/tool-labels.ts) (Chat UI; since moved into `@eddi/core`) turn an identifier into words (`getAgentDescriptors` → "Get agent descriptors", `fetchHTTPStatus` → "Fetch HTTP status") and leave text with spaces (a designer label) as written. The Manager's also parses the `tool_call` payload and builds label/value rows from tool arguments, reusing the lossless parse of `hitl-format-args.ts`.
* **Live status lines** (Manager chat page and drawer, Platform Operator, Chat UI): "Using Get agent descriptors…", or the designer's phrase on its own ("Creating an action: Renew the contract…"). `tool_result` stops the spinner of the call that finished (Manager) or returns the widget to "Thinking…" (Chat UI). Whether a status line is an identifier or a designer phrase is decided where the `tool_call` event is parsed and carried as `{ text, phrase }` — it is never re-derived from the string's shape, so a one-word `toolDisplay` label ("Searching") is not wrapped in "Using …" and a prefixed MCP name (`github.search-code`) is still put into words. An event without `displayName` or `display` (pre-6.7 backend) is an identifier, as before.
* **Approval card** (`approval-banner.tsx`, every surface that decides: conversation page, Approvals inbox, Platform Operator): each gated call shows its name in words with the exact identifier beside it, and its arguments as label/value rows by default, with JSON and Raw one click away (a generated tool's nested `requestBody` string is expanded into rows). The confirmation dialog, the decision receipt, the pause notice and the Approvals inbox list name tools in words; the inbox search matches both forms.
* **Edit-on-approve for gated calls**: "Amend arguments" now opens pre-filled with the call's arguments pretty-printed as sent (nested strings are not expanded, so a string parameter keeps its type). A copy that differs only in whitespace is a plain approval. An amendment that still contains `<REDACTED>` is refused before submit: the REST resume runs `amendedArguments` verbatim (only Slack merges against the raw arguments), so the marker would otherwise become the value.
* **Group transcripts**: "using {tool}…" names the tool in words.
* **Platform Operator prompt** (revision 60 → 61): `toolDisplay`, httpcall `argumentSchema` / `unknownFields`, and `answerMode: "tool"` were missing; an admin asking how to make tool calls read well, or why a call was refused before approval, now gets an answer. No allow-list or guard change.
* **Mocks**: `conv-toolcall-1` serves a TOOL\_CALL pause shaped like `buildToolCallPauseDetails` (a generated tool with a JSON-string body and a redacted secret, plus an MCP tool) for MSW mode.
* Chat UI `AGENTS.md`: the backend-contract notes on `tool_call` and the event list are brought up to 6.7.

### Per-surface feature table

| Surface                                            | Tool names in words | toolDisplay label       | tool\_result | Args as fields                 | Edit gated call (pre-filled) | Edit rule-pause answer | Reason codes                | Approval context      |
| -------------------------------------------------- | ------------------- | ----------------------- | ------------ | ------------------------------ | ---------------------------- | ---------------------- | --------------------------- | --------------------- |
| Manager chat page / drawer                         | new                 | new                     | new          | new (activity details)         | via conversation page        | via conversation page  | via conversation page       | via conversation page |
| Conversation page + Approvals inbox (ApprovalCard) | new                 | n/a                     | n/a          | new                            | new (was blank)              | already                | already                     | already               |
| Platform Operator chat                             | new                 | new                     | new          | new                            | new (was blank)              | n/a (tool gate)        | shown, not sent (see below) | n/a                   |
| Group / Workforce transcripts                      | new                 | event carries name only | n/a          | n/a                            | n/a                          | n/a                    | already                     | already               |
| Chat UI widget                                     | new                 | new                     | new          | n/a (no arguments on the wire) | n/a (read-only by design)    | n/a                    | n/a                         | n/a                   |

### Not in this change

* **Group task and synthesis edits** (`taskDecisions[].editedResult`, `decision.editedAnswer` on a SYNTHESIS phase) stay REST/MCP: the group `approval-status` exposes neither whether `review.allowResultEdits` is on nor the results to edit, so the Manager cannot offer it honestly.
* `member_tool_call` (group streams) carries only the tool name, so group lines cannot use `toolDisplay`.
* The Chat UI remains read-only on a pause (no approve/edit for end users).
* The operator chat's `onDecide` wrapper drops the banner's `review` argument, so a reason code picked on an operator approval card is not sent. Left as is: the operator's resume path is security-reviewed and this change stays UI-only there.

***

## 🐛 fix(cluster): presence age on this node's clock; drain key and duplicate cleanup (2026-11-06)

**Repo:** EDDI (`fix/cluster-presence-clock`)

### What changed and why

**Presence ages are measured on this node's own clock (OPS-1).** The presence watch stamped each record with the NATS server's write time and expired it against this node's wall clock after the 30 s bucket TTL. A node whose clock ran about 20 s ahead therefore dropped every member between two rewrites, and `members()`, `currentMembers()` and the RPC peer list came back empty. Four staleness checks compared another node's `updatedAt` with this node's clock against two presence intervals (20 s): the drain `LAST_NODE` guard, the drained node's own check of a drain request over RPC, the overview's `STALE` card, and the watcher's `node.stale` entry. Skew above about 10 s was enough to refuse a legitimate drain or to report a live node as stale.

`ClusterPresence` now records, for each record, the revision it saw and when it saw that revision on its monotonic clock. Expiry uses that time, and the new `heartbeatAgeMillis(nodeId)` reports it. The four checks use that age. A record that was already in the bucket when this node started looking (the watch's initial values, the first bucket read, or a read more than one TTL after the previous one) was written at an unknown moment, so it has no age until it is rewritten. The drain guards count such a node as not serving, so they refuse rather than drain the last live node. The overview shows it `LIVE` with the age its own timestamp gives, and the watcher does not report it. `updatedAt` stays in the record and in the overview as `lastHeartbeat`, for display only. `node.stale` is still keyed by `updatedAt`, so every node's report of one stale record collapses into one entry.

**The drain key of a decision being applied survives the node's own key sync (OPS-9).** `drain()` opens `gate.drain`, writes `drain.<node>` and then asks the node over RPC. If the node's scheduled `syncOwnDrainKey` ran in between, it saw a key for a node that was not draining yet and deleted it. The node then refused the request as "not recorded", and the administrator got `409 NODE_FAILED`. The sync now reads the key's revision first, then skips the delete while the drain gate is held, and deletes only at that revision. A key written after the read is either covered by a gate the check sees or carries a newer revision, and the conditional delete then fails. The drain flag is read again just before the delete, so a drain applied on the node while the sync ran — the gate already closed again after the reply — keeps its key too. A leftover key from a drain that a restart ended is still removed on the next sync.

**Dead code (OPS-18).** `ClusterPresence.duplicateDetail()` had no caller; the same detail is in the ERROR log. `KvLeaseManager.snapshot(prefix, max)` listed `max * 2 + 16` entries before filtering by prefix, so a real prefix could miss matching leases. Its only production caller passed `""`, so it is now `snapshot(max)`. `heartbeatAll()` is kept: nine tests use it.

**Tests (OPS-20, the presence part).** Skewed-clock tests for presence expiry and heartbeat age, the drain guards, the overview and the watcher. The tests of the drain-key sync include one where the key is rewritten between the sync's read and its delete.

**Files:** [`ClusterPresence.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterPresence.java), [`ClusterAdminService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/admin/ClusterAdminService.java), [`ClusterWatcher.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/admin/ClusterWatcher.java), [`KvLeaseManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/lease/KvLeaseManager.java), [`coordinator-admin.md`](https://docs.labs.ai/deployment-and-infrastructure/coordinator-admin.md)

***

## ✨ feat(workforce): search my conversations, tool cards, and the tool notice before Edit and Regenerate (2026-11-06)

**Repo:** EDDI · **Branch:** `feat/conversation-search-tool-ui` (`feat/workforce-tier1-ux` with `feat/conversation-search-tool-events` merged in)

The rest of phase 7 of the frontend unification plan (`planning/frontend-unification-plan.md` §5, T1.3, T1.6 and T1.9), on the backend's B3 (`GET /conversationstore/conversations/search`) and B6 (the `tool_result` stream event). Frontend only.

### What changed and why

* **Search my conversations (T1.3).** A search box at the top of the Workforce sidebar's conversations ([`conversation-search.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/conversation-search.tsx)): a combobox whose results replace the date-grouped list while it holds text, **↑ ↓** and **Enter** to open, **Esc** to clear. A line under it says it searches **titles only** (tied to the box with `aria-describedby`), and a polite status says how many it found once a search settles, or that none matched, or that it failed (with Retry). [`use-conversation-search.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-conversation-search.ts) holds the request discipline: the text normalized as the backend stores titles and capped at `MAX_CONVERSATION_SEARCH_LENGTH` (also the box's `maxLength`), a 300 ms debounce, one `AbortController` per request (a new text aborts the old request, and a late answer is dropped), and **More results** until a page comes back empty — only an empty page ends the list, since the server drops unreadable rows from a page after paging, so a short page is not the end. A page whose matches were all left out here (member conversations) reads on by itself rather than saying that nothing matches. `searchConversations` takes an `AbortSignal` now (it uses the client's authenticated fetch; `api.get` takes no signal). Member conversations of a team session are left out, as in the list. The **⌘K quick switcher** adds the title matches it has not already shown, below the local ones, with the same "titles only" line.
* **No Manager surface.** The Manager's conversation pages list every user's conversations for an administrator, and its chat history one agent's; an owner-only title search fits neither, so search is Workforce only.
* **Tool activity as cards (T1.9).** A new entry, [`@eddi/conversation/tool-activity`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/tool-activity/index.ts): `ToolActivityLog` files each `tool_result` under its conversation and step (`beginTurn` from `onTurnStarting` empties the turn's step and every later, undone one; `clearStep` after a rerun, which has no stream; at most 50 calls per turn, the rest counted; 20 conversations). `ToolActivityCards` shows a turn's calls as one disclosure under its **question** — collapsed, "Tools used: 2 · 1 failed"; open, a card per call with the tool, whether it worked, and the summary. **The summary is a React text child, never markdown or HTML**: a test feeds it `<img onerror>`, `<b>`, `**…**` and a link and finds no element. The Manager/Workforce chat (`ChatPanel`, through `chatToolActivity` in `use-chat.ts`) and the member thread wire `@eddi/core/tool-events` into their controllers.
* **Live only.** The detailed snapshot holds the raw tool trace under `langchain:trace:*`, which the server redacts (`ToolTraceRedaction`) only on the way out through the stream and `task_complete`. Restoring cards from it would show unredacted tool results, so nothing is restored: a reload, a conversation opened later, or a turn answered without streaming shows no cards. A rerun (REST, no stream) clears its step's cards rather than leave the first run's.
* **The tool notice (T1.6).** `ChatPanel`'s `renderTurnNotice` now defaults to `ToolTurnNotice`: beside **Edit** and **Regenerate** of a last turn that ran tools, an inline warning names them ("Ran send\_email. Editing takes back the reply, not what the tools did." / "… What they did stays, and a new reply may run them again."), tied to the button with `aria-describedby`. A host's own `renderTurnNotice` still replaces it. After an Edit of such a turn, the same point is made once more as a toast, since the undo takes the warning off the screen with the turn. **An inline warning, not a confirm step:** the effects already happened, so a dialog cannot prevent anything; an Edit only puts the text back in the composer, and nothing runs again until the user sends; the warning is visible before the click (and before **↑**), where a confirm on every edit of every tool turn would train people to click through it.
* **The widget does not grow.** It is at 169.4 of 170 KB gz and shows no tool activity, so it imports neither the new entry nor `@eddi/core/tool-events`; a test reads `ui/chat/src` and fails if it ever does. Lazy-loading the cards into the widget was rejected: even the loader and the listener would cost bytes it does not have, for a surface the embedding contract never promised. `docs/chat-ui-embedding.md` is unchanged.
* **Strings.** `toolActivity.*` (10 keys) in the package's own locale files (`withToolActivityLocales`, merged by `setupAppI18n`), `Workforce.search.*` (12) and `Workforce.switcher.searchFailed` in Workforce's, all in the eleven locales. The tool strings are their own bundle rather than `conversation.*`: that namespace's English is bundled into the widget.
* **Platform Operator.** The prompt now says how Workforce and the Manager's chat show `tool_result` (cards, the notice, live only, none in the widget), which an admin asked about a missing card would need. No allow-list change. `operator-revision.json` stays at **56** (set by the merge, unreleased) with the new fingerprint.
* **Docs.** [`workforce-guide.md`](https://docs.labs.ai/protocols-and-integration/workforce-guide.md) (searching, what the agent's tools did, the warning on Edit and Regenerate, the keyboard table, two administrator notes), `ui/manager/AGENTS.md`, `ui/workforce/AGENTS.md`, the `@eddi/conversation` README.
* **Test fix.** The quick switcher's "filters … opens a chat with an agent" test read an agent row before the sessions loaded and filled the 30 rows; it now reaches the agent by name.

### Design decisions

* Titles only, as the backend decided (B3); the UI says so at every place it offers the search.
* Any non-empty page means "maybe more"; only an empty page ends the list. The backend drops rows from a page after reading it (a match whose memory is gone), so a short page is not the end — treating it as one hid later matches. The cost is one empty extra request at the end of a list.
* Cards go under the turn's question, so they read in the order things happened: the question, the tools it set off, the reply.

### Not done

* Restoring cards after a reload: needs a client-readable, redacted trace on the snapshot (a backend item).
* Tool cards for group discussions: the backend sends no `member_tool_result` yet.
* Searching outputs: the backend's follow-up (privacy review first).

***

## 🐛 fix(conversations): the chat panel resumes only the caller's own conversation (2026-11-06)

**Repo:** EDDI (`fix/conversations-mine-flag`)

### What changed and why

The Manager's chat panel opens an agent by resuming the newest `READY` or `AWAITING_HUMAN` conversation the listing returns. An administrator's listing holds **every user's** conversations, so an admin who opened an agent an end user had talked to more recently landed in that user's conversation, and the next message ran in it as that user: their tools, property writes and long-term memory. The admin passes the per-conversation ownership check, so nothing stopped it. The operator's "restore my last investigation" had the same shape: a fresh tab restored another admin's newest operator conversation, pending approval card included, and its History list showed and opened other admins' investigations.

The Manager cannot filter this by itself: a conversation's owner is the principal name the backend resolved, which the Manager does not reliably know. So the listing gained a flag:

* **`GET /conversationstore/conversations?mine=true`** lists only the caller's own conversations, for every caller: an administrator, and an agent's reviewer (who otherwise also sees that agent's conversations). The owner is pushed into the descriptor query as an exact match on `userId`, so a pre-v5.1.6 conversation that records no owner on its descriptor is left out, and the per-row check enforces the same, as it stays the authority over the query. The "search matches nothing, list everything" fallback is decided within the same set. Without a named caller, or with authorization disabled (a conversation then records the userId the client passed, not the principal, even when a token names the caller), there is no owner and the flag changes nothing. The default is `false`: existing clients are unchanged.
* **Manager:** the chat panel's resume and its history list (they share one cache entry, so they must ask the same question), the operator's restore and its History list all ask for `mine`. Browsing everybody's conversations stays on the Conversations page.
* **Operator polling:** the 1.5 s poll while a resumed turn settles slept through a helper that added an abort listener per call and never removed it, about 200 on one signal over the five-minute ceiling. It is now `lib/abortable-sleep.ts`, which removes its listener when the timer fires.
* **Operator History** sorts with `conversationRecency`, whose comment already claimed the list shared it; the list carried its own copy of the expression.

**Files:** [`IRestConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java), [`RestConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/RestConversationStore.java), [`conversations.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/api/conversations.ts), [`use-chat.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-chat.ts), [`use-operator-chat.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/hooks/use-operator-chat.ts), [`use-conversations.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/hooks/use-conversations.ts), [`operator-history.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/operator/operator-history.tsx), [`abortable-sleep.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/abortable-sleep.ts), [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md#the-conversation-store)

### Design decisions

* A server-side flag, not a client filter: only the backend knows the principal name it stamps as owner.
* Exact owner match, no "or unowned" alternative: a legacy conversation without a recorded owner is not "mine" to resume. Same semantics as the open "search my conversations" endpoint (#1307).
* The old eight-argument Java signature stays as a `default` overload (`mine=false`), so the MCP tool and the existing tests are unchanged.

***

## ✨ feat(parser): correct phrase search, match confidence, partial phrases and an embedding fallback (2026-11-06)

**Repo:** EDDI (`feat/inputparser-improvements`)

### What changed and why

A critical re-read of the input parser (`modules/nlp`) found defects that made it silently miss inputs its dictionaries covered, plus measurement it computed and threw away. Each defect below was reproduced before it was fixed, and each fix was mutation-checked (re-introducing the defect fails its test).

**Defects fixed**

* **The combination search skipped readings.** `IterationCounter` capped every token's match index by the *last* token's match count, so a token with more readings than the last one never had its alternatives tried (`[1,0]` produced 1 of 2 combinations, `[2,0,0]` 1 of 3) while out-of-range plans were generated and discarded. A typo in the first word of a phrase, whose phrase reading was a correction's second candidate, therefore never matched the phrase. Replaced by a complete best-first enumerator (increasing total rank, then lexicographic), linear per step, allocation-free; `Permutation` is gone.
* **A complete phrase match found after the first combination was appended behind worse solutions**, and the pipeline takes the first one. It now goes to the front.
* **Partial phrase matching never worked**: `lookForPartlyMatch` compared phrase words with *found* words (different classes, never equal) and mixed up the two lists' indexes. Rewritten, and opt-in — see below.
* **Quick replies were not normalized** like the input they are compared with: under the punctuation normalizer a click on `Yes, please!` arrived as `Yes , please !` and matched nothing.
* **Generated quick-reply expressions were ASCII-only** (`[^a-zA-Z0-9 ]`): `Größe` became `gre`, Cyrillic, Arabic or CJK quick replies an empty expression. Letters and digits of every script are kept now.
* **Phrases of a dictionary in another language were candidates** — phrases are matched by word value, so a `de` phrase could match in an `en` conversation once the English dictionaries knew its words.
* **A phrase assembled from typo corrections reported accuracy 1.0**; it is now as accurate as its least accurate word and counts as corrected.
* **The `/parser` endpoint skipped the normalizers**, so it answered for an input the pipeline never parses.
* `won't` normalized to "would not" (now "will not"); typographic apostrophes (`don’t`, as phones type it) were never expanded; 20 common contractions added.
* The email dictionary rejected top-level domains longer than four letters (`.technology`, `.online`).
* `toLowerCase()` without a locale in the nlp module (Turkish-locale JVMs).

**Performance** (none measured as a regression, all remove work per input token): `RegularDictionary.lookupTerm` returned one match per phrase containing a word plus a 0.9 copy of every exact hit (now one per distinct word, from an index built once) and checked case on a parallel stream over all keys; `Phrase.getWords()` re-split and re-allocated on every call (now cached); duplicate matches of one token are dropped before enumeration; `RawSolution` has content equality, so the solution list no longer fills with copies; without phrases, `parse` stops at the chosen reading plus `maxAlternatives` (`parseAllReadings` keeps the full list for the `/parser` endpoint); the Damerau–Levenshtein correction applies its length bound before lower-casing each dictionary word.

**New, all opt-in or diagnostic**

* `expressions:confidence` (accuracy of the least accurate contributing match), `expressions:inputTruncated` (input over `maxInputTokens`), and accuracy/corrected markers in `expressions:matches`.
* `minMatchingAccuracy` (default 0): matches below it contribute no expressions — "do not act on a guess".
* `maxAlternatives` (default 0, max 10): other readings as `expressions:alternatives`.
* `matchPartialPhrases` (default off) + `minPartialPhraseCoverage` (0.5): a fragment yields its phrase with accuracy = coverage; equally covered ambiguous fragments yield nothing.
* `semanticFallback`: when the dictionaries understood nothing, the input is compared by embedding similarity with example sentences (explicit, and by default the dictionaries' own phrases) and the best example at or above `minScore` (0.8) supplies its expressions. Reuses `EmbeddingModelFactory` (vault secrets, host allow-list, SSRF policy, cache). Examples are embedded once on first use; a provider failure is "no match" with a 60 s back-off; a malformed block fails the deployment. Metric `eddi.parser.semantic.fallback{outcome}`.
* **Vault grant enforcement now covers parser configurations**: `VaultGrantChecker` reads parser documents and scans every step's inline `config`/`extensions`, so a `${vault:…}` key in a parser's `semanticFallback` — stored or inline — is checked against the agent's grant like an LLM's.
* From review: a quick-reply phrase with the same text as a configured phrase now yields the quick reply's expressions (single quick-reply words already won); `UnrestrictedSecretsCheck` scans each string value with the linear reference scanner instead of one regex over the serialized document, where an unterminated `${vault:` in one field hid the reference in the next; the new counter is documented in [`metrics.md`](https://docs.labs.ai/deployment-and-infrastructure/metrics.md) and charted on the full-metrics dashboard ("Input Parser" row).
* From the second review (after merging main): a variable-store failure during the grant check's in-place `${vars:…}` expansion escaped to the catch-all that answers "no violations" — it now fails closed through the per-variable path; the semantic fallback reads the same token-limited input and the same effective language (default `en`) as the dictionaries, and an example with a language never matches a turn without one; `minMatchingAccuracy` takes part in choosing a token's reading (qualifying readings first, and readings of different accuracy are no longer collapsed); a complete phrase reading no longer cuts off the readings asked for by `maxAlternatives` / `parseAllReadings`; an ambiguous phrase fragment no longer suppresses unambiguous fragments elsewhere; the phrase index uses the same case-insensitive equivalence as the word map (Turkish dotted/dotless i), and the Damerau–Levenshtein length pre-check allows for lower-case expansion (`İ`).
* From the third review: a phrase or phrase fragment whose final accuracy is below `minMatchingAccuracy` is no longer taken (it outranked a qualifying word reading and then yielded nothing); the semantic fallback re-embeds its examples when the factory hands out a new model (changed variable or secret), so input and examples share one embedding space; an unsupported `embeddingProvider` fails the deployment; a parser that replaces an earlier result on the same step (`appendExpressions: false`) clears its confidence, alternatives and matches.
* From the fourth review: every occurrence of a phrase or fragment is judged against the threshold — a below-threshold first occurrence no longer hides a qualifying one later in the input.
* From the fifth review: the ambiguity check for fragments sees every qualifying fragment of every phrase, so a phrase's better fragment elsewhere no longer hides that its fragment at one position is contested.

**Files:** [`InputParser.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/internal/InputParser.java), [`IterationCounter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/internal/matches/IterationCounter.java), [`InputParserTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/InputParserTask.java), [`SemanticFallback.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/semantic/SemanticFallback.java), [`RegularDictionary.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/nlp/extensions/dictionaries/RegularDictionary.java), [`VaultGrantChecker.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/VaultGrantChecker.java), [`semantic-parser.md`](https://docs.labs.ai/agent-configuration/semantic-parser.md); Platform Operator prompt (revision 63).

### Behaviour changes for existing agents

Agents that relied on a defect parse differently: inputs whose phrase needed a non-first reading of an early token now match the phrase; a complete phrase match now wins over an earlier partial reading; quick replies with punctuation now match under the punctuation normalizer; `won't` expands to "will not". The pinned enumeration order in `IterationCounterTest` was an artifact of the old scheme and was replaced by the documented best-first order.

### What's next

* The Manager's parser editor has no form fields for the new keys yet (they work in the JSON tab).
* The `/parser` endpoint takes no language and does not consult the semantic fallback.

***

## 🐛 fix(hitl): crash recovery also recovers interrupted group discussions (2026-11-06)

**Repo:** EDDI (`fix/group-crash-recovery`)

### What changed and why

A group discussion whose node died mid-run stayed `IN_PROGRESS` (or `SYNTHESIZING`) for good. Its leg lives only in the JVM that ran it, the startup crash recovery deliberately skipped running group discussions, and `continue` and `followup` both require `COMPLETED`, so nothing but a manual cancel could end it. The sharpest case was a crash right after an approve: the approve CAS clears the pause bookmark in the same write that moves the discussion to `IN_PROGRESS`, so there was no pause left to restore either. Only a standing team's run had a backstop, the cadence claim TTL, whose default is 24 hours.

* **`HitlCrashRecoveryObserver`** — the single-node startup pass now scans `IN_PROGRESS` and `SYNTHESIZING` group discussions and cancels each one last written before the JVM started, through `IGroupConversationService.cancelDiscussion` (the ordinary cancel: state CAS, timeout schedule removed). It is gated on `eddi.hitl.crash-recovery.recover-in-progress`, like the regular IN\_PROGRESS recovery, and the WARN summary counts the cancelled discussions. The first start after the upgrade also cancels every discussion that was already stuck this way. A running-state cancel releases no ephemeral agents (no leg is left to); they go when the discussion is closed or deleted. The leader-elected cluster sweep (`runClusterRecovery`) is unchanged and does not cancel groups.
* **`GroupHitlCoordinator.resumeDiscussion`** — the approve resume now stamps `lastModified`, as the human-turn and tie-break resumes already did. Without it, a discussion paused before a restart and approved after it would carry the pre-restart timestamp into its new, live leg, and the recovery pass could cancel that leg.
* **Docs** — [`hitl.md`](https://docs.labs.ai/conversations-and-orchestration/hitl.md#crash-recovery) (crash recovery list, overlapping-JVM caveat), a new "Restarts" section in [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md#restarts), and the `recover-in-progress` row of [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md).

### Design decisions

* **Process start, not a timestamp taken in the observer.** The cut-off is the JVM start time (`RuntimeMXBean.getStartTime()`): nothing this process runs can have been written before it, whatever ran before the `StartupEvent` observer.
* **Cancel, not restore.** A resumed group leg keeps no bookmark, so there is no pause to put back; cancelling ends in a state the user can act on, and a standing team's next fire returns its pulled backlog tasks to `PENDING`.
* **Reuse `cancelDiscussion`** rather than a raw state write, so the transition is the CAS-guarded one a manual cancel makes.
* **Single node only.** In cluster mode a group discussion holds no conversation lease that could prove its leg dead; a cluster variant would need its own staleness rule and is left as a follow-up.

**Files:** [`HitlCrashRecoveryObserver.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/HitlCrashRecoveryObserver.java), [`GroupHitlCoordinator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupHitlCoordinator.java), [`HitlCrashRecoveryObserverTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/hitl/HitlCrashRecoveryObserverTest.java), [`GroupHitlCoordinatorTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/internal/groups/GroupHitlCoordinatorTest.java)

***

## 🐛 fix(groups): streaming continue binds the caller; MCP and templates enforce REST's checks (2026-11-06)

**Repo:** EDDI (`fix/group-rest-mcp-parity`)

### What changed and why

Three places where one surface of the group API did less than its sibling.

* **A streamed continuation ran without its caller.** `POST /groups/{groupId}/conversations/{id}/continue/stream` hands the round to `RestGroupConversation`'s own virtual-thread executor. Nothing carried the caller across, and on that thread the request scope is gone, so the member turns' `captureOrCurrent()` found nobody: every `${caller:userId}` and `${caller:token}` failed closed on this path alone. The caller is now captured on the request thread and bound around the work with `CallerIdentityContext.withIdentity`, the way `startAndDiscussAsync` already does for a streamed start. `CallerIdentityContext` is a new constructor parameter of `RestGroupConversation`.
* **The MCP discussion tools skipped the question ceilings.** REST re-checks by hand that a question is present and at most 50,000 characters, and that `userId` and `targetAgentId` are at most 256, because a question is fanned out to every member in every phase at the group owner's cost. An MCP tool calls the service in-process, where no Bean Validation constraint runs, so a caller with the CONVERSE role (`eddi-viewer` included) could send a multi-megabyte question, or start a discussion about nothing. The check now lives in `GroupQuestionLimits`, next to `GroupAttachmentLimits`, and `discuss_with_group`, `start_group_discussion`, `followup_with_member` and `continue_group_discussion` call it before any read, access check or service call, answering `{"error": …, "errorCode": "BAD_REQUEST"}`. REST calls the same class, so both surfaces refuse the same input with the same text. The constants stay on `IRestGroupConversation`.
* **Creating a group from a template turned an access refusal into a 500.** `POST /groupstore/templates/{id}/instantiate` saves through `IRestAgentGroupStore.createGroup`, which throws `ForbiddenException` for an assigned agent the caller may not use. The generic `catch (Exception)` logged it as an error with a stack trace and answered `500`. A `ForbiddenException` or a JAX-RS `WebApplicationException` is now rethrown, as `RestTeamHandoffs` and `RestGroupWorkspace` do, so the caller gets the `403` (or the store's own status). The MCP side had the same fault: `create_group_from_template`, and every other group tool that ends in `McpGroupTools.failure` (`create_group`, `update_group` and the rest), answered the store's `ForbiddenException` with an `INTERNAL` reference and a logged stack trace. `failure` now answers it with `"errorCode": "FORBIDDEN"` and the guard's text, through the shared `McpToolUtils.accessRefusal` that `toolFailure` already uses.

The Javadoc on `budgetRefused` said the team-budget refusal "carries no caller-supplied id". It does carry the group id: the stored one, already resolved by the group read that precedes admission, and needed by the administrator `PUT` path in the exhausted message. The comment now says that.

### Design decisions

* **Bind at the dispatch, not in the service.** Moving the async dispatch into `GroupConversationService`, or running the SSE method inline on a virtual thread, would also fix it, but would change when the SSE response is committed. Capturing before `submit` is the established pattern and a two-line change.
* **One check class, not a public static on the REST resource.** The MCP tools are in another package; making `RestGroupConversation.rejectionReason` public would have the MCP layer depend on a JAX-RS resource. `GroupQuestionLimits` reads the ceilings from `IRestGroupConversation`, so nothing is duplicated.
* **List limits not clamped.** The plan also suggested clamping `limit` in `list_groups` and `list_group_conversations`. REST takes the same unbounded `limit`, and both are bounded by the storage layer's `MAX_RESULT_LIMIT` (10,000), so this is not a check REST makes and MCP skips. Left for a change that bounds both surfaces together.

**Files:** [`RestGroupConversation.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestGroupConversation.java), [`GroupQuestionLimits.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupQuestionLimits.java), [`McpGroupTools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpGroupTools.java), [`RestGroupTemplates.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/rest/RestGroupTemplates.java), [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md); tests in `RestGroupConversationExtendedTest`, `McpGroupToolsTest`, `RestGroupTemplatesTest`, and the constructor update in the other five `RestGroupConversation*Test` classes.

***

## 🐛 fix(manager): per-slot agent creation in the group wizard cannot overwrite or orphan agents (2026-11-06)

**Repo:** EDDI (`fix/group-wizard-slot-create`)

### What was wrong

"Create Agent" on a member card of the Group Setup Wizard provisions and deploys that agent while the person keeps working. Its write-back rebuilt the whole member list from the render in which the button was clicked, by index. So with two cards created at once, whichever finished second set the other card back to "not created" (its agent id gone), and the final Create then provisioned and deployed a second agent for that card. The first stayed deployed with nothing pointing at it. An edit to another card made while one was provisioning was reverted, and removing a card above a provisioning one shifted the indexes, so the new agent was written into the wrong card. The moderator's write-back spread the moderator as it was at the click, reverting edits made meanwhile.

Three more ways in: the final Create stayed enabled while a card was still provisioning (provisioning that card a second time); a card's Remove and type toggle stayed enabled while its own agent was being created; and during the final Create, Back and the step indicator still worked, so the person could edit members that the Create then overwrote with its own click-time copy. While a card was provisioning they worked too, and picking a preset on the first step replaced every card, so the new agent had no card left to be written back to.

### What changed

* [`group-wizard.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/group-wizard.tsx): every member slot carries a stable client-side `id` (a module counter, not `crypto.randomUUID()`, which is missing outside a secure context; it is never sent, since the save maps slots to `GroupMember` field by field). The wizard's `update` also accepts a function of the current state, and every member and moderator write in the Members step goes through it, keyed by id. Cards are keyed by id. The final Create is disabled (and `handleCreate` returns) while any card is provisioning; a card's Remove and type toggle, and the moderator's Remove, are disabled while that agent is being created; Back and the step buttons are disabled during the final Create and while any card or the moderator is provisioning. The per-slot buttons get `gw-create-agent-<n>`, `gw-create-moderator`, `gw-add-moderator`, `gw-remove-moderator`, `gw-moderator-prompt`, `member-created-<n>` and `moderator-created` test ids (the tests select by them, not by translated copy).
* [`create-group-dialog.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/groups/create-group-dialog.tsx): removed the `selectedTemplate` state, whose value was never read.
* New [`group-wizard-slot-create.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/pages/__tests__/group-wizard-slot-create.test.tsx): seven cases (two cards at once, an edit and a removal during provisioning, the locked controls, navigation locked while a card provisions, a moderator edit across a failed create, navigation locked during the final Create). Each fails on the previous code.

### Design decisions

* **Functional updates over a ref to the latest state.** A ref would also fix the stale read, but writes would still race each other between renders; a `setState` updater always applies to the state React holds.
* **Lock navigation during the final Create rather than make its write-back id-keyed too.** The review step renders no editors, so once Back and the steps are locked nothing can change the members under it, and its retry-safety logic stays as it is.
* **Lock navigation while a card provisions rather than only the preset step.** Only the preset step can replace the cards, but it is two Back clicks away; one lock on Back and the steps, held for the few seconds a create takes, is simpler than guarding each preset button.

***

## 🔧 fix(llm): an `ai.labs.apicalls` step is offered to the LLM as tools, and neither API-call step name is "legacy" (2026-11-06)

**Repo:** EDDI (`fix/httpcalls-step-alias-tools`)

### Why

The API-call step has two names. `eddi://ai.labs.httpcalls` is the task's own id (`ApiCallsTask.ID`), and `V6RenameMigration` keeps that step type on purpose. `eddi://ai.labs.apicalls` is an alias that `ApiCallsModule` registers for the same task. `LlmModule` registers `ai.labs.langchain` for `ai.labs.llm` the same way. Both names run in the pipeline.

Tool discovery did not treat them alike. `WorkflowTraversal.discoverConfigs` compared the step type string literally, so an agent whose workflow typed its API-call step `eddi://ai.labs.apicalls` ran that step but never offered its calls to the LLM as tools. Nothing logged it. The same literal match hid a `langchain`-typed step from `TurnBudgetValidator`.

The Manager made it look deliberate: its pipeline view labelled the canonical `ai.labs.httpcalls` "API Calls (legacy)" and the alias "API Calls", which is the wrong way round.

### What changed

* `WorkflowTraversal`: there is a new `STEP_TYPE_ALIASES` map (`apicalls` → `httpcalls`, `langchain` → `llm`, matching the bootstrap modules' alias registrations) and a `canonicalStepType` helper. Discovery compares canonical names on both sides and keys its cache by the canonical name, so asking for an alias and asking for its target share one traversal. This covers HTTP-call tools, MCP tools, RAG and the turn budget check, since they all go through it.
* Manager `extensions.ts`: both names are labelled "API Calls", and the canonical name sorts first. The `extensionTypes.httpcallsLegacy` key is removed from all 11 locales.

### Behaviour change for existing agents

An existing agent whose workflow types its API-call step `eddi://ai.labs.apicalls` now has those calls offered to the model as tools, because `enableHttpCallTools` defaults to `true`; before this change they ran in the pipeline but were never exposed. Set `enableHttpCallTools: false` in the agent's `langchain.json` (or remove the calls you do not want exposed from the step's httpcalls configuration) to keep the old behaviour. The upgrade guide ([Changes after 6.7.0](https://docs.labs.ai/deployment-and-infrastructure/upgrading-from-6.5.md#changes-after-670)) says the same.

### Tests

`WorkflowTraversalTest` has a parameterised test that discovers a step typed with either name when asked for the other, plus the `langchain` → `llm` case, and a test that an alias never matches a different type. Mutation check: putting the literal comparison back fails all 3 alias cases.

### Next

The Workforce Active Tools panel (#1294) mirrors the backend's old exact match and leaves out `apicalls`-typed steps. Once this lands it should list them too.

***

## 🐛 fix(import): a refused merge update fails the import instead of creating a duplicate (2026-11-06)

**Repo:** EDDI (`fix/import-merge-refusals`)

### What changed and why

* **A store that refuses a merge update now fails the import.** `RestImportService.updateTracked` returned `null` on any non-200 answer, and every caller then created the resource instead. Only two stores answer a refusal rather than throwing — `RestDictionaryStore.updateRegularDictionary` (a regular expression that does not compile) and `RestApiCallsStore.updateApiCalls` (batch settings over the deployment ceiling) — and for both the fallback went through `createResourceDirect`, which runs neither check: the refused document was stored as a second resource with the archive's origin id, and the workflow was pointed at the copy. `updateTracked` now throws a `WebApplicationException` carrying the store's own response (its `400` and body reach the client), or a `500` for no answer or a non-error status; the import's existing rollback undoes what the merge had already written, and a `WARN` line names the refused resource.
* **The dead fallbacks are gone.** Every other store updates through `RestVersionInfo.update`, which answers 200 or throws, so the `updated != null ? updated : create…` branches for agents, workflows, parsers, behavior, LLM, property, output, MCP calls and RAG (with its second `applyStorageRulesToNewRag`) could never run. The snippet merge no longer "falls through to create" a second snippet of the name it had just matched; a refused snippet update costs that snippet, like any snippet failure.
* **Live sync takes only a resource id as `sourceAgentId`.** `RemoteApiResourceSource.readAgent` concatenated the id into the request path, and resolving that against the source URL normalised `../` away — an id like `../../backup/export/x` read another path on the source with the caller's token. `previewSync`, `executeSync` and both batch endpoints refuse anything `RestUtilities.isValidId` rejects with a `400` (a failed entry in a batch) before a request is sent, and `readAgent` encodes the id as one path segment, as `exportAgentArchive` already did.
* The Javadocs of `RestApiCallsStore`, `RestLlmStore`, `RestMcpCallsStore` and `RedactionMarkerGuard` that described the fallback as intended are rewritten.

### Docs

[`import-export-an-agent.md`](https://docs.labs.ai/getting-started/import-export-an-agent.md) (when a merge fails part-way) and [`agent-sync-guide.md`](https://docs.labs.ai/conversations-and-orchestration/agent-sync-guide.md) (the `sourceAgentId` parameter).

### Tests

`RestImportServiceMergeSharedExtensionTest` (refused dictionary and httpcalls updates fail the merge with the store's answer, roll back, and create nothing; a non-error or missing answer is a `500`), `RestImportServiceSnippetResilienceTest` (a refused snippet update creates no duplicate and does not fail the agent), `RestImportServiceSyncCoverageTest` (a crafted `sourceAgentId` is a `400` on preview, sync and both batches, with no request sent), `RemoteApiResourceSourceTest` (the id never leaves `/agentstore/agents/`). Each failed on `main` and was mutation-checked.

**Files:** [`RestImportService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RestImportService.java), [`RemoteApiResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RemoteApiResourceSource.java)

***

## 🐛 fix(ingestion): fetchable crawl URLs, bounded markdown prefixes, at-block hiding rules (2026-11-06)

**Repo:** EDDI (`fix/ingestion-html-and-crawl`)

### What changed and why

Three ingestion defects from the whole-codebase review.

* **A link with a raw space was never fetched.** jsoup resolves `href="my doc.html"` without encoding the space. `CrawlUrls.canonicalize` already encoded it for the document id, but the crawler fetched the raw `abs:href`, and `SafeHttpPageFetcher`'s `URI.create` refused it. The page became an inconclusive error on every run, which also kept deletion reconciliation from ever running for the source. The new `CrawlUrls.fetchable` strips the fragment and encodes through the same tolerant parser (an already valid URL comes back byte-identical); `WebCrawler` uses it for links and for sitemap URLs, including for the `MAX_LINK_LENGTH` bound and the frontier cost. A URL that still does not parse is skipped instead of queued to fail.
* **Nested blockquotes and lists cost the square of their depth.** A blockquote renders into its own buffer and copies every line out behind `>` ; a list item nested through another element (`li > div > ul`) is re-indented by every enclosing item. Neither budget of the walk counts those prefixes, so a 240 KB mail quoted ninety levels deep allocated 340 MB. `HtmlToMarkdownConverter` now caps the stack of such prefixing containers at `MAX_PREFIXED_NESTING = 8` per conversion (counted on the per-conversion `Walk`, so the converter stays stateless); deeper ones are written in place without their marker. Output up to eight levels is unchanged.
* **A hiding rule inside `@media screen` evaded the mail hidden-content pass.** `HiddenStylesheetRules` skipped every at-block, so `<style>@media screen{.x{display:none}}</style>` hid text from every reader and still sent it to the model. Blocks that hold on every screen — `@layer`, `@supports`, and `@media` with no query, `all`, `screen`, `only screen` or `not <other type>` — are now entered and their rules read like top-level ones. Entering continues the same forward scan (the block's closing brace is skipped like a stray one), so nesting costs no recursion and the pass stays linear. Viewport and device queries (`(max-width:600px)`, `prefers-color-scheme`), `print`, `@container` and the like stay skipped, because responsive mail hides one copy there and the other copy everywhere else.

### Design decisions

* The crawl fix encodes the URL to fetch rather than fetching the canonical id: the canonical form lowercases the host, drops tracking parameters and folds `index.html`, and the server should get the URL the page linked to.
* The markdown cap bounds stacking instead of rewriting the output model to stream prefixes; eight levels keep every real document intact.
* At-blocks are entered in place instead of collected onto a work list and re-read, which is simpler and needs no depth cap. A feature query that holds everywhere (`(min-width:0)`) is still skipped; the class Javadoc and [`security.md`](https://docs.labs.ai/security-and-compliance/security.md) say so.

**Files:** [`CrawlUrls.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/crawl/CrawlUrls.java), [`WebCrawler.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/crawl/WebCrawler.java), [`HtmlToMarkdownConverter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/HtmlToMarkdownConverter.java), [`HiddenStylesheetRules.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/HiddenStylesheetRules.java), [`security.md`](https://docs.labs.ai/security-and-compliance/security.md), and their tests.

***

## 🐛 fix(managed-conversations): one claim path for the user-conversation mapping (2026-11-06)

**Repo:** EDDI (`fix/managed-conversation-claims`)

### What changed and why

A managed conversation is one conversation per intent and user, held by a `UserConversation` mapping with a unique (intent, userId) key. Two requests that both need a new conversation (none yet, or the current one has ended) each start one and each try to store the mapping. The REST endpoints and the MCP `chat_managed` tool handled that race differently, and both badly:

* **REST, ended conversation** (`RestAgentManagement`): the replace deleted the mapping unconditionally. A slower request deleted the fresh mapping a faster one had just stored, so the two clients went on talking to two different conversations; or its insert collided and the request failed with an opaque `500`.
* **REST, no mapping yet**: the loser re-read the winner, but left its own started conversation running with nothing pointing at it.
* **MCP `chat_managed`** (`McpConversationTools`): a lost insert fell into the generic catch and answered "Failed to chat via managed agent", again leaving the started conversation running. A store failure on the mapping read was swallowed as "no mapping", so a database hiccup started a second conversation and orphaned the user's real one. An agent that was not deployed yet answered a generic failure where REST answers `503` with `Retry-After`. And it always took the trigger's first deployment, where REST picks one at random.

Now there is one claim path. `IUserConversationStore.createOrAdopt` stores the candidate mapping or, on a duplicate key, returns the mapping that won (a store error if that one is gone again by the time it is read). Both callers use it, end the conversation they started whenever it is not the one returned (best effort, logged on failure), and replace an ended mapping with `deleteUserConversationIfMatches`, so a delete only removes the mapping while it still names the ended conversation. This is the pattern the Slack, webhook and email channels already followed. MCP now lets a mapping-read failure surface, answers a not-ready agent with `"errorCode": "UNAVAILABLE"`, and picks a random deployment like REST.

`RestAgentManagement` also takes `SecurityIdentity` and `OwnershipValidator` through its constructor. The `{userId}` ownership check used to run only `if (ownershipValidator != null)`, a guard that turned itself off when its dependency was missing, and the three test classes set both fields by reflection (two of them never set the validator, so they ran with the check off). The check is now unconditional and the tests pass both through the constructor.

**Behaviour changes:** a REST request that loses the replace race is served on the winner's conversation instead of failing with `500`; `chat_managed` answers the same race with the winner's reply, a not-ready agent with `UNAVAILABLE`, and spreads new conversations across a trigger's deployments. A conversation a request started but could not claim is ended (MCP records `system:lost-create-race` as who ended it). This holds on both stores, whether the claim fails with a checked `ResourceStoreException` (how PostgreSQL reports a failed read or write) or with an unchecked driver exception (how MongoDB, the default backend, reports a timeout or a write error other than a duplicate key).

**Files:** [`IUserConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/triggermanagement/IUserConversationStore.java), [`RestAgentManagement.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentManagement.java), [`McpConversationTools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpConversationTools.java), [`managed-agents.md`](https://docs.labs.ai/conversations-and-orchestration/managed-agents.md), [`mcp-server.md`](https://docs.labs.ai/protocols-and-integration/mcp-server.md)

**Not changed:** `EmailInboundProcessor` and `OpenAiConversationBridge` keep their own copies of the adopt-and-end logic; moving them onto `createOrAdopt` is a follow-up.

***

## Manager: dialog bodies no longer touch the dialog border (2026-11-06)

**Repo:** EDDI (`ui/manager`) · **Branch:** `fix/manager-dialog-body-padding`

**What changed.** The "This agent is not granted its vault keys" dialog showed its title bar with padding but its body flush against the dialog's left and right border: the key notice box, the "Add … to the grant?" question, the "allow every agent" checkbox and the footer buttons all sat on the edge.

**Root cause.** `AccessibleDialog` (`ui/manager/src/components/ui/accessible-dialog.tsx`) pads only its own header (`p-5`); the content slot is rendered edge to edge on purpose, so full-bleed bodies (the version diff editor, toolbar strips) can reach the border. Every caller is expected to pad its own content, and 13 of the 18 call sites do (`p-5`, a few `p-6`). Five did not:

* `ui/manager/src/components/secrets/grant-required-dialog.tsx` (the reported dialog)
* `ui/manager/src/components/feedback/ratings-table.tsx` (internal-note dialog)
* `ui/manager/src/components/quotas/team-budget-dialogs.tsx` (adjust-cap and transfer dialogs)
* `ui/manager/src/pages/user-conversations.tsx` (Create Binding dialog)

Each now wraps its body in `p-5`, matching the header. The convention is written into the `children` doc comment of `AccessibleDialog`.

**Design decision.** Fixed at the call sites, not in the primitive: padding the content slot by default would double-pad the 13 dialogs that already pad themselves and break the full-bleed ones. The shared `AlertDialog` pads its whole content (`p-6`) and was fine; the hand-rolled modals and sheets were audited and each pads its own sections. The Chat UI has one inline confirm strip, which is padded.

***

## fix(manager): every workflow step opens in the Agent Studio, and a denser pipeline list (2026-11-06)

**Repo:** EDDI (`fix/studio-step-editors-and-polish`)

### Why

Selecting an `eddi://ai.labs.httpcalls` step in the Agent Studio showed "Editor not available for this extension type". That is the API-call task's *canonical* step type (`ApiCallsTask.ID = "ai.labs.httpcalls"`; `ai.labs.apicalls` is the alias), so an agent with thirty API-call steps had thirty uneditable stages. The same happened to steps still typed `ai.labs.langchain` (registered by `LlmModule` as an alias of `ai.labs.llm`).

**Root cause:** the Studio resolved step → editor through its own partial type table (`EXTENSION_TO_SLUG` in `editor-registry.tsx`), while the workflow page resolved the same step by the store segment of its config URI (`workflow-step-links.ts`, with a third copy of the store table) and the add-extension dialog and orphans page used a fourth (`EXTENSION_TO_RESOURCE_SLUG`). The Studio's copy lacked both aliases.

### What changed

* **One resolution path.** `getResourceSlugForStep` in [`ui/manager/src/lib/api/extensions.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/api/extensions.ts) decides by the config URI's store segment (`apicallstore` → `apicalls`, through `RESOURCE_TYPES` and the new `getResourceTypeByStore`), and only falls back to the step type for a URI without that shape. The Studio uses it; `EXTENSION_TO_SLUG` is gone; `workflow-step-links.ts` reads the same store table instead of its own copy. `ai.labs.langchain` was added to the type tables.
* **Store-less steps get an informative state instead of a warning.** Templating explains what it does; a parser with an embedded config shows that config read-only; a step of a store-backed type with no URI says to attach a resource; an unknown type shows its stored config read-only. Each links to the workflow page (`/manage/workflowview/:id?version=N`), where steps are attached and inline configs are edited.
* **Pipeline list (`pipeline-railroad.tsx`).** Compact rows with the pipeline position, the resource's descriptor NAME (read per resource through the descriptor store, shared cache key with the parser editor), the id in the tooltip; consecutive steps of one type are grouped under one header with a count; the connector lines and per-card gaps are gone; the type label now comes from the shared `extensionTypes.*` labels, so it matches the workflow page.
* **Studio chrome.** Pipeline header with a step count and proper padding, larger workflow switcher, wider default pipeline column (288px), editor panel padded `px-6 py-5`, the shared `EmptyState` for "select a stage", the chat toggle as a `Button` with an `aria-label`.
* **i18n.** New `studio.inlineConfig` and `studio.stepInfo.*` keys in all 11 locales; the unused `studio.type.*`, `studio.noConfig` and `studio.unsupportedType` keys were removed.

### Step types and how the Studio handles them

| Step type (backend registration)                                     | Handling                                                            |
| -------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `ai.labs.httpcalls` (ApiCallsTask.ID), `ai.labs.apicalls` (alias)    | API Calls editor (`apicallstore`)                                   |
| `ai.labs.behavior` (RulesEvaluationTask.ID), `ai.labs.rules` (alias) | Rules editor                                                        |
| `ai.labs.llm`, `ai.labs.langchain` (alias)                           | LLM editor                                                          |
| `ai.labs.property`                                                   | Property Setter editor                                              |
| `ai.labs.output`                                                     | Output editor                                                       |
| `ai.labs.mcpcalls`                                                   | MCP Calls editor                                                    |
| `ai.labs.rag`                                                        | RAG editor                                                          |
| `ai.labs.parser` with a URI / with an embedded config                | Parser editor / read-only inline config + link to the workflow page |
| `ai.labs.templating`                                                 | Explanation (no config of its own) + link                           |
| anything else                                                        | Read-only stored config + link                                      |

### Decisions

* The URI's store wins over the step type: it names the store the task really reads, whatever spelling the workflow carries. Not editing a parser's inline config in the Studio itself — that needs a workflow-document save, which the Studio's cascade does not do; the workflow page does.
* The "API Calls (legacy)" label for `ai.labs.httpcalls` is untouched (being decided separately); the pipeline list now shows it, as the workflow page already did.

### Verification

`npm run lint`, `npm run typecheck`, `npm run i18n:check` clean; Studio, editor-registry, extensions, workflow, i18n and page suites pass. Mutation check: removing the store lookup from `getResourceSlugForStep` fails the httpcalls/store tests. Checked in the browser against the MSW mock with a 20-step pipeline.

***

## test(operator): CI activates the Platform Operator against a real backend (2026-11-06)

**Repo:** EDDI (`test/operator-activation-e2e`)

### Why

6.7.0 shipped with Platform Operator activation broken: `POST /administration/agents/setup-api` refuses a `systemPrompt` over `AgentSetupService.MAX_SYSTEM_PROMPT_LENGTH` (100,000), and the operator prompt had grown to \~110,000 characters, so every fresh activation and every upgrade answered `System prompt is too long (109661 characters, maximum 100000) (HTTP 400)`. Every operator test until now ran on MSW, and none ever sent the real prompt to the real endpoint. This entry adds the test that would have caught it, and the cap fix it needs to pass (the separate cap-fix PR, #1290, was closed unmerged).

### What changed

* **New Playwright tier `operator`** (`ui/manager/e2e/operator/operator-activation.operator.spec.ts`, `npm run test:e2e:operator`). It activates the operator through the Manager the way an administrator does, then checks every stage of the real path: the spec pre-flight (`findMissingEndpoints`, `findUnusableEndpoints`), the platform base URL prefilled from `GET /administration/operator/self-url` and recorded as `apiBaseUrl`, provisioning through `setup-api` with the real prompt and allow-list, deploy, `verifyGateInstalled` and the gate dry run (`operator-gate-verified`), the read canary (no `operator-canary-warning`), the write canary (its `canary-result` report must say `pass`), and a chat turn whose tool call must come back with data.
* **A deterministic model.** `ui/manager/e2e/operator/llm-stub.mjs` is a dependency-free OpenAI-compatible server (streaming and non-streaming chat completions, `/models`). It answers "list the agents" with a `readAgentDescriptors` call, the write canary's prompt with exactly the tool and id it names, and a tool result with `OPERATOR_E2E_TOOL_OK` — or `OPERATOR_E2E_TOOL_FAILED` for an `{"error": …}`, a 4xx/5xx or a `NOT_EXECUTED` schema refusal. Arguments are filled from each tool's own JSON schema. No paid provider, no key.
* **`ui/manager/docker-compose.integration-operator.yml`**, an overlay on `docker-compose.integration.yml` that adds the stub as `llm-stub` (`node:26.13.0-alpine`, the script mounted read-only); `npm run infra:up:operator` / `infra:down:operator`. The `ui` project ignores `e2e/operator/`, and `eslint.config.js` exempts it from the "import `test` from ./fixtures" rule, as it does the other real-backend tiers. The tier runs with no retries: a retry would meet the operator the first attempt activated and report that instead of the real failure.
* **CI job `Operator Activation E2E`** (`e2e-operator` in `ci.yml`), on the image built from the commit like `Auth E2E`, whenever `code` changed — so every PR touching the backend or `ui/`. It feeds `E2E Gate` and is a `needs` of `docker`, so a commit whose operator cannot be activated is never published. `BuildQualityGatesTest`'s "docker needs everything the gate grades" check covers the new job without a change.
* Docs listing the CI jobs: root `AGENTS.md` (Key Files), `CONTRIBUTING.md`, `ui/manager/CONTRIBUTING.md`, `ui/manager/AGENTS.md` (Platform Operator), `docs/release-versioning.md` (the `docker` needs list) and the ship-pr skill.

### Verified locally

* Against the released `labsai/eddi:6.7.0` image and the Manager it bundles: **fails** with `Operator activation failed: System prompt is too long (109661 characters, maximum 100000) (HTTP 400)`.
* Against an image built with the cap raised to 250,000, with this branch's Manager: **passes** (about 18 s).
* Mutation checks against that image, each failing by name: an allow-list entry the spec lacks (`This deployment does not expose 1 endpoint(s) …`); `EDDI_SELF_BASE_URL=http://127.0.0.1:9` (the read canary's "could not connect to the platform API at <http://127.0.0.1:9>"); and provisioning without `hitlConfig` (`The approval gate could not be verified … hitlConfig is absent`).

### The setup-api prompt cap

* **`AgentSetupService.MAX_SYSTEM_PROMPT_LENGTH` 100,000 → 250,000.** The cap bounds a `systemPrompt` that reaches `setup` / `setup-api`, including one an LLM writes through `create_sub_agent` (storage growth, log noise); it is not a prompt-cost control. The operator prompt the Manager sends is \~110,000 characters for `read_write`, and grows every release; 250,000 gives it room and still bounds an LLM-authored prompt. Raising the cap rather than trimming reviewed safety and tool instructions keeps the prompt unchanged (no revision bump for it); shortening the prompt is still worth doing, since it is sent on every operator turn.
* **The Manager mirrors the cap** as `SETUP_MAX_SYSTEM_PROMPT_LENGTH` in `ui/manager/src/lib/api/agent-setup.ts`. The new backend `SetupPromptCapMirrorTest` reads that file and fails when the two values differ.
* **New `ui/manager/src/lib/operator/__tests__/operator-prompt-size.test.ts`** builds the exact prompt `provisionOperator` sends, for both scopes (`read_write` grants every endpoint, so every optional section is in) and the longest brand name the validator allows, and fails above 80% of the cap. The headroom is the point: the guard should fire on a feature branch, a release before the cap would.

### Fixed on the way

The first green run surfaced three defects in what activation provisions. The tier now asserts each of them.

* **The operator prompt failed its template render on every turn (revision 60 → 61, landing as 63).** The backend renders `systemMessage` with Qute, and the forEach entry in the prompt's apicalls section was written `forEach {pathToTargetArray (…, required), iterationObjectName …}`. Qute read that as an expression and could not parse it. Every operator turn logged `ERROR … Template processing failed for LLM parameter 'systemMessage'` and sent the raw prompt, and every deploy reported `TEMPLATE_DOES_NOT_PARSE`. The line now lists the fields in prose. With that fixed, the render still failed on the next one: `eddi_email_outbound_total{outcome: sent, …}` reads as the namespace `outcome:` (`No namespace resolver found for [outcome]`), which a parse alone does not catch. It is now written with the label in parentheses. Both scopes now parse and render. The revision bump is what tells existing deployments to upgrade.
* **The compatibility check reported a false `TEMPLATE_DOES_NOT_PARSE`.** `LlmTask` wraps `${vault:…}`-style mentions in raw sections before rendering an LLM parameter (`escapeConfigReferenceMentions`), but `AgentCompatibilityLint` parsed the raw text, so a prompt that only *mentions* the syntax (the operator's tells the model to store keys as `${vault:key-name}`) was reported on every deploy. New `CompatibilityRules.scanLlmTaskTemplates` checks a task's `parameters` as they render. The rest of the task is still checked raw, because it renders without that escape. `escapeConfigReferenceMentions` is now public for it.
* **Optional query parameters were required tool arguments.** `McpApiToolBuilder` marked every query parameter required, defaults included, so `readAgentDescriptors` made the model invent `filter`, `index`, `limit`, `ownership` and `space`. A query parameter is now required only when the spec says so. New `Request.optionalQueryParams` (null by default, so stored configs are unchanged) lists the others, and `ApiCallExecutor.buildRequest` leaves one off the request when its value renders empty instead of sending `?limit=`. The approval preview, the request fingerprint and the execution all go through `buildRequest`, so request pinning sees the same request that is sent. Side effect: an endpoint that needs a query value its spec does not mark required (`duplicateRag`'s `version`) now answers the model with its own 400 instead of being forced. A path parameter stays required even when an optional query parameter of the same name shares its tool variable (review finding; regression test `pathParamSharingNameWithOptionalQueryStaysRequired`).
* **A repeated operationId dropped a tool.** `GET /groupstore/groups/{groupId}/lessons` and `…/outcomes` were both `list`. Tools register by name, so assembly logged `Tool name collision: http tool 'list'` and the operator never received one of two endpoints it had been granted. The two now have their own operationIds (`listGroupLessons`, `listGroupOutcomes`). `McpApiToolBuilder.uniqueToolName` also keeps names unique for any spec: the first operation keeps its operationId and a repeat takes its method-and-path slug, so a third-party spec can no longer lose a tool this way.

[HTTP Calls → Argument schema](https://docs.labs.ai/agent-configuration/httpcalls.md#argument-schema-for-llm-tools) and its field table now describe the requiredness rule, `request.optionalQueryParams` and the renaming of a repeated operationId.

Unit tests: `AgentCompatibilityLintTest` (vault mention not reported, a real error beside one still reported), `McpApiToolBuilderArgumentSchemaTest` (requiredness, `optionalQueryParams`, repeated operationIds, suffix fallback), `ApiCallExecutorTest` (an empty optional parameter is not sent, a supplied one and a non-optional empty one are). Mutation-checked: reverting each of the four fixes fails its test. The E2E checks the same things from outside: one distinct tool per allow-listed endpoint reached the model (read from the stub's `GET /__e2e/tools`, published on loopback port 8089), `readAgentDescriptors` has no required arguments, the operator's deployment status carries no `TEMPLATE_DOES_NOT_PARSE`, and no request reached the model with the prompt unrendered. The stub counts system prompts that still hold `{#if}` section tags: when its render fails, `LlmTask` only logs the error and sends the raw text. Restoring the `{outcome: …}` line fails that check with 5 unrendered prompts.

### Next

* Making `Operator Activation E2E` (or `E2E Gate`) a required status check is a repository-settings decision; only `Build & Test` and `CodeQL Analysis` are required today.
* The revision bump collided as expected: `main` reached 62 meanwhile, so the merge of `main` into this branch (2026-11-14) re-bumped to **63** with the fingerprint of the merged prompt, which still parses and renders in both scopes.
* **Follow-up, not in this PR:** the prompt still holds literal braces that Qute evaluates as variables and the runtime renders as empty — `{input}`, `{output}`, `{id}`, `{risk}`, `{cause}`, `{context}`, metric label sets such as `{reason="caller_timed_out"}` and `{provider,outcome}` (16 in the read\_write scope). They do not fail the render, so the model simply never sees that text. Escaping the prompt's literal braces at build time, with a test that renders it under the runtime engine's rules, is the fix.

***

## 🐛 fix(llm-tools): the tool-result guardrail screens the whole result before truncation; the summarizer honours a `${vars:...}` provider type (2026-11-06)

**Repo:** EDDI (`fix/tool-result-screening`)

### What changed and why

**The guardrail ran on the cut text, so everything past the cut was ungoverned (LLM-3).** `ToolLoopRunner` redacted secrets, truncated, and only then ran the tool-result guardrail. With `truncationStrategy: paginate` the whole remainder went into `PaginatedResponseStore` unscreened, and pages 2..N came back through `fetch_tool_response_page`, a built-in tool. Under the documented narrowing `directiveAppliesToSources: ["mcp", "a2a", "http"]` a built-in result is not screened for directives, so an instruction an MCP server placed after the first page reached the model unredacted, in an envelope that said `builtin`. The `summarize` strategy likewise sent the unscreened text to its summarizer model. The default configuration (an empty source list means every source) was not affected.

`ToolResultGuardrail.inspect` is split in two. `screen` runs the directive rule on the whole result and applies `warn`/`redact`/`block`; `mark` adds the provenance envelope. The runner now screens first, truncates the screened text, and marks what is left, so stored pages and summarizer input are governed text under the tool's real source. A summary is screened once more, because it is new text a model wrote from third-party content. Both methods keep the degrade-to-allow behaviour.

Behaviour changes: `block` now also fires on a directive in the part a `headTail` or `truncate` cut drops. The `tool_result` trace entry shows the screened text (without the envelope). `eddi_guardrail_toolresult_count_total` counts a `summarize` summary as a second screening.

**The summarizer ignored global variables in the provider type (LLM-11).** `ToolResponseTruncator` passed `task.getType()` unresolved to `ChatModelRegistry.getOrCreate`, so a task typed `${vars:provider}` failed to build a summarizer and `summarize` silently became `truncate`. The type is now resolved through `GlobalVariableResolver`, as `LlmTask` resolves it. Parameters need no such step: the registry resolves `${vars:...}` and vault references in them itself, while a Qute expression in a parameter stays unrendered (now noted in the class Javadoc). `PaginatedResponseStore` moved into the same constructor, which removed a null-fallback branch for a field CDI always fills and the reflection the tests used to set it.

### Design decisions

* **Screen before truncation and mark after, rather than screening each page as it is fetched.** Per-page screening would need the original source carried through the page store and would still miss a directive split across a page boundary. Screening once, whole, covers every strategy at once.
* **Re-screen only the summary.** The cut strategies only remove text from an already-screened result, so scanning their output again would cost a second regex pass and a second metric count on the default path for nothing.
* **Resolve the type in the truncator**, the one place that builds the summarizer model, rather than in the runner.

**Files:** [`ToolResultGuardrail.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/ToolResultGuardrail.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`ToolResponseTruncator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolResponseTruncator.java), tests in `ToolLoopRunnerGuardrailWiringTest`, `ToolResultGuardrailTest`, `ToolResponseTruncatorTest`, `ToolResponseTruncatorExtendedTest`, `HelperModelCallRetryTest`; docs [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md), [`mcp-client.md`](https://docs.labs.ai/protocols-and-integration/mcp-client.md), [`metrics.md`](https://docs.labs.ai/deployment-and-infrastructure/metrics.md).

***

## ✨ feat(llm): traceable rolling summaries — cited turns, verbatim numbers, a deterministic check (2026-11-06)

**Repo:** EDDI (`feat/traceable-summaries`, stacked on `feat/user-memory-contested`)

### What changed and why

The rolling conversation summary was prose with no link back to the turns it condensed: `conversationRecall` could drill back, but nothing told the model where to look, and nothing caught a number the summarizer rounded or invented. `conversationSummary.citeSources: true` makes it extractive and checkable. See [LLM Configuration → Traceable summaries](https://docs.labs.ai/agent-configuration/langchain.md#traceable-summaries-citesources).

* **Prompt** — with `citeSources` the summarizer must end every point with the turns it came from (`[turns 4-7, 9]`, numbered as the summarizer input and `conversationRecall` number them: 0-based conversation steps), copy numbers verbatim and write "unclear in source" instead of guessing. The rules are appended to a custom `summarizationPrompt` too.
* **Check** — [`SummaryCitations`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/SummaryCitations.java), no model: every citation inside the summarized range, every bullet cited, every number verbatim in the cited turns' screened text. Citation indices, unbracketed `turn N` references and list markers are not numbers. A citation of a turn before the previous boundary is checked against the previous summary's text — the only source of those turns the summarizer saw.
* **Policy** — `onValidationFailure`: `keep` (default), `retry_once` (same screened content, spend-checked first, tokens added to the first call's so the step prices both), `fallback_to_previous` (previous summary and boundary stay). Counted on `eddi.summary.citation.checks{source,outcome}`, charted on the Full Metrics dashboard.
* **Recall** — `conversationRecall` takes a citation as it stands: `[turns 4-7, 9]` returns every turn it names, each once, clamped and capped at `maxRecallTurns`. A plain query behaves as before.
* **Wiring** — `LlmTask.resolveEffectiveSummaryConfig` copies the two new fields (it rebuilds the config when the provider or model is inherited, and would otherwise have switched the feature off silently).

### Design decisions

* Off by default; while off the prompt is byte-identical and the check never runs. `keep` is the default policy because a fallback retries on every turn and pays for it.
* Numbers match by exact text: `1,000` ≠ `1.000` ≠ `1000`, `10%` ≠ `10`, `-5` ≠ `5`. Strict on purpose — the prompt asks for verbatim copies, and a reformatted number is exactly what the check exists to catch.
* The check is line-scoped (a bullet plus its continuation lines), not sentence-scoped: deterministic and cheap, and a model that puts one citation at the end of its bullet is what the prompt asks for.

### What's next

Dream consolidation gets the same check and records the ids of the entries a consolidated memory came from (entry below).

***

## ✨ feat(memory): traceable Dream consolidation — cited originals and sourceEntryIds (2026-11-06)

**Repo:** EDDI (`feat/traceable-summaries`, stacked on `feat/user-memory-contested`)

### What changed and why

A Dream consolidation replaces its originals and then deletes them, so a number the model rounded or invented replaced the user's fact for good, and nothing recorded what a consolidated memory was made of. `dream.citeSources: true` applies the rolling summary's check to every consolidation group. See [User Memory → Traceable consolidation](https://docs.labs.ai/architecture-and-concepts/user-memory.md#traceable-consolidation-citesources).

* **Model** — [`UserMemoryEntry`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/properties/model/UserMemoryEntry.java) gains `sourceEntryIds` (never null, `[]` by default; the 15-argument constructor stays). Every ordinary write clears it — a value stated anew is not derived from those sources.
* **Stores** — MongoDB and PostgreSQL write it on every path `assessment` is written on (upsert, `insertIfAbsent`, `upsertIfOwnedBy`, `replaceIfUnchanged`, the mappers) and the flat `mergeProperties` clears it. PostgreSQL adds `source_entry_ids JSONB DEFAULT '[]'` with `ADD COLUMN IF NOT EXISTS`; a MongoDB document without the field reads as `[]`. Covered by `DatastoreParityTest` on both backends. The GDPR export carries it (the record is serialised whole).
* **Dream** — with `citeSources` the request numbers the originals (`"ref": 0..n-1`, not their ObjectIds), every consolidated entry must carry `"sources"`, and `SummaryCitations.checkConsolidatedEntry` checks it (refs exist, every number of the value verbatim in the cited originals' key and value). A separate parser reads the `sources` array; the plain parser and request are untouched while the flag is off. Duplicate keys merge their sources.
* **Policy** — `dream.onValidationFailure`, default `fallback_to_previous` (the group is skipped, originals kept); `retry_once` is bounded by `maxCostPerRun`, the legacy call cap and the tenant budget and costed like any call; `keep` writes anyway (an entry left without valid refs records the whole group). Counted on `eddi.summary.citation.checks{source="dream"}`.

### Design decisions

* The Dream default differs from the conversation default (`keep`) on purpose: a rolling summary is a derived view over a conversation that is kept in full; a consolidation deletes what it read.
* `sourceEntryIds` points at deleted documents (except an original the consolidation overwrote in place). That is what recording provenance can mean without changing what consolidation deletes; the ids identify the facts in logs, backups and exports.
* A retry that throws skips the group but does not abort the phase: the group's first call succeeded, so it is no configuration fault.
* After merging #1295's `asStatement()` (every store value write is stored `ACCEPTED`): `asStatement()` keeps `sourceEntryIds`, because provenance is not a verdict and Dream's consolidation write goes through those same store methods. The REST boundary (`UserMemoryWriteRules.withDefaults`) clears it, so a client echoing a consolidated entry's ids onto an edited value does not keep them. MCP and every other writer build their entries without sources. `DatastoreParityTest` pins both halves on MongoDB and PostgreSQL.

### Review follow-up (2026-11-12)

* **Citation failures no longer log content.** The WARN lines for a failed citation check (conversation summary and Dream), a failed retry and an unparseable or unserialisable Dream answer now carry ids, counts, the policy and the exception class only. The problem list, which quotes the summary text and memory keys, and the parser's message, which quotes the model's answer, moved to a DEBUG line (sanitised, capped).
* **`conversationRecall` and out-of-range citations.** A cited turn past the summarized turns used to be clamped onto the last summarized turn, so `[turn 40]` returned turn 4 as if it were the source. A citation wholly outside the summarized turns, or a bracket that is not a list of turn numbers, now names no turn: the tool says so and logs one DEBUG line. A range that only partly overlaps is still cut at the last summarized turn.

### Review follow-up (2026-11-15)

* **Dream checks each cited object before merging duplicate keys.** The citation check used to run on `mergeDuplicateKeys`' output, whose sources are the union of every object sharing a key. An object citing nothing, or citing an original that does not hold its number, borrowed a sibling's sources and passed, and the originals were then deleted. The check now reads the parsed answer object by object, on the first call and on the `retry_once` call alike; the merge still runs afterwards and still records the union of the (now individually valid) sources.
* **A cut turn is checked against the text that was sent.** When a single turn is longer than `maxCharsPerUpdate`, the check kept that many characters of the turn's raw text. The request itself is shorter: the "Turn N — User:" labels and the cut notice take part of the budget, so a number just past the sent prefix could back a summary the summarizer could not have read. The check now keeps exactly the user and agent text inside the sent prefix.
* **A `retry_once` summary call is spend-checked with the first call's cost.** The retry's admission ran before the first summary call's cost was recorded, with `0.0` pending, so a $1 ceiling with $0.90 recorded admitted a retry after a $0.20 first call. `ConversationSummarizer`'s admission callback now takes the update's unrecorded token usage (empty before the first call, the first call's usage before the retry), and `LlmTask` prices it with the same `ModelPrices` it records the summary spend with and passes it as `pendingUsd`. The cost is only checked there; both calls are still recorded once, together, after the update.
* **An empty first answer gets the citation policy.** With `citeSources` on, an empty summarizer answer returned early, before the check: `retry_once` never made its corrective call and no outcome was counted. It now goes through the check, which fails it ("the summary is empty"), and the configured policy applies. `retry_once` retries, `fallback_to_previous` falls back, and `keep`, having nothing to keep, falls back rather than replace the previous summary with nothing. Each case is counted. With `citeSources` off the early return is unchanged.

***

## 🐛 fix(turns): queued-turn guard on the one-read path, busy skips and inert abandoned outcomes (2026-11-06)

**Repo:** EDDI (`fix/turn-runner-guards`)

### What changed and why

Four holes in how a queued turn starts and how an abandoned one ends, all in `ConversationStepRunner` plus one in the SSE stream.

* **A conversation deleted while its turn was queued (RT-1).** Both stores answer a missing document with no state and no revision. The queued-say guard skipped only `AWAITING_HUMAN`, `IN_PROGRESS` and `ENDED`, so a turn queued during a delete or a GDPR erasure ran on its request-time snapshot: model and tool calls, and `storePropertiesPermanently` wrote the erased user's long-term properties back after the erasure's memory sweep. Only the final persist failed. Such a turn is now skipped and reported as `ENDED`: REST answers `410`, a stream ends with `done`, and the clients already start a new conversation on `ENDED`.
* **A store failure at that guard (RT-2).** The state/revision read ran outside any `try`. A pool timeout there escaped the task, the coordinator dead-lettered the turn, and its caller never heard back (REST waited for its `408`, a stream got no terminal event). The same held for a runtime that refused the body (`RejectedExecutionException`). Both now answer **busy** (`409` + `Retry-After`, `done` with `IN_PROGRESS` on a stream; the input was not consumed), the contract the fence branch already used for a store failure. The three busy paths share one `skipAsBusy`.
* **The late outcome of a turn the watchdog abandoned (RT-5).** After a watchdog timeout the coordinator starts the next turn while a body that swallowed its interrupt keeps running. When it finally ended, its callbacks settled it as a cancelled turn, keyed only by conversation id: on one node that stamped `EXECUTION_INTERRUPTED` over the `READY` the next turn had committed (and made that turn's pause commit miss); in cluster mode its expired lease put a lease-lost record in the map the next turn drains, so the next turn was dead-lettered as lease-lost after it had answered `200`. Once the dispatcher has given up, the outcome now only refreshes the state cache. The same holds for a persist the completion callback started just before the watchdog gave up and that failed afterwards: a fence or revision-guard refusal is no longer recorded for the next turn to drain (which dead-lettered that turn), and a store failure no longer stamps `ERROR` over the next turn's state. The comments that said a node runs at most one turn of a conversation at a time were wrong and are corrected.
* **A stream whose turn hung past the watchdog (RT-2).** REST has its `408`; a stream had nothing and was kept open by the keep-alive for as long as the body hung. Once the turn has written its first event, a stream that then carries none of its events for `systemRuntime.agentTimeoutInSeconds` plus one keep-alive interval is ended with an `error` event, code `turn_timeout`. A live turn cannot reach that (the watchdog bounds it), a queued one has written nothing yet, and with the keep-alive off the backstop is off too.

`ConversationServiceQueuedTurnTest` now stubs `getStateAndRevision`, the path both production stores take; before, every queued-turn test ran on the legacy two-read fallback. One test keeps the fallback covered.

**Files:** [`ConversationStepRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationStepRunner.java), [`RestAgentEngineStreaming.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentEngineStreaming.java), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [`hitl.md`](https://docs.labs.ai/conversations-and-orchestration/hitl.md) (the resume stream's `turn_timeout`), [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md) (the stream's `turn_timeout` code); tests in `ConversationServiceQueuedTurnTest`, `ConversationStepRunnerLeaseTest`, `ConversationStepRunnerAbandonedTurnTest` (new) and `RestAgentEngineStreamingKeepAliveTest`.

***

## 🐛 fix(llm-tools): per-turn tool budgets live on the conversation step, forgetFact included (2026-11-06)

**Repo:** EDDI (`fix/turn-scoped-tool-budgets`)

### What changed and why

Two LLM-tool budgets were counted in a field of the tool object: `maxWritesPerTurn` in `UserMemoryTool` and `maxDelegationsPerTask` in `ConverseWithAgentTool`. A turn builds its tools more than once — each step of an agent-mode model cascade runs its own tool assembly, and so does the continuation of a turn resumed after a HITL tool approval — and every assembly starts a new tool object at zero. A three-step escalating cascade could therefore write three times `maxWritesPerTurn`, and a resumed turn got a fresh budget, while [`user-memory.md`](https://docs.labs.ai/architecture-and-concepts/user-memory.md) promised a limit "per conversation turn".

The new `TurnCounter` keeps the count on the conversation's current step instead, where `hitl:tool_pause_count` already lives for the same reason. `ContextualToolsProvider` hands the memory tool `tools:memory_writes`, and `DynamicAgentToolsProvider` hands the delegation tool `tools:delegations:<taskId>` (`default` for a task without an id), so the delegation cap stays per LLM task as documented, now across every assembly of that task in the turn. The next turn's step starts at zero again. Two consequences follow from counting on the step: the LLM tasks of one turn share `maxWritesPerTurn` (it was per task execution), and a rerun of the turn, which re-executes the same step, starts from what its first run spent — the writes and delegations that run made are not undone either. Neither key has a public prefix, so the counts stay out of the simple client snapshot; `returnDetailed=true` shows them as plain integers, like `hitl:tool_pause_count`. The key is read by exact match: the step's `getLatestData` is a prefix lookup and would let `tools:delegations:a` read the count of `tools:delegations:ab`. A tool built without a conversation (direct construction) still counts on its own instance.

`forgetFact` was not covered by any budget, so one injected "forget everything about the user" could delete every memory the agent owns in a single turn. A successful deletion now counts against `maxWritesPerTurn` like a stored fact, and is refused with the same "Maximum writes per turn" message once the budget is spent. A key that matches nothing and a refused deletion do not count. The refusal text now says "saved or forgotten", since it can answer either tool.

**Files:** [`TurnCounter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/TurnCounter.java), [`UserMemoryTool.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/UserMemoryTool.java), [`ConverseWithAgentTool.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/ConverseWithAgentTool.java), [`ContextualToolsProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ContextualToolsProvider.java), [`DynamicAgentToolsProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/DynamicAgentToolsProvider.java), [`user-memory.md`](https://docs.labs.ai/architecture-and-concepts/user-memory.md)

***

## ✨ feat(events): the per-user event stream, `GET /me/events` (2026-11-06)

**Repo:** EDDI · **Branch:** `feat/user-event-stream` (from `feat/conversation-search-tool-ui`)

Phase 8 of the frontend unification plan (`planning/frontend-unification-plan.md` §6, **B12**), the backend for T2.3 (approvals in the flow) and T2.8 (long jobs with a notification when done). A server-sent event stream that tells a signed-in user's tabs about things that concern them, plus a framework-free client in `@eddi/core/user-events`. No UI yet: the next step wires the notifications.

### What changed and why

* **`GET /me/events`** ([`IRestUserEvents`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/IRestUserEvents.java), [`RestUserEvents`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/RestUserEvents.java)): a `ready` frame, then one named event per thing — `approval.pending`, `approval.decided`, `team.started`, `team.waiting_for_human`, `team.ended`, `job.finished`, `job.run_completed`, `job.failed`, `notification.created` — and a keep-alive comment every 20 s. Any role may open it; an anonymous caller gets `401` with authorization on (`@RolesAllowed` first, an explicit check second).
* **Ids and kinds, never content** ([`UserEvent`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/UserEvent.java)): conversation, agent, group, discussion, schedule and notification ids, plus short enum states. No message text, title, prompt, pause reason, tool argument or display name; the client fetches details through the access-checked endpoints. Tests serialize every group state with a question, an answer, a pause reason and a rendered prompt set, and find none of them on the wire.
* **Scoping at fan-out, per connection** ([`UserEventHub`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/UserEventHub.java), [`UserEventAudience`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/UserEventAudience.java)): each event carries an audience read from the authoritative record (the conversation descriptor's owner, the discussion's owner and `HUMAN` roster, the notification's recipient), and each connection is checked against it with what its own request established — principal, `eddi-admin` / `eddi-approver`, team subjects — plus, for a paused 1:1 conversation, a fresh `ResourceAccessGuard.checkPrincipalUse` on the agent (the rule `HitlAccessGuard.requireConversationResumeAccess` applies to an owner's resume). A check that cannot answer delivers nothing. Approvers and admins get approval events by role, as [Who May Decide](https://docs.labs.ai/conversations-and-orchestration/hitl.md#who-may-decide) says.
* **Sources.** `approval.pending` (1:1) from `HitlPauseCommittedEvent`; `approval.decided` (both surfaces) from `HitlDecisionRecorded`; group gates and `team.*` from `GroupConversationService.executeDiscussion` (start of a fresh leg, and the end of every leg, reading the state the leg left behind) and the cancel of a paused discussion in `GroupHitlCoordinator`; `job.finished` from `ConversationContinuations.armIfDecided` when a continuation turn arms no successor (state `done`, or the refusal reason); `job.run_completed` / `job.failed` from `ScheduleFireExecutor` (the owner read from the conversation descriptor, never the schedule); `notification.created` from `WorkspaceNotifications.deliver`, `UPDATE_AVAILABLE` to every admin.
* **Cluster.** [`UserEventPublisher`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/userevents/UserEventPublisher.java) delivers locally and publishes `ClusterEvent.USER_EVENT` through `IClusterEventBus.publishTransient` (new): core NATS on `eddi.<prefix>.tevt.>` with `eddi.messaging.type=nats`, a no-op in-memory; each receiving node scopes the event against its own connections. Principals travel as `KvKeys.sha256` hashes, as the other user-keyed cluster events do. A kind a node does not know is dropped. **Not on the JetStream stream** that carries cache invalidations (review finding): there a burst of user events evicted invalidations from the stream's 100,000-message cap sooner, during an outage filled the shared outbox (`eddi.cluster.events.outbox-size`) until its overflow forced `cache.resync-all` on reconnect, and replayed hints up to an hour late. A transient event is never stored, queued or replayed, carries no stream sequence (so it is never a gap), and is dropped while disconnected (`eddi_cluster_events_transient_dropped_total{type}`; `…_transient_published_total{type}` otherwise). [`JetStreamEventBus`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/events/JetStreamEventBus.java) subscribes the transient wildcard on every (re)connect and hands it to the same handlers.
* **Review fixes to the sources.** `job.run_completed` is not raised for a scheduled run whose turn ended `AWAITING_HUMAN` (its `approval.pending` says so; the run is not over). A continuation whose next schedule could not be written now raises `job.finished` with state `schedule_failed` — the job stops there as surely as at its limit. A nested discussion (`depth > 0`) raises neither `team.started` nor `team.ended`: it is a step of its parent, whose owner would otherwise hear each sub-team start and end.
* **Bounds.** Per-user (`8`) and per-node (`10000`) connection caps answering `429` with `Retry-After`. Before refusing, the caller's own streams whose client already went away are swept under the registration lock (only that caller's bucket, never a global scan), so a reload or a flaky network is not refused by its own dead tabs, and two concurrent opens at one below a cap cannot both pass it; one fan-out thread behind a bounded queue (dropped and counted when full); a per-connection buffer of unacknowledged frames (`64`), past which the stream is closed as a slow consumer; streams closed at token expiry and after `max-connection-age` (1 h) so captured roles are re-read; a vanished client noticed at the next heartbeat. Seven `eddi.user-events.*` properties in `application.properties` and [configuration-reference.md](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md).
* **Authorization off:** every caller is owner and admin, as on every other endpoint, so all streams share one anonymous bucket and get every event. That bucket is exempt from the per-user cap, which there would cap every caller of the deployment together; the per-node cap still bounds it.
* **Metrics:** `eddi_user_events_connections`, `eddi_user_events_delivered_total{kind}`, `eddi_user_events_dropped_total{reason}`, `eddi_user_events_rejected_total{reason}` — [metrics.md](https://docs.labs.ai/deployment-and-infrastructure/metrics.md#user-event-stream-metrics), a **User event stream** row on the Full Metrics Reference dashboard, and the Kubernetes copies (`scripts/sync-monitoring-assets.py`).
* **Frontend.** [`@eddi/core/user-events`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/user-events.ts), its own `exports` entry, not re-exported from the root: `getUserEventStream` (one per tab), typed events, `on(kind | "*")`, `onStatus` (`open` means refetch), `fetch` through the app's `HttpClient` (bearer token and one refresh on `401`), reconnect with exponential backoff and jitter, stop on `401`/`403`/`404`, at least the server's `retryAfterSeconds` on `429`. A test fails if `ui/chat/src` ever imports it. MSW: [`user-event-handlers.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/test/mocks/user-event-handlers.ts) holds the stream open after `ready` and writes whatever `pushMockUserEvent` sends; `GET /me/events` is in `openapi-operations.json`.
* **Docs.** New [user-events.md](https://docs.labs.ai/conversations-and-orchestration/user-events.md) (in `SUMMARY.md`); [rest-api-reference.md](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md), [hitl.md](https://docs.labs.ai/conversations-and-orchestration/hitl.md), [group-conversations.md](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md) and [long-jobs.md](https://docs.labs.ai/conversations-and-orchestration/long-jobs.md) link to it.
* **Platform Operator.** The prompt explains the stream (kinds, audiences, limits, cluster behaviour, metrics, the audit-ledger dependency of `approval.decided`). No allow-list change: a stream is no tool. `operator-revision.json` → **57**.
* **Platform Operator, caps.** The prompt also says the per-user cap does not apply to the shared anonymous bucket with authorization off (only the node cap does); revision stays 57, fingerprint updated.

### Design decisions

* **Hints, no replay.** `Last-Event-ID` is not supported: a replay would need a per-user history shared across pods. The client refetches on every (re)connect instead, so a missed event is never lost in effect.
* **The audience is data; the decision is the receiver's.** The raising node names who may receive an event; every node, its own included, checks its connections against that with their own captured identity.
* **The end of a group leg reads the persisted state** instead of listening to each branch's listener call, so a new way of ending a discussion cannot forget to tell anyone.
* **`approval.decided` rides `HitlDecisionRecorded`**, which carries the owner and covers both surfaces, cancels and timeouts; the price is that it needs the audit ledger (on by default), which the docs and the operator say.
* **Refuse at the cap, not evict the oldest:** eviction would let two misbehaving tabs knock each other off in a loop; a refused tab backs off, and a closed tab's slot frees as soon as another stream is opened at the cap (otherwise at the next heartbeat).

### Not done

* The UI (T2.3 / T2.8 notifications) — the next step.
* Web push.
* No `*IT`: the cross-pod path is covered through the bus abstraction (two hubs joined by a fake bus with a JSON round trip), not against a live NATS.

***

## fix(nlp): a chat message with stray parentheses no longer fails the turn (2026-11-06)

**Repo:** EDDI (`fix/user-input-expression-depth`)

A production deployment on 6.6.0 failed three turns in five minutes when users pasted long text containing list markers and unbalanced parentheses (`a)`, `(It`, `3))`). The log showed `Error while parsing Expression` repeated, then `ExpressionLimitExceededException: Expressions nest 33 levels deep; at most 32 are accepted`, and the user received the generic fallback answer.

**Root cause:** every token no dictionary knew became `unknown(<token>)` (`Unknown`), and `InputParserTask` stores the expressions of a turn as one string that rule matching, the property setter and the append merge parse again. The token text went into that string verbatim, so each `(` in the message became an opening bracket in expression syntax. Opening brackets from different tokens add up across the whole message; past 32 the depth bound added in 6.6 refused the string and the exception failed the lifecycle. Before the bound the same input produced silently wrong nesting. `main` still had it.

**Fix:** `Unknown` now builds `unknown(<token>)` from the token without `(`, `)` and `,`, the three characters the notation gives meaning to; a token that is only such characters becomes a bare `unknown`. The word itself (`getValue()`, match details, the conversation input) is untouched, and the other dictionaries that build expressions from runtime text only accept digits, e-mail addresses or epoch times, which cannot carry those characters. The malformed-expression log in `ExpressionProvider` is a WARN instead of an ERROR.

**Decision:** `eddi.expressions.max-depth` and `eddi.expressions.max-length` are unchanged and still refuse configuration-authored and client-supplied (`context` type `expressions`) nesting; user chat text is data and is sanitised where it becomes an expression, not by loosening the guard.

**Tests:** `UserInputExpressionRoundTripTest` runs prose with many unbalanced parentheses through the parser, the stored expression string and the re-parse (failed with the 33-level error before the fix), checks that dictionary words still match, and that authored deep nesting is still refused.

***

## 🛠️ fix(manager): Active Tools in the Workforce agent panel shows what the LLM really gets (2026-11-06)

**Repo:** EDDI (`fix/workforce-active-tools-display`)

### Why

The Workforce chat's Agent Details panel listed an LLM task's `tools` as raw `eddi://ai.labs.apicalls/apicallstore/apicalls/<id>?version=1` URIs, one badge each. The badges overflowed the 320 px panel (horizontal scrollbar), an agent with sixteen tool sets produced a wall of near-identical badges, and nothing said which tool set was which.

Worse, it was the wrong list. The backend never resolves `task.tools` (`LlmConfiguration.Task#tools`: "a non-empty list only switches the task into agent mode"). HTTP and MCP tools are discovered from the `eddi://ai.labs.httpcalls` / `eddi://ai.labs.mcpcalls` steps of **every** workflow of the agent (`HttpCallToolsProvider`, `McpToolsProvider`, `WorkflowTraversal.discoverConfigs`), gated by `enableHttpCallTools` / `enableMcpCallTools`, which default to **on**. The panel showed the HTTP/MCP chips only when those flags were explicitly `true`, and showed a built-in whitelist even when `enableBuiltInTools` was off, in which case the backend ignores it.

### What changed

* `ui/manager/src/lib/agent-tool-refs.ts` (new): `collectWorkflowToolRefs` reads tool sets from the agent's workflows the way the backend does. It matches the step type exactly (a step typed with the `eddi://ai.labs.apicalls` alias is not offered as a tool by the backend, so it is not listed), respects the two switches with default-on semantics, and deduplicates.
* `ui/manager/src/components/workforce/active-tools-list.tsx` (new): the Active Tools section.
  * Each tool set is shown by its **descriptor name** (one cached `getDescriptor` read, short-id fallback), with an HTTP/MCP icon, its version, the full URI in the tooltip and a link to its editor.
  * The first four are shown; the rest sit behind "Show N more".
  * Built-in tools appear only when `enableBuiltInTools` is on: the whitelist as chips, or one "All built-in tools" chip when there is no whitelist.
  * There is a Memory chip and a total count.
  * A loading state shows while the workflows load.
* `agent-details-panel.tsx`:
  * It fetches every workflow of the agent, sharing the existing query key so the first workflow comes from cache.
  * It uses the new component and no longer repeats capabilities in the tool list.
  * It clips horizontal overflow, and the model badge truncates.
* Six new `Workforce.agentEditor.tools*` keys in all 11 locales.

### Tests

`active-tools-list.test.tsx` has 9 tests:

* collection across workflows, with dedupe;
* the `apicalls` alias is ignored;
* the per-category switches;
* `task.tools` is not listed;
* name resolution, link and collapse;
* the id fallback on a 404 descriptor;
* built-ins gated by `enableBuiltInTools`;
* the loading and empty states.

Mutation check: when the HTTP switch is flipped from default-on to default-off, 2 tests fail.

### Follow-ups found on the way (not in this PR)

* Pipeline labels: `extensions.ts` labels the canonical `eddi://ai.labs.httpcalls` step type "API Calls (legacy)" and the alias "API Calls". It is the other way round: `ApiCallsTask.ID` is `ai.labs.httpcalls`, and `V6RenameMigration` deliberately keeps that step type.
* Backend: a workflow step typed `eddi://ai.labs.apicalls` runs, but its calls are never offered to the LLM as tools, because `WorkflowTraversal` matches the type string exactly. `docs/architecture.md` shows that alias in an example.

***

## ✨ feat(workforce): approvals in the flow and long-job notices on the user event stream (2026-11-06)

**Repo:** EDDI · **Branch:** `feat/workforce-approvals-job-notices` (from `feat/user-event-stream`)

Phase 8 of the frontend unification plan (`planning/frontend-unification-plan.md` §5 Tier 2): **T2.3** (approvals in the flow) and **T2.8** (long jobs with a notification when done), the first UI on the per-user event stream B12 ([user-events.md](https://docs.labs.ai/conversations-and-orchestration/user-events.md)).

### What changed and why

* **One stream per tab, in both signed-in apps.** [`UserEventBridge`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/layout/user-event-bridge.tsx), mounted by the Manager's `AppLayout` and Workforce's `WorkforceLayout`, starts the tab's stream once someone is signed in and stops it on sign-out. Invalidations are coalesced per query key (`coalesce-invalidations.ts`): the first runs at once, further ones within 500 ms collapse into one trailing refetch, so a burst of events costs at most one refetch per key per half second and an isolated event is not delayed. Every event invalidates the queries it concerns ([`staleQueryKeys`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/user-event-stream.ts)); every (re)connect refetches them all, since the stream has no replay. The transport is `ApiClient.authorizedFetch`, but the error stays `@eddi/core`'s `ApiError`, which is how the client tells a refusal (401/403/404) it must not retry. `useUserEvent`, `useUserEventStatus` and `useEventDrivenInterval` ([`use-user-events.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-user-events.ts)) are how components listen.
* **Manager:** the approvals inbox, the sidebar badge, the chat's pause notice and the notification bell now update the moment an approval is decided, a pause lands or a notification arrives, instead of at the next 5–10 s poll. Its polls are unchanged.
* **Workforce — what waits on a human (T2.3).** [`ApprovalsIndicator`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/approvals-indicator.tsx) in the topbar, on every viewport: a count of the person's own paused chats and team sessions and, for an approver or admin, the pauses they may decide; a panel listing each with what its timeout policy does and when (`pausedAt + approvalTimeout`), jumping to the paused turn in Workforce or, for a review, to the Manager's approvals inbox. Data from the existing `GET /agents/pending-approvals` and `GET /groups/pending-approvals` ([`use-workforce-approvals.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-workforce-approvals.ts), [`workforce-approvals.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/workforce-approvals.ts)), on the Manager's query keys, polled every 30 s only while the stream is not open. The sidebar marks a paused chat or team session.
* **By when.** The read-only [`PauseNotice`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/hitl/pause-notice.tsx) (the chat in both apps, the Workforce member thread) now says when and how a finite timeout policy decides on its own.
* **Workforce — notices (T2.8, and "told when it continues" of T2.3).** [`WorkforceNotices`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/workforce-notices.tsx) toasts a finished or stopped long job (turn limit, cost ceiling), a failed scheduled run (and its recovery; see below), a team discussion that ended, a team waiting for *your* turn (`yourTurn: true` only) and a decision on *your own* pause, with "Open" to the conversation or team session — except the one already on screen. [`noticeFor`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/workforce-notices.ts) picks a generic sentence; events carry no content. Toasts use sonner's polite live region and never take focus.
* **Recurring jobs stay quiet (review fix).** A schedule's every fire raised a toast (and, opted in, an OS notification) — a 60 s heartbeat meant one a minute — and each retry of a failing fire raised another. [`NoticeGate`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/workforce-notices.ts), one per tab: a routine `job.run_completed` is not shown, only the success that ends a failure streak; `job.failed` is shown once per `scheduleId` until that schedule succeeds again (at most 500 remembered); an event more than 2 minutes old by its `ts` (delivered late) is not shown. No new strings.
* **Known limit, documented in** [**`use-workforce-approvals.ts`**](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-workforce-approvals.ts)**:** an approver or admin gets everyone's pauses capped at 200, so on a busy deployment their own pause can fall outside the page — then missing from "mine" and from the "your conversation continues" check. The endpoints have no owner filter yet.
* **Browser notifications, opt-in.** [`use-browser-notices.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-browser-notices.ts): off by default; turned on from the indicator's panel, the only place the permission prompt is ever requested; sent only while the tab is hidden.
* **i18n:** 3 `hitl.*` keys in `@eddi/app-kit` and 38 `Workforce.approvals.*` / `Workforce.notices.*` keys in Workforce, translated into all 11 locales.
* **Platform Operator:** the prompt says how the apps use the stream, what Workforce shows and why a user may see no notices. `operator-revision.json` → **58**.
* **Docs:** [user-events.md](https://docs.labs.ai/conversations-and-orchestration/user-events.md) ("In the Manager and Workforce"), [`ui/workforce/AGENTS.md`](https://github.com/labsai/EDDI/tree/main/ui/workforce/AGENTS.md).

### Design decisions

* **Refetch, never render the event.** An event says only that something changed; the lists come from the access-checked endpoints, so the UI cannot show something the stream should not have carried.
* **No new endpoint.** "Who must approve" is shown as the person's own pause versus one they may review, which is what the pending-approvals summaries can say; naming the reviewer would need a backend field.
* **A hand-rolled disclosure panel, not the Radix dropdown,** in the topbar: the topbar is in Workforce's first load, and a menu role would also be wrong for a list of links plus a setting.
* **Toast only what is news.** No toast for `approval.pending` (the count says it, and it is usually what the person just did), `team.started` (they started it) or an approver's queue changing.

### Not done

* **Deciding in place in Workforce** (T2.3's "an approver decides in place"): reviews link to the Manager's inbox; the Operator-style inline approval card is a follow-up.
* **Progress for a running long job** (T2.8's "shown as progress"): the stream has no in-progress event for continuations, only `job.finished` / `job.failed`; a backend event would be needed.
* The pause notice's "Review" link still goes to the Manager's conversation page, which an `eddi-user` cannot open.

***

## ✨ feat(ui): "What I remember about you", composer modes, and the `/chat/embed.js` launcher (2026-11-06)

**Repo:** EDDI · **Branch:** `feat/workforce-memory-composer-embed` (on `feat/conversation-search-tool-ui`)

Phase 8 (Tier 2) of the frontend unification plan (`planning/frontend-unification-plan.md` §5): T2.4, T2.5 and T2.9. Frontend, plus one literal JAX-RS path for the launcher. T2.1/T2.2/T2.6/T2.7 and the per-user event stream (B12) are other branches.

### What changed and why

* **"What I remember about you" (T2.4).** A Workforce page at `/workforce/memory` ([`workforce-memory.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/pages/workforce/workforce-memory.tsx)), linked as **My memory** from the sidebar footer and from the ⌘K switcher. It lists the signed-in person's own persistent memory, newest first, with the agent that saved each entry (named from the catalog, else its id; a legacy entry without one says so) and its visibility in plain words (*Private*, *Team* with the team's name, *All agents*). It has a search box, **Forget** for one entry, and **Forget everything** behind a confirm that names the consequence: every agent and team, gone from new conversations, cannot be undone, conversations kept. It uses the existing REST API only (`GET /usermemorystore/memories/{userId}`, `DELETE /entry/{id}`, `DELETE /{userId}`), with the token's `preferred_username` as the user id. The backend's `OwnershipValidator` answers 403 for anyone else's, so the page can only show a person their own entries. The backend lets a person delete any of their entries, shared ones included, so the page offers that and says that a shared entry goes for every agent. The reserved `_gdpr_` rows cannot be deleted (400 on the single delete, kept by delete-all), so they are counted and named in a note, not listed. A stored value is a text child, never markdown or HTML. Row shaping is pure, in [`memory-entries.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/memory-entries.ts). The user-memory API and hooks moved from the Manager to `@eddi/app-kit` with `git mv`, and the Manager's admin tab now imports them from there. The MSW handlers already covered the three endpoints.
* **Composer modes (T2.5).** [`composer-mode.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/composer-mode.ts) in `@eddi/conversation` defines the composer's three modes once: the field an agent asked for (`inputField`) wins over the user's lock (secret mode), and the lock wins over text. Only a `password` field (or one with no `subType`, in any case) is a secret. `email` and `text` are ordinary turns of that type. Quick replies show beside text and a requested field, and are hidden under the lock. The widget's `Composer`/`SecretInput` and `@eddi/app-kit`'s `ChatPanel`/`SecretInputField` (Manager, Workforce, test drawer) all follow it. Fixes that came with it:
  * **A secret was echoed in the clear.** The text draft and the masked value were one state in both composers, so turning the lock off showed the typed secret in the textarea. They are now separate: leaving secret mode drops the masked value, the text draft typed before survives the trip, and a secret the server refused (409) returns to the masked field.
  * **The app-kit field was wrong.** It masked and vaulted every `subType`, so an email address was sent as a secret. It also trimmed passwords. It now sends what the shared rule says, and gained the widget's **Type a message instead**.
* **The embed launcher (T2.9).** `<script src="https://eddi.example.com/chat/embed.js" data-agent-id="…" defer>` draws a floating button that opens the `/chat` widget in a panel ([`launcher.ts`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/embed/launcher.ts)). It is framework-free and imports nothing from the widget. It is its own Vite build (`vite.embed.config.ts` → `dist/scripts/js/chat-ui-embed.js`), which the existing Maven `chat-ui*.js` copy, exclude and clean patterns already cover. EDDI serves it from a literal path, `RestHtmlChatResource#fetchEmbedScript` (beside the SPA catch-all, which would otherwise answer with HTML under `nosniff`), as JavaScript with `Cache-Control: public, max-age=3600`, and answers 404 when the jar has no UI.
  * **Settings.** `data-` attributes set the agent id, environment, position, colour (the widget's colour rule), label (a built-in "Chat" per widget locale), open-by-default (not on a phone), language, theme and a token provider.
  * **Token hand-off.** It relays the widget's existing protocol. `tokenOrigin` is set only when the host gives a provider, since the widget would otherwise wait five seconds for a token. A message is answered only from its own iframe's window and EDDI's origin, and the token is posted to that exact origin.
  * **Isolation.** The button and panel live in a shadow root. The launcher never touches cookies or storage and uses no `innerHTML` or `eval`.
  * **Accessibility.** The button is a labelled `<button>` with `aria-expanded`. The panel is a labelled dialog: focus moves to it, Tab is kept inside, Esc or the close button closes it, and focus returns to the button. On a phone the panel is full-screen with safe areas, and there is no animation under reduced motion.
  * **Budget.** `check-bundle-budget.mjs` learned `scripts` entries, and the launcher has its own budget of 5 KB.
* **Strings.** `Workforce.memory.*` (36 keys) in Workforce's eleven locales. T2.5 adds none: the app-kit field reuses `conversation.input.typeInstead`. The launcher's default label and close label are a small table in the script, in the widget's eleven locales.
* **Platform Operator.** The prompt now covers the launcher (what to set, the two settings it fails without: `eddi.chat.frame-ancestors` and the host page's CSP), "My memory" (what a user may delete, the `_gdpr_` rows), and the `inputField` rule. Revision **58** (57 is taken by sibling branches), fingerprint `9f251b17d4cf3b8a`. No allow-list or guard change.
* **Docs.** [`chat-ui-embedding.md`](https://docs.labs.ai/protocols-and-integration/chat-ui-embedding.md) section 6, "The launcher": the snippet, the attribute table, authentication, the host page's CSP (`script-src`, `frame-src`, inline style in the shadow root, no SRI), and accessibility. Also [`user-memory.md`](https://docs.labs.ai/architecture-and-concepts/user-memory.md) ("What the user sees"), [`workforce-guide.md`](https://docs.labs.ai/protocols-and-integration/workforce-guide.md) (the composer's modes, "What your agents remember about you"), [`agent-config-authoring.md`](https://docs.labs.ai/agent-configuration/agent-config-authoring.md) (`inputField`), and the Chat UI and Workforce AGENTS and `@eddi/conversation` README.

### Bundle sizes (gzip -9, KB)

| Entry                               | Before            | After             | Budget |
| ----------------------------------- | ----------------- | ----------------- | ------ |
| `chat.html` (widget first load)     | 169.4 (169,379 B) | 169.5 (169,543 B) | 170    |
| `scripts/js/chat-ui-embed.js` (new) | —                 | 3.6 (3,647 B)     | 5      |
| `workforce.html`                    | 255.0             | 256.5             | 280    |
| `manage.html` / `welcome.html`      | 611.8             | 612.8             | 620    |

No existing budget was raised. Workforce grew 1.5 KB. About 1 KB is the entry chunk (the sidebar link and its icon, the switcher item). The rest is Rolldown splitting the shared `groups` chunk differently (`sse` 45.3 KB + `groups` 35.3 KB, before one 80 KB chunk), now that `SecretInputField` imports `@eddi/conversation`'s main entry. The memory page itself is a lazy route. The widget's growth is the composer split and the shared mode resolver. It is within the budget but not offset (see the decision log).

### Design decisions

* **Search in the browser over what the page shows**, not `GET /{userId}/search`. That endpoint matches keys and string values only (newest 200), while the person thinks in agent and team names, which only the page knows.
* **Forget one has no confirm. Forget everything does.** One entry is one row, and the toast names it. "Everything" is irreversible across every agent, so its dialog says so in full.
* **The launcher's dialog takes focus on open** (Esc works at once, Tab reaches the close button and the conversation). Inside the conversation, Esc keeps the widget's meaning, Stop. A widget-to-host "escape" message would need the widget to know its parent's origin even without a token provider, which costs widget bytes the budget does not have.

### Not done

* Esc from inside the conversation closing the launcher panel (see above).
* Editing a memory entry: the REST upsert is open to the owner, but what an end user may rewrite (an agent's private note, a team's entry) needs a product decision first.
* An E2E spec for `/workforce/memory`: the MSW tier runs with no signed-in user (the auth context has no `user`), and the page correctly asks for nothing then. The Vitest suite covers the flows with a signed-in context.

***

## ✨ feat(workforce): teams beside chats, @mention hand-off, artifact versions, turn notes (2026-11-06)

**Repo:** EDDI · **Branch:** `feat/workforce-teams-mention-artifacts` (on `feat/conversation-search-tool-ui`)

Part of phase 8 of the frontend unification plan (`planning/frontend-unification-plan.md` §5, Tier 2): T2.1, T2.2, T2.6 and T2.7. Frontend only; no backend change. T2.4 (memory), T2.5 (composer modes), T2.9 (embed launcher) and B12 (the per-user event stream) are other branches.

### T2.1 — Teams beside chats

**Already there (phases 2–6):** a team's board streams the discussion live (phase rail, member turns, task board), shows the structured decision (`DecisionRecordCard`: winner, tally, ballots, minority report), the HUMAN member's turn with its prompt and timeout (`HumanTurnBanner`, `POST …/human-input`), the approval pause linked to the Manager, Stop, follow-ups, history; the sidebar lists team sessions; the catalog lists the teams an `eddi-user` may use.

**Added:**

* **Home starts a team session.** Home's picker lists the catalog's teams under the agents (`<optgroup>`s). With a team picked, sending opens its board with the question in **router state, never the URL** ([`workforce-team-start.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/workforce-team-start.ts)), and the board starts a new session with it once (guarded by identity, dropped from the history entry so a reload cannot start it again, ignored when it names another team).
* **Templates.** The preset templates (`/groupstore/templates`, `instantiate`) answer `eddi-editor` and `eddi-admin` only (`IRestGroupTemplates`), and creating a team is authoring — the wizard already offers them to authors. For an `eddi-user`, the listed teams are where a session starts; the guide says so.
* **The decision in plain words.** `decisionSummary` ([`decision-summary.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/team/decision-summary.ts)) turns the record's typed fields into one or two sentences — "The team voted, and “Ship it” won. Members who disagreed: 2." — the decision card's first line, and the board announces it politely when it arrives. Never an agreement's `winner` (a proposal id). Worded without plural forms, so each locale needs one string.
* **Whose turn.** `HumanTurnBanner` takes `viewerIsMember`: "It's your turn, Gregor" for the member, "Gregor's turn — only Gregor or an administrator can answer" for anyone else. The board compares the signed-in username or e-mail with `pendingHumanInput.memberId` only for the wording; the form stays, because the client cannot know which claim the server reads as the principal, and the server decides. A refused submission (`403`) is explained in those words. The banner is a labelled region; the board's status line announces the turn.

### T2.2 — @mention hand-off: the design decision

**No backend support exists for this.** EDDI's one hand-off concept, [cross-team handoff](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-handoff.md), is an *agent* filing a *task* into a standing team's backlog under two-sided author consent — not a person moving their own question from one conversation to another, and it records nothing in the origin conversation.

So the client-side version, said plainly: typing **@** in a Workforce chat opens a combobox over the catalog's agents and teams (`GET /catalog/*`, so only listed entries the caller may USE; never the agent store, never the chat's own agent). Picking one shows "Hand over to …" above the box; sending **starts a new chat with that agent, or a new team session, with the question as its first message** — through the existing router-state start paths — instead of sending it to this chat's agent. A marker in the origin chat says where it went and links to it; the new conversation shows where it came from and links back.

The hand-off is **recorded in this browser only** ([`workforce-handoffs.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/workforce-handoffs.ts): keyed by principal, at most 100, the question cut to 140 characters, removed at sign-out like the pinned responses). The marker says so in visible text, the guide says so. **Why that is the honest version:** the target agent or team receives an ordinary first message, which is exactly what happened on the server; a marker written *into* the transcript would claim a server-side record that does not exist, and faking one as a message would put client text into the agent's conversation and its context. The store re-renders readers on a write in the same tab and, through the `storage` event, on a change or clear made in another tab (a stale list there would also have overwritten the other tab's record on its next write). Recording it properly is a backend item (a `handoffFrom` on the descriptor, readable by its owner), listed below.

* `ChatPanel` gets two optional props the Manager does not pass: `mention` (the textarea becomes a `role="combobox"` with `aria-expanded`, `aria-controls`, `aria-activedescendant` over a `listbox`; ↑ ↓, Enter or Tab to choose, Esc closes only the popup — a running turn's Esc-to-stop does not fire — Backspace in an empty box drops the choice; a polite status says how many suggestions and the choice) and `transcriptMarkers` (host lines after a step's last message, at the top for none, at the end when the step was undone). The pure parts are [`lib/chat-mention.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/chat-mention.ts).
* `ChatPanel` now takes a second initial message while mounted (by identity), so a hand-off from one chat to another agent on the same page starts, and reports the conversation it started (`onInitialConversationStarted`) so the record is linked. Files are not handed over; secret mode has no mentions.

### T2.6 — Shared artifacts with versions

**Already there:** `ArtifactsPanel` in the transcript header (current content, a revision count). **Added:** an artifacts button on the board (shown when the session has any, with the count) opens a side panel — the same non-modal slide-over as the Team and Sessions panels, full width on a phone, loaded lazily ([`artifacts-drawer.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/artifacts-drawer.tsx)). Inside, `ArtifactVersions` ([`artifact-versions.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/team/artifact-versions.tsx)): the list, one artifact opened, a **Version** select over the current content plus every revision its `history` keeps (`ARTIFACT_HISTORY_CAP` = 10), each with editor and time; an earlier version says so and offers the current one; "versions before vN are no longer kept" when the history dropped some. No request: the versions arrive with the status read, which the board polls while a discussion runs. Focus goes to the panel's close button once loaded and back to the trigger on Escape or close. One rendering policy for every artifact view, `ArtifactContent` ([`artifact-content.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/team/artifact-content.tsx)): MARKDOWN through the one renderer with raw HTML escaped, JSON pretty-printed, TEXT plain — `ArtifactsPanel` now uses it too. **Not built:** a diff between versions (a line diff over 256 KB documents needs its own bounded algorithm; switching covers reading), and editing (no endpoint lets a person write an artifact).

### T2.7 — Cascades and guardrails in plain words

What the backend exposes per streamed turn, and nothing more: `cascade_escalation {fromStep, toStep, confidence, threshold, reason, durationMs}`, `llm_retry {reason, attempt}` (in the SSE union since phase 7) and `guardrail_triggered {type, phase, action}`. A new [`turn-notes.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/tool-activity/turn-notes.ts) in `@eddi/conversation/tool-activity` reads the first two (`reason` only), files them per conversation and step like the tool cards (`TurnNotesLog`), and `TurnNotes` renders a sentence per reason — "Another model was tried because the first answer wasn't confident enough." (`low_confidence`), took too long (`timeout`), failed (`error`, `retryable_error`), couldn't be used (`invalid_output`); "The model was asked again because its first reply was empty / was cut off / was stopped by the provider's content filter / wasn't in the expected format / the conversation was too long for it". The guardrail notices the controller already keeps on a reply now read "A safety check removed part of the answer (pii-redaction)." instead of "Guardrail (output): pii-redaction redacted" (`GuardrailNote`; three `chat-message.test.tsx` assertions changed with the wording, the seven `chat.guardrail*` keys they used were removed). Wired into `ChatPanel` (Manager and Workforce chat) under each turn's last message, and into Workforce's member thread. Nothing renders when the stream said nothing.

**Gaps, documented:** a cascade stopped early by `maxCostPerRun` or `maxTotalDurationMs` sends no event, so users are told nothing; the model's name and cost are not shown to end users (the widget's escalation indicator is unchanged); like the tool cards, notes are live only (the stored trace is not client-safe); a turn answered without streaming has none; group member turns stream no such events.

### Bundles, i18n, operator

* First load, gzip: Workforce 256.7 → 256.7 KB (budget 280), Manager 615.3 → 615.3 KB (620), both measured on the base commit and on this branch, the widget 169.4 → 169.4 KB (170): it imports none of this. No budget raised.
* 70 new keys in the eleven locales (turn notes in the tool-activity bundle, team strings in the team bundle, `chat.mention.*` in app-kit's, `Workforce.handoff.*` / board / home in Workforce's).
* **Platform Operator:** the prompt explains the turn notes and their gaps, the browser-only hand-off (not cross-team handoff), Home's teams, the plain decision, the human-turn wording, the artifacts panel, and that templates need an author role. No allow-list change. Revision **57**.
* Docs: [`workforce-guide.md`](https://docs.labs.ai/protocols-and-integration/workforce-guide.md) (Home, why an answer came the way it did, @ hand-off, keyboard, a team, administrator notes), [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md) (humans in Workforce, artifacts in Workforce), `ui/workforce/AGENTS.md`, `ui/manager/AGENTS.md`, the `@eddi/conversation` README.

### Follow-ups

* A server-side hand-off record (the origin on the new conversation's descriptor, owner-readable) so the marker survives devices.
* A `member_tool_result` / member cascade events for group turns; a client-readable redacted trace so tool cards and turn notes survive a reload.
* An event when a cascade's cost or duration ceiling ends escalation.
* A bounded line diff between artifact versions.

***

## 🔒 fix(workspaces): legacy resources grant at most EDIT; settings load once and revalidate (2026-11-06)

**Repo:** EDDI (`fix/workspace-legacy-access`)

### What changed and why

* **A resource that predates ownership no longer makes every caller its owner.** `DescriptorAccess.effectiveLevel` gave `OWN` to any caller for an unowned descriptor under `legacy-visibility=shared`. `OWN` gates delete, share, revoke, visibility and move, so any user could publish a colleague's pre-upgrade agent to anonymous callers, or move it into `user:<them>` — after which it was owned, and everyone else lost access. With enforcement off, the same answer let any user read the grant list of a legacy resource. The legacy contribution is now `EDIT`: everyone can still read, use, edit and deploy pre-existing resources, so an upgrade hides nothing, but the `OWN` acts are admin-only until an owner is assigned with `PUT /descriptorstore/descriptors/{id}/shares/owner`. Explicit grants on a legacy resource still count in full. It is the rule a resource with no descriptor at all already followed — an absent record must not grant authority — though that case, in `ResourceAccessGuard.requireLegacyFallback`, stops lower still, at read and use. See [Resources that predate ownership](https://docs.labs.ai/security-and-compliance/workspaces.md#resources-that-predate-ownership).
* **The workspace settings cache no longer makes access checks wait for the store.** `WorkspaceSettings` re-read the stored settings under a lock when its 5-second cache expired, so every request whose access check asked `admitsLegacy()` queued behind a database read with no timeout — at every expiry, and for the whole of an outage. It is now stale-while-revalidate: one caller re-reads, everyone else is served the last values. Each read is numbered when it starts and each adopted write when it lands, and the higher number is what stays served, so neither a write adopted meanwhile nor the settings page's forced re-read is undone by an older read that answers later. Only the very first read, with nothing to serve, is still waited for. No executor is involved.
* **A corrupt stored `legacy-visibility` is validated once, at load.** It used to be re-validated, and logged at `WARN`, on every access check. It is now treated as unset when read, logged once per distinct bad value, and `GET /workspaces/settings` reports it as `DEFAULT` — the default that actually applies.
* **`PUT /workspaces/settings` stamps `updatedAt` to the millisecond.** Mongo keeps milliseconds and Postgres microseconds, so the value this instance adopted differed from what a replica read back.
* **New `WorkspaceSettingsStoreParityTest`** runs the Mongo and Postgres settings stores through the same cases: unknown tenant, full round trip, unset fields read back as null, writing null clears a stored value (how `PUT` unsets a setting), tenant isolation, timestamp precision. Neither store had a test before.

### Behaviour change for administrators of upgraded deployments

With `eddi.workspaces.enabled=true`, a non-admin can no longer delete, share, publish, move or read the grants of a resource created before ownership was recorded; the Manager stops offering those actions on it (it reports `callerLevel: EDIT`). Assign an owner to each such resource you want someone other than an administrator to manage. Nothing changes for administrators, or while enforcement is off apart from the grant list.

**Files:** [`DescriptorAccess.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/DescriptorAccess.java), [`WorkspaceSettings.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/WorkspaceSettings.java), [`RestWorkspaces.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/rest/RestWorkspaces.java), [`workspaces.md`](https://docs.labs.ai/security-and-compliance/workspaces.md); tests in `DescriptorAccessTest`, `ResourceAccessGuardTest`, `RuntimeWorkspaceSettingsTest` and the new `WorkspaceSettingsStoreParityTest`.

***

## 🐛 fix(compat): no false TEMPLATE\_DOES\_NOT\_PARSE for a prompt that mentions a vault reference (2026-11-05)

**Repo:** EDDI (`fix/compat-template-parse-vault-prose`)

### What changed and why

Every Platform Operator deployment logged `[TEMPLATE_DOES_NOT_PARSE] llm task '…'.parameters.systemMessage: … empty expression found {vault:…}, so every render of it fails`, while the agent answered correctly. The warning was a false positive: at runtime `LlmTask.runTemplateEngineOnParams` first wraps `{vault:…}`, `{vars:…}`, `{connection:…}` and `{caller:…}` mentions in Qute raw sections (`escapeConfigReferenceMentions`), so a prompt that only documents the syntax renders fine. The deploy-time lint parsed the unescaped text.

* [`CompatibilityRules.scanLlmTaskTemplates`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/compat/CompatibilityRules.java) applies the same escaping before parsing, and only to the task's own `parameters` — the strings the runtime escapes. Cascade step parameters, API-call, property and output templates are rendered without it and still warn. `AgentCompatibilityLint` uses it for LLM tasks; `LlmTask.escapeConfigReferenceMentions` is now public for this.
* A genuinely broken template next to a mention still warns. No Manager change, so no operator revision bump.

***

## The team kind of conversation — frontend unification phase 6 (2026-11-05)

**Repo:** EDDI · **Branch:** `feat/conversation-operator-team` (stacked on `feat/workforce-app`, PR #1285)

Phase 6 of the frontend unification plan (`planning/frontend-unification-plan.md`, §3.2, §7): group discussions become the **team kind** of `@eddi/conversation`, the same controller and components in the Manager and in Workforce, and Workforce's two group transcript renderers become one. The **operator kind** did not move in this phase (below).

**What changed**

* **`@eddi/core/groups`** ([`groups.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/groups.ts)) — the discussion contract: every type a stored or live group discussion is made of (`TranscriptEntry`, `GroupConversation`, the decision, tasks, proposals, artifacts), the SSE events and payloads, the group constants and the display fallbacks for styles and entry types, moved out of `@eddi/app-kit`'s `lib/api/groups.ts`, which re-exports the module so no import changed. The group *configuration* type, its normaliser and the calls stay in app-kit (they reference app-only modules). The four HITL types a stored discussion carries about its pause moved to `core/hitl.ts`. Not re-exported from core's main entry, so the Chat UI never resolves it.
* **`GroupDiscussion`** ([`controller/group-discussion.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/group-discussion.ts)) — the framework-free controller of one group's discussion: the state a run builds, `applyGroupStreamEvent` (the reducer every SSE event goes through), and start, approve-and-resume, continue a round, detach, Stop (the deferred Stop, 409 as already ended), reset and `whenAccepted`. A plain store (`subscribe`, `getSnapshot`) over a `GroupTransport`, with an optional host store. It is the code of `@eddi/app-kit`'s `use-group-discussion-stream.ts`, which keeps its whole API and now binds the controller (a transport over the apps' client, one controller per group writing its slot of `useGroupStreamStore`). New framework-free tests: `group-discussion.test.ts` (10). Every existing stream, board and workspace test passes unmodified.
* **`@eddi/conversation/team`** — the team components moved from `@eddi/app-kit` with `git mv`: `TaskBoard`, `DecisionRecordCard`, `StructuredTurnCard`, `StructuredEntryBody`, `NegotiationLedger`, `ArtifactsPanel`, `DiscussionInsights`, `HumanTurnBanner`, the overview (`PhaseRail`, `MemberRoster`, `ParticipationMatrix`, `InteractionMap`, `BidBoard`, `DiscussionOverview`, the view toggle) and the entry readers (`group-utils`, `group-entry-body`, `group-payloads`, `group-decision`, `discussion-styles`, `use-discussion-digest`, ISO durations). Router-free. Their strings (152 keys, nested `groups.*` as before) moved to the package's [`team/i18n/locales`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/team/i18n/locales/en.json) in all eleven locales, merged by `withTeamLocales` from `setupAppI18n`; the translation-quality suite merges them too. `Badge` and the display helpers (`hashColor`, `getInitials`, `formatUsd`, `formatDuration`) moved to `@eddi/ui` (app-kit's `lib/utils` re-exports the helpers). `ConversationMarkdown` moved to `@eddi/conversation/i18next`.
* **One transcript in Workforce.** The history viewer (`conversation-viewer.tsx`) renders a stored discussion through the board's transcript (`board-transcript.tsx`, read-only and opened at the top) instead of its own copies of the question, member, synthesis, error and skipped cards and the phase separator. History now looks like the board, with its pins and "Ask more". Two Workforce coverage assertions named copy of the deleted cards ("Final Synthesized Answer", "No content") and now assert the board transcript's synthesis card and "No response generated"; the wave-3 parity test no longer looks for an icon map in the viewer (it has none) and checks that it renders through the board transcript. No other test assertion changed; the moved components' tests changed their import path only.
* **Links** in the September and October archives and one fragment pointed at the files that moved; they were repointed (link targets only).
* **`npm run i18n:check`** counts every `i18n/locales` directory of a package, not only `src/i18n/locales`.
* **Lockfile** — `@eddi/conversation` depends on `@eddi/ui`, `i18next` and `react-i18next` (already in the tree); the lockfile was regenerated in `node:26.13.0`.

**Not done in this phase, and why**

* **The Operator still runs its own turn loop** (`use-operator-chat.ts`). Moving it onto `AgentConversation` needs controller work first: an approval policy hook (resume with per-call decisions and request pinning, poll until the resumed turn settles, the 409 / `awaiting_approval` race that back-fills the ask, executed calls reconstructed from the detailed log). The 2,600 lines of operator store tests pin those call sequences, and the approval UI is security-reviewed. Nothing under `ui/manager/src/lib/operator`, in `lib/api/updates.ts` or `lib/hitl-tool-approvals.ts` changed, so the Stryker scope and the HITL guard tests are untouched. The Platform Operator's prompt and allow-list are unchanged (no operator-visible behaviour moved).
* **The Manager's group transcript** (`discussion-transcript.tsx`, `agent-response-card.tsx`) still renders its own entry cards, around the approval card and editor tools. Moving it onto the shared transcript changes how the Manager's workspace looks and its tests' markup, and is the next step, together with moving `board-transcript.tsx` and the advisor card into `@eddi/conversation/team` behind slots (pins and "Ask more" as `messageActions`).

***

## ✨ feat(conversations): search my conversations; tool\_result on the stream (2026-11-05)

**Repo:** EDDI (`feat/conversation-search-tool-events`, stacked on `feat/conversation-operator-team`)

The backend half of phase 7 of the frontend unification plan (`planning/frontend-unification-plan.md`, rows B3 and B6; T1.3, T1.6 and T1.9 build on them).

### What changed and why

**B3: search my conversations.**

* `GET /conversationstore/conversations/search?q=&index=&limit=` returns the caller's own conversations whose **title** contains `q`, newest first, as the same descriptors the listing returns. It is paged like the listing: `index` is a page of results, and `index × limit` above 10,000 is a `400`. A page can come back short, because a match whose conversation memory is gone is left out.
* **Owner scope.** The caller's conversations only, for every caller, an administrator included. This is "my conversations"; an administrator who needs everybody's uses the listing's `filter`. The owner goes into the query as an exact `userId` match (`QueryFilter.exact`), so another user's descriptor is never read, and a row-level check repeats it. Because the owner is exact, a page from the store is a page of results, and the listing's owner-scan budget and back-fill are not needed. An anonymous caller with authorization on gets an empty list without a query. With authorization disabled every conversation is searched, as the listing then shows every conversation. A pre-v5.1.6 descriptor that records no owner is not searched; such descriptors predate titles.
* **Matching.** A new `IResourceFilter.ContainsIgnoreCase` is the case-insensitive twin of `Contains`: an escaped regex with the `i` option on MongoDB, an escaped `ILIKE … ESCAPE '\'` on PostgreSQL. Either way `q` is literal text. `q` is normalized the way titles are stored (`ConversationTitles.requireValidSearchQuery`: whitespace collapsed, control and bidi characters dropped) and must be 1 to 100 characters. No new index: the exact owner predicate, which uses the existing `userId` index, narrows the rows first.
* **Privacy.** Only titles are searched. A title never comes from a secret turn (B2 derives it after the turn-end scrub), it lives on the descriptor, and GDPR erasure deletes every descriptor of the user (`GdprComplianceServiceTest.deleteUserData_erasesConversationTitlesWithTheirDescriptors`). The search keeps no index of its own and drops a match without memory, so nothing it finds outlives an erasure. `RestConversationStoreSearchTest` pins title-only matching, the owner scope, the dropped foreign and orphan rows, normalization and paging.
* **Outputs are not searched (follow-up).** They live in the conversation memory documents, not the descriptors, so searching them needs its own index on both backends. They also hold model and tool text that the turn-end scrub does not cover: it removes secret input and secret context, not what a tool echoed. So searching them needs a redaction decision as well as an index, and that was not clearly safe to do here.
* Surfaces: `searchConversations` in the app-kit API layer, an MSW handler, the line in `openapi-operations.json` (added by hand, as for earlier endpoints: no instance was running to refresh it), and [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md#searching-my-conversations) and [`gdpr-compliance.md`](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md).

**B6: `tool_result` on the SSE stream.**

* After every tool call it announced with `tool_call`, a streamed turn now sends `tool_result {tool, ok, summary}`. `ok` is true when the tool ran and `ToolOutcomeClassifier` reads its result as a success: an HTTP error status, an `error` field or a `NOT_EXECUTED`/`DENIED` status make it false, and so does a refusal (budget, quota, turn deadline). `summary` is the start of the result or of the refusal, at most 200 characters.
* **The same redaction as `toolTrace`.** The redaction `LifecycleManager` applied to the `task_complete` trace moved into `ToolTraceRedaction` (`redactTrace`, `redactValue`), and both channels use it. `ToolTraceRedaction.summary` redacts the **whole** text before cutting it, so a credential that straddles the cut cannot leak its first characters past the redactor's minimum length. A test pins this.
* The event is built in `ToolLoopRunner.executeToolCall`, which now wraps the old body (`runToolCall`), from the trace entry this call wrote. That covers every exit, the mock, budget and quota refusals included, and the resume path of an approved call. No event is sent for a call cut off by a cancellation or an approval pause. A failing sink never breaks the tool loop. The event is plumbed through `ConversationEventSink`, `StreamingResponseHandler`, both `ConversationService` bridges and `RestAgentEngineStreaming` as a typed `ToolResultEvent`.
* It is additive: older clients ignore unknown events. **UI:** `SSEEventType` lists `tool_result`, and `llm_retry`, which the backend already sent. A new contract test in `stream-events.review.test.ts` reads the event names from `RestAgentEngineStreaming.java` and fails when the union and the Java disagree. The parser is in a separate entry, `@eddi/core/tool-events` (`parseToolResult`, `toolResultListener`), which plugs into `AgentConversation`'s `onStreamEvent`. The widget does not import it and its controller is unchanged, so the widget bundle, at its 170 KB budget, does not grow. A widget test pins that nothing of the payload reaches the page.
* No meter: the per-tool counters (`eddi_tool_calls_total` and friends) already count these calls, and the event adds no new outcome.
* Group discussions: not done. A member's turn is not streamed, and only its tool *name* reaches the group stream (`member_tool_call`). A `member_tool_result` needs its own observer, so it is left as a follow-up.

**Platform Operator.** The prompt explains the search (the caller's own conversations only, an admin's too; titles only; not one of its tools) and `tool_result`. The allow-list is unchanged. The search answers only the caller's own conversations, so it would not help the operator inspect anyone else's, and the operator already holds the listing. Revision 55.

### Design decisions

* Titles only, now. Outputs need an index and a redaction rule of their own (see above).
* Owner-exact for administrators as well: the endpoint is the end user's search box, not an admin tool.
* A substring match (escaped regex / `ILIKE`), not a MongoDB text index or a PostgreSQL `tsvector`. Titles are short. Users expect a substring to match ("rom" finds "Rome"), which word-stemmed full-text search does not do. The exact owner predicate keeps the scan to one user's rows, and the existing descriptor query path and both backends' escaping are reused without new schema.

### What's next

* Frontend: the Workforce sidebar search box (T1.3), and tool cards (T1.9) and the "this turn ran tools" notice on edit and regenerate (T1.6) built on `@eddi/core/tool-events`.
* Searching outputs, after the privacy review above. `member_tool_result` for group discussions.

**Files:** [`IRestConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java), [`RestConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/RestConversationStore.java), [`IResourceFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/IResourceFilter.java), [`ConversationTitles.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/ConversationTitles.java), [`ToolTraceRedaction.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/lifecycle/ToolTraceRedaction.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`RestAgentEngineStreaming.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentEngineStreaming.java), [`tool-events.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/tool-events.ts); docs [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md), [`gdpr-compliance.md`](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md), [`README.md`](https://docs.labs.ai/readme.md).

***

## ✨ feat(conversations): titles, rename and pin; agent appearance and chat controls (2026-11-05)

**Repo:** EDDI (`feat/conversation-titles-agent-appearance`)

The backend half of phase 4 of the frontend unification plan (`planning/frontend-unification-plan.md`, rows B2 and B4; decisions D7 and D9): what a sidebar of conversations and a per-agent home screen need from the server.

### What changed and why

**B2 — conversation titles, rename, pin.**

* `ConversationDescriptor` gains `title`, `titleSource` (`AUTO`, `LLM`, `USER`) and `pinned`. Stored on both backends as plain descriptor fields; every listing that returns descriptors (`GET /conversationstore/conversations`, MCP `list_conversations`) now carries them. A descriptor written before reads untitled and unpinned.
* **Default title** (`ConversationTitles`, `ConversationTitleService`): the first user message that was not secret, whitespace collapsed, control and bidi characters dropped, cut at a word to `eddi.conversations.title-max-length` (default 80). It is written from the turn's completion callback on exactly the turn that holds that message — a walk over the in-memory steps on every other turn, one write on that one. **Never from a secret turn:** a turn is skipped when the client flagged `secretInput` (a secret `inputField` does), when a `scope: "secret"` property vaulted the input, when the input carries a secret context placeholder, or when an input guardrail withheld it. All of it is read after `Conversation`'s turn-end scrub, so the plaintext is never seen; the next usable message titles the conversation, and with none it stays untitled.
* **Rename and pin:** `PATCH /conversationstore/conversations/{conversationId}` with `{"title", "pinned"}` (either). Owner or `eddi-admin` only, through the same strict owner check as delete (`requireConversationOwnerStrict`; reviewers get nothing); `400` for an empty body or a blank or over-200-character title, `404` for a soft-deleted conversation.
* **A rename is never overwritten.** Title writes are one conditional update per backend — `IResourceStorage.setFieldsIf` (Mongo `updateOne` with the guard in the filter, PostgreSQL `data || ?::jsonb` with the guard in the `WHERE`) — with precedence `USER` > `LLM` > `AUTO`: `AUTO` lands only where there is no title, `LLM` only over `AUTO`, the owner's edit always. No read-modify-write, so a model title arriving after the owner renamed cannot clobber it. PostgreSQL builds the patch as a JSON tree rather than through the persistence mapper, which omits null map entries — a field set to `null` is stored as JSON null on both backends, as the contract says.
* **Model-written titles, opt-in** (`titleGeneration` on the agent, default off): after the first exchange a background virtual thread (at most 8 at once per node; beyond that the default title stays) asks the configured model through the shared `SummarizationService`, as Dream does. Refused by the unpriced-call policy and the tenant cost budget like other model calls; the priced spend is recorded on the tenant budget and reported to spend sinks as the new `SpendEvent.Kind.CONVERSATION_TITLE`, with conversation, agent, version and user. Counted on `eddi.conversation.titles{outcome}` (new Full Metrics dashboard panel).
* **GDPR:** the export's `ConversationExportEntry` carries `title` and `pinned` (live descriptor, else the archived copy of a soft-deleted conversation); erasure already deletes every version of each conversation's descriptor, which is where titles live — now pinned by a test.

**B4 — agent presentation.**

* `appearance {displayName, avatar, accentColor, starters[]}` and `conversationControls {undo, redo, attachments, rating, quickReplies, streaming, rawHtml}` on `AgentConfiguration`, all optional. Validated on every agent write path (REST, ZIP import, sync, setup) by `AgentPresentationValidator`: display name ≤ 80, no control characters; accent `#rgb`/`#rrggbb`; avatar an `https` URL without credentials or a `data:image/png|jpeg|gif|webp;base64` URI ≤ 64 KB (SVG and `http` refused — the browser renders it as `<img>`, EDDI never fetches it); ≤ 6 starters of ≤ 200 characters. `titleGeneration` is validated there too (provider and model required when enabled, `maxLength` 10–200).
* `GET /agents/{agentId}/profile` returns `appearance` (or `null`) and `conversationControls` resolved to booleans — absent switches `true`, **`rawHtml`** **`false` unless the agent sets it (D9)** — for the deployed version, read through `AgentConfigurationCache`.
* ZIP export/import and agent sync carry the blocks unchanged (they move agent JSON; the export's secret scrub keeps them — tested).
* Manager: a "Presentation & titles" section on the agent page (appearance, controls, model titles), keys in all 11 locales. Platform Operator: the prompt explains appearance, controls, the `rawHtml` default and titles; revision bumped. The `PATCH` is deliberately not in its allow-list — renaming is the conversation owner's act. `eddi-admin` skill mentions the fields. The section is disabled for a read-only viewer like every other section, and changing the title model's provider drops `apiKey` and `baseUrl` from its `parameters` (they belong to the old provider; a vault reference without `allowedHosts` would otherwise go to the new one).
* Chat UI: the review notice and the settled profile lookup now land in one commit (the flag was set a microtask after the notice, and the ref `handleSend` reads synced in a passive effect), so a quick reply clicked right after the notice appears is no longer dropped.

### Design decisions

* Title derivation runs in the completion callback, not as a lifecycle task: it is a session concern of the turn's outcome, and reading after the scrub is what makes "never from a secret turn" hold for every way a turn becomes secret.
* Controls are presentation only: hiding undo does not disable the endpoint; `rating: false` can hide but not enable ratings.
* `rawHtml` is reported now; the widget keeps rendering HTML until its own phase ships, so agents can opt in first (`docs/chat-ui-embedding.md` → "Upgrading").

### What's next

* **Catalog (#1273):** once both land, `IRestCatalog.CatalogAgent` should carry `appearance` (and probably `conversationControls`) — `AppearanceProfile.of(config.getAppearance())` from the same deployed version the catalog already resolves; the operator revision files of both PRs will conflict and need one more bump.
* **Frontend:** Workforce sidebar (titles, rename/pin via the `PATCH`, grouping by date), home with per-agent starters, and the widget honouring `conversationControls` (including `rawHtml`). A `pinned` filter on the listing would let a sidebar fetch pinned items regardless of paging; not added yet.

**Files:** [`ConversationTitles.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/ConversationTitles.java), [`ConversationTitleService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationTitleService.java), [`ConversationDescriptor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/descriptor/model/ConversationDescriptor.java), [`IResourceStorage.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/IResourceStorage.java), [`RestConversationStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/RestConversationStore.java), [`AgentPresentationValidator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/agents/AgentPresentationValidator.java), [`IRestAgentProfile.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/api/IRestAgentProfile.java), [`GdprComplianceService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/gdpr/GdprComplianceService.java); docs [`agent-config-authoring.md`](https://docs.labs.ai/agent-configuration/agent-config-authoring.md), [`chat-ui-embedding.md`](https://docs.labs.ai/protocols-and-integration/chat-ui-embedding.md), [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md), [`gdpr-compliance.md`](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [`metrics.md`](https://docs.labs.ai/deployment-and-infrastructure/metrics.md).

***

## 📝 docs(connections): Google Workspace recipe — Gmail and Drive as per-user LLM tools (2026-11-05)

**Repo:** EDDI (`docs/google-workspace-tools-recipe`)

### What changed and why

The Google Workspace plan's conversation-tools slice. It is configuration apart from one engine addition, the `encoder:mimeHeader` template function that `createDraft` uses for the subject (see below), so the recipe needs a build that includes it. Per-user Google access was the motivating case for connections, but no worked config showed it end to end, and the prerequisites (verified identity, allowlisted credential endpoints, Google's publishing-status rules) were scattered or missing.

* **Recipe** — [`docs/agent-configs/google-workspace-tools/`](https://github.com/labsai/EDDI/tree/main/docs/agent-configs/google-workspace-tools/README.md), an importable agent in the ZIP layout: the `google-workspace` connection (`OAUTH2_AUTHORIZATION_CODE`, `PER_USER`, scopes `gmail.readonly` + `gmail.compose` + `drive.readonly`), a Gmail httpcalls config (`searchMail`, `readThread`, `createDraft`), a Drive one (`searchDrive`, `readDriveFile`), an LLM task with httpcall tools on and built-in tools off, and the setup wizard's catch-all rule. Every tool has an `argumentSchema` with `unknownFields: reject` and authenticates with `"Authorization": "${connection:google-workspace}"`.
* [**`google-workspace.md`**](https://docs.labs.ai/protocols-and-integration/connections/google-workspace.md) (new, in `SUMMARY.md` under Connections) — prerequisites (OIDC-verified users and which entry points are `SELF_ASSERTED`; connection settings with both Google origins on the credential-endpoint allowlist; the OAuth client; Linked accounts, including that only an admin can *start* a link from that page), Google's publishing-status table, installation, and the security notes below.
* [**`email-integration.md`**](https://docs.labs.ai/protocols-and-integration/email-integration.md#gmail-and-google-workspace) — the Gmail note expanded: why an inbound Gmail integration is refused at save (authorization-code grants are `PER_USER`, a poll has no verified principal — `ConnectionResolver.requireMailLoginTarget`), that app passwords over `BASIC` are not blocked but untested, and what is planned (admin-linked `SERVICE` grant, domain-wide delegation).
* **`StrictBoundaryShippedConfigsTest`** now maps `.connection.json` to `ConnectionConfiguration`, so the recipe's connection — and any future fixture under `connections/` — is parsed strictly instead of being counted as skipped.
* Cross-links from [`connections.md`](https://docs.labs.ai/protocols-and-integration/connections.md#see-also) and [`agent-config-authoring.md`](https://docs.labs.ai/agent-configuration/agent-config-authoring.md#reference-implementation).

### Design decisions

* **No send tool; drafts only.** A model that reads mail and can send is an exfiltration channel for prompt injection in mail bodies. The page says how to gate a send tool behind `hitlConfig.toolApprovals`, and that `gmail.compose` already permits sending — the "no send" is the tool set's, not the token's.
* **CR/LF in `to`/`subject` is neutralised in the template, not rejected by the schema.** The argument schema check deliberately drops `pattern` (backtracking risk on model text), so a pattern forbidding `\r\n` would accept everything. Instead `to` has CR and LF removed with `.replace(…)` and `subject` goes through the new `encoder:mimeHeader`; the body is `base64Mime` after the header block.
* **`encoder:mimeHeader` (new, `EddiTemplateExtensions`).** The first version wrapped the whole subject in one `=?UTF-8?B?…?=` word, which breaks RFC 2047's 75-character word limit from 46 UTF-8 bytes up (24 `é`); the review caught it. The function always B-encodes, ASCII included, so it keeps the CR/LF guarantee; Jakarta Mail's `MimeUtility.encodeText` was rejected because it leaves all-ASCII text, CR and LF included, unencoded. Words carry at most 39 bytes (64 characters framed, so `Subject:` plus the first word fits a 76-character line), split on code points and joined with CRLF SP. `EncoderExtensionsTest` round-trips them through `MimeUtility.decodeText`.
* **`StrictBoundaryShippedConfigsTest.shippedConnectionsImport`.** The strict sweep swallows malformed JSON and wrong value types, and the importer silently skips a connection it cannot read, leaving the agent's `${connection:…}` reference unresolved. Every shipped `*.connection.json` is now read as `RestImportService` reads it and passed through `ConnectionConfiguration.validate()`. Verified against qute-core 3.40.1.1: a raw CR/LF inside a Qute string literal is kept, and nested namespace calls work as `str:concat` arguments.
* **`readThread` returns Gmail's base64url body parts as-is** — templating has no decoder; documented as a limitation rather than worked around.

### What's next

A real `pattern` (or a narrower "no control characters" keyword) for tool arguments would let such fields be refused rather than rewritten. Admin-linked `SERVICE` grants and domain-wide delegation for Gmail as an inbound channel are later slices of the plan.

***

## ✨ feat(connections): signed-JWT credentials — OAUTH2\_JWT\_BEARER and private\_key\_jwt (2026-11-05)

**Repo:** EDDI (`feat/connections-jwt-bearer`) — slice C1 of the Google Workspace plan

### What changed and why

A service account that proves itself with a private key instead of a client secret could not be expressed as a connection: Google service accounts (RFC 7523 JWT bearer grant) and Entra apps registered with a certificate (`private_key_jwt`) both need EDDI to sign an assertion.

* **`AuthType.OAUTH2_JWT_BEARER`** (new; `isOAuth()` true, new `isServiceAccount()` shared with `OAUTH2_CLIENT_CREDENTIALS`). `SERVICE` binding only. `oauth.tokenUrl`, `oauth.privateKey` (vault reference), optional `clientId` (issuer), `privateKeyId` (`kid`), `audience` (defaults to the token URL), `scopes`. The assertion is RS256 via the JDK `Signature` — no new dependency — with `iss`, `sub = iss`, `aud`, `scope`, `iat`, `nbf`, a unique `jti` and a five-minute `exp`.
* **`oauth.clientAuthMethod: "private_key_jwt"`** on `OAUTH2_CLIENT_CREDENTIALS` and `OAUTH2_AUTHORIZATION_CODE`: `privateKey` replaces `clientSecret`, and every token request (mint, code exchange, refresh) carries a freshly signed `client_assertion` (`aud` = token URL, unique `jti`). Optional `certificateThumbprint` (hex or base64url) in `x5t#S256` (default) or `x5t`, chosen by `certificateThumbprintHeader`; the digest length must match the header. The default stays `client_secret_basic`. The existing `clientAuthMethod` field was extended rather than a second `clientAuth` field added, so one field says how the client authenticates.
* **`SigningKey`** (new, `connections/oauth`) parses a PKCS#8 PEM or a whole Google service-account JSON key file from ONE vault entry (`private_key`, `client_email`, `private_key_id`; `token_uri` deliberately ignored). Refuses PKCS#1, encrypted keys, non-RSA keys and RSA below 2048 bits with fixed messages and no exception cause, because a JSON parser's message quotes the key. `toString()` is redacted. **`JwtAssertions`** (new) builds and signs both assertions.
* **`OAuthTokenClient.jwtBearer`**; client authentication factored into `authenticateClient`; the token-URL allowlist and https checks factored into `requireUsableTokenEndpoint` and run before anything is signed. **`OAuthTokenService`** mints JWT bearer grants through the same cache/single-flight as `client_credentials` and re-mints on expiry or `REFRESH_FAILED`; `OAuthConfig.clientCredentialReference(AuthType)` picks `privateKey` or `clientSecret` for the service and the authorization callback alike.
* **Validation** (`ConnectionConfiguration`): `privateKey` reference-only; a field the chosen flow would ignore (`clientSecret` beside a key, `authorizationUrl`/`extraAuthParams`/thumbprint on JWT bearer, `audience` outside it) is refused; identifiers are bounded literals. `RestConnectionStore` applies the vars→vault check to `oauth.privateKey`; `ConnectionReadRedactor` redacts a legacy literal `privateKey` for non-admins.
* **Manager**: the new auth type in the chooser, labels and badges; private-key, thumbprint and audience fields; and **connection templates as data** — JSON files under `ui/manager/src/lib/connection-presets/` (Google service account, Entra app with a certificate) offered by the New connection dialog. New i18n keys are translated for `de`; other locales carry the English text until translated.
* **Docs**: `docs/connections.md` — two new quick-start sections, model and redaction updates, a security rule on private keys.
* **Review follow-ups.**
  * `oauth.privateKeyId` is refused on a client-secret flow, which never builds an assertion. The refusal names the effective method, `client_secret_basic`, when the field is null.
  * `OAUTH2_JWT_BEARER` now refuses every `clientAuthMethod` except the stored default.
  * The Manager's `isThumbprint` reads a value exactly as `canonicalThumbprint` does: only colons and spaces removed, a 128-character cap.
  * A blank thumbprint is refused for `private_key_jwt` when the token URL is an Entra host. Entra identifies the key only by the `x5t` header. Providers that use `kid` keep it optional.
  * The two presets' labels and descriptions are translated in every locale. The JSON text is the fallback.
  * The private-key picker and the thumbprint field announce their hint and error.
  * `docs/connections.md` names the `openssl -fingerprint` digest, because the default is SHA-1.

### Decisions

* Assertion lifetime five minutes, not Google's one-hour maximum: it is presented once, immediately, and an intercepted one is replayable until it expires.
* A JSON key file is parsed when used, not at save: resolving a secret only to inspect it is a use of it. Save time checks only that `privateKey` is a vault reference.
* The Platform Operator was not changed: it has no connection tools or connection section (writes are admin-only by design), and its one mail line naming `OAUTH2_CLIENT_CREDENTIALS` stays accurate — a Google service account cannot log into a mailbox without domain-wide delegation.

### Next

C2 (domain-wide delegation: `sub` = a Workspace user) and C5 (keyless signing) build on `JwtAssertions`.

***

## ✨ feat(outbound): a Vert.x engine for OutboundHttp, with a pre-send connected-peer check (2026-11-05)

**Repo:** EDDI (`feat/outbound-vertx-engine`)

Phase 4 of [`planning/http-client-consolidation-plan.md`](https://github.com/labsai/EDDI/tree/main/planning/http-client-consolidation-plan.md), which this branch also adds — it was referenced by Phases 1 and 2 but never merged.

### What changed and why

On the JDK engine the facade can only re-check a target **after** the exchange, so a DNS-rebinding request has already been sent blind. Moving `httpcalls` (Phase 5) onto that engine would lose the pre-send check its own Vert.x client has today. This adds the engine Phase 5 needs.

* **`VertxOutboundEngine`** (`engine/httpclient/outbound`) — the core Vert.x `HttpClient` of the Quarkus `Vertx`, one client per profile (TLS and cleartext separately for `protocol=auto`). No redirects, no decompression, no Vert.x tracing (the facade writes and strips trace headers). The request target is built from the validated `URI`'s parts; a `URI` with no host is refused rather than re-parsed (security review H2).
* **`OutboundEngine.Hop.peerCheck`** — run on the address the connection reached, after it is assigned and before a byte is written. It runs on every request, so a pooled connection is judged each time it is handed out. A refused connection is closed, not just reset: resetting a request with nothing written yet hands an HTTP/1 connection back to the Vert.x pool, still open to the refused address until the keep-alive timeout, and the close is what evicts it. The JDK engine ignores it; the post-exchange recheck stays on both. Skipped through a forward proxy, whose peer is the proxy.
* **`ConnectedPeers`** — the address rules, once: `STRICT` refuses loopback/private/link-local/metadata peers, `METADATA_ONLY` metadata/link-local ones, `HOPS_ONLY` only on redirect hops. `HttpClientModule` parses peers through it.
* **`VertxBodyStream`** — the event-loop-to-blocking bridge: bounded queue (pause at 256 KiB, resume below 64 KiB), ordered end/failure, reset on early close, and a close that wakes a blocked reader.
* **Selection** — `eddi.http.outbound.engine` now takes `jdk` or `vertx`; new per-profile `eddi.http.outbound.<profile>.engine` and `…max-connections-per-host` (fails startup on a `jdk` profile). `apicalls` defaults to `vertx` — no caller sends through it until Phase 5, so nothing changes at runtime today. `ProfileRoutedEngine` dispatches; the Vert.x engine is built only when a profile uses it.
* **Metrics** — `eddi.http.outbound.requests` and `eddi.http.outbound.duration` gain an `engine` tag.
* **Docs** — `configuration-reference.md` (new keys), `security.md` (DNS rebinding table), `application.properties` comments.

### Tests

`VertxOutboundHttpServerTest` reruns the whole `OutboundHttpServerTest` suite on Vert.x; `VertxOutboundEngineTest` (loopback: refused peer receives zero bytes, host differential, cap mid-stream, deadline, proxy, pool-limit queuing); `VertxOutboundEnginePeerRefusalTest` (mocks: a refused connection is closed before the reset and nothing is sent, a second request on the same pooled connection is checked and refused again, an allowed peer's connection stays open); `VertxOutboundEnginePoolIT` (loopback: two refused requests to one origin, pool limit 1, open two connections, each closed by the client with zero bytes received); `VertxBodyStreamTest`; `OutboundEngineSelectionTest` (settings, and which peer check each hop carries).

### Design decisions

* The peer check is a callback on the hop, so the rules sit in the facade and an engine only says where it connected.
* A request with its own `hopValidator` gets no peer check on redirect hops: its validator decides what a hop may reach.
* Cleartext `auto` is HTTP/1.1 on Vert.x — neither JDK-style `h2c` upgrade nor prior-knowledge HTTP/2.

### What's next

Phase 5 (`httpcalls` onto the facade). It needs the previous hop's connected class and the allow-list in the peer check (plan §5 item 5), and pool gauges for Vert.x profiles.

***

## ⚡ feat(rag): pgvector v2 layout — HNSW index, indexed jsonb metadata, pooled connections, batched inserts (2026-11-05)

**Repo:** EDDI (`feat/pgvector-scale-layout`)

Slice T2 (pgvector throughput) of the enterprise ingestion plan. `EmbeddingStoreFactory.buildPgVector` built langchain4j's `PgVectorEmbeddingStore` from host/port/user/password: no vector index (every retrieval an exact scan), metadata in a `json` column nothing can index (every `removeAll` by document id and owning source a sequential scan), and a new physical connection for every operation. At ten million chunks retrieval took seconds and each document replacement scanned the table.

### What changed

* **New `PgVectorSchema`** ([`PgVectorSchema.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/PgVectorSchema.java)) — the table layouts and EDDI's own DDL. A table EDDI creates gets the **v2 layout**: `metadata jsonb`, an HNSW index on the embedding (`vector_cosine_ops` — langchain4j orders by `<=>`), and b-tree expression indexes on `(metadata->>'documentId', metadata->>'sourceKey')` and `(metadata->>'sourceKey', metadata->>'runId')`. Index names are unqualified, lower-case and at most 63 characters (a long table name is shortened with a digest).
* **New `EddiPgVectorEmbeddingStore`** ([`EddiPgVectorEmbeddingStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/EddiPgVectorEmbeddingStore.java)) — a subclass that overrides the protected `getConnection()` to `SET hnsw.ef_search` on every borrowed connection, and splits `addAll` into `insertBatchSize`-row batches.
* **New `PgVectorConnectionPools`** ([`PgVectorConnectionPools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/PgVectorConnectionPools.java)) — Agroal pools (already on the classpath through `quarkus-agroal`), one per (host, port, database, user, password), keyed on a SHA-256 digest, bounded like the MongoClient cache, `minSize` 0 with a two-minute reap so an abandoned pool holds no connection. Closed by `clearCache()` and `@PreDestroy`. Max size: new property `eddi.rag.pgvector.pool.max-size` (default 10). The database name is URL-encoded into the JDBC URL so it cannot add driver properties.
* **`EmbeddingStoreFactory.buildPgVector`** now parses the new parameters, borrows from the pool, creates the `vector` extension only if it is missing (langchain4j ran `CREATE EXTENSION` on every connection, which needs CREATE privilege even when it is a no-op), inspects the table, picks the layout, builds through langchain4j's `datasourceBuilder()` and then creates the v2 indexes.
* New `storeParameters`: `layout` (`auto`|`v1`|`v2`), `vectorIndex` (`hnsw`|`none`), `hnswM` (16), `hnswEfConstruction` (64), `hnswEfSearch` (40), `insertBatchSize` (500). Range-checked; messages name the parameter, never the value.
* Docs: [`rag.md`](https://docs.labs.ai/agent-configuration/rag.md#pgvector-at-scale) (new "pgvector at scale" section, parameter table, limits), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md#knowledge-bases-rag) (pool size).
* Tests: `PgVectorSchemaTest` (parameters, layout resolution, DDL, index names, JDBC URL, batching and ef\_search against mocked JDBC); `PgVectorScaleLayoutIT` (pgvector/pgvector:pg16) — indexes exist, the store's own `removeAll` and search statements use them (plans captured with `auto_explain`, `enable_seqscan=off`), a pre-existing json table keeps working untouched, `layout: v1`, pool sharing.

### Design decisions

* **Layout chosen by the table, not by a default on the knowledge base.** `layout: auto` (the default) keeps an existing table in the layout its `metadata` column type says it has and creates a missing one in v2. A store-parameter default of `v2` would have applied to every existing knowledge base too (none carries the parameter), and EDDI would then have built an HNSW index over a production table from inside a request — blocking writes for as long as it takes. An explicit layout that contradicts an existing table is refused, naming the way out (new table, re-ingest).
* **jsonb + expression indexes, not column-per-key.** Verified in the langchain4j 1.23.0-beta33 jar (javap): `JSONFilterMapper` emits `(metadata->>'key')::<type>` for `isEqualTo` and `metadata->>'key'` for `isIn`/`isNotIn`; the `::text` cast on a text expression is dropped by the parser, so the expression indexes match (the IT proves it on the real statements). Column-per-key would also index, but `ColumnsMetadataHandler` silently drops every key without a column — the URL, title, source name and loader metadata.
* **EDDI creates the indexes, not langchain4j.** langchain4j's builder offers only IVFFlat, and its metadata-index names are `<table>_<key>`, invalid SQL for a schema-qualified table.
* **ef\_search per borrow, session-level.** langchain4j runs in autocommit (a `SET LOCAL` would end with its own statement) and its only hook is `getConnection()`. Pools are shared across knowledge bases, so the value is set on every borrow — one extra round trip per operation.
* HNSW is skipped with a warning above 2000 dimensions (pgvector's limit) and when the server's pgvector is older than 0.5.0; the store then works with exact scans, as before.
* **The DDL checks its own inputs (CodeQL `java/sql-injection`).** `PgVectorSchema` no longer relies on `EmbeddingStoreFactory.physicalName` alone: `quotedTable` re-checks each part of the (optionally schema-qualified) table name against `[A-Za-z_][A-Za-z0-9_$]{0,62}` and emits it as a quoted, lower-cased identifier — the same table PostgreSQL resolves langchain4j's unquoted name to — and the index names are quoted too. `m`, `ef_construction` and `ef_search` are range-checked ints where they meet SQL; the table lookup in `inspect` was already a bind parameter.
* **A store holds a handle, not a pool.** `PgVectorConnectionPools.get` returns a `DataSource` that looks the login's pool up on every `getConnection()`, so a size eviction cannot strand a cached store or a running ingestion: the next borrow reopens the pool, and each borrow counts as use of it. An evicted pool with connections still borrowed (Agroal metrics, `activeCount()`) is retired rather than closed under them, and closed on a later lookup once they are returned; `clearCache()` and `@PreDestroy` still close every pool. A borrow and a close of the same pool exclude each other through a per-pool read/write lock (borrow under the read lock, from the `closed` check through `getConnection()`; every close under the write lock, from the `activeCount()` check through `close()`), so a borrow that had looked the pool up before its eviction can no longer finish between the "nothing borrowed" check and the close; eviction and the retired sweep use `tryLock` and retire or skip a pool a borrow is in, rather than stall a lookup. Tested in `PgVectorConnectionPoolsTest` with fake pools, including a gated borrow that is inside `getConnection()` while its pool is evicted.
* **An unqualified table is inspected in `current_schema()`**, where langchain4j's `CREATE TABLE IF NOT EXISTS` creates it, not wherever the `search_path` first finds the name — with `search_path = myschema, public`, `public.docs` would otherwise decide the layout of the new `myschema.docs`.
* **Existing indexes are looked up before their DDL runs** (`to_regclass` on the bound, schema-qualified index name): `CREATE INDEX IF NOT EXISTS` takes a `SHARE` lock before it finds the index, so on every store build it would queue behind open write transactions. `IF NOT EXISTS` stays for concurrent builds.
* **Review follow-ups (CodeRabbit)**: an index that exists but is invalid (a failed `CREATE INDEX CONCURRENTLY`) or sits on another table is refused with `DROP INDEX` instructions instead of being taken as usable; the table layout is re-checked after the store has created the table, so two racing builds that ask for different layouts fail rather than run with the wrong metadata handling; the HNSW index name is logged, and `docs/rag.md` explains the unqualified-index-name rule for `CREATE INDEX CONCURRENTLY` and that `vectorIndex: none` does not remove an existing index.

### Follow-ups

* A Manager one-click "move to the v2 layout" action (re-embed into a new table) — out of scope here.
* Manager RAG editor fields for the new parameters (they can be set as raw `storeParameters` today).
* `hnsw.iterative_scan` (pgvector 0.8) for filtered queries on shared tables.

***

## ✨ feat(rag): delete a document ingested through `/ingest` (2026-11-05)

**Repo:** EDDI (`feat/rag-document-delete`)

### What changed and why

A client that pushes text through `POST /ragstore/rags/{id}/ingest` could supersede a document (`replace=true`) but never remove one. `DELETE /ragstore/rags/{id}/documents?version=N&documentName=…` now does, with the semantics of `replace=true`:

* **The same chunks.** `RagIngestionService.delete` removes by the metadata ingestion writes — `source = documentName` and this knowledge base's `kbId` — on this knowledge base's own store (`EmbeddingStoreFactory.getOrCreate`, not `getOrCreateForIngestion`, so a delete can never replace an in-memory store). Every version of the name goes, legacy chunks without an ingestion id included; another knowledge base's document of the same name in a shared store does not.
* **The same lock.** The per-document `ReplaceKey` lock is now taken through `documentLock`, by replacements and deletes alike, so a delete never lands between a replacement's store and its cleanup (where it would take the new chunks too and leave a "completed" replacement over an empty document). A delete waits up to 30 seconds and then answers `409`.
* **A name is required.** Missing, blank or `unnamed` is a `400`, as for `replace=true`.
* **EDIT**, checked first, like ingestion.
* **Outcomes.** `200` deleted (also for a name nothing was ingested under); `200` with a `warning` when the store cannot delete by metadata; `503` when the store fails, so the client retries.
* **Source-owned names are refused (`409`).** A source's chunks carry `sourceName`/`sourceKey` and no `source` key, so the delete filter cannot touch them — but answering "deleted" while they stay retrievable would mislead. `RagSourceIngestionService.sourceHoldingDocument` checks the knowledge base's sources: an upload source's file names and ids, and the non-tombstoned documents a crawling source's state records. A hit is refused with the source's id and the endpoint to use instead.

**Platform Operator:** the endpoint stays outside the allow-list, like every RAG write (`planning/operator-write-scope-plan.md` §5). `grantsKnowledgeBaseAuthoring` now counts it, and the read-only line says the operator cannot delete a document either; revision bumped.

No MCP tool ingests into a knowledge base (`McpAdminTools` reads `rag` but deliberately does not write it), so there is no delete tool to add and no plugin skill to update.

### Judgment calls

* Ownership is checked by name against the sources' state, not by chunk metadata: listing chunks needs a similarity search (an embedding call) and still could not express "has a `sourceKey`". Consequence: a document pushed through `/ingest` under the same name as a source's file cannot be deleted here until that file is removed.
* An ingestion without `replace` takes no lock, so one in flight when a delete answers can still store its chunks afterwards. Documented rather than changed.

**Files:** [`RagIngestionService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/rag/RagIngestionService.java), [`IRestRagIngestion.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/rag/IRestRagIngestion.java), [`RestRagIngestion.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/rag/rest/RestRagIngestion.java), [`RagSourceIngestionService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/RagSourceIngestionService.java), [`rag.md`](https://docs.labs.ai/agent-configuration/rag.md#deleting-a-document), the operator's [`system-prompt.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/operator/system-prompt.ts), [`tool-scopes.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/operator/tool-scopes.ts) and [`operator-revision.json`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/operator/operator-revision.json); tests in `RagIngestionServiceTest`, `RagSourceIngestionServiceTest` and the new `RestRagIngestionDeleteDocumentTest`.

***

## ✨ feat(hitl): approval bound to the exact plan — `planHash` (2026-11-05)

**Repo:** EDDI (`feat/hitl-plan-hash`)

### What changed and why

A HITL approval approved "this pause", but nothing tied it to the exact arguments or actions that then ran. Every pause now gets a **plan hash** when it is committed — inspect → plan hash → apply only with that hash:

* **What is hashed** ([`HitlPlanHash`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/HitlPlanHash.java)): SHA-256 over a canonical JSON document, reported as `v1:` + 64 hex. A tool pause covers the conversation, agent and version, the batch's `pauseEpoch`, a per-pause secret nonce, and every pending call in order (`callId`, `toolName`, `source`, `argsTruncated`, canonicalized raw arguments, request fingerprint when pinned). A rule (turn-level) pause covers the bookmark (pause id, workflow, task index) and the paused step's actions without `PAUSE_CONVERSATION`. A group pause covers the paused phase's transcript, the tasks awaiting approval and the synthesized answer.
* **Canonicalization**: keys sorted by UTF-16 code unit, arrays in order, numbers by value (`1` = `1.0` = `1e0`), strings as parsed (escapes decoded, no Unicode normalization); arguments that are not exactly one JSON document (duplicate keys, anything after the first value) are hashed as their exact text. The existing `JacksonCanonicalizer` was not reused because it keeps Jackson's number formatting (`1` ≠ `1.0`).
* **Stored with the pause**: `hitlPlanHash` on the conversation (cleared with the bookmark) and `planHash` + `planNonce` on the pending tool batch. Computed in `ConversationHitlService#populateHitlTimeoutBookmark`, i.e. after the turn's secret scrub rewrote the batch and before the store, so it covers exactly what is persisted. The nonce is never served (approver projection nulls it, names-only projection never copies it, the Mongo and PostgreSQL tail reads leave it on the server).
* **Checks** ([`HitlPlanBinding`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/HitlPlanBinding.java), one rule for both surfaces): a decision whose `planHash` is not the pause's → `409` before the CAS and again on the snapshot the resume runs; the resume re-derives the hash from the loaded plan and refuses (`409`, `WARN hitl.plan.changed`, pause restored) when it no longer matches; `ToolLoopResumer` re-derives it once more immediately before an approved call runs (`NOT_EXECUTED`, "the plan changed after it was approved").
* **Compatibility**: a decision without `planHash` is accepted and logged (`hitl.plan.not_presented`) unless strict binding is on — `hitlConfig.requirePlanHash` (agent or group) or `eddi.hitl.plan-hash.strict=true` — then it is a `400` and the pause is not consumed. `system:*` decisions are exempt. Pauses committed before this change have no hash and are decided as before, also under strict binding (`hitl.plan.legacy`).
* **A hash that cannot be computed fails closed under strict binding**: `HitlPlanHash.commit` never throws, so a hashing bug cannot stop pauses from committing, but the pause it could not hash stores the marker `"unavailable"` (conversation `hitlPlanHash` and batch `planHash`; it persists through both stores like any hash) instead of null. A null would have made it indistinguishable from a legacy pause, which strict binding accepts unbound. `HitlPlanBinding.check` refuses a human decision on a marked pause under strict binding (`409`, the pause is restored as for a mismatch). Without strict binding it accepts the decision, logs `WARN hitl.plan.unavailable` and records it as `PLAN_HASH_UNAVAILABLE`. `approval-status` (REST, MCP) and Slack cards serve `""` for the marker, and it never matches. Group plans are derived at decision time, not stored, so a failed derivation already fails the approve.
* **Surfaces**: REST `approval-status` (`planHash`) and the resume/approve bodies (`HitlDecision.planHash`); MCP `get_approval_status` / `get_group_approval_status` report it, `resume_conversation` / `approve_group_phase` take an optional `planHash` (`PLAN_CHANGED`, `PLAN_HASH_REQUIRED`); Slack buttons carry it as a fourth value field and the edit/reject modals keep it in their metadata, and a card whose plan is no longer the pending one is replaced by a "Not applied — the request has changed" notice without buttons; the Manager's `lib/hitl-pause-binding.ts` sends the shown plan from every approval surface, and the operator card sends it too.
* **Audit**: `hitl.approval` entries carry `planHash` and `planBinding` (`MATCHED` / `NOT_PRESENTED` / `SYSTEM` / `LEGACY_UNHASHED` / `PLAN_HASH_UNAVAILABLE`); every task a resume runs carries `input.hitlPlanHash`; `hitl_approved` trace entries carry `planHash`.
* **Platform Operator**: system prompt documents plan binding and strict mode; revision 60 → 61. It also names the `PLAN_HASH_UNAVAILABLE` outcome and what a pause whose hash could not be computed does under strict and non-strict binding.

**Docs:** [hitl.md → Plan Binding](https://docs.labs.ai/conversations-and-orchestration/hitl.md#plan-binding-planhash), [hitl-review-and-audit.md](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-review-and-audit.md), [hitl-approval-context.md](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-approval-context.md), [audit-ledger.md](https://docs.labs.ai/security-and-compliance/audit-ledger.md), [mcp-server.md](https://docs.labs.ai/protocols-and-integration/mcp-server.md), [configuration-reference.md](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [cryptography.md](https://docs.labs.ai/security-and-compliance/cryptography.md).

### Design decisions

* **Strict mode at two levels** (agent/group `hitlConfig.requirePlanHash` and deployment `eddi.hitl.plan-hash.strict`), either one enabling it: a designer protects high-stakes agents without breaking other clients; an operator turns it on everywhere once all clients send the hash. A failed config read counts as strict (fail closed).
* **Group plans are derived, not stored**: an `AWAITING_APPROVAL` discussion cannot change except through the approval, so the read-time hash is the stored state's hash.
* **Amended arguments are not re-hashed**: the hash binds what the reviewer was shown; the amendment is the reviewer's own recorded change.
* **The tool-call plan omits the pause id** (it uses the batch's `pauseEpoch` instead) so the tool loop can re-derive it after the bookmark is cleared.

### What's next

* Strict binding could become the default once every first-party client has shipped a release that sends the hash.

***

## 💬 refactor(manager): the Manager's chat on `AgentConversation` (2026-11-05)

**Repo:** EDDI (`refactor/manager-chat-on-conversation`, stacked on `feat/ui-eddi-conversation`)

Phase 3c of the frontend unification plan (`planning/frontend-unification-plan.md` §1.3, §2.5, §3.2, §7 phase 3): the Manager's 1:1 chat runs on [`@eddi/conversation`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/README.md)'s controller, and every markdown surface in the UIs renders through the one renderer.

### What changed and why

* **Host hooks on `AgentConversation`** ([`agent-conversation.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/agent-conversation.ts), [README](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/README.md#host-hooks)). The controller can keep its state in a host's store (`store`), follow a host's conversation generation (`generation`), let a replaced conversation's stream drain for a grace period before aborting it (`detachedGraceMs`), take undo/redo from `done` instead of a read (`refreshAfterStream: false`), show files as chips (`attachmentDisplay`, `send(text, secret, { attachments })`), read outputs a host's way (`outputTexts`), and hand events, turn boundaries, the finished snapshot, a failed turn's reason and every refusal or failure to the host (`onStreamEvent`, `onTurnStarting`, `onTurnEnd`, `onTurnSnapshot`, `turnFailure`, `presentFailure`). `send` resolves `{ outcome }`. Without the hooks it behaves as before; the widget's suites are unchanged. New rule for every surface: a secret turn never forwards an attachment.
* **`Message`** renders a sent message's attachments (image previews, file chips with size, "too large to send directly") and a reply's guardrail notes; **`ThinkingIndicator`** has a guardrail state (`guardrail`, `guardrailActive(messages, processing)`: "Checking the reply…"). The widget now shows both the notes and the state ([`chat/AGENTS.md`](https://github.com/labsai/EDDI/tree/main/ui/chat/AGENTS.md)). Eight `conversation.*` strings in the eleven locales (the guardrail lines are the Manager's existing translations). **`MarkdownContent`** gains `escapeRawHtml` (raw HTML shown as the text it is, for third-party text whose angle brackets are prose), and its image links carry `data-testid="markdown-image-link"`.
* **`ChatPanel` on the controller** ([`use-chat.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-chat.ts)). The Manager's send — streamed or not, the `done` reconcile, refusals, the detached-stream grace — is `chatConversation.send`; about 400 lines of its own turn loop (`handleSSEEvent`, `classifyRejectedSend`, `RejectedSendError`, the optimistic-message refs) are gone. The Zustand `useChatStore` stays the store every component reads: the controller writes it through `chatConversationStore`, and the store's own actions (agent picker, history, reset) advance the generation the controller follows. The Manager's copy is the hooks': a 409 is a pause only when a read confirms `AWAITING_HUMAN`, otherwise a toast; an error during a turn goes into the reply, flagged for "Retry Last Step"; a failed request keeps the message and adds an error bubble; the debug drawer gets every event (`recordDebugEvent`). The load guard, start, load/resume (with its masking of secret turns), following an executing turn, undo/redo/rerun and end stay Manager code. Every `use-chat*` and `use-send*` suite and every `ChatPanel` suite passes unmodified. That covers Agent Studio and Workforce chat, which render `ChatPanel`.
* **Visible in the Manager chat:** designer `image` output items render as images (live and from history; [`chat-message.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/chat/chat-message.tsx)); `button` labels and `applicationLink` links in a reply are shown (@eddi/core's reader; the flat `output:text:*` keys are still read); a turn dropped into a paused or busy conversation is withdrawn with a notice instead of staying as sent; the thinking line stays on between pipeline tasks until the first token (it used to blink off at each `task_complete`); and a guardrail at work on the reply says "Checking the reply…" ([`guardrail-activity.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/chat/guardrail-activity.tsx)).
* **The test drawer** ([`chat-drawer.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/chat/chat-drawer.tsx)) sends through `useSendMessage` and reads `useChatStore`, so it runs on the controller with `ChatPanel`; it gains the guardrail activity line, and designer images through `ChatMessage`. Its own composer, quick replies and masked field are unchanged (`chat-drawer*.test.tsx` unmodified).
* **One markdown renderer, enforced (§2.5).** The thirteen Manager files that called `ReactMarkdown` themselves — the group transcript, response, structured-turn, decision and overview cards and the artifacts panel, the Workforce board, advisor card, context card, conversation viewer and member thread, the Operator chat, and the update check's release notes — render through `ConversationMarkdown` (`MarkdownContent`). Each keeps raw HTML escaped as it was (`escapeRawHtml`); what they gain is KaTeX, highlighted code with a copy button and scrolling tables. [`one-renderer.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/markdown/one-renderer.test.ts) fails on any import of `react-markdown`, `remark-gfm`, `rehype-raw`, `rehype-sanitize` or `rehype-katex` outside the renderer's directory, in either app or any package, tests included — no exceptions. `markdownImageAsLink` is gone from [`markdown-safe.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/markdown-safe.tsx) (the renderer has the same rule); `sanitizeAgentHtml` stays for the group card's opt-in HTML view. The update card's test now finds the image link by the renderer's test id.
* **The Workforce member thread on the controller** ([`workforce-thread.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/pages/workforce/workforce-thread.tsx)). Its own stream loop (about 250 lines: the placeholder, settle, drop-turn and the event switch) is replaced by an `AgentConversation` per advisor, with an internal store read through `useAgentConversation`. The thread keeps its own presentation through the hooks: the error banner with Retry (`presentFailure` — a 409 withdraws the question, an error before any token keeps it for Retry to withdraw, a partial reply keeps it), the pause notice after a paused `done` (`onTurnSnapshot`), and "the connection ended" when a stream stops without `done` or `error`. A turn of files only still names the first file as its input. Visible: designer images render; Stop also asks the server to stop the turn (`POST /agents/{id}/cancel`, as the chat does) instead of only dropping the stream; a "New conversation" that fails to start keeps the old thread on screen, as before. Every thread suite passes unmodified; one new case covers designer images.
* **Feature matrix** ([`feature-matrix.spec.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/e2e/feature-matrix.spec.ts)). Now assertions: `output-images` on the chat panel (an MSW reply with an `image` item, `IMAGE_OUTPUT_TRIGGER`), and `katex`, `highlight` and `output-images` on the Workforce member thread (the same triggers, sent from the thread; its textarea gained `data-testid="thread-input"`). The operator's `katex` and `highlight` move from `no` to `unit`: it renders through the shared renderer, but the MSW tier has no activated operator.
* **Platform Operator.** No endpoint, field, default or failure mode changed, so neither its prompt nor its allow-list changed and `operator-revision.json` was not bumped; its chat only changed renderer. No Stryker-scoped file changed (`lib/operator/**`, `lib/api/updates.ts`, `lib/hitl-tool-approvals.ts`).

### Review fixes (2026-11-15)

* **A second pause after one resolved elsewhere is a pause again.** The controller judges a zero-token `done` reporting `AWAITING_HUMAN` against the state it held before the send (`isSkippedTurn`). The widget re-reads after a pause (`refreshAfterPause`), but the Manager's hosts only cleared their banner, so the controller kept `AWAITING_HUMAN` and the next turn that paused again was taken for one the server dropped: its message was withdrawn as "not sent", the Manager never raised the pause banner and the Workforce thread never its notice, and a re-send got a 409. New controller method `pauseResolved(state = "READY")` (clears the approval status, moves the state off `AWAITING_HUMAN`); the Manager calls it through `clearChatPause` from the chat panel's `PauseNotice`, the approvals inbox's resume and cancel ([`use-hitl.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-hitl.ts); cancel passes `EXECUTION_INTERRUPTED`), and the member thread calls it from its notice. The controller's undo/redo (`applyHistorySnapshot`) and `use-chat.ts`'s snapshot install, undo/redo and rerun now write the snapshot's `conversationState` too (`adoptConversationState`), and rerun re-establishes the pause banner like undo/redo; the thread's resume read sets it as well. Tests: [`agent-conversation.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/agent-conversation.test.ts) ("a pause resolved elsewhere"), [`chat-panel-pause-resolved.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/chat/__tests__/chat-panel-pause-resolved.test.tsx), [`workforce-thread-pause-resolved.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/pages/workforce/__tests__/workforce-thread-pause-resolved.test.tsx).
* **Controller notices are system lines.** A `kind: "notice"` message (the controller's "…was not sent", "Undo is not possible right now") rendered as an agent markdown bubble with a copy button. `ChatMessage` and the member thread render it through the new `ChatNotice` ([`chat-message.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/chat/chat-message.tsx)): a centred, plain-text `role="note"` line, no avatar, no copy, no rating.
* **Secrets do not outlive the conversation.** `reset()` now drops the raw texts of secret turns, and `forgetSecrets()` does it alone; the Manager's app-wide `chatConversation` kept every secret typed in a session across agent switches and logout. The chat store's `setSelectedAgent`, `clearMessages` and `reset` call it ([`use-chat-forget-secrets.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/hooks/__tests__/use-chat-forget-secrets.test.ts)).

### Merged with #1280's final fixes (2026-11-16)

* **`main` merged after #1280 was squash-merged.** Both sides' controller behaviour is kept: #1280's `turnsSent` guard reaches the extracted `readStream` (a late re-read no longer writes undo/redo over a newer turn's), `resume()` aborts the running turn and takes a generation first (read through `currentGeneration`, so a host generation still governs), the local transport's stale-turn checks return the turn result, and the restored-step state comment covers both the ERROR and the resolved-pause case.
* **The live tool is a `ToolActivity` in the Manager too.** `use-chat.ts`'s `activeTool` and `recordDebugEvent` follow `@eddi/core`'s `ToolActivity`: `tool_call` goes through `parseToolCallEvent` / `toolCallActivity` (the designer's `toolDisplay` label), and `tool_result` settles the newest call. `ThinkingIndicator` keeps #1283's guardrail state with #1280's tool phrasing.
* **Test ids for the CodeRabbit nitpicks.** `message-no-response` ([`chat-message.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/chat/chat-message.tsx)), `thread-no-response` and `thread-send` ([`workforce-thread.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/pages/workforce/workforce-thread.tsx)); the image and pause-resolution tests use them instead of copy.

### Not done

* **The member thread renders no quick replies, requested field or secret input yet.** The controller tracks them for it; rendering them (the Manager's quick-reply buttons and `SecretInputField`) and an MSW reply that offers them are what flip those cells. Its history cell stays `no` (a thread is one pinned conversation).
* The thread's resume and welcome read `conversationSteps` with its own parser, not the controller's `applySnapshot`.
* The matrix has no test-drawer column: the MSW tier cannot open the drawer without the save-and-deploy flow. The drawer shares the chat panel's controller and bubble.
* Start, load/resume, undo, redo and rerun in `use-chat.ts` are not the controller's yet: they install snapshots with the Manager's secret masking and attachment-preview carry-over, which the controller's `stepsToMessages` does not do.

### Next

Quick replies and the requested field in the member thread, the controller's snapshot install for `use-chat.ts`'s load/undo/redo; then phase 4.

***

## feat(rag): retrieval benchmark — golden queries, recall\@k, MRR, baseline diff (2026-11-05)

**Repo:** EDDI (`feat/rag-retrieval-eval`)

### Why

There was no way to tell whether a RAG change — chunking, embedding model, `minScore` — made retrieval better or worse. `POST /ragstore/rags/{id}/search` shows one query at a time, and comparing two configurations meant eyeballing result lists.

### What changed

* **`POST /ragstore/rags/{id}/evaluate?version=N`** (`IRestRagIngestion`, `RestRagIngestion`): takes golden queries `[{id?, query, expected[], k?}]`, runs each through the **same** `KnowledgeBaseInspector.search` call `/search` uses (no second retriever), and returns per query `firstHitRank`, `hit` (hit\@k), `reciprocalRank`, `recall` (recall\@k), `found`, `missing` and the ranked identifiers retrieved, plus `summary` (`hitRate`, `recall`, `mrr`). With a `baseline` (an earlier response's `queries`) it adds a `comparison`: per-query and aggregate deltas, regressions flagged. EDIT, like `/search`.
* **`RetrievalMetrics`** (`modules/rag/evaluation`): the metric math as a pure class, unit-tested on its own.
* **`eddi.rag.evaluation.max-queries`** (default `100`): queries per request; more is a 400 naming the setting. Every validation (empty query, no expected documents, `k` outside 1–50, `minScore` outside 0–1, duplicate query keys) runs before the first embedding call.
* Docs: [rag.md → Evaluating retrieval](https://docs.labs.ai/agent-configuration/rag.md#evaluating-retrieval), the endpoint table, and [configuration-reference.md](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md). OpenAPI snapshot for the Manager's contract test gains the operation.

### Design decisions

* **Hit = exact, case-sensitive equality** of an expected identifier with the value of one of the `matchKeys` in a chunk's metadata. Default keys `source` (a direct ingest's `documentName`), `documentId` and `url` (an ingestion source's document), so both ingestion paths work without configuration; `matchKeys` overrides them (e.g. `title` for an upload's file name).
* **recall\@k is per-document** (distinct expected documents found / expected, averaged), and hit rate is returned beside it — they differ whenever a query expects more than one document. Chunks of one document count once.
* **Reciprocal rank is cut at k** (0 without a hit in the top k), so `mrr` is MRR\@k.
* **A query with nothing expected is refused** (400) at the endpoint; the math class treats it as unscorable (null recall, left out of every average) rather than as a perfect or failed answer.
* **Baseline pairing by `id`, else query text**; duplicate keys on either side are a 400. Aggregate deltas are over the queries both runs contain; the rest are listed (`onlyInCurrent`, `onlyInBaseline`). A query **regressed** if its reciprocal rank *or* recall fell; `kChanged` marks a different cut-off.
* **A knowledge base `maxResults` above 50 is clamped** to the search ceiling for the default k, while an explicit `k` above 50 is refused — the benchmark never reports a k it did not look at.
* **One failure fails the run** (502 with `queryIndex`), no partial results: a benchmark missing queries compares badly with its baseline.

### Not done / next

* No MCP tool (there is no RAG tool family yet; adding one means a new tool class, roles and the tool-count docs) and no Manager UI. The Platform Operator is not given the endpoint, matching `/search`, which it also does not hold.

***

## ♻️ refactor(ingestion): provider-neutral source connector contract (F1) (2026-11-05)

**Repo:** EDDI (`refactor/ingestion-source-connector-contract`)

### What changed and why

This is the foundation of the ingestion source types plan (`planning/rag-ingestion-source-types-plan.md` §3.1, §3.2, §3.5). `IngestionPipeline` was hard-wired to the web crawler and the uploaded-file store. It now dispatches every run through a `SourceConnector` chosen by `IngestionSource.type`, so that provider-specific Java lives only in connectors. **There is no behaviour change**: the existing ingestion tests pass without modification.

* **The contract** (new package `modules/ingestion/connector`):
  * `SourceConnector`: `discover(DiscoveryContext) → DiscoveryResult` lists from a cursor and streams `WorkItem`s to `context.accept`. `fetch(WorkItem, SourceContext) → SourceDocument` reads one document. `listPartitions` and `verifyAccess` default to one implicit, always-accessible partition.
  * `WorkItem` carries `action` `UPSERT`/`UNCHANGED`/`DELETE`, a version token, hints, and an optional prefetched document.
  * `SourceDocument` has `Content` `HtmlPage`/`FileBytes`/`Text`, a version token, HTTP validators and metadata.
  * `SourceMetadataKeys` defines the standard vocabulary and reserves `acl.principals`, which is schema only.
  * `Coverage` is `FULL_LISTING`/`FULL_TRAVERSAL`/`INCREMENTAL`/`PARTIAL`. `StopReason` uses the same names as `WebCrawler.StopReason`.
  * `SourceError` is a sealed type: `Transient`, `Throttled`, `Auth`, `NotFound`, `Permanent`, `Rejected` and `CursorInvalid`, plus `isDefinitive()`. The checked `SourceException` carries it. `Permanent` is an answer about the document (it can never be read as it is). `Rejected` is a request the provider refused as made (malformed, an unknown field mask). It says nothing about the document and is not definitive, so a connector defect or an API change cannot tombstone a corpus.
  * `KnownVersion`, `Partition` and `SourceContext`.
  * `SourceConnectors` is the CDI registry by type, and fails startup when two beans claim one type.
* **Adapters:** `crawl/WebSourceConnector` wraps `WebCrawler` unchanged. Pages arrive prefetched, a 304 becomes `UNCHANGED`, and crawl errors are classified so that `isDefinitive()` is exactly the crawler's `!contentUnknown`. `files/UploadSourceConnector` lists without reading, uses the hash of the bytes as the version token, and maps a deleted-meanwhile file to `NotFound` and a store failure to `Transient`. The `toCrawlRequest` and upload listing loop moved into the adapters verbatim.
* **Pipeline:** `Collector` no longer implements `CrawlSink`. It processes work items generically. Text extraction stays in the framework, selected by content kind, which keeps the page-skipped-when-blank and file-failed-when-blank semantics. The old 8-argument constructor remains and builds the two connectors. CDI uses a new constructor that takes `SourceConnectors`.
* **Traversal evidence is counted, not inferred.** The blank-site guard (`learnedSomething`) used to treat `failed - unreachable` as definitive answers. A source-level failure (no document id) counts as failed but was never unreachable, so a `FULL_TRAVERSAL` run that learned nothing about any document passed for one that saw the corpus gone, and its absence-based deletion ran. `Collector` now counts `definitive` where it is learned: a document-level `NotFound`/`Permanent`, or a file with no text. Embed and budget failures no longer stand in for evidence either. That is the safe direction, since the only effect is that reconciliation runs less often. The now write-only `unreachable` counter is gone.
* **Config models only, not wired:** `SourceFilters` (`formats`, `excludeNamePatterns`, `includePaths`, `maxFileBytes`) and `SourcePartitions` (`LISTED` | `ALL_ACCESSIBLE`, `ids`).
* **Docs:** a "Source connectors" section in [`rag.md`](https://docs.labs.ai/agent-configuration/rag.md#source-connectors-for-contributors).

### Not in this slice

The following are not in F1:

* **Cursors are not stored.** The pipeline passes none and ignores a returned one, so every run lists in full.
* **No multi-partition runs.** More than one partition is refused with a run failure.
* **No work queue or workers, and no superseding of item versions.** These are F2 and F3.
* **`DELETE` items** are applied directly: vectors are removed first, then the item is tombstoned. No built-in connector emits them yet.

**Files:** [`IngestionPipeline.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/IngestionPipeline.java), [`connector/`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/connector/SourceConnector.java), [`WebSourceConnector.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/crawl/WebSourceConnector.java), [`UploadSourceConnector.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/ingestion/files/UploadSourceConnector.java), [`SourceFilters.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/rag/model/SourceFilters.java), [`SourcePartitions.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/rag/model/SourcePartitions.java)

***

## ♻️ refactor(email): opaque mailbox cursor and a processedAction vocabulary for the next mail transports (2026-11-05)

**Repo:** EDDI (`refactor/mail-transport-cursor`)

### What changed and why

`MailTransport.MailboxSession` was IMAP-shaped (`uidValidity()`, `uidNext()`, `messagesAfter(long lastUid, …)`), and the poller and the state store kept UIDs. The Gmail API transport (cursor = `historyId`) and the Microsoft Graph transport (cursor = a mail-folder `deltaLink`) that come next must each be one class with no poller change (email plan §7.2, Phases 4 and 6). No behaviour change for IMAP: every existing email test passes with its assertions unchanged.

* **`MailboxCursor`** (new, `integrations/email/transport`) — opaque, `<transport>:<position>`; the poller never reads inside it. **`ImapCursor`** is IMAP's reading (`<UIDVALIDITY>:<last UID>`, exactly the two values stored before).
* **`MailboxSession`** is now `startCursor()` and `messagesAfter(MailboxCursor, int) → Batch`. A `Batch` carries entries (each message with the cursor that settles it), a `start` cursor (kept when nothing is settled), an `end` cursor (stored when everything is settled — for a history transport it may lie past the last message) and `cursorReset`, which replaces the poller's "UIDVALIDITY changed" branch: same WARN, same `eddi.email.poll.cursor_resets`, same rescan deduplicated by the ledger.
* **`UidFolderSession`** (new) — the IMAP cursor logic on three UID primitives; `ImapMailTransport.ImapSession` extends it. A cursor written by another transport is treated as a reset.
* **`MailboxMessage.uid()`** is a default (`-1`); only UID sessions use it.
* **State store** — `MailboxState` carries a `MailboxCursor` (`uidValidity()`/`lastUid()` remain as derived IMAP views); `saveCursor(…, MailboxCursor, …)`, with the old `(uidValidity, lastUid)` overload as a default method. MongoDB adds the field `mailboxCursor`, PostgreSQL the column `mailbox_cursor` (`ADD COLUMN IF NOT EXISTS`). `StoredCursor` maps both the same way.
* **`processedAction`** is parsed by the new `EmailProcessedAction`: `flag`, `move:<folder>`, `label:<name>`. `flag` and `move:` behave as before; `label:` is refused at save time for `imap` ("needs a transport with labels; IMAP has none") because IMAP marking only ever sets the fixed keyword `$EddiProcessed`. `EmailChannelSettings` carries the parsed action; `moveToFolder()`/`movesProcessed()` are derived from it.
* **Find by Message-ID** was already a transport method (`MailboxSession.findByMessageId`); no shared code searched IMAP, so nothing moved.

### Design decisions

* **Persisted state stays compatible in both directions.** An IMAP cursor is written to the new serialised field *and* to the legacy `uidValidity`/`lastUid` (`uid_validity`/`last_uid`); for IMAP the legacy fields win on read. State written before this change has no serialised cursor and loads as the same IMAP cursor, without migration. A node still on the old version (rolling upgrade, rollback) only writes the legacy fields, so letting them win means a stale serialised cursor can never override them. A non-IMAP cursor is stored only in the new field, with the legacy fields at 0 ("no IMAP cursor").
* `MailboxCursor.toString()` names the transport only — a Graph delta link does not belong in a log line.
* Test edits are mechanical: `EmailMailboxPollerTest`'s fake session is now `new UidFolderSession()` instead of `new MailboxSession()`, and the test-only `InMemoryEmailMailboxStateStore` stores a cursor.

Docs: [`email-integration.md`](https://docs.labs.ai/protocols-and-integration/email-integration.md) (`processedAction` row, the ledger section on the cursor).

**Files:** [`MailboxCursor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/transport/MailboxCursor.java), [`ImapCursor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/transport/ImapCursor.java), [`UidFolderSession.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/transport/UidFolderSession.java), [`StoredCursor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/ledger/StoredCursor.java), [`EmailProcessedAction.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/channels/model/EmailProcessedAction.java), `MailTransport.java`, `ImapMailTransport.java`, `EmailMailboxPoller.java`, `IEmailMailboxStateStore.java`, `MongoEmailMailboxStateStore.java`, `PostgresEmailMailboxStateStore.java`, `EmailChannelSettings.java`. Tests: `MailboxCursorTest`, `StoredCursorTest`, `EmailProcessedActionTest`, `EmailMailboxPollerCursorTest`.

### Next

The Gmail API transport (Phase 6) and the Graph transport (Phase 4) as one `MailTransport` each, plus a transport registry so the poller picks the transport by `platformConfig.transport` instead of injecting `ImapMailTransport`.

***

## 📝 docs(release): close the 6.7.0 upgrade-guide and release-notes gaps (2026-11-05)

**Repo:** EDDI (`docs/release-6.7.0-docs-gaps`)

### What changed and why

"Changes in 6.7" in [`upgrading-from-6.5.md`](https://docs.labs.ai/deployment-and-infrastructure/upgrading-from-6.5.md) and the 6.7.0 row of [`release-notes.md`](https://docs.labs.ai/deployment-and-infrastructure/release-notes.md) were written before the team learning loop, team lessons, the agent operations tools, the tenant cost reservation, per-run `toolQuotas`, the email channel, conversation ratings and alert rules were all merged. The upgrade guide now lists each in "New opt-in features" with its switch and page, and "Rolling upgrades" says which stored fields (`TaskItem.bet`, `lessonConfig`) an older pod drops on save, which new collections and tables older pods ignore, and that the alerts maintenance schedule exists by default and should be switched off until every pod runs 6.7, and how to delete the already-created marked schedule (MongoDB and PostgreSQL) before rolling back, since disabling alerts does not remove it and REST refuses to. The release-notes row gets the release date 2026-11-05 (the `6.7.0` tag date) and the missing headline items. [`email-integration.md`](https://docs.labs.ai/protocols-and-integration/email-integration.md) said "Since v6.6.0"; the channel merged after the 6.6.0 tag, so it now says v6.7.0.

### Design decisions

* The date is the plain release date: the `6.7.0` tag exists and the release was published on 2026-11-05, and the table defines dates as tag dates.
* Release pointers (Helm `appVersion`, manifests, docs commands) are left to the post-release PR.

***

## 🧪 test(rag): document replacement verified on a real Chroma server (2026-11-05)

**Repo:** EDDI (`test/chroma-replacement-it`)

### What changed and why

[`rag.md`](https://docs.labs.ai/agent-configuration/rag.md#store-support-for-replacement) said replacing a document's chunks — the `removeAll(Filter)` on `documentId` + `sourceKey` that a re-ingest, a tombstone and a deleted upload all end in — was verified only on `in-memory` and `pgvector`, with Chroma merely "expected". Nothing checked it, and a driver that cannot translate the compound filter leaves stale chunks retrievable for good.

New [`ChromaReplacementIT`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/ingestion/ChromaReplacementIT.java) starts `chromadb/chroma:1.1.0` (the image `docker-compose.chroma.yml` ships) and drives the real `IngestionPipeline` through the real `EmbeddingStoreFactory`, so the store is the one `buildChroma` makes, on its default `apiVersion` `V2` with its bounded JDK client. Only the embedding model is an offline bag-of-words stand-in. Three cases, each asserting on what is actually in the collection:

* a changed page is re-ingested: the new text is there, the old text is gone, `replaceUnsupported` is false — this exercises the three-clause filter including `runId $ne`;
* a page removed from the site is tombstoned: its chunks are deleted, the surviving page's are not;
* a deleted upload is forgotten: `ForgetOutcome.REMOVED`, and the source's other document survives.

All pass locally against the container, so the docs now list Chroma as verified. `mongodb-atlas`, `elasticsearch` and `qdrant` remain "expected".

### Notes

* Run locally from a sandboxed Windows shell, the JDK `HttpClient` could not open its selector ("Unable to establish loopback connection" — the NIO pipe's Unix-domain socket under a long temp path). `-DargLine=-Djdk.net.unixdomain.tmpdir=<short dir>` works around it; CI is unaffected.

**Files:** [`ChromaReplacementIT.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/modules/ingestion/ChromaReplacementIT.java), [`rag.md`](https://docs.labs.ai/agent-configuration/rag.md)

***

## 💬 feat(ui): `@eddi/conversation` — the agent kind (2026-11-05)

**Repo:** EDDI (`feat/ui-eddi-conversation`, stacked on `feat/ui-eddi-ui`)

Phase 3b of the frontend unification plan (`planning/frontend-unification-plan.md` §1.3, §2.5, §3.1, §3.2, §7 phase 3, D9): the third shared package, [`@eddi/conversation`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/README.md), with the `AgentConversation` controller.

### What changed and why

* **`AgentConversation`** ([`agent-conversation.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/agent-conversation.ts)) — the 1:1 turn state machine, framework-free (`subscribe` / `getSnapshot`, read through `useSyncExternalStore`), on `@eddi/core`: streaming, a 409 that restores the draft, dropped vs paused turns, `inputField` on `done`, undo/redo, rerun, stop, cancel, the refresh after a pause, and `resume(conversationId)`, which restores the last output's quick replies. Its suite is the union of the 1:1 loops' turn rules, without React.
* **The shared `conversation.*` strings** in the eleven locales; the Manager's `i18n:check` reads a package's own locale files with the app's.
* **The shared components** — `Message`, `MessageList`, `Composer`, `SecretInput`, `QuickReplies`, `ThinkingIndicator` / `TypingIndicator`, `PausedCard`, `RatingCard`, `StepRating`, `ScrollToBottom` — moved from the widget with their history, and **the one markdown renderer** (`MarkdownContent`, §2.5): images in model text as links, raw HTML only through rehype-sanitize (parser lazy, still rendered for every agent until D9's setting), KaTeX (`trust: false`) and highlight.js lazy. GFM is now parsed without its serialiser ([`remark-gfm-parse.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/markdown/remark-gfm-parse.ts)): remark-gfm also registered mdast-util-to-markdown and markdown-table, which a renderer never calls — about 4 KB of gzip off every first load that renders markdown; a test renders a corpus both ways and compares.
* **The widget (`ui/chat`) on the controller.** `ChatProvider` owns one `AgentConversation` and keeps the widget's own state beside it (config, agent name, review notice, rating profile); `useChatState()` / `useChatDispatch()` are unchanged for components. `ChatWidget` keeps the embedding — route, `?token=`/postMessage auth, URL colours, `hide*` flags, the profile gate, ratings, HITL polling — and hands the route to the controller as a transport (conversation, managed, or the demo's `createDemoTransport`). Deleted: `turn-notices.ts`, `api/hitl-api.ts`, `ime.ts` (now in the package). The component tests stay in the widget and import from `@eddi/conversation`; `chat-store.test.tsx` and every `ChatWidget.*` suite pass unmodified. The 108 moved strings left `src/i18n/locales` for the package's (`conversation.` prefix, same translations). Visible changes: none intended; a guardrail notice is now recorded on the reply it explains (the widget does not render it yet). First load 167.7 KB gz (was 169.3; budget 170).
* **The Manager's chat bubble on the one renderer.** `chat-message.tsx` — the Chat page, Agent Studio, the test drawer and Workforce chat — renders replies through `MarkdownContent` ([`conversation-markdown.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/i18next/conversation-markdown.tsx), with the Manager's `t` for the shared strings, which `i18n/config.ts` now merges in). Visible: KaTeX for `$$…$$`, highlighted fenced code with a copy button, links in a new tab, and raw HTML rendered **sanitised** instead of shown as escaped text (D9: every agent until the per-agent setting). `@eddi/conversation/markdown.css` styles the copy button, tables and highlight tokens from the shared tokens. The feature matrix's KaTeX and highlight cells for `chat-panel` are now assertions (an MSW reply with math and code, `RICH_MARKDOWN_TRIGGER`).
* **Quick replies on resume (Manager).** A conversation reopened from history, or resumed on opening an agent, now offers the last reply's quick replies again (`installSnapshot`, `use-chat-load-pause.test.tsx`) — the same rule as `AgentConversation.resume`, kept in `use-chat.ts` until `ChatPanel` moves onto the controller. Mutation-checked: without the line, the new test fails.
* **Widget RTL e2e.** [`chat-widget-rtl.fullstack.spec.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/e2e/fullstack/chat-widget-rtl.fullstack.spec.ts) opens `/chat/demo/showcase?lang=ar` against the real server (the only tier that serves `/chat`) and checks `dir="rtl"` and the mirrored composer and message layout.
* **Gates.** CI's `UI Chat` job runs the package's type check, lint and tests; `sharedPackage({ routerFree: true })` and `boundaries.test.ts` keep it router-free, off `window.__EDDI_*__`, and unimported by `@eddi/core` and `@eddi/ui`; `AutoApproveCopilotPolicyTest` covers its config files.
* **Archived changelog links.** Nine links in `docs/changelog/2026-09.md`, `2026-10.md` and the phase-0 fragment named widget components this change moves; they now point at the package files (`DocumentationLinksTest`). Only the link targets changed.
* **Platform Operator.** No endpoint, field, default or failure mode changed, and the operator's own chat is untouched (phase 6), so neither its prompt nor its allow-list changed and `operator-revision.json` was not bumped. No Stryker-scoped file changed.

### Not done

* **`ChatPanel` (`use-chat.ts`), the test drawer, Workforce chat and the Workforce member thread are not on `AgentConversation` yet.** The Manager loop differs from the widget's in ways each of its 30 suites pins (error bubbles and toasts where the widget writes notices, the conversation epoch and detached-stream grace, the load guard, following an executing turn, debug events, agent selection); moving it is a step of its own. They share the renderer and the resume rule only. The Operator stays on its own code (phase 6).
* `Message` does not render a sent message's attachments or a reply's guardrail notes yet (the widget never had them; the Manager's bubble still does), and `ActivityIndicator` has no guardrail state. `MessageList` is not windowed (sticky scroll only).
* The §2.5 test that fails on a `ReactMarkdown` import bypassing the shared renderer is not written: thirteen Manager files (groups, Workforce, the Operator, update check) still use their own.
* Feature matrix: `output-images` stays unsupported on the chat panel (the Manager's bubble renders text parts only); the widget's `history` and `inline-hitl` cells are unchanged by design.

### Next

`ChatPanel` and the test drawer onto `AgentConversation` and the shared components (then Workforce chat and the member thread), with the Manager's error copy as the controller's notices; then phase 4.

***

## ✨ feat(memory): contested and superseded user memories instead of log-only contradictions (2026-11-05)

**Repo:** EDDI (`feat/user-memory-contested`)

### What changed and why

Dream detected user-memory contradictions (one key, different values — possible because `self`/`group` entries are keyed per agent and the `global` row is shared) but only counted and logged them, and `contradictionResolution` was documented as "Reserved". It is now implemented as a small claim ledger: no strategy deletes an entry or silently picks a winner. See [User Memory → Contradiction resolution](https://docs.labs.ai/architecture-and-concepts/user-memory.md#contradiction-resolution).

* **Model** — [`UserMemoryEntry`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/properties/model/UserMemoryEntry.java) gains `assessment` (`ACCEPTED` / `CONTESTED` / `SUPERSEDED`; `null` and unknown read as `ACCEPTED`) and `supersededBy` (kept only on a superseded entry). The 13-argument constructor stays and builds an `ACCEPTED` entry, so every existing call site and old JSON body is unchanged. `conflicted` — already on the record and shown by the Manager, but never set — now mirrors `CONTESTED`.
* **Stores** — MongoDB and PostgreSQL read and write both fields on every path (upsert, `insertIfAbsent`, `upsertIfOwnedBy`, `replaceIfUnchanged`, the mappers); the flat `mergeProperties` resets to `ACCEPTED`. PostgreSQL adds the two columns with `ALTER TABLE … ADD COLUMN IF NOT EXISTS` (default `ACCEPTED` for existing rows). Every value write — upsert, `upsertReserved`, `insertIfAbsent`, `upsertIfOwnedBy`, `replaceIfUnchanged`, on both stores — stores the entry as `UserMemoryEntry.asStatement()` (`ACCEPTED`, no `supersededBy`, `conflicted=false`) whatever it carries, so a REST client that PUTs back an edited contested entry cannot keep the old verdict (review finding on PR #1295); `UserMemoryWriteRules.withDefaults` applies the same rule at the REST boundary. New `IUserMemoryStore.setAssessmentIfUnchanged` — a compare-and-set on `updatedAt` that deliberately does **not** bump `updatedAt`, one conditional statement on both backends, and now the only write that can record a verdict (its interface default refuses instead of going through `upsert`).
* **Dream** — the decision is a pure function, [`UserMemoryContradictions`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/UserMemoryContradictions.java); `DreamService.resolveContradictions` (replacing `detectContradictions`) logs exactly as before and writes the changes. `keep_newest` (default) changes nothing; `mark_contested` flags both sides; `supersede_older` retires the older side only where the newer one reaches all of its readers, otherwise contests. Writes stay inside the agent-scoped set (`crossAgentMaintenance`, `_gdpr_` keys excluded) like pruning; a lost CAS counts in `conflictsSkipped`. Stale verdicts are lifted in every mode. Unknown values WARN and act as `keep_newest`. Contested and superseded entries are held back from summarization (`acceptedOnly`).
* **Loading** — `Conversation.mostSpecificPerKey` drops a superseded entry when its key has a non-superseded visible entry; contested entries load as usual plus a conversation-scoped `contestedMemories` map (`key → true`). Persisting a rewritten key drops it from the marker, and so does a `rememberFact` write of the key (the tool writes the store directly, so end-of-turn persistence never saw it and the marker outlived the user's confirmation; lifting lives in `ContestedMemoryMarker`, review finding on PR #1295). `UserMemoryTool` marks contested/superseded lines in recall and search, and a re-statement of a contested value is a write (it confirms the fact). `forgetFact` deletes the whole supersession chain of the forgotten entry (every same-key entry linked through `supersededBy`, in either direction), limited to entries this agent may see and delete; before, forgetting the newest version left the `SUPERSEDED` one behind, and the loader served its older value again as the reader's only entry for the key (review finding on PR #1295). The linked versions are deleted before the forgotten entry, farthest first, so a failure part way leaves the forgotten entry and a chain still connected to it for a retry; deleting the entry first left older versions whose replacement was gone, served again and unreachable by a retry's chain walk (review finding on PR #1295).
* **Metrics** — `eddi.dream.contradictions.contested`, `.superseded`, `.cleared`, charted with a legend on the Full Metrics dashboard (Kubernetes copy re-synced) and listed in [metrics.md](https://docs.labs.ai/deployment-and-infrastructure/metrics.md). GDPR export carries the new fields ([gdpr-compliance.md](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md)).

### Design decisions

* Default stays log-only; the name `keep_newest` is historical — Dream keeps no value, the loader's precedence decides.
* An assessment is not a write of the fact, so it leaves `updatedAt` alone (staleness pruning and `most_recent` recall unaffected).
* The competing value is never exposed to the agent — it may be another agent's `self` memory.
* Known limit: a property setter re-setting a contested property to its current value writes nothing, so it does not resolve the contest (use `rememberFact`, REST or MCP).

### Next

Manager: show `assessment`/`supersededBy` on the memory page (it already highlights `conflicted`).

***

## Workforce as its own app — frontend unification phase 5 (2026-11-05)

**Repo:** EDDI · **Branch:** `feat/workforce-app` (stacked on `feat/workforce-sidebar-home`, PR #1284)

Phase 5 of the frontend unification plan (`planning/frontend-unification-plan.md`, §3.1, §4.1, §4.2, §7): Workforce leaves the Manager's bundle and becomes `ui/workforce`, an app of its own beside `ui/manager` and `ui/chat`, with its own `workforce.html`, `main.tsx`, router, i18n, tests and E2E suite. It loads only what it uses.

**What changed**

* **`ui/workforce`** — `src/app.tsx` holds the `/workforce/**` routes the Manager's `app.tsx` used to; `src/main.tsx` boots through `startApp`. The Workforce components, pages, hooks and libs moved here with `git mv` (64 modules, 55 test files), so `git log --follow` traces them. Dev server on port 3002, MSW `ui` E2E tier (`playwright.config.ts`), its own Vitest config, ESLint, tsconfigs, `AGENTS.md` and `CLAUDE.md`.
* **`@eddi/app-kit` (`ui/packages/app-kit`)** — a fourth shared package: the layer the two signed-in apps share. Workforce rendered some two hundred Manager modules (the API client and hooks, the Keycloak session, the UI primitives, the group, chat and editor components, the mock API); they moved here at the paths they had, imported as `@eddi/app-kit/<path>`. Also new in it: `startApp` and `AppProviders` (both apps boot and wrap the same way), `setupAppI18n` (each app's strings deep-merged with the package's and `@eddi/conversation`'s), `styles/app.css` (the base stylesheet, with `@source`), and `AppLink` / `AppNavigate` / `useAppNavigate` over `lib/app-paths.ts`.
* **Moving between the apps is a page load.** A `<Link>` from one router to the other app's path matches nothing, so every cross-app link (the welcome chooser's Workforce card and its `eddi-user` redirect, the mode switcher, Workforce's links into the Manager, the Operator link, the pause notice's review link) goes through `AppLink` / `AppNavigate` / `useAppNavigate`, which keep the router inside the app. Theme, language, pins and the Keycloak session carry over through same-origin storage (keys unchanged).
* **The Manager loses the Workforce routes**, the `workforce.html` build input, `workforce-pins` (now `@eddi/app-kit`, since the Manager's sign-out clears it) and its Workforce tests. Six mixed tests were split between the apps; the group rendering matrix keeps one shared fixture list (`@eddi/app-kit/test/group-message-matrix`).
* **The mock API is shared, not split.** Every MSW handler the Workforce screens call is also called by the Manager (the catalog included: `use-chat` reads it), so there was no Workforce-only set to drop; the handlers moved to `@eddi/app-kit/test/mocks`, and both apps' tests and dev servers run on them. The OpenAPI contract test stays in the Manager.
* **i18n** — the Manager's locale files were split by who uses each key: 1,133 keys to `@eddi/app-kit`, 613 to Workforce, 5,128 stay in the Manager, in all 11 locales. `check-i18n.mjs` moved to `ui/scripts/` and checks the app it runs from.
* **Guards** — `appBoundary` in `ui/eslint.config.base.js` (with the tests-must-fail rules, now shared as `signedInApp`) fails a Manager import of Workforce code and the reverse; `src/__tests__/app-boundary.test.ts` in each app checks resolved paths. `route-integrity` is a shared suite each app runs over its own table and the shared modules it renders, and fails a router link into the other app. `core/src/boundaries.test.ts` resolves relative paths (app-kit has `components/chat/` and `components/workforce/` of its own), keeps the three packages below app-kit from importing it, and checks that its `exports` reach every module.
* **The production bundles no longer carry the mock API.** `main.tsx` passes `startApp` the MSW loader as `import.meta.env.DEV ? () => import(…) : undefined`.
* **Build** — `pom.xml` builds `ui/workforce` (`workforce-build`), copies its `dist/` beside the Manager's (`workforce.html` at the root, chunks under `assets/`), cleans `ui/workforce/dist`, and `-DskipUi=true` skips it. The jar layout is unchanged: `RestWorkforceResource` still serves `workforce.html` for every `/workforce/**` path, so deep links and reloads (`?agentId=&conversationId=`) work as before, with no Java change. `ui/scripts/` now holds the shared build tooling (`vite-plugin-brand.mjs`, `vite-backend-proxy.mjs`, `install-playwright-chromium.mjs`); the dev proxy gained `/catalog`, which it never forwarded.
* **CI** — a `UI Workforce` job (app-kit type check and lint, lint, i18n, type check, tests, build, budget, MSW E2E) in the UI Gate; Build Image checks the packaged assets against both builds; the SBOM gains `bom-ui-workforce.json`; CodeQL scans `ui/workforce/src`; Dependabot's `/ui` entry already covered it.
* **Budgets** (`ui/bundle-budget.json`) — Workforce gets its own: 251.2 KB gz first load measured at the split (it loaded the Manager's whole 629.4 KB entry before), budget 280 KB. The Manager's first load fell from 629.4 to 604.1 KB gz with what left it (Workforce's strings above all), so its budget is lowered from 630 to 620 KB; the widget's is unchanged.

**Design decisions**

* *A fourth package rather than the plan's three.* The modules Workforce needs read the router, call the backend and read `window.__EDDI_*__`, which `@eddi/ui` and `@eddi/conversation` forbid; loosening those rules, or letting Workforce import the Manager, were the alternatives. `@eddi/app-kit` is app code shared by two apps; what phase 6 moves into `@eddi/conversation` (the team kind) leaves it.
* *Paths kept, not redesigned.* Modules kept their relative paths, so a Manager import changed from `@/x` to `@eddi/app-kit/x` and nothing else — reviewable, scriptable, and `git mv` keeps the history.
* *No index barrel.* The package's `exports` map directories, so an app's first load holds only what it reaches.
* *Rejected: `/workforce/index.html`.* The shells stay at the jar root as the backend expects (`BrandedShell`); a new layout would have needed Java and test changes for no user-visible gain.

**Follow-ups:** phase 6 (Operator and team kinds) drains the group components out of `@eddi/app-kit`; `use-current-screen-context.ts` still maps `/workforce` screens, which the Manager no longer renders.

***

## ✨ feat(workforce): sidebar of conversations, Home, the chat in the URL; the widget follows rawHtml (2026-11-05)

**Repo:** EDDI (`feat/workforce-sidebar-home`, stacked on `refactor/manager-chat-on-conversation` with #1273 and #1282 merged in)

The frontend half of phase 4 of the frontend unification plan (`planning/frontend-unification-plan.md`, T1.1, T1.2, T1.4 and T1.15; B1/B2/B4; decisions D7 and D9), for every Workforce role, end users first.

### What changed and why

* **Sidebar (T1.1, T1.2).** [`session-list.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/session-list.tsx) lists the signed-in person's chats and team sessions in the Workforce sidebar: Pinned, Today, Yesterday, Previous 7 days, Previous 30 days, then one group per month ([`workforce-sessions.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/lib/workforce-sessions.ts), local calendar days). A chat shows its B2 `title`, or the agent's name and the date before it has one; a team session shows its question. Chats are renamed inline (Enter saves, Esc cancels, one request even though the field blurs as it closes), pinned and unpinned through `PATCH /conversationstore/conversations/{id}`, and deleted through the owner `DELETE` after a confirmation; team sessions can only be deleted (the backend keeps no title or pin for them). Every write updates the TanStack cache first and puts it back when the server refuses ([`use-workforce-sessions.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-workforce-sessions.ts)). Reads are the owner-scoped `GET /conversationstore/conversations` and `GET /groups/{id}/conversations` for the teams the person can see (catalog or store by role) — nothing an `eddi-user` is refused. The chats are read with `?mine=true&excludeGroupMembers=true` (below), so an admin's sidebar holds only their own chats and the conversations members hold inside a team session (owned by the person who started it) are not listed as chats; `memberConversationIds` stays as a fallback for member conversations started before the descriptor recorded their group.
* **Listing filters (backend, review follow-up).** `GET /conversationstore/conversations` gains `mine` and `excludeGroupMembers` ([`IRestConversationStore`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/rest/IRestConversationStore.java)). `mine=true` applies the owner filter for an admin too — pushed into the descriptor query, so it holds on MongoDB and PostgreSQL alike and an admin's own chats are no longer the few of the 100 newest of every user that happened to be theirs — and admits a row only if the caller IS its owner (`ConversationAccessGuard.ownsConversation`, no admin bypass, no reviewer exception, no ownerless row). It replaces the sidebar's client-side comparison with `user.username`, which never matched where the principal claim is not `preferred_username` and let other users' legacy (ownerless-descriptor) rows through. A member conversation now records `groupConversationId` on its `ConversationDescriptor`: `ConversationService.startConversation` reads it from the start context `MemberTurnExecutor` passes, and `ConversationSetup` writes it; `excludeGroupMembers=true` filters on its absence in the query and again per row. It is a listing hint, not an access attribute. An eight-argument default method keeps the in-process signature the MCP tools call. [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md#the-conversation-store) documents both parameters.
* **Review follow-ups (frontend).** The team sessions are read with `?mine=true` too (`RestGroupConversation.listGroupConversations` applies the owner query to an admin when asked). Deleting the chat or team session that is open returns to Home and clears the chat store, instead of leaving the deleted conversation on screen. Home's first message waits on the review/controls lookup of the agent of *this* render (`ChatPanel` no longer reads `selectedAgentId` from the live store there, which could pair a just-switched agent with the previous one's settled profile). Home's starters fall back to the agent's profile `appearance` when the catalog has none for it (an author's unlisted agents). The Shift+Enter test waits for sending to be possible first, so it can no longer pass vacuously.
* **Home (T1.4).** [`workforce-home.tsx`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/workforce-home.tsx): a composer first with an agent picker (the agent of the most recent chat, else the first listed), the picked agent's review notice and its `appearance.starters` as chips, then the five most recent conversations, then the catalog. Agent cards show the B4 display name, avatar (initials on the accent colour when there is none or it fails to load) and accent colour. Sending, or a starter, opens a new chat with the text as its first message; the text travels in **router state** ([`workforce-chat-start.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/workforce-chat-start.ts)), never in the URL, so a link still only preselects an agent (the chat's deep-link rule). Authors get the composer and the recent list above their dashboard.
* **Catalog appearance (backend).** `IRestCatalog.CatalogAgent` gains `appearance` and `conversationControls`, built with `AppearanceProfile.of` / `ControlsProfile.of` from the configuration `CatalogService` already reads for the deployed version — so a card needs no profile call. A six-argument constructor keeps the old shape (no appearance, default controls). [`CatalogServiceTest`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/engine/catalog/CatalogServiceTest.java) covers both; [`catalog.md`](https://docs.labs.ai/security-and-compliance/catalog.md) shows the new fields. No new endpoint, so `openapi-operations.json` is unchanged.
* **T1.15 — the conversation in the URL.** `ChatPanel urlSync` (Workforce only) keeps `?agentId=…&conversationId=…` in the address bar in both directions: the parameters are acted on once per pair, and the conversation on screen is written back once the URL's own conversation has loaded (read from the live store, so a half-switched render cannot overwrite it). A reload or a second tab opens the same conversation. The Manager's `/manage/chat` still clears the parameters once read. The widget's direct routes (`/chat/:environment/:agentId[/:userId]`, risk R10) are untouched; `location.test.tsx` pins them.
* **`conversationControls` (B4) in the shared chat.** The Manager's `ChatPanel` (Manager and Workforce) reads them from the profile (`useAgentReviewProfile`) and drops undo, redo, attachments (button, paste and drop), ratings and quick replies the agent switched off; `streaming: false` sends without streaming (`agentStreaming` in the chat store). The rule itself — every switch on unless `false`, `rawHtml` off unless `true` — is `parseConversationControls` in `@eddi/core`, shared with the widget.
* **The widget follows `rawHtml` (D9) — a behaviour change.** `Message` now renders raw HTML only when the host passes `enableRawHtml` (default **off**) and otherwise shows it as text (`escapeRawHtml`). `ChatWidget` passes the agent's `conversationControls.rawHtml` from the profile; until the profile answers, when it reports no controls, and for every agent that does not set `rawHtml: true`, `<b>bold</b>` in a reply is shown as that literal text. The parser stays a lazy chunk. The widget honours the other switches too (undo, redo, attachments via a new `Composer attachments` prop, quick replies, ratings, streaming); the `hide*` URL parameters can only hide more. [`chat-ui-embedding.md`](https://docs.labs.ai/protocols-and-integration/chat-ui-embedding.md#upgrading-html-in-replies-is-off-by-default) says what to do when upgrading.
* **The Manager's chat history** shows a conversation's title instead of its id once it has one.
* **Platform Operator.** The two prompt bullets #1273 and #1282 each added are both kept; the revision goes from their 53 to **54**. The prompt also learns that catalog entries carry appearance and controls (avatars on other hosts need the Manager's `img-src`) and what the Workforce sidebar does. No allow-list change: renaming stays the owner's act.
* **i18n.** `Workforce.sessions.*` and `Workforce.home.*` in all eleven locales; the layout uses logical properties only.
* **Docs.** A new end-user guide, [`workforce-guide.md`](https://docs.labs.ai/protocols-and-integration/workforce-guide.md) (in `SUMMARY.md`); `catalog.md`; `chat-ui-embedding.md` (upgrade section rewritten for the shipped behaviour); `ui/manager/AGENTS.md` (Workforce sidebar, Home, `urlSync`), `ui/chat/AGENTS.md` (4b), the `@eddi/conversation` README.
* **Tests.** Unit: date grouping, labels and the router-state hand-over; the sidebar (groups, rename, Escape, refused rename, pin/unpin, confirmed and refused delete, team sessions and hidden member chats); Home (composer first, default agent, starters, Enter vs Shift+Enter, recent, accent colour); `ChatPanel urlSync` (both ids kept, reload, a started conversation written back, nothing started from the URL alone, the handed-over first message, the Manager still clearing); the widget's controls and D9 (`ChatWidget.controls.test.tsx`, `MessageBubble.test.tsx`); `parseConversationControls`. MSW: titles and a pin on the conversation fixtures, a `PATCH` handler and a `DELETE` that removes from the listing (both reset after every test), the catalog fixtures' appearance and controls, a profile that answers them. Playwright: `workforce-sidebar.spec.ts`, `workforce-home.spec.ts`, `workforce-reload.spec.ts`, and `workforce-end-user.spec.ts` extended (Home and the sidebar read no store).

### Design decisions

* The first message goes through router state, not `?q=`: a crafted link must not make anyone say anything (the same reason deep links only preselect). A reload cannot resend it — the chat drops the state the moment it takes it, and the URL write that follows replaces the history entry.
* Team sessions are listed but cannot be renamed or pinned: B2 lives on conversation descriptors, and group conversations have no such fields. Pinning them would need a backend change, not a client-side store.
* The catalog carries appearance rather than each card fetching `/profile`: one request for the whole Home, and the same views the profile serves.
* Raw HTML off by default in `Message` itself, not only in the widget: any future host of the shared component starts safe.

### Verification (local, Windows)

* `ui/`: `npm ci`, `npm run lockfile:check` (lock untouched). `@eddi/core` typecheck, lint, 209 tests (+3); `@eddi/ui` 62; `@eddi/conversation` 109 (+1); Chat UI typecheck, lint, 550 tests (+6, 2 todo), build, budget **170.0 KB gz of 170** (from about 169.8: no headroom left); Manager lint, typecheck, `i18n:check` (6,990 keys), 9,449 of 9,453 tests (+33) — the three known environmental failures in `resource-detail-rag-upload-source.test.tsx`, and `group-detail-selection.test.tsx`, which fails only under load (a fixed 150 ms wait) and passes on its own — build and budget **629.4 KB gz of 630** (the session list is a lazy chunk; eager it was 632.3). `npx playwright test --list`: 410 tests in 45 files, the four Workforce specs among them (not run: the local browser does not match).
* Mutation check: `enableRawHtml={true}` forced in `ChatWidget` fails two of `ChatWidget.controls.test.tsx`'s cases; reverted.
* Backend, from PowerShell: `./mvnw compile`; `CatalogServiceTest`, `RestAgentProfilePresentationTest` and the guards `ImportStyleTest`, `BuildQualityGatesTest`, `ChangelogRotationTest`, `ChangelogFragmentTest`, `DocumentationLinksTest`, `DocumentationAccuracyTest`, `DocumentedRestPathsTest`, `SkillToolReferencesTest`, `AutoApproveCopilotPolicyTest`, `BrandDeliveryTest` — 127 tests, a report from each class.

### What's left

* Not run here: the Playwright specs (they type-check, lint and are listed; the local browser does not match), Stryker over `src/lib/operator/**` (only prompt text changed), CI.
* Team sessions are read per team (up to 20 teams, 10 sessions each): a per-user listing endpoint would replace that fan-out. Member chats no longer depend on it (`excludeGroupMembers`), except those started before `groupConversationId` was recorded.
* Neither the MCP `list_conversations` tool nor the Platform Operator knows `mine` / `excludeGroupMembers` yet (the operator's allow-list already holds the listing endpoint; its prompt does not mention the parameters). Search (T1.3, B3) is phase 7.
* The widget does not yet show `appearance` (display name, avatar, accent): `agentAppearanceLayer` in `ui/chat/src/api/brand.ts` is still the empty seam, and the budget (170 KB gz) has almost no room.

***

## ✨ feat(workforce): Tier 1 of the end-user chat — Stop that tells the truth, edit and regenerate, rich output, attachments, keyboard, installable, accessible (2026-11-05)

**Repo:** EDDI · **Branch:** `feat/workforce-tier1-ux` (stacked on `feat/conversation-operator-team`)

The frontend half of phase 7 of the frontend unification plan (`planning/frontend-unification-plan.md` §2.5, §3, §4.2, §5 Tier 1): T1.5, T1.6 (part), T1.7, T1.8, T1.10–T1.14. Search (T1.3), the tool notice of T1.6 and tool cards (T1.9) wait for the backend's B3 and B6, built on another branch. The changes are in the shared controller and components, so the Manager's chat, Agent Studio, the Workforce chat and member thread, and the embeddable widget get them where they apply.

### What changed and why

* **Stop that says when it did not take (T1.5).** `POST /agents/{id}/cancel` stops a running turn only on the pod running it ([HITL](https://docs.labs.ai/conversations-and-orchestration/hitl.md)); a `200` says the request was accepted, not that the turn stopped. [`AgentConversation`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/controller/agent-conversation.ts) now re-reads the conversation after Stop (`stopVerifyDelaysMs`, 1.5 s and 5 s): a turn that ran on gets a notice — it *finished anyway* (its whole reply replaces the part Stop left) or is *still running* — a `409` means it had already finished, and a cancel that could not reach the server says that. A `409` is read from any host client's error now, not only `@eddi/core`'s `ApiError` (the Manager's was never recognised).
* **Reconnect (T1.5).** A stream that drops after part of the reply arrived is followed (`reconnectDelaysMs`, about half a minute; new `reconnecting` state): the conversation is re-read until the turn settles, and its reply is applied as its `done` would have been. "Connection lost" only when it never settles. Opt-in; the widget, `ChatPanel` and the member thread pass the shared defaults.
* **`ChatPanel` (Manager, Studio, Workforce).** Stop in place of Send while a turn runs, **Esc** stops it (not while a dialog is open), a "Reconnecting…" line, client notices as system lines (`ChatMessage` `kind: "notice"`), no pulsing bubble while text streams, a stable scrollbar gutter, the composer refocused after a send, a new chat and Stop. Sticky scroll with "jump to latest" was already there (`useSmartAutoScroll`).
* **Edit the last message, regenerate the last reply (T1.6, T1.10).** *Edit* (or **↑** in an empty composer) undoes the last step and puts its text back in the composer; *Regenerate* reruns it. Only when the agent's `conversationControls` allow undo (and redo); never for a secret turn or one that carried files. **`renderTurnNotice`** on `ChatPanel` is the seam for "this turn ran tools whose effects stay" once B6 reports which tools ran; no tool detection here.
* **Rich output (T1.7)**, in the one renderer ([`Markdown.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/markdown/Markdown.tsx)): a fenced block names its language; a ` ```mermaid ` block is drawn by Mermaid with `securityLevel: "strict"` once its source has been still for 400 ms, and stays the code block until then or when it does not parse. [`MermaidDiagram.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/markdown/MermaidDiagram.tsx) and Mermaid are lazy chunks in every app. Tables, code copy, message copy, KaTeX (`trust: false`) and images-as-links were in place. `one-renderer.test.ts` also forbids `mermaid` outside the renderer, and now reads `workforce/src` and `workforce/e2e`, which phase 5 had added without telling it.
* **Attachments (T1.8)** ([`use-attachment-staging.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/hooks/use-attachment-staging.ts)): a file from 256 KB goes up through XMLHttpRequest and shows its own progress (bar and percentage); a failed chip keeps the server's reason, announced as an alert, with *Try again*. Paste, drop, picker, thumbnails and the cap were in place. An upload the user walks away from is aborted: removing the chip, switching conversation, sending without waiting and unmounting all call `abort()` on the request (`uploadAttachment` takes an `AbortSignal`; a cancelled upload rejects with code `UPLOAD_CANCELLED`), the handlers then stay silent (no error toast, no chip update), and a file whose reply still arrives after its chip was discarded is deleted from the server again.
* **Keyboard in Workforce (T1.10).** ⌘K / Ctrl+K opens a [quick switcher](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/components/workforce/quick-switcher.tsx) over the sidebar's chats and team sessions, the agents and "New chat" (combobox + listbox, a lazy chunk); ⌘⇧O / Ctrl+Shift+O goes Home with the composer focused. The shortcuts dialog lists every shortcut. The widget: Esc stops.
* **Installable Workforce (T1.11).** `GET /workforce/manifest.webmanifest` ([`WorkforceManifest`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/ui/WorkforceManifest.java), `RestWorkforceResource#manifest`) renders the manifest from the current brand: name, short name, primary colour, the brand's icon slot (a PNG's real size from its header, an SVG `any`), standalone, scoped to `/workforce`. A literal JAX-RS path beside the catch-all; public like the shell. The shells link it, an `apple-touch-icon` and the theme colour, with `viewport-fit=cover, interactive-widget=resizes-content`; the layout pads by the safe-area insets and takes its height from the visual viewport while an iOS keyboard shrinks it ([`use-visual-viewport-height.ts`](https://github.com/labsai/EDDI/tree/main/ui/workforce/src/hooks/use-visual-viewport-height.ts)).
* **Accessibility (T1.12).** [`ReplyAnnouncer`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/components/ReplyAnnouncer.tsx): a polite status region says each completed reply once, with its speaker, and the client's notices; the transcript `log` is `aria-live="off"` (it used to be live, with `aria-relevant="additions"`, which reads streamed text piecemeal). Muted text and controls in the chat no longer fade the token below contrast (`/40`–`/80` modifiers), with a guard test; the conversation-info toggle has a translated name and `aria-expanded`. Focus returns to the composer after a send, a new chat and Stop, and to where it was when the quick switcher closes.
* **Locales and themes (T1.13).** Every new string is in the eleven locales (5 in `@eddi/conversation`, 10 in `@eddi/app-kit`, 13 in Workforce); new layout uses logical properties; the new surfaces follow the light, dark and system themes through the shared tokens.
* **Ratings (T1.14)** were complete (thumbs per reply, reasons and a comment after a thumbs down); a test now pins the whole path through `ChatPanel`.
* **Widget budget.** The widget's first load must stay within 170 KB gz. `PausedCard`, `RatingCard` (new entries `@eddi/conversation/paused-card`, `/rating-card`) and `StepRating` now load when first shown, which pays for the new code: **169.4 KB gz** (it was 170.0).
* **Platform Operator.** The prompt learns how users install Workforce, that the manifest follows the branding, that there is no service worker on purpose, and what Stop does in a cluster. No allow-list change. `operator-revision.json` 54 → **55**.
* **Docs.** [`workforce-guide.md`](https://docs.labs.ai/protocols-and-integration/workforce-guide.md) (while the agent answers, editing, what a reply can contain, files, ratings, keyboard, installing; for administrators: the manifest and Stop in a cluster), [`chat-ui-embedding.md`](https://docs.labs.ai/protocols-and-integration/chat-ui-embedding.md) (§5, what the widget does during a reply), `ui/manager/AGENTS.md`, `ui/chat/AGENTS.md`, `ui/workforce/AGENTS.md`, the `@eddi/conversation` README.

### Design decisions

* **No service worker.** Browsers install without one, Lighthouse dropped its PWA category, and Workforce shows signed-in conversations that must never come from a cache; an app shell would only risk a stale UI after a deploy. An e2e test fails if any worker other than the MSW mock registers.
* **The manifest is rendered, not shipped.** A static file could not carry a deployment's name, colour or icon; rendering it from `BrandingService` follows a rebrand at once, as the shells do.
* **Stop is checked, not trusted.** Two re-reads after the cancel rather than one: the cancel's own mark (`EXECUTION_INTERRUPTED`) is what an immediate read sees even when the turn runs on elsewhere.
* **Reconnect follows the turn instead of reopening the stream:** the backend has no resumable stream; the conversation read is the source of truth.
* **Progress only from 256 KB.** A small file is up before a bar could show anything, and fetch stays the path the rest of the client uses.
* **Mermaid \~12.2.0, not 12.3.0** (three days old at the time); `securityLevel: "strict"`, rendered lazily as §2.5 asks. 112 packages enter the lockfile, all in lazy chunks.

### Not done

* **Lighthouse** (exit criterion: accessibility and PWA ≥ 95 on Workforce) was not run here: no Chrome for Lighthouse in this environment, and current Lighthouse (12+) has no PWA category at all. Verified instead: the manifest (Java and e2e tests), installability criteria by hand (name, icons, `start_url`, `display`, HTTPS from EDDI), live region and focus (unit tests), contrast (guard test). Run it with `npx lighthouse http://localhost:7070/workforce --only-categories=accessibility --view` against `./mvnw quarkus:dev` after a `./mvnw package`, signed in (or `npm run dev` in `ui/workforce`, which serves the mock API).
* **No axe** in the repo (neither vitest-axe nor `@axe-core/playwright`); adding one is a dependency decision left for the follow-up.
* The widget's composer has no paste, drop or per-file progress: its first load has 0.6 KB left.
* Ratings from Workforce are recorded with channel `manager` (`MANAGER_RATING_CHANNEL`): a `workforce` channel needs the backend's `KNOWN_CHANNELS`.
* Not run here: the Playwright specs (listed and type-checked; the local browser build does not match), Stryker (no file in its scope changed: only `system-prompt.ts` text and `operator-revision.json`).

***

## 🧪 test: raise branch coverage back over the merged 80% gate (2026-11-05)

**Repo:** EDDI (`test/raise-branch-coverage`)

### Why

After the last day's feature merges (cost accounting, team handoff, the SERVICE judge, HITL edit-on-approve and approval-card context, setup-api, argument schemas, the configs/llm/secrets fixes), the `Integration Tests` job on `main` failed the JaCoCo `merged-check`: branches covered ratio 0.79 against a minimum of 0.80. The threshold stays where it is; this branch adds tests.

### What changed

Test code only — no production source is touched. Plain JUnit 5 + Mockito, no `@QuarkusTest`. Every test asserts behaviour (refusal messages, routing decisions, masking, audit units), not just execution. Classes covered, grouped by the PR that introduced or changed them:

* **Argument schemas (#1268):** `ToolArgumentSchemaValidator` (keyword reduction, nullable type lists, the violation cap, violation wording), `OpenApiArgumentSchemas` (no direct test before), `McpApiToolBuilder` helpers (unsendable inputs, header-answering operations, server variables).
* **Team handoff (#1223):** `TeamHandoffToolsProvider` — the standalone filed ledger in step data, artifact references, unusable targets, participant rules.
* **Cost accounting (#1222):** `MeteredTokenUsage`, `PricingLint` (cascade, judge, summary and tool-summarizer pricing), `UnpricedSightings`.
* **HITL (#1228, #1230):** `HitlDecisionRecords`, `EditMetrics`, `ApprovalCategories`, `GroupApprovalContextRenderer`, `HitlNotificationContent`.
* **Cluster rate limits:** `ToolRateLimiter` in NATS mode — shared buckets across replicas, the global layer giving the conversation its token back, degraded local-share and reject.
* **Elsewhere:** `ArtifactSchemaComplexity`, `EmailAgentToolsInspector`, `EmailTargetRouting`, `EmailReplyThread`, `TurnBudgetValidator`, `TurnObservation`, `ResourceSharingService.describe`, `SpaceTenants`, `JsonBodyErrors`, `AlertPayloads`, `DeliveryTarget`, `OutboundSettings.fromConfig`, `AttachmentClassifier`, `WebhookEventParser`, `PropertyAccessValueResolver`, `IngestionSource` validation, `EmbeddingParameters`, `ChatCompletionRequest`.

### Measured

Unit suite only (integration tests need Docker): branch ratio **0.7793 → 0.7915**, +867 branches. The merged unit + IT ratio could not be measured locally; CI's `Integration Tests` job is the check.

### Noticed, not changed

`JsonBodyErrors` renders an unknown field's JSON path including the field itself (`Unknown field 'x' at x.`): it calls `StrictConfigurationParser.jsonPath(e)`, which renders the whole path, where the private overload documents "one short of it for an unknown field". The new test asserts only the prefix of the message, so it does not pin either form.

***

## End-user catalog and Workforce for `eddi-user` (frontend unification, phase 2) (2026-11-04)

**Repo:** EDDI · **Branch:** `feat/catalog-workforce-end-users`

Phase 2 of the frontend-unification plan: a signed-in `eddi-user` can open Workforce, see what they may use, and chat, without any page answering 403.

**Backend**

* **B1 Catalog.** `GET /catalog/agents` and `GET /catalog/groups` (`IRestCatalog`, `CatalogService`, `RestCatalog` in `engine/catalog`), for `eddi-user`, `eddi-editor` and `eddi-admin`. An agent is returned when it is READY in production (read from `IAgentFactory`, as `AgentModelResolver` does), the caller holds `USE` on it (the existing `ResourceAccessGuard` check, with no new access control), and it is **listed**. A group is returned under the same rules, using the group's own `USE` check, the one `POST /groups/{id}/conversations` applies. Agent items carry the profile fields (name, description, review notice, rating controls), `callerLevel` and `agentId`. Group items carry `groupId`, the current version, name, description, style, members and `callerLevel`. An entry that cannot be read is skipped without failing the list. See [End-User Catalog](https://docs.labs.ai/security-and-compliance/catalog.md).
* **`listed` flag** (`Boolean`, default `false`) on `AgentConfiguration` and `AgentGroupConfiguration`. With workspaces enforced, `published` and `internal` visibility count as listed too. The Platform Operator (its agent id is read from the `platform.operator` global variable) is listed only by its explicit flag. `OperatorRevisionCheck.OPERATOR_VARIABLE` became public for that. The flag is part of the JSON document, so ZIP export/import and agent sync carry it. Over MCP only a group's flag can be set, with `update_group`; `update_resource` does not write the agent document, so an agent is listed from the Manager or over REST. `ListedFlagSerializationTest` pins the round trip and the default.
* **B5.** `RestUserMemoryStoreCrossUserTest` runs the real `OwnershipValidator` and pins that `eddi-user` A gets 403 on every read and write of user B's memories, before the store is touched.
* `landing-redirect.js` now sends everyone to `/welcome`, which knows the roles (D6). It used to shortcut a remembered `workforce` preference straight to `/workforce`, which let a dedicated `eddi-viewer` or `eddi-approver` reach the end-user catalog; `LandingPage` now applies the role decision to those visitors too.
* Docs: new `docs/catalog.md` (plus SUMMARY), a pointer from `workspaces.md`, and a section in the `eddi-admin` Claude Code skill. `openapi-operations.json` gains the two operations.

**Manager (`ui/manager`)**

* Workforce is role-aware (`useWorkforceAccess`). For a user without `eddi-editor` or `eddi-admin`:
  * the dashboard is the catalog (`EndUserCatalog`), and the sidebar, the chat picker (`useDeployedAgents`) and the board, thread and history pages (`useWorkforceGroup`) read `/catalog/*` instead of `/groupstore` and `/agentstore`;
  * the wizard, team settings and analytics routes redirect (`AuthorRoute`);
  * the authoring actions on team cards, the board's settings link, the agent details panels, the Insights links and the mode switcher are hidden.
* **D5:** the Workforce top bar no longer mounts the Operator drawer. Admins get a link to `/manage/operator`.
* **D6:** `/welcome` sends an end user straight to `/workforce`, including with `?choose` and with a stale `manage` preference. A dedicated `eddi-viewer` or `eddi-approver` cannot read `/catalog/*`, so it goes to the Manager instead: an approver to `/manage/approvals`, a viewer to `/manage`.
* The `GET /catalog/agents` OpenAPI description no longer claims an anonymous caller sees published agents (copied from `/v1/models`): with authorization on an anonymous caller is refused, with it off visibility is not consulted.
* The catalog's empty state explains how to list an agent to authors (shown on their dashboard as **What end users see**). A plain user gets a neutral sentence.
* A **Listed in the catalog** switch on the agent page, in the Manager's group panel (saves at once), and in Workforce team settings.
* i18n: 18 new keys (`Workforce.operatorLink`, `Workforce.catalog.*`, `catalogListing.*`) in all 11 locales.
* MSW handlers for both endpoints, plus `e2e/workforce-end-user.spec.ts`. It runs as `eddi-user` through a new dev-only seam (`lib/mock-roles.ts`, which reads `localStorage["eddi-mock-roles"]` only with the mock API active) and fails if any Workforce page requests a store the backend refuses that role.
* Platform Operator: the prompt explains `listed` and the catalog, the allow-list gains `GET /catalog/agents` and `GET /catalog/groups`, and `operator-revision.json` gets a revision bump.

**Not done here / next:** phase 3 of the plan (`@eddi/ui` and the agent kind). The catalog has no paging; it is bounded at 2,000 group descriptors per request.

***

## Shared PII detectors; `pii-redaction` finds national identifiers of 27 countries (2026-11-04)

**Repo:** EDDI · **Branch:** `feat/pii-detectors`

The first piece of the reversible pseudonymization work: a detector layer that the `pii-redaction` guardrail and a later pseudonymization block share, so both find exactly the same values. It recognizes identifiers from around the world, not only German ones.

### What changed

* **New package `modules/llm/pii/`.**
  * `PiiDetector`: an SPI of CDI beans selected by `type()`, like `ContentGuardrail`. It comes with `PiiSpan`, `DetectorContext` and `DetectorUnavailableException`. A detector that cannot finish throws the exception; it never reports "nothing found" for a text it did not check.
  * `BuiltinPiiDetector` (`builtin`) and `BuiltinRecognizers`: one pattern-plus-validation recognizer for each of 40 entity types.
    * Universal types: `EMAIL`, `PHONE`, `CREDIT_CARD`, `IBAN`, `IP_ADDRESS`, `PASSPORT_MRZ` (ICAO 9303 TD3) and `DATE_OF_BIRTH`. Birth keywords are recognized in eleven languages.
    * National identifiers of 27 countries, each named `<ISO code>_<id>`: US, CA, BR and MX; GB, IE, FR, IT, ES, PT, NL, BE, DE, AT, CH, PL, SE, DK and FI; IN, CN, JP, KR, SG, AU and NZ; and ZA.
    * The patterns of the original four types moved here unchanged.
  * `PiiCountries` holds the standard set (`EMAIL`, `US_SSN`, `CREDIT_CARD`, `PHONE`, `IBAN`) and the country→types map.
  * Check digits:
    * `PiiChecksums`: Luhn, ISO 13616, and the German identifiers.
    * `NationalChecksums`: the rest. These include mod-97 (NIR, Belgium), mod-23 letters (DNI/NIE, PPS), mod-11 variants (NHS, BSN, NIF, PESEL, SVNR, CPF, TFN, IRD, My Number, CN ID), Verhoeff (Aadhaar), EAN-13 (AHV), mod-31 (HETU), the codice fiscale letter, CURP, NRIC/FIN and the ICAO MRZ digits.
    * Each validator is tested against published valid examples, not against values generated with the code under test.
  * `PiiSpanMerger` and `TermMatcher`: overlap resolution. The priority order is: the author's always-terms, then the longer span, then the higher score, then the earlier detector. Spans inside never-terms or inside skip ranges (placeholders EDDI wrote) are dropped. Term matching is whole-word and case-insensitive.
* **`PiiRedactionGuardrail`** is rebuilt on `BuiltinRecognizers`.
  * `patterns` selects kinds. When it is absent, the standard set runs, which is the original four kinds plus `iban`.
  * The new `countries` parameter adds every identifier of the listed countries. The two combine: `{"patterns": "email", "countries": "DE,FR"}`.
  * The kinds run one after another in a fixed order. E-mail runs first, so an address whose local part is an IBAN or a tax ID is redacted whole. The checked national formats come next, and the loose card and phone patterns run last, so they cannot take an identifier's digit groups (before, `DE89 3704 0044 0532…` came out as a partial `[REDACTED:phone]`).
  * The four original kinds keep their names, their `{kind}` value and their reason, and their output is byte-identical. `PiiRedactionGuardrailTest` checks this against `LegacyPiiRedaction`, a frozen copy of the old rewrite, over a fixed corpus and 3,000 random fragment combinations.
  * An unknown kind or country is now a deploy warning. Before, an unknown kind selected nothing, silently.
* **Manager:**
  * The PII section lists the universal kinds, then the 27 countries grouped by region. Ticking a country writes it to `countries`; ticking one of its identifiers writes that to `patterns`.
  * Country names come from `Intl.DisplayNames` in the UI language. Identifiers show their official names (PESEL, NIR, Codice fiscale, …).
  * Labels are in all 11 locales. A stored `patterns` that uses the entity-name aliases `CREDIT_CARD` or `US_SSN`, or that is whitespace only, ticks the right boxes.
* **Operator:** the system prompt describes `patterns`, `countries` and the opt-in rule; its revision is 66 after merging `main`.
* **Docs:** a new [PII kinds and countries](https://docs.labs.ai/agent-configuration/langchain.md#pii-kinds-and-countries) section with the full table; [`security.md`](https://docs.labs.ai/security-and-compliance/security.md).

### Design decisions

* **National identifiers are opt-in.** Each one matches only its own country's format. Turning all 27 countries on by default would only add false positives in texts that never mention them. A compact 15-digit French NIR, for example, also passes the card Luhn check. The standard set stays what agents always had, plus the international IBAN.
* **Weak check digits need a keyword.** Where a check digit lets about one in ten random numbers of the right length through, a keyword must stand within 40 characters before the value. This applies to PESEL, NHS, BSN, NIF, SVNR, CPR, SIN, Aadhaar, My Number, TFN, Medicare, IRD and the German ID card, and to dates of birth. Identifiers with a strong check or a distinctive shape need none.
* **No check digit where the issuer dropped it.** Korean RRNs issued since October 2020 and Danish CPR numbers since 2007 carry no reliable check digit, so only their date and structure are checked, and CPR also needs a keyword.
* **Not included:** EU VAT numbers and Brazilian CNPJs, which identify businesses rather than people.
* **The guardrail applies kinds sequentially** rather than through the merger. Its replacement text is author-configurable, and the legacy result depends on later kinds seeing earlier replacements, so only sequential application keeps the output byte-identical. The merger is for pseudonymization, which replaces each value with its own token.
* **Keywords are looked for in the original text.** The kinds still rewrite the text one after another, but a keyword-bound kind checks the 40 characters before the value's position in the text as it arrived. Before, an earlier redaction could shift a keyword out of the window (a short address became the 16-character `[REDACTED:email]`), or a replacement that names a keyword could stand in for one. The guardrail keeps a position map from the rewritten text to the original for this.
* **Review fixes.** The Singapore pattern also takes the M series of FINs, issued since 1 January 2022 (ICA). ICA does not publish the check-letter algorithm, so the commonly implemented one is used: offset 3 and the table `KLJNPQRTUWX`. ICA's example `M1234567B` fails it and only shows the format. `IBAN_LENGTHS` now has every country of the IBAN registry; BI, DJ, FK, HN, LY, MN, NI, OM, RU, SD, SO and YE were missing. After an accepted value the scan resumes at its end, not at the end of the raw match, so two IBANs in a row are both found. The card scan is the exception and keeps the legacy behaviour. IPv6 matches are checked against the IPv4 spans in one pass rather than against every accepted span. The Swedish day check formats with `Locale.ROOT`, so a JVM locale with Arabic-Indic digits cannot reject a valid personnummer. A second round: IBANs are found in lower case too (`de89 3704 …`), upper-cased before the mod-97 check, because a guard that misses a typed IBAN is a gap rather than a documentation issue. The Austrian SVNR accepts the fictitious months 13–15 that the Hauptverband assigns when a birth date is unknown or its serials are used up (parliamentary answer 4690/AB XXIII. GP, 2008). The New Zealand IRD upper limit is 200,000,000, as Inland Revenue announced on 10 February 2026. An IPv6 address with seven groups and a leading or trailing `::` (RFC 4291 §2.2) is found.
* **The detector honours an explicit request.** When `DetectorContext.entities()` names types, those run even if they are outside the standard set. The standard set is the default only when nothing is requested.
* **No new regex budget class, and no budget on the guardrail.** `RegexDeadline` already provides one, and `BuiltinPiiDetector` honours the caller's deadline, which a pseudonymization chain will need. Every pattern is bounded, so a scan is linear; a test runs all 40 recognizers over about 600,000 characters of adversarial digit, letter, separator and keyword runs within 10 seconds. `regex-filter` keeps its budget because its patterns are the author's.
* **The package is `modules/llm/pii`,** not `modules/llm/pseudonymization` as the plan said, because the detectors serve both features.

### Next

PR 2 of the pseudonymization plan: the token codec, key provider, session and restorer, unit-tested and not yet wired into `LlmTask`.

***

## ⚡ perf(ui): frontend unification phase 0 — bundle budgets, per-locale fonts, a lighter widget (2026-11-04)

**Repo:** EDDI (`perf/frontend-phase0-baseline`)

Phase 0 of the frontend unification plan (revision 3, branch `claude/amazing-thompson-jzrvz7`, `planning/frontend-unification-plan.md` §7): measure first, take the two quick wins, write down where Open WebUI is the better answer, and record what each conversation surface can do today.

### First load, gzip -9, before any lazy chunk

| Page                                | Before (main, 2026-11-04) | After    | Budget |
| ----------------------------------- | ------------------------- | -------- | ------ |
| `/manage`, `/workforce`, `/welcome` | 743.8 KB                  | 616.4 KB | 630 KB |
| `/chat`                             | 224.8 KB                  | 160.6 KB | 170 KB |

KB are 1000 bytes. The plan's §1.2 measured 714 KB and 217 KB on 2026-10-29; main grew in between, so the "before" column is re-measured on today's `origin/main`. `/manage`, `/workforce` and `/welcome` still load the identical file set — separating them is phase 5.

### What changed and why

* **Budget check in CI.** [`ui/scripts/check-bundle-budget.mjs`](https://github.com/labsai/EDDI/tree/main/ui/scripts/check-bundle-budget.mjs) reads each built HTML shell, sums the gzipped scripts, module preloads and stylesheets it references, and compares them with [`ui/bundle-budget.json`](https://github.com/labsai/EDDI/tree/main/ui/bundle-budget.json). Server-rendered files (`/__*__.js`, `/branding/*`) are skipped by name; any other reference missing from `dist/` fails the check rather than shrinking the number. `UI Manager Checks` and `UI Chat` now run `vite build` and `npm run budget` after their tests. Raising a budget is a decision (plan §8), not a fix.
* **Manager: script fonts per locale.** [`main.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/main.tsx) imported all eight Noto families; their `@font-face` rules were 128 KB gz of the 158 KB main stylesheet. Only Noto Sans stays eager. [`locale-fonts.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/ui/src/i18n/locale-fonts.ts) (moved to `@eddi/ui` in phase 3a) imports a family's CSS when its locale becomes active: `ar` → Arabic, `th` → Thai, `hi` → Devanagari, `ja` → JP, `ko` → KR, `zh`/`zh-CN`/`zh-Hans` → SC, `zh-TW`/`zh-HK`/`zh-MO`/`zh-Hant` → TC (from the detected tag; the Manager ships one `zh` locale). The first paint waits up to 3 s for the active locale's font CSS, so a Japanese user does not see a font swap. **Text in another script inside a Latin UI** (a Japanese agent reply in an English Manager) still renders: `--font-sans` names every family, and where one is not loaded the browser falls through to `system-ui`, which has these scripts on every desktop and mobile OS. It is drawn in the system's face rather than in Noto.
* **Widget: no react-router.** [`location.ts`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/location.ts) parses the three shapes — `/chat/managed/:intent/:userId`, `/chat/:environment/:agentId/:userId`, `/chat/:environment/:agentId` — with react-router's matching rules (case-insensitive literals, `managed` outranks `:environment`, trailing slashes ignored, params percent-decoded). Unknown paths still go to `/chat/production/default`, and `?token=` is still removed with `history.replaceState`. [`ChatLocationProvider`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/components/ChatLocationProvider.tsx) replaces `BrowserRouter`, and its `initialPath` mode replaces `MemoryRouter` in the tests. `location.test.tsx` pins every URL shape, because embedders link to them.
* **Widget: raw-HTML parser on demand.** `rehype-raw` (and parse5 with it) is now a lazy chunk like KaTeX and highlight.js, loaded when a reply contains `<` followed by a letter, `/`, `!` or `?`. Per D9 the widget **still renders sanitised HTML for every agent**; only the loading changed. Once the chunk is in, the output is the same: [`raw-html-lazy.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/markdown/raw-html-lazy.test.tsx) compares the two pipelines on a corpus. The two byte-level differences of parse5's round trip (whitespace text hoisted before a table, `data-footnote-ref=""` rather than `"true"`) render the same and are normalised in the comparison. While the chunk loads, a reply's HTML is briefly missing and its text shows.
* **Docs (D10).** [`open-webui-integration.md`](https://docs.labs.ai/protocols-and-integration/open-webui-integration.md) and the README now say that a deployment wanting only generic chat can use Open WebUI over `/v1`, and list what it goes without: approvals in the chat, quick replies and `inputField`, secret input, ratings, review notices, group discussions, memory transparency, branding.
* **Feature matrix.** [`ui/manager/e2e/feature-matrix.spec.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/e2e/feature-matrix.spec.ts) has one cell per capability (KaTeX, highlight.js, output images, quick replies, `inputField`, secret input, history, inline HITL decision, i18n) and surface (`ChatPanel`, Operator, Workforce member thread), tagged `@surface:` and `@capability:`. `yes` cells assert against MSW. `no` cells are `test.fixme` with the reason. `unit` cells are supported but unreachable in MSW (no activated operator, no agent asking for a secret) and are skipped with the unit tests that cover them. The widget's column is [`ui/chat/src/feature-matrix.test.tsx`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/feature-matrix.test.tsx), a Vitest spec, because `ui/chat` has no Playwright tier.

### Not done, or not verified

* The Manager feature-matrix spec was **not run locally**: the installed Playwright browser build does not match `@playwright/test` 1.64.1, and downloading the browser was out of scope for this session. CI's `UI Manager E2E (MSW)` runs it.
* The widget's matrix is unit-level, not Playwright. Adding Playwright to `ui/chat` is a lockfile change better done with phase 1's single root lockfile.

### Next

Phase 1 (workspaces, one lockfile, `@eddi/core`) and phase 2 (catalog, Workforce for `eddi-user`) can start. The remaining 616 KB of the Manager's first load is mostly its own code, which phase 5 splits.

***

## 🧩 refactor(ui): `@eddi/core`, and the 1:1 turn loops on it (2026-11-04)

**Repo:** EDDI (`refactor/ui-eddi-core`, stacked on `chore/ui-npm-workspaces`)

Phase 1b of the frontend unification plan (revision 3, `planning/frontend-unification-plan.md` §1.3, §2.7, §3.1, §3.2, §7 phase 1, §9): the first shared package, `@eddi/core` under [`ui/packages/core`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/README.md), with the union of the turn loops' protocol tests, and the widget and the Manager's `ChatPanel` moved onto it.

### What changed and why

* **`@eddi/core`** — framework-free TypeScript, no React and no DOM beyond `fetch`, consumed as source through the workspace link (`exports` → `src/index.ts`; no build step). Every module was derived from code the apps already had twice or three times, not written afresh:
  * `http.ts`: `HttpClient` — status-aware fetch, `ApiError`, the `{error, code}` envelope (`errorPayload`), an injected `AuthProvider` with one 401 retry, and an injectable transport and error factory, so an app keeps its own error type. The module-level `setBaseUrl` / `setAuthToken` / `setUnauthorizedHandler` / `request` drive a default client, the way the Chat UI always used this layer.
  * `sse.ts`: **one** frame parser and stream reader for agent and group streams, replacing three that each got a different subset right. It strips exactly one delimiter space, joins multi-line `data:`, normalises CRLF on the accumulated buffer (so a `\r\n` split across two reads still splits the frame), accepts bare CR, flushes the decoder and the last unterminated frame at EOF, and skips frames with no `event:` line where the caller asks (group streams). The two readers that disagreed: the Manager's chat reader did not flush the decoder; the Chat UI's `.trim()`med event names. The package follows the majority (flush) and the spec (one optional space). **For the Manager's agent stream the flush is a deliberate reversal**: its old reader left the decoder unflushed on purpose, so a body cut mid multi-byte character dropped the malformed tail; it now ends in one U+FFFD in the transcript. `decode(value, {stream: true})` only ever holds back an *incomplete* trailing sequence, so no complete character is affected either way, and one reader with one rule was the point of the change: a visible replacement glyph marks a truncated reply where the old reader hid the truncation.
  * `conversation.ts`: start, read, send, stream, undo, redo, rerun, end, the managed variants and the profile, as `createConversationApi(http)` plus bound functions over the default client. `hitl.ts`: approval status, cancel, resume, deadline maths, poll cadence. `stream-events.ts`: error frames, `UNCONSUMED_STREAM_ERROR_CODES`, tool activity (`parseToolCallActivity`), `inputField`, dropped vs paused turns, output texts and images. `snapshot.ts`, `attachments.ts`, `ratings.ts` (with `createRatingClient(http, channel)`), `rating-steps.ts` (the rule the two apps held twice, with the union of their "belongs to no step" and "not ratable" predicates) and `types.ts` (eleven SSE event types — `guardrail_triggered` was missing from the Chat UI's list; `tool_result` came with the merge of `main`). `tool-labels.ts` (`humanizeToolName`, `ToolActivity`) moved in from the Chat UI when `main` was merged, because the `tool_call` parser and `gatedToolNames` now name a tool in words and the package cannot import an app.
  * Its README is the backend contract list that was in `ui/chat/AGENTS.md`, each rule now naming the test that pins it.
* **Tests first.** The Chat UI's protocol suites (`http`, `chat-api`, `sse-events` with its Java-pinned review test, `snapshot`, `hitl-api`, `attachments-api`, `rating-api`, `rating-steps`) and the Manager's `parse-sse-frame` suite moved into the package. [`turn-protocol.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/turn-protocol.test.ts) encodes the protocol-level cases the five loops' suites (`use-chat`, `use-operator-chat`, the Workforce member thread, `ChatWidget` + `chat-store`) each held in UI terms: a 409 (and a pre-turn `error` code) is a refusal whose input was never consumed, dropped vs paused turns, `inputField` on `done`, undo/redo's empty 200 and 409, rerun's parameters, cancel, resume, the injected auth and error factory, and the framing cases the three readers disagreed on.
* **Boundaries.** `sharedPackage()` in [`ui/eslint.config.base.js`](https://github.com/labsai/EDDI/tree/main/ui/eslint.config.base.js) forbids, in a package, an app import, React, `@eddi/ui` and the DOM globals; [`boundaries.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/boundaries.test.ts) checks the same over every `ui/packages/*` and fails on an import cycle (its cycle finder is tested against a synthetic one). The package's `tsconfig.json` is as strict as the strictest app (the Manager's `noUncheckedIndexedAccess`, ES2020), because each app compiles it.
* **Widget (`ui/chat`).** `ChatWidget`, `ChatInput`, `PausedCard`, the HITL polling and rating hooks and the store import the protocol from `@eddi/core`. Deleted: `api/http.ts`, `api/chat-api.ts`, `api/sse-events.ts`, `api/snapshot.ts`, `api/attachments-api.ts`, `rating-steps.ts` and their tests. The widget keeps what is its own: `embed-auth.ts`, the brand, the demo, `pauseHeadline` (`api/hitl-api.ts`), the `chat-ui` rating channel and error copy (`api/rating-api.ts`) and `skippedTurnMessage` (`turn-notices.ts`). `@/types` re-exports the contract types. Its consumer tests changed in import paths only; `vite-proxy.test.ts` also scans the package for the path prefixes it calls.
* **Manager (`ui/manager`).** `lib/api/chat.ts` is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it too, so neither changed), with an `HttpClient` built on a new `ApiClient.authorizedFetch` (pre-flight refresh, one forced refresh and retry on a 401, network failures as `ApiClientError` status 0, an abort left an `AbortError`) and `apiErrorFromResponse` — so the raw-fetch stream and `text/plain` send now refresh the token like every `api.post`. `startConversation` stays an `api.post`: `ApiClient` also reads a `location` field from the body, which the MSW fixtures rely on. `groups.ts`'s group reader is `readSseStream`; `use-chat.ts` takes `UNCONSUMED_STREAM_ERROR_CODES` and `parseErrorEvent` from the package; `ChatPanel` and `use-chat-ratings` take the rating steps from it. Deleted: `lib/api/sse-utils.ts` (and its test, ported), `lib/chat-rating-steps.ts`.
* **Gates.** CI's `UI Chat` job runs the package's type check, lint and tests. `i18n:check` walks `ui/packages/*/src` (the Manager compiles them). `auto-approve-copilot.yml` protects a package's vitest, ESLint and tsconfig files, as it does an app's (`AutoApproveCopilotPolicyTest`).
* **Archived changelog links.** Eight links in `docs/changelog/2026-09.md` and `2026-10.md` named files this change deletes; they now point at the package module the code moved to (`DocumentationLinksTest`). Only the link targets changed.
* **Platform Operator.** No endpoint, field or failure mode changed, so neither its prompt nor its allow-list needed an update; its code (`use-operator-chat.ts`, `lib/operator`) is untouched (phase 6).

### Not done, or not verified

* The CI jobs were not run (a stacked PR gets none). Locally, on Windows: `npm ci` and `npm run lockfile:check` at `ui/` (the lock was regenerated in a `node:26.13.0` container); `@eddi/core` typecheck, lint and 203 tests; the Chat UI typecheck, lint, 512 tests (+2 todo), build and budget (162.2 KB gz of 170); the Manager typecheck, lint, `i18n:check`, 9,322 of 9,325 tests (the three failures are the known environmental ones in `resource-detail-rag-upload-source.test.tsx`), build and budget (617.8 KB gz of 630, from 616.4). `./mvnw compile`, `./mvnw package -DskipTests` (947 entries under `META-INF/resources`, as on the base branch) and `BuildQualityGatesTest`, the `Documentation*Test`s, `ChangelogFragmentTest`, `ImportStyleTest` and `AutoApproveCopilotPolicyTest`.
* Not run: the Manager's Playwright tiers and Stryker. Stryker's scope (`lib/operator/**`, `updates.ts`, `hitl-tool-approvals.ts`) has no changed file, though `write-canary.ts` now reaches the backend through the package.
* The Workforce member thread (`workforce-thread.tsx`) and the Operator use the package only through `lib/api/chat.ts`; their own error-frame parsing and state machines are untouched. Both, and the Manager's `lib/api/hitl.ts`, `lib/api/attachments.ts` and `conversations.ts` extractors, move in phase 3 with `AgentConversation` (and phase 6 for the Operator).
* `use-chat.ts` still parses the `error` frame inline in `handleSSEEvent`: the package's `parseErrorMessage` falls back to English for an empty payload, the Manager to an empty reason it then translates.

### Next

Phase 2 (catalog and Workforce for `eddi-user`) or phase 3 (`@eddi/ui` and the agent kind: `AgentConversation` over this package, then every 1:1 surface on it).

***

## 🎨 feat(ui): `@eddi/ui`, and both apps on its tokens, theme and i18n (2026-11-04)

**Repo:** EDDI (`feat/ui-eddi-ui`, stacked on `refactor/ui-eddi-core`)

Phase 3a of the frontend unification plan (`planning/frontend-unification-plan.md` §3.1, §3.3, §7 phase 3, D3): the second shared package, `@eddi/ui` under [`ui/packages/ui`](https://github.com/labsai/EDDI/tree/main/ui/packages/ui/README.md), with the Manager and the Chat UI moved onto its foundations. Phase 3 is split: 3b builds `@eddi/conversation` (`AgentConversation` and the shared chat components) on top of this.

### What changed and why

* **`@eddi/ui`** — consumed as source like `@eddi/core` (`exports` → `src/`), React allowed, no API calls:
  * **Tokens** (`@eddi/ui/theme.css`): the Manager's Tailwind v4 `@theme` — semantic colours, the `brand-*` / `warn-*` / `ochre-*` scales, radius, font stack, light and `.dark` — moved verbatim out of `ui/manager/src/index.css`, which now imports it. Plain `@theme`, not `inline`, so `/branding/brand.css` still reaches the utilities. `@source "../"` lets Tailwind see the package's classes. `BrandDeliveryTest`, `brand-css.test.ts` and `no-hardcoded-amber.test.ts` read the new file.
  * **`--chat-*` as documented aliases** (`CHAT_TOKEN_ALIASES`, `SEMANTIC_TOKENS`). Fifteen of the widget's variables are now `var(<shared token>)` (`--chat-bg` → `--color-background`, `--chat-accent` → `--color-primary`, `--chat-user-bg` → `--chat-accent`, …); the widget gives the tokens its own palette per theme, so nothing renders differently. The names, the URL colour parameters and `brand.css`'s `--chat-accent` keep working because an override of the `--chat-*` name still wins. [`chat-aliases.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/styles/chat-aliases.test.ts) pins `variables.css` to the table, every one of the 31 names to the colour it had before (both themes), every name a colour parameter writes, and `--chat-accent` staying overridable by `brand.css`.
  * **Theme**: `ThemeProvider` / `useTheme` (moved from the Manager; marks `<html>` with a class or with `data-theme`) and the helpers under it (guarded storage, resolve, apply, an OS-change subscription that re-reads the preference). The widget's `useTheme` keeps its own `?theme=` precedence on top of the helpers.
  * **i18n**: `setupI18n` — English bundled, every other locale its own chunk and only the active one loaded (`partialBundledLanguages` + a lazy backend over a loader map), region tags matched, `{{productName}}` default variables, `dir`/`lang` from the RESOLVED language; `setDefaultVariables` for a brand saved at runtime; `SUPPORTED_LANGUAGES` (the eleven), `RTL_LANGUAGES`, `matchLanguage`. The Manager's `i18n/config.ts` is now its locale loaders plus one `setupI18n` call.
  * **Per-locale fonts**: phase 0's `locale-fonts.ts` moved in as the separate entry `@eddi/ui/fonts`. Separate on purpose: re-exported from the main entry, it made the widget's build emit all 468 Noto font files into `chat/dist` although nothing called it.
  * **Primitives**: `Button` / `buttonVariants` (and `cn`) and the theme-following, direction-aware `ThemedToaster` (it takes `rtl` as a prop; the Manager's new `AppToaster` passes it). The 174 Manager files that imported `@/components/ui/button` or `@/components/layout/theme-provider` import from `@eddi/ui`; `lib/utils.ts` re-exports `cn`.
  * **Boundaries**: `sharedPackage({ react, noApi })` in [`ui/eslint.config.base.js`](https://github.com/labsai/EDDI/tree/main/ui/eslint.config.base.js) lints `.tsx` with the hook rules and forbids `@eddi/core`, `fetch`/`XMLHttpRequest`/`EventSource`/`WebSocket` and `window.__EDDI_*__` in `@eddi/ui`; [`boundaries.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/core/src/boundaries.test.ts) checks the same (and still that core imports no UI package, and no cycle).
* **Widget i18n**: the Chat UI's own `t()` and four string tables became i18next bundles in [`ui/chat/src/i18n/locales`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/i18n/locales/en.json), set up through `setupI18n` without react-i18next (the locale is chosen once; `main.tsx` awaits `initLocale` before the first render, so `t()` still works outside React). The seven new locales — `ar`, `zh`, `th`, `ja`, `ko`, `pt`, `hi` — are translated with the Manager's terminology for agent, conversation, approval and rating. Placeholders moved from `{name}` to `{{name}}`; a missing value still stays visible, and a value is never interpolated twice. `?lang=ar` lays the widget out right to left. [`i18n.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/i18n/i18n.test.ts) checks all eleven files for parity, placeholders and real translation, and every key the code passes to `t()`.
* **Gates**: CI's `UI Chat` job runs `@eddi/ui`'s type check, lint and tests next to `@eddi/core`'s. `i18n:check` already walks `ui/packages/*/src`; the package has no `t()` keys of its own (a primitive takes its text as a prop). `AutoApproveCopilotPolicyTest` covers the new package's config files. The seven script-font packages moved from the Manager's dependencies to the package's; `ui/package-lock.json` was regenerated in a `node:26.13.0` container.
* **Docs**: the three AGENTS.md files, the packages README, the new package README, the Chat UI README (eleven languages, the token layers) and [`chat-ui-embedding.md`](https://docs.labs.ai/protocols-and-integration/chat-ui-embedding.md) (`lang`, the aliases). Two links to moved files were repointed (`docs/changelog/2026-10.md`, the phase-0 fragment) for `DocumentationLinksTest`.
* **Platform Operator**: no endpoint, config field, default or failure mode changed; neither its prompt nor its allow-list needed an update, so no revision bump. Stryker's scope (`lib/operator/**`, `updates.ts`, `hitl-tool-approvals.ts`) has no moved file. No API change, so no MSW handler changed.

### Behaviour and visual changes

* **Widget**: speaks eleven languages instead of four; its first load grew from 162.2 to 169.1 KB gz (budget 170) — i18next, less the three string tables that left the entry chunk. Each locale is a 2.8–3.4 KB gz chunk. `chat/dist` gains those ten files.
* **Manager**: none intended. The tokens, button and toaster were moved, not edited: the same declarations, classes and props (the main stylesheet's size is in the table below). A stored theme value that is not `dark`/`light`/`system` is now ignored instead of trusted.

### Review fixes (2026-11-15)

* **Focus ring under a brand.** `--chat-input-focus` aliased `--color-ring`, but `/branding/brand.css` (`BrandDelivery.stylesheet`) writes the Manager's `--color-ring` (its primary) on `:root`, and `chat.html` loads that stylesheet, so a branded widget's focus ring followed the Manager primary instead of the chat accent. It now aliases `--chat-accent`, like `--chat-user-bg` (`?accentColor=` already set all three). Unbranded, nothing changes; branded, the ring is the chat accent (on `main` it stayed the literal EDDI blue under a brand, so this also ends that mismatch). `--chat-accent` keeps its `--color-primary` alias: the brand stylesheet writes `--chat-accent` on `:root` whenever it writes `--color-primary` there (the chat accent defaults to the primary), and the widget's dark theme is `data-theme`, not the `.dark` class the brand's dark block targets. [`chat-aliases.test.ts`](https://github.com/labsai/EDDI/tree/main/ui/chat/src/styles/chat-aliases.test.ts) now applies that stylesheet's output and checks the accent, the user bubble and the focus ring take the chat accent in both themes while every other `--chat-*` name ignores the brand.
* **RTL.** `chat.css` used physical sides that `dir="rtl"` does not flip: the accent stripes (`border-left`, five rules) are `border-inline-start`, the absolutely placed eye toggles and the copy/close buttons (`right`) are `inset-inline-end`, and the paddings that reserve room for them (the secret fields, the rating card, the attachment chip) are `padding-inline`. Identical in LTR. The toast's `left: 50%` + `translateX(-50%)` centring stays physical.
* **`i18next` declared.** The widget imports `i18next` directly (`src/i18n/index.ts`) but relied on `@eddi/ui`'s copy being hoisted; `ui/chat/package.json` now declares it (`^26.4.7`, as the Manager and `@eddi/ui` do) and the lock's `chat` entry says so.
* **Merging `main` (through `refactor/ui-eddi-core`).** The eleven Manager files `main` added since this branch was cut import `Button` from `@eddi/ui`. `main`'s checks on the Manager's own font wiring (`main.tsx` imports only the default Noto family and installs the loader; `index.css` puts the active locale's CJK family first) were Manager tests in the file that moved into the package; they are now `ui/manager/src/i18n/__tests__/locale-fonts-wiring.test.ts`.

### Moved and deferred

* **Moved to `@eddi/ui`**: tokens, theme provider, i18n setup, locale fonts, `Button`, `ThemedToaster`, `cn`.
* **Not moved**: the Manager has no tooltip or icon-button component to move (icon buttons are `Button size="icon"`; tooltips are Radix used in place), and its dialogs, badges and inputs are not needed by the 3b chat components from both apps. The widget is not restyled onto Tailwind: its BEM stylesheet reads the shared tokens through the aliases, which is what 3a needs; D3's move to Tailwind comes with the shared components in 3b. The widget keeps the Noto Sans faces `chat.html` declares rather than loading script fonts per locale.
* **3b**: `@eddi/conversation` with `AgentConversation`, `MessageList`, `Message`, `Composer` and the rest, and the `conversation.*` namespace.

### Not done, or not verified

* The CI jobs were not run (a stacked PR gets none). Locally, on Windows: `npm ci` and `npm run lockfile:check` at `ui/` (lock regenerated in a `node:26.13.0` container); `@eddi/ui` typecheck, lint and 62 tests; `@eddi/core` typecheck, lint and 205 tests; the Chat UI typecheck, lint, 532 tests (+2 todo), build and budget (169.1 KB gz of 170, from 162.2); the Manager typecheck, lint, `i18n:check`, 9,032 of 9,035 tests (the three failures are the known environmental ones in `resource-detail-rag-upload-source.test.tsx`), build and budget (619.1 KB gz of 630, from 617.8). `./mvnw compile`, `./mvnw package -DskipTests` (951 entries under `META-INF/resources`, from 947: the widget's ten locale chunks, and six fewer files from the Manager's chunk graph — all 476 script-font files and seven family stylesheets are still there) and `BuildQualityGatesTest`, the `Documentation*Test`s, `ChangelogFragmentTest`, `ImportStyleTest`, `AutoApproveCopilotPolicyTest` and `BrandDeliveryTest`.
* Not run: Playwright (the local browser revision does not match), so the RTL e2e on the widget the plan asks of phase 3 is still to write and run; Stryker (no file in its scope changed).
* The widget's budget headroom is 0.9 KB gz. 3b, which moves it onto Tailwind and the shared components, has to find room (the router-free widget still carries `react-markdown` and `remark-gfm` eagerly) or raise the budget as a decision.

### Next

Phase 3b: `@eddi/conversation` — `AgentConversation` and the shared chat components, with `ChatPanel`, the test drawer, the Workforce chat and member thread and the widget moved onto them.

***

## 🧰 chore(ui): one npm workspace and one lockfile for both UIs (2026-11-04)

**Repo:** EDDI (`chore/ui-npm-workspaces`, stacked on `perf/frontend-phase0-baseline`)

Phase 1a of the frontend unification plan (revision 3, `planning/frontend-unification-plan.md` §2.7, §3.1, §7 phase 1, D2): `ui/` becomes an npm workspaces root, so the Manager, the Chat UI and the shared packages still to come (`ui/packages/*`) install from one lockfile. Both apps stay where they are (D2). `@eddi/core` is the next step and is not part of this change.

### What changed and why

* **Workspaces root.** [`ui/package.json`](https://github.com/labsai/EDDI/tree/main/ui/package.json) declares the workspaces `manager`, `chat` and `packages/*`. [`ui/package-lock.json`](https://github.com/labsai/EDDI/tree/main/ui/package-lock.json) replaces `ui/manager/package-lock.json` and `ui/chat/package-lock.json`. `npm ci` now runs once, at `ui/`, and installs into `ui/node_modules`. Each app keeps its own scripts (`npm run dev`, `test`, `build`, `lint`, `budget`) in its own directory. [`ui/packages/README.md`](https://github.com/labsai/EDDI/tree/main/ui/packages/README.md) holds the place for the shared packages.
* **The lock was seeded from the two old lockfiles, not resolved afresh.** Every version CI had accepted was kept, except the edges the alignment below forced. The resulting lock passes `npm ci` and a clean `npm ls --all` on Linux with Node 26.13.0, as CI runs it. The only transitive version changes are Tailwind 4.3.3 → 4.3.4 (with its oxide platform packages and their `@emnapi/*` children), `enhanced-resolve` 5.26.0 → 5.26.1 and one `magic-string` 1.4.5 where two copies were.
* **Shared versions aligned**, so a dependency both apps use is installed once: `lucide-react` ^0.577 → ^1.59 in the Chat UI (no icon it uses was renamed; typecheck, tests and build pass unchanged), `jsdom` \~30.1.2 in the Chat UI, and `eslint` ^10.14.0, `typescript` \~5.9.3, `typescript-eslint` ^8.72.1 and `vite` ^8.3.5 in the Manager.
* **`overrides` moved to the root.** npm reads them only from the workspace root. The two `$dompurify`/`$katex` references became explicit floors (`^3.4.17`, `^0.19.1`), because a `$` reference may only name a dependency of the root package itself.
* **Shared configs, without changing what they check.** [`ui/tsconfig.base.json`](https://github.com/labsai/EDDI/tree/main/ui/tsconfig.base.json) holds the eight compiler options every app tsconfig set identically; each `tsconfig.*.json` extends it and keeps its own target, lib and paths. `tsc --showConfig` is identical before and after for all six projects. [`ui/eslint.config.base.js`](https://github.com/labsai/EDDI/tree/main/ui/eslint.config.base.js) holds the recommended presets, browser globals, the two hook rules and the `toBeGreaterThanOrEqual(0)` guard. `eslint --print-config` is identical before and after for nine sample files across both apps, except that the Chat UI's tautology message is now the Manager's longer one. `ecmaVersion` stays per app (2020 and 2022).
* **The Windows `oxide-wasm32-wasi` trap, checked in CI.** npm on Windows prunes that optional package's children from the lock, and the Linux runner then fails `npm ci`. Until now only `ui/manager/AGENTS.md` described a manual check. [`ui/scripts/check-lockfile-platforms.mjs`](https://github.com/labsai/EDDI/tree/main/ui/scripts/check-lockfile-platforms.mjs) (`npm run lockfile:check` at `ui/`) asserts the four children resolve from the oxide package, and that every dependency of every lock entry resolves the way Node would look it up. `UI Manager Checks` runs it after `npm ci`. Run against a copy of the old Manager lock with the children removed, it fails and names all four.
* **Maven.** `pom.xml` runs one `npm ci` (execution `ui-install`, working directory `ui/`) instead of `manager-install` and `chat-install`. Node still lands in `ui/node/<version>`, and `manager-build`, `chat-build` and `copy-ui-bundles` are unchanged, so the jar's `META-INF/resources` layout is unchanged.
* **CI** ([`ci.yml`](https://github.com/labsai/EDDI/tree/main/.github/workflows/ci.yml)). `UI Manager Checks`, `UI Manager E2E (MSW)`, `UI Chat`, `Backend E2E` and `Auth E2E (Keycloak)` install at `ui/` and key the npm cache on `ui/package-lock.json`, as does `Build Image`. The CycloneDX step still writes `bom-ui-manager.json` and `bom-ui-chat.json`, now from `ui/package.json` with `--workspace manager|chat`: each document lists only that app's production dependencies, and its root component is the workspace root (`eddi-ui`), with the app as a component. Trivy and Gitleaks scan the whole repository and needed no change. CodeQL's UI config adds `ui/packages`.
* **Dependabot.** The `/ui/manager` and `/ui/chat` entries become one `/ui` entry with the Manager's groups and ignore rules, so a dependency both apps use moves in one PR.
* **Elsewhere.** The auto-approve policy protects `ui/package*.json`, `ui/scripts/**`, the two base configs, `ui/bundle-budget.json` and `ui/packages/*/package*.json` (with `AutoApproveCopilotPolicyTest`). `.gitignore` ignores `ui/node_modules/`. `.gitattributes` pins the root lock to LF. The demo Dockerfile, the Manager's `mise.toml` install task, the Stryker schema path and the design-sync `extraFonts` path follow the new layout. The root, Manager and Chat UI `AGENTS.md`, both READMEs, `CONTRIBUTING.md`, `docs/agent-manager-gui.md` and `docs/developer-quickstart.md` say to run `npm ci` in `ui/`.

### Not done, or not verified

* The CI jobs were not run. Locally: `npm ci` at `ui/` (Windows, Node 24), both apps' lint, typecheck, unit tests, `vite build` and `npm run budget` (`/manage` 616.4 KB gz, `/chat` 161.6 KB gz, both within the phase-0 budgets), the Manager's `audit:prod` and `i18n:check`, and the CycloneDX step in a `node:26.13.0` container. The Manager's only failing unit tests are the three in `resource-detail-rag-upload-source.test.tsx` that already fail locally on `main`.
* **Jar layout.** `./mvnw package -DskipTests` on this branch and on `perf/frontend-phase0-baseline` both put 947 entries under `META-INF/resources`. 842 paths are identical, and the other 105 differ only in a Vite content hash; with hashes normalised, the two listings are the same.
* `BuildQualityGatesTest.vitestIsGroupedForSecurityUpdates` now expects at least one npm entry grouping vitest, since there is one `/ui` entry instead of two.
* `npm audit` run from `ui/manager` (`audit:prod`) now audits the whole workspace tree, the Chat UI's production dependencies included.
* Not run: the Manager's Playwright tiers, Stryker, and the design-sync converter.

### Next

Phase 1b: `@eddi/core` under `ui/packages/core`, the union of the five turn loops' tests first, then the widget and `ChatPanel` moved onto it. `i18n:check` learns the package directories when the first package with strings lands.

***

## ✨ feat(llm): lazy loading for HTTP, MCP and A2A tools (`lazySources`) (2026-11-04)

**Repo:** EDDI (`feat/llm-lazy-external-tools`)

### What changed and why

An operator agent whose tools are a 60–70 operation API sent every tool description on every model call: `toolLoadingStrategy: LAZY` only ever hid the built-in tools, because `AgentOrchestrator.buildToolSetup` built `discover_tools` from the built-ins and merged the http/mcp/a2a sources afterwards, in full.

* **`lazySources`** (`LlmConfiguration.Task`): any of `builtin` (default, the old behaviour), `http`, `mcp`, `a2a`. **`lazyRetention`**: `turn` (default) or `conversation`. Both are defaults, not switches: a stored config is unchanged.
* **`LazyToolCatalog`** (new, stateless): with an external source listed, the `discover_tools` name is reserved in assembly phase 1 (so no remote tool can take it) and completed after phase 2 into a *grouped* meta-tool — its description lists the groups with a one-line summary each; it takes `group` and/or `keywords`; results are ranked and capped by `maxToolsInContext`. The lazily-managed specs travel in `ToolSetup.builtInSpecs`, the component LAZY always activated from, so the live loop, resume and refusal share one list. An empty catalog removes the meta-tool again.
* **Groups**: `ToolGroup` on the tool SPI (`ToolContribution.toolGroups`, carried through `ToolSourceRegistry`). An http group is one apicalls configuration (resource id), summarised by the new optional **`ApiCallsConfiguration.description`**, which `McpApiToolBuilder` now fills from the OpenAPI tag (`"<tag>: <first line of the tag description>"`). An MCP group is one server (`name`, else host — never the URL).
* **Safety parity**: a call to a lazily-managed tool that is not loaded is answered `NOT_EXECUTED` ("call discover\_tools first") *before* the approval gate — never executed, never shown to an approver (trace `tool_not_activated`, metric `eddi.llm.lazy_tools.refused`). Loaded tools go through the unchanged per-call pipeline. This also applies to the existing built-in-only LAZY mode, where a hidden built-in called directly used to run. Resume executes approved calls by name regardless of what is loaded.
* **Retention**: the loaded names are stored on the conversation step (`llm:lazyTools:activated:<taskId>`, not a client-visible key) when `discover_tools` activates, and re-applied at the start of every loop run (cascade steps, resume) and, with `conversation`, from the latest earlier step (capped at `maxToolsInContext`). Metric `eddi.llm.lazy_tools.activated`.

### Measured

Synthetic 66-tool HTTP agent, six apicalls groups of eleven, OpenAPI-generated shape (`LazyExternalToolsTest`, GPT-4o tokenizer, tool specs only): eager 66 specs / 40,626 chars / \~9,438 tokens per request; lazy first request 1 spec / 1,024 chars / \~258 tokens; after loading one group 12 specs / 7,795 chars / \~1,831 tokens. See [Lazy tool loading](https://docs.labs.ai/agent-configuration/langchain.md#lazy-tool-loading).

### Docs

`docs/langchain.md` (table rows + new "Lazy tool loading" section), `docs/httpcalls.md` (`description`). The Platform Operator's prompt and allow-list do not cover tool loading, so they are unchanged.

***

## 🐛 fix(cluster): a finished turn could take back the lease it had just handed on (2026-11-04)

**Repo:** EDDI (`fix/lease-handoff-test-flake`)

### What changed and why

`ClusterConversationCoordinatorTest.leaseIsHandedToTheNextQueuedTurn` failed intermittently in CI (`one acquire for the whole queue ==> expected: <1> but was: <2>`). It was not the test: the local lease handoff added in #1240 had a real race.

`releaseOrHandOver` parks the lease in `handoffs`, calls `submitNext` (whose `execute` takes it for the next queued turn), and in its `finally` removes "its" parking with `handoffs.remove(conversationId, lease)`. But a handed-over lease is the *same* `LeaseHandle` object for every turn in the chain. Once `submitNext` has handed it on, turn N+1 can run to its end and park that same lease for turn N+2 before turn N's thread reaches its `finally` — which then matched N+1's parking, released the lease, and left turn N+2 to acquire a fresh one. In production that is the extra NATS round trips and the window for another node to take the conversation that the handoff exists to avoid.

Each parking is now its own `Handoff` object (a private class with identity `equals`, deliberately not a record), and the `finally` removes only the parking this call made.

Reproduced before the fix with the test repeated 1000 times: 13 failures. After it: 0 failures in 3000.

**Files:** [`ClusterConversationCoordinator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/ClusterConversationCoordinator.java)

***

## ✨ feat(llm): structured answers through a terminal reply tool, `answerMode: "tool"` (2026-11-04)

**Repo:** EDDI (`feat/llm-answer-mode-tool`)

### What changed and why

A tool-using agent on Gemini, Anthropic or Bedrock cannot use native JSON mode (the providers reject it next to `tools`), so its JSON answer was only held to the schema by the prompt block — and in production 1.6–5.7% of such answers were replaced by the fallback. Function-call arguments, by contrast, are enforced by every provider. The new opt-in task field `answerMode: "tool"` adds one synthetic tool, `reply` (`answerToolName`), whose parameters are the `responseSchema`; the model answers by calling it.

* **Loop** (`ToolLoopRunner`): reply calls are taken out of each model response before the call caps, the approval gate, quotas, rate limits, cache and cost tracking see it. A reply ends the loop with no further model call; its arguments become the answer text and run through the unchanged `convertToObject` path (parse, `responseSchema` / `nonBlankFields`, `onSchemaMismatch`, `postResponse`). Reply plus other calls: the others run first; if one pauses for approval the reply is discarded (not in the frozen transcript). Duplicate replies: the first wins, WARN once per conversation. Traced as step type `answer` without arguments; never a `tool_call`/`tool_result` event (those are emitted inside `executeToolCall`, which the reply never reaches — true for the current event code and for `feat/resume-stream-tool-events`).
* **Forced call** (`answerToolChoice`, default `required`): `ToolChoice.REQUIRED` on the request for `openai`, `azure-openai`, `anthropic`, `gemini`, `mistral` (verified in the langchain4j bindings); every other provider gets `auto`, logged at INFO at deploy. `maxToolIterations` still bounds the loop; a loop that spends it without a reply ends with the budget text, which goes to `onInvalidJson`.
* **Plain-text answer** goes through the existing invalid-JSON path (local repair → `onInvalidJson`); no parallel path.
* **Assembly** (`AgentOrchestrator.buildToolSetup`): the reply tool is added last, with no executor; a runtime tool of the same name is dropped with a WARN. The HITL resume, LAZY loading, cascade steps, streaming and the format re-ask (`reaskFinalAnswer`) all offer it.
* **Validation** (`AnswerToolConfigValidator`, called from `LlmStore` and at deploy): tool mode needs `convertToObject: "true"` and a convertible object-root `responseSchema`; the name must not collide with an engine tool or a tool the task names in its whitelist, rate limits, pricing, timeouts, cache scopes or quotas.
* **Prompt**: in tool mode the `RESPONSE FORMAT` block tells the model to call the tool instead of repeating the schema; no response format is sent on those requests.
* **Metric** `eddi.llm.answer_tool{outcome}`: `reply`, `text`, `duplicate`, `discarded_by_pause`, `no_reply`, `collision_dropped`.

### Design decisions

* The reply arguments are returned as the loop's answer *string*, so every downstream policy is the existing one — "tool" can never lose an answer "text" would have kept.
* The reply call is removed from the transcript rather than answered with a synthetic result, so a pause's frozen transcript and a cascade's carried exchange never hold an unanswered call.
* The "only tool" INFO is logged at first assembly per task, not at configure: httpcall/MCP tools come from the workflow, which `configure` cannot see.

**Files:** [`AnswerTool.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/AnswerTool.java), [`AnswerToolConfigValidator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/AnswerToolConfigValidator.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`AgentOrchestrator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/AgentOrchestrator.java), [`LlmTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmTask.java), [`LlmConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/LlmConfiguration.java), [`LlmStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/llm/mongo/LlmStore.java), [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md#answering-through-a-reply-tool-answermode-tool), [`llm-resilience.md`](https://docs.labs.ai/agent-configuration/llm-resilience.md).

**Review follow-ups.** A `modelCascade` on a `tool`-mode task with no other tool ran every step on the legacy text path, because the cascade's tool-loop gate was `task.isAgentMode()` alone, so the reply tool was never offered. `CascadingModelExecutor` now also enters the tool loop when `answerMode` is `tool`. `enableInAgentMode` still gates a task with other tools, because `LlmTask` skips the cascade for those before this point. A blank `answerToolName` is now saved as the default `reply`, which is how the runtime already read it; before, it was refused with a 400. `langchain.md` now warns that a tool-mode turn adds the reply JSON to the output unless `addToOutput` is `"false"`, and tells authors to set that when a `postResponse` template renders the answer.

***

## ✨ feat(httpcalls): validate LLM tool arguments against an argument schema before the approval gate (2026-11-04)

**Repo:** EDDI (`feat/httpcall-argument-schema`)

### What changed and why

Generated OpenAPI tools filled a whole-body template from string parameters, so a malformed call (missing required field, wrong type, misspelled field, value outside an enum) reached the human approval card and then failed at the API — or, when the API ignores unknown fields, silently did nothing after a human had approved it.

* **`ApiCall.argumentSchema`** (new, optional) — JSON Schema of the tool arguments. `null` keeps string parameters and today's rendering byte for byte. **`ApiCall.unknownFields`** (`reject` | `drop` | `allow`, default `reject` when a schema is set; save-time validated).
* **`McpApiToolBuilder`** generates the schema per operation (new `OpenApiArgumentSchemas`): scalar path/query parameters typed, the body schema with every component `$ref` resolved (`allOf` of objects merged, recursion and `anyOf`/`oneOf` left untyped, `readOnly` fields omitted).
* **`HttpCallToolsProvider`** types the tool parameters from the schema (via the new `ResponseSchemaConverter.toElement`; a parameter with no tool form, including a property-less object Gemini would reject, stays a string). With a schema, arguments are normalised (a JSON string for an object/array parameter is decoded; `drop` removes undeclared fields) and every non-string value is rendered as compact JSON — never a Java `toString` — and substituted as data, as before.
* **`ToolLoopRunner.refuseInvalidArguments`** runs before `ToolApprovalGate.classify`: every executor implementing the new SPI `ToolArgumentValidator` is asked; a violating call gets a `NOT_EXECUTED` envelope with one line per violation (`$.requestBody.emails: required`, `$.requestBody.role: must be one of manager, curator`, `… unknown field (declared fields: …)`), a `tool_error` trace step with `error: "argument_schema"`, and `eddi.tool.arguments.refused`. It is never paused or executed. The httpcall executor re-checks before sending, which covers resumed calls.
* **`ToolArgumentSchemaValidator`** (`modules/llm/guardrails`) — pure function, uses the networknt validator already on the classpath on an effective schema reduced to a safe subset (no `$ref` loading, no `pattern`); built so it can become a tool-call guardrail type later.

Docs: [`httpcalls.md`](https://docs.labs.ai/agent-configuration/httpcalls.md#argument-schema-for-llm-tools), [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md#argument-schema-refusals).

**Files:** [`ApiCall.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/apicalls/model/ApiCall.java), [`ToolArgumentSchemaValidator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/ToolArgumentSchemaValidator.java), [`ToolArgumentValidator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/spi/ToolArgumentValidator.java), [`OpenApiArgumentSchemas.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/OpenApiArgumentSchemas.java), `McpApiToolBuilder.java`, `HttpCallToolsProvider.java`, `ToolLoopRunner.java`, `ResponseSchemaConverter.java`, `ApiCallsConfigurationValidator.java`.

### Design decisions

* Rendering moved to the tool-argument boundary (`HttpCallToolsProvider.templateDataFor`, shared by the gate-time resolver and the executor) rather than `ApiCallExecutor`: the executor keeps receiving strings, so the fingerprint pinned at gate time and the request built at execution agree.
* `drop` is applied when the request is built, not by rewriting the model's call: the transcript and the approval card keep the call as the model wrote it.
* Top-level parameters stay all-required as before (an omitted query value would render `?name=`); requiredness inside the body follows the spec.

***

## ✨ feat(llm): rescue near-miss JSON replies without a second model call (2026-11-04)

**Repo:** EDDI (`feat/llm-json-near-miss-rescue`)

### What changed and why

A tool-using agent on Gemini, Anthropic or Bedrock gets no native JSON mode, and in production about 2-6% of the turns of such agents were replaced by the fallback answer although the model had written a good one: plain HTML/text with no JSON wrapper (most often non-Latin scripts), double-escaped JSON, a misspelled field name, or `{}`. `onInvalidJson: "retry"` helps but costs a second model call. Three opt-in local repairs now cover the first three shapes, in the shared parse path (`ModelOutputParser`), so the live turn, the HITL resume, the format-retry runner's detection, the circuit breaker's view and every cascade step see the same reply:

* **`responseValidation.onInvalidJson: "wrap"`** with required `wrapField`, optional `wrapDefaults` and `wrapMaxChars` (default 20,000): a non-JSON, non-blank reply becomes `{ "<wrapField>": "<text>" }` (plus the defaults) and is validated like any parsed reply. Text starting with `{` or `[` is broken JSON and is never wrapped (`fallbackAction` applies). New parse outcome `wrapped` (`llm:output:outcome:*`, `eddi.llm.output{outcome=wrapped}`), `eddi.llm.recovery{action=wrap}` and a `LlmRecoveryLog` line.
* **Double-escape repair** (`{\"a\": \"b\"}`): one-level unescape, on whenever `onInvalidJson` is `wrap` or `retry`; accepted only as a JSON object and never tried on a reply that already parsed.
* **Task `fieldAliases`** (`{"htmlResponseStr": "htmlResponseText"}`): renames a top-level key when the target is absent (the target wins when both exist).
* `{}` stays covered by `nonBlankFields` plus `onSchemaMismatch: "retry"`; documented as the recommended pair.

Save-time validation in `LlmStore`: `wrap` without `wrapField` is a 400 naming what to set; `wrapField`, alias names and `wrapDefaults` keys must be plain top-level names. A config without the new fields behaves exactly as before.

### Design decisions

* The options are resolved once into `RescueOptions.of(task)` and passed through the existing `parse` / `Policy.from` / `classifyJsonReply` / `convertResponseToObject` overloads (the old signatures delegate with `RescueOptions.NONE`), so a later caller that routes a plain-text answer through the invalid-JSON handling (the `answerMode: "tool"` work) gets the rescue for free.
* Wrapping and the double-escape repair follow `responseValidation.enabled` like every other policy; `fieldAliases` is independent of it, like `nonBlankFields`.
* Plan deviation: `wrap` and `retry` are alternatives for the single `onInvalidJson` action. A reply `wrap` cannot rescue (broken JSON, over the cap) is handled by `fallbackAction` (as after spent retries), not by a second policy.
* Platform Operator: no change needed (it does not teach per-task response-validation fields).

**Files:** [`ModelOutputParser.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ModelOutputParser.java), [`RescueOptions.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/RescueOptions.java), [`FormatRetryRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/FormatRetryRunner.java), [`LlmTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmTask.java), [`LlmConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/LlmConfiguration.java), [`LlmStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/llm/mongo/LlmStore.java), [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md), [`llm-resilience.md`](https://docs.labs.ai/agent-configuration/llm-resilience.md)

***

## ✨ feat(setup-api): per-turn auth from secret context, generate-only, and re-sync (2026-11-04)

**Repo:** EDDI (`feat/setup-api-context-auth-sync`)

### What changed and why

An integrator could not build a per-user-token operator agent with EDDI's own OpenAPI converter, nor update one from a regenerated spec. Three additions, usable independently:

1. **`${context:<key>}` in httpcall headers and in `apiAuth`.** Resolved per request from the turn's context entry of that key — only when the client marked it `"secret": true`, only in a header, only as a lone reference after an optional scheme, only when written in the configured header itself, and only towards the origin of the httpcalls configuration's `targetServerUrl`. A missing value, an empty one, or the `<secret context>` placeholder a resumed turn holds when the client did not re-supply it fails the call — never `Bearer` with nothing. The plaintext joins the executor's redaction set (request record, approval preview, error bodies, logs) and disables redirects. Read from the step datum (`context:<key>`), which holds the live value during the turn and after a HITL resume re-injects it (`Conversation.injectResumeSecretContext`). A Qute pass-through resolver for the `context` namespace keeps the reference intact through templating. Metric `eddi.httpcalls.context.reference{outcome}`.
2. **`"dryRun": true` on `POST /administration/agents/setup-api`.** Runs the whole setup code path with every write skipped (`ResourceWriter`): no store, vault, descriptor, grant or deploy. Returns `200` with the apicalls configurations, tool names, LLM configuration, workflow and agent (gate included). A plaintext `apiKey`/`apiAuth` is shown as a placeholder. Hidden from the OpenAPI schema so the Platform Operator's generated `setup-api` tool cannot carry it.
3. **`POST /administration/agents/{agentId}/setup-api/sync`.** Regenerates only the apicalls configurations stamped with the new `ApiCallsConfiguration.openApiOrigin` marker (now set by every setup), rewrites the LLM task's `tools` list and the generated API summary in its prompt, keeps everything else, and saves the agent as a compatible version (`updateAgent(..., compatible=true)`), then deploys unless `deploy: false`. Reports added/changed/removed tools; refuses with 400 and nothing written when a removed tool is still named by `toolQuotas`, a `toolApprovals` exemption (agent or task) or `toolResultGuardrails.exemptTools`, listing each. The request's `requireApproval` patterns are unioned into the stored gate; nothing is removed and request exemptions are ignored. An agent without marked configurations (created before this change) is refused with how to add the marker. Supports `dryRun`.

### Findings

* The existing `Bearer {context.userToken}` Qute form does **not** leak into persisted memory: an `Authorization` header is name-redacted in the request record, and the turn-end scrub (`Conversation.scrubSecretContextValues`) removes the value (8+ characters) from every step datum, property, pending tool-call batch and audit entry. It is weaker in-turn: it renders anywhere (path, query, body), towards any host, follows redirects, sends `Bearer` when missing, and an API error body echoing the token reaches the model's tool result only pattern-redacted. Unchanged; the reference is documented as the recommended form.
* Review follow-up: a dry run that names an existing vault key (`vaultKeyName`) together with a plaintext `apiKey` can't tell reuse from creation without vault metadata, so it reports the destination-host rule a new key would fail in `resources.warnings` instead of refusing the request; the live setup checks hosts only when it creates the key.

### Not done

* `toolDisplay` reference checks: the field is not on `main` yet (`feat/resume-stream-tool-events`); sync preserves it (the LLM task is copied whole) but cannot check it for dangling references.

**Files:** [`SecretContextReferences.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/SecretContextReferences.java), [`ApiCallExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/apicalls/impl/ApiCallExecutor.java), [`AgentSetupService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/setup/AgentSetupService.java), [`ApiAgentSyncService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/setup/ApiAgentSyncService.java), [`ApiCallsConfiguration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/apicalls/model/ApiCallsConfiguration.java); docs [`httpcalls.md`](https://docs.labs.ai/agent-configuration/httpcalls.md), [`architecture.md`](https://docs.labs.ai/architecture-and-concepts/architecture.md), [`rest-api-reference.md`](https://docs.labs.ai/conversations-and-orchestration/rest-api-reference.md), [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md).

***

## 🛡️ fix(groups, llm): fenced peer text in group prompts, head-and-tail tool truncation, identifiers kept in summaries, retry jitter (2026-11-04)

**Repo:** EDDI (`fix/tier1-prompt-hygiene-runtime`)

Four small changes that came out of comparing EDDI with OpenClaw's group-chat and agent runtime. Each one is local to one or two files.

### 1. Peer text in group prompts is fenced, cleaned and bounded

The preset discussion templates quoted other participants as `— {entry.speaker}: "{entry.content}"`. A peer is not necessarily trustworthy (a dynamic or recruited agent, a human member, or a model talked into something), and its text could close the quotation and carry on as if it were the template giving instructions. The text could also be any size.

* **New `PeerContentGuard`** ([`PeerContentGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/PeerContentGuard.java)), applied once in `GroupContextBuilder.buildPhaseInput` to the template data of every phase type, custom `inputTemplate`s included. It breaks any ` ``` ` inside quoted text with a zero-width space, reduces a speaker name to one line of at most 120 characters, cuts one entry at 12,000 characters with a note, and drops the oldest entries of a list once it passes 96,000 characters, leaving one `System` note in their place. The newest entry is always kept. The stored transcript is unchanged.
* **The 14 presets that quote peers** ([`DiscussionStylePresets.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/DiscussionStylePresets.java)) now put that text between ` ``` ` fences, including `targetResponse` and `originalResponse`, and open with `QUOTED_CONTENT_NOTICE`, which tells the member that fenced text is quoted material to weigh and not instructions to follow.
* The participant names spliced into the instructions themselves (`targetName` in "You are reviewing {targetName}'s…", the speaker's own `displayName`) get the same one-line treatment, and the list budget counts every rendered string of an entry (names and phase name too), not only its content.
* The Manager's verbatim copy of the arbitration prompt (`NEGOTIATION_ARBITRATION_TEMPLATE` in [`hitl-config.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/hitl-config.ts)) follows the new preset; a Vitest compares the two.
* The user's own `question` is not treated as peer text.
* **Not covered yet:** the task-force templates (`TEMPLATE_EXECUTE`, `TEMPLATE_VERIFY`), which `TaskForceEngine` renders from its own data. They quote task results the same unfenced way.

### 2. Tool results over the limit keep their start and their end

`ToolResponseTruncator` cut an over-limit result after its first `maxChars` characters, which drops exactly what a model most needs from a failed command or API call: the exit code, the error and the totals at the end.

* **New strategy `headTail`**, the default when `toolResponseLimits.truncationStrategy` is unset. It keeps 70% of the limit from the start and 30% from the end, with a `[TRUNCATED: …]` note in place of the middle. The kept content is still exactly the limit, and neither cut splits a surrogate pair.
* `truncate` (start only) is unchanged when set explicitly, and is still what an unknown strategy name and the `paginate`/`summarize` fallbacks use.
* `toolResponseLimits` had no documentation, so it now has its own section in [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md#tool-response-limits).

### 3. Summaries keep identifiers exactly as written

The rolling conversation summary's default prompt ([`ConversationSummarizer.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ConversationSummarizer.java)) gained a seventh rule: copy every opaque identifier (IDs, UUIDs, hashes, order and ticket numbers, URLs, hostnames, IPs, ports, file names and paths) exactly as written. The group context-window summary (`GroupContextBuilder.WINDOW_SUMMARY_INSTRUCTIONS`) got the same line. A custom `summarizationPrompt` replaces the whole default, so it gets none of this; the docs now say so.

### 4. Retry backoff has jitter

`RetryConfiguration` slept exactly `backoffDelayMs × multiplier^n`, so every conversation that hit the same provider outage retried in lockstep and arrived in one burst again.

* **New field `jitterRatio`**, default `0.2`: each configured backoff is shortened by a random share of up to that fraction (a 1000 ms backoff sleeps 800–1000 ms). Applied in both `executeWithRetry` and the public `backoff(...)` used by the streaming path.
* **Downwards only**, so a jittered sleep never exceeds `maxBackoffDelayMs`, the 60-second total backoff budget or the turn deadline. A provider-requested wait (`honorRetryAfter`) is never shortened. `0` turns it off; values outside `[0, 1]` are clamped and `NaN` counts as `0`.
* The Manager's `retry` type gained the optional field ([`types.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/components/editors/llm/types.ts)).

### Behaviour changes operators may notice

* A tool result over its limit now shows its last 30% instead of more of its start. Set `"truncationStrategy": "truncate"` to keep the old output.
* Retry sleeps are up to 20% shorter and no longer identical across conversations.
* Group member prompts show peer text in fences, with a one-line notice at the top.

### Tests

New `PeerContentGuardTest`, including a real Qute render in which a peer's attempt to close the fence stays inside it, and a check that every peer-quoting preset carries the notice. Also new head-and-tail cases in `ToolResponseTruncatorExtendedTest`, jitter cases in `RetryConfigurationTest`, and an identifier-rule case in `ConversationSummarizerTest`. Existing retry tests that assert exact sleep values or exact budget arithmetic (`RetryConfigurationTest`, `RetryConfigurationDeadlineTest`, `StreamingLegacyChatExecutorRetryTest`, `ToolExchangeIdsAndProvenanceTest`) now set `jitterRatio` to `0`: jitter only shortens a sleep, so with it on, one more retry fits inside the same budget.

***

## 🔒 fix(engine): agent-findings sweep — security, runtime, HITL, GDPR and cluster (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-engine-security-runtime`)

### What changed and why

Verified the 55 CodeRabbit agent findings filed against `engine/{security,runtime,hitl,setup,tenancy,schedule,triggermanagement,cluster,gdpr}` against current `main`: 15 fixed here, 25 already fixed by earlier PRs (#1187, #1197, #1198), 4 accepted risks (documented behaviour or operator-only configuration), 11 left for a decision (contract or cross-area changes, one already on the unmerged #1234). Plus the CodeRabbit outside-diff finding on #1208.

* **NATS TLS** — a `tls://` / `wss://` URL turned TLS on inside jnats with `SSLContext.getDefault()`, skipping the host-name check that `eddi.nats.tls.enabled` installs; the verifying context is now built for those URLs too. The `createSocket(Socket, InputStream, boolean)` overload of `HostnameVerifyingSslContext` now returns a verifying socket like every other overload. Review follow-up: without an EDDI trust or key store the JVM default context is the base (a `javax.net.ssl.keyStore` client certificate still goes out for mTLS), and with host-name verification on the node dials the host name (`HappyEyeballs`) — jnats' default resolution dialled the resolved IP, so the check compared the certificate with the address, not the name in `eddi.nats.url`.
* **HITL** — the batch timeout policy no longer treats a rule shadowed by an earlier rule with the same match as speaking for a call (a policy-less task rule could let another call's `AUTO_APPROVE` decide the whole batch). The group pending-approval retention sweep cancels only the pause it found expired (`cancelPausedDiscussion` with the pause id), not a discussion an approval resumed in between. The self-conversation check sees JSON-escaped ids. The self-ungating guard refuses a patch whose earlier add/remove shifts a gated task's index, and an MCP `update_resource` that replaces a gated LLM document.
* **Sharing** — revoking the canonical subject `describe()` returned no longer re-encodes it (a `%`/`|` in a name made the revoke match nothing and report success); the share dialog's grant list follows the same structural disclosure rule as descriptor responses when workspaces are not enforced.
* **GDPR** — a failed dead-letter, journal, descriptor or checkpoint delete keeps the conversation snapshots for the retry, as a failed attachment or vault sweep already did.
* **Runtime** — the secret-context scrub leaves spend and token-usage records alone (a secret equal to the turn's cost erased its metering); a later workflow no longer puts back input a `scope: secret` instruction scrubbed; Dream keeps global and reader-less group memories apart; a 3-segment DELETE marks a descriptor deleted only when it is that descriptor's own resource (a `/spacestore/variables/{key}` delete could hide another owner's configuration).
* **Unauthenticated guard** — the side-effecting managed-conversation GET is recognised under a `quarkus.http.root-path`.

### Decisions left open

Conversation review after a compatible update, sharing CAS, setup-api `apiAuth` allowedHosts doc/code mismatch, checkpoint writes racing an erasure, journal tombstone retention, tool-pause narration vs output guardrails, team-cadence mutation by a former member, cascade ids of non-viewable nodes, team-share notifications to former members — listed in the batch report.

**Files:** [`NatsConnectionManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/NatsConnectionManager.java), `HostnameVerifyingSslContext.java` (since replaced by `ServerNameTrustManager`), [`ConversationHitlService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationHitlService.java), [`HitlCrashRecoveryObserver.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/HitlCrashRecoveryObserver.java), [`ApprovedCallScope.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/tools/ApprovedCallScope.java), [`SelfUngatingGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/tools/SelfUngatingGuard.java), [`RestResourceSharing.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/rest/RestResourceSharing.java), [`ResourceSharingService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/ResourceSharingService.java), [`ResourceAccessGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/spaces/ResourceAccessGuard.java), [`UnauthenticatedRequestGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/security/UnauthenticatedRequestGuard.java), [`GdprComplianceService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/gdpr/GdprComplianceService.java), [`Conversation.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/Conversation.java), [`DreamService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/DreamService.java), [`DocumentDescriptorFilter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/rest/interceptors/DocumentDescriptorFilter.java), [`gdpr-compliance.md`](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md)

***

## 🐛 fix(integrations): close six channel findings from the agent-findings review (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-integrations`)

### What changed and why

A batch of 23 scanner findings against `integrations/{channels,email,slack,webhook}` was checked against the current code. Most had been closed since the scans (#1126, #1187, #1175) or are documented limitations; six were real and are fixed here:

* **Slack bot token, composite references.** The `allowedHosts` check on a Slack `botToken` parsed only the first `${vault:…}` in the value, while the resolver expands all of them. Every reference is now checked (`ChannelTargetRouter.botTokenMayGoToSlack`, which the legacy connector path shares).
* **Slack approval card without a known pause.** A card built before its pause could be read was recorded with no pause identity and matched any pause that began before the record was written — so a delayed card could approve a later pause it does not show. Such a card is now posted without buttons and not recorded, and a record without a pause epoch matches nothing (`ISlackApprovalRecordStore.matchesPause`, `notifyApprovers`, the group listener). The card says why it has no buttons; for a conversation, its own user writing in the thread again posts a card with buttons, and a group pause is decided through REST/MCP ([hitl.md](https://docs.labs.ai/conversations-and-orchestration/hitl.md)).
* **Slack pause notice escaping.** The in-thread pause notice appended the pause reason as raw mrkdwn; it is escaped like the approval card's reason.
* **Email, duplicate Message-ID.** A mail from another sender carrying the Message-ID of a mail waiting for its retry took over that mail's ledger row and the conversation it names. It now waits, and is settled as a duplicate once the real mail has run (`EmailInboundProcessor`).
* **Email, group reply retries.** A cached group reply was retried to its stored recipient without the recipient rules being applied again, so turning `honorReplyTo` off did not stop a pending reply to a `Reply-To`. The retry now decides again, as every other reply kind does ([email-integration.md](https://docs.labs.ai/protocols-and-integration/email-integration.md) already promised this), and renders the mail again under the row's Message-ID, so a changed `address` is its `From` as well as the envelope sender.
* **Legacy Slack connector `groupId`.** A `channels[].config.groupId` on an agent became a standing route into that group once deployed, with no check that the deployer may use it. `deployAgent` now requires USE on it, the rule the channel API applies to a group target ([slack-integration.md](https://docs.labs.ai/protocols-and-integration/slack-integration.md)). The check fails closed: when the agent's configuration cannot be read, the deploy is refused with a retryable 503 instead of going ahead unchecked (it used to proceed on a store outage).

Verdicts: 6 fixed, 7 already fixed, 1 false positive, 4 accepted risk, 5 need a decision (Slack approval records keyed by the mutable integration name; editor-declared Slack `teamId` as the identity namespace; space membership for channel credential references; IDNA deviation characters in the notify recipient policy; discovery records during a partial email GDPR erasure).

**Files:** [`ChannelTargetRouter.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/channels/ChannelTargetRouter.java), [`SlackEventHandler.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/SlackEventHandler.java), [`SlackGroupDiscussionListener.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/SlackGroupDiscussionListener.java), [`ISlackApprovalRecordStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/hitl/ISlackApprovalRecordStore.java), [`EmailInboundProcessor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/EmailInboundProcessor.java), [`EmailReplySender.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/email/reply/EmailReplySender.java), [`RestAgentAdministration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentAdministration.java)

***

## 🛡️ fix(modules): CodeRabbit agent findings for ingestion, nlp, templating and apicalls (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-modules-misc`)

The 43 findings of the CodeRabbit agent-findings export that touch `modules/{ingestion,apicalls,nlp,properties,rag,rules,templating}` were each traced through the current code. Most were already closed by #1173, #1175, #1186 and #1199 since the scans ran; six needed a change here, and seven are left for a decision.

### What changed and why

* **Quadratic regex in the `str:fmt` size estimate** (`BoundedFormat`). `%` followed by a long run of `0` could be read as a flag or as the start of the width, and the regex tried every split of the run, so the estimate that exists to protect the render took time quadratic in the format's length before any limit applied. The width now cannot start with `0`, which is how `String.format` reads it too.
* **HTML list items were not charged to the conversion budget** (`HtmlToMarkdownConverter`). A list item is written by `appendList` without passing through `convertElement`, so a page of empty `<li>` elements escaped the element allowance. Each item is now counted and the list stops when the allowance is spent.
* **Run ownership is checked fail-closed before vectors are published** (`IngestionPipeline`). A state store that could not answer used to count as "still owned", so a worker that had been revoked while its embedding call was in flight could publish text of a source that had just been removed. The check made before a write now refuses when it cannot be verified; the document is not recorded and the next run takes it. The periodic progress check keeps working through a store outage.
* **The crawl frontier is bounded in characters** (`WebCrawler`). The count cap (100,000) did not bound size: a short relative link inherits its whole base URL, and both the canonical id and the fetch URL are retained, so one page could pin about 1.6 GB. Link discovery now stops admitting URLs after 64 million characters of URL text.
* **PDF pre-filter copied one dictionary per `stream` keyword** (`PdfStreamBudget`). A file that is mostly the word `stream` copied up to 64 KB for every occurrence. A later keyword in an object whose dictionary was already read is skipped.
* **Merged-terms correction shares one time budget across its retries** (`MergedTermsCorrection`). Every prefix and suffix lookup had its own regex deadline and counted expiry as a miss, so a word cost up to 200 deadlines. The word is now abandoned when one `RegEx.MATCH_BUDGET_NANOS` has passed.

### Findings left for a decision

Not changed, because a fix changes a contract or needs a design: a credential-use check for standalone RAG ingestion, a durable retry for removed-source vector cleanup, the `tenantId` conversation property choosing the auto-vault tenant, filtering `capabilityMatch` by the caller's USE access, a per-render allocation budget for Qute loops, structural escaping of values substituted into quick-reply expressions, and provenance tracking so a normalized secret input scrubs its original form.

### Verdicts

43 findings: 6 fixed, 26 already fixed, 1 false positive, 3 accepted risk, 7 left for a decision.

***

## ✨ feat(llm): agent operations tools — team scorecard, budget proposal, follow-up scheduling (2026-11-03)

**Repo:** EDDI (`feat/agent-ops-tools`, branched from the local `feat/operator-mcp-integration`, which merges the still-open PRs #1222–#1231)

### What changed and why

A standing team could not read its own spend or approval numbers, propose a budget move, or book its own check-back, so a person pasted metrics and moved money by hand. Three built-in tools now do that for an agent, each **off unless named in `builtInToolsWhitelist`** (an omitted whitelist does not admit them), see [Agent Operations Tools](https://docs.labs.ai/security-and-compliance/tenant-quotas/agent-ops-tools.md):

* `read_team_scorecard` (slug `team_scorecard`) — read-only: month spend and budget left, tasks done/failed per UTC week, approval outcomes with reason codes, retro lessons, for the agent's own group, its `oversight.teams` and `agentOps.scorecard.groupIds`. Each team is read only if the conversation's user may VIEW it (`ResourceAccessGuard`, the REST rule), checked per call and failing closed; no `userId` parameter.
* `propose_team_budget_raise` / `propose_team_budget_transfer` (slug `propose_team_budget`) — assembled only when the task's effective `toolApprovals` requires approval for both tools, so the existing approval card (Manager, Slack, e-mail, MCP) is the human gate. The body re-checks that the approving caller is an `eddi-admin` and refuses otherwise (owner/`eddi-approver`, timeout auto-approval and autonomy exemptions apply nothing). Applies through `TeamBudgetService`; per-turn, per-day (counted from the adjustment history) and amount caps; idempotent.
* `schedule_followup` / `list_followups` / `cancel_followup` (slug `schedule_followup`) — one-shot schedules for the agent's own conversation or a fresh one; horizon ≤ 90 days, per-agent pending and per-turn caps, a mandatory `maxCostPerFire`, never admin-powered, an agent sees and cancels only its own.

New `agentOps` block on an LLM task (limits only, validated at save time). `AgentOpsToolsProvider` is a CDI bean wired into `AgentOrchestrator`. `RetroEngine.RETRO_SOURCE` became public. Manager: an **Agent Operations Tools** section in the LLM editor, strings in all 11 locales. Platform Operator: the team-budget guidance now covers the tools (revision bump).

### Design decisions

* Gate-based approval rather than a new pending-proposal store: reuses the approval card, Slack channel, audit and crash recovery, at the cost of the approver having to be an admin for the change to apply.
* The budget tool refuses to exist without a gate instead of trusting the designer to add one.

### Tests

Plain JUnit 5 + Mockito for the three tools, the provider and the validator; Vitest for the Manager helpers.

### Review follow-ups (PR #1259)

* `schedule_followup` reserves its per-turn slot only when a booking is about to be written and releases it on a pending-cap refusal or store failure, so a malformed call no longer locks the model out for the turn.
* `pending()` pages through all of the agent's schedules (bounded at 40 pages of 500) before filtering, so a check-back past the first page still counts, lists and cancels.
* The scorecard's approval window now starts at midnight UTC on the Monday of the oldest throughput week shown.
* Manager: unticking the last whitelisted tool switches built-ins off instead of leaving an empty whitelist that means "all built-in tools"; the limit blocks use the logical `ms-5` for RTL.
* Docs: e-mail is a notification, not an approval channel; the task-level `toolApprovals` shape is shown; a group member's gated call is auto-rejected, so budget proposals belong to a standalone oversight agent; `maxPending` is per agent and booking user. The Platform Operator prompt says the same about group turns and `maxPending` (revision 55). Inline Mockito FQNs in two tests replaced by static imports.

***

## 💰 feat(cost): per-run tool quotas and an opt-in hard tenant ceiling (2026-11-03)

**Repo:** EDDI (`feat/cost-hardening`, branched from the local `feat/operator-mcp-integration` because the price resolver and catalog PRs were still open)

### What changed and why

Two gaps in cost control, found while planning to run EDDI on EDDI inside a fixed monthly budget.

**1. `toolQuotas`** **`window: "RUN"`.** Tool quotas only had fixed UTC windows (`PT1M`..`P31D`), so "20 searches per scout per run" had to be approximated with a daily cap. A rule may now say `"window": "RUN"`: the counter belongs to one run and the next run starts at zero. The run is a scheduled fire (new context key `scheduleFireId`, set by `ScheduleFireExecutor` on the startup turn and on every fire turn, so a persistent conversation counts per fire), else a group conversation (`groupConversationId`, already set on every member turn), else the conversation. Mechanics: `ToolQuotaRules.Resolved.perRun()`, the run id hashed into the counter name by `ToolQuotaService.keyFor` with window start `0` (no schema change in either store), rows expire 31 days after the first call. Validated at save time (`ToolQuotaConfigValidator`): `RUN` is case-insensitive, a pool cannot mix `RUN` with a time window. The refusal names the per-run limit and no reset time. `docs/langchain.md` gets a "Per-run caps" section.

**2. `eddi.tenant.quota.cost-reservation.enabled` (default `false`).** `maxMonthlyCostUsd` was only charged after each settled turn, so the crossing turn finished and overshot, and concurrent turns all read the same remaining budget. With the mode on, an LLM task's model phase and each priced tool call *reserve their maximum cost* against the tenant counter before running, and are refused when it does not fit.

* `ITenantQuotaStore.tryReserveCost` / `releaseCost`: one atomic conditional write per backend (MongoDB: `$expr` filter plus pipeline update on `tenant_usage`; PostgreSQL: one `UPDATE ... WHERE cost + held + amount <= limit`, two new columns added with `ADD COLUMN IF NOT EXISTS`; in-memory under the tenant lock). Unreleased holds (dead node) are dropped by an epoch (`reservedSince`) older than `eddi.tenant.quota.cost-reservation.ttl` (`PT10M`); a release names its epoch, so a late release cannot cancel somebody else's hold.
* `TenantQuotaService.reserveCost` / `holdForCall` / `shrinkHolds` / `releaseHolds`; fails closed (a store that cannot answer refuses, counted on `eddi_tenant_quota_unavailable_total{type="cost"}`). Metrics `eddi_tenant_cost_reservation_total{outcome}` and `eddi_tenant_cost_reservation_usd_total{direction}`.
* `ModelCallBound` sizes the model phase: prompt (three characters per token) x input price + output-token cap x output price, over `1 + maxToolIterations` rounds for an agent-mode task (later rounds carry the tool-context cap) and every step of a cascade. Unpriced models reserve $0, like metering.
* Holds live on the turn (`IConversationMemory.getTenantCostHolds`), are shrunk to the actual cost when each LLM task finishes (`LlmSpendGate.settleHolds`) and are released in `TurnCostMeter.meterSettledStep` *after* the charge, so spend is always counted as spent before it stops being counted as held.
* Wired into `LlmTask` (before the model phase, and when a paused tool loop resumes) and `ToolLoopRunner` (priced tool calls, price from the new `ToolCostTracker.priceOf`).

**3. Manager UI.** The LLM task editor has a new "Tool quotas" section (`task-tool-quotas.tsx`): subject template, per-tool rules with limit, window (per run, hour, day, 7 days, 31 days, or a stored custom duration kept as-is) and pool, plus the note that a per-run cap is not an abuse limit. Nothing is written until a rule is added. The Quotas page shows the budget running turns hold (`reservedUsd`, new on `UsageSnapshot` and filled by all three stores) as a second segment on the monthly-cost bar, and explains the opt-in startup property next to the cost limit. 16 new i18n keys in all 11 locales. A Grafana panel (`Tenant cost reservations (hard ceiling)`) charts the new meters.

### Design decisions

* A deployment property, not a per-tenant field: it needs no change to the tenant quota record, REST shape or its two stores' document layout, and a cluster agrees on it by construction.
* A reservation is held until the turn is charged, not until the call ends: the actual cost only reaches the counter at settle, so releasing on call end would leave a window where the spend is counted nowhere.
* The small paid side calls (re-ask, judge, guardrail classifier, summaries, Dream) are **not** reserved; they keep the read-only gate and are charged at settle. The mode is a hard ceiling for the calls that carry the cost, not bit-exact (documented in `docs/tenant-quotas.md`).
* The `RUN` id comes from runtime context, so it bounds an autonomous run, not a hostile end user (documented); fixed windows remain the tool for per-user fair use.
* Platform Operator: system prompt teaches both (revision 54, fingerprint `00f0946c7e085db5`; 55 after the review follow-ups); the allow-list is unchanged (the property is startup configuration, the `RUN` rule is part of the agent document).

### Not done / next

* Anthropic Batch API support was explicitly out of scope.
* Store ITs (`TenantQuotaStoreParityTest`, Mongo and PostgreSQL) are written; they need Docker.
* Not reserved: embeddings (unpriced anyway), the side calls above and the HITL REVISE model call, which keep the read-only gate. A resumed tool loop does reserve (`ModelCallBound.resumeMaxUsd`).

### Review follow-ups (2026-11-05)

* Hold expiry is by the **newest** hold, not the shared epoch: a busy tenant's overlapping turns kept the held total above zero past the TTL and the next reservation dropped holds of calls still running. New `reservedLastAt` / `reserved_last_at` (added by `ALTER ... IF NOT EXISTS`) in all three stores; a dead node's hold on a continuously busy tenant now waits for a quiet TTL (fails closed). Parity test with a stepping clock. Docs say the snapshot's `reservedUsd` can include such a hold, and that a model hold is an estimate.
* `window: "RUN"` on a scheduled fire is keyed by `scheduleId@lastFired` (`ScheduleFireExecutor.runIdOf`), so the retries of one due fire share one run instead of each getting a fresh counter.
* The resumed LLM task settles its holds when it finishes (as `executeTask` does).
* `maxToolContextTokens <= 0` (guard off) sizes a hold with the default tool-context cap instead of zero.
* Manager: no subject-only `toolQuotas` (subject disabled until a rule exists; removing the last rule drops it); a rename onto another rule's name is held as a draft and flagged instead of silently dropping that rule; the budget status subtracts holds from what is left; the cost-ceiling note and the operator prompt no longer promise an un-overshootable budget. 2 new i18n keys and one amended, in all 11 locales. Grafana: the USD series has its own unit and axis.
* Platform Operator: revision 55 (fingerprint `a5a444f4385d0702`) for the prompt change.

***

## 📝 docs: fix the findings of the 2026-11-03 documentation audit (2026-11-03)

**Repo:** EDDI (`docs/audit-fixes-2026-11-03`)

### What changed and why

A 13-scope audit compared the docs, Javadoc and inline comments with the code. Every finding was re-checked against the code before it was fixed; the audit was wrong about a few, which were skipped.

**Code**

* Counterweight preset snippets are now `counterweight_cautious` / `counterweight_strict`. The hyphenated names could never be created (`PromptSnippetStore.NAME_PATTERN` is `[a-z0-9_]+`). The hyphenated names are still read as a fallback.
* `OrdinalNumbersDictionary` carried the id `punctuation` (copy-paste); it is now `ordinal_number`.
* Everything else under `src/` is Javadoc or comment text only.

**Docs**

* Tenant quotas: only the default tenant is seeded, other tenants are unmetered until an admin sets a quota, and quotas are off by default.
* `rotate-kek` "TLS required" is not enforced by EDDI; the docs now say so. Default demo credentials are no longer listed in `security.md`.
* Compliance pages (`PRIVACY.md`, BAA template, audit ledger, data flow) no longer claim an immutable, always-signed ledger, a complete export, or unsalted pseudonyms (the DB-log pseudonym is `k1:`/`s1:`). EU AI Act citations corrected (Art. 50, 73). DLQ subject is `eddi.<prefix>.dlq.audit`.
* `AGENTS.md` §5 and the config-authoring pages: the templating step is only needed for output texts and quick replies, not for LLM prompts. `returnDetailed` withholds audit, trace and error keys.
* The vars/vault resolution order in `global-variables.md`, the HITL crash-recovery description, the MCP tool count (96) and the discussion-style count were corrected.
* `SECURITY.md` (root and Manager): only the latest release is supported; older versions get no backported fixes.
* `ui/manager/SECURITY.md`: the react-router advisory acceptance is restated for the data router the app uses.

**Deferred** (editorial or structural): splitting the very large pages (`langchain.md`, `hitl.md`, `configuration-reference.md`, `metrics.md`, `rag.md`, `security.md`, `secrets-vault.md`), the duplicated Manager community files, a 6.6 to 6.7 upgrade page, I-code and Phase labels in comments. Open code gaps: the 10,000-row audit export cap is not signalled in the bundle, and some export categories and block failures are not reported in `failedCategories`/`omittedCategories`.

***

## 🔒 fix(cluster): NATS TLS, failing loudly, replication, manifests and alerts (2026-11-03)

**Repo:** EDDI (`fix/cluster-ops-security`) — workstream D of the cluster production-readiness review (`planning/cluster-production-readiness-review.md`, findings C1, C2, C3, C5, C7–C15 and the scheduler starvation of D6).

### What changed and why

* **C1 — TLS host names.** EDDI's hostname-verifying SSL context is now built for every `tls://` or `wss://` server, not only with `eddi.nats.tls.enabled=true`. The chart's external path never set that flag, so jnats fell back to the JVM default context, which accepts any CA-signed certificate for any host: a man in the middle received the shared NATS password. `opentls://` (trust anything) fails the boot. A real-server test (`NatsConnectionSecurityIT`) also found that the previous hostname verification (endpoint identification on the socket) never worked with a host name: jnats resolves the name and dials — and hands TLS — the bare IP, so every certificate issued for the host was refused (and jnats' `Unresolved` mode does not connect at all). Verification now happens in a trust manager ([`ServerNameTrustManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ServerNameTrustManager.java)): the chain must be trusted AND the certificate must name one of the hosts in `eddi.nats.url` (DNS SAN, one leading wildcard label, or an IP SAN for an IP). `HostnameVerifyingSslContext` is gone. [`NatsConnectionManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/NatsConnectionManager.java), [`ClusterConfig.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterConfig.java)
* **C1, reconciled with main (#1249).** Main fixed the same hole with `HostnameVerifyingSslContext` plus jnats `HappyEyeballs` resolution. The merge keeps one check, `ServerNameTrustManager`: it compares the certificate with the configured names whatever address is dialled, so it also covers servers jnats discovers from INFO by IP. From main it keeps `HappyEyeballs` (the handshake carries the name as SNI), the real-handshake `NatsTlsHandshakeTest`, and mutual TLS with the JVM's `javax.net.ssl.keyStore` certificate when no EDDI key store is configured (now loaded explicitly into the EDDI context; a new handshake test covers it).
* **C2 — fail loudly.** A node that never connected since boot, or whose connection fails for a reason retrying cannot heal (authentication, TLS, client options), now reports not-ready (`eddi.cluster.readiness.require-first-connect`, `eddi.cluster.readiness.fail-on-misconfiguration`, both default `true`) instead of serving every turn unfenced while green. Every NATS error is classified and counted in `eddi_cluster_nats_errors_total{cause}` (all causes registered at 0); misconfigurations log at ERROR, the rest at WARN, rate-limited; `eddi_cluster_nats_misconfigured` is a gauge. Trust stores may be PEM (a cert-manager `ca.crt`), and the chart mounts the NATS CA — the in-chart TLS Secret's, or `nats.externalCaSecretName` — into EDDI as its trust store; the in-chart URL is `tls://` with `nats.tls.enabled`. [`ClusterHealthCheck.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterHealthCheck.java)
* **C5 — dead connections.** `eddi.nats.ping-interval` (5 s) and `eddi.nats.max-pings-out` (2): a server lost without a TCP reset is noticed in about 10–15 s instead of about 4 minutes.
* **C3 — replication.** The chart renders `EDDI_NATS_REPLICAS` for an external NATS too (`nats.externalReplicas`, default 3); EDDI warns at connect when R1 meets three or more servers, or the replica count exceeds the servers it knows.
* **C7 — rollouts.** Readiness still flips at SIGTERM, but turns are admitted for the readiness grace (3 s) before the gate closes; the chart (`eddi.preStopSleepSeconds`, 5) and the Kustomize `nats` component add a `preStop` sleep, counted in the termination-grace check. [`GracefulShutdownService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/GracefulShutdownService.java)
* **C8 — Kustomize NATS.** The `nats` component now authenticates clients and routes (credentials from a `nats-auth` Secret the operator creates — **existing users must create it before applying**), restricts EDDI's user, sets `max_file_store` with headroom, requires one NATS pod per node, spreads zones, sets `GOMEMLIMIT` and `EDDI_CLUSTER_DEGRADED_TURNS=reject`. TLS remains the Helm chart's.
* **C9 — storage.** `<prefix>_ARCHIVES` gets `eddi.cluster.archives.max-bytes` (1 GiB; an existing bucket is capped on first use); the in-chart `max_file_store` is 80 % of the volume (`nats.storage.maxFileStore` overrides). [`ClusterArchiveStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterArchiveStore.java)
* **C10 — NATS StatefulSet.** `nats:2.11.17-alpine` pinned by digest on every delivery path (chart, Kustomize, compose; `ThirdPartyImagePinsTest` enforces it), required anti-affinity (`nats.antiAffinity`) plus zone spread, `nats.goMemLimit`, an optional `prometheus-nats-exporter` sidecar with a ServiceMonitor (`nats.metrics.enabled`), and a second user for password rotation without downtime (`nats.auth.secondaryUsername`/`secondaryPassword`).
* **C11 / C4 (chart side) — isolation and least privilege.** The in-chart and Kustomize NATS deny EDDI's user `$JS.API.STREAM.DELETE.>`, `$JS.API.SERVER.>`, `$JS.API.META.>` and `$JS.API.ACCOUNT.PURGE.>` (checked against a real NATS 2.11.17: KV, streams, purge and object store still work; a stream delete is refused). `eddi.nats.inbox-prefix` (default jnats' `_INBOX`) and the opt-in `nats.isolation.enabled` put a deployment in its own NATS account with its own inbox prefix — opt-in because it moves the buckets into a new account.
* **C12 — alerts.** `eddi-cluster-alerts.yml` gains NATS misconfiguration, NATS errors by cause, member loss, lease takeovers, an event-outbox backlog and, from the NATS exporter, JetStream storage, a full dead-letter stream and slow consumers; it has promtool tests (`eddi-cluster-alerts.test.yml`, run in CI) and the chart's PrometheusRule includes it in cluster mode.
* **C13 — ingress.** With `ingress.className: nginx` the chart disables buffering and sets a 300 s read timeout (SSE), and in cluster mode adds an `<release>-mcp` Ingress hashing `/mcp` on the client address (`ingress.nginxDefaults`, `ingress.readTimeoutSeconds`).
* **C14 — HPA.** `autoscaling.targetMemoryUtilizationPercentage` defaults to `null`: a JVM keeps its heap, so the memory target ratcheted the HPA to `maxReplicas`.
* **C15 — configuration.** Boot refuses non-positive durations, two authentication methods at once and a malformed inbox prefix; warnings for an acquire timeout below the lease TTL or at or above the agent timeout, plaintext credentials and `verify-hostname=false`.
* **D6 — scheduler.** The cluster scheduler's two platform threads now only keep time; every job runs on a virtual thread and never overlaps itself ([`OffloadingScheduler.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/OffloadingScheduler.java)), so jobs blocked on NATS or the database can no longer delay presence past its 30 s TTL.
* **Docs:** [Clustering](https://docs.labs.ai/deployment-and-infrastructure/clustering.md) (degraded mode, failure modes, permissions, TLS, alerts), [Kubernetes](https://docs.labs.ai/deployment-and-infrastructure/kubernetes.md), [Configuration reference](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [Metrics](https://docs.labs.ai/deployment-and-infrastructure/metrics.md), the monitoring guide; the Platform Operator explains a not-ready node (revision bump). Helm chart **2.14.0**.

### Design decisions

* Readiness DOWN for a misconfiguration takes every node with the same bad credential out of the load balancer. That is the intended trade: loud instead of silently unfenced. Both switches can be turned off.
* The code default of `degraded.turns` stays `local`; the chart exposes `eddi.cluster.degradedTurns` and the docs and the Kustomize component recommend `reject`.
* Account isolation and a custom inbox prefix are opt-in: switching an existing release would strand its dead letters and archives in the old account.

### Review follow-ups

* Only a certificate or handshake-policy failure counts as a TLS misconfiguration: a handshake the peer cut off or a reset connection (a NATS restart) is `io` and no longer turns every pod not-ready.
* A failed cap of an existing archive bucket is retried on the next use instead of being given up.
* `helm upgrade --reuse-values` from an older chart no longer fails on the missing `nats.externalReplicas` (defaults to 3) or `nats.isolation` / `nats.metrics` maps.
* `EddiClusterMemberLost` compares with the member count that held for 10 minutes, so a rolling update's surge pod (3 → 4 → 3) no longer fires it; a promtool case covers that.
* Docs: `require-first-connect` must be off as well to serve from boot; the Kustomize NATS needs EDDI switched to `tls://` too, not only a server `tls {}` block; an `eddi.existingSecret` release must update that Secret and restart EDDI before the old NATS user is removed. The Platform Operator no longer rules out a NATS outage for a node that never connected.
* The NATS image pin test checks the whole reference, not a valid prefix of it. The CI chart checks use low-entropy fixture passwords (secret scanning flagged the earlier placeholders).

### What's next

* Per-node NKey/JWT users need an external NATS with account management; the chart stays with password users.
* Signed RPC/events (C4) and the receiving-side last-node guard are workstreams C and B.
* Operator prompt (revision 55): a `config` NATS failure is diagnosed from the reported error detail (credential, trust store or client certificate), and with `eddi.cluster.readiness.require-nats=true` a node that connected and then became degraded is also not ready.

***

## 🐛 fix(cluster): shared state, events, deployments, node identity, signed control plane (2026-11-03)

**Repo:** EDDI (`fix/cluster-shared-state`) — workstream C of the cluster production-readiness hardening (findings B1–B5, C4 signing part, C6, C15 versioning part, D6 presence part, D7).

### What changed and why

* **B1 — `autoDeploy=false` deployments are recorded.** They existed only as `deployment.changed` events, so a lost undeploy, an outbox that delivered an undeploy before its redeploy, or a node that joined later left them deployed (or missing — 404 for about 1/N of the requests) on some nodes for good. They now live in a `<prefix>_DEPLOYMENTS` KV bucket as `DEPLOYED` or an `UNDEPLOYED` tombstone, ordered by the KV revision; the deployment sweep reconciles them like the deployment collection, refreshes them (compare-and-set) while they are served and re-creates an expired one only when it was confirmed within the TTL. A deployment event is checked against the records before it is applied: an undeploy older than a redeploy, or a transient deploy older than its tombstone, is dropped. Not in the database, as the review suggested: the record must vanish once the whole cluster is gone (that is what "not recorded" means), and a new status value in the deployment collection would have broken older nodes that parse it during a rolling upgrade.
* **B2 — events.** A node resyncs once after its first subscription (it subscribes at `DeliverPolicy.New`, so whatever was published while it booted with NATS down never arrived), and when the event stream was recreated — detected by its creation time (checked every 30 s) or by a sequence that goes back — it re-subscribes and resyncs.
* **B3 — cache events.** A read-through fill (`ICache.fill` / `fillIfAbsent`) is no longer announced as an eviction; only mutations are. Dispatch runs on two bounded lanes (cache evictions vs everything else), so a burst of evictions no longer delays a secret rotation; a full lane drops the event and resyncs.
* **B4 — webhook de-duplication fails closed** while NATS is unreachable under `eddi.cluster.degraded.nonces=reject` (the default): 503, the sender retries. The docs now list the cache TTLs of secrets (5 min), connections (1 min) and global variables (2 min) and no longer claim that security state always fails closed.
* **B5.** A GDPR stop waits for the member count it read itself, with its own timeout (`eddi.cluster.gdpr-stop-timeout`, 10 s), and the user-id hash travels sealed (AES-GCM, key derived from the signing key) on the RPC, on `gdpr.user-erased` and in cache-eviction keys when a signing key is set. Audit-position counters that are (re)seeded are counted (`outcome=seeded`).
* **C4 (signing part) — signed control plane.** With `eddi.cluster.signing.key` every node RPC, RPC reply and cluster event carries an `Eddi-Sig` header: HMAC-SHA256 over the subject, a timestamp, a random nonce and the SHA-256 of the body, compared in constant time. Without a key a WARN is logged and nothing changes; `eddi.cluster.signing.required=true` refuses unsigned messages and refuses to start without a key. Configuration lives in the new `ClusterSigningConfig`, not `ClusterConfig`.
* **C6 — duplicate node ids.** The presence record is written with compare-and-set; a node whose key is held by another boot waits one interval and takes over only a record that stopped changing (a crashed predecessor). A live twin stops announcing itself, logs an ERROR, reports `eddi_cluster_node_duplicate 1` and its new `cluster-node-identity` readiness check is DOWN. Falling back to `eddi.schedule.instance-id` as the node id now logs a WARN.
* **C15 (versioning part).** RPCs and events carry their payload version (`Eddi-V`, event `v`); an unversioned message is version 1; a newer one is handled best-effort and counted. Presence records carry the payload protocol, and members on mixed versions log a WARN (`eddi_cluster_versions`).
* **D6 (presence part).** Members come from a KV watch on the presence bucket instead of listing it and reading every record every few seconds on every node.
* **D7.** The event stream is updated only when its configuration differs, and a cluster-wide resync starts after a random delay (`eddi.cluster.events.resync-jitter`, 5 s).

### Threat model of the signing

Who is kept out: anyone who holds the shared NATS credentials (every pod has them) or can read and write NATS traffic, but not the signing key. Such a party could drain every node, stop a user's work, undeploy agents or trigger resync storms; with a key, a message must carry a valid HMAC made with it. A signature is bound to the subject and the body hash, so it cannot be moved to another operation or payload. Replay is bounded twice: a request older (or further ahead) than `eddi.cluster.signing.max-age` (60 s) is refused, and within that window a nonce already seen is refused; an event's window is the event retention plus that, because a reconnecting node legitimately receives events that old. A reply is bound to the nonce of its request, so an old answer cannot be passed off as a new one. Not covered: confidentiality (use NATS TLS), the KV and stream state (per-node NATS permissions, workstream D), flooding NATS, and a holder of the key. The nonce memory is per node and in memory: a node that restarts inside the window could accept one replay of a message it had already seen, which the 60 s window keeps short.

### Design decisions

* Rolling upgrade first: unsigned and unversioned messages from older nodes stay accepted unless `eddi.cluster.signing.required=true`; a node without a key accepts signed messages it cannot check. The three-step order is in [Clustering](https://docs.labs.ai/deployment-and-infrastructure/clustering.md#rolling-upgrades).
* The audit-counter margin the review recommends was **not** added: a margin is a gap in the conversation's chain, which verification grades `BROKEN`. A re-seed is counted instead, so a duplicate position can be attributed.

### Needs from other workstreams

* WS-A: `KvLeaseManager` should not sweep or take over "our earlier boot" leases while `ClusterPresence.isDuplicate()` is true (a twin still runs its lease sweeps).
* WS-B: `RestAgentAdministration` keeps calling `announceTransientDeployment`; nothing else needed.

### Review follow-ups

* **The boot sweep waits for presence to confirm the node id.** On a twin's first connect presence has not yet told a live twin from a dead predecessor (that takes one interval), so the duplicate flag was still down and the sweep deleted the live twin's leases. The sweep, and the own-node-id takeover, now need `ClusterView.isNodeIdentityConfirmed()` (this JVM holds its own presence record and no twin is flagged); `ClusterPresence.onIdentityConfirmed` re-runs the sweep when that happens.
* **A failed event re-subscribe is retried by the periodic stream check**, which resyncs once it succeeds. Before, a subscribe that failed after a stream recreation while the connection stayed up left the node deaf until the next reconnect.
* **Key rotation and sealed GDPR hashes.** A rotated node also opens hashes sealed with a key in `previous-keys`; a node still on the old key cannot open the new key's, so `clustering.md` now says to re-run erasures made during the rolling window.
* `eddi-cluster-alerts.yml` gains the `EddiClusterNodeDuplicate` and `EddiClusterSigningRejected` rules `metrics.md` already promised. The presence watch drops records past the TTL instead of only skipping them, and the signed-event test tampers with the timestamp and the nonce too. Test fixture keys are low-entropy strings (a hex-looking key tripped secret scanning).
* **Second round.** A presence takeover needs one full interval of (monotonic) clock time, not two writes in a row — a reconnect and a scheduled tick can come milliseconds apart and would have confirmed the id over a live twin. A create lost after the own record expired resets the own revision, so the node is no longer "confirmed" without a record. The `eddi.cluster.signing.rejected` series are registered at zero on a node that can refuse anything, so `EddiClusterSigningRejected` fires on the first refusal. A failed subscribe retry falls through to the stream check, which recreates a missing stream; a resync the full control lane refuses is kept and retried after a second instead of waiting for the next request.

**Files:** [`TransientDeployments.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/TransientDeployments.java), [`AgentDeploymentManagement.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/AgentDeploymentManagement.java), [`DeploymentStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/deployment/mongo/DeploymentStore.java), [`JetStreamEventBus.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/events/JetStreamEventBus.java), [`ClusterMessageSigner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterMessageSigner.java), [`ClusterSigningConfig.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterSigningConfig.java), [`NatsClusterRpc.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/rpc/NatsClusterRpc.java), [`ClusterPresence.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ClusterPresence.java), [`NodeIdentityHealthCheck.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/NodeIdentityHealthCheck.java), [`ClusterInvalidatingCache.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/ClusterInvalidatingCache.java), [`CacheFactory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/caching/CacheFactory.java), [`WebhookEventHandler.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/webhook/WebhookEventHandler.java), [`AuditClusterSupport.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/AuditClusterSupport.java), [`GdprComplianceService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/gdpr/GdprComplianceService.java); docs [Clustering](https://docs.labs.ai/deployment-and-infrastructure/clustering.md), [Configuration Reference](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [Metrics](https://docs.labs.ai/deployment-and-infrastructure/metrics.md), [Security](https://docs.labs.ai/security-and-compliance/security.md), [GDPR](https://docs.labs.ai/security-and-compliance/gdpr-compliance.md).

***

## 🐛 fix(cluster): fence first, never lower the fence, dead-letter what was refused (2026-11-03)

**Repo:** EDDI (`fix/cluster-turn-fencing`)

Workstream B of the cluster production-readiness review (`planning/cluster-production-readiness-review.md`): the turn path, the conversation stores, HITL resume, dead-letter replay and the admin console.

### What changed and why

* **A3, fence first.** A turn under a cluster lease raised the conversation's `_fence` only *after* it had read the state, the revision, a reloaded snapshot and the recorded `Idempotency-Key`s, so an expired predecessor could still append in between: the successor then ran without that step, its properties overwrote the predecessor's, and a duplicate `Idempotency-Key` could run twice. A failed raise was only logged. Now the fence goes up before anything is read, and a turn that cannot raise it — or whose lease is already lost — does not run: 409 + `Retry-After`, input not consumed. The HITL resume is ordered differently: it reads the snapshot and moves the state `AWAITING_HUMAN` → `IN_PROGRESS` on the request thread, and only its queued task raises the fence, before the resumed pipeline runs; a resume that cannot raise it does not run and restores the pause. `ConversationStepRunnerLeaseTest.raiseFailureDoesNotStopTheTurn` asserted the old behaviour and was replaced by `raiseFailureAnswersBusy`.
* **A4, the fence only grows.** A full-document write (Mongo `replaceOne`, Postgres `data = ?`) persisted the `_fence` it had loaded. A raise does not move `_rev`, so an unfenced writer that loaded before a raise passed the revision guard and put the old fence back, after which the holder the raise had shut out could write again. Postgres now builds `_fence` in SQL (`GREATEST` for a fenced write, the stored value for an unfenced one); Mongo refuses to write a lower fence and adopts the stored one. Documents without `_fence` stay writable. Undo and redo, which ran on the REST thread outside the lease, now run through the coordinator in cluster mode, under the lease, with its token on their write (single-node undo/redo are unchanged). A turn whose write lost the optimistic-concurrency race after its reply had gone out is dead-lettered in cluster mode (`reason: conflict`) instead of only logged.
* **A6.** A conditional write (pause commit, resume, undo, redo) refused by the fence returned `false`, which every caller read as "a concurrent writer moved the state": the turn was dropped without a dead letter. It now throws `ConversationFencedException`; the say path and the resume dead-letter it, undo/redo answer 409.
* **A5.** A HITL resume that lost its lease only raised the cancel flag, and nothing then moved the conversation off `IN_PROGRESS` until crash recovery minutes later. The pause is now restored at once with a fenced compare-and-set (new `IConversationMemoryStore.compareAndSetStateFenced`: only while no newer holder has started on the conversation) and the resume is dead-lettered; its caller is answered 409.
* **A1 (turn side).** The turn's memory reads `LeaseHandle.isLost()` itself (`IConversationMemory.setLeaseLostCheck`), so a lease that can no longer be trusted cancels the turn, skips the unfenced long-term user-memory write and answers the reply as not processed, even before the lease manager's lost-callback arrives. When `isLost()` turns true is the lease workstream's part (`fix/cluster-lease-validity`).
* **A7.** A replay deleted its dead letter as soon as the turn was *queued*, so a replayed turn that was then skipped, timed out on the lease or failed lost its input. The entry is now deleted only once the replayed turn commits (checked through its `Idempotency-Key`, `dead-letter-replay:<id>`, which every replay of one entry carries), the claim is held until then, and the outcome is on the activity timeline. With turn idempotency switched off there is no key to look for, and the check falls back to "the conversation's revision moved past the one read before the replay" — another turn can move it too, so in that mode a deleted entry does not prove the replay itself committed. The legacy `POST /administration/coordinator/dead-letters/{id}/replay` goes through the same path, so it now claims the entry and is audited with the calling admin.
* **A9.** A turn the runtime refused after its lease was granted was both dead-lettered and answered "retry". It is answered busy, and its dead letter is marked `answeredRetry` and cannot be replayed (`notReplayableReason: ANSWERED_RETRY`).
* **A11 (group lease).** A discussion whose `g.<id>` lease another live node holds no longer runs a second leg here; it stops without writing. Only when no holder can be read (NATS unreachable) does a discussion run without its lease. `ClusterHitlRecovery` no longer takes a lease read made while NATS is unreachable for "nobody holds it, recover now" (it checks the connection around the read until the lease workstream's `peekStrict` is wired in).
* **C4 (receiving side).** A drain request that arrives over RPC is checked again on the node it drains: the drain gate must be held, its own `drain.<node>` key written, and another live node must still take turns — so a request published straight onto the RPC subject, a broadcast included, drains nothing. What a node applies or refuses on another node's request (drain, undrain, reconcile, forward) is written to its audit ledger (actor `cluster-rpc`) and activity timeline.
* **D6 (console reads).** One scan of the lease bucket and one read of each dead-letter page is shared for 3 s by every console polling this node, and dropped by a force-release, replay, discard or forward.
* **C12 (part).** `eddi.cluster.fence.rejected` is registered at startup, so the first rejection on a pod is visible to `increase()`.
* **A8, A10 (docs).** `clustering.md` no longer claims "no loss" for degraded turns (conversation properties are last-writer-wins), nor that node-local dead letters survive a restart or the 1000-entry cap.

### Design decisions

* Mongo cannot express `$max` inside a `replaceOne`, so the full write is filtered on "the stored fence is not above the one written" and, on a miss caused only by that, adopts the stored fence and tries again (at most three times). Only an unfenced write can miss this way.
* Undo/redo go through the coordinator only in cluster mode: that is where the fence exists; on one node the state-and-revision CAS already orders them.
* The node-local dead-letter ring (A10) is not persisted to disk here: it lives in the coordinator base class, and a durable journal would also have to honour GDPR erasure. The docs now say what it does; persisting it is left to the coordinator workstream.

### Review follow-ups

* A resume that lost its lease re-arms the pause's timeout from the **stored** bookmark: the resumed pipeline had already cleared the live memory's, so a finite `AUTO_REJECT` / `AUTO_APPROVE` / `ABORT` policy was left without a schedule until the next restart.
* A force-release drops the shared lease scan *after* the release, not before, and a scan that read the bucket while an invalidation happened is returned but not cached (generation counter), so the console does not show a released lease as held for 3 s.
* `clustering.md` no longer calls the group `g.<id>` lease exclusive: the discussion's writes are not fenced and a holder that loses the lease is not stopped. The A3 and A7 entries above now state the resume's real fencing order and the replay check's fallback without idempotency.

**Files:** [`ConversationStepRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationStepRunner.java), [`ConversationService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationService.java), [`ConversationHitlService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationHitlService.java), [`ConversationMemoryStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/memory/ConversationMemoryStore.java), [`PostgresConversationMemoryStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/datastore/postgres/PostgresConversationMemoryStore.java), [`ClusterAdminService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/admin/ClusterAdminService.java), [`RestCoordinatorAdmin.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestCoordinatorAdmin.java), [`GroupConversationService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/GroupConversationService.java), [`clustering.md`](https://docs.labs.ai/deployment-and-infrastructure/clustering.md), [`coordinator-admin.md`](https://docs.labs.ai/deployment-and-infrastructure/coordinator-admin.md)

***

## Log capture starts at boot; unauthenticated reminder is opt-in (2026-11-03)

**Repo:** EDDI, branch `fix/log-capture-at-startup`

**Defect.** `/administration/logs` and `/administration/logs/history` returned nothing on a production instance that had been serving conversations for hours; capture began at the first request to the log API. `BoundedLogStore` was a plain `@ApplicationScoped` bean that registered itself with `LogCaptureFilter` in `@PostConstruct`, but it was only injected by `RestLogAdmin` and `McpConversationTools`, so it was created on first use. Until then `LogCaptureFilter` (which forwards only when a store is registered) fed nothing to the ring buffer, the SSE tail or the DB persistence, and every startup warning was lost from EDDI's own log view after each restart. Console output was never affected.

**Fix.**

* `BoundedLogStore` is now `@Startup`, so the ring buffer, DB flush scheduler and shutdown flush run from application start.
* `LogCaptureFilter` holds records logged before a store exists in a bounded pre-start buffer (1000, newest kept, drops counted) and replays them in order, plus a WARN naming any dropped count, when `setStore` is called. Only redacted text is buffered; a record whose redaction fails is never buffered raw and is still stripped for the console. Console output is unchanged. Javadoc "Bootstrap Safety" updated.
* Docs: `docs/log-administration.md` states capture starts at boot.

**Unauthenticated reminder.** `AuthStartupGuard` logged a WARN `REMINDER: OIDC is DISABLED` every hour for deployments that knowingly set `eddi.security.allow-unauthenticated=true`. It now logs the `[SECURITY]` ERROR once at startup (wording and level unchanged) and the repeat is opt-in through `eddi.security.unauthenticated-reminder-interval` (default `off`; a duration such as `1h` enables it; repeats closer than 5 minutes are throttled). Documented in `application.properties`, `docs/configuration-reference.md`, `docs/security.md`, `docs/troubleshooting.md`, `docs/docker.md`, `docs/architecture.md`.

**Tests.** `LogCaptureFilterPreStartTest` (eager store, ordered replay with MDC, bounded buffer, redaction, fail-closed, live path) and extended `AuthStartupGuardTest`.

**Brand-leak E2E.** With capture running from boot, the Logs page now shows startup records that name the engine, which `brand-leak.fullstack.spec.ts` flagged. Log message and stacktrace text is server output, not product chrome: `LogRow` (Logs page) and the live log viewer mark it `data-log-content`, and the spec's snapshot skips that text and its attributes while still scanning the rest of the page. `docs/white-labeling.md` "Not branded" notes it.

**Review follow-ups.** A plain JUL `LogRecord` with parameters whose message redaction left unchanged was skipped by the pre-start buffer: `LogRecordRedactor` hands back no reusable message for that shape (capture formats it printf-first), and the filter read that as a redaction failure. The filter now formats it with `BoundedLogStore.formatRecord` (now package-private), redacts it with `LogRecordRedactor.rewrite` and buffers it; two tests cover the printf and MessageFormat cases. `docs/architecture.md`'s auth table no longer promises an hourly WARN (it is opt-in), and `docs/log-administration.md` names what the ring buffer (`eddi.logs.buffer-size`), database history (`db-enabled`, `db-persist-min-level`, retention) and the live tail (50 recent entries on connect) keep of startup records. The brand-leak spec gains a server-free `page.setContent` test proving the `data-log-content` exclusion.

***

## 🔒 fix(deps): minimatch 11.0.4 in Manager and Chat UI — Dependabot #75 and #76 (2026-11-03)

**Repo:** EDDI (`fix/minimatch-dos-alerts`)

Both alerts (minimatch globparts amplification DoS, patched in 11.0.1) were dev-only transitive dependencies through ESLint and typescript-eslint, which pin `^10`, and in the Manager also through `@stryker-mutator/core`, which pins `~10.2.4`. A lockfile refresh alone could not reach the fix, so `ui/manager/package.json` and `ui/chat/package.json` gain an `overrides` entry `"minimatch": "^11.0.1"`, and both lockfiles resolve to 11.0.4 (new transitive `@isaacs/nonrecursive-glob-match`). The lockfiles were edited by hand rather than regenerated on Windows, which drops the `libc` and `peer` fields. `npm ci` and ESLint pass in both packages.

**Decision:** the override is a major bump for tooling only; remove it only once none of ESLint, typescript-eslint and (Manager only) Stryker selects an affected `minimatch` 10.x range any more.

**Review follow-ups:** the dependency summary and the removal condition now name Stryker, whose `~10.2.4` range would otherwise bring an affected 10.x back the moment the override is dropped.

***

## feat(integration): F9 — the cross-feature fixes, MCP tools and Platform Operator for the ten feature PRs (2026-11-03)

**Repo:** EDDI (`feat/operator-mcp-integration`)

The combined follow-up to cost accounting, team handoff, the SERVICE judge, human tie-breaks, human task executors, tool-call guardrails, edit-on-approve, approval analytics and earned autonomy, approval card context and team budgets. Those ten PRs deliberately left out what every one of them would have conflicted on — new MCP tools and the Platform Operator — and wrote down what each needed in `planning/operator-followups/<feature>.md`. This entry is what was built from those notes, after checking each against the merged code.

### Cross-feature fixes

* **A handoff into a team that cannot pay is refused.** `TeamBudgetHandoffAdmission` is the first `HandoffAdmission` bean: the *receiving* team's `TeamBudgetService.decide` (spent, tenant spent, or unreadable — fail closed) refuses the handoff with the budget's own sentence, before anything is filed. New refusal surface `handoff` on `eddi_team_budget_refusals_total`. See [Team Budgets](https://docs.labs.ai/security-and-compliance/tenant-quotas/team-budgets.md#what-happens-at-the-cap) and [Cross-Team Handoff](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-handoff.md).
* **A follow-up respects the team ceiling and is charged.** `GroupConversationService.resolveEffectiveCostCeiling` ignored `teamBudgetState.ceilingUsd`, so a follow-up on a discussion that had already reached its team's ceiling ran one more paid turn; and a follow-up starts no leg, so its spend reached the team only if the discussion was ever continued. The ceiling now includes the team's, and `GroupLifecycleOps.followUpWithMember` charges the turn as soon as its cost is harvested, as a phase turn does.
* **The SERVICE judge prices from the catalog.** `JudgeCallPricing` was the seam left for the price resolver; it now passes the judge's `llmProvider/llmModel` to `ModelPriceResolver`, so a judge without prices of its own is priced from the [price catalog](https://docs.labs.ai/agent-configuration/model-cascade/model-pricing.md) instead of $0. Explicit prices still win.
* **Dashboard.** The HITL row of the Full Metrics Reference had two panels at the same position after the merge (approval-context renders and decision latency); the former moved below. The k8s copies are regenerated.
* **Schema version.** `handoffState` and `teamBudgetState` ride `GroupConversation` schema v5 with the tie-break fields — recorded in the version comment as decided, valid while the ten ship in one release.
* `GroupConversationService.executeTaskExecutionPhase` keeps its unused `speakers` parameter (the reflection seam every phase delegator shares); the reason is now in its Javadoc.

### MCP tools (96 → 108)

Thin wrappers over the in-process REST beans, so every access rule of the REST resource — existence first, VIEW or EDIT on the group, per-agent oversight scoping, the caller's principal as the recorded actor — applies to the MCP caller unchanged. Each class checks its tier itself, because an in-process call never passes the HTTP layer's `@RolesAllowed`; `McpRoleTierParityTest` measures the tiers and compares them with the REST annotations (now also method-level ones). New tiers in `McpRoles`: `OVERSIGHT` (admin, editor, approver) and `BUDGET_READ` (admin, editor, viewer). `McpToolUtils.responseJson` turns a resource's `Response` into the tool result, keeping its sentence or code.

| Class                 | Tools                                                                                                       | Tier                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `McpPricingTools`     | `read_model_prices(provider?, model?)`                                                                      | Author (read only — prices are a budget lever) |
| `McpTeamHandoffTools` | `list_team_handoffs`, `accept_team_handoff`, `decline_team_handoff`                                         | Author, then VIEW / EDIT on the group          |
| `McpTeamBudgetTools`  | `read_team_budget(groupId, historyMonths?)`, `list_team_budgets`                                            | Budget read                                    |
|                       | `adjust_team_budget`, `transfer_team_budget`                                                                | Admin                                          |
| `McpOversightTools`   | `summarize_approvals`, `list_autonomy_recommendations`, `get_autonomy_state`, `count_pending_audit_samples` | Oversight                                      |

Not built: a tool to file a handoff or delete a backlog task, any oversight write (never), the per-decision and sample listings (they carry users' redacted tool arguments), `preview_approval_context` (no render-preview service method exists) and a separate `get_hitl_decisions` (`summarize_approvals` answers it). The `eddi-admin` Claude Code skill teaches the new tools (`SKILL.md`, `references/groups.md`, `references/destructive-ops.md`).

**Found on the way:** `RestTeamHandoffs` caught the guard's `io.quarkus.security.ForbiddenException` in its generic `catch (Exception)` and answered **500** to a caller without access to the group, over REST and MCP alike; its test threw the JAX-RS `ForbiddenException`, which the guard never throws. It now rethrows the Quarkus exception (403), and the test uses the real type. `RestGroupWorkspace` on `main` has the same pattern and is left for its own fix.

### Platform Operator (revision 52 → 53)

* **Allow-list** (`tool-scopes.ts`), reads only, each with the exclusions written next to it: the price catalog, model resolution and unpriced sightings, and one tenant's usage (`PUT …/model-prices`, the reference list and every quota write stay out — a price is a budget lever); a team's handoff intake inbox (accept, decline and backlog delete stay out — an intake decision is a person's); a team's budget, its history and the cross-team listing (the cap change and the transfer stay out); the approval analytics summary, the earned-autonomy states, one category's evidence and the sample count (the sample list, the per-decision rows and every oversight write stay out). Four new predicates gate the matching prompt sections, so a deployment without one of the reads is not told about it.
* **Prompt** (`system-prompt.ts`): sections on cost and prices (resolution order, unpriced models and the strict policy, where cost shows), cross-team handoff (two-sided consent, REVIEW vs AUTO, why group handoffs are gated on the receiving side, every refusal), team budgets (window, who pays, every refusal, the admin-only calls to give) and approval oversight (tiers, `sampledAudit`, `autonomyPolicy`, the 409s); and quick-reference entries for the SERVICE judge, human tie-breaks, humans in task forces, tool-call guardrails, edit-on-approve with the decision audit, and approval card context, plus their documentation pages. The operator is told it never answers a tie-break or a human task, never decides an intake item, and never changes a price, a cap or an oversight state.
* **Gate guard** (`gate-guard.ts`): an LLM-config write that sets `toolCallGuardrails` — in a PUT body at any depth, or a patch path, `from` or value — is refused in the approval UI with the new reason `carries-guardrails` (string `operator.approval.blockedGuardrailCarrying`, all 11 locales), mirroring the backend's `SelfUngatingGuard`. The agent-store oversight fields the approval-analytics follow-up asked for need no rule: the operator holds no agent-store write.

The ten `planning/operator-followups/*.md` notes stay: planning documents are kept in this repository after they are done, and these record why each read was granted or left out.

***

## 🧪 test(hitl): raise branch coverage of the oversight classes (2026-11-03)

**Repo:** EDDI (`feat/approval-analytics-autonomy`)

### What changed and why

CI's `Integration Tests` job failed the JaCoCo gate (branches covered ratio 0.79, minimum 0.80) because the approval analytics, sampled audit and earned-autonomy classes landed with poorly covered branches. This adds plain JUnit 5 and Mockito tests (no container, no Docker) for those classes under `src/test/java/ai/labs/eddi/engine/hitl/oversight/` and `src/test/java/ai/labs/eddi/configs/hitl/model/`: the autonomy service (reads, evaluation, decision and sample triggers, lift, dismiss, suspend, apply and revert), the suspended-gate overlay and its service, the promotion patch builder, analytics grouping and sample joins, the sampled-audit recorder and its sampling key, the write guard, the GDPR participant, the config lookup, the maintenance schedule and service, the rebuild service, the REST resources, the metrics and the config model.

No production code changed. The oversight classes' own tests now leave 118 of 1,320 branches uncovered, almost all in the three database stores that only an integration test can reach.

***

## 📝 docs(release): 6.7.0 release prep — release-notes index and upgrade guide (2026-11-03)

**Repo:** EDDI (`docs/release-6.7.0-prep`)

### What changed and why

`docs/release-notes.md` stopped at 6.5.0, so 6.6.0 (tagged 2026-10-20) had no row and the 6.5 upgrade guide was not listed under "Upgrade guides". It now has rows for 6.6.0 and 6.7.0 and lists the guide. The 6.7.0 row is marked unreleased, to be set to the tag date at tagging.

`docs/upgrading-from-6.5.md` gains a "Changes in 6.7" section written on the assumption that the open 6.7 PRs (cluster hardening, team budgets, HITL review/oversight, cost accounting, the update check, the review sweep) all merge: changed defaults, fail-closed behaviour, the cluster/NATS/Helm notes, rolling-upgrade cautions and the opt-in feature switches.

### Design decisions

* No version files were touched: `pom.xml` already says 6.7.0 and the release pointers correctly stay on 6.6.0 until the post-release PR after the 6.7.0 image exists.
* The helm chart version and `operator-revision.json` are bumped by the PRs that change them, not here, to avoid re-conflicting the serially landing operator PRs.
* The upgrade section links only to pages that exist on main today; pages added by open PRs (e.g. group human decisions) are referenced through `group-conversations.md`.

### Next

Before tagging: merge the open PRs, re-read the 6.7 upgrade section against what actually landed, set the 6.7.0 date in the release-notes row, confirm main's `ci.yml` is green, tag `6.7.0` (no `v`).

***

## feat(streaming): resume stream, tool\_result events, stored call identity, toolDisplay (2026-11-03)

**Repo:** EDDI (`feat/resume-stream-tool-events`)

### What changed and why

Streaming clients (a live chat with plain-language activity lines and an approval card) could stream a `say` but not the resume of a human-approval pause, saw a tool start but never finish, and lost call identity in the stored trace, so a receipt could not be rebuilt after a reload.

* **`POST /agents/{conversationId}/resume/stream`** (SSE, same roles, body and query flags as `/resume`). Admission is the plain `/resume`'s own method (`RestAgentEngine.resumeStreaming`), so every refusal (400/403/404/409/503, pause mismatch, secret-context error) is the same plain HTTP error and nothing is written to the stream first; the keep-alive starts only after the decision was accepted. `ConversationHitlService.resumeConversationStreaming` installs the same event sink a streamed `say` uses on the resumed memory; failure, lease loss and thrown errors go to `onError`, a dropped resume ends with a typed `error` (`conversation_ended`, `awaiting_approval`, `conversation_busy`, `resume_dropped`), and a re-pause is still delivered only after it is persisted. `hitl_resume {pauseId, verdict}` is sent once, from the resume callable, before any event of the continued turn. `/resume/stream` follows `eddi.streaming.resume-cancel-on-client-disconnect` (default `false`: a dropped client never discards an approved turn); `/stream` keeps `eddi.streaming.cancel-on-client-disconnect`.
* **Events (additive):** `tool_call {tool, callId, displayName?, display?}`; new `tool_result {tool, callId, status: ok|error|not_executed|rejected, durationMs}`, emitted once per call from a single `try/finally` in `ToolLoopRunner.executeToolCall` and for declined/skipped gated calls from `ToolLoopResumer`; new `approval_required {pauseId, pauseType, callCount}` right before `done` on `/stream` and `/resume/stream` when the turn ends `AWAITING_HUMAN`. `ConversationEventSink` and `StreamingResponseHandler` gained default overloads, so existing implementors (group member observers, `toolCallObserver`) are untouched.
* **Stored trace identity:** `tool_call`, `tool_result` and `tool_error` entries carry `callId`; approved gated calls add `hitl_approved {tool, callId}`; `hitl_rejected` adds the per-call reviewer note and the call's arguments, redacted with `SecretRedactionFilter`.
* **`toolDisplay`** (new optional field on the LLM task): `{"<tool>": {"label": "...", "fields": ["..."]}}`. `label` static, at most 120 characters; `fields` an allow-list of at most 3 top-level argument names; only string/number/boolean values are shown, redacted and cut to 80 characters. Validated at save time (`ToolDisplayConfigValidator`, wired in `LlmStore`), keyed like `toolQuotas`.

### Design decisions

* `task_complete.toolTrace` already carries redacted arguments and results. The new events do not, but a client that forwards events to end users must still drop `toolTrace`; this is now stated in `rest-api-reference.md`, `hitl.md` and `langchain.md`.
* `hitl_resume` is emitted when the resume callable starts rather than at submit, so a resume the coordinator drops (pause restored) never announces itself.
* A streamed `say` that is skipped keeps its old `done` answer; only the resume stream turns a skipped resume into a typed `error` event.
* `onToolCall(String)` keeps working: the new three-argument form defaults to it.

### Files

[`RestAgentEngineStreaming.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentEngineStreaming.java), [`ConversationHitlService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/ConversationHitlService.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`ToolLoopResumer.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopResumer.java), [`ToolDisplayConfigValidator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/ToolDisplayConfigValidator.java), [`hitl.md`](https://docs.labs.ai/conversations-and-orchestration/hitl.md)

***

## Review-thread sweep over the merged PR backlog (2026-11-03)

**Repo:** EDDI · **Branch:** `fix/review-threads-sweep`

Fixes the findings that were still open as review threads on the 38 PRs merged on 2026-11-02, each checked against current `main` first. Findings that were not defects, or are design work, are answered on their PRs and listed at the end.

**Security and data integrity**

* **Authorization** (`RestWorkflowStore.java`): `addReference` no longer skips a host-bearing reference without a scheme (`//ai.labs.llm/…`); the engine resolves it by host and id, so it now gets the same VIEW check as `eddi://`.
* **Redaction** (`SecretRedactionFilter.java`, `SecretScrubber.java`): a quoted cookie value (`sid="…"`, also as `sid=\"…\"` inside a JSON carrier, with an apostrophe inside, or starting with a colon) is masked with its quotes kept; `Set-Cookie` attribute values (`Path`, `Domain`, `Expires`, …) are exempt only in a `Set-Cookie` header and only after its first pair (the first pair is the cookie itself, even when it is named `Path`), not in a `Cookie` request header, and a bare flag no longer ends the walk; both export-scrubber query paths (relative and absolute URL) judge a percent-encoded name (`%6bey`, `%73ig`) by its decoded form.
* **PDF budget** (`PdfDecodeBudget.java`, `PdfTextExtractor.java`): predictor dimensions are checked for overflow and non-positive values before they are multiplied (a zero dimension also hangs PDFBox's TIFF predictor), and a `/Filter` that PDFBox reads as zero filters (`[]`, a number, a string) is charged like an unfiltered stream.
* **Crawler** (`WebCrawler.java`): the link-length bound is applied to the URL that will be fetched, for page links and sitemap entries alike, before canonicalization drops tracking parameters.
* **Erasure race** (`ClusterConversationCoordinator.java`): after publishing a node-local dead letter the coordinator looks again for an erasure marker and retries until it can — an unreadable marker or a failed purge no longer leaves the erased turn in the shared stream, and a failed purge no longer escapes the fixed-delay forwarding task (which cancelled every later run).
* **Alerts** (`AlertMaintenanceService.java`, both alert event stores): the bounded orphan scan resumes after the last rule id it saw, so rules that still digest cannot crowd a disabled or deleted rule out of every pass.
* **HITL journal** (`HitlToolJournalStore.java`): `reconcileRetention` counts only index drops that happened, still handles every other stale index and recreates the partial one when a drop fails, and then rethrows the first failure (anything but "index not found").
* **Helm** (`helm/eddi`, chart `2.13.0` → `2.14.0`): `nats.externalAllowPlaintext` must be a boolean (the string `"false"` is truthy and switched the plaintext guard off); external NATS credentials are escaped for the properties file they are written to (backslash, line breaks, `${…}` expansion and a leading blank).
* **Audit evidence** (`TurnAuditBuffer.java`): a turn that recorded a failed task, or whose entry the ledger refused, no longer hands its compiled prompt and model response over to the ledger, and a step marker (`audit:evidence_retained`) carries that across a pause and its resume. The failure entry carries no LLM detail, so releasing them deleted the only copy.
* **Legacy path rewrite** (`LegacyPathRewriteFilter.java`): the rules are matched below `quarkus.http.root-path`; the cache memo of hashed keys (`CacheFactory.java`) forgets an evicted key on the publishing node.
* **Shutdown** (`SchedulePollerService.java`): a poll that is already running stops claiming once shutdown begins.

**Correctness and smaller fixes**

* Postgres `loadConversationMemorySnapshot` calls `ensureSchema()` again (a read can be the first statement on a fresh database); the simple projection of a drifted document with outputs and no steps no longer throws.
* Dark-only brand colours render the same stylesheet in mock mode as the server (`brand-css.ts`); `SwaggerUiBranding` survives a malformed alpha; the Slack refusal WARN (`ChannelTargetRouter.java`) carries `[SECURITY]` as documented, and only that one; the apicalls `authHeaderRef` error names `${eddivault:…}`.
* `docs-site/scripts/check-live.mjs` validates both URL arguments; the cluster demo treats an empty `MOCK_LLM_BIND` as unset (it bound every interface); the changelog collator refuses a link to a dated pending fragment (judged on the resolved path and the link destination alone, so `.././changelog.d/…`, a root-relative form and a titled link are caught; the README is still linkable) and the CI register-row detector accepts the same whitespace the collator does.
* **Manager:** the synthesis heading and footer keep their contrast for a bright brand; `BrandIcon` falls back once when `/branding/icon` fails; version labels and the About entry are translated, with focus returned to the Help trigger; French and Korean strings no longer attach an elision or particle to the brand name; the European Portuguese login-theme strings; `swatchFor` shows a valid `rgb()` primary; save, reset, upload and remove on the branding page are one write at a time and bounded by a timeout, and out-of-order or failing live brand scripts can no longer leave a stale or missing brand; a failed logo or icon no longer falls back to EDDI's own wordmark on a branded deployment; `AboutDialog`, `BrandWordmark` and `BrandIcon` are in the design-system mirror.
* **Spent team budget on the group endpoints** (`RestGroupConversation.java`, found in a smoke test of `main` on 2026-11-05): `TeamBudgetRefusedException` is now caught before its parent `GroupDiscussionException` and answers **409 with the refusal's own text** (team, spend, cap, reset, what an administrator can do) on `discuss`, `continue` and `followup`; the streaming start and a streamed continuation send that text in their `group_error` event. Before, `discuss` fell through to a 500, continue and follow-up returned the canned "must be COMPLETED" conflict text on a completed conversation, and the stream said only "could not be started". [`team-budgets.md`](https://docs.labs.ai/security-and-compliance/tenant-quotas/team-budgets.md) now names the streaming behaviour. `RestGroupConversationTeamBudgetTest` asserts status and body on all four endpoints.
* **Docs:** the vault fallback counter is described as cumulative and attempt-based (rate, not zero total); the manual-fire timeout (`504`, interrupt, 30 s grace); NATS certificates and discovered brokers; a failed Keycloak admin login stops the Compose stack on loopback too; the audit ledger's crash window.

**Answered, not changed**

* `TemplateSyntaxMigrator` ReDoS: already bounded by `conversionWork` before any pattern runs; a regression test pins it.
* `BoundedRegex` stacked counted quantifiers: measured at milliseconds on this JDK, so no refusal is needed.
* `TurnAuditBuffer` durability window: documented; releasing the evidence keys only after the store confirms the entries is a larger change, left open.
* NATS `tls://` without `eddi.nats.tls.enabled` (#1206): superseded on `main` by #1249, which builds the host-name-verifying context for `tls://` and `wss://` URLs too and dials the name itself (`HostnameResolveMode.HappyEyeballs`), with handshake tests (a certificate whose only SAN is the configured host connects; a trusted certificate for another host is refused). A first attempt in this branch gave those URLs the verifying context without that, which would have compared the certificate with a resolved IP; it was withdrawn, and this PR does not touch the NATS TLS code. Only the certificate guidance for servers learned from cluster discovery is added to `docs/clustering.md`.
* `CacheFactory`: receiving nodes keep the memoised hash of an evicted key until the bounded memo turns it over; a reverse lookup per event on the dispatch thread would cost what the memo exists to save.
* A fragment dated 2026-11-01 for the Node 26 change: the date is when it was written.

***

## ✨ feat(groups): team learning loop — bets and outcomes (2026-11-03)

**Repo:** EDDI (`feat/team-learning-loop`), built on the local integration branch `feat/operator-mcp-integration` because PRs #1222–#1231 are not merged yet

### What changed and why

Approval gates record that a human said yes; nothing recorded what came of it, and a backlog task was free text. Two opt-in pieces close that:

* **Bets as first-class backlog tasks.** `TaskItem.bet` (`hypothesis`, `metric`, `target`, `reviewDate`, `reviewedAt`) on workspace backlog tasks, filed through REST, `add_team_task`, `addGroupTask`, `handoff_to_team` (and kept in the REVIEW inbox until accepted) and the Manager. `GET …/workspace/backlog/due-reviews` lists bets whose date has arrived and that have no verdict; `POST …/backlog/{taskId}/bet/review` closes or reschedules one; `list_team_backlog` takes `dueForReview`. Every task copy site (all status transitions, the cadence writeback, dependency rewrite on delete, handoff intake) now carries the bet. No bet fields = an ordinary task; stored tasks read unchanged.
* **Outcome events.** `POST/GET /groupstore/groups/{groupId}/outcomes` records a real-world result against a backlog task or an approval decision. Off until the group has an `outcomeConfig` (409 otherwise). Bounded per subject, per team and by age, idempotent by `idempotencyKey` (scoped to the team), the principal is the authenticated caller. Stored in `group_outcomes` on MongoDB and PostgreSQL ([`IOutcomeEventStore`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/outcomes/IOutcomeEventStore.java)), cascaded on permanent group deletion, pseudonymized on GDPR erasure. The RETRO phase quotes the newest `retroDigestSize` outcomes as labelled data; `GET /hitl/analytics/outcomes` joins approval decisions with them per category.
* **Manager.** Workspace page: *File as a bet*, the bet on each backlog row, a *Bets due for review* section with Mark reviewed / Reschedule, per-task *Outcomes*, a *What came of approvals* table and the outcome setting on the group config panel. `groupLearning.*` in all 11 locales.
* **Platform Operator.** Read-only grants for the outcomes, due-reviews and outcome-analytics endpoints and a prompt section; **revision 56** (above the open #1245's 55). Deliberately not granted: recording an outcome or a bet verdict.

### Design decisions

* Outcomes are team-scoped and never decide anything: no promotion, demotion or re-gating reads them.
* `outcomeConfig == null` is *off*, not a default (unlike `retroConfig`): the endpoint refuses and the retro is unchanged.
* A task id joins an approval decision only through a `TASK` unit, so an unrelated row that carries the same id is not credited.
* A bet is due whatever the task's status.

### Not in this PR

Cross-team lesson sharing (explicit grants) and the scheduled, cost-capped consolidation of retro lessons are a second PR. Not run locally: the `*IT` store tests (Docker) and the Playwright suite; CI is the gate for those.

Docs: [`docs/team-learning-loop.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-learning-loop.md).

* Final Platform Operator revision for 6.7.0 after merging main, #1259, #1260 and #1265 into this branch: **60** (the revisions 55–59 named in those PRs' fragments and earlier on this branch were intermediate).
* Platform Operator: closes the remaining gaps of the ten 6.7 follow-up notes; final revision 60. The prompt now names the oversight deployment properties (sampling switch, retentions, maintenance interval, suspension cache TTL), the served `approvalContext` shape and its render outcomes, human task results under TASK-granularity approval, the free human tie-break, Slack's edit limits and `hitlShareRuleDrafts`, reason-code and category rules, `hitl.edit.refused`, the human-only backlog delete, and the tool-call guardrails' `disclosure` parameters, could-not-decide reasons, trace step and budget accounting.

***

## ✨ feat(groups): team lessons - sharing between teams and cost-capped consolidation (2026-11-03)

**Repo:** EDDI (`feat/team-learning-lessons`), stacked on `feat/team-learning-loop` (PR #1264), which sits on the unmerged `feat/operator-mcp-integration`

### What changed and why

A team's retro lessons were visible only inside their own group, FIFO-evicted at `maxStoredLessons` and never consolidated. Both are now possible, **off unless the group has a `lessonConfig`**:

* **Cross-team lessons.** `lessonConfig.shareWith` (owner) and `readFrom` (reader), consent on both sides like a handoff; `GET /groupstore/groups/{groupId}/lessons` and `…/lessons/shared` (which also returns `notShared`, the owners that did not grant). The reading team's RETRO phase quotes the shared lessons after its input, bounded, labelled as other teams' words (the hook added for outcomes in #1264 now composes both).
* **Lesson consolidation.** [`LessonConsolidationService`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/LessonConsolidationService.java) merges lessons that say the same thing and retires a lesson a later outcome contradicted. It rides the schedule machinery (`ScheduleFireExecutor` dispatches on the `lessonType` marker, as for Dream and team cadences; `PUT/DELETE …/lessons/consolidation/schedule`), reuses Dream's summarization call and cost arithmetic, and checks `maxCostPerRun` **before** the call against a worst case (dropping lessons until it fits, making no call when it cannot). A retirement must cite outcome ids the model was shown. Every change is conditional on the lesson being unchanged; the removed text, reason and evidence go to the new `group_lesson_history` store (MongoDB and PostgreSQL) first. `POST …/lessons/consolidation/run?dryRun=true` previews.
* **Manager.** A *Team lessons* card on the workspace page: own lessons, shared lessons with the owners that did not grant, consolidation state with schedule / preview / run, and the history; a line on the group config panel. `groupLessons.*` in all 11 locales.
* **Platform Operator.** Read-only grants for the four lesson reads and a prompt section; **revision 55**. Not granted: scheduling, running or removing the consolidation (it rewrites a team's memory and spends budget).

### Design decisions

* A separate service rather than extending `DreamService`: Dream consolidates one *user's* memories, these are a *team's*, and the grouping, the evidence requirement and the history differ. The call and the cost arithmetic are shared.
* The cap is a hard pre-check, not Dream's soft "checked before each call". One call per run makes the soft form a no-op.
* Retirement without evidence is refused rather than trusted: a model asserting a lesson is wrong is not an outcome.
* History is a store of its own, not a flag on the memory entry, so the live set stays what members recall.

### Not in this PR

FIFO eviction in `RetroEngine` still drops the oldest lesson without recording it in the history. Sharing is read-only: a reader cannot write to another team's lessons.

Docs: [`docs/team-learning-loop.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-learning-loop.md#lessons).

### Review follow-ups

* `RestScheduleStore` refuses the `lessonType=lesson_consolidation` marker in a create or update body (an update may only echo its own row's marker), and an update of a stored consolidation schedule needs EDIT on its group. A forged marker let anyone who could create a schedule consolidate a team they cannot edit. ZIP import goes through the same guard; the MCP tool cannot set metadata.
* A merge rewrites the kept lesson with `replaceIfUnchanged` instead of an unconditional `upsert`; losing that race skips the merge (`skipped_changed`) and drops no duplicate.
* A permanent group delete also removes the `lesson-consolidation-<groupId>` schedule.
* The workspace page shows the lessons panel from the group's current version, not the URL's.
* Docs: `maxCostPerRun` is an estimate, not a hard ceiling (the answer length is not enforced); history keeps the newest 1,000 rows per team; an owner absent from both shared lists may still have lessons outside the cap.

### Review follow-ups (second round)

* Merged `feat/team-learning-loop` (which had `main` merged in): the full-metrics dashboard takes the base layout with the lesson-consolidation panel beside the vote tie-break panel; operator **revision 58** (the base, after a second merge that brought in the operator MCP integration, is at 57).
* `lessonConfig.consolidation.parameters` follows the SERVICE judge's vault rule (`ServiceJudgeVaultGrants`): a `${vault:...}` must name a secret granted to all agents. Checked at group save and again before each run's model call.
* `RestGroupLessons.schedule` applies `eddi.schedule.min-interval-seconds` and answers an unsatisfiable cron (`0 0 30 2 *`) with 400 instead of 500.
* A retirement or a merge's duplicate drop whose conditional delete loses the race is no longer reported as applied; a partial merge names the duplicate it kept.
* `RestScheduleStore.fireNow` requires EDIT on a consolidation schedule's group before the owner checks; an update may not rename a consolidation schedule (its name is how the group's endpoints find it).
* Manager: a SKIPPED run toasts a warning with the reason instead of "finished"; the schedule control sends a time zone (the viewer's by default) and the state badge shows the stored one; each section shows an error state when its read fails, instead of the empty or "not configured" text.

***

## 🧪 test(cluster): multi-process end-to-end cluster suite, nightly cluster demo, soak and scale harness (2026-11-03)

**Repo:** EDDI (`test/cluster-e2e-evidence`)

### What changed and why

The [cluster readiness review](https://github.com/labsai/EDDI/tree/main/planning/cluster-production-readiness-review.md) (committed with this branch) found that nothing ran more than one JVM against a real database and a real NATS, with no fault injection, no soak and no scale test, and that `scripts/cluster-demo` never ran in CI. This is its Phase 3 ("evidence"), written against the contract of the Phase 1 fixes rather than against today's behaviour.

* **End-to-end suite** (`src/test/java/ai/labs/eddi/integration/cluster`). `ClusterHarness` starts three EDDI processes from the packaged app (the production Dockerfile, as `ContainerBaseIT` builds it), an R3 NATS cluster (`--no_advertise`, so clients stay behind the proxy), MongoDB or PostgreSQL, the demo's mock LLM, and a Toxiproxy proxy per (EDDI node, NATS server). The 8 scenarios in `AbstractClusterE2EIT` cover ordering without faults, latency, a partitioned node in `degraded.turns=reject`, NATS replies dropped after the write was applied (A2), a half-open link (A1), a holder frozen by SIGSTOP past `lease.ttl` (A1/A6), repeated stream-leader step-downs under load (A2/D3), and `kill -9` mid-turn. Each scenario writes JSON evidence to `target/cluster-e2e/<db>/`. A scenario that `main` is expected to fail names the finding in its title, and its assertions state the contract.
* **`ConversationHistoryChecker`**: a history checker in the style of Knossos and Elle, reduced to the ordering contract. It compares client answers, committed history and the LLM's view, and flags lost, duplicated, phantom, refused-but-committed, out-of-order (real-time order), overlapping and stale-context turns. It has 20 unit tests of its own in `ConversationHistoryCheckerTest`, which run in the normal build.
* **Opt-in.** The suite runs only with `-Deddi.cluster.e2e=true`, so `./mvnw verify -DskipITs=false` skips it. It runs through surefire, which has no 15-minute fork timeout and no rerun.
* **`.github/workflows/cluster-e2e-nightly.yml`**: the suite on MongoDB and on PostgreSQL, nightly and on PRs that touch `engine/cluster/**`. The cluster demo runs nightly on both databases. Results and node logs are uploaded as artifacts, with a job summary. The workflow is not a required check.
* **`scripts/cluster-demo/demo.py`**: `--exit-code`, so CI sees a failed scenario, and `--summary-md`, for the step summary.
* **`scripts/loadtest/cluster_soak.py`**: `soak` runs chunked steady load for a configurable duration, restarting replicas along the way. It samples per-node heap, threads, held leases and open files, plus NATS subscriptions and stream and bucket growth, and fits a per-hour slope to each series. `scale` runs many concurrently held leases per node, locally or against a cluster deployed on separate hosts (`--external`). Both are documented in the load-test README.
* [**Clustering**](https://docs.labs.ai/deployment-and-infrastructure/clustering.md#how-cluster-mode-is-tested): a new section, "How cluster mode is tested".

### First local run, on `main` at `1e8ecd372` (Docker Desktop, Windows)

On both databases, 6 of the 8 scenarios pass: ordering, latency, partition, SIGSTOP past the TTL, stream-leader failover and `kill -9`. The other two fail as the review predicted.

* **A2**: the holder's healthy turn is answered 409 after 7 s of dropped NATS replies. The next turn waits about 10–13 s.
* **A1**: the holder on a half-open link answers 200 for a turn the takeover fenced off. The checker reports it as `LOST`.

On the SIGSTOP scenario, the frozen holder correctly answers 409 after it thaws.

### What's next

Rerun once the A–D workstreams land. The two scenarios that name a finding should then pass.

### Carried into this PR for 6.7.0

* The branch-coverage tests of the closed #1281 (unit tests only, no production change) bring the merged JaCoCo branch ratio back over the 0.80 gate; two of them were adapted to the grant-visibility rule of #1249.
* `NatsTlsHandshakeTest.presentsTheClientCertificateToABrokerThatRequiresMutualTls` is quarantined (`@Disabled`): on the Linux CI runner it intermittently sees the connection CLOSED, while it passes locally. Client-certificate presentation stays covered by the JVM-default-keystore handshake test and `NatsConnectionSecurityIT`; the root cause is a 6.8 item.
* The NATS fixture password of `ClusterHarness` is a low-entropy string so secret scanning stays quiet.

***

## 🔒 fix(backup): agent-findings review — repeated references, parser references, export vetting (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-backup`)

### What changed and why

Verified the 43 CodeRabbit "agent findings" on backup / import / export / sync against the current code. 18 had been scanned before the review fixes of 2026-10-31 and most of those were already closed there; the rest were checked on today's code.

**One document, one copy, one request**

* The ZIP and remote source readers read and parse a workflow once per id and version, however often the source agent names it; every further position shares that record (`IResourceSource.atPosition`). `UpgradeExecutor` now repoints a copy of an adopted source config (`copyOf`) instead of the shared one.
* The ZIP reader reads an extension file once per archive path; both readers scan a parser document for its dictionaries once, not once per step naming it.
* The remote reader remembers failed reads, so a repeated failing reference is not requested again, and stops after `eddi.backup.sync.max-requests` requests (default `10000`) with `502`.
* Export reads each referenced resource once (`IResourceId` has no value equality, so the map kept one copy per reference); the legacy merge preview scans each archived workflow once.
* Import: two spellings of one workflow URI are one workflow; versions of one id, which read the same archive file, are decoded and written once and every reference names the one resource; a workflow directory holding more than one workflow document is a `400`.
* `StructuralMatcher` indexes source extensions by id instead of scanning them per diff row.
* Export finds `${connection:…}` references with the linear `ConnectionReference.findAll` instead of the backtracking regex.

**Authorization**

* Export no longer counts an agent or group reference (checked for `USE` only when the workflow was written) as vetting the id it carries, so a configuration named elsewhere under that id needs its own `VIEW`.
* A parser document created by import or upgrade runs `RestParserStore`'s reference check: every dictionary it names needs `VIEW` (`WorkflowReferenceAccess.requireAccessToParserReferences`).
* A structural preview's REMOVE row names a target workflow only for a caller with `VIEW` on it.
* A failed merge's rollback puts back the name, description, origin and sync baseline it rewrote onto the *current* descriptor, so a sharing change the owner made meanwhile is not undone.

**Secrets**

* `ScrubbedSecrets` compares the destination fields of both sides: a source that drops the target's `baseUrl` (provider default) or carries a non-string `host` counts as a changed destination, and the target's literal credential is not restored into it.
* `SecretScrubber` judges a header or query map serialized into a string (an LLM task's `customHeaders` / `customQueryParams`) entry by entry under the map's name, as the editor read does, so an opaque credential header no longer leaves in an export.

**Verdicts** (43 findings):

| Verdict         | Count | Notes                                                                                                                                                              |
| --------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| FIXED           | 24    | this branch                                                                                                                                                        |
| ALREADY\_FIXED  | 16    | the 2026-10-31 backup review fixes (#1189)                                                                                                                         |
| ACCEPTED\_RISK  | 2     | DNS rebinding between check and connect (documented in `security.md`); `VIEW` on an agent covering its step references (documented in `import-export-an-agent.md`) |
| NEEDS\_DECISION | 1     | per-name connection lookups on export                                                                                                                              |

### Design decisions

* Repeated references are collapsed, not refused: an agent naming a workflow twice and a stale parser document naming an older dictionary version are legitimate and keep importing.
* The request budget is a count, configurable, far above any real agent; an elapsed-time budget for the whole sync was not added (each request already has its own 30 s timeout).
* Not done: export resolves each distinct `${connection:…}` name through `IConnectionStore.idOfName` + `readByName`, each of which reads every connection; a batched lookup needs a store API change (left as a decision).

**Files:** [`IResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/IResourceSource.java), [`RemoteApiResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RemoteApiResourceSource.java), [`ZipResourceSource.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/ZipResourceSource.java), [`RestExportService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RestExportService.java), [`RestImportService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/RestImportService.java), [`UpgradeExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/UpgradeExecutor.java), [`StructuralMatcher.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/StructuralMatcher.java), [`ScrubbedSecrets.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/ScrubbedSecrets.java), [`WorkflowReferenceAccess.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/backup/impl/WorkflowReferenceAccess.java), [`SecretScrubber.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/SecretScrubber.java), [`import-export-an-agent.md`](https://docs.labs.ai/getting-started/import-export-an-agent.md), [`agent-sync-guide.md`](https://docs.labs.ai/conversations-and-orchestration/agent-sync-guide.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md)

***

## 🐛 fix(configs,datastore): agent findings for the configuration stores and the datastore (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-configs-datastore`)

Verified the 56 CodeRabbit "agent findings" for `configs/**`, `datastore/mongo`, `datastore/postgres` and `ui/BrandedOpenApiRoute` against `main`. Many had been closed since the scans, mostly by #1191 (`87f98b7b3`), #1190, #1175, #1173 and #1161. Verdicts: 14 fixed here, 29 already fixed, 5 accepted risk, 8 needing a decision, 0 false positives (two of the already-fixed ones left a gap that is fixed here too).

### What changed and why

**Reference checks.**

* `RestWorkflowStore.addReference` now needs only a host, not a scheme. A scheme-relative `//ai.labs.output/outputstore/outputsets/<id>` was skipped, but the engine resolves a step by host and id and loaded it anyway.
* A parser document's own `config.uri` is now one of the references `RestParserStore` checks. The standalone parse endpoint follows it (`InputParserTask.loadParserDocument`) and uses that parser's dictionaries.
* `RestAction` and `RestExpression` (the Manager's action/expression helpers) check VIEW on every rule set, API-call set, output set and dictionary they read, not just on the workflow. They pick a store by step type and read whatever id `config.uri` spells, relative ones included. A resource the caller cannot read contributes nothing.

**Artifact validators (group conversations).**

* A JSON-schema validator is refused at save, and not run at write, when its evaluation is unbounded (`ArtifactSchemaComplexity`). The library evaluates every `$ref` separately and reads no clock. Measured: 20 `$defs` that each `allOf` the previous one twice took 2 s to save and 3.6 s per artifact write, doubling with each further level. A self-`allOf` threw a `StackOverflowError` out of the tool call, and two routes to the same property doubled the work per nesting level. The check refuses:

  * an expansion beyond 2000 subschemas;
  * recursion that comes back at the same content location;
  * two recursive routes that do not start with differently named properties.

  Trees and binary trees still pass. A nested `$id` is refused rather than resolved by guesswork.
* `REGEX` validators and schema `pattern`s are run through `BoundedRegex.excessiveRepetition`, the scan agent tests already use. A counted repetition of an empty match (`(?:(?:){99999}){99999}`) spins without reading input, so the match deadline never saw it.

**JSON Patch.** `ConfigJsonPatcher` masks credentials and judges their relocation by the store's own read rules. Before, it used the generic redaction rules, while `RestLlmStore`'s read leaves `tasks[].toolCacheScopes` as it is. A key copied to `toolCacheScopes.apiKey` was accepted as "still hidden" and then returned in plain text. The LLM and API-call stores pass their `NOT_CONFIGURATION` skip paths through a new `RestVersionInfo.patch` overload.

**Knowledge bases.**

* A 6.5.0 name-layout knowledge base that changes its `storeType`, or the server it connects to, moves to the id layout. The server parameters are `host`, `port`, `database`, `databaseName`, `connectionString`, `serverUrl`, `baseUrl` and `tenantName`. On the new backend or server the same name maps to that one's default store, which can belong to another legacy knowledge base with the same name.
* The standalone endpoints (search, ingest, documents, chunks) apply the deployment rule: the caller must belong to every space tenant the configuration's `${vars:<tenant>/…}` / `${vault:<tenant>/…}` references name, with variables expanded and connections followed. They build the model and store on the spot with the server's authority, and no deployment ever checked them. This adds `SpaceReferenceGuard.requireMayUse` and `VaultGrantChecker.referencedTenantsOf`. Docs: [RAG](https://docs.labs.ai/agent-configuration/rag.md).

**Connections.** `ConnectionStore.readByName` reads the live version of each connection. Before, it read the version the descriptor names. The response filter advances that descriptor only after `updateConnection` has invalidated the registry, so a lookup in between cached the previous `allowedHosts` for the registry's one-minute TTL.

**Datastore.** `GridFsAttachmentStore` counts quota usage, and enumerates a conversation's blobs for erasure, on the primary, like `MongoScheduleStore`'s erasure reads. The client reads `nearest`, so a lagging secondary undercounted admitted uploads and left committed blobs out of an erasure.

**API description.** `quarkus.http.auth.permission.api-docs.paths` now lists `/openapi.json`, `.yaml`, `.yml` and their `/q/` forms. Neither `/openapi` nor `/openapi/*` matches them, so the role-gated document was served to any authenticated token through a suffix URL. Docs: [security](https://docs.labs.ai/security-and-compliance/security.md), [configuration reference](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md).

### Design decisions

* **Schema complexity is bounded statically.** networknt offers no hook that runs during evaluation, so a budget cannot be enforced while the schema runs. The analysis follows only references inside the document. References to other documents are left to the loader, which loads nothing but the bundled meta-schemas.
* **Standalone RAG reuses the deployment rule** (`SpaceReferenceGuard`) instead of a second tenant-membership check.

### Needs a decision (not changed)

* Descriptor `PATCH` against sharing: the full descriptor is written back, guarded only by the resource version, so a concurrent revocation can be undone. Needs a descriptor revision or field-level writes on both backends.
* Mongo authorization reads use `nearest`. Moving descriptor reads to the primary affects every descriptor read.
* Slack approval records are keyed by the integration's name, not its id.
* A non-admin `duplicateLlm` (or a deep workflow copy) carries plaintext credentials the copier cannot read.
* The knowledge-base collision check does not see locations used by older, still-pinned versions.
* Uploads are not fenced against a concurrent conversation erasure (MongoDB and PostgreSQL).

### Follow-up: review findings on the parse path and the connection lookup

* **Standalone parse checks a parser document's `config.uri` per request.** Parser documents saved before the save-time check can still name another owner's parser, and `RestSemanticParser` loaded them unchecked. The cache entry now records the parser documents `config.uri` named when it was built, and every request requires `VIEW` on each of them on the request thread, hit or miss, with the same rule `RestParserStore` applies on save. The cache stays shared and the document is still read once per cached parser. The parser is now resolved on the request thread instead of the pool thread, so that the check has the caller's identity. Not done: a one-off scan or migration of stored legacy parsers, and the same per-request check for dictionary references in `extensions`.
* **The connection lookup reads from the primary.** `IResourceStorage.primaryReads()` returns a view served by the authoritative copy: on MongoDB the same collections with `ReadPreference.primary()`, on PostgreSQL the storage itself. `ConnectionStore` resolves the current version and fetches the connection through it, so a lagging secondary cannot hand the registry a connection whose `allowedHosts` was just narrowed. Every other store keeps `nearest`. Authorization descriptor reads are unchanged and remain the open decision above.

***

## 🔒 fix(engine): agent-findings review of engine/internal — resume USE check, undeploy overflow, synthesis approval under the cost ceiling (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-engine-internal`)

### What changed and why

A batch of 41 scanner findings against `engine/internal` (REST endpoints, conversation and group authorization, data exposure) was traced through the current code. 26 had already been fixed by #1161, #1188, #1193 and #1207; the real remainder is fixed here.

* **Resume re-checks USE for an owner.** `HitlAccessGuard.requireConversationResumeAccess` is `requireConversationHitlAccess` plus, for a caller who is neither admin nor approver, the turn check `say` applies (`ConversationAccessGuard.requireConversationTurnAccess`): ownership outlives a revoked share, the right to run the agent does not. Used by `POST /agents/{conversationId}/resume` and MCP `resume_conversation`. Approvers and admins decide by role, unchanged — the same split the group approve already makes.
* **MCP `get_approval_status` withholds the compiled prompt** from a caller without VIEW on the agent, as the REST `approval-status?detail=full` has since #1193.
* **Single-version undeploy refuses a version below 1** (400). The decrementing loop wrapped at `Integer.MIN_VALUE` and never ended; the bulk path was bounded in #1193.
* **A SYNTHESIS phase that runs under the `SYNTHESIZE_NOW` skip-ahead keeps its `requiresApproval` gate.** Only the phase that trips the ceiling skips its own gate (abandoned work); the synthesis answer is executed work and is published.
* **Member tool-pause recovery** resumes with the detailed projection (the summary one dropped the dynamic-agent tracking keys, so agents created while resuming escaped cleanup) and harvests the resumed run's cost into the ledger before any return, including a re-pause — the next member's ceiling check saw a stale total.
* **`GET /administration/logs/history` with `limit` ≤ 0** reads the default page of 100. Both log stores treat a non-positive limit as "no limit" and collected the whole history onto the heap.

Verdicts: 6 fixed, 26 already fixed, 1 false positive (the vote-option regex: a 400,000-character worst-case synthesis parses in well under the test timeout on the current JVM, so no quadratic cost could be shown), 3 accepted risk (the auto-approval counter is the documented consecutive no-progress guard, total pauses are capped by `maxPausesPerTurn`; a resume deploys its pinned version on demand, documented in `hitl.md`; the agent quota's bounded concurrent overshoot, documented on `enforceAgentQuota`), 5 need a decision (contextScope for the phase-specific prompt variables, a durable record of follow-up creations after a timeout, explicit unretain propagation, an atomic discussion-wide creation reservation, a configured-task cap).

**Files:** [`HitlAccessGuard.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/HitlAccessGuard.java), [`RestAgentEngine.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentEngine.java), [`McpHitlTools.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/mcp/McpHitlTools.java), [`RestAgentAdministration.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestAgentAdministration.java), [`GroupConversationService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/GroupConversationService.java), [`MemberTurnExecutor.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/MemberTurnExecutor.java), [`RestLogAdmin.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/RestLogAdmin.java), [`log-administration.md`](https://docs.labs.ai/deployment-and-infrastructure/log-administration.md), [`hitl.md`](https://docs.labs.ai/conversations-and-orchestration/hitl.md), [`workspaces.md`](https://docs.labs.ai/security-and-compliance/workspaces.md), [`group-conversations.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md)

***

## Agent findings, engine misc: audit erasure barrier, scrubbed audit payloads, MCP schedule floor (2026-11-03)

**Repo:** EDDI. **Branch:** `fix/agent-findings-engine-misc`.

40 CodeRabbit agent findings in `engine/{mcp,memory,a2a,alerts,audit,httpclient,mail,ratings,agenttests}` were traced against the current code. Most were already closed by #1173, #1187, #1188, #1193 and #1198; four real gaps are fixed here, plus one extra item carried over from the llm-impl sibling branch.

**Fixed**

* `AuditLedgerService.stopInFlightWorkByHash` (the peer's reply to the cluster `gdpr-stop`) now waits for a flush that is already committing before it answers. The erasing node sweeps the stored audit rows as soon as every node replied, so a batch drained before the peer marked the user could previously commit its raw entries after the sweep.
* `TurnAuditBuffer` scrubs the buffered audit payloads with the shared deep, JSON-aware `SecretValueScrubber.scrubDeep` instead of its own string/number/map/list walk. A secret inside a payload object, or inside a JSON string in its escaped form (a quote, backslash or newline in the secret), no longer survives into the persisted audit entry.
* MCP `create_schedule` refuses heartbeat and cron intervals below `eddi.schedule.min-interval-seconds` (default 60), as the REST schedule store already did; one MCP call could otherwise create a schedule firing agent turns faster than the deployment's floor.
* OpenAPI discovery from a remote `specUrl` refuses a downloaded document whose `$ref` carries an explicit non-http(s) scheme (`file:`, `classpath:`, a drive path or UNC path). Relative refs stay: they resolve against the document's URL.
* `CompatibilityRules.containsTemplate` strips configuration-reference mentions with a linear forward scan, not a regex that went quadratic on a value of unclosed `{vault:` openers (same approach as `LlmTask.escapeConfigReferenceMentions` on the llm-impl branch).

**Verified, no change needed** — `SelfUngatingGuard.refusalFromArguments` already checks the JSON-decoded keys and string values (`argumentHaystack`, #1192), so a `\uXXXX`-escaped id or key in tool arguments is caught; `SelfUngatingGuardProtectionTest` pins it.

**Open decisions** (not implemented; they change a contract or need a redesign): a cap on active alert rules per agent and a per-event delivery budget; routing OpenAPI external `$ref` fetches through the guarded fetcher (or refusing external refs); a durable deletion barrier between conversation purge and in-flight dependent writes.

Verdicts for the 40 findings: 4 FIXED, 28 ALREADY\_FIXED (two of them on the sibling `fix/agent-findings-engine-internal` branch), 1 FALSE\_POSITIVE, 3 ACCEPTED\_RISK, 4 NEEDS\_DECISION.

**Review follow-up (PR #1257)**

* `CronParser.computeMinIntervalSeconds` skips calendar dates a zone does not contain (Pacific/Apia lost 2011-12-30), which used to yield a gap of 0 and reject a valid daily schedule on REST, MCP and RAG ingestion alike.
* Embedded JSON in scrubbed strings is read with decimals as `BigDecimal`: unrelated decimals keep their text (`1.00` stays `1.00`) and a secret number is matched by value.
* A downloaded OpenAPI spec is checked on its decoded tree only (prose and YAML comments that mention `$ref: file:` no longer refuse it) and a `file:`/`jar:`/`classpath:` schema `$id` is refused, since relative refs resolve against it.
* The MCP schedule-floor error tells operators to lower, not raise, `eddi.schedule.min-interval-seconds`.

***

## 🔒 fix(infra): agent-findings triage of the installer, GCP provisioner, CI and load-test scripts (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-infra`)

### What changed and why

A batch of 35 machine-generated security findings against the infrastructure files was checked against the current code. Most were already closed by the earlier infra review pass (#1185); the rest are fixed here or recorded as accepted risk or open decisions.

* **`install.sh`** sends Keycloak and Grafana credentials to `127.0.0.1` instead of `localhost`. The Docker ownership check matches the published IPv4 port, but `localhost` can resolve to `::1` first, where another local user's listener could hold the same port.
* **`gcp/provision-vm.sh`**: the generated startup script reads Keycloak's real port from `.env` (the installer moves off an occupied 8180), sends the admin password only to a port Docker reports as a running `keycloak` container's, uses the same port in nginx, and passes the admin bearer token through a curl config on stdin rather than `-H` (argv).
* **`src/main/docker/seed-demo-agent.sh`**: the `/v1/models` bearer key goes through `curl -K -` instead of `-H`.
* **`.github/workflows/ci.yml`**: the PR title shown in the Slack notification is escaped (`&`, `<`, `>`), so it cannot form a link in the mrkdwn field.
* **`scripts/loadtest`**: result and report files are written through an exclusive temp file and `os.replace`, so a symlink planted in the world-writable `results/` directory is replaced rather than followed. The stream driver reads bodies and SSE frames in linear time and caps the error body it keeps.
* **`k8s/overlays/monitoring`**: a `NetworkPolicy` admits only the Grafana pod to Prometheus.
* **`application.properties`**: a comment says the metrics permission path is literal and must be repeated if the endpoint is relocated.
* **`install.sh` / `install.ps1`** (PR #1099 review): a fresh install (no `.env` yet) now generates its own `MONGO_APP_PASSWORD`, so EDDI no longer connects to MongoDB with the root password under another name. An existing `.env` is never given one (its app user already exists with the old password); a stored value is carried forward as before.
* **PR #1239 review follow-ups:** the GCP startup script now sets `EDDI_DIR` before it reads Keycloak's port (it read `/.env` and always fell back to 8180); the credential-bearing `curl` calls in `install.sh` pass `--noproxy 127.0.0.1`; `install.ps1` takes an exported `MONGO_APP_PASSWORD` as the value it persists; the stream driver reads a chunked body in 64 KiB pieces; `write_text_atomic` sets the mode with `fchmod` on the open descriptor and keeps an existing file's mode or the umask default; the NetworkPolicy and metrics-path notes are corrected.
* **PR #1239 outside-diff review:** the Grafana health probe and the GCP script's Keycloak grant and admin calls also pass `--noproxy 127.0.0.1`; the GCP script re-checks that a running Keycloak container owns the port on every attempt instead of once; `install.ps1` removes only one matching outer quote pair when reading `.env`.
* **Stream driver, SSE across piece boundaries:** `sse_events` holds a trailing until the next piece and decodes incrementally, so a CRLF or a multi-byte character split by the 64 KiB reads no longer delays or merges events.
* **PR #1239 third review:** `sse_events` resumes its `"\n\n"` search one character before each new piece instead of rescanning an incomplete frame from its start, and fails the turn as a protocol error once a frame passes 1 MiB (`MAX_SSE_FRAME`, the reader's existing line limit); `report --out` / `cluster-report --out` naming a special file such as `/dev/stdout` is written in place rather than replaced; the GCP script takes the Keycloak container id from `docker compose ps -q keycloak` with the stack's own compose arguments, so a keycloak of another Compose project on the same port is never sent the admin password.
* **PR #1239 fourth review:** a complete SSE frame is held to the same 1 MiB limit before it is yielded, so the verdict no longer depends on where the 64 KiB boundaries fall. `--out /dev/stdout` (or `-`) now writes to the process's stdout descriptor. It works even when stdout is redirected to a file, where a stat reports a regular file and the temp file would have landed in `/dev`. No other `--out` path is opened in place, so a FIFO planted in `results/` is replaced rather than written to. This drops the stat-based special-file branch.

### Verdicts (35 findings)

FIXED 13, ALREADY\_FIXED 14, ACCEPTED\_RISK 4, NEEDS\_DECISION 4 (the Copilot auto-approve workflow's trust boundary, the shared GCP firewall rules, the updater's compose checksums, the Manager client's `localhost:*` redirect URIs).

**Files:** [`install.sh`](https://github.com/labsai/EDDI/tree/main/install.sh), [`gcp/provision-vm.sh`](https://github.com/labsai/EDDI/tree/main/gcp/provision-vm.sh), [`seed-demo-agent.sh`](https://github.com/labsai/EDDI/tree/main/src/main/docker/seed-demo-agent.sh), [`ci.yml`](https://github.com/labsai/EDDI/tree/main/.github/workflows/ci.yml), [`loadtest.py`](https://github.com/labsai/EDDI/tree/main/scripts/loadtest/loadtest.py), [`stream_driver.py`](https://github.com/labsai/EDDI/tree/main/scripts/loadtest/drivers/stream_driver.py), [`monitoring-stack.yaml`](https://github.com/labsai/EDDI/tree/main/k8s/overlays/monitoring/monitoring-stack.yaml), [`InfraReviewHardeningTest.java`](https://github.com/labsai/EDDI/tree/main/src/test/java/ai/labs/eddi/deploy/InfraReviewHardeningTest.java)

***

## 🔒 fix(llm): agent-findings batch llm-impl — streaming suppression, linear reference escaping, budget accounting, rebinding re-checks (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-llm-impl`)

### What changed and why

Verified the 39 CodeRabbit agent findings against `modules/llm/impl/**` (scans of 2026-10-26 … 11-02) on current `main`. Verdicts: 10 fixed here, 17 already fixed (#1160, #1163, #1190, #1192, #1194), 8 accepted risk (documented residuals), 4 need a decision.

* **`addToOutput: false` no longer streams the raw answer.** The plain legacy branch built a streaming model and handed it the caller's event sink even when the task suppresses its raw output, so intermediate tokens reached an SSE caller before `postResponse` chose what to show. Such a task now takes the plain, buffered path (`LlmTask`).
* **Configuration-reference escaping is linear.** `escapeConfigReferenceMentions` ran `CONFIG_REF_MENTION.replaceAll`, which re-scans to the end of the value from every unclosed `{vault:` opener: an editor-written prompt full of them cost quadratic CPU on every turn, before any template limit. It is now a forward scan with the same matches; a mention is copied literally (the regex replacement also read `$`/`\` in a mention as group references).
* **An enforced tool budget is charged even with `enableCostTracking: false`.** The ceiling is checked against the cost tracker, but turning tracking off also stopped charging it, so the ceiling never moved. A task with an enforced `maxBudgetPerConversation` now always records the charge (`ToolLoopRunner`), a `summarize` truncation's model call included.
* **An endpoint key the builder does not read no longer skips its default's `allowedHosts` check.** `ChatModelRegistry` returned as soon as any endpoint-like key was set, so an `endpoint` value on an OpenAI-compatible preset (which reads `baseUrl` only) let the `region`-selected URL through unchecked. The builder's default is now checked whenever it reports one.
* **Self-conversation check decodes JSON.** The raw-argument fallback compared the serialized arguments with the conversation id; an id written with a JSON unicode escape passed the check and was decoded by the executor. The arguments' string values are now checked after JSON decoding as well (`ToolLoopResumer`, live and resume path).
* **Mistral and Gemini embeddings and the Chroma store re-check their destination per request.** They now use `BoundedJdkHttpClient` with the outbound policy, like OpenAI/Ollama embeddings (DNS rebinding on cached clients).
* **A MongoDB connection string's `proxyHost` is checked** like its seeds — for SSRF and as an `allowedHosts` destination; the driver dials the proxy and sends it `proxyUsername`/`proxyPassword`.
* **An invalid Chroma `apiVersion` no longer echoes its value** (resolved vault references reach this message in RAG search responses and ingestion status).
* Docs: [`security.md`](https://docs.labs.ai/security-and-compliance/security.md) (DNS-rebinding table, cost tracking) and [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md) (`allowedHosts` scope).

### Design decisions

* Fixed-vendor defaults (OpenAI, Anthropic, Mistral … with no endpoint key) stay unchecked against `allowedHosts`, as `secrets-vault.md` documents: the destination is a vendor host, not one the editor controls. Changing that is a contract change (every builder would report its fixed host, and existing secrets whose list omits the vendor host would stop working).
* The per-request re-check is a pre-send check with the documented cache-expiry residual, not address pinning: the JDK client has no resolver hook.

### Needs a decision (not implemented)

* **Jlama loader** (`jlama-core` 0.8.4): header allocation before a bounds check and unchecked shard paths in a downloaded index. Options: an operator allow-list of Hugging Face repositories for `jlama`, waiting for an upstream fix, or disabling `jlama` by default.
* **Elasticsearch (and other) store transports are not closed** when the store cache is invalidated; each secret or variable change followed by a rebuild leaves a live REST client behind. Options: share transports per endpoint/credential like the pooled `MongoClient`s, or close retired stores after a grace period.
* **HITL resume fallback** rebuilds messages from memory (which holds the input as sent) when the paused transcript was omitted, without re-running the task's input guardrails. Options: re-run the input guardrails on the rebuilt messages, or refuse model continuation when the screened transcript cannot be restored.

**Files:** [`LlmTask.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmTask.java), [`ChatModelRegistry.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ChatModelRegistry.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`ToolLoopResumer.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopResumer.java), [`EmbeddingModelFactory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/EmbeddingModelFactory.java), [`EmbeddingStoreFactory.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/EmbeddingStoreFactory.java)

***

## 🔒 fix(llm): agent-findings batch llm-tools — tool rate limit, memory ownership and erasure, selector and PDF work bounds, guardrail number parsing (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-llm-tools`)

### What changed and why

The 29 CodeRabbit "agent findings" filed against `modules/llm/tools/**` and `modules/llm/guardrails/**` (scans of 2026-10-26 … 11-02), each re-traced through the current code. Many were already closed by #1160, #1163, #1192 and #1194; the ones still live after those are fixed here:

* **`enableRateLimiting: false` no longer skips the operator's deployment-wide limit.** The flag turned off the whole admission call, so an agent designer's task setting opted out of `eddi.tools.ratelimit.global.*`. It now skips only the task's own per-conversation limit (`ToolRateLimiter.refusedByGlobalLimit`, same bucket, cluster-aware). Documented in [`langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md) and [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md).
* **`forgetFact` no longer deletes another agent's `global` memory.** Read visibility was treated as permission to delete, so an agent could delete a foreign global key and then write it again with its own value — the replacement `rememberFact` refuses without `allowGlobalKeyOverwrite`. The same rule now applies to deletion ([`user-memory.md`](https://docs.labs.ai/architecture-and-concepts/user-memory.md)).
* **An update in `rememberFact` cannot recreate a memory a GDPR erasure just deleted.** Updates go through the update-only compare-and-set `replaceIfUnchanged` first; when that no longer applies, the inserting write runs and counts as an insert, so the existing post-write cancellation check takes it back.
* **`extractWithSelector` refuses positional pseudos on a page too wide for them.** jsoup's `:eq`/`:lt`/`:gt`/`:nth-*`/`:*-of-type`/`:only-child` walk every sibling of every candidate — quadratic in one parent's width, CPU the parse timeout cannot interrupt. With such a pseudo in the selector, a page whose sum of squared child counts exceeds 50 million is refused with a message; ordinary tables are unaffected.
* **PDF tool extraction has the ingestion extractor's two missing bounds**: unfiltered page-content references are charged to the decode budget before PDFBox parses them (`PdfTextExtractor.chargePageContents`, now public), and glyph layout stops at the character cap plus slack instead of holding millions of glyphs before the cap is applied — the text laid out so far is kept.
* **The expression guardrail compares against the real downstream number reading.** Both of its readers parsed numbers exactly, so a value only exact parsing refuses (`1e2147483648`) made both skip the same earlier object and agree on a later one while the task's double-based conversion took the earlier. The tolerant reader is now the default mapper, compared number-aware.

### Verdicts

FIXED 9 · ALREADY\_FIXED 14 · ACCEPTED\_RISK 1 · NEEDS\_DECISION 5 · FALSE\_POSITIVE 0.

Open decisions (not implemented): process-local tool budget lost on cost-tracker eviction (two findings); quota refunds read failure from result text; `converse_with_agent`'s per-task count resets on a HITL resume; dynamic-agent USE checks treat a `/v1` shared-key conversation's self-asserted user id as a verified principal. The `OutboundHttp` DNS-rebinding residual (a blind request before the post-connect re-check) stays the documented accepted risk in [`security.md`](https://docs.labs.ai/security-and-compliance/security.md#dns-rebinding).

***

## 🔒 fix(secrets): agent-findings pass over the vault, grant checks, redaction and connections (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-secrets-connections`)

### What changed and why

The 45 CodeRabbit "agent findings" filed against the secrets vault, the grant and host checks, the redaction layer and connections were each traced through the current code. Most had already been closed by the October hardening rounds; nine were still real and are fixed here.

* **Space-membership check could miss a tenant** ([`VaultGrantChecker`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/VaultGrantChecker.java)). Tenant discovery used one scanner for `${vault:` and `${vars:`, so a malformed opener of one namespace (`${vars:a${vault:t.finance…/key}`) swallowed a real reference of the other into a single bogus tenant, while the runtime resolved the inner reference with its own rules. Vault tenants now come from a vault-only scanner and variable tenants from `GlobalVariableResolver.VARS_PATTERN`, the grammar the resolver uses (made public for this).
* **Rotation racing a delete** ([`VaultSecretProvider.store`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/impl/VaultSecretProvider.java)). A rotation whose row vanished was turned into a create, and the create checks its endpoint runs had been skipped. The Manager's rotate call, which restates the agent grant but no host list, re-created the key sendable to any host. The rotation now fails and writes nothing.
* **Stale conditional grant edit** ([`RestSecretStore.updateGrant`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/rest/RestSecretStore.java)). With `expectedAllowedAgents` and `allowedHosts` together, the host list was committed before the precondition was checked, so a stale request answered 409 "nothing was written" after it had changed where the key may go. The precondition is now checked before the host write. An edit landing in the moment between that check and the grant write is still refused by the conditional grant write, after the hosts. One atomic operation for both lists would need a new persistence operation on both backends.
* **Linear unresolved-reference check** ([`CredentialReferenceResolver`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/connections/CredentialReferenceResolver.java)). The last `find()` over a `[^}]*` reference regex in the area, run on decrypted credential text, was quadratic on unterminated openers. It is replaced by an exact linear equivalent.
* **Read redaction** ([`ConfigSecretRedactor`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/ConfigSecretRedactor.java)). A numeric value in an embedded `customHeaders` / `customQueryParams` map is judged like a string. A JSON request body has every literal under a credential-named field masked whatever its length, because the shape scan's eight-character floor left `{"password":"hunter2"}` legible to editors. Only one whole JSON document is re-serialized, never a prefix.
* **Long non-JSON text** ([`SecretRedactionFilter`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/SecretRedactionFilter.java)). The 1 MiB bound that assumes a JSON carrier now applies only to text that could be JSON. Text that cannot be JSON keeps apostrophe-quoted passwords whole across an embedded double quote.
* **Export scrubbing** ([`SecretScrubber`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/secrets/sanitize/SecretScrubber.java)). The additional query-name rule (`key`, `sig`, …) now also judges the percent-decoded name on both export branches, so `%6Bey=` no longer survives export.

Docs: [`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md) (rotation racing a delete, the grant precondition and host lists) and [`security.md`](https://docs.labs.ai/security-and-compliance/security.md) (JSON body masking).

### Verdicts (45 findings)

FIXED 9 · ALREADY\_FIXED 27 · ACCEPTED\_RISK 6 · NEEDS\_DECISION 2 · FALSE\_POSITIVE 1.

* **Accepted (documented):** the connections master switch does not stop `${connection:…}` resolution ([`connections.md`](https://docs.labs.ai/protocols-and-integration/connections.md)). Unreadable or absent grant metadata is allowed at deploy time, with the grant checked at creation instead, and a deployment racing a secret's creation is a named gap ([`secrets-vault.md`](https://docs.labs.ai/security-and-compliance/secrets-vault.md#what-counts-as-granted)).
* **Open:** whether an OAuth service grant should carry the connection's immutable id, so that a stale configuration minting during a delete and re-create cannot store its token under the successor. And whether GDPR erasure should report the auto-vaulted-secret step incomplete when the vault is disabled (no master key) but secret rows remain.

### Design decisions

* No runtime per-agent grant check was added. `VaultGrantChecker`'s class Javadoc records why resolution time is the wrong place, and the race findings that ask for one are accepted as documented.
* The rotation now prefers "the delete wins" over re-creating the key. A re-create would have to repeat every endpoint check (host list, deployed-agent impact) inside the provider, which knows neither the mode nor the deployments.

***

## 🔒 fix(manager): agent-findings batch for the Manager and Chat UI (2026-11-03)

**Repo:** EDDI (`fix/agent-findings-ui`)

Verified 19 findings from the CodeRabbit agent-findings export against the current code. Most had already been closed by the review-fix PR #1200; the rest are fixed here.

### What changed and why

* **Per-call approval decisions survive a `__proto__` call id.** `ApprovalBanner` built its `toolDecisions` on a plain `{}`; a provider-chosen call id of `__proto__` re-prototyped the object, the reviewer's explicit rejection vanished from the JSON, and the backend read the omitted call as approved. The dictionary now has no prototype.
* **Secret rotation no longer restates the grant.** `rotateSecret` sent the grant and description read just before the PUT, so a concurrent revocation could be put back (last-writer-wins). Both backends keep an omitted grant and description on an update (`VaultSecretProvider.store`, `MongoSecretPersistence.secretWrite`, the PostgreSQL upsert), and the Manager is bundled with the backend that does, so the PUT now carries the value only.
* **Operator gate verification refuses exemptions it cannot judge.** `ToolApprovalGate.addressesOf` matches a call by `http.<method>:<path>`, `<source>:<name>` and the bare name, so an `exempt` entry or `AUTO_APPROVE` rule such as `deployAgent` or `http:*` could un-gate a write while the Manager certified the gate. `gateLooksInstalled` now accepts such an entry only when it fixes a read method (`http.get:`, `http.head:`, `http.options:`) or a non-`http` source literally; anything else is refused (the safe direction: write scope withheld, or a warning on a created agent). `operator-revision.json` is not bumped: neither the system prompt nor the allow-list changed.
* **Hostile-input bounds in the group transcript and diff viewer.** The markdown autolink matcher stops at the next `<` and is bounded (it ran to the end of the text from every opener); the JSON repair of malformed task arrays is a single forward pass that tracks string and escape state (a regex retried from every escaped quote); `reindentJsonText` caps printed indentation at 64 levels (N openers printed N lines of up to N levels) and trims a trailing-comma line by hand instead of with a regex scanning the whole output on every closer.

### Verdicts (19)

FIXED 6; ALREADY\_FIXED 11 (by #1200: the diff-viewer budget, JSON pretty-print bounds, markdown destination, indented-run and verification-line bounds, selective export, conversation/agent binding, erasure cache sweep, latest-version matching, operator pause binding, and the every-write-method gate check); ACCEPTED\_RISK 2 (`fc72ab76`, `96a089e2`); FALSE\_POSITIVE 0; NEEDS\_DECISION 0. The URL-token adoption in the chat widget is off unless the operator sets `eddi.chat.url-token.enabled` and is documented as a residual login-CSRF risk; the release check's `Origin` header cannot be suppressed by a cross-origin fetch and the card says so (a same-origin proxy would be a new backend endpoint).

**Files:** [`approval-banner.tsx`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/components/hitl/approval-banner.tsx), [`secrets.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/app-kit/src/lib/api/secrets.ts), [`operator.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/api/operator.ts), [`group-utils.ts`](https://github.com/labsai/EDDI/tree/main/ui/packages/conversation/src/team/group-utils.ts), [`reindent-json.ts`](https://github.com/labsai/EDDI/tree/main/ui/manager/src/lib/reindent-json.ts)

***

## ✨ feat(hitl): config-driven context on approval cards (2026-11-03)

**Repo:** EDDI (`feat/approval-card-context`), stacked on `feat/hitl-edit-on-approve`

### What changed and why

An approval card said *that* something was waiting and *why*. For a decision that is more than "run it" — publish this post, send this reply — the approver also needs the thing itself. `approvalContext` lets the agent or group designer say what to show: short templates over the conversation's own data, rendered **once, when the pause is committed**, and served unchanged on every surface.

* **Config** — `hitlConfig.approvalContext` (agent, at most 8 blocks), `toolApprovals.rules[].context` (at most 4, with `call.*` = the one gated call the rule matched) and the group `hitlConfig.approvalContext` (at most 8, with `group.*`: the phase, members, transcript, `lastByRole`/`lastByType`/`lastBySpeaker`, tasks awaiting approval and shared artifacts). A block is `{label, template, maxChars}` ([`ApprovalContextBlock`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/model/ApprovalContextBlock.java)). All optional; absent config renders nothing, stores nothing and leaves the Slack card byte-identical.
* **Save-time validation** — [`ApprovalContextValidation`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/ApprovalContextValidation.java) from `HitlConfigValidation`, so every store and the ZIP import refuse a bad block with a 400 that names it: limits, a template that does not parse on the restricted runtime engine ([`RuntimeTemplateParseCheck`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/templating/impl/RuntimeTemplateParseCheck.java), extracted from `TemplateSyntaxMigrator`, which now delegates to it), the `vault:`/`eddivault:`/`connection:`/`caller:` namespaces (they would print a secret's name on a card), and `call.*` outside a rule.
* **Rendering** — [`ApprovalContextRenderer`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/context/ApprovalContextRenderer.java) (regular conversations and rule blocks per gated call) and [`GroupApprovalContextRenderer`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/context/GroupApprovalContextRenderer.java), on a dedicated restricted `TemplatingEngine` with a 500 ms / 16,000-character / 2,000-iteration budget per block and 8,000 characters in total. Reference tokens become `[secret]`, `SecretRedactionFilter` runs, and tool arguments come only from `argumentsRedacted` — `argumentsRaw` is never read. A block that throws, times out or exceeds a limit becomes an item with an `error` and **never fails or delays the pause**.
* **Persistence** — one field, `hitlApprovalContext` ([`RenderedApprovalContext`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/context/RenderedApprovalContext.java): items, `truncated`, a SHA-256 `digest`), on the conversation snapshot and the group conversation. Written at the single pause-commit hooks (`ConversationHitlService.populateHitlTimeoutBookmark`, `GroupHitlCoordinator.commitPause` and the restore after a failed group resume), overwritten by a re-pause, cleared with the bookmark in memory, in the MongoDB and PostgreSQL stores and on every group resume/reject/cancel/fail. The raw conversation read strips it.
* **Surfaces** — `approvalContext` on REST `approval-status` and MCP `get_approval_status` (one shared [`ApprovalContextViews`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/context/ApprovalContextViews.java), re-redacted at serve time; the MCP summary map is now `Map<String,Object>`, its existing values unchanged), on the group approval-status (REST and MCP) and on the group conversation read.
* **Slack** — [`SlackApprovalContextBlocks`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/SlackApprovalContextBlocks.java) inserts the blocks before the `actions` block (which stays last), as `plain_text` (so no mention, link or bold spoofing), within Slack's 50-block budget ("+N more context items — open in Manager"). Because everyone in the approval channel sees a card, the channel needs `platformConfig.hitlApprovalContext = "true"`; without it the card gets one line, "More context available in the Manager". A card that carries context is posted with `unfurl_links`/`unfurl_media` off (`SlackWebApiClient.postBlocksMessage(…, unfurl)`); cards without context are posted by the unchanged call. `HitlPauseEvent` gains a `@JsonIgnore approvalContext` component and keeps its old constructors.
* **Manager** — `ApprovalContext` shows the items as plain text (`whitespace-pre-wrap`, never markdown or HTML) above the decision on the Approvals page, the conversation page and the group discussion; a block editor (`ApprovalContextEditor`) in the agent's Human-in-the-Loop section and in the group approval editor, with the same limits shown as the author types. New keys under `approvalContext.*` in all 11 locales.
* **Docs and metrics** — new page [HITL Approval Card Context](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-approval-context.md) (config, the data model, the audience table, validation, Slack), linked from `hitl.md`, `group-conversations.md`, `security.md` and `SUMMARY.md`; `eddi_hitl_approval_context_render_total{outcome,surface}` in `metrics.md` and on the Full Metrics Reference dashboard (panel 420); two properties in the configuration reference. The operator and MCP follow-up is in [`planning/operator-followups/approval-card-context.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/approval-card-context.md).

### Not in this change

* No Platform Operator edits and no new MCP tools (both go to the combined follow-up).
* The Manager's tool-approval editor has no rule editor, so `rules[].context` is written in the agent's JSON.
* No `hitl.draft` template root: this branch does not resolve a rule pause's draft for templates.
* Stacked on `feat/hitl-edit-on-approve`: merge after it. Expect a trivial conflict with the approval-analytics branch in the Full Metrics Reference dashboard's HITL row and in `GroupConversation`/`HitlConfig` field lists.

***

## 🐛 fix(cluster): leases stop trusting themselves, survive lost replies, and cost fewer round trips (2026-11-03)

**Repo:** EDDI (`fix/cluster-lease-validity`) — workstream A of the cluster production-readiness review (`planning/cluster-production-readiness-review.md`, findings A1, A2, A11, D1–D5, D7, and the lease part of C12).

### What changed and why

**A1 — a holder cut off from NATS stops itself.** A renewal that could not reach NATS used to be ignored forever (`KvLeaseManagerTest.heartbeatIoFailureKeepsLease` asserted it), so a partitioned holder kept running — LLM calls, tools, the unfenced user-memory upsert, a 200 to its client — after another node had taken the conversation over at `lease.ttl`. A lease is now trusted for `ttl − 2 × heartbeat` (10 s by default) after the last renewal NATS *acknowledged*, counted from when that renewal was *sent*, so the server-side TTL always ends later. Past that `LeaseHandle.isLost()` is true at once and the lost callbacks fire (from the tick every quarter heartbeat, or from `isLost()` itself, on the I/O executor). The test is rewritten to assert the new contract. Contract for the turn side (WS-B): check `isLost()` before the user-memory upsert and before delivering the reply.

**A2 — a write applied on the server whose reply was lost.** Every lease value now carries a lease id (`lid`) unique within the process. A renewal that conflicts re-reads the key from the stream leader: if it still holds this lease (same node, boot and `lid`), an earlier renewal landed although its reply timed out — the lease is kept at the revision found (`eddi_cluster_lease_adopted_total{op="renew"}`) instead of cancelling a healthy turn. An acquire that finds its own `lid` adopts the lease its timed-out create wrote; a lease of this process that nobody here holds (an acquire that gave up) is deleted instead of blocking the conversation for the TTL — this node included. `release()` of a lost handle now still deletes the key when it is provably still this lease.

**A11 — waiter markers and peek.** A granted waiter deletes its `w.<key>` marker by compare-and-set at the revision it wrote, so another node's marker survives; a waiter that times out, is drained or shut down removes its own. New `IConversationLeaseManager.peekStrict` / `peekKeyStrict` throw `ClusterUnavailableException` instead of reading an outage as "no lease" (for `ClusterHitlRecovery.eligible`, owned by WS-B).

**D1 — fewer round trips.** Acquire reads the key's last record (`ISharedKv.latest`, which also returns a delete marker's revision) and writes at that revision: 2 round trips instead of jnats' 3 for a `create` on a deleted key. Release is one guarded delete that returns the marker's revision (`deleteReturningRevision`); the unconditional waiter-marker read and the broadcast are gone. An uncontended turn's lease went from about 6 to 3 round trips; a waiter woken by a release acquires with 1.

**D2 — contention.** The coordinator hands a healthy lease straight to the next turn of the same conversation queued on this node (`IConversationLeaseManager.handOver`: no I/O, refused when less than a heartbeat of validity is left, when another node is known to wait, or after 16 handoffs in a row). The waiter poll is capped at 500 ms (250–750 ms jittered; it was 2.5–7.5 s at the default TTL).

**D3 — reopen storm.** `NatsSharedKv` reopens a bucket handle once, under a lock, for all the callers that failed on it; it never drops a handle younger than 1 s or on a full outgoing queue / closed connection, and a failed open is not retried for 250 ms.

**D4 — heartbeats at scale.** At most 64 renewals in flight, least recently confirmed first; each lease is renewed when 3/4 of a heartbeat has passed since its last renewal, from a tick every quarter heartbeat, so thousands of leases no longer go out in one burst.

**D5 — stale-lease sweep.** Runs once per process (leases of an earlier boot cannot appear after it started), with one watch instead of a read per key — no more whole-bucket scans on every node at every reconnect.

**D7 — release notifications.** A waiter tells the holder's node that it waits (`<root>.lease.to.<nodeId>`, core NATS, repeated with each poll); the holder addresses the release only to those nodes, with the delete marker's revision. The cluster-wide broadcast is kept only for an administrative force-release.

**C12 (lease part).** `eddi_cluster_lease_acquire_seconds` (every outcome × contended), `eddi_cluster_lease_lost_total` (every reason), `eddi_cluster_lease_adopted_total` and `eddi_cluster_degraded_decisions_total{area="turns"}` are registered at construction, so `increase()` sees the first occurrence on each pod.

### Rolling upgrade: why old and new nodes keep mutual exclusion

* **Acquisition stays create-if-absent.** The new acquire is a compare-and-set at the revision of the key's last record, which succeeds only while the key holds no live value — the same server-side check jnats' `create` makes. An old node's `create` and a new node's write race on the one stream leader; exactly one wins. `LeaseProtocolIT.earlierVersionInteroperates` runs both against real NATS.
* **The delete marker is jnats' own.** `deleteReturningRevision` publishes the `KV-Operation: DEL` marker with `Nats-Expected-Last-Subject-Sequence`, exactly as jnats' `delete(key, revision)` does, only keeping the acknowledgement's sequence; old nodes read it as a deleted key.
* **The value only gains a field.** `lid` is ignored by old nodes, which read `node`, `boot` and `since` as before. A new node treats a value without `lid` as somebody else's lease, so it never adopts or deletes an old node's lease as its own.
* **Takeover rules are unchanged** (presence, boot id, three unchanged heartbeats); renewals and releases stay compare-and-set on the revision.
* **Notifications are hints.** Old nodes still broadcast on `lease.released.<key>`, and new nodes still listen there. New nodes no longer broadcast a plain release, so an old node waiting for a lease a new node releases falls back to its poll (`ttl/4`, 5 s by default) until it is upgraded, and a new holder does not see an old waiter's marker when it decides to yield or hand off — fairness toward old-version waiters is weaker for the length of the upgrade. Neither affects mutual exclusion or the fence.

### Tests

`KvLeaseManagerValidityTest` (A1, A2, A11), `KvLeaseManagerScaleTest` (D1, D2, D4, D5, D7, C12), `NatsSharedKvReopenTest` (D3), two handoff tests in `ClusterConversationCoordinatorTest`, and `LeaseProtocolIT` against a real NATS: the delete-marker round trip, interoperation with an earlier version's jnats `create`/`delete`, a renewal and a create applied on the server whose replies are reported as timeouts, and addressed release notifications with no broadcast. Rewritten: `KvLeaseManagerTest.heartbeatIoFailureKeepsLease` (now `…KeepsLeaseOnlyUntilItsValidityRunsOut`).

**Files:** [`KvLeaseManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/lease/KvLeaseManager.java), [`NatsLeaseManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/lease/NatsLeaseManager.java), [`IConversationLeaseManager.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/lease/IConversationLeaseManager.java), [`ISharedKv.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/ISharedKv.java), [`NatsSharedKv.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/NatsSharedKv.java), [`InMemorySharedKv.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/cluster/InMemorySharedKv.java), [`ClusterConversationCoordinator.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/ClusterConversationCoordinator.java); docs: [`clustering.md`](https://docs.labs.ai/deployment-and-infrastructure/clustering.md), [`configuration-reference.md`](https://docs.labs.ai/deployment-and-infrastructure/configuration-reference.md), [`metrics.md`](https://docs.labs.ai/deployment-and-infrastructure/metrics.md).

### Not done here

* The turn side of A1 (checking `isLost()` before the user-memory upsert and the reply) and the switch of `ClusterHitlRecovery` to `peekStrict` belong to WS-B.
* D2's "load memory after the lease is granted" and the reference ingress configs' consistent hashing are outside this workstream.
* Sharding `LEASES` by hash prefix (D3–D5 plan item) is not attempted.

***

## Clear the Guava advisory flagged by Scorecard; OpenTelemetry blocked on Quarkus (2026-11-03)

**Repo:** EDDI, branch `fix/dep-advisories-guava-otel`

**What changed** (`pom.xml`, `dependencyManagement` only): `com.google.guava:guava` 33.6.0-jre -> 33.7.2-jre, for GHSA-xxph-c9ww-hj94 (uncontrolled memory allocation when `CompactHashMap`, `CompactHashSet` or `MapMakerInternalMap` is deserialized). Pulled in by `langchain4j-qdrant`. Not reachable from a known code path; fixed because OpenSSF Scorecard counts advisories regardless of reachability.

**Not fixed - GHSA-ccrj-gw8r-854m** (quadratic CPU in W3C `tracestate` parsing, `opentelemetry-api` <= 1.66.0, fixed in 1.67.0). Quarkus 3.40.1.1, the latest platform, manages OpenTelemetry at 1.62.0, and 1.67.0 cannot be forced in either shape; both were tried and both fail at startup (Backend E2E caught the first, a local boot the second):

* Whole family at 1.67.0 (BOM imports): `NoSuchMethodError: io.opentelemetry.exporter.internal.ExporterBuilderUtil.validateEndpoint(String)`, because `quarkus-opentelemetry` calls an internal exporter method that 1.67 changed.
* API line only (`opentelemetry-api`, `-context`, `-common`) at 1.67.0 with SDK and exporter at 1.62.0: `NoClassDefFoundError: io.opentelemetry.api.internal.ConfigUtil`, which 1.67 removed and the 1.62 SDK still uses.

Neither showed up in the unit tests run locally (the tracing, style and repo-guard tests; the full suite was not run), so only a real boot shows it. Revisit when a Quarkus platform manages OpenTelemetry 1.67.0 or later. Until then the exposure is a long inbound `tracestate` header; capping header size at the proxy (or `quarkus.http.limits.max-header-size`) bounds it.

The `minimatch` advisory (GHSA-g3hv-75wg-m249, dev tooling only) is handled in a separate PR.

***

## 🐛 fix(groups): a caller without access to a group gets 403 from the workspace endpoints, not 500 (2026-11-03)

**Repo:** EDDI (`fix/group-workspace-forbidden`)

### What changed and why

`RestGroupWorkspace` (`readWorkspace`, `readBacklog`, `addBacklogTask`, `addCadence`, `deleteCadence`) calls `ResourceAccessGuard.requireAccess` inside a `try` whose last `catch (Exception e)` logs and answers 500. The guard denies with `io.quarkus.security.ForbiddenException`, so a caller without access to the group received a 500 and an error log line instead of 403. Each of the five methods now catches `ForbiddenException` ahead of the generic catch and rethrows it, so Quarkus maps it to 403.

`RestGroupWorkspaceTest` gains `everyEndpoint_accessDenied_propagatesForbidden`, which makes the guard throw the real Quarkus type for each of the five endpoints. Mutation-checked: with the new catch removed the test fails because the endpoints answer 500 instead of throwing.

***

## ✨ feat(hitl): approval analytics, sampled audit and earned autonomy (2026-11-02)

**Repo:** EDDI (`feat/approval-analytics-autonomy`, stacked on `feat/hitl-edit-on-approve`)

### What changed and why

Approval gates have a capacity: a gate that asks about everything gets rubber-stamped. This puts human attention where it matters — see [HITL Oversight](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-oversight.md).

* **Config** — one nested field, agent-level `hitlConfig.oversight {sampledAudit, autonomyPolicy}` ([`OversightConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/model/OversightConfig.java)), validated on every save and import by [`OversightConfigValidation`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/OversightConfigValidation.java) (one line in `HitlConfigValidation`). Absent = nothing sampled, nothing recommended or suspended.
* **Approval analytics** — `ApprovalDecisionProjector` observes F3's `HitlDecisionRecorded` (`@ObservesAsync`) and stores one row per decided unit in a new `approval_decisions` store (MongoDB + PostgreSQL), keyed `decisionId#index` so the event and `ApprovalBackfillService` (rebuild from the ledger via `HitlApprovalAudit.parse`; once on first start for 90 days, and `POST /hitl/analytics/rebuild`) never double-count. Pre-6.7 entries become `legacy:` rows that are never evidence. `GET /hitl/analytics/summary` / `decisions`.
* **Sampled audit** — `SampledAuditRecorder` is an `AllowedToolCallObserver` set on `ToolLoopRunner` (a setter, no constructor change) and called after each allowed call in both loops. Deterministic HMAC sampling keyed from the audit key, a per-(agent, category, UTC day) cap through `IToolQuotaStore`, a bounded write queue, card-level redaction. New `audit_samples` store; `/hitl/samples` review queue with one-at-a-time verdicts (CAS, no bulk).
* **Earned autonomy** — `AutonomyEvaluator` and `PromotionPatchBuilder` (pure), `AutonomyService` (apply, dismiss, suspend, lift; demotion from flagged samples and demote-code rejections), `autonomy_state` store, `/hitl/autonomy`. Apply re-checks the evidence, needs the reviewed agent version, validates and writes a new version through `IRestAgentStore` — never deploys.
* **Suspension overlay** — `AutonomyOverlayService` copies the effective tool-approval config with a transient, `@JsonIgnore` `suspendedPatterns` list plus a synthetic `WAIT_INDEFINITELY` rule per pattern (no `ConversationHitlService` edit: "strictest rule wins" does the rest); `ToolApprovalGate` gates an allowed call matching one with `suspended:<pattern>`. Applied in `LlmTask` (memory carrier and effective config), `McpCallsTask`, and carried through `TaskToolApprovalsResolver`'s strict merge. `ToolApprovalGate.firstExemptMatch` tells exempt from unmatched calls.
* **Security** — `X-EDDI-Agent-Call` set last on an httpcall aimed at this deployment only — its own origin (`SelfUrlResolver`), a loopback address or a host in the new `eddi.hitl.oversight.self-hosts`; third-party APIs see no EDDI header and their wire format is unchanged (`AgentCallMarker`, one line in `ApiCallExecutor`); `AgentOriginatedRequestFilter` answers 403 `AGENT_ORIGINATED` to marked oversight writes; `SelfUngatingGuard` delegates to `OversightWriteGuard` (no oversight-API writes, no change to `hitlConfig.oversight`).
* **Maintenance** — `hitl-autonomy-maintenance` system schedule (fast path right after the alerts one in `ScheduleFireExecutor`, reserved in `RestScheduleStore`): sample expiry, round-robin evaluation, retention, the first-start rebuild. Gauges refreshed per node.
* **Manager** — new `/manage/oversight` page (sidebar next to Approvals): analytics tiles and a per-category table with tiers, the sample review queue (one sample at a time, a flag needs a reason code, no select-all), and recommendations (evidence, change list, configuration preview, a second confirmation when the change leaves no gated tool) and suspensions (lift needs a note). `oversight` i18n namespace in all 11 locales; MSW handlers in `oversight-handlers.ts`; OpenAPI snapshot refreshed for the new endpoints.
* **Docs** — new [`hitl-oversight.md`](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-oversight.md); one-line links in `hitl.md`, `audit-ledger.md`, `gdpr-compliance.md`, `SUMMARY.md`; metrics in `metrics.md` and dashboard panels 400–405; properties in `configuration-reference.md`.

### Not in this change

MCP read tools and the Platform Operator (see [`planning/operator-followups/approval-analytics-autonomy.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/approval-analytics-autonomy.md)); the alerts `HITL_AUTONOMY` source and a Slack sample digest; Slack verdict buttons; an `oversight` form in the agent editor (JSON only for now).

**Tests.** The three stores have shared contracts (`OversightStoreContracts`) run against both backends by `MongoOversightStoresIT` and `PostgresOversightStoresIT` (Testcontainers): idempotent insert, window and field filters, compare-and-set review and save, expiry, retention, erasure and the indexes. They compile but were not run on the machine this was built on (no Docker); CI's `verify -DskipITs=false` runs them.

***

## ✨ feat(groups): HUMAN members execute task-force tasks (2026-11-02)

**Repo:** EDDI (`feat/group-human-task-executors`, stacked on `feat/group-human-tiebreak`)

### What changed and why

I6 shipped human group members but refused them in any group with PLAN/EXECUTE/VERIFY phases, because task waves assign and time work on agent latencies. A HUMAN member may now **execute** the tasks assigned to them; planning and verifying stay with agents.

* **Engine** — the EXECUTE wave loop (`TaskForceEngine`) filters HUMAN-assigned tasks out of its waves. When no agent task is left but a human task is executable, it throws the existing `HumanTurnRequired` for the highest-priority one ([`GroupHumanTasks`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupHumanTasks.java)), now carrying a `HumanRequestDetail` of kind `TASK`, which the phase dispatch commits as the usual I6 pause. `GroupHitlCoordinator.resolveHumanTurn` applies the answer to the task inside the same compare-and-swap (complete, or submit for approval under TASK-granularity HITL; a `SKIP_TURN` timeout fails it) and puts it back on a rolled-back resume; the resumed wave loop runs its dependents. A human task is a turn and costs $0. A VERIFY rework re-runs EXECUTE with human pauses disabled and skips HUMAN-assigned tasks (they stay FAILED, with a note).
* **Assignment** — round-robin never picks a HUMAN member (`TaskListParser.roundRobinAssign` and `TaskForceEngine.resolveAssignee("ALL")`); explicit `ROLE:` / principal assignment, agent-filed tasks and the planner (told which members are human) still can. Bidders were already agents only.
* **Save time** — `AgentGroupStore.humanMemberProblems` no longer refuses task phases; it calls `GroupGapsValidation.humanTaskForceProblems`, which refuses a HUMAN planner/verifier (the moderator, or the first member by speaking order without one) in a group with PLAN or VERIFY phases. `targetEachPeer` phases and nested groups containing humans stay refused.
* **Surfaces** — the summaries' `pendingKind: TASK` / `pendingTaskId` (from the tie-break PR), a Slack task notice, and in the Manager a task variant of the human-turn banner (subject and description) plus a **Task** inbox badge; new i18n namespace `groupHumanTasks` (11 locales).
* **Docs** — [Group Human Decisions](https://docs.labs.ai/conversations-and-orchestration/group-conversations/group-human-decisions.md) gains *Humans as task-force executors*; [Group Conversations](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md) points there from the human-member bounds and the TASK\_FORCE section.

### Not done

* The save-time warning for a standing-team cadence whose `eddi.groups.cadence.claim-ttl` is shorter than the human turn timeout: the TTL is a deployment property the group store cannot see. The docs say to keep `turnTimeout` well inside it.
* Reassigning an unanswered human task to an agent, and humans as bidders.

### What's next

Operator/MCP follow-up: [`planning/operator-followups/group-human-task-executors.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/group-human-task-executors.md). Rides schema v5 from the tie-break PR (no further bump).

***

## ✨ feat(groups): `tiePolicy: HUMAN_DECIDES` — a named person breaks a tied vote (2026-11-02)

**Repo:** EDDI (`feat/group-human-tiebreak`)

### What changed and why

`HUMAN_DECIDES` was a real enum value that every save refused: a tie that waits on a person needed resume machinery a finished VOTE phase did not have. It now pauses the discussion until the decider chooses, riding I6's human-input path rather than the approval path.

```json
"voteConfig": {
  "method": "MAJORITY", "optionsSource": "EXPLICIT", "options": ["Double down on SEO", "Launch the paid pilot"],
  "tiePolicy": "HUMAN_DECIDES",
  "humanTieBreak": { "decider": "founder@acme.com", "timeout": "PT24H", "onTimeout": "MODERATOR_DECIDES" }
}
```

* **Config** — [`HumanTieBreakConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/HumanTieBreakConfig.java) as an eighth `VoteConfig` component (the seven-argument constructor stays). Save time ([`GroupGapsValidation`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/validation/GroupGapsValidation.java), called from `AgentGroupStore.validateVotePhases` in place of the old throw) needs a resolvable decider (named, or the single HUMAN member), a positive ISO-8601 timeout, and a moderator for `MODERATOR_DECIDES`.
* **Engine** — `PhaseExecutionEngine.recordVoteDecision` records the NONE tally as before and returns a `PendingTieBreak` ([`HumanTieBreakEngine`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/HumanTieBreakEngine.java): decider, prompt from option texts and totals only, choice matching, decision building). `GroupConversationService` pauses on it after the persist and `onPhaseComplete`, after applying a deferred `INSERT_VOTE` and dropping a deferred escalation with a note. [`GroupTieBreakPauses`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupTieBreakPauses.java) commits the pause (`speakerIdx = -1`, `RESUME_KIND_TIE_BREAK`, no turn charged), resolves a choice (validated before any mutation, CAS out of the pause, rollback on executor refusal) into a `vote+human-tiebreak` VOTE record with the losing ballots as dissents, and resumes at the next phase — or pauses for the vote phase's own approval gate. Timeouts: `NO_DECISION`, `MODERATOR_DECIDES` (turn- and cost-gated, one turn) or `ABORT` (the plain ABORT policy, so the timeout handler needs no change). `GroupHitlCoordinator` dispatches to it from `submitHumanInput` and `skipHumanTurnOnTimeout`.
* **Persisted shape** — `PendingHumanInput` gains a `detail` ([`HumanRequestDetail`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/HumanRequestDetail.java): kind, options, taskId, transcriptFrom, timeoutResolution); the nine-argument constructor stays. **Schema v5** (`GroupConversation.CURRENT_SCHEMA_VERSION`), an identity hop, so an older pod refuses a tie-break pause instead of re-running the vote.
* **Surfaces** — REST `HumanInputRequest` gains an optional `choice` (and `content` loses `@NotBlank`; the service keeps requiring it for every other kind); MCP `submit_group_human_input` gains an optional `choice`; the REST and MCP status summaries add `pendingKind`/`pendingOptions`/`pendingTaskId` ([`PendingHumanInputView`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/PendingHumanInputView.java)), the inbox `PendingApprovalSummary` a `pendingKind`; `HumanInputRequestedEvent` carries the `detail`; Slack posts a tie-break notice (still notification-only).
* **Audit and metrics** — one `hitl.approval` entry per resolution: `verdict TIE_BROKEN`, `approvalCategory group.vote_tiebreak`, `reasonCode`, options, choice — and no `decisionOutcome`, because a tie-break is a human turn. Counter `eddi.group.vote.tiebreaks{policy, resolution}`.
* **Manager** — the phase editor enables HUMAN\_DECIDES with decider/timeout/on-timeout fields; the human-turn banner's tie-break variant asks for one option plus an optional rationale; the inbox labels tie-breaks. New i18n namespace `groupTieBreak` (11 locales).
* **Docs** — new page [Group Human Decisions: Tie-Breaks](https://docs.labs.ai/conversations-and-orchestration/group-conversations/group-human-decisions.md); links from [Group Conversations](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md) and [HITL](https://docs.labs.ai/conversations-and-orchestration/hitl.md); the AGENTS.md roadmap row no longer lists HUMAN\_DECIDES as pending.

### Compatibility

Every other tie policy behaves as before. A document without `detail` is a speaking turn; a pending record's `onTimeout` is still `SKIP_TURN`/`ABORT`. The schema bump to v5 collides with any other branch that bumps it — whichever merges second renumbers.

### What's next

Humans as task-force executors (`feat/group-human-task-executors`) reuse `HumanRequestDetail` (`kind TASK`). Operator/MCP follow-up: [`planning/operator-followups/group-human-tiebreak.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/group-human-tiebreak.md).

### Review follow-ups (2026-11-05)

* `AgentGroupStore.validateHumanMembers` now also refuses a nested GROUP member whose VOTE phase uses `tiePolicy: HUMAN_DECIDES`. The parent's turn cancels a nested pause and records `SKIPPED`, so such a tie could never be decided; it now fails at save time, like a nested HUMAN member.
* The Manager inbox reason for a tie-break row is cause-neutral ("Waiting on … to decide the vote", 11 locales): a vote that misses quorum pauses with the same `pendingKind`.
* [Group Human Decisions](https://docs.labs.ai/conversations-and-orchestration/group-conversations/group-human-decisions.md) separates the role check (`eddi-viewer` cannot answer) from the principal check, says the principal check needs authentication, says every new discussion is stamped v5 (an older pod refuses any resume during a rolling upgrade), and that `choice` is required for a tie-break; [MCP Server](https://docs.labs.ai/protocols-and-integration/mcp-server.md) says the same for `submit_group_human_input`.

Review follow-ups (round 3):

* `AgentGroupStore.hasHumanDecidesVote` reads only `VOTE` phases: a `voteConfig` the Manager keeps on a phase whose type was switched never starts a vote, so it no longer refuses the parent that nests the group.
* The Manager inbox reason for a human turn carries `data-testid="human-turn-reason-<id>"` and `data-reason-kind`, and the tie-break test asserts those instead of the English copy.
* [MCP Server](https://docs.labs.ai/protocols-and-integration/mcp-server.md) says a `TIE_BREAK` pause is answered by `humanTieBreak.decider`, a principal who need not be a member; [Group Human Decisions](https://docs.labs.ai/conversations-and-orchestration/group-conversations/group-human-decisions.md) says the audit entry and the counter are written only when the audit ledger and the meter registry are present.

Review follow-ups (round 4):

* Docs: `pendingOptions` appears only for a caller who may read the pending content; the tie-break audit entry records a choice only for a human submission; an `eddi-approver` may answer a tie-break when their own principal is the decider.

***

## ✨ feat(groups): per-team monthly budgets — a calendar-month dollar cap per group, metered from the cost ledger, enforced at the gate and inside the run (2026-11-02)

**Repo:** EDDI (`feat/team-budgets`, stacked on `feat/cost-accounting`)

### What changed and why

Several standing teams share one tenant and one monthly cost budget. One busy team could spend the whole month and leave the others nothing, and nothing said who had spent what. A group can now carry a `teamBudget`; see [Team Budgets](https://docs.labs.ai/security-and-compliance/tenant-quotas/team-budgets.md).

* **Config** — [`TeamBudgetConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/TeamBudgetConfig.java) (`monthlyBudgetUsd`, `onExhausted`, `oversight.teams`) on `AgentGroupConfiguration`, validated at save ([`TeamBudgetConfigValidator`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/TeamBudgetConfigValidator.java), 400), and changeable only by `eddi-admin` while `eddi.groups.team-budget.admin-only-edits=true` (default).
* **Store** — one document per `(groupId, UTC month)` in `team_budget_months` (MongoDB and PostgreSQL twins) holding spend, the month's cap adjustment, a bounded adjustment history and the applied transfer ids; atomic `$inc` / `ON CONFLICT` spend, one conditional update for a debit, 13-month retention.
* **Off when absent** — a group without a `teamBudget` is not metered, gated or ceilinged: no store access, no state on its discussions. `eddi.groups.team-budget.metering-enabled=false` is the global kill switch. Spend before a cap is added is not back-filled.
* **Metering** — [`TeamSpendMeter`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/TeamSpendMeter.java) charges the increase of the root discussion's `gc.totalCost` after each member turn, each nested roll-up and each leg. A nested child charges nothing (its parent pays). Never fails a discussion; an outage is carried to the next charge.
* **Gate** — a new root discussion, a follow-up or a continuation is refused (409) when the team or the tenant has no budget left or the budget cannot be read (fail closed); a cadence fire is skipped, or failed when unreadable.
* **Inside a run** — the team ceiling is written in the discussion's `totalCost` terms ([`TeamBudgetCeilings`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/groups/budget/TeamBudgetCeilings.java)), so the existing `maxCostPerDiscussion` checks enforce it unchanged, with the team's policy and its own transcript text.
* **REST** — snapshot, history, batch listing, set this month's cap, idempotent transfers; reads are VIEW-guarded, money moves are `eddi-admin`, both write the audit ledger.
* **Template values** — `{context.teamBudget}` and `{context.teamBudgets}` (a board's `oversight.teams`, filtered by the discussion owner's view; numbers only).
* **Manager** — a team budget card on the group workspace page (cap/spent/remaining, history), a team table on the Quotas page, and admin-only adjust-this-month and transfer dialogs (transfers send an `Idempotency-Key`); strings in a `teamBudget` namespace in all 11 locales.
* **Metrics** — `eddi_team_budget_{metering,refusals,adjustments}_total`, a Team Budgets dashboard row (the Kubernetes copy is synced).

### Design decisions

* The root discussion's group pays; the ledger delta is the charge. The F1 `ISpendSink` feed was evaluated and not used: it attributes a nested child's turns to the child's group, carries no root, and fires only for tenant-accepted charges, while the in-run ceiling must live in `totalCost` terms.
* The team ceiling excludes its boundary (`Math.nextDown`) so a team at its cap stops instead of taking one more turn.
* One document per team per month (history for a board) rather than the tenant's roll-in-place row.
* 409 for refusals through the existing `GroupDiscussionException` handling; no edits in the hot REST resource.
* Equality exhausts, like the tenant.

### Not done / next

* Deferred to the combined follow-up (`planning/operator-followups/team-budgets.md`): the MCP tools, the Platform Operator grants and prompt text, and a `HandoffAdmission` bean that refuses a handoff to a team over budget (after F2).
* The LLM budget-transfer proposal tool was not built in this change.
* GDPR erasure does not yet pseudonymise the admin principal recorded in a month's adjustment history (the audit-ledger entry carries it as its user id and is covered by the ledger's own erasure).
* No oversubscription warning (sum of team caps above the tenant budget); `limitedBy` shows the tighter limit.

### Review follow-ups (2026-11-05)

CodeRabbit's full review of the merged-with-main head:

* `TeamSpendMeter`: the kill switch now drops a persisted team state at the next leg, so it lifts every in-run ceiling; a state created on a discussion that already spent takes that spend as its baseline (no back-fill).
* `GroupConversation.CURRENT_SCHEMA_VERSION` 4 → 5 for `teamBudgetState`: an older pod re-saving a paused document would drop it, so it must refuse the document instead (identity hop, no migration).
* Follow-ups: `resolveEffectiveCostCeiling` starts a team leg and includes the team ceiling, and the follow-up callback charges the team (`GroupLifecycleOps`).
* Transfers: each step id carries a fingerprint of source, target and amount, so a reused `Idempotency-Key` with another request is refused instead of crediting what was never debited; a retry checks the reversal and credit ids in `appliedTransferIds` before the shorter adjustment history.
* REST and the group-save check read the group with `readConfig`: a store failure is 503 (not 404, not a team silently missing from the listing), and an unreadable stored version makes a `teamBudget` save need admin.
* Manager: the Quotas table shows a read failure with a retry, polls like the card, and a transfer replaces its key after a 4xx; the MSW mock refuses same-team transfers; the card test waits for each response.
* Docs: kill-switch timing, the overshoot of `PARALLEL` phases and task-force waves, retries across a month boundary, the 50-group table limit, and the corrected upgrade note and `TeamBudgetConfig` Javadoc.

Second round of review follow-ups:

* The `teamBudget` edit check treats a group that does not exist as having no cap, so a non-admin's update of a missing id gets the store's 404 instead of a misleading admin-only 403; other store failures still fail closed.
* Manager: a failed background poll of the Quotas table keeps the cached table and any open transfer dialog (and its `Idempotency-Key`) mounted, with a "could not be refreshed" notice and a retry; only a failure with nothing loaded replaces the table.
* Docs: the synthesis-phase overshoot applies only under `SYNTHESIZE_NOW`; `ABORT` runs no synthesis phase.

***

## ✨ feat(llm): `toolCallGuardrails` — guardrails on tool-call arguments before execution (2026-11-02)

**Repo:** EDDI (`feat/tool-call-guardrails`)

### What changed and why

An agent designer can now screen the **arguments** of the tool calls a model asks for — the body of a GitHub comment it is about to post, an e-mail, a handoff brief — with the guardrail types that already screened input and output. Until now nothing looked at what went *into* a tool: `toolResultGuardrails` governs results, and the approval gate only asks a human. A public-posting agent needed "never name a prospect", "no PII", "only approved claims" and a disclosure label enforced before an approver ever saw the call.

```json
"toolCallGuardrails": [
  { "tools": ["mcp:add_issue_comment"], "fields": ["/body"], "type": "regex-filter", "action": "block",
    "parameters": { "patterns": "\\b(acme|globex)\\b" } },
  { "tools": ["mcp:add_issue_comment"], "fields": ["/body"], "type": "disclosure", "action": "redact",
    "parameters": { "text": "— AI-assisted reply" } }
]
```

* **Config** — `LlmConfiguration.Task.toolCallGuardrails`, a list of [`ToolCallGuardrailConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/ToolCallGuardrailConfig.java): a guardrail plus `tools` (tool-approval patterns, the same matcher as `toolApprovals`) and `fields` (JSON pointers with a `*` segment; `""` the whole arguments; absent = every string). Absent or empty: nothing runs.
* **Phase** — `GuardrailPhase.TOOL_CALL` (`tool_call` in audit keys, metric tags and SSE). Every built-in type opts in: `regex-filter`, `pii-redaction`, `max-length`, `prompt-injection`, `judge`, `classifier`, `expression`, `json-object`. The judge's `{output}` is the screened field (`GuardrailModelClient.templateData`, one line).
* **New type `disclosure`** ([`DisclosureGuardrail`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/impl/DisclosureGuardrail.java)) — adds a fixed label, idempotently; `redact` only. Runs on output too.
* **Live path** — [`ToolCallGuardrails`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolCallGuardrails.java), hooked into `ToolLoopRunner` after the call caps and **before** the approval gate. `block` / `reprompt` answer the call with a `NOT_EXECUTED` envelope built from configuration and EDDI vocabulary only (the screened text is never echoed); `redact` rewrites the call in the model's own message, so transcript, trace, pending batch and tool all see the same request. Reprompts are counted per entry per turn from the trace, so a HITL pause does not reset them.
* **Resume** — `ToolLoopResumer` re-screens each approved call, block-only, before the journal claim. Amended calls get every type; unamended ones only the deterministic ones (`screensHistory()`). Journal replays are not re-screened.
* **Engine reuse** — [`ToolCallGuardrailScreener`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/ToolCallGuardrailScreener.java) reuses `GuardrailService`'s resolve/evaluate/emit (four visibility modifiers, no copy); [`ArgumentFields`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/guardrails/ArgumentFields.java) walks and rewrites fields with exact numbers and key order, re-serializing only on change. Caps: 256 fields / 256 KiB per call and entry, 20 model-backed checks per loop run.
* **Cost** — a judge or classifier on arguments is admitted against the conversation ceiling and tenant budget and charged as a priced pseudo-tool call (`toolCallGuardrail`), through [`LoopSideCallSpend`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LoopSideCallSpend.java) — the summarizer's admit-and-charge logic extracted into one shared helper, which the summarizer now uses too.
* **Validation** — save time ([`ToolCallGuardrailConfigValidator`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/guardrail/ToolCallGuardrailConfigValidator.java), 400; strict action, valid patterns and pointers, `disclosure` needs `redact`); deploy time (`ToolCallGuardrailValidation`: parameters by type, unknown or wrong-phase types refused).
* **Self-ungating** — `SelfUngatingGuard` rule 3 now also refuses an approved LLM-config write (body, patch or raw arguments) carrying `toolCallGuardrails`.
* **Metrics** — `eddi.guardrail.triggered{phase=tool_call}` and a new `eddi.guardrail.toolcall.decisions{stage,outcome}`.
* **Manager** — a "Tool-call guardrails" section in the LLM editor (tools and fields per entry, the guardrail side sheet with a tool-call phase), the `disclosure` type in the output list too, and a new `toolCallGuardrails` i18n namespace in all 11 locales.
* **Docs** — new page [Tool-Call Guardrails](https://docs.labs.ai/agent-configuration/langchain/tool-call-guardrails.md); links from `langchain.md`, `hitl.md`, `mcp-client.md`, `metrics.md` and `SUMMARY.md`.

### Not in this change

* Configurable rules on tool **results** (`toolResultGuardrails.rules`, deterministic types only) — follow-up; the shape is in the docs page.
* Agent- and group-level `toolCallGuardrails` inheritance; refusing a full-PUT that *removes* another agent's `toolCallGuardrails` (v1 refuses bodies that carry the field).
* Platform Operator prompt and gate-guard, and MCP tools — see `planning/operator-followups/tool-call-guardrails.md`.

### Review follow-ups

* `SelfUngatingGuard`: a patch `add` or `remove` at an array index at or before a stored task's gate or guardrails, under the same parent, is now refused for both gates and guardrails. Two `remove /tasks/0` operations could otherwise drop a gated `/tasks/1` unseen. Appends (`/-`) and later indexes still pass.
* [Tool-Call Guardrails](https://docs.labs.ai/agent-configuration/langchain/tool-call-guardrails.md) and the dashboard panel no longer read `live/blocked` as "approvals never asked for" or `resume/blocked` as "edits refused". The labels do not separate gated from ungated calls, or edited from unchanged ones.

***

## 🐛 fix(loadtest): the load-test stack admits its plaintext mock LLM to the vault transport check (2026-11-03)

**Repo:** EDDI (`fix/loadtest-vault-plaintext`)

### What changed and why

The `Load Test DB Ops` workflow (check "DB ops per turn") went red on `main` from the 2026-11-03 nightly: `ci-gate-10vu-10t: 0 ok ... errors: app_error=100`. Every turn failed in the EDDI container with `VaultHostAllowlist$HostNotAllowedException: LLM provider 'openai' sends ${vault:...apiKey} to wiremock:8080 over unencrypted http`. #1175 added a separate plaintext-transport check, so a vault secret is no longer sent over `http://` to a non-loopback host unless `eddi.vault.allow-plaintext-remote-hosts=true`, even when the host is listed in `allowedHosts`. The load test points its OpenAI-compatible model at the plain-http mock `http://wiremock:8080/v1` and stores the API key as a vault secret, so every LLM call was refused before it left EDDI. The 2026-11-02 nightly ran before #1175 merged.

Both load-test compose files ([`docker-compose.loadtest.yml`](https://github.com/labsai/EDDI/tree/main/scripts/loadtest/docker-compose.loadtest.yml), [`docker-compose.cluster.yml`](https://github.com/labsai/EDDI/tree/main/scripts/loadtest/docker-compose.cluster.yml)) now set `EDDI_VAULT_ALLOW_PLAINTEXT_REMOTE_HOSTS=true`, the deployment-level opt-in the check documents. The setting still admits plaintext only to a host on the secret's own `allowedHosts`.

### Design decisions

* The opt-in goes on the throw-away benchmark stack, not into the driver: switching the mock to https would measure TLS rather than turns, and the check is correct in production.

***

## ✨ feat(llm): cascade judge grades against the request, MCP on the capped client — langchain4j 1.23 follow-ups (2026-11-03)

**Repo:** EDDI (`feat/langchain4j-1-23-adaptations`)

Dependabot moved EDDI to langchain4j 1.23.0 / 1.23.0-beta33 (#1214) with no code change, and CI passed. EDDI implements no `McpTransport` and uses none of the Jackson 2 MCP methods the release removed (#6824), so nothing broke. This change adopts what the release made possible, and one lesson from its new Confidence Cascade pattern (langchain4j#6765).

### What changed and why

* **The `judge_model` cascade judge sees the request.** It was sent only the answer and asked to rate it, so a fluent answer to the wrong question scored as well as a right one. langchain4j's cascade grades "does the answer fully and correctly address the request?". `ConfidenceEvaluator` now sends the text of the latest user message the step's model saw (8,000 characters at most: a single long text keeps its end, where a templated prompt puts the question; with attachments the typed question is kept whole and the head of the attached text fills the rest) together with the answer, and asks for the probability that the answer is acceptable for the request. With no user text (an image-only message) the judge rates the answer on its own, as before. `CascadingModelExecutor` passes the request from both the legacy and the agent-mode step.
* **`modelCascade.acceptanceCriterion`** (optional string): one sentence an acceptable answer must also meet, added to the judge's instructions. It is langchain4j's `yesWhen` for the same pattern. Only the judge reads it, so `CascadeConfigValidator` warns when it is set without a `judgeModel`. The Manager's cascade editor shows it under the judge model editor (all 11 locales).
* **Untrusted text is data, not instructions.** The request and the answer go to the judge as JSON string values (Jackson-encoded, so neither can close its field), and the system message tells it to ignore instructions and self-reported scores inside them. The author's criterion is trusted config and sits in the system message. The docs now say so plainly: this keeps graded text from posing as instructions, but the grade can still be swayed, so the cascade is a cost/quality trade-off and not a security boundary.
* **MCP runs on `BoundedJdkHttpClient`.** langchain4j 1.23 made the `StreamableHttpMcpTransport` backend pluggable (#6726). The transport now uses EDDI's capped JDK client: a response past `eddi.llm.max-response-bytes` (32 MB) fails instead of being read into the heap whole, and the per-request URL re-check against DNS rebinding moved from the header hook into the client's request guard, which runs before every send. `followRedirects(false)` stays pinned, and `streamingBackpressure(true)` keeps what the transport's own backend set. The cap's error message no longer says "LLM provider", since MCP shares it. This puts MCP on the same client as the LLM builders, not on `OutboundHttp`: the HTTP client consolidation's Phase 3 (a langchain4j `HttpClient` adapter over `OutboundHttp`) is not built yet, and its Vert.x engine is Phase 4. When Phase 3 lands, MCP moves with the builders through this same `httpClientBuilder` hook — the hook the October security review noted was missing.
* **Version stamps.** `docs/rag.md`, `InputTypedEmbeddingModelTest` and `VertexGeminiLanguageModelBuilder` named 1.22. Checked against the 1.23 jars: still only Gemini (and Cohere) declare `INPUT_TYPE`, and the Vertex streaming builder still has no `seed`.

### Tests

`ConfidenceEvaluatorJudgeRequestTest` (6): the request and criterion reach the judge, hostile text stays inside its JSON field, no request means no `request` field, request extraction and its tail truncation. `CascadingModelExecutorToolReplayTest.judgeSeesRequestAndCriterion` covers the executor wiring. `McpTransportResponseCapTest` serves a 40 MB handshake answer from a loopback server; it and `McpTransportRevalidationTest` both fail when the `.httpClientBuilder(...)` line is removed (mutation-checked). In the Manager, two `task-cascade-section` tests cover editing and clearing the field and hiding it for other strategies.

### Considered, not done

* **Skip the judge on a step that is accepted anyway** (the last step, a null threshold). langchain4j never grades its last tier. Here the last step's confidence feeds `audit:confidence`, `cascadeConfidence`, the confidence metric and `returnBestAcrossSteps`, so skipping the call would change what those report. That needs its own decision.
* **A `decision_model` strategy** on langchain4j's `DecisionModel` (OpenAI Decisions API, Ollama): it returns probabilities instead of a number the model writes as text. The API is `@Experimental`, and its token usage goes to a `DecisionModelListener`, outside EDDI's cost accounting. Revisit when it stabilises.
* **The agentic layer** (`ConfidenceCascadePlanner`, decision agents, activation conditions) and AiServices-only features (tool search strategy, `AiServiceInvocationSummaryEvent`): EDDI's orchestration is config-driven and does not use `AiServices`.

***

## Update check is on by default, with a server-side opt-out and a notification (2026-11-03)

**Repo:** EDDI — branch `feat/update-check-default-on`.

**What changed**

* The "is a newer EDDI out?" check used to be browser-only and opt-in (a `localStorage` flag). It is now **on by default** and EDDI itself runs it: `UpdateCheckService` (`engine/updatecheck/`) asks `api.github.com` once a day (first run a minute after boot), compares with `quarkus.application.version`, and raises a notification when the release is newer. The announced version is stored, so a dismissed notice is not raised again by the next day's check or a restart.
* **Two opt-outs.** `eddi.update-check.enabled=false` (env `EDDI_UPDATE_CHECK_ENABLED`, wired through `docker-compose.yml`, `.env.example` and the Helm value `eddi.updateCheck.enabled`, chart 2.14.0) stops it entirely — it is tested before the database is read, so the first check after the first boot is suppressed too — and wins over the Manager's switch, which shows as locked. The Manager's Updates page has the other switch (administrators), stored through the new `ISystemSettingStore` (`system_settings`, Mongo and Postgres), so it holds across restarts, browsers and nodes. `GET/PUT /administration/update-check`.
* **Notification reuses the existing inbox** (`WorkspaceNotifications`): new type `UPDATE_AVAILABLE`, addressed to the shared recipient `system:admins`, which administrators read in addition to their own inbox (with authorization off, everyone is an administrator). The bell no longer requires workspaces; it shows while workspaces or the update check are on.
* White-labelled deployments that did not set `eddi.branding.show-update-check` neither check nor notify.
* Manager: the banner/card read the server's switch instead of `localStorage`; the old key is ignored. `api.github.com` is still the only off-origin host the Manager contacts.

**Design decisions**

* State lives on the backend because only the backend can honour the env var before anyone reaches the UI.
* Platform Operator checked (§4.6.6): no prompt or allow-list change. The operator cannot write this switch (`PUT` stays off its allow-list on purpose) and the behaviour is documented in `docs/docker.md`, which it can read.
* 11 locales updated for the reworded `updates.autoCheck*` strings and the two new ones.

**Not done:** the browser still makes its own per-load request to GitHub for the card's release notes while the switch is on (a second, cheap call; the server's notification is the primary signal).

***

## Workforce dashboard shows every agent, ordered by your last use (2026-11-03)

**Repo:** EDDI, `ui/manager`

`WorkforceSection` in `pages/workforce/workforce-dashboard.tsx` cut the grouped agent list with `.slice(0, 10)`, so an eleventh agent was silently missing from "Your Digital Workforce" and the counter read "10 experts". Now:

* every agent is listed: the section pages through all descriptors with `useAllAgentDescriptors` (descriptors are per version, so a single page can hold fewer distinct agents than its size);
* if a descriptor page fails to load, the agents already loaded stay visible with an inline "Some experts could not be loaded" notice and a Retry button (`workforce.loadIncomplete`);
* above 12 agents the section collapses to the first 12 with a "Show all N" toggle, and expands into a height-capped scroll area (`workforce.showAll`, `workforce.showLess`, all 11 locales);
* order is most recently used by this user first (new `use-recent-agents.ts`, per browser in `localStorage`, recorded by `workforce-chat.tsx` once the chat has resolved which agent is open), then last modified for agents never used. The Manager's agent list keeps its last-modified order.

The Workforce sidebar keeps its own compact top-10.

***

## ✨ feat(pricing): correct cost accounting — usage normalization, one price resolution, deployment price catalog, unpriced visibility, strict mode, spend SPI (2026-11-02)

**Repo:** EDDI (`feat/cost-accounting`)

### What changed and why

EDDI's dollar figures — `audit:cost`, every cost ceiling, the tenant's monthly budget, the audit ledger, `/v1` usage — were only as good as the token counts and prices behind them, and both were off. Anthropic and Bedrock report prompt-cache reads and writes outside `input_tokens`, so cached prompts cost $0; Gemini reports thinking outside its output count; the only per-call sum point (`ToolContextBudget.sumTokens`) threw away every provider field beyond the three base counts; a rolling summary on a cheap model was charged at the task's rates; group window and stance summaries never reached the tenant budget; and a model with no price on its config was simply free, with nothing telling anyone. See [Model Pricing](https://docs.labs.ai/agent-configuration/model-cascade/model-pricing.md).

* **Usage normalization** — the decorators around every chat model ([`UsageMetering`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/pricing/UsageMetering.java), [`UsageNormalizer`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/pricing/UsageNormalizer.java)) replace each response's usage with a [`MeteredTokenUsage`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/pricing/MeteredTokenUsage.java): input = all prompt tokens, cache reads/writes kept as subsets, output includes thinking, per-call long-context buckets, the pricing model, and the call's price at the catalog entry it matched when it returned. Sums and usage-map merges keep every field. `audit:token_usage` gains `cacheReadTokens`/`cacheWriteTokens`.
* **One price resolution** — [`ModelPriceResolver`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/pricing/ModelPriceResolver.java): config prices, then the task's / cascade step's new optional `pricing` object (cache and long-context prices), then the catalog, then fallbacks (cache at the input price, tier at the base price; no price at all is unpriced, an explicit `0` is priced). `ModelPrices` and `TokenPricing` delegate to it, so every existing call site gains it.
* **Deployment price catalog** — one CAS-revisioned document (MongoDB `modelpricecatalog`, PostgreSQL `model_price_catalog`), `/administration/model-prices` (admin writes; admin/editor read, resolve and unpriced sightings), published as a static snapshot every pricing site reads, refreshed every 30 s. Bundled, never-active **reference prices** (Anthropic, OpenAI, Gemini list prices as of 2026-11-02, each with its source) for one-click adoption in the Manager.
* **Visibility** — `[unpriced-model]` deployment warnings, `audit:pricing` per step (→ `llmDetail.pricing`), `eddi.llm.cost.usd`, `eddi.llm.calls.unpriced`, `eddi.llm.pricing.refused`, cache/reasoning token types on `eddi.llm.tokens`, catalog gauges, and node-local unpriced sightings.
* **Strict mode** — `unpricedPolicy` `ALLOW` (default) / `REFUSE_WHEN_BUDGETED` / `REFUSE`, never looser than the `eddi.llm.pricing.unpriced-policy-floor` property; refused before the call through each caller's existing failure path (task fallback with reason `unpriced_model`, failed cascade step, undecided guardrail, truncation for group summaries, Dream stops).
* **Spend attribution SPI** — [`ISpendSink`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/pricing/ISpendSink.java) / [`SpendEvent`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/pricing/SpendEvent.java), fired synchronously after each accepted tenant charge by `TurnCostMeter` (exactly once per step), `DreamService` and the new [`SystemSpendMeter`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/pricing/SystemSpendMeter.java), which also charges group window and stance summaries to the tenant and admits them against the budget first.
* **Call sites** — summaries and the tool-response summarizer priced at their own model; guardrail, streaming and summary usage maps are the metered ones; Dream falls back to the catalog.
* **Manager** — a *Model Prices* page (admin) and a catalog hint plus cache/long-context fields in the LLM task's pricing section.

### Design decisions

* No active shipped prices: silently active, code-shipped prices go stale invisibly and an EDDI upgrade would change what a tenant is charged. An empty catalog prices exactly as before.
* Static snapshot holder (`ModelPriceCatalogs`) instead of injecting the catalog into the tool loop, cascade executor and resumer — every pricing method also has a snapshot-taking overload for tests.
* A provider response metadata subclass (`OpenAiChatResponseMetadata`, …) narrows `tokenUsage()` to its own type, so the decorator replaces it with a plain `ChatResponseMetadata` (id, model, finish reason). EDDI reads none of the provider-only extras.
* Strict mode never fails a deployment; the warning says the calls will be refused, and the per-call check enforces it. Failing deploy would race the catalog load at boot.

### Not done / next

* The MCP tool `read_model_prices` and the Platform Operator grants are deferred to the combined follow-up (`planning/operator-followups/cost-accounting.md`).
* Strict mode does not refuse the rolling conversation summary, the tool-response summarizer or the cascade's confidence judge yet (they are priced and counted).
* Embeddings are not priced (next gap; the catalog could take `kind: embedding`).
* Summarization retries that failed after consuming tokens stay unpriced.

***

## ✨ feat(groups): `convergence.judge: "SERVICE"` makes one direct model call (2026-11-02)

**Repo:** EDDI (`feat/group-service-judge`)

### What changed and why

`judge: "SERVICE"` on a phase's `convergence` block used to be accepted, documented and then quietly run as the moderator agent: the group config carried no model coordinates or credentials for a direct call. A phase can now name the model in a new `convergence.service` block, and the judge asks it directly — one short call instead of a full moderator-agent turn, and it works in a group that has no moderator at all.

```json
"convergence": {
  "enabled": true, "minRepeats": 2, "threshold": 0.8, "judge": "SERVICE",
  "service": { "llmProvider": "openai", "llmModel": "gpt-4o-mini",
               "parameters": { "apiKey": "${vault:openai-key}" },
               "inputPricePer1M": 0.15, "outputPricePer1M": 0.60, "timeoutMs": 20000 }
}
```

* **Config** — [`ServiceJudgeConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/ServiceJudgeConfig.java), a sixth component on `ConvergenceConfig` (the five-argument constructor is kept as an overload). Normalized like `ContextWindowConfig`/`StanceSummaryConfig`: blank identifiers absent, negative prices unpriced, timeout default 20 s and ceiling 60 s. The stale Javadoc that said the config "does not carry" provider coordinates is fixed.
* **Engine** — [`ServiceConvergenceJudge`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/ServiceConvergenceJudge.java) calls `SummarizationService.summarizeWithUsage` with a fixed system instruction and the existing judge prompt as the user message (data, never template source), parses it with the same `ConvergenceDetector` parsers, prices it through the one-method seam [`JudgeCallPricing`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/JudgeCallPricing.java) (today `TokenPricing.cost`), books it as `system:judge:<phase>:<repeat>` and announces it with `cost_updated`. `PhaseExecutionEngine.runJudge` asks it **before** the no-moderator early return; it is wired by a setter from `GroupConversationService`, so no construction site changed. A failure, timeout or unreadable reply is "not converged"; the provider's error text never reaches the transcript.
* **Save time** — [`ServiceJudgeValidation`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/validation/ServiceJudgeValidation.java), one line in `AgentGroupStore.memberAndLimitProblems`: a plaintext credential in `service.parameters`, a `${connection:...}` reference (the model registry refuses those) and a half-named provider/model are 400s. `SERVICE` without a model and an unknown `judge` value are warnings only, so stored configs keep saving.
* **Vault grants** — [`ServiceJudgeVaultGrants`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/validation/ServiceJudgeVaultGrants.java): a `${vault:...}` reference in `service.parameters` is refused at group save unless the secret exists and its grant contains `"*"` (a group has no agent identity for a narrower grant), and re-checked before the judge resolves its parameters; a narrowed grant fails that judge with `outcome=error`, not the discussion.
* **Metrics** — timer `eddi.group.convergence.judge.duration{judge=service, mode, outcome}`.
* **Manager** — the phase editor shows provider, model, API key reference, prices and timeout when Judge is Service (`service-judge-fields.tsx`); `normalizeConvergence` carries the block through. New i18n namespace `groupServiceJudge` in all 11 locales; the "not yet wired" note is gone.
* **Docs** — new page [Group Convergence Judge: SERVICE](https://docs.labs.ai/conversations-and-orchestration/group-conversations/group-service-judge.md); the convergence paragraph in [Group Conversations](https://docs.labs.ai/conversations-and-orchestration/group-conversations.md) now links to it.

### Behaviour of existing configs

Unchanged. `judge: SERVICE` without a `service` model still runs the moderator agent (now counted as `outcome=fallback_moderator`), and no stored config can fail the new save-time checks because they only read the new block.

### What's next

* `JudgeCallPricing` is the seam the cost-accounting work re-points at its central price resolver.
* MCP/Operator: no new tool; the Platform Operator follow-up is in [`planning/operator-followups/group-service-judge.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/group-service-judge.md).

***

## ✨ feat(hitl): edit-on-approve everywhere and the HITL decision audit contract (2026-11-02)

**Repo:** EDDI (`feat/hitl-edit-on-approve`)

### What changed and why

An approver can now approve **with an edit**, and every HITL decision is recorded in the audit ledger in one typed shape that analytics can rely on.

* **Config** — `hitlConfig.review` on agents ([`HitlReviewConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/model/HitlReviewConfig.java)) and groups ([`GroupHitlReviewConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/model/GroupHitlReviewConfig.java)), and `toolApprovals.rules[].approvalCategory`. All optional; a config without them behaves exactly as before. Validated at save time by [`HitlReviewConfigValidation`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/hitl/HitlReviewConfigValidation.java).
* **Audit contract** — every `hitl.approval` entry is now written by [`HitlApprovalAudit`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/audit/HitlApprovalAudit.java) with `schema: 2`: the legacy fields stay, and the decision gains `decisionId`, `pauseId`, `pausedAt`, `decidedAt`, `latencyMs`, `channel` (`REST`, `MANAGER` from the `X-EDDI-Client: manager` header, `MCP`, `SLACK`, `TIMEOUT`, `SYSTEM`), `automationReason`, `approvalCategory`/`approvalCategorySource`, `reasonCode` and a `units[]` list — one unit per answer, tool call, phase or task, each with its `decisionOutcome` (`APPROVED`, `APPROVED_EDITED`, `REJECTED`, `AUTO_APPROVED`, `AUTO_REJECTED`, `ABORTED`) and edit metrics. `HitlApprovalAudit.parse` reads schema 1 and 2 into [`HitlDecisionUnit`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/audit/HitlDecisionUnit.java)s, and the CDI event [`HitlDecisionRecorded`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/audit/HitlDecisionRecorded.java) is fired (async) after each write. The four writers were uneven before: a regular cancel had no agent or user, a group cancel had no `decidedBy`, a group decision had no phase — all fixed.
* **Reason codes** — `reasonCode` on a decision and on `toolDecisions[]`, checked before the pause is consumed by [`HitlDecisionValidator`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/hitl/review/HitlDecisionValidator.java) against `review.reasonCodes` or the built-in vocabulary. `approval-status` lists the vocabulary and the category in `pauseDetails`.
* **Approve a RULE pause with an edited answer** — `editedAnswer` on the resume body, for agents with `review.allowAnswerEdits`. The draft is kept with the pause (also without `onRejection: REVISE`), checked before the CAS (not blank, `maxEditChars`, no control characters, a JSON object for a `convertToObject` task), and applied by the LLM task in place ([`LlmAnswerEditor`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/LlmAnswerEditor.java)): the answer's own output item and data keys, nothing after it, no `postResponse`, no task re-run. Under `screenEdits: OUTPUT_GUARDRAILS` the task's output guardrails screen the edit (`reprompt` acts as `block`); a blocked edit or a changed configuration pauses the turn again on the unchanged draft, records `hitl.edit.refused` and shows `lastEditRefused` on the next pause. `approval-status` serves the redacted draft as `pauseDetails.editableAnswer`.
* **Group edits** — `taskDecisions` on the group approve body (`{verdict, note, editedResult, reasonCode}` per task, exclusive with `taskApprovals`) and `decision.editedAnswer` on a PHASE pause after a SYNTHESIS phase, for groups with `review.allowResultEdits` ([`GroupReviewEditor`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/internal/groups/GroupReviewEditor.java)). An edited result replaces `TaskItem.result` (dependents and the summary read it) and is noted in `SharedTaskList.reviewerEdits`; a synthesis edit is appended as an unsigned `SYNTHESIS` entry (speaker `hitl:<decidedBy>`, `errorReason: "reviewer-edit"`) — signed entries are never rewritten, and the signing guard skips reviewer entries.
* **Slack** — approval cards of regular conversations gain "✏️ Edit & approve" and "Reject with reason…" ([`SlackHitlEditModal`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/SlackHitlEditModal.java)), opened as modals with `views.open`. A TOOL\_CALL card offers Edit for a single call whose redacted arguments fit Slack's 3000 characters; edited arguments are merged server-side against the raw ones ([`SlackRedactedArgumentsMerge`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/integrations/slack/SlackRedactedArgumentsMerge.java)), so redacted secrets never travel through Slack and cannot be edited there. A RULE card offers Edit only with the new integration setting `platformConfig.hitlShareRuleDrafts=true`, for agents that allow edits and drafts without secrets. `view_submission` re-runs every check (approver, workspace, card, pause) and is validated synchronously through `IConversationService.validateHitlDecision`, so errors show in the modal. Group cards keep Approve/Reject. `SlackHitlSupport.buildApprovalBlocks` keeps its signature; the new overload takes the card's edit controls and keeps the `actions` block last.
* **Manager** — the approval banner offers "Edit the answer before approving" on a RULE pause whose `pauseDetails.editableAnswer` is present (textarea with the draft, a counter against `maxChars`, JSON validation for a JSON answer, the original one click away), a reason-code select for rejections and edits, and a notice when the engine refused the last edit; the group transcript marks a reviewer's SYNTHESIS entry. Every Manager decision sends `X-EDDI-Client: manager`. New keys under `hitlReview.*` in all 11 locales.
* **Docs** — new page [HITL Review & Audit](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-review-and-audit.md) (config, edit semantics per surface, Slack modals, the full audit contract with the schema-1 mapping, the reason-code vocabulary, a worked GitHub-reply example), linked from `hitl.md`, `group-conversations.md`, `mcp-server.md` and `SUMMARY.md`. The operator and MCP follow-up is in [`planning/operator-followups/hitl-edit-on-approve.md`](https://github.com/labsai/EDDI/tree/main/planning/operator-followups/hitl-edit-on-approve.md).

### Review follow-ups (2026-11-04)

* **Slack**: a tool-call card offers Edit only when the shown arguments are a JSON object (or blank) — malformed model arguments opened a modal every submission of which the server-side merge refused (`SlackHitlEditModal.forCard`).
* **Manager**: an amendment identical to the shown arguments is no amendment, so a selected reason code is not sent with what the server treats as a plain approval (it answered that with a `400`) (`approval-banner.tsx`).
* **Group cancel audit**: a cancel that lands while a running leg commits its pause is audited by that leg on its own thread; the token now records the caller that signalled it (`DiscussionControlToken.getSignalledBy`), so the entry names the canceller instead of the owner or `system:unattributed`.
* **Docs and dashboard**: [`hitl-review-and-audit.md`](https://docs.labs.ai/conversations-and-orchestration/hitl/hitl-review-and-audit.md) separates request validation (`400`, still paused) from screening (a refused edit re-pauses), says the resume reply needs a reply flag and owner-or-admin access, and what an edit reaches for an `addToOutput: false` task; "Size of approver edits" says "no samples yet" when empty.

### Contract for the features built on this branch

* **Approval analytics** reads `hitl.approval` entries only through `HitlApprovalAudit.parse(AuditEntry)` → `List<HitlDecisionUnit>`, and observes `HitlDecisionRecorded(String auditEntryId, List<HitlDecisionUnit> units)` with `@ObservesAsync`. Values of `DecisionOutcome`, `HitlChannel`, `UnitKind` and `EditSummary.Kind` are only ever added. HUMAN\_TURN resolutions have no units and no outcome.
* **Approval card context** extends the Slack card through `SlackHitlSupport.buildApprovalBlocks`, whose signatures stay as they are; the `actions` block stays the card's last block.

### Not in this change

* The Manager has no UI for group task-result or synthesis edits yet (REST and MCP have them); Slack cards of group discussions keep Approve/Reject.
* A note typed in a Slack modal is recorded but does not drive `onRejection: REVISE`.
* The approval category of a rule or group pause is derived from the configuration at decision time (the pinned agent version for agents; the current group version for groups) rather than stamped at pause time.

***

## ✨ feat(groups): native cross-team handoff (2026-11-02)

**Repo:** EDDI (`feat/team-handoff`)

### What changed and why

A standing team could only receive work from a human typing into its backlog. Cross-team handoff lets another team, or a standalone agent, file a task into a team's workspace, under **two-sided consent enforced by code**: the source lists the target (`teamHandoff.targets` on an LLM task, `handoffConfig.targets` on a group) and the target lists the source (`handoffConfig.accept.from`, `agent:<id>` or `group:<id>`, exact ids). Nothing else changes by default: every new field is absent-means-off, and old stored or imported configs and workspaces behave exactly as before.

* **One pipeline.** `TeamHandoffService.file` is the only code that writes to another team's workspace. It checks consent against the target's *current* config, refuses self-handoff, cycles and the hop limit (`eddi.groups.handoff.max-hops`, default 3), cleans the text, reserves a per-run and two per-UTC-day slots (the `toolQuotas` store, so atomic across pods), asks any `HandoffAdmission` bean, then writes through the workspace compare-and-set, re-validating duplicates, decline tombstones and capacity on every retry. A refused attempt gives its slots back.
* **Two entry points.** A `handoff_to_team` tool whose `team` argument is an enum of the aliases the source declared (new approval source `team`), and deterministic `handoffConfig.onDecision` rules that file a task when a discussion completes with a matching `VOTE`/`VERDICT`/`AGREEMENT`/`AWARD`, with an idempotent dedupe key per discussion, round and rule.
* **AUTO vs REVIEW.** REVIEW (the default) puts the item in an intake inbox that is in no task list, so a cadence can never pull it; a human with EDIT accepts (optionally edited) or declines it. Both write an audit entry in the shared approval vocabulary (`team_handoff_intake`, `APPROVED | APPROVED_EDITED | REJECTED`, `reasonCode`).
* **Lineage and provenance.** The origin of a handed-off task lives in a side map keyed by task id, and the cadence stamps the lineage of the tasks it pulled onto the discussion, so A to B to A is caught across discussions. A handed-off task is marked in the cadence question as a request to evaluate, not instructions.
* **New REST** under `/groupstore/groups/{groupId}/workspace`: `GET /handoffs`, `POST /handoffs/{id}/accept`, `POST /handoffs/{id}/decline`, and `DELETE /backlog/{taskId}` (the 200-task backlog had no way to shrink; handoff makes the ceiling reachable). Manager: an Intake section and an origin badge on the workspace page, a handoff section in the group advanced editor.
* `team` is added to the known HITL tool sources and to the tool-cache side-effecting sources (a cached result must never stand in for a write). SSE gets a `team_handoff` event; metrics `eddi_team_handoff_*`.

Not built here: new MCP tools for the intake (the service methods are public and web-free for thin wrappers), and the Platform Operator update, both listed in `planning/operator-followups/team-handoff.md`.

**Rolling upgrade caveat:** an older pod that re-saves a workspace drops the unknown `handoffs` field, losing pending inbox items and origins (same as `reworkCounts`); the audit entries hold the subject and source for recovery.

**Files:** [`TeamHandoffService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/handoff/TeamHandoffService.java), [`TeamHandoffIntake.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/engine/runtime/internal/handoff/TeamHandoffIntake.java), [`HandoffPolicies.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/HandoffPolicies.java), [`WorkspaceHandoffs.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/model/WorkspaceHandoffs.java), [`TeamHandoffToolsProvider.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/TeamHandoffToolsProvider.java), [`RestTeamHandoffs.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/configs/groups/rest/RestTeamHandoffs.java), [`team-handoff.md`](https://docs.labs.ai/conversations-and-orchestration/group-conversations/team-handoff.md)

***

## ✨ feat(llm): `toolQuotas` — per-subject, per-window caps on tool calls (2026-11-02)

**Repo:** EDDI (`feat/tool-quotas`)

### What changed and why

An agent designer can now cap how often one **subject** — normally the end user — may make a tool run within a time window, counted **across conversations and across nodes**: "at most 100 content improvements per user per day". Until now EDDI had a per-tool-per-minute rate limit per conversation (`toolRateLimits`), a per-conversation budget that a new conversation resets (`maxBudgetPerConversation`) and per-tenant quotas — none of them is per user per day.

```json
"toolQuotas": {
  "subject": "{context.personId}",
  "tools": {
    "updateAction":        { "limit": 100, "window": "P1D", "pool": "improvements" },
    "updateSession":       { "limit": 100, "window": "P1D", "pool": "improvements" },
    "generateActionImage": { "limit": 30,  "window": "P1D" }
  }
}
```

* **Config** — `LlmConfiguration.Task.toolQuotas` ([`ToolQuotaConfig`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/model/ToolQuotaConfig.java)). Keys are tool names with the same matching as `toolRateLimits` (dispatch name wins over slug) and work for every tool source, HTTP-call tools included. Tools of one `pool` share one counter. Validated at save time ([`ToolQuotaConfigValidator`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/quota/ToolQuotaConfigValidator.java), wired into `LlmStore` like the `toolApprovals` check, so it is a 400): `limit` a positive integer, `window` an ISO-8601 duration from `PT1M` to `P31D`, every rule of a pool states the same limit and window. Windows are fixed and aligned to the UTC epoch (`P1D` resets at 00:00 UTC).
* **Subject** — an optional template rendered with the turn's template data; default is the conversation's user id. Managed conversations use composite user ids (`<user>-<company>-<program>`), so the default counts per program and the template is how a deployment counts per person. A blank render falls back to the user id, a caller with no user id is capped per conversation, a subject over 256 characters becomes a prefix plus a digest, and the subject is only ever logged as a short digest.
* **Counts real executions only.** The reservation is made in one place, `ToolExecutionService.executeToolWrapped`, after the rate limit and the cache and immediately before the tool runs (`ToolQuotaGate.reserve`). Cache hits, rate-limited calls, calls refused by the conversation or tenant budget, rejected approvals and calls that never ran are never counted. A failed call gives its reservation back (`ToolQuotaGate.settle`): an exception, a tool-reported error, an HTTP non-2xx or transport failure — judged by the same `ToolOutcomeClassifier` the repeat guard uses. A **timed-out** call keeps its count, because the abandoned worker cannot be stopped and may still finish the side effect.
* **Atomic, no overshoot, multi-node.** A new counter store, `IToolQuotaStore`, with a MongoDB implementation (`findOneAndUpdate` with a `count < limit` filter and upsert; the duplicate-key race on the window's first insert is retried as a conditional update; TTL index on `expiresAt`) and a PostgreSQL one (`INSERT … ON CONFLICT DO UPDATE … WHERE used < ? RETURNING used`; an hourly sweep removes expired rows). Selected in `DataStoreProducers` like the other stores. With three calls left, a batch of five parallel calls runs exactly three.
* **Refusal** is a tool result the model sees, a final `NOT_EXECUTED` envelope with the limit and the reset time ("Not run: the daily limit for this tool (100) is reached; it resets at 2026-11-03T00:00:00Z …"), not a thrown error; the turn carries on and the model is not invited to retry.
* **Human approval.** Approved calls run on the resume path through the same `ToolLoopRunner.executeToolCall` → `executeToolWrapped` pipeline as live calls, so the quota is applied (and counted) at execution time there too. A gated call proposed while its quota is already exhausted is refused immediately by a read-only pre-check (`ToolLoopRunner.refuseExhaustedGatedCalls`, before the pause is built), so a human is never asked to approve what will then be refused; pausing counts nothing.
* **Fails closed.** If the store cannot answer, a stored rule cannot be applied or the subject template fails to render, the call is not run and the model is told the limit could not be checked. One WARN a minute with agent, conversation and a digest of the user id; every failure is counted.
* **Metrics** — `eddi.tool.quota.decisions{tool, outcome}` (`allowed`, `refused`, `precheck_refused`, `unavailable`, `released`) and `eddi.tool.quota.store.failures{operation}`; documented in `docs/metrics.md` and charted on the Full Metrics Reference dashboard.
* **GDPR** — counters are keyed by a user identifier, so [`ToolQuotaGdprParticipant`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/quota/ToolQuotaGdprParticipant.java) joins the erasure cascade (delete by subject) and the export (the user's counters). If a deployment's subject template derives an identifier other than the conversation's user id, erasure deletes the counters whose subject equals the erased user id; counters hold counts only and expire an hour after their window ends.

### Design decisions

* The reservation sits inside `executeToolWrapped`, not in `ToolLoopRunner` around the supplier: only there is it after the cache check, and a refusal returned from inside the supplier would have been cached and charged as a result.
* A rule keyed by a slug is one counter for all of that tool's operations (unlike the per-dispatch-name rate-limit bucket), because "30 web searches a day" is naturally per tool; `pool` is the explicit way to share across tools.
* Pre-check only refuses an *already exhausted* quota; it does not reserve slots for pending approvals.
* A call with no quota rule takes exactly the old 10-argument `executeToolWrapped` path.

### What's next / not done

* The Manager has no form for `toolQuotas` yet; its LLM task editor spreads the task object on save, so a configured `toolQuotas` is preserved.

**Files:** [`ToolExecutionService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/ToolExecutionService.java), [`ToolLoopRunner.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/impl/ToolLoopRunner.java), [`ToolQuotaService.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/quota/ToolQuotaService.java), [`MongoToolQuotaStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/quota/MongoToolQuotaStore.java), [`PostgresToolQuotaStore.java`](https://github.com/labsai/EDDI/tree/main/src/main/java/ai/labs/eddi/modules/llm/tools/quota/PostgresToolQuotaStore.java), [`docs/langchain.md`](https://docs.labs.ai/agent-configuration/langchain.md)

***

## 🐛 fix(test): `toolQuotas` tests follow `executeToolCall` and `truncateIfNeeded` (2026-11-02)

**Repo:** EDDI (`fix/review-infra`, folded into #1185 so it lands with a reviewed PR)

### What changed and why

\#1210 (`toolQuotas`) and #1192 (spend recorded on every model-phase exit) each passed CI on their own, but together `main` no longer compiled its tests: #1192 added a `DoubleSupplier runSpend` parameter to `ToolLoopRunner.executeToolCall` and a seventh parameter to `ToolResponseTruncator.truncateIfNeeded`, and `ToolLoopRunnerQuotaTest` still called the old shapes. The two direct calls now pass `ToolLoopRunner.NO_RUN_SPEND`, and the truncator stub matches the seven-argument overload the runner uses (the old stub was never hit, so the mock returned `null` and five tests failed with an NPE on `governed()`). `ToolQuotaHitlTest` had the same two stale stubs: `checkCostBudget(any())` (now `checkCostBudget(any(), anyDouble())`, the two-argument form the runner calls) and the six-argument `truncateIfNeeded`; its three resume tests failed with an NPE in CI. Test-only change.

***

## Group HITL transitions are bound to their pause with a multi-field CAS (2026-11-01)

Repo: EDDI, branch `fix/groups-pause-cas` (stacked on #1188).

**Problem:** the group approve, reject, cancel and human-turn timeout-skip writes compared only `state` in their compare-and-set. A resume followed by a re-pause between the read and the write (ABA) left the state `AWAITING_APPROVAL` / `AWAITING_HUMAN_INPUT` again, so a stale decision could act on a newer pause it never saw. The in-memory pause-id checks narrowed the window but could not close it.

**Change:**

* `IResourceStorage.storeIfFieldsEqual(resource, Map)` — an atomic conjunctive conditional write (a `null` expected value means "absent"), implemented in `MongoResourceStorage` (one `replaceOne` filter) and `PostgresResourceStorage` (one `UPDATE ... WHERE a = ? AND b = ?`), with the same 404/409 zero-match distinction as the single-field CAS.
* `GroupConversation.pauseId` is persisted next to `pausedAt` and kept in lockstep by `setPausedAt`, so no pause or resume site can forget it. `IGroupConversationStore.updateIfStateAndPause` writes with state AND pauseId; `GroupHitlCoordinator` uses it for approve, reject, `cancelStored` (so `cancelDiscussion` and `cancelPausedDiscussion`) and the human-turn timeout skip and submit, each bound to the pause it read.

**Design decisions:** a separate string field rather than comparing `pausedAt`, because an `Instant` is stored differently by the two backends while a string compares identically on both. Documents written before the field existed are matched as absent (still state-bound, still atomic) so pauses in flight at upgrade remain decidable; the next write stamps the id. The pause→cancel conversion inside a running leg is unchanged: it acts on the pause that same leg just committed.

**Tests:** coordinator tests per transition (the CAS names the pause that was read and a stale refusal surfaces), store unit tests, and Testcontainers tests on MongoDB and PostgreSQL showing that a decision read before resume + re-pause is refused while the newer pause is untouched.

***

## fix(hitl,alerts): self-heal the journal TTL index and release digests held by stale rules (2026-11-01)

**Repo:** EDDI (`fix/hitl-alerts-followups`, stacked on `fix/review-engine-hitl-alerts`)

Closes the two items deferred in the HITL/alerts review fixes (`2026-10-31-review-engine-hitl-alerts`).

### What changed and why

* **Journal TTL index self-heals.** During a rolling update an old pod could recreate the unfiltered `idx_journal_ttl_claimed` after a new pod dropped it, silently expiring `EXECUTING` claims again. `IHitlToolJournalStore.reconcileRetention()` (MongoDB: lists the indexes, drops any unfiltered TTL on `claimedAt` or a legacy name with a `WARN`, re-ensures the partial `idx_journal_ttl_completed`) is called by the new `HitlToolJournalMaintenance` scheduled job every `eddi.hitl.tool.journal-reconcile-interval` (`15m`); the constructor still drops the known names at startup. PostgreSQL has no such index (default no-op).
* **Stale-cache digest events are released.** `IAlertEventStore.findDigestPendingRuleIds` (Mongo `distinct`, Postgres `SELECT DISTINCT`) lets `AlertMaintenanceService` release `DIGEST_PENDING` events whose rule is now deleted, disabled or has no digest, so an event created by a replica that still cached the old rule stays in the inbox instead of being held until retention. `AlertMaintenanceService.Result` gained `released`.

### Design decisions

* The reconciliation is a periodic pass over the existing alert maintenance job and a small `@Scheduled` bean for the journal, not a new scheduler or a migration marker: both repairs are idempotent, so every replica may run them.
* The journal job lives in its own bean because the Mongo store is created lazily only on MongoDB; a `@Scheduled` method on the store would instantiate it on PostgreSQL.

***

## chore(build): Node 26 LTS, cache/paths-filter actions, hold blocked majors (2026-11-01)

**Repo:** EDDI (`chore/node-26-lts`)

### What changed and why

* **Node 24.22.0 to 26.13.0** (Active LTS "Lithium" since 2026-10-28). Moved together: `pom.xml` `node.version` and its comment, `ci.yml` `NODE_VERSION` and `NODE_SHA256_LINUX_X64` (taken from the official `SHASUMS256.txt` for `node-v26.13.0-linux-x64.tar.gz`), `docs-site.yml` `NODE_VERSION`, `docs-site/.nvmrc`, `mise.toml`, and the current-state mentions in `AGENTS.md`, `README.md`, `docs-site/README.md`, `ui/chat/README.md` and `ui/manager/README.md`. `@types/node` is untouched; separate Dependabot PRs own it.
* **GitHub Actions**: `actions/cache/restore` and `actions/cache/save` v4 to v6.1.0 in `docker-pull-notify.yml`; `dorny/paths-filter` v3 to v4.0.3 in `ci.yml` and `docs-site.yml`. SHA pins kept, comments now carry the exact version. Supersedes Dependabot PRs #823, #824 and #744.
* **`dependabot.yml` ignore rules** (semver-major only, so minor/patch and security updates still arrive): `de.undercouch:bson4jackson` and `com.networknt:json-schema-validator` (3.x pull Jackson 3 / `tools.jackson`, banned by the `ban-jackson3` enforcer rule while Quarkus manages Jackson 2); `io.github.classgraph:classgraph` (a dependencyManagement pin for a transitive dependency, and ClassGraph 5/6 is not binary-compatible with 4.x); `typescript` in `ui/manager` and `ui/chat` (TS 7 is the Go-native compiler and typescript-eslint peers `typescript <6.1.0`, so `npm ci` fails with ERESOLVE).

### Design decisions

* The held majors are closed rather than left open: each would fail the build or `npm ci`, and an ignore rule stops Dependabot re-proposing them every week. Each rule carries its reason and the condition for lifting it.

### Verification

`BuildQualityGatesTest` keeps `pom.xml`, `ci.yml` and `mise.toml` Node pins equal. UI builds on Node 26 are verified by CI.

***

## fix(runtime): persist late agent-test charges and fence dead letters behind GDPR erasure (2026-11-01)

**Repo:** EDDI (`fix/runtime-late-charges-erasure`, stacked on `fix/review-engine-runtime`)

The two items the engine-runtime review PR deferred. Each has unit tests that fail without the fix.

### What changed and why

* **Late charges of an abandoned agent-test turn** (`AgentTestRunner`): the terminal record was built from the run's cost at the moment `run()` returned, so a turn that completed afterwards updated only the in-memory total and the reported spend stayed too low. A `LateChargeLedger` now tracks what the terminal record accounted for. Once that record is stored, every further difference (cost, newly seen models) is handed out exactly once and applied to the stored run as an adjustment, and an `AGENT_TEST_LATE_CHARGE` entry carrying just the added cost goes to the audit ledger. Charges that land between building the record and storing it are collected right after the write. A failed adjustment is handed out again with the next charge.
* **Dead letters vs GDPR erasure across nodes** (`ClusterConversationCoordinator`, new `ErasureTombstones`): a node that reconnects between the erasure's shared purge and the deletion of the conversation's snapshot still found the conversation existing and republished its erased dead letter. `purgeDeadLetters(conversationId)` now writes a marker to a shared `ERASED` bucket first; forwarding reads it before publishing (erased: discard), and again after the publish (erased meanwhile: purge the published copy). An unreadable marker defers the entry, as an unreadable conversation store already did.

### Design decisions

* The late-charge adjustment is a compare-and-swap loop on the terminal record's `heartbeatAt`, which no longer means anything once the run is terminal, so it doubles as the version counter. No new store method was needed. The alternative, holding finalisation for abandoned turns, would delay every timed-out run by up to the turn timeout plus the write-back wait.
* The adjustment does not recompute status, cases or `costCeilingReached`: it corrects the figure, not the verdict.
* The marker lives in the coordinator's purge, not in `GdprComplianceService`, so every caller of the purge gets it; if it cannot be written, the shared stream is purged anyway and the failure is reported to the cascade (step `deadLetters`).
* The marker's lifetime is configurable (`eddi.cluster.erasure-marker-ttl`, default `P7D`). It holds only the conversation id as key. Past it, the existing existence check takes over.

### Decision Log

***

## Scheduler keeps claiming due schedules while long fires run (2026-11-01)

**Repo:** EDDI, branch `fix/schedule-claim-cycle` (stacked on #1197)

* `SchedulePollerService.pollDueSchedules()` waited for its whole batch of fires, so with `concurrentExecution = SKIP` one fire running for minutes suppressed every 15-second poll on that instance; schedules that fell due meanwhile (HITL approval deadlines included) waited for the long fire. The poll is now a short claim cycle: it claims due schedules and hands each to a bounded fire executor, then returns.
* New `eddi.schedule.max-concurrent-fires` (default 100) caps fires in flight per instance. A poll takes a slot before claiming, so nothing is claimed that cannot start; the rest stay due.
* Each fire is bounded by its own watchdog (`fire-timeout` plus grace) instead of a shared batch deadline; a timed-out fire is interrupted, counted in `eddi.schedule.fire.timedout`, and gives its slot back even if it ignores the interrupt. The lease invariant (lease > fire-timeout + grace), dead-lettering, `failCount`, expired-claim-as-failed-attempt and the manual-fire path are unchanged.
* Graceful shutdown (`@PreDestroy`): stop claiming, let in-flight fires finish for 5 s, interrupt the rest.
* Tests: a long fire does not block the next poll from claiming another schedule; the in-flight cap holds and slots are returned (also after a lost claim); shutdown drains and cancels; the per-fire timeout frees its slot.
* Docs: `docs/scheduling.md`, `docs/configuration-reference.md`.

***
