Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

October 2026

Archived entries for October 2026, newest first. For recent work see the live changelog.


🔧 ci: warm one complete Maven cache and retry Central rate limits (2026-10-31)

Repo: EDDI (chore/ci-maven-cache)

What changed and why

A pull request's Build & Test job failed with an HTTP 429 from Maven Central while resolving surefire-junit-platform, before a single test ran. Every Java job used setup-java with cache: maven, which keys one shared cache on the pom.xml hash: whichever job finished first saved it and nothing ever updated it. A compile-only job (CodeQL) could therefore save a repository without the surefire/failsafe providers or the other test-time plugins, and every later job fetched those from Central, concurrently with every other open PR.

  • New Maven Cache job (.github/workflows/ci.yml) is the only writer of ~/.m2/repository. It resolves the dependencies and plugins, runs package once with tests skipped (formatter, Checkstyle, JaCoCo, Quarkus and its *-deployment jars), forces the surefire and failsafe JUnit providers, and fetches the SBOM and license plugins, then saves under maven-v1-<os>-<hash of every pom.xml and maven-wrapper.properties>. When that exact key already exists it does a lookup-only check and stops, so a docs-only PR pays seconds. A miss starts from the nearest older cache. It is continue-on-error, so a failed warm-up never blocks the required checks.

  • Build & Test, Integration Tests, CodeQL Analysis, Generate SBOM and Build Image need it and only actions/cache/restore the same key (with the prefix as fallback); none saves. cache: maven is gone from them. Job names are unchanged.

  • .mvn/maven.config sets Maven Resolver's HTTP retry: aether.transport.http.retryHandler.count=8, .interval=10000, .intervalMax=300000, .serviceUnavailable=429,503. A 429 or 503 is retried, the server's Retry-After is obeyed when sent, and a wait above five minutes fails the request instead of stalling the build.

  • Review fix: the warm-up checks out before it computes its cache key (the key hashed files that were not on disk yet, so it never matched and every run rebuilt the cache), and it also stores the checksum-verified Node archive in the cache so Build Image downloads nothing.

Design decisions

  • The warm-up is ungated: CodeQL runs on every PR (Scorecard), so a gated warm-up would leave it uncached. The exact-key lookup keeps that cheap.

  • Caches written on main are visible to every PR, caches written on a PR only to that PR, which is why the fallback prefix exists.

  • The Node archive pin in Build Image is unchanged; it now rides in the same restored repository.

  • codeql.yml and loadtest-db-ops.yml still use cache: maven (separate workflows, not in this change).


🐛 fix(ci): ratings races in the Chat UI and the integration-test stall on main (2026-10-31)

Repo: EDDI (fix/main-ci-ratings-it-hang)

What changed and why

Three CI failures present on main (and so on every PR) at 01c3250.

  • Chat UI ratings restore clobbered the person's own action. useRatings applied the server's restore read verbatim, so a thumb tapped while the read was in flight was undone (flaky ChatWidget.ratings.test.tsx, and a real bug). Changes made since the read left are now kept over the server's older view. The restore effect also closed the rating card whenever it re-ran, including when the profile merely arrived after paint, so a fast click on "Rate this conversation" opened and immediately closed it (the Playwright ratings-feedback.fullstack timeout waiting for rating-star-1). It now closes only on a switch to another conversation. Both have unit tests in useRatings.test.tsx.

  • RagWorkflowExtensionIT stalled the failsafe fork. It was the one Mongo-backed @QuarkusTest without @TestProfile(IntegrationTestProfile.class), so Quarkus restarted the application without the Mongo dev-service connection string. The app then pointed at the unresolvable mongodb:27017 and every Mongo-touching bean waited out the driver's 30 s server selection: 250 s on the last green run, ~580 s on main since more stores were added. The 900 s fork timeout then killed whichever class was running (usually PostgresGroupVerdictIT, which is innocent). The test now carries the profile.

  • The rating card never opened for an agent that sends no greeting (ChatWidget.tsx). With no messages the transcript renders its empty state, and the card was only rendered in the non-empty branch, so "Rate this conversation" set the state and nothing appeared. The Backend E2E agent has an empty workflow, so its ratings test waited for a star that was never rendered. The card now renders in both branches; a ChatWidget test covers the empty transcript.

  • Rating state across the restore read (useRatings, RatingCard), from the review of this PR: an edit is now tracked per rating (in flight, confirmed since the read began, revision). A failed write rolls back to the server's value (from the read or the last confirmed write), never to empty, and only when no newer edit has started; a failed write before the read answers lets the read fill the value in. The per-conversation state is no longer cleared when the profile merely reloads for the same conversation, and the protection is retired when the next read begins. A card opened before the read finishes picks up the restored rating until the person has touched it.

Design decisions

  • No timeout was raised and nothing was skipped; the stall's cause was removed.


🔒 fix(backup): review findings on export, import and upgrade (2026-10-31)

Repo: EDDI (fix/review-backup)

What changed and why

Verified findings from the CodeRabbit security review and the October code review, all on the backup / import / sync path. Several authorization findings only matter with eddi.workspaces.enabled=true; they are fixed regardless.

Export

  • The agent and workflow documents are scrubbed like every other archived document — a Dream job's model apiKey and legacy channels[].config tokens used to leave verbatim.

  • The export scrubber now redacts query parameters whose name marks a credential (key, sig, signature, accessKey, … — ConfigSecretRedactor's rule) in relative paths and absolute URLs, so a signed-URL signature an editor's GET hides no longer leaves in the archive. Form bodies are not affected.

  • A URI found anywhere in a workflow other than its step references (which the authoring check vetted) needs VIEW before export or preview reads it; previously a URI in a free field of a step's config pulled another space's configuration into the archive.

  • Snippets are exported only with VIEW (a USE-only listing no longer suffices).

  • Connections go through ConnectionReadRedactor before the generic scrubber, so a pre-validation literal passwordRef is not exported.

Import

  • A workflow written straight to the store runs RestWorkflowStore's reference check (now reused via WorkflowReferenceAccess, walking RestWorkflowStore.referencedResources).

  • A workflow directory without a workflow document is a 400, not a kept foreign reference.

  • Repeated workflow URIs in an agent are imported once (no orphan copies).

  • updateParser now goes through updateTracked, so a failed merge rolls it back too.

  • Connections are created only for an administrator, as over REST; an editor's import skips (and counts) them.

Upgrade / sync

  • A source resource two workflows share is matched per workflow: extension diffs carry their workflow's workflowIndex, and the executor looks diffs up per workflow (#8).

  • A 409 is retried against the store's version only when the descriptor lags the store (a lost descriptor write) or when the newer version is one this run wrote itself (a target resource two workflows share is written once per workflow); any other version whose descriptor moved is somebody's edit and is reported, not overwritten.

  • createExtension decodes the JSON before requireMayAuthor, so a JSON-escaped ${caller:token} no longer passes the check; a created RAG config gets KnowledgeBaseStorageGuard.prepareNew.

  • A newly created workflow runs the reference check before any of its resources is written.

  • ScrubbedSecrets restores a literal target credential only when the object's destination (…Url, uri, endpoint, host, absolute path) is unchanged, compared by origin with scheme and host case-folded and a default port equal to an omitted one; vault references still come from the target. The identity lookup for array elements is indexed once per list instead of a scan per element.

  • Source readers refuse more than 256 workflow references; the remote source fetches each document once per sync.

Archive extraction: a ZIP directory entry carrying data, or an entry nested more than 32 levels deep, is refused.

Dead code: removed StructuralMatcher.readLatestVersionOrDefault and UpgradeExecutor.readLatestVersion; moved the stacked Javadoc in StructuralMatcher onto readLatestVersion.

Design decisions

  • Export keeps "VIEW on the agent covers the graph beneath it" for the structural step references (a non-cascading share still exports); only references the authoring check never saw need their own VIEW. That includes the dictionaries a parser document names (the parser store does not vet them on write), so a recipient of a non-cascading share whose agent uses parser-document dictionaries they cannot see now gets a 403 instead of an archive.

  • Minimal edits outside backup/: RestWorkflowStore.referencedResources and ConnectionReadRedactor.redactLegacyLiterals made public for reuse; SecretScrubber gained the credential-query-name rule.

Not done

  • Consolidating RestImportService's per-type create/update methods with UpgradeExecutor.resolveExtensionOps into one table: the import side carries per-type behaviour (RAG preparation, storage namespace, v5 LLM defaults) that makes it a larger refactor than this pass.

  • Second review round: an upgrade write that meets a 409 for a version this run did not write is now always reported as "changed on this instance" instead of being retried when the descriptor lags the store (a lost descriptor bump and a save whose descriptor has not moved yet cannot be told apart, so the sync fails safe; preview and sync again). The workflow-reference rule now lives once, in RestWorkflowStore.requireAccessToReferences, shared with the backup paths.

Files: RestExportService.java, RestImportService.java, UpgradeExecutor.java, StructuralMatcher.java, ScrubbedSecrets.java, WorkflowReferenceAccess.java, ZipArchive.java, SecretScrubber.java, import-export-an-agent.md, agent-sync-guide.md


fix(configs,datastore): review findings in the configuration stores and the datastore (2026-10-31)

Repo: EDDI (fix/review-configs)

Verified CodeRabbit findings and code-review leads (§4 Persistence, §5 dead code) for configs/** and datastore/**.

What changed and why

Configuration stores

  • Reverse-reference lookups no longer loop on a caller-chosen version. AgentStore.getAgentDescriptorsContainingWorkflow and WorkflowStore.getWorkflowDescriptorsContainingResource issued two to four queries per integer version from the ?version= the caller sent down to 1, so ?version=2000000000&includePreviousVersions=true kept a worker busy for billions of queries. The walk now starts at the referenced resource's LIVE version, read from its own store (ResourceUtilities.clampToLiveVersion; the workflow store for an agent lookup, IResourceClientLibrary for a workflow lookup), never from its descriptor: descriptors lag every in-process update, and clamping to a stale descriptor version made the cascade-delete and orphan-purge reference checks skip referrers of the live version. When the live version is unknown a walk above 1000 versions is refused (both delete paths read that as "still referenced") instead of being cut short. Only walks are clamped; an exact lookup (includePreviousVersions=false) queries the version it was asked about.

  • JSON Patch cannot relocate a credential the caller cannot read. ConfigJsonPatcher applied the patch to the unredacted document, so an editor could copy/move a plaintext key into description and read it back. For anyone but an eddi-admin the patch now runs against a view where every credential ConfigSecretRedactor would redact is an opaque random token; a token is restored wherever it is a whole value, but one that ends up at another path (an add/remove earlier in an array shifts the indexes after it) is kept only if the redacted read still hides it there; a credential relocated into a readable field, or embedded in a larger string, is refused with a 400, and a test against a credential never sees its value.

  • JSON Patch output is bounded. Operations are applied one by one and each copy is followed by a size check (nodes plus string length, counted with an early stop) that refuses growth beyond twice the stored document plus 1 MB, before anything is serialised. Shared JSON-P structure let a few copies build an exponentially large result.

  • Workflow references with a non-canonical scheme are checked. RestWorkflowStore.addReference skipped any config.uri not starting with eddi://, but the engine resolves by host and id, so Eddi:// or x://ai.labs.llm/… ran a configuration the access check never saw. Every URI with a scheme, host and id is now checked.

  • Parser documents check their dictionary references. RestParserStore create, update and duplicate run the workflow store's reference check on the parser's extensions (VIEW on each newly introduced dictionary), so a private dictionary can no longer be reached through the standalone parse endpoint or an export.

  • Agent tests: maxCostPerRun NaN/Infinity and a non-finite expect.maxCostUsd are refused (NaN passed the range check and disabled the budget).

  • Artifact JSON-schema validators evaluate pattern/patternProperties through a deadline-bound regex factory sharing one 500 ms budget per validation, like the REGEX validator; a runaway pattern refuses the write. The budget is checked before every match as well as during one, so many short matches (every patternProperties pattern against every key) stop at it too.

  • Template migration is linear. TemplateSyntaxMigrator.unconvertibleReason continues after the closer instead of re-scanning from every nested opener, and a text whose openers-times-length exceeds 50M is reported unconvertible and left alone instead of costing quadratic CPU at import or startup. Only anchors a conversion step can scan from count ([[${, [(${, [#, #strings.), so nested JSON arrays ([[1,2]]) no longer push a resource past the bound, and an import that the converter refuses as a whole text is reported in the log like a refused value.

  • Global variables: the assembled-reference check scans in one linear pass instead of a regex retried at every unterminated opener. ApiCallExecutor refuses a full-form ${vars:tenant/key} that only conversation data supplied (the configured template did not write it): it would read another workspace's variable.

  • Knowledge bases: a 6.5.0 name-layout knowledge base that drops its explicit location moves to the id layout, as a rename already did (rename-keeping-location then drop-location reached another name's default store unchecked); an Elasticsearch indexName must name one concrete index (no wildcard, list or exclusion, and no surrounding whitespace, since the store receives it untrimmed); and the location collision scan fails closed when it runs past its 20,000-descriptor budget.

  • Channel integrations: duplicateChannel runs the target USE check a create runs; the uniqueness checks and the write are serialised on the node, and a new integration's descriptor (which those checks enumerate) is written before the lock is released; a create whose descriptor cannot be written removes the integration again and fails with a 500 instead of leaving it invisible to the next check. A channelId a deployed agent's legacy Slack connector serves is refused instead of silently taking the route over. That check asks ChannelTargetRouter.isServedByLegacyConnector, which reads the live deployments and deployed agent configurations rather than the router's one-minute cache (a connector deployed a moment ago is not in it), and the save answers 503 when they cannot be read. The router is constructor-injected.

  • Group configurations: protocol.maxTurns and a phase's repeats are capped at 1000, and artifactConfig.maxArtifactsPerDiscussion at 1000 (the quota counts a bounded listing).

  • Orphan purge: the scan also walks the exact workflow version every current (not only deployed) agent pins, so a dependency a newer workflow version dropped is not purged from under an undeployed agent. It reads each agent and workflow at its live version rather than the version its (possibly stale) descriptor names, and the per-candidate re-check before a delete also asks whether a current agent pins a superseded workflow version that uses the extension (IWorkflowStore.getWorkflowVersionsContainingResource), failing closed.

  • Properties: PropertyValues.toProperty and copyOf copy nested maps and lists, so a path assignment into a property built from a cached configuration value cannot write into that shared configuration.

  • PropertiesMigrationService skips only on postgres, like every other datastore switch, instead of running only on the literal mongodb.

Datastore

  • PostgresUserConversationStore.deleteAllForUser throws instead of returning 0 on a SQL error, so a failed GDPR erasure step is reported as failed.

  • DescriptorStore.findByOriginId returns every match instead of the first ten, which was a cap applied before the caller's workspace/EDIT filter and could make a merge import create a duplicate.

  • Sorted PostgreSQL findResources pages break ties on id, so offset paging over equal sort values neither repeats nor skips rows (the field index still supplies the leading key; the tie is ordered by an incremental sort). MongoDB deliberately keeps the single-key sort: its field indexes are single-field, and {field: -1, _id: -1} would turn every sorted page into a blocking in-memory sort over all matches.

  • PostgresAttachmentStore.grantAccess throws AttachmentNotFoundException for a missing blob, as the MongoDB store does.

  • Attachments that record no owner fail closed for reads: the MongoDB store no longer lets any conversation read them unless that conversation was explicitly granted access, matching PostgreSQL. Deletes are unchanged on both backends: an ownerless blob can still be deleted by its storageRef, because deleting discloses nothing and refusing it would strand personal data beyond erasure. deleteByConversation (conversation delete, purge, GDPR erasure) is untouched and matches on the owning conversation exactly as before. Docs: Attachments guide.

  • V6RenameMigration.saveDocument addresses a string _id as stored (it queried new ObjectId(string), which never matched) and counts a document only when the replace matched.

  • Dead code removed: datastore/model/ResourceId and its test; the unreachable null-weight check in AgentGroupStore.validateVotePhases (VoteConfig copies weights with Map.copyOf, which refuses null values).

Docs updated: RAG, Group conversations, Attachments guide.

Design decisions

  • Patch protection by token, not by path rules. Deciding which patch operations touch credentials by their pointers breaks on array shifts and nested copies; masking the document with per-request random tokens, and admitting a token at a new path only where the redaction rules still hide it, covers both and reuses the read redaction's own rules. Over-masking (no skip paths) only restricts copy/move for non-admins.

  • Reverse-lookup clamp uses the resource's live version from its own store, injected lazily (Provider) because the workflow store and the resource client library reach back to the agent and workflow stores through the REST facades. The descriptor's version was tried first and is wrong: it lags in-process updates. A store-level prefix query would avoid the per-version walk entirely but needs new queries on both backends.

  • Ownerless attachments fail closed for reads only: the PostgreSQL store already refused those reads, and an owner nobody can establish is not an owner. Deletes stay allowed, since a delete that refuses data it cannot attribute would make it impossible to erase.

Deferred

  • Descriptor PATCH vs. sharing race (full-snapshot write conditioned only on the resource version): needs a descriptor revision or field-level update on both backends.

  • Slack approval records keyed by integration name: needs an immutable integration id on approval records (integrations area).

  • Knowledge-base collision check against locations of older, still-pinned versions: needs a location index across versions.


🐛 fix(engine): conversation engine, HITL and memory findings from the external reviews (2026-10-31)

Repo: EDDI (fix/review-engine-conv)

Verified findings from the CodeRabbit security review and the full code review against 01c3250, for the conversation engine (engine/internal), the HITL services and conversation memory (engine/memory).

What changed and why

Conversation state can no longer be resurrected or overwritten blindly

  • The agent-timeout watchdog and the turn error path wrote EXECUTION_INTERRUPTED / ERROR with an unconditional store write. An end only raises the cooperative-cancel flag, which a hung model call never sees, so ending a stuck conversation was undone by the watchdog — and EXECUTION_INTERRUPTED auto-recovers on the next say, so the ended conversation was drivable again and invisible to the ENDED-only retention sweep. Both are now a compare-and-set from the state they read, never over ENDED (ConversationStepRunner.transitionUnlessEnded; both stores already had compareAndSetState).

  • The admin PATCH /agents/{conversationId}/state read the state and then wrote READY: IConversationService.resetConversationState now takes the expected state and is a compare-and-set; a lost race answers 409.

  • A cancelled say ends its pipeline through the STOP_CONVERSATION path, so the caller was told ENDED while the store recorded EXECUTION_INTERRUPTED. It is now reported as what the store holds (ConversationService.reportCancelledTurnAsInterrupted).

HITL

  • An ABORT timeout (and the pending-approval retention sweep in HitlCrashRecoveryObserver) used the full cancel and was not bound to its pause: a fire claimed just before a resume stopped the resumed turn, or aborted a newer pause. Both now use the paused-only cancel bound to the pause id (IConversationService.cancelPausedConversation(id, by, pauseId)), which re-checks the pause after its compare-and-set and puts back a pause it did not mean. An ABORT fire that meets a resume of its pause still in flight (IN_PROGRESS) stays armed and is retried rather than completed, since that resume may still fail and restore the pause. The group surface is left to the groups work.

  • Resume did not apply the GDPR Art. 18 processing restriction that start and say apply; a restricted owner could drive a resumed turn (including a rejection-note revision). It now refuses with the pause restored and its timeout still armed.

  • A tool pause's timeout policy came from the governing rule of the matched calls only, so an AUTO_APPROVE rule for one endpoint auto-approved an unmatched gated call bundled into the same model message. A call that no policy-stating rule covers now contributes the policy it would inherit, strictest wins.

  • getAgent keeps deploying a conversation's pinned version on demand even when its deployment record says undeployed: the old-version cleanup undeploys a previous version whose only open conversations are paused (and retirement does the same for movable ones), so refusing would strand those approvals at the next deploy. docs/hitl.md claimed a resume after an undeploy returned 409; it now describes this.

  • The approver projection stripped the revision candidate (frozen prompt + tool results) from active steps but not from the redo cache an undo fills.

Memory, retention and reads

  • The raw read GET /conversationstore/conversations/{id} and approval-status?detail=full served audit:compiled_prompt — the agent's rendered system prompt — to an owner who may only USE the agent. Both now strip audit:* (keeping audit:token_usage) unless the caller has VIEW on the agent, as the detailed view and MCP read_audit_trail already did (ConversationMemoryUtilities.stripAuditData).

  • The retention sweep deleted the snapshot without the memory checkpoints (copies of the properties) and the HITL tool journal, removing the only link a later user erasure had to them. It now runs the same dependent cascade as a permanent delete; and both paths keep the snapshot and descriptors when any dependent delete fails (ConversationPurgeService.deleteDependentData), or when the vault is unavailable while the conversation references auto-vaulted secrets, instead of orphaning the copies.

  • The conversation listing's "search matches nothing → list everything" fallback decided by searching the whole store, an existence oracle over other users' conversations. It is now decided within the caller's own records.

  • Mid-turn memory checkpoints copied properties before the turn-end secret-context scrub, persisting a secret context value a property instruction had copied. The checkpoint copy is now scrubbed with the same thresholds (MemorySnapshotService.withoutSecretContextValues).

  • SecretValueScrubber decoded serialized JSON only in exact mode; in substring and whole-token mode a secret with a JSON-escaped character survived inside tool-call arguments. All modes now decode embedded JSON.

  • Attachment uploads to a legacy conversation used the descriptor's (null) owner as the quota identity, exempting them from the per-user quota; they now use the owner the access guard resolved.

  • An Idempotency-Key retry was served a turn's answer from the grace cache even when the turn's persist then failed; a failed persist now drops it (TurnIdempotencyService.forgetUnpersisted).

Administration

  • undeployThisAndAllPreviousAgentVersions counted down from any requested integer (one DB read and one undeploy task per number, plus an "undeployed" record for versions that never existed). The starting version must now be one the agent has (400 above its current version).

  • The agent quota counted only each agent's newest runtime version, so a failed newer version hid a live older one; it now counts any READY version. A deployment-count outage failed open; it now refuses with 503 while an agent limit is in force (TenantQuotaService.agentCountUnavailable).

  • The live log stream (/administration/logs/stream) kept delivering admin-only records after the opening token expired; it now closes at the token's expiry, as the cluster activity stream does.

Dead code and duplication

  • Removed SecretValueScrubber.scrubContext, ITurnAbandonment with ConversationService.abandonInFlightTurn (only a test called it), and the unused MemoryKeys.SYSTEM_MESSAGE / PROMPT.

  • ConversationAccessGuard's four near-identical owner checks now share one helper.

Design decisions

  • Pause-bound cancels re-verify the pause after the state compare-and-set and restore it on a mismatch, before any side effect — the same pattern resume uses — rather than adding a pause-id predicate to both stores' CAS.

  • The agent quota fails closed only where a limit applies, so a deployment-store outage never blocks deploys on deployments without an agent quota.

  • Whether an admin's explicit undeploy should block resuming the version's pending approvals is open: it needs an undeploy record that tells an explicit undeploy from the automatic cleanup, which writes the same undeployed status today.

  • Second review round: a bulk undeploy no longer answers 404 when the deployment records could not be read (500 instead); the log stream stops its initial batch when the token expires mid-batch; ConversationPurgeService.purge ends the conversation before the first irreversible cleanup step, so a delete that fails part-way leaves it unable to take a turn until the retry finishes (and when that write itself fails, the delete stops before any cleanup and is retried); the stale-turn tests also assert that no compare-and-set to ERROR happens.

Deferred

  • A persistent pending-deletion state (a dedicated state that blocks every read path, not only turns) is not added: a partly purged conversation is ENDED, findable for the retry, the retention sweep and erasure, but still readable through the history endpoints.

  • API-call quota spent on turns refused after admission (duplicate, skipped, ended): needs a refund operation in both quota stores or moving acquisition into the queued turn — a product decision on whether skipped turns count.

  • ConversationService's thin private delegators kept for reflective tests (§7): reducing them means rewriting the characterization suites that reach them via getDeclaredMethod; not done here.

Files: ConversationStepRunner.java, ConversationService.java, ConversationHitlService.java, HitlTimeoutHandler.java, HitlCrashRecoveryObserver.java, RestAgentAdministration.java, RestAgentEngine.java, RestLogAdmin.java, TurnIdempotencyService.java, RestConversationStore.java, RestAttachmentUpload.java, ConversationPurgeService.java, ConversationMemoryUtilities.java, MemorySnapshotService.java, SecretValueScrubber.java, IConversationService.java, TenantQuotaService.java, ConversationAccessGuard.java; docs hitl.md, gdpr-compliance.md, tenant-quotas.md, deployment-management-of-agents.md, rest-api-reference.md.


fix(engine): review findings — HITL, GDPR, Dream, alerts, audit, mail (2026-10-31)

Repo: EDDI (fix/review-engine-hitl-alerts)

Fixes from the CodeRabbit review and the full code review (against 01c3250) for the engine runtime and the packages around it. Each fix has a unit test that fails without it.

What changed and why

HITL

  • A reissue of an approved call that has already executed is gated again (ToolApprovalGate.REPEAT_REASON) instead of running a second time on one approval.

  • Approval patterns are matched by a linear glob matcher (ToolApprovalPatterns.matches), not one backtracking .* per wildcard.

  • TaskToolApprovalsResolver (strict) pins a task rule with no timeoutPolicy to WAIT_INDEFINITELY when it would inherit the agent's AUTO_APPROVE, so it cannot hide a stricter agent rule.

  • SelfUngatingGuard compares an LLM-store write against the stored configuration: a whole-document PUT that omits a stored task gate, or a patch on its ancestor, is refused (lookup wired through ActingAgentResources).

  • The tool journal's TTL expires EXECUTED entries only; a crash-orphaned EXECUTING claim is kept until its conversation is deleted, so a late approval cannot run the call again.

GDPR, tenancy, ratings, Dream

  • Erasure keeps conversation snapshots when attachment deletion failed, keeps mapping rows when their cache keys could not be read, and reports nodes that did not confirm the cluster stop (IClusterRpc.expectedPeers). restrictProcessing removes a legacy agent-owned row under the reserved key first, which otherwise made the restriction unenforced.

  • PostgresTenantQuotaStore.setQuota propagates a write failure (503) instead of acknowledging a quota that was never stored.

  • Withdrawing a rating blanks the comment excerpts alerts copied from it first; erasure could not find them afterwards.

  • Dream partitions consolidation by group readership (no union of group ids across groups), merges duplicate keys in linear time with the cap checked per append, and refuses a cycle whose pinned agent version names an ungranted vault secret.

Alerts and audit

  • Webhook targets, signing-secret references and multi-agent rules need the eddi-admin role (AlertAccess.hasAdminRole), not merely unrestricted visibility, which every editor has while workspaces are off.

  • Digests go out per originating agent; deleting/disabling a rule or setting its digest to NONE releases its DIGEST_PENDING events (IAlertEventStore.releaseDigestPending). An output value older than the erasure fence's lifetime is not stored. AlertEngine lost its test-only constructors and the duplicated 24-argument event rebuilds (AlertEvent.withMatch), and uses AlertMatchers.applies.

  • The audit chain check finds holes between sequenced rows in a window that also holds unsequenced rows (was UNAVAILABLE), and with signing on ignores positions claimed by v1/v2-signed rows, whose signature does not cover the sequence.

Mail

  • DkimVerifier refuses a header block with a bare CR or LF (the MIME parser splits a header there, the verifier did not). QuoteStripper's label patterns are possessive (quadratic backtracking on long blank runs).

Docs: Alerts, Audit Ledger, HITL, Secrets Vault.

  • Second review round: a digest is skipped when its rule was disabled or deleted after the pass began, and withdrawn (not delivered) when every held event was released first; NatsClusterRpc.expectedPeers reads presence uncached, fails closed when it cannot, and excludes this node by id; erasure keeps conversation snapshots when the conversation-id lookup failed; a failed tool-journal delete keeps the conversation (ConversationPurgeService.purge throws) so a retry can still reach the rows naming the approver; Dream warn mode logs ungranted vault references; agent-trigger cache misses re-check inside the stripe lock; AgentSetupService registers API-call locations before the creation loop so rollback sees them; two docs/Javadoc corrections.

Design decisions

  • A repeat of an executed approved call goes back to a human rather than replaying the journaled result: replay needs a new result path through ToolLoopRunner; re-gating is safe with the code this group owns.

Not done (deferred)

  • Stale cached alert rules can, for up to the rule cache TTL (60 s) on another replica, still create a DIGEST_PENDING event after the rule was disabled; such an event stays visible in the inbox until retention. Reconciling them needs a store query for held events of rules that are no longer digest rules.

  • Mongo journal TTL migration during a rolling update: an old pod can recreate the unfiltered idx_journal_ttl_claimed after a new pod dropped it, until it is stopped. Finish the upgrade (no old pods) before relying on the EXECUTING-claim retention; a versioned migration marker is not part of this change.

  • Audit tail / whole-trail deletion stays undetectable: it needs an anchored chain head stored outside the trail (or a predecessor digest in a new canonical form), which is a format change.

  • Interim narration of a tool-approval pause is not screened by the task's output guardrails: the narration is built in modules/llm (ToolApprovalGateSupport), where the guardrails live.

  • Alert webhook HMAC keys have no grant model of their own; with webhooks now reserved to the administrator role (who controls grants anyway) the remaining oracle is administrator-only.


fix(engine): review findings — runtime, scheduling, cluster (2026-10-31)

Repo: EDDI (fix/review-engine-runtime)

Fixes from the CodeRabbit review and the full code review (against 01c3250) for the engine runtime and the packages around it. Each fix has a unit test that fails without it.

What changed and why

Runtime and REST

  • CronParser.parseField checks a range's endpoints against the field's domain before enumerating it; 0-2000000000 used to allocate billions of boxed integers first (reachable from group cadences and schedules). The stepped loop no longer wraps on a huge step.

  • DocumentDescriptorFilter takes the deleted resource's id from the request path and the version parameter only; ?x=/<other id> made it mark another resource's descriptor deleted.

  • LegacyPathRewriteFilter rewrites a v5 store prefix only at the start of the path, and restricted/unrestricted only in /administration/{environment}/…. A substring replace turned DELETE /admin/gdpr/restricted into an erasure of user production.

  • WorkflowStoreClientLibrary reads secret instructions from the executable PropertySetter the task configures to; the check for PropertySetterConfiguration never matched, so failed turns of secret-collecting agents kept their input in dead letters.

  • RestInterfaceFactory addresses the HTTP listener EDDI is bound to (SelfUrlResolver's logic), not always 127.0.0.1, and forwards no caller token when that address cannot be resolved.

Scheduling and cluster

  • A schedule whose claim expired without an outcome (its node died or the fire wedged) counts as a failed attempt instead of being re-fired at once with failCount untouched — a node-killing fire could never dead-letter. The poll runs with concurrentExecution = SKIP. tryClaim re-checks enabled (MongoDB and PostgreSQL). POST /{id}/fire and the MCP fire_schedule_now tool are bounded by the fire timeout like a polled fire, so a manual Dream or ingestion run cannot outlast its lease and start twice. A disabled schedule can no longer be fired manually.

  • A scheduled fire that starts a conversation runs the agent's startup workflow under maxCostPerFire, and the turn gets the remainder.

  • A dead letter a node kept locally while cut off from NATS is discarded, not forwarded, when its conversation no longer exists (erased in the meantime).

  • NATS TLS verifies the broker host name (eddi.nats.tls.verify-hostname, default true); jnats sets no endpoint identification, so any trusted certificate for any host was accepted. Upgrade note: the broker certificate must now carry a SAN for every host in eddi.nats.url (an IP SAN for an IP address); see Clustering.

  • CacheFactory.evictLocal remembers key hashes instead of SHA-256-ing every cached key on every eviction event. BoundedLogStore's DB queue is capped (50,000; drops are counted and logged at flush). BoundedFanOut claims "not started" by compare-and-set, so an item reported as not sent can no longer go on and send. AgentTestRunner charges an abandoned (timed-out) turn's cost when it completes.

Cleanup: unused ClusterConfig.withDegradedNonces/withDegradedRateLimits/withHitlRecovery removed; misplaced Javadoc in ScheduleFireExecutor and SchedulePollerService moved to its methods; the nine fire-log blocks in ScheduleFireExecutor share recordFire.

Docs: Clustering, Scheduling, Configuration Reference.

  • Second review round: a manual fire cut off at its deadline (REST and MCP) answers a timeout (504 / an error result) instead of an empty 200, and leaves the schedule claimed until its lease expires rather than releasing it while the worker may still run (FireAbandonedException); a local dead letter whose conversation cannot be checked stays on the node instead of being published, and a legacy conversation without a stored state is no longer mistaken for a missing one; an unreadable startup spend leaves the turn no allowance instead of the full maxCostPerFire; BoundedFanOut no longer reports a gate-refused item as started; BoundedLogStore hands the database fixed-size batches; two docs/test corrections.

Design decisions

  • An expired claim is a failure, not a retry-now. The lease already outlasts the fire timeout by a margin, so a claim that expires means the fire is gone.

  • Hostname verification is on by default and can be turned off; an IP address in eddi.nats.url then needs an IP SAN.

Not done (deferred)

  • Late charges of an abandoned agent-test turn (AgentTestRunner) are still not persisted into the already-finalised run record; that needs an atomic adjustment of the terminal record or a hold on finalisation until the turn's persistence completes.

  • Local dead-letter forwarding vs GDPR erasure has no shared erasure marker: a node that reconnects between the shared purge and the snapshot deletion can still publish an erased turn (the existence check now closes the common case).

  • The SKIP poll cycle still waits for its batch's fires, so one long fire delays claiming other schedules on that instance; splitting the short claim cycle from the bounded fire wait is a larger change to the poller.

  • One fire-timeout mechanism instead of the executor's turn latch plus the poller's deadline: both now use eddi.schedule.fire-timeout, and the manual path is bounded; merging them is a refactor.


🔒 fix(engine-surface): review findings on channels, Slack, MCP, A2A, sharing and outbound HTTP (2026-10-31)

Repo: EDDI (fix/review-engine-surface)

Fixes from the CodeRabbit review and the full code review (revision 01c3250) for the external surfaces: integrations/**, engine/mcp, engine/security, engine/a2a, engine/httpclient.

Channels and Slack

  • Only credentials are vault-resolved. ChannelTargetRouter used to expand ${vault:...} in every platformConfig value, so an editor could put a restricted reference into a webhook's inputTemplate and read the plaintext in the resulting conversation. Only botToken and signingSecret are resolved now; everything else stays literal.

  • An unresolved credential is dropped, for every channel type. The resolver passes an unresolvable reference through unchanged, and Slack used that public text as its HMAC key. The router now drops it (as it already did for webhooks), and SlackSignatureVerifier refuses a reference-shaped key outright.

  • A Slack bot token honours its secret's allowedHosts (checked against https://slack.com/api/ via VaultHostAllowlist).

  • The approval card no longer borrows another integration's bot token via the editor-chosen approval channel; resume outcomes are posted only for conversations owned by a Slack principal (SlackUserIdentity.isSlackPrincipal), so a hand-made channel:slack:... trigger intent cannot post with another integration's identity. Only the reserved slack: form counts: a raw U123ABC-shaped owner is just a shape an OIDC principal can share, so a legacy thread mapping gets resume posts again once its next message re-keys it.

  • Event user ids are validated ([UW][A-Z0-9]+) before they become slack:<team>:<user>, so a teamless signer cannot alias a workspace-qualified user by sending user: "T1:U2".

  • Approval-card text is mrkdwn-escaped (tool previews, reason, agent label).

  • /v1 matrix parameters (v1;x/chat/completions) no longer skip OpenAiAuthFilter's key check.

MCP

  • chat_managed re-checks USE on the retained conversation's own agent, and a refusal there is the neutral "you may not continue this conversation" (the owner does own it), not "you do not own this managed conversation".

  • submit_group_human_input (and REST POST .../human-input) return an acknowledgement unless the caller is the owner or an admin. The Manager's submitHumanInput resolves to GroupConversation | HumanInputAcknowledgement (narrow with isHumanInputAcknowledgement).

  • McpAdminTools no longer echoes raw exception text: caller-fixable failures are described, everything else returns a log reference (toolFailure overload). Two refusals stay caller errors rather than INTERNAL: a guard's Quarkus ForbiddenException (ResourceAccessGuard, OwnershipValidator) answers errorCode FORBIDDEN with its reason, and malformed JSON in a config / resourceMappings argument answers "config is not valid JSON (line L, column C)" (McpToolUtils.readCallerJson) — resources, channels and triggers alike. list_agent_resources reads each distinct workflow once.

  • McpApiToolBuilder: spec parameter names that collide with template namespaces are renamed (properties_2); suffix allocation is linear; a spec server URL is literal (declared variables take their defaults, other {...} is refused).

  • OpenApiSpecFetcher repeats the target-policy check after connecting (DNS rebinding) and discards the response if it now fails.

Security, A2A, outbound HTTP

  • With authentication off, GET /agents/managed/... (creates a conversation) gets the same cross-site check as a POST.

  • Access requests answer a non-configuration id exactly like a missing one, after counting the attempt; a cascade skips HUMAN group members, budgets its seeding, and omits the name of a skipped resource the caller cannot view.

  • A2A caps caller-chosen ids at 256 characters and refuses non-scalar JSON-RPC ids. Every JSON-RPC response now carries the id member, "id": null for an unreadable request, as JSON-RPC 2.0 requires (JsonRpcResponse was NON_NULL).

  • httpcalls: a cross-origin redirect hop keeps only content-negotiation headers (a credential can sit in any header name); with SSRF protection off a redirect hop's connected peer is held to the previous hop's address class.

  • Constant-time compares in the area now use HmacSignatures.constantTimeEquals.

Deferred

  • Review eligibility pinned to the conversation's start version (ConversationAccessGuard.requireConversationRead) needs a descriptor field written by conversation setup (engine/internal) — left for that owner.

  • Former team members' share notifications need the share subject stored on the notification (store schema change) for a cheap read-time check.

  • Control-character scrubbers and domain normalisers (§6) live outside this area.

Files: ChannelTargetRouter.java, SlackSignatureVerifier.java, SlackEventHandler.java, SlackHitlResumeObserver.java, SlackUserIdentity.java, SlackHitlSupport.java, OpenAiAuthFilter.java, McpConversationTools.java, McpHitlTools.java, McpAdminTools.java, McpApiToolBuilder.java, OpenApiSpecFetcher.java, UnauthenticatedRequestGuard.java, ResourceSharingService.java, ConfigGraphResolver.java, WorkspaceNotifications.java, A2AWireFormat.java, A2AModels.java, McpToolUtils.java, HttpClientModule.java; docs: slack-integration.md, webhook-triggers.md, httpcalls.md, security.md, a2a-protocol.md, workspaces.md, group-conversations.md, architecture.md.


🐛 fix(groups): review findings — HITL scope, follow-up budget, task-force results, negotiation, JSON extraction (2026-10-31)

Repo: EDDI (fix/review-groups)

Fixes from the external code review and the CodeRabbit pass against 01c3250, group-conversation area.

What changed and why

HITL authority and read scope

  • Approvers can no longer cancel another user's running discussion. The group cancel on REST and on the MCP cancel_group_discussion tool now uses HitlAccessGuard.mayCancelExecuting, like the 1:1 surface: an approver-only caller gets a paused-only cancel (cancelPausedDiscussion, one compare-and-set on AWAITING_APPROVAL / AWAITING_HUMAN_INPUT) and 403 / FORBIDDEN on a running discussion. The Javadoc that claimed both surfaces already did this is now true.

  • Responses no longer hand the transcript to callers who may not read it. The JSON approve, the human-input submission and the approver cancel return the conversation only to its owner or an admin; an approver or a pending HUMAN member gets {"state": …}. MCP approve_group_phase and submit_group_human_input match.

  • A human-turn resume no longer runs as the submitter. resolveHumanTurn bound the submitting member's identity to the rest of the owner's discussion, so later ${caller:token} calls went out with their token. It now uses resumeCallerFor, the rule the approval resume already followed.

  • Group HITL timeouts are bound to their pause. Approval ABORT, human-turn ABORT and SKIP_TURN pass the schedule's pauseId; a late fire no longer skips a newer human turn or cancels a discussion that has resumed. Stale skipHumanTurnOnTimeout Javadoc ("never throws") corrected.

Discussion engine

  • Follow-ups respect the cost ceiling and are accounted. followUpWithMember refuses once the effective maxCostPerDiscussion is spent (409), harvests the member's cost into the ledger, and propagates dynamic-agent tracking so sub-agents created in a follow-up are cleaned up with the discussion.

  • A skipped or errored task-force member fails its task. It used to complete the task with a null result, unblocking dependents that then ran without its output. SharedTaskList.completeTask / submitForApproval now refuse a null result.

  • Negotiation cannot record a stale agreement. Accepting a proposal withdraws the signer's signature from every other open proposal. An agreement keeps the dissents a dissent round recorded, and an arbitration verdict now replaces a dissent-only NONE record instead of being dropped.

  • One balanced JSON extractor for every group engine (EmbeddedJson): facilitator, retro, vote, negotiation, bid, convergence and debate parsers, and the VERIFY phase. The greedy first-{-to-last-} slice dropped a ballot followed by a brace in prose; the first-[-to-last-] slice made VERIFY fail open on any bracketed aside. Each engine accepts only an object carrying a key it reads (vote/votes/statement, bids, move, lessons, accept/proposal/concessions, passed, agreementScore, winner), so an unrelated object in the prose (an example, a quoted config, {}) is neither taken for the reply nor a rival to it. A reply carrying two well-shaped values is ambiguous and rejected — unchanged for the greedy engines (two objects never parsed as one), but a behaviour change for bids and bargain moves, which used to take the first. The documented fail-open on a truly unparseable verdict is unchanged.

  • groupTranscript is scoped by the phase's contextScope, like the rendered prompt, and a member conversation's startup step now receives the group's dynamic-agent policy instead of the permissive standalone default.

  • Stance extraction is linear. leadSentence rescanned the prefix at every terminator.

Dead code: GroupConversationService.DEFAULT_ENV, PhaseOutcome.endDiscussion / END_DISCUSSION and the unreachable endDiscussionEarly handling, and the findMember / findMemberIncludingDynamic reflective delegators (covered directly by TaskForceEngineTest).

Not done

  • Retention revocation (unretainAgent) still does not propagate to the group registry, and the discussion-wide creation cap is still checked against a per-member copy. Both need a change in modules/llm (DynamicAgentToolsProvider / CreateSubAgentTool) to record revocations and reserve slots.

  • The approval/reject CAS still compares only state, not the pause id; that needs a multi-field conditional write in the storage layer.

  • The remaining ~24 private delegators in GroupConversationService stay until their reflective tests are ported.

  • Second review round: the follow-up cost-ceiling lookup propagates store failures instead of meaning "unlimited"; an exhausted EmbeddedJson candidate budget is ambiguous, not a unique match; an ABORT no-result task turn stops the following waves; a blank task result is no result; a verification array is accepted only when an element carries a subject.

Files: GroupHitlCoordinator.java, RestGroupConversation.java, McpHitlTools.java, HitlAccessGuard.java, HitlTimeoutHandler.java, GroupLifecycleOps.java, TaskForceEngine.java, NegotiationEngine.java, EmbeddedJson.java, hitl.md, group-conversations.md, passing-context-information.md


Deployment and script hardening from the code review (2026-10-31)

Repo: EDDI, branch fix/review-infra. Low-severity findings in operator scripts and manifests.

  • install.sh: every Keycloak admin call now sends its bearer token through a 0600 curl config file (kc_authed_curl) instead of -H on the command line, so it no longer shows in /proc/<pid>/cmdline. The already-running repair path verifies the downloaded keycloak/eddi-realm.json against the release SHA256SUMS before posting scope definitions to Keycloak, and no longer sends stored Keycloak/Grafana admin passwords to a localhost port unless Docker reports a running container of this installation's compose project, for that service, publishing that port; when Docker cannot be queried the credentials are withheld. The check sits in kc_password_token, so every password grant is covered. A bearer token is accepted into the curl config only if it consists of token characters, and a failed realm download is truncated so no unverified partial file reaches Keycloak.

  • gcp/provision-vm.sh: --vault-key is removed. The key was appended to the installer flags, uploaded as startup-script instance metadata and echoed into /var/log/eddi-install.log; the VM now generates its own master key (in /root/.eddi/.env on the VM), like the Keycloak admin password. Passing the flag is an error that says why.

  • docker-compose.yml, docker-compose.cluster.yml, docker-compose.postgres-only.yml: the bind guard fails closed. Only false/0/no/off (any case) count as "authentication on"; TRUE, 1, yes... no longer slip past the refusal.

  • docker-compose.auth.yml: keycloak-admin-rotate writes the .eddi-admin-verified marker only after a successful login with the configured credentials. When KC_BOOTSTRAP_ADMIN_USERNAME names another user, the original admin account is also tried with admin and rotated to the configured password if it still accepts it, so a renamed admin user can no longer certify a volume whose admin/admin remains. kcadm reads the configured password from KC_CLI_PASSWORD (supported by kcadm 26.x) instead of --password, so it stays out of the process arguments; stdin is not an option because kcadm's prompt needs a console.

  • Helm: nats.externalUrl containing @ is refused (it lands in a ConfigMap); new nats.externalUsername / nats.externalPassword go to the chart Secret. A password without a username, these values alongside eddi.existingSecret (which would make them inert), and these credentials with a non-tls:///wss:// server are all refused at render time; nats.externalAllowPlaintext=true is the opt-out for an encrypted transport underneath EDDI. Chart 2.12.0 → 2.13.0. docs/kubernetes.md updated.

  • Kustomize: warnings in the ingress component (plain HTTP as shipped; the redirect annotation is named as ingress-nginx-only) and in the auth overlay (remove the localhost redirect URIs outside dev). k8s/create-secrets.ps1 writes the temporary key file into a private directory made before any cluster change (mktemp -d, mode 0700 from creation, on Linux/macOS; a per-user temp subdirectory on Windows), so it works on every PowerShell 7.x and a failure there cannot follow the -Force delete.

  • docs-site/scripts/check-live.mjs: redirects are followed only to the configured origins (parsed origin comparison, not string prefix).

  • scripts/cluster-demo/mock_llm.py: 10 s socket timeout, 1 MiB body cap, and loopback by default (demo.py binds it to the docker bridge gateway with Docker Engine on Linux via MOCK_LLM_BIND, keeps loopback on Docker Desktop, including Docker Desktop for Linux, never all interfaces, and aborts when the mock does not come up listening; the README's manual --external-mock example sets the same binding). scripts/loadtest/loadtest.py: startup state moved from the world-writable results/ to scripts/loadtest/.state/ (0700), written atomically through a fresh mkstemp file per save (no shared .tmp between overlapping runs), a symlinked state directory refused, symlink ignored on read. src/main/docker/seed-demo-agent.sh: the provider key goes to curl on stdin, not -d, and a key or allowed host with anything but printable ASCII (a trailing newline included) is refused instead of being altered or producing invalid JSON — the curl image has no JSON encoder.

Decision: the shipped k8s base (unauthenticated quickstart), the Prometheus overlay and the other BY_DESIGN findings are unchanged.


🐛 fix(ingestion): resource limits in HTML conversion, crawling, extraction and the RAG pipeline (2026-10-31)

Repo: EDDI (fix/review-ingestion)

Fixes from the external code review and CodeRabbit for the ingestion and RAG modules. Almost all are denial-of-service shapes: compact input from a crawled page or an uploaded file that made a worker do work out of all proportion to its size before any limit was consulted.

What changed and why

  • Nested HTML tables were exponential (HtmlToMarkdownConverter). Rows and cells were found with descendant selectors, so a table also rendered the rows of every table nested inside it, and again inside the cell holding them; cells restarted the depth count at zero, so MAX_DEPTH never applied. Twenty nested tables did not finish. A table now reads only the trs it owns (its children and those of its own thead/tbody/tfoot) and a row only its child cells, with the depth carried through. The same doubling existed for a summary or figcaption nested below a details/figure; those are now taken from direct children only. A per-conversion work budget (Walk) backs this up: at most 1,000,000 elements visited, and the walk stops writing once the text written is certain to be truncated by the caller's cap; whitespace-only text between tags is not charged, or an indented page with a small cap stopped before its first paragraph. Ordinary tables render as before (checked differentially against the previous converter); a table with several tbodys, a tfoot or a multi-row thead now keeps those rows instead of silently dropping them, and a table whose thead is empty takes its first body row as the header.

  • Trailing newlines in a <pre> were trimmed quadratically — one substring per newline. Now one backward scan and one copy.

  • Sitemap <loc> text was copied once per nesting level (WebCrawler.collectText): only a leaf <loc>/<link> counts now, and entries longer than the protocol's 2,048 characters are dropped. Links longer than 8,192 characters are not followed. The unused BYTE_ORDER_MARK constant is now the one the text-sitemap reader compares against, in place of a unicode escape.

  • Exclude globs no longer compile to a backtracking regex (UrlPattern). A pattern with several wildcards could take combinatorial time on a near-miss path from a crawled page; matching now steps the set of reachable pattern positions per character — pattern length × path length, always. It steps by code point, as the regex did, so ? still matches one supplementary character. The one difference: *, ** and ? now match a line terminator (a decoded %0A in a path), which the regex's . did not, so such a path can no longer slip past an exclusion.

  • Spreadsheet cells were copied in full before the character limit was checked (MarkdownTable). One shared string referenced from 64 header cells rendered hundreds of MB. Each cell is cut to what can still fit before it is normalised and escaped.

  • maxSegmentsPerRun was checked after paying for the document that crossed it (IngestionPipeline). It is now checked after splitting and before embedding: a document that would cross it waits for the next run (stamped as looked-at so it is not counted as missing), and a document larger than the whole budget is reported as failed instead of embedded in part.

  • Ownership is re-checked after the embedding provider answers, before addAll, so a run reaped during a stalled provider call can no longer republish a deleted file's chunks.

  • Chunk settings are bounded: chunkSize 1–32768 and chunkOverlap ≤ half of it are enforced in RagConfiguration.validate(), and both ingestion paths (IngestionPipeline, RagIngestionService) read them through chunkSizeOrDefault()/chunkOverlapOrDefault(), which clamp a configuration stored before the check. An imported archive's out-of-range values are clamped the same way (RagConfiguration.clampChunkSettings(), from RestImportService on create and update) rather than failing the import, and the Manager's chunk-size slider now pulls the overlap down to half the new size, so the default overlap of 64 no longer makes a chunk size of 64 unsaveable. The crawl pipeline's fallback for an explicit null was 1000/100 and is now the documented 512/64; RagIngestionService threw on an explicit null.

  • PDF: PdfStreamBudget remembered neither the next endstream nor the last obj, so a file of unterminated stream keywords was scanned in quadratic time — both are now carried forward. PdfDecodeBudget refuses a PNG/TIFF predictor whose declared row exceeds 4 MB before PDFBox allocates its two row buffers. PdfTextExtractor now charges the decode budget for the page content PDFBox reads around the counted filters: a lone /FlateDecode /Contents stream (which PDFBox 3.0.8 inflates with a FlateFilterDecoderStream it builds itself — confirmed in the bytecode) is decoded once through the counted filter first, and every reference to an unfiltered content stream is charged its length.

Design decisions

  • The table fix is structural (ownership + depth) and the work budget is a backstop, not the fix: the budget alone would have turned the exponential case into a silently truncated document.

  • Over-budget documents are deferred, not truncated: a partially embedded document recorded as ingested would hide its tail until the page next changed.

  • Not changed: the review suggested keeping an upload source's files when forgetSource fails to remove its chunks. RagSourceIngestionServiceTest.survivesAVectorStoreThatRefuses pins the opposite as a deliberate decision — the configuration is already saved, so keeping the files leaves the operator no way to retry — and nothing would ever retry. A durable retirement/retry record is the real fix and is left open.

Files: HtmlToMarkdownConverter.java, WebCrawler.java, UrlPattern.java, MarkdownTable.java, PdfStreamBudget.java, PdfDecodeBudget.java, PdfTextExtractor.java, IngestionPipeline.java, RagIngestionService.java, RagConfiguration.java, RestImportService.java, rag-editor.tsx, rag.md, and the matching tests.


🐛 fix(llm): every model-phase exit records its spend; guardrail redactions reach the summarizer and recall tool (2026-10-31)

Repo: EDDI · Branch: fix/review-llm-cost · Review group H1 (LLM task core: cost accounting, spend gate, guardrails), from the code review report (§3 #2, #3, #4, #12, §5, §6, §7) and the verified CodeRabbit findings

What changed and why

Spend of a failed model phase was never recorded (#2). A task wrote its cost from the result of its model phase, so a phase that threw — a tool loop whose seventh round hit a provider error or the context limit, a cascade step that timed out, a cascade whose every step failed — lost everything it had spent: the tenant's monthly counter and maxCostPerConversationUsd never saw it, with or without onError: fallback. Now:

  • UnrecordedSpend carries a failed phase's spend on the failure (a suppressed throwable, so it survives wrapping; drained at most once). The tool loop attaches its answered rounds and tool cost on every failure exit; the cascade folds a failed step's rounds into its run totals, prices a timed-out step's completed rounds from the step's ToolExchangeRecorder (which now records each round's usage as it finishes), and attaches the run's totals to the failure it finally throws — including a spend refusal, an open circuit, or a run ceiling (maxCostPerRun, duration, turn deadline) reached before a later step when every earlier step had failed.

  • LlmTask.recordSpend is the one place spend reaches the step; a returned phase, a pause (recordPrePauseSpend) and a failure (recordFailedPhaseSpend) all pass through it. The returned phase's spend is now recorded as soon as the phase is over, before JSON conversion and postResponse can fail the task, and a rejected answer (responseValidation error, a failed reprompt) records the answer's cost before it rethrows.

One price decision instead of six (§6). ModelPrices decides which prices a phase is charged at (task, or cascade step → cascade default). The tool loop used the task's prices for its mid-loop ceiling and its pause spend even inside a cascade step, so with prices set only on the cascade the ceiling ignored token spend and a pause recorded $0. The cascade now hands the loop its step's prices through the recorder, and a resumed cascade step is priced at that step again.

Tenant check before a tool call (#12). It compared the budget against the counter as it stood before the turn. It now passes the step's unmetered audit:cost plus the running loop's spend, the figure LlmSpendGate.admit uses for every other paid call.

Redactions leaked through the rolling summary and the recall tool (#3). Memory keeps the user's text as sent; pii-redaction, regex-filter and prompt-injection re-screen only the history window, so a turn they rewrote reached the summarizer (possibly another vendor), the summary placed in every later system prompt, and recallConversationDetail verbatim. GuardrailService.screenHistoricInput applies the history rule to one stored text; the summarizer screens the turns it sends and the recall tool the turns it returns. The summary sits in the system prompt inside the retrieved-context provenance envelope. The summary call and a tool result's summarize truncation are now admitted by the spend checks and priced at the task's rates (the summary on audit:cost, the tool summary as a priced summarizeToolResponse tool call). A cross-provider summary no longer inherits customHeaders, customQueryParams, customParameters or provider account keys.

Guardrails.

  • pii-redaction missed a card followed by its CVV or expiry: the greedy run failed Luhn as a whole and was skipped. The digit-group windows of the run are now checked (longest Luhn-valid window wins; an unseparated number is never split), and a run that holds no card is searched again from its next digit group, so groups in front of a card (ref 1234 4111 1111 1111 1111) do not hide it. Unspaced +E.164 numbers count as phones. Every pattern repetition is bounded, so the e-mail scan is linear (it was quadratic on a long local-part run).

  • A warn output guardrail with failMode: closed now forces buffering — it can withhold the answer.

  • The expression guardrail reads the answer the tolerant way too and treats a disagreement as undecided: strict extraction could skip an earlier duplicate-key object and approve a later one while the task's conversion consumed the earlier.

  • The HITL self-checks judge an MCP/A2A call by its arguments as well (RemoteToolRequestResolvers.Envelope): the resolved URI is the server, not the conversation or resource the call targets. The approved call's outgoing request is also refused when a preRequest instruction pointed it at the running conversation (ApprovedCallScope carries the conversation id).

Tool cost tracking. A non-finite toolPricing value fell through Math.max as NaN and poisoned every total; it now falls back to the default price. A timed-out tool call is charged. An entry found over budget is evicted only after every under-budget one, and the conversation whose charge triggered the eviction is never a victim (with the map nearly all exhausted entries it used to go with the other under-budget ones). A tool whose waiting pipeline thread is interrupted (a cascade step timeout, the agent watchdog) is charged like a timed-out one, and a timed-out cascade step is given up to CANCELLED_STEP_SETTLE_MS (1 s) to unwind before its tool spend is snapshotted, so that charge lands in the failed step's spend and maxCostPerRun. ToolCostTracker.resetConversation (unused) is gone.

Self-ungating argument check. SelfUngatingGuard.refusalFromArguments searched the raw arguments only, percent-decoded, so a JSON unicode escape (toolApprovals or an id with one letter written as \uXXXX) passed it while every downstream JSON parser read the plain key. It now also searches every key and string value of the arguments parsed as JSON, re-parsing string values that are themselves JSON a few levels deep.

Streaming. A tool-loop round that failed after forwarding text was retried into the same sink (partial + full answer); it is now raised as PartiallyStreamedRoundException, which the retry does not repeat. Its message is fixed: it used to carry the forwarded character count, and a count of 429 or 502-504 read as an HTTP status to LlmFailureClassifier, making exactly that failure retryable again.

Dead code / docs (§5). LlmSpendGate's misplaced Javadoc fixed; AgentOrchestrator's unused DEFAULT_MAX_PAUSES_PER_TURN, PAUSE_REASON_MAX_CHARS, mergeExternalTools and the test-only delegators removed.

Files: LlmTask.java, ToolLoopRunner.java, CascadingModelExecutor.java, ModelPrices.java, UnrecordedSpend.java, ConversationSummarizer.java, GuardrailService.java, PiiRedactionGuardrail.java, ToolCostTracker.java, ToolExecutionService.java, ToolLoopStreamingChatModel.java, SelfUngatingGuard.java; docs: langchain.md, tenant-quotas.md.

Design decisions

  • Carry spend on the failure, don't write it as you go. Writing each round into audit:cost immediately would have changed the accounting model of every path; a carrier mirrors the pause's addSpend and leaves the success path untouched.

  • Summaries are priced at the task's rates. No price is configured for a summarizer; the task's model is the same provider and normally the dearer model, so this errs on the side of the budget. A dedicated summarizer price is a possible follow-up.

  • Screen at the consumer, lazily. The summarizer screens only the batch it sends and the recall tool only the turns it returns, rather than modelFacingOutputs screening the whole conversation every turn.

Not done

  • SecretRedactionFilter still has no Cookie/Set-Cookie rule (owned by the secrets area; a fuzzed filter — left for that group).

  • The per-conversation tool budget stays in memory (lost on restart); documented, with maxCostPerConversationUsd as the durable bound.


🔒 fix(llm): review findings in the LLM module periphery — secrets, SSRF, tool limits (2026-10-31)

Repo: EDDI (fix/review-llm-tools)

What changed and why

Fixes from the two external reviews of revision 01c3250 (CodeRabbit security scan and the code-review report), for the built-in tools, model builders and embedding/A2A tool providers.

Secrets and destinations

  • Embedding/vector-store errors no longer quote parameter values. Parameters reach the factories with vault references already resolved, and RAG search responses and ingestion status return the error message to the editor: a ${vault:…} reference put in timeout, dimensions or a store's port came back as plaintext. The messages now name the parameter only (and drop the NumberFormatException cause, whose message quotes the input); the model/modelName conflict check runs before resolution.

  • Vertex apiEndpoint is an endpoint key for allowedHosts (ChatModelRegistry.ENDPOINT_KEYS), and an OpenAI-compatible preset without baseUrl is checked against the URL its editor-chosen region selects (new ILanguageModelBuilder.defaultEndpoint).

  • Secret invalidation reaches models built through ${vars:…}: the cache key holds unexpanded parameters, so every variable-bearing chat model is evicted with a changed secret.

  • Embedding model and store caches use structural keys instead of TreeMap.toString(), which could render two different parameter maps identically and share one client.

  • Cached model clients re-check their destination before every request. BoundedJdkHttpClient takes the OutboundTargetPolicy and validates each request URL (OpenAI, OpenAI-compatible, Ollama, Anthropic, Gemini, Mistral; OpenAI and Ollama embeddings) — a hostname validated once at build was otherwise re-resolved unchecked for the model's whole cache life (DNS rebinding). docs/security.md gains a row for this path and names what stays build-time only (other SDK transports, MongoDB Atlas replica-set discovery).

Tools and providers

  • WebScraperTool and PdfReaderTool send model-chosen URLs STRICT, not HOPS_ONLY, so the first hop gets the facade's post-connect re-check. OpenApiSpecFetcher (policy NONE, own loop) re-validates each hop after the response arrives. WeatherTool/WebSearchTool keep HOPS_ONLY: their hosts are fixed.

  • WebScraperTool.extractWithSelector refuses CSS escapes (jsoup decoded :\6d atches into a regex selector) and sibling combinators ~/+ (quadratic evaluation the parse timeout cannot interrupt); the same characters in quotes, attribute selectors, :contains(…) text or :nth-* formulas are not combinators and still pass (unterminated quotes or brackets fail closed).

  • TextSummarizerTool splits sentences with a linear pattern (the old one was quadratic on a punctuation run without whitespace). DataFormatterTool.csvToJson caps rows and output size; extractJsonValue reports a missing/non-array field instead of an NPE.

  • AttachmentTextExtractor extracts with a bounded stripper: an operator budget, a deadline and interrupt checks (repeated unfiltered forms spent no decode budget).

  • A2A discovery bounds agent-name/skill-id length and skill count, logs duplicate skills once per card, and skips a tool name another peer already registered (the later peer's executor used to replace the first's under the first's spec).

  • find_agents_by_capability filters by the caller's USE rule, as the REST search does. converse_with_agent carries the chain's depth ceiling (delegationDepthMax, inside the reserved context namespace) so a delegate cannot extend a chain the originator capped.

  • Group artifact and task tools honour a member's non-empty builtInToolsWhitelist (slugs artifacts, group_tasks). Behaviour change on upgrade: a member whose LLM task already has a non-empty whitelist stops receiving these tools in groups that enable them until artifacts / group_tasks is added to that list. The Manager's tool picker (BUILT_IN_TOOLS in ui/manager) now offers both slugs, and switching a task to whitelist mode there selects them along with the rest — they are self-gating, so they enable nothing outside a group that asks for them.

  • FetchToolResponsePageTool is marked @ConversationBound and no longer served from the tool cache.

  • UserMemoryTool re-checks cancellation right before writing and takes back an insert that landed after the turn was cancelled (erasure race).

  • Negative rate limits are refused at save time (ToolRateLimiter.validateLimits, called from LlmStore); 0 blocks a tool.

  • ObservableChatModel/ObservableStreamingChatModel log model responses at DEBUG, like requests.

  • The confidence judge's JSON extraction delegates to the new ModelOutputParser.extractFirstObject. Removed the unused CustomToolConfiguration.

  • Second review round: UserMemoryTool no longer deletes anything to make room before the write has landed (the eviction victims are planned first, deleted afterwards, each only if unchanged since it was chosen), and a cancelled turn takes back only its own write, conditionally, leaving a different turn's entry under the same key alone; A2A skill filters compare the skill id as the card gave it, and an id too long for a tool name keeps a hash of the whole id so distinct long ids stay distinct tools.

Design decisions

  • Redaction instead of rejecting vault references in non-credential fields: the leak was the echo, and rejecting would break any config that legitimately keeps e.g. a host in the vault.

  • The per-request destination check is the MCP transport's approach (pre-send check, cache-expiry residual), not address pinning — the JDK client has no resolver hook.

  • DataFormatterTool and OpenAiCompatibleLanguageModelBuilder.putPath keep their own path walkers: PathNavigator works on maps with +/- arithmetic (a hyphenated JSON key would resolve to null) and its setValue neither creates intermediate maps nor copies shared ones.

Deferred

  • Jlama loader allocation/path-traversal findings are in jlama-core 0.8.4 (third party); needs an upgrade or an operator allow-list of model repositories.

  • MongoDB Atlas replica-set discovery is not re-checked against the outbound policy (documented); forcing directConnection would break mongodb+srv clusters.

  • A store-level erasure generation for user memories (needs IUserMemoryStore and GdprComplianceService changes).

  • Provider-builder build()/buildStreaming() duplication: langchain4j's separate builder types make a shared helper no cleaner.

Files: ChatModelRegistry.java, EmbeddingModelFactory.java, EmbeddingStoreFactory.java, BoundedJdkHttpClient.java, A2AToolProviderManager.java, WebScraperTool.java, security.md, secrets-vault.md, langchain.md, group-conversations.md


fix(modules): pipeline-module review findings (2026-10-31)

Repo: EDDI (fix/review-modules)

What changed and why

Fixes from the code review and the CodeRabbit sweep over the pipeline modules (nlp, apicalls, properties, templating, rules, mcpcalls).

apicalls

  • A delayed HTTP call (preRequest.delayBeforeExecutingInMillis, retry backoff) no longer hands its blocking send to the single shared eddi-scheduler thread. The delay is served on the calling turn thread, so one slow request cannot queue every delayed call in the node behind it, and an interrupted wait sends nothing instead of leaving a queued send to fire later; the thread's interrupt flag is restored when the step fails on it.

  • Vault references are found with the linear SecretReference.scanner() (request building) and a new linear scanner in ConfigReferenceGuard, instead of regex find() loops that rescanned the remaining text at every unterminated ${vault: opener (quadratic work on a long input).

  • A vault secret resolved into the URL, body or a query value now disables redirect following, as a header secret already did; the redirect handler would otherwise replay the body on a 307/308 to a host the secret's allowedHosts never judged.

  • The malformed-JSON warning no longer logs a resolved credential that the parser quoted in its message.

nlp

  • POST /parser/{parserId} rejects an id that is not a store id (hex or UUID) before authorizing it. An id such as <other>?version=3&x= was authorized as one resource and resolved to another.

  • The merged-terms and Damerau-Levenshtein corrections skip tokens over 100 characters (ICorrection.MAX_CORRECTABLE_LENGTH): their cost is quadratic in the token length and the parser limits the number of tokens, not their length.

  • PunctuationNormalizerProvider no longer stores one parser's punctuationRegexPattern in a singleton field that became the default of every parser built afterwards. PunctuationNormalizer matches under the same 200 ms regex budget as dictionary regexes, because the pattern can leave its character class.

properties

  • scope: "secret" with toObjectPath is rejected on save and at run time (the copy returned before any vaulting). A secret instruction whose value is converted to an object and refused now scrubs the raw input first. Properties extracted earlier in the turn can no longer put a vaulted plaintext back or overwrite a vault reference created in the same execution (one from an earlier turn stays replaceable, as before); a normalized copy of the plaintext (punctuation or whitespace stripped by a parser normalizer) is caught by the same normalization-insensitive match the input scrub uses, and the whole value is replaced. The live output scrub is deep, so a credential in a typed output item (an LLM reply) is removed.

rules

  • dependency conditions evaluate a rule once per evaluation instead of once per path to it; a chain of rules that each depend twice on the previous one cost 2^n evaluations. A remembered result is not reused for a rule on the active trace, so a rule depending on its own (duplicated) name still fails as an infinite loop.

  • connector operator is case-insensitive, defaults to AND (as documented) and an unknown value is refused at validation instead of silently becoming OR; getConfigs()/clone() can no longer throw on a connector without one.

  • Removed Rule.clone(): unused, and it dropped the rule's actions.

mcpcalls

  • An MCP call without a retry block now makes a single attempt (it used to fall through to the shared three-attempt default, so a side-effecting tool could run three times), and retries stop when the turn deadline leaves no room. Inside a turn deadline the attempt runs on the retry helper's executor, so the task now carries the turn's caller across (CallerIdentityContext.propagate): without it an MCP server's apiKey: "${caller:token}" would have found no caller there and failed closed. An interrupted turn is rethrown as such: it no longer writes an <name>Error entry, runs postResponse or continues to later calls under continueOnError.

templating

  • str:concat and str:join are measured before the generated resolver builds them, so reusing one permitted value many times can no longer allocate past eddi.templating.max-output-chars. The measurement follows Qute's varargs binding: a list is one argument rendered with its brackets and separators, and only a sole Object[] is expanded into its elements.

  • Template preview redacts the snippets namespace for restricted callers whatever getAll() returns.

Not changed (decisions)

  • SecretPropertyVault still reads the tenantId conversation property: the guard reads the same property and multi-tenancy is not implemented yet; deriving the tenant from trusted context is a product decision.

  • CapabilityMatchCondition stays unfiltered: rules run off the request thread, where the access guard has no identity to filter by.

  • Quick-reply expression values from an HTTP response are not escaped (needs an expression-escaping design); a per-parse regex deadline for RegularDictionary and a cumulative loop-result budget in the template engine are left as defense-in-depth follow-ups.

  • An MCP attempt abandoned at the turn deadline is not cancelled inside the transport: langchain4j's DefaultMcpClient exposes no cancellation of the in-flight request, and a request already sent cannot be recalled by any client-side cancel. Retries stay opt-in, so the tool runs at most once.

  • The dotted-path walkers in OutputMatcher and ResponseShapeValidator are not replaced by PathNavigator: its arithmetic-expression fallback and array syntax differ from their strict lookups, and both live outside this area.

Files: ApiCallExecutor.java, ConfigReferenceGuard.java, RestSemanticParser.java, PropertyInstructionExecutor.java, Dependency.java, Connector.java, McpCallsTask.java, BoundedFormat.java


fix(secrets): review findings on the vault grant check, redaction, connections and legacy sealing (2026-10-31)

Repo: EDDI (fix/review-secrets)

Fixes from the 2026-10 external review (CodeRabbit plus a manual code review) in secrets/** and connections/**.

What changed and why

Deploy-time grant check (VaultGrantChecker): it now reads what the runtime reads

  • A step's config URI is trimmed, as ResourceUris.require does at runtime, and the store is picked by an exact match on the config URI's host, the key ResourceClientLibrary reads with. Before, a URI with surrounding whitespace failed to parse and went unchecked, a step typed with the ai.labs.langchain alias went unscanned, and contains() on the step type could pick the wrong store, fail, and skip the config.

  • Every string value is scanned on its own, not the serialized document. An unterminated ${vault:x in one field used to run on to the next field's closing brace and swallow the real reference behind it.

  • A workflow, credential-bearing extension config or ${vars:…} that cannot be read is now a violation (fail closed), as an unreadable connection already was. Unreadable grant metadata still counts as granted, as documented.

Redaction

  • ConfigSecretRedactor: a header or query map stored as a JSON string (customHeaders, customQueryParams) has its entries judged like a real headers/queryParams map. In a credential field, a value with no reference is always a literal (a scheme word alone included), and symbols or non-ASCII letters beside a reference no longer count as scaffolding.

  • Query names are classified percent-decoded in ConfigSecretRedactor, SecretScrubber and UriRedactor (%61pi_key is api_key).

  • UriRedactor's shared header rule adds cookie and signature (substring) and sig, session, sessionid, sid (whole word).

  • SecretRedactionFilter: a connection string with an empty username (redis://:pw@host) and a password containing a comma are redacted; Digest directives allow whitespace around =. A Cookie / Set-Cookie header has every cookie value redacted with the cookie names kept (Cookie: sid=<REDACTED>; theme=<REDACTED>); Set-Cookie attributes such as Path, Expires and HttpOnly stay readable, and a second pass is a no-op.

  • Linear time: SecretRedactionFilter's optional vault-reference prefix is bounded (a run of password:${vault: was quadratic), and SecretScrubber, VaultHostAllowlist.referencesIn and CredentialReferenceResolver use the linear ReferenceScanner instead of [^}]* regexes. SecretScrubber.redactFreeText restores its masks in one pass.

Vault

  • SecretResolver: a value read while an invalidation ran is no longer left in the cache for the TTL (invalidation counter, re-checked after the put).

  • VaultHostAllowlist.requireAllowed refuses a reference whose secret does not exist instead of skipping it: on the API-call path it runs after resolution.

  • A secret's allowedHosts now applies through a connection: a STATIC/BASIC connection's vault references are checked against the call's target, an OAuth client secret against the token URL (CredentialReferenceResolver.requireHostsAllowed).

  • VaultSecretProvider.store: a rotation is update-only (ISecretPersistence.updateSecretIfPresent); a row deleted mid-rotation is treated as a create and needs a grant, instead of being re-created with allowedAgents: ["*"].

  • Legacy unbound (no-AAD) data: every open through the fallback is counted (eddi.vault.legacy.unbound.opened.count), and eddi.vault.accept-unbound-legacy-data=false (default true) retires the fallback once a DEK rotation has re-sealed everything. Re-sealing a legacy secret on read also replaces its bare SHA-256 checksum with the keyed form. decryptSecretWithFallback (a one-line wrapper) is inlined. The property is in the configuration reference and the counter in metrics.md, the monitoring guide and the Full Metrics Reference dashboard ("Vault errors" panel). updateSecretIfPresent and the checksum-replacing re-seal have their own unit tests on both stores.

  • RestSecretStore.updateGrant evicts cached clients when the host list was written, even if the grant write after it is refused (409) or fails.

  • AutoVaultedSecrets.belongsToUser reads the owner from the slot's second segment only; a property name carrying another user's hash no longer makes the slot theirs.

Connections

  • RestConnectionStore.createConnection requires eddi-admin in the implementation too: the archive import (open to eddi-editor) called it directly. An editor's import now skips connections with a logged reason.

  • The OAuth callback re-reads its claimed state row after storing the grant and discards the grant if the row is gone: a GDPR erasure that ran during the token exchange no longer leaves a live refresh token behind (IOAuthStateStore.exists, Mongo and Postgres).

  • A client_credentials mint checks the connection's id before the exchange and after the write, and discards the grant if the connection was deleted or re-created under the same name meanwhile.

  • requirePrincipal refuses a user whose principal name is the reserved __service__.

  • Docs: the enabled connections switch governs account linking only; it does not stop ${connection:…} resolving (Connections).

Design decisions

  • Store chosen by config-URI host, not step type. Whichever task a step runs, the document it loads is the one the config URI names, so that is what the scan reads.

  • accept-unbound-legacy-data defaults to true. Turning the fallback off before a rotation would make never-read legacy rows unreadable; the counter tells the operator when it is safe.

  • The connections master switch was documented, not enforced on resolution. It defaults to off, and STATIC/BASIC connections work with it off today; enforcing it would break those deployments.

Not changed

  • VaultGrantImpactAnalyzer: a deployment racing a restrictive secret creation is still unseen (already documented). Closing it needs a post-record re-check on the deploy side (AgentFactory), outside this area.

  • ConnectionRegistry can re-cache the previous version of an updated connection for up to its one-minute TTL: the descriptor advances in DocumentDescriptorFilter (engine) after the store has invalidated.

  • allowedHosts entries without a port still admit http; requiring https for vault-backed hosts is a policy decision.

  • A Qute-looking credential value such as {abc} is still read as a template.


chore(ui): review cleanup — RTL icon mirroring, dead code, chat query keys (2026-10-31)

Repo: EDDI (chore/review-ui-cleanup) — Manager (ui/manager) and Chat UI (ui/chat) only. The behavioural fixes from the same review are on fix/review-ui.

What changed and why

  • RTL: directional arrows and chevrons carry rtl:rotate-180 — 59 icons across the Manager plus the three page-local BackLinks (agent-detail, conversation-detail, workflow-detail). In Arabic they pointed the wrong way: "back" arrows pointed forward and collapsed chevrons pointed at the content. rtl-directional-icons.test.ts scans the sources so a new left/right arrow or chevron without an rtl: variant fails the unit run.

  • Dead code removed: use-coordinator.ts and createCoordinatorEventSource, useUpdateAgentWorkflows, useDeployAgent, formatDateOnly, mapIfArray, debounced-inputs.tsx, cascadeHasErrors, EVENT_STATES/MATCH_OPS, the Variables page's unreachable copyRef template branch, six unreferenced type aliases, and the Chat UI's SUPPORTED_LOCALES, with the tests that only exercised them.

  • Query keys: chatKeys in query-keys.ts replaces nine hand-typed ["chat","deployedAgents"] keys, and the agentKeys header no longer claims agentKeys.all clears the detail, descriptor and prompt entries.

Design decisions

  • Not changed: the SSE payload interfaces in hitl.ts/groups.ts that nothing references (they document the wire format next to their used siblings), the remaining ~100 single-hook literal queryKey arrays (the header allows a key read and invalidated inside one hook), and getDeadLetters/replayDeadLetter/discardDeadLetter/purgeDeadLetters (still wrapped by tests).

  • No behaviour change is intended: the branch is independent of fix/review-ui and merges cleanly with it in either order.

Tests

npm run typecheck, npm run lint, npm run i18n:check and the full Vitest run in ui/manager; npm run typecheck, npm run lint and vitest run in ui/chat.


fix(ui): review findings in the Manager and Chat UI — operator gate check, approval binding, hostile-input bounds (2026-10-31)

Repo: EDDI (fix/review-ui) — Manager (ui/manager) and Chat UI (ui/chat) only. The mechanical half of the same review (RTL icon mirroring, dead code, chatKeys) is on chore/review-ui-cleanup.

What changed and why

Platform Operator

  • gateLooksInstalled (operator.ts) now judges a gate the way the backend's ToolApprovalPatterns matches it: * is a wildcard anywhere in a pattern. An exempt entry is refused when it can match any http.{post,put,patch,delete}:/… address (*:*, h*, *post*, http.*:/x all pass the old check and exempt every write at runtime, exempt being tested first), and the same test now applies to the AUTO_APPROVE rules check, which used to omit the http.*: prefix. requireApproval must cover every write method with a <head>* pattern — a PATCH-only gate used to certify an operator whose POST/PUT/DELETE calls ran unapproved. The gate buildToolApprovals() writes (all four methods, unchanged since it was introduced) passes, so no shipped operator is newly reported as ungated. A per-task toolApprovals override lives in the llmstore document and is not inspected here; the backend's default strict mode only lets it strengthen the agent gate. The verifier is outside the revision fingerprint (the prompt, allow-list and buildToolApprovals() are unchanged), so operator-revision.json stays at its value.

  • The same judgement drives the agentCreatedWithoutGate approval warning, which now also fires for a gate covering only some write methods; its text (all 11 locales) says the gate does not cover every write method instead of claiming there is no gate.

  • The operator chat's resume now carries a pauseId (use-operator-chat.ts, operator.tsx): the id of the pause the card showed, else the displayed pause's start, else the pause read just before the resume. If the displayed pause and the one read now differ, the decision is refused client-side. A top-level REJECTED could previously land on a pause nobody had looked at.

  • The cascade approval preview reads redeploy/compatible the way Jackson's default coercion does — "true", "True", "TRUE" (trimmed) and any non-zero integer are true — so a redeploy requested in one of those forms no longer shows as none.

Hostile or oversized input (Manager)

  • group-utils.ts: the markdown link-destination mask is bounded (]( runs with no ) rescanned the text from every opener, ~5 s per 100k characters); maskIndentedCode builds its line table once instead of re-splitting the prefix for every indented run; the ✅/❌ verification header is parsed with string steps and a per-line cap instead of a backtracking regex. formatJsonSafely (artifacts panel) returns content over 64 KiB or nested deeper than 32 as written. The sync diff viewer gives diffLines a time budget and falls back to one removal plus one addition.

  • useLatestVersions counts only descriptors whose own id is the requested resource (the filter= search is a substring match); erasure also sweeps the workforce-analytics cache; a conversation loaded for one agent is refused when it belongs to another; selective export sends the snippet and schedule selections (an empty list means none) instead of exporting every one.

Correctness

  • Agent config number fields keep a typed 0 (pruneStaleAfterDays: 0 was saved as 90, the opposite of "never prune"); the Dream cost default shown is the backend's 0.50, not 5.

  • "Switch to latest" is disabled while the editor holds unsaved edits. The Workforce settings page reads the group's current version when the URL names none (and offers Retry if the lookup fails), registers with the in-app navigation guard, and its delete flow (like the agent, channel and group-config delete flows) calls allowNextNavigation(). A deleted group discussion no longer re-selects itself while the list still holds it.

  • The Variables page documents {vars.key} (Qute), not {{vars.key}}, in all 11 locales. RAG ingestion shows translated status labels (9 new ragEditor.status* keys, all 11 locales), polls for ~11 minutes (2 s, then 10 s) and then says "stopped checking" instead of declaring a failure while the server is still ingesting; kbId/ingestionId go through seg().

  • The deploy/undeploy button no longer acts on another agent's status shown as placeholder data. The tool-approval pattern validator accepts / { } and method-qualified http.<method>: patterns like the backend and rejects the shapes it rejects. Upgrade preview and live sync send X-EDDI-Space; the cluster activity stream re-reads the bearer token on each reconnect. The update-check card now says the request origin is sent (a CORS fetch always carries Origin).

  • Chat UI: embed-auth backs off (10 s doubling to 5 min) when the host keeps handing over an already-expired token, instead of re-requesting every 5 s forever.

  • Second review round: the export sends an empty snippet/schedule selection (not an omitted one) when the preview lists none of that type; a stopped RAG ingestion row says "Last known" and has a "Check again" action; the markdown link-destination pattern takes its run atomically (about twice as fast on a hostile 100k-character input; the remaining cost is the bounded forward scan) and a verification header is bounded by its header part, not the whole line; the operator gate check matches wildcard patterns with a linear matcher (lib/glob.ts, shared with the HITL pattern validator) instead of a generated regular expression that went exponential on runs of *; after a PauseChangedError the approval status is keyed to the pause that is paused now; Deploy stays unavailable until the version's status is known (first fetch and failed lookups included); deleting a discussion drops its retained stream.

Design decisions

  • ui/manager/AGENTS.md now says the app runs under a data router (createBrowserRouter), as main.tsx and §4b already did.

  • The Variables page's unreachable copyRef template branch (it still builds {{vars.key}}) is left alone here: chore/review-ui-cleanup deletes it, and editing it on both branches would make the two PRs conflict.

Tests

Focused vitest suites for each fix; npm run typecheck, npm run lint and npm run i18n:check pass in ui/manager; npm run typecheck, npm run lint and vitest run pass in ui/chat. resource-detail-rag-upload-source.test.tsx (3 tests) fails on the base commit as well and is untouched.


CI: the changelog collation PR no longer runs the Java suite (2026-10-27)

Repo: EDDI, branch ci/skip-tests-on-collation-pr.

What changed: .github/workflows/ci.yml — detect-changes now forces operator_docs=false for a pull request whose head is this repository's own chore/collate-changelog branch and whose diff contains only files the collator writes (docs/changelog.md, docs/changelog.d/*, docs/changelog/*.md, docs/SUMMARY.md). Build & Test and the dependent jobs are skipped for it; a skipped required check still satisfies branch protection.

Design decisions: the exemption checks the diff as well as the branch name, because a name alone was already abused as an opt-out of the Changelog Discipline job. Any other file on that branch restores full gating.


📐 feat(docs-site): resizable and hideable sidebars (2026-10-27)

Repo: EDDI (feat/docs-site-resizable-sidebars)

What changed and why

The docs site's two sidebars — navigation on the left, "On this page" on the right — can now be resized and hidden on desktop, so a reader can give the page the room it needs.

  • Resize: drag a sidebar's inner edge. The handle is also a keyboard control (role="separator", ← → in 16px steps, Home/End for the limits, double-click to reset), with limits of 200–520px (navigation) and 180–480px (table of contents).

  • Hide: a button in the header for each side — before the logo for the navigation, before "Website" for the table of contents — with aria-expanded and a label that says what it will do.

  • Remembered: widths and hidden sides are kept per browser in localStorage (eddi-docs-layout) and applied by an inline script before first paint, so pages do not jump. That script is generated from the same functions the drag code uses (sidebar-layout.mjs), so its limits cannot drift; a test runs it against a fake document.

  • Starlight sizes both sidebars from one --sl-sidebar-width; each side now has its own variable, and the right sidebar's fixed box gets an explicit width (Starlight relied on a fixed-width inner container). Drags measure against documentElement.clientWidth, not innerWidth, so the right pane's edge stays under the pointer when the page has a scrollbar — both found while testing in the browser.

  • Desktop only: the navigation from 50rem, the table of contents from 72rem. Phones keep Starlight's own menu and "On this page" dropdown, untouched.

  • docs/mcp-server.md: the same one-line anchor fix as #1166 (identical bytes, so whichever lands first, the other merges cleanly), so this branch builds against today's main.

Verification

  • npm test in docs-site/: 65 tests, 11 of them new for the layout logic; mutation-checked (swapping the right pane's arrow direction, dropping the clamp from the pre-paint script).

  • In a browser at 1440px: dragging each edge (left to 400px, right to 404px with the edge exactly under the pointer), keyboard steps and Home, hiding and showing both sides (content re-centres, handles disappear, labels flip), persistence across reloads with no flash, double-click reset; at 375px nothing new appears and nothing overflows.


SSE keep-alive on turn streams (2026-10-27)

Repo: EDDI · Branch: feat/sse-keepalive

Problem. A turn can go a minute without a single SSE event: a model that is working out a tool call, or a structured (JSON) reply, emits no tokens until it is done. Load balancers and proxies close a connection that carries no bytes for their idle timeout — 60 s on an AWS ALB by default — and with eddi.streaming.cancel-on-client-disconnect on (the default), that close also discards the turn. Seen in a production-like deployment on 2026-10-27: a turn spent about 50 s before its first action, and the slowest ones run past 60 s.

Change. RestAgentEngineStreaming writes an SSE comment line, : keep-alive, on a turn stream that has carried nothing for eddi.streaming.keepalive-interval-seconds (default 15, 0 turns it off).

  • One daemon thread (eddi-sse-keepalive) ticks every open turn stream at the interval; a tick writes only when the stream has been silent for the whole interval, so a stream of tokens carries no extra frames.

  • Writes to the sink are serialised, so a comment never lands between the lines of an event.

  • The tick stops when the stream ends (done, error, start failure) or the client is gone.

  • A tick that finds the sink closed, once the turn has written an event of its own, is handled like any send to a vanished client: with cancel-on-client-disconnect on, the turn is cancelled during the silent stretch instead of at its next event, on a separate thread so the cancel's store work does not delay other streams' ticks. Before its first event a turn may still be queued behind another turn of the same conversation, whose cancel would hit that other turn, so the tick then only stops and the turn's own first event handles the disconnect, as before. A send that fails on a sink that is still open is not taken for a disconnect, as before.

  • The tick runs every quarter interval, so the longest silence is about 1.25 intervals.

  • SSE clients ignore comment lines by definition, so no consumer changes. docs/rest-api-reference.md notes that a hand-written parser must skip lines starting with :.

Files. RestAgentEngineStreaming.java, new RestAgentEngineStreamingKeepAliveTest (9 tests, the scheduler and clock replaced so each tick runs by hand), configuration-reference.md, rest-api-reference.md.

Decision. Comment frames rather than a named ping event: a named event reaches every client's handler and some treat unknown events as errors, while comments are dropped by every SSE parser. The interval is a setting because the right value depends on the shortest idle timeout between EDDI and the client.


An untyped context entry is a 400, not a 500 (2026-10-27)

Repo: EDDI · Branch: fix/context-entry-without-type

Problem. POST /agents/{agentId}/start answered 500 with a NullPointerException ("contextType is null") when a context entry had no type. The usual cause is a caller wrapping the map in {"context": {…}}: the start body is the context map, so Jackson reads context as one entry with no type, and ConversationMemoryUtilities.prepareContext switched on it. Found on a staging deployment while scripting an end-to-end test; a say with an untyped entry went the same way.

Change.

  • RestAgentEngine.requireTypedContext refuses a null or untyped entry with 400 {"error": {"code": "INVALID_CONTEXT", …}} naming the key and the valid types. It runs on start, on say and on the streaming say, before the turn is queued or the stream is opened, next to the existing input checks.

  • prepareContext skips an untyped entry like an unknown type instead of throwing, so a producer other than these three endpoints cannot crash a turn with it either.

  • rest-api-reference.md documents the rule.

Tests. RestAgentEngineClientContextTest (start, say and streaming say: 400, nothing forwarded, no SSE frame) and ConversationMemoryUtilitiesTest (an untyped entry is skipped, the others kept).


🔀 fix(docs-site): docs.labs.ai redirects with a 301, kept forever; repair the docs build on main (2026-10-27)

Repo: EDDI (fix/docs-site-301-redirects)

What changed and why

301, not 308. The decision for the docs move is now final: docs.eddi.technology is canonical, and docs.labs.ai answers every path with a 301 to the same path there, for good (released images print docs.labs.ai links forever). The generated redirects used Vercel's permanent: true, which sends a 308. That is just as permanent, but 301 is what was decided and what every crawler and HTTP client has always read as a move. redirects.mjs now writes an explicit statusCode: 301 on all 434 rules (REDIRECT_STATUS), and a test fails if any rule loses it or uses permanent again. Vercel's own trailingSlash redirect (/x → /x/) stays a 308, because it cannot be configured; check-live.mjs therefore checks the status of the hop that leaves docs.labs.ai and requires it to be the 301, whichever order Vercel runs the two in.

The Vercel project now builds from the repository root. The eddi-docs project was created with Root Directory docs-site, and Vercel checks that the Root Directory exists before any ignore step runs — so every push to a branch without docs-site/ failed, with a failure email: the orphan metrics data branch that docker-pull-notify.yml writes every 10–35 minutes, and every branch cut before the site existed. The Root Directory is now the repository root (it exists on every branch), vercel.json moves to the repository root (Vercel reads it from the Root Directory) with cd docs-site && … commands and output docs-site/.generated/dist, and the ignore step test ! -d docs-site || git diff --quiet HEAD^ HEAD -- docs-site docs PRIVACY.md vercel.json skips a branch without the site and any commit that does not touch the docs. The project settings carry the same commands, for branches without the root vercel.json (main until this merges). The Docs Site workflow now also watches vercel.json, and a test pins the layout.

Only main deploys. Decided the same day, after branches that had merged a broken main (the ratings anchor below) started failing their previews and emailing: the ignore step now begins with [ "$VERCEL_ENV" != production ] ||, so every non-production deployment — every branch and pull request — is skipped. Pull requests keep the Docs Site check, which builds the site and validates every link; the project setting carries the same command. On main, "did the docs change?" is asked against the last successful deployment ($VERCEL_GIT_PREVIOUS_SHA), not HEAD^, so a docs build Vercel cancelled is still published by the next commit; without a previous deployment in the clone, it builds. (Vercel caps the project setting at 256 characters, so the command is written compactly; a test holds it under the cap.)

main's Docs Site check was red. #1136 (conversation ratings) linked mcp-server.md to conversation-ratings.md#mcp-tools-and-the-platform-operator, a section that page does not have, so the docs build has failed on every push to main since. The link now points to the section that describes the same scoping — "Analyzing and triaging (the people running the agent)". The ratings page's status note says it covers the MCP rating tools, but it has no section on them; adding one is for the ratings work, not this fix.

Verification

  • npm test in docs-site/: 55 tests, including the new 301 test.

  • check-live against a local stand-in for Vercel that applies vercel.json, with a second port posing as docs.labs.ai: every legacy URL ends on the right page on the canonical host, leaving the legacy host with a 301. With the host rule switched back to permanent (308), the legacy checks fail.

Next

The cutover itself: phase 5 of planning/docs-site-migration-plan.md.


🐛 fix(hitl): email-notification review follow-ups (2026-10-27)

Repo: EDDI (fix/hitl-email-review-followups)

What changed and why

Follow-up to the HITL email notifications PR (#1141), for the review threads left open when it merged.

  • Docs and Javadoc named the wrong thing. The email.notify audit entry carries recipientPseudonym (the GDPR pseudonym token: keyed with the audit ledger's key, salted per deployment when it has none, and an unsalted hash only when a deployment has neither) next to recipientDomain, and the rate-limit WARN names the recipient by that same pseudonym. hitl.md, configuration-reference.md and the HitlEmailNotifier class Javadoc still said "SHA-256 hash" / "by hash", which would send an operator looking for a value that is never written.

  • Manager: off then on again lost the typed recipients. Switching email notifications off clears the stored list, and the effect that resyncs the field to the stored list then emptied the draft, so switching back on (before saving) came back empty. The typed list is now kept when the user switches it off.

  • Manager: internationalised domains were rejected. The server converts the domain to ASCII (AddressNormalizer, IDN.toASCII) and accepts ops@bücher.example; the Manager's check was ASCII-only and marked such an agent invalid. The domain is now converted the same way before it is checked (the local part must still be ASCII, as on the server), and the Unicode and punycode spellings of one domain count as a duplicate. hitl.md now says so. Two further gaps CodeRabbit found in that conversion are closed: URL syntax after the domain (/path, ?q, #f, :25, a backslash, %) is refused instead of being parsed away, and a domain containing ß, ς or a zero-width (non-)joiner is refused, because the platform's IDNA processing keeps those and the server's IDN.toASCII maps or drops them, so the two would normalise the domain differently (the punycode spelling stays valid).

  • No change needed: the metrics dashboard panel ids are unique and the split dashboard parts are in sync with the source (sync-monitoring-assets.py produces no diff); the collision the thread described was renumbered after the review.

Design decisions

  • The Manager still sends the addresses as typed; normalisation stays the server's job.

  • Browser IDNA conversion (new URL) stands in for IDN.toASCII, with the known divergent characters refused outright; the backend remains the authority and answers 400 for anything the two still disagree on.


perf(audit): the stored conversation no longer repeats the prompt and response the ledger holds (2026-10-27)

Repo: EDDI (perf/audit-copies-out-of-memory)

What changed and why

With auditing on, LlmTask writes audit:compiled_prompt (system prompt plus prompt) and audit:model_response to every step so LifecycleManager can build the ledger entry. Nothing removed them afterwards, so the full text lived in the conversation document too. On a measured 1.6 MB, 20-step conversation the compiled prompt alone was 325 KB (20%) and the model response 39 KB. Large documents slow every read and write of a conversation, and a deployment whose link to MongoDB is bandwidth-limited felt it directly.

  • Release after hand-over. Conversation (say and resume paths) calls TurnAuditBuffer.releaseLedgerOwnedEvidence once the turn's buffer has been flushed and the ledger accepted every entry. Within the turn nothing changes: the entries are built, buffered and redacted exactly as before; the keys are removed afterwards, before the conversation is stored.

  • Only what was accepted. AuditLedgerService.submit now returns whether the entry was queued, and the collectors ConversationService and ConversationHitlService install implement the new IAuditEntryCollector.Acknowledging. TurnAuditBuffer.flush returns false if any entry was refused (full queue) or any submit threw, and then the evidence stays in the stored step. A plain collector (tests) counts as accepting unless it throws.

  • Paused turns keep it. A turn that ends AWAITING_HUMAN resumes from the stored step, so the keys stay until the resume that completes the turn.

  • Deliberately kept: audit:tool_calls, audit:token_usage, audit:cost, audit:model_name and the guardrail records. Agent tests read tool calls, cost and model from the stored step (TurnObservation.fromSnapshot), the /v1 adapter reads token usage, and the history replay reads the guardrail records. They are small by comparison.

  • No consumer needed the removed keys. Searched the Manager UI, Chat UI, REST and MCP surfaces, conversation log, exports and GDPR export: the only reader of the two keys is LifecycleManager.buildAuditEntry, inside the turn. The text is read from the ledger (GET /auditstore/{conversationId}). Documented in audit-ledger.md.

  • Auditing off: the keys are never written and no code path changes.

  • Already-stored conversations keep what they hold; only new turns are slimmer.

Files: TurnAuditBuffer.java, IAuditEntryCollector.java, AuditLedgerService.java, Conversation.java, ConversationService.java, ConversationHitlService.java; tests ConversationAuditEvidenceReleaseTest, TurnAuditBufferTest, AuditLedgerServiceTest.


⚡ perf(conversations): current-step and approval-status reads no longer transfer the whole conversation (2026-10-27)

Repo: EDDI (perf/slim-conversation-reads)

What changed and why

Every read of a conversation loaded its whole stored document, and for an agent with tools that document is 0.5–3 MB after twenty turns, almost all of it step history. On a staging deployment whose link to MongoDB was intermittently bandwidth-limited (~100 KB/s for whole-document reads, while small reads stayed at 0.3 s and EDDI itself was idle), GET /agents/{conversationId}/approval-status and the chat-reload read GET /agents/{conversationId}?returnCurrentStepOnly=true took 11–29 s, and the approval card's spinner showed for that long. Both responses describe only where the conversation is now.

  • New store read, IConversationMemoryStore#loadConversationMemoryTail, returning a ConversationMemoryTail: the document with conversationSteps and conversationOutputs cut to their last element, no redoCache, and none of the pending tool-call batch's resume-only fields (chatTranscriptJson, gatingAssistantMessageJson, traceSoFar, fingerprint, each call's argumentsRaw), plus the totals the projection still needs from what stayed behind — step, output and redo counts, and the audit:cost / audit:discarded_cost values for conversationCost. MongoDB: one aggregation ($match on _id, $set with $slice: -1 and the computed totals, $unset). PostgreSQL: one query using ->-1, jsonb_array_length and jsonb_path_query_array. The spend values come back in document order and are summed in Java with the same filter and the same left-to-right addition as before, so the cost is bit-identical, not merely close.

  • IConversationMemoryStore#loadConversationMemorySnapshotForApprover for approval-status?detail=full: that response is the whole snapshot, so it still carries the history; only the resume-only batch fields — which sanitizePendingToolCallsForApprover nulls before serving — stay on the server (MongoDB: all five; PostgreSQL: the four batch-level ones, argumentsRaw sits inside an array #- cannot wildcard and is small).

  • Wired into: ConversationService.readConversation (both overloads) when returnCurrentStepOnly=true — which serves REST GET /agents/{conversationId}, the managed-agent read, MCP read_conversation and the A2A status read; RestAgentEngine.getApprovalStatus and McpHitlTools.getApprovalStatus (summary → tail, detail=full → approver read). A RULE pause's pauseDetails.actions comes from the tail's last step; only when that step has no actions does it load the full history and walk back, as before.

  • Unchanged: every write path, undo/redo, resume, the conversation log, export, returnCurrentStepOnly=false (and null), and every other caller of getConversationMemorySnapshot / loadConversationMemorySnapshot.

  • ConversationMemoryUtilities.convertSimpleConversationMemory was split into a shared body taking the rendered lists plus the totals explicitly, so the full-snapshot and the tail projection run the same code.

  • A document still storing a step under EDDI 5's packages key (read by the load's @JsonAlias, not by the server-side expressions) is detected in the same round trip and loaded in full, so its cost is never under-counted.

Files: ConversationMemoryTail.java, IConversationMemoryStore.java, ConversationMemoryStore.java, PostgresConversationMemoryStore.java, ConversationMemoryUtilities.java, IConversationService.java, ConversationService.java, RestAgentEngine.java, McpHitlTools.java. Tests: ConversationMemoryTailParityTest (Testcontainers MongoDB + PostgreSQL: for a READY 20-turn conversation with spend and a redo entry, a one-turn conversation, a TOOL_CALL pause, a RULE pause, a secret last turn, a drifted steps/outputs document and an ERROR turn, the tail projection serializes to the same JSON as the full one for every returnDetailed × returningFields combination; the approver projection of the slim approver read equals that of the full read; legacy packages fallback; unknown ids), ConversationServiceTest$ReadConversationSingleArg, RestAgentEngineToolPauseDetailsTest$RulePauseDetails, plus the HITL REST/MCP tests re-stubbed for the new reads.

Not covered

detail=full still transfers the step history — the response is the full snapshot. The Manager's own approval card uses the summary.


📚 feat(docs-site): redirects for every URL GitBook ever served, CI, and the cutover kit (2026-10-27)

Repo: EDDI (feat/docs-site-astro)

What changed and why

Phases 2–4 of planning/docs-site-migration-plan.md. After this, moving docs.labs.ai off GitBook is a Vercel project and a DNS record — the checklist is phase 5 of the plan.

  • Fidelity (phase 2), by script over all 94 pages. Source against build: the same number of tables and code blocks, and no Markdown leaking into rendered text. GitBook against build: 98.4% mean word coverage, every gap GitBook's page chrome or text that changed on main after the branch was cut.

  • Every old URL keeps working (phase 3). docs-site/legacy-urls.txt lists every URL docs.labs.ai has served — today's sitemap, the Wayback Machine's older flat and chatbot-era URLs, the links in this repo and the website. scripts/redirects.mjs generates vercel.json's redirects from it: docs.labs.ai → the same path on docs.eddi.technology, then each legacy path in its plain, trailing-slash and .md forms, then a per-section fallback. Pages whose slug contains a dot (upgrading-from-6.4) get an explicit slash redirect, because trailingSlash takes .4 for a file extension and would 404 them — found by the new checker.

  • A guard over docs links in the repository. Every docs URL written in the backend, the UIs, README, CONTRIBUTING, AGENTS, the plugin and .github/ must land on a page, anchor included. Released images print those links forever; three of them 404 on GitBook today.

  • scripts/check-live.mjs checks a deployment over HTTP — 693 URLs followed hop by hop. Run locally against a stand-in for Vercel's serving of vercel.json, it found the dotted-slug 404s and a generator bug that rewrote an external …/CONTRIBUTING.md target to …/CONTRIBUTING/; both are fixed and covered by tests.

  • Headers: the website's security headers, with a CSP written for this site ('wasm-unsafe-eval' for the search index, shields.io and quay.io images). Search, Mermaid and badges were checked in a browser under it with no violations.

  • CI (phase 4): docs-site.yml — check Docs Site — runs the tests on every PR (they hold the repo-wide link guard) and the site build when docs changed. Dependabot watches /docs-site, because CI's Trivy scan reads its lockfile and an advisory there would fail every backend PR. ci.yml's backend filter gains docs-site/**/*.md, and BuildQualityGatesTest holds docs-site/.nvmrc to the pom's Node.

  • Branding matched to the website and the Manager, value for value. Tokens copied from the website's global.css; the header bar, its right side (Website, Get Started, GitHub) and the sun/moon toggle from its Header.astro, replacing Starlight's theme <select>; prose from its GuidePage.astro; code blocks in Astro's default github-dark theme with the same geometry; the website's favicons; the Manager's sidebar active/hover treatment and scrollbars. Checked against the live site by computed style (header, logo, CTA, nav link, headings, body text, links, code, tables: identical) and by screenshot in both themes and at phone width. Two deliberate differences: light-mode links use the website's own light accent token (accent-700) rather than accent-400, which is ~1.9:1 on its light background; and the docs render Outfit and JetBrains Mono for real, which the live website currently does not (it asks for Outfit, but @fontsource-variable/outfit registers Outfit Variable, so it falls back to the system font; inline code falls back to the browser's generic monospace).

  • No sharp. Dependency Review failed the PR on the ten @img/sharp-libvips-* packages (LGPL-3.0), which sharp — Astro's optional default image optimiser — pulls in and the repository's licence policy denies. The site has no raster images, so it uses Astro's pass-through image service and package.json overrides sharp with a local stub (docs-site/stubs/sharp); the policy is unchanged. licenses.test.mjs checks the lockfile against the deny-list read from dependency-review.yml, so this fails npm test next time rather than a PR check.

  • AGENTS.md (ecosystem row: the website is Astro + Tailwind on Vercel at eddi.technology), CONTRIBUTING (how to add a page), the ship-pr skill (the new check) and the monorepo plan now describe the docs as they are built.

Verification

npm test in docs-site/: 52 tests; the new guards were mutation-checked. npm run build clean; check-live 693/693 against the local stand-in. The Java guards touched here (BuildQualityGatesTest, DocumentationLinksTest, DocumentationAccuracyTest, DocumentedRestPathsTest, the changelog tests) pass.


🐛 fix(email): HITL notification review findings after the retarget to main (2026-10-27)

Repo: EDDI (feat/email-hitl-notifications)

What changed and why

Once #1140 merged and #1141 was retargeted to main, the review bots saw the whole slice and raised these:

  • One recipient's failure no longer drops the rest. HitlEmailNotifier.notifyPause handles each recipient on its own: a store error while counting, inserting or attempting one recipient is logged under that recipient's pseudonym and the loop moves on. The sweep only retries rows that exist, so a recipient skipped this way would never have been mailed for that pause.

  • A send failure that is not a MailSendException is an attempt. A RuntimeException from SystemMailer.send (a bad address, a mailer bean that could not be built) used to escape attempt, leaving the row PENDING and reclaimed after every lease without ever reaching max-attempts. It is now rescheduled with backoff and FAILED at the limit, like a transient SMTP failure.

  • The audit entry names the recipient by keyed pseudonym. It carried an unkeyed SHA-256 of the address beside the recipient's domain, which anyone reading the ledger or the logs could confirm by hashing candidate addresses. It is now recipientPseudonym, from GdprPseudonymizer (the audit ledger's keyed pseudonym, or the per-deployment salt), the same token GDPR erasure writes for that identifier; the rate-limit WARN uses it too.

  • A From with a valid mailbox beside an unparseable entry has no sender. MimeMessageParser.parseFrom now records MULTIPLE_FROM for it, as AddressNormalizer.parseSingle already did, so DKIM/DMARC never authenticates a domain the header did not name unambiguously.

  • Manager: a switched-off HITL section no longer blocks the save over hidden recipients, and the section resets per agent and version (key on HitlConfigSection).

  • SystemMailer states mail.smtp.ssl.checkserveridentity=true where the session is built (CodeQL java/insecure-smtp-ssl); SafeSocketConnector.angusProperties already set it under the protocol's prefix.

  • Dashboard: the email panels collided with main's Conversation Ratings panels on ids 264 and 265; they are now 267 and 268.

Files: HitlEmailNotifier.java, MimeMessageParser.java, SystemMailer.java, agent-config-sections.tsx, agent-detail.tsx, eddi-full-metrics-dashboard.json, with tests for each; each new test fails with its fix reverted.


✅ test(e2e): brand-leak acceptance test, and Keycloak's card-top rule — white-label phase 7 (2026-10-26)

Repo: EDDI (feat/white-label-6-chat-operator-surfaces)

What changed and why

Phase 7 of the white-labeling plan (§7), the acceptance test; the plan is now marked implemented. docs/white-labeling.md gains "Verification".

  • ui/manager/e2e/fullstack/brand-leak.fullstack.spec.ts (+ fixtures/zebra-logo.svg, zebra-icon.svg). Resets the brand, sets "Zebra Labs" / "Zebra" / a tagline / teal #0f766e on white / poweredBy: false and uploads an SVG logo and icon through the admin REST, creates and deploys an empty agent, then walks 57 pages: /, /welcome, every static /manage route and every RESOURCE_TYPES list page (both read from source, src/app.tsx and resources.ts, with a floor on the count so a broken parse cannot pass), every static /workforce route, the fixture agent's agent, workflow and Studio pages, /chat/production/<agent> and /chat/demo/showcase. Per page: \bEDDI\b, [Ll]abs.ai, LABS.AI in innerText, document.title, alt/aria-label/title/placeholder/aria-description/aria-roledescription, the live <meta> contents and the raw HTML's <title> and <meta> contents; the title must name the brand, every same-origin <img> and icon link must be under /branding/, and --color-primary (chat: --chat-accent) must be the brand's. Then the OpenAPI title and contact, MCP initialize serverInfo.name, and Swagger UI (packaged build). Then a reset, after which /welcome, /manage, /workforce, the chat demo and the OpenAPI title say EDDI. afterAll resets the brand and removes the agent whatever happened. Leaks are collected for the whole run and reported by route with where and a snippet; allow-listed hits are printed too, so a stale entry is visible.

  • CI: none needed. The fullstack project's testDir is e2e/fullstack, so npm run test:e2e:fullstack in the Backend E2E job (both databases, workers: 1) picks it up.

  • Allow-list (2): the "EDDI Cluster" Grafana dashboard named on /manage/coordinator (a technical name, as documented), and the Branding page's empty Product-name placeholder, which shows the EDDI default the field falls back to.

  • Keycloak (found in Phase 6): keycloak.v2 26.x draws a 4px border-top on the card in --keycloak-card-top-color (:root, PatternFly blue-400). eddi-login.css now sets it to var(--eddi-primary) (amber), and KeycloakThemeExport's generated brand-overrides.css sets it explicitly with the other PF tokens. KeycloakThemeExportTest checks both.

Verified

  • Full ./mvnw package -DskipTests (with the UIs), the jar on :7070 with MongoDB 7 and the compose file's three opt-outs, PORT=7070 E2E_AGAINST_BACKEND=1 npx playwright test --project=fullstack: the new spec passes (3 tests, about a minute; no leaks, the two allow-listed hits), and the whole fullstack project with --workers=1 passes (38 tests).

  • The first run found one hit, the Branding page placeholder, which became the second allow-list entry.

  • Injected leak: the jar's Manager bundle patched so landing.title reads "Welcome to EDDI" fails the spec with 2 brand leak(s) on 2 route(s): / → /welcome [visible text] "EDDI" in: Welcome to EDDI Choose your workspace… and the same for /welcome; the original jar was restored.

  • Manager npm run lint and npm run typecheck green. Backend: formatter:format, compile, and KeycloakThemeExportTest, the Brand*/Branding* tests, ImportStyleTest, BuildQualityGatesTest, ChangelogFragmentTest and the Documentation*Tests (244 tests) green.

Not verified

  • PostgreSQL (CI's second leg), A2A agent cards (needs an A2A-enabled agent; covered by Phase 6's manual check), the Keycloak login page (not served in this tier), and a re-screenshot of the card-top colour on Keycloak 26.8.


🎨 refactor(manager): brand, warn and ochre colour scales — white-label colours, part 1 of 2 (2026-10-26)

Repo: EDDI (feat/white-label-2-colour-scales)

What changed and why

Next step of the white-labeling plan after the brand store: the Manager's colours become able to follow a brand. Amber was both the EDDI brand and the app's caution colour, written out as about 745 amber-N utilities, so a brand colour could not reach them. This part adds the colour scales and converts the pages, lib/ and the HTML shells; the components follow in part 2, together with the guard that forbids amber-N. With no brand set, every pixel is unchanged.

  • Three scales in ui/manager/src/index.css, in plain @theme (not @theme inline) so the utilities read the variable at runtime. All three are var(--color-amber-N) unbranded:

    • --color-brand-50…950 follows the brand: accents, selection, primary emphasis.

    • --color-warn-50…950 is fixed amber for cautions: warnings, approval pauses, pending and degraded states, unsaved-changes markers.

    • --color-ochre-50…950 is a fixed categorical hue (per-type badges, section accents, avatar and syntax palettes) that is neither a warning nor re-branded, so two categories can never collide with the brand.

  • Pages and lib/ converted by meaning, read per component. The welcome modal's rgba(245,158,11,…) became color-mix over --color-primary, and the dark scrollbar greys became --color-scrollbar-thumb(-hover). The shells' loader spinner reads var(--brand-loader-accent, #d4a843).

  • BrandDelivery's brand.css, when a primary colour is set, re-declares the brand scale in :root and .dark as fixed color-mix(in oklch, var(--color-primary) N%, white|black) text and sets --brand-loader-accent. It never touches warn or ochre, and unbranded output stays empty. BrandDeliveryTest checks the scale against index.css, that ochre maps to amber and is never branded, and the shells' loader fallback.

  • Docs: docs/white-labeling.md and the eddi-ui skill describe the three scales and when to use each.

Design decisions

  • Full scales rather than the plan's single warning token. The existing utilities need 50…950 with opacity modifiers; a one-for-one swap keeps the classification reviewable and the output identical.

  • The loader uses its own variable. The bundle CSS in <head> already defines --color-primary as #f59e0b, so var(--color-primary, #d4a843) would have changed the unbranded spinner.

  • Mix ratios put each brand step near the OKLCH lightness of the amber step it replaces.

Fixed on the way

docs/mcp-server.md linked to an anchor docs/conversation-ratings.md does not have, which failed the docs-site build on main and on every PR. It now points at the page's "Analyzing and triaging" section, where the rating tools are described.


🎨 refactor(manager): components move off hard-coded amber, and a guard keeps it that way — white-label colours, part 2 of 2 (2026-10-26)

Repo: EDDI (feat/white-label-3-colour-sweep)

What changed and why

Second half of the colour work in the white-labeling plan. Part 1 added the brand, warn and ochre scales and converted the pages; this part converts every component under ui/manager/src/components, so no amber-N utility is left in the Manager. With no brand set, every pixel is unchanged, because all three scales resolve to the same amber.

  • Classified by meaning, per component:

    • brand (follows the brand): the Workforce synthesis cards, the dashboard's agents card, the wizard choice card and the pinned-response star.

    • warn (cautions): HITL pauses and approval surfaces, pending badges, unsaved markers, in-progress and degraded states, vault and secret-rotation cautions, amber callouts, the amber middle of red/amber/green scales.

    • ochre (fixed categorical hue): per-type badges, discussion-style palettes, section accents, the avatar palette (kept in sync with lib/utils.ts), syntax and number colours, tool chips, the search <mark>, the welcome-modal gradient.

  • Guard: src/__tests__/no-hardcoded-amber.test.ts fails on any amber-N utility or brand-gold hex (#f59e0b, #fbbf24, #d4a843 and their rgb() forms) in ui/manager/src and the three shells. Its allow-list is empty; the theme file's custom-property declarations are the one place amber is named.

  • Tests that asserted amber class names now assert the new scale (badges, resource-type-badge, pipeline-railroad).


🐛 fix(security): bound the regex work of seven matchers (CWE-1333) (2026-10-26)

Repo: EDDI (fix/regex-redos-bounds)

What changed and why

A repository security scan flagged seven places where a pattern from configuration, or text from a user, could make java.util.regex backtrack super-linearly. All seven were reproduced; each is now bounded, and where a regex was kept its meaning is unchanged — each fix ships with a test comparing old and new over a dense random or exhaustive corpus, plus a timing-bounded pathological input that hangs the old code.

  • ToolApprovalPatterns.compile (HITL tool-approval globs): one greedy .* per star made a*a*…*z exponential in the star count, at save-time validation and on every gated tool call. Middle segments are now matched at their earliest occurrence inside atomic groups ((?>.*?B)), which loses no match, so matching costs pattern length × input length. The Pattern return type stays, so the gate and the rules are untouched.

  • UrlPattern (crawl excludePatterns): the glob is no longer translated to a regex; a dynamic-programming pass over the tokens costs pattern length × path length. ** now also crosses a decoded line terminator — the regex's . did not, so /private/** let /private/a%0Ab through.

  • BoundedRegex (agent test-suite regexes): its deadline only fires on charAt, and a counted repetition of something that matches empty reads nothing — (?:(?:){99999}){99999} spun for 25 s on a three-character text. Counted minimums over groups, anchors and back-references may now force at most 1,000 iterations in total (nested counts multiply), and (?x) is refused. Checked when a suite is saved (AgentTestSuiteValidator) and again before every match, for suites saved earlier. What remains is documented in the class: a pattern within the cap that reads nothing still costs up to 1,000 steps per start position, unchecked by the deadline.

  • TemplateSyntaxMigrator (Thymeleaf→Qute import): the three #strings patterns are possessive where the next token cannot be what the quantifier consumes, and the two-argument form checks for its ) with a lookahead first; a long whitespace run in an unterminated call was quadratic.

  • SecretRedactionFilter unquoted-value rules: the optional ${vault:…} prefix searched for its closing brace afresh at every key, so repeated token:${vault: without a } was quadratic in the message. The key is still found by regex; the reference and value are now found by a forward-only scan whose brace search is reused across keys. Whole-reference exemption and reference-plus-tail redaction are unchanged (no new bypass).

  • PunctuationNormalizerProvider: the punctuation setting is spliced into […] and could close that class (!]|(a+)+$|[!). It is used as a class body only when its brackets balance and it has no \Q…\E; otherwise its characters are taken literally. The provider also no longer keeps the last parser's setting in a field of the shared singleton, which made one parser's custom punctuation the default of every later one.

  • PromptInjectionGuardrail: whitespace runs in the built-in patterns are possessive; ignore or < followed by a long whitespace run was quadratic.

Docs: agent-testing.md — the repetition cap.

Files: ToolApprovalPatterns, UrlPattern, BoundedRegex, AgentTestSuiteValidator, TemplateSyntaxMigrator, SecretRedactionFilter, PunctuationNormalizerProvider, PromptInjectionGuardrail and their tests (new: BoundedRegexTest, SecretRedactionFilterUnquotedValuesTest).


🔒 fix(secrets): allowedHosts now also governs transport, connections, Slack bot tokens and discovery's authHeaderRef (2026-10-26)

Repo: EDDI (fix/secret-allowed-hosts)

Four findings from the repository security scan of daecb3513, all about a vaulted secret reaching a destination its allowedHosts list was meant to exclude.

What changed and why

  • Plaintext http to an allowed host. VaultHostAllowlist compared host and port only, so http://api.openai.com matched api.openai.com and an editor could send a restricted key unencrypted. A secret with a list is now refused for http:// / ws:// to any non-loopback host, even a listed one. Loopback (localhost, 127.0.0.1, [::1]) is exempt, the same rule a connection's allowPlaintextRemoteOrigins applies. A deployment that does send restricted secrets to an internal service over http sets eddi.vault.allow-plaintext-remote-hosts=true, which still admits only listed hosts. Schemeless destinations (pgvector/Qdrant host:port) and mongodb:// are not judged by scheme. Unrestricted secrets are unchanged.

  • A connection bypassed the secret's own list. ConnectionResolver checked the target against the connection's baseUrlAllowlist and then turned the ${vault:…} references behind a STATIC valueTemplate or BASIC passwordRef into plaintext without consulting their allowedHosts. CredentialReferenceResolver now takes the target and checks every vault reference, after ${vars:…} expansion and before decryption; a refusal is TARGET_NOT_ALLOWED. Because the check sits in the resolver, it covers every caller (ApiCallExecutor, MCP), not only the one the finding named.

  • Slack botToken resolved without a destination check. ChannelTargetRouter now checks a vaulted botToken (new-style integrations and legacy agent connectors) against SlackWebApiClient.SLACK_API_BASE before resolving it. A refused token is withheld (the integration cannot post) with a [SECURITY] WARN. Signing secrets are inbound-only and not checked.

  • authHeaderRef prefix check. RestApiCallsStore discovery accepted any value that started with a reference prefix, so ${vault:x}sk-live-… passed and the literal was copied into every generated call. The value must now be exactly one ${vault|eddivault|vars|caller:…} reference, whole-string.

What operators see

A restricted secret that is used today over plain http to a non-loopback host — e.g. an in-cluster http://elasticsearch:9200 or an OpenAI-compatible server at http://vllm:8000 — now fails at that call/build with a message naming the destination and eddi.vault.allow-plaintext-remote-hosts. Switch the endpoint to https, or set the property. Docs: secrets-vault.md → Destination allow-list.

Tests

VaultHostAllowlistTest (new EncryptedTransport group), new ConnectionResolverVaultAllowedHostsTest, new ChannelTargetRouterAllowedHostsTest, and a new case in RestApiCallsStoreBranchTest. Each was mutation-checked: with the fix reverted, the new tests fail.

Not done

  • The Manager's isAuthReference (ui/manager/src/lib/secret-reference.ts) is still a prefix check. The server now refuses what it lets through, but it should use the same whole-string grammar.

  • An OAuth connection's client secret is not checked against its own allowedHosts at the token endpoint. credentialEndpointAllowlist governs where it goes.


🧪 test(email): full-application IT for the email channel (2026-10-26)

Repo: EDDI (feat/email-conversation-mode)

The existing email ITs (EmailImapPollingIT, EmailConversationModeIT) wire the poller, processor and reply sender by hand around a mocked conversation engine. EmailFullApplicationIT boots the real application (@QuarkusTest, MongoDB Dev Services) and drives it through its REST API, with GreenMail as IMAPS and SMTPS server and a deterministic agent (dictionary, behavior rules, output — no LLM):

  • Trigger mode — POST /channelstore/channels answers X-Eddi-Warnings: email.open-trigger and creates email-poll:<id>; the poll is fired through POST /schedulestore/schedules/{id}/fire (claimed, then ScheduleFireExecutor); the mail runs a real turn with the mail as input and the mail context, its PDF lands in the attachment store, the ledger row ends DONE, the mail is moved, and nothing is sent. An Auto-Submitted: auto-replied mail is refused without a conversation.

  • Conversation mode — DKIM-signed mail (real DkimVerifier/SenderAuthenticator) is answered in the thread (In-Reply-To, References, Auto-Submitted, AI disclosure); the answer to EDDI's Message-ID continues the conversation, another sender quoting it gets their own, unsigned and body-tampered mail is refused unanswered.

  • HITL in the thread — a PAUSE_CONVERSATION turn sends the in-thread notice with the pause reason; POST /agents/{conversationId}/resume sends the continuation.

  • Bounce — a permanent DSN for a reply lists the address under GET /channelstore/channels/{id}/email-suppressions (hashed) and the sender's next reply row ends SUPPRESSED.

Two test seams, enabled only by the IT's profile (getEnabledAlternatives), replace beans; no production code changed:

  • E2eMailSocketConnector (engine.net, test sources) runs the production author policy of SafeSocketConnector in full on every call, over an injected resolver that answers a public documentation address for imap.mail.test / smtp.mail.test; only an endpoint that passed is re-pinned to the loopback GreenMail port, keeping host name and TLS mode, so TLS and host-name verification run against a certificate for those names.

  • E2eMailDns (engine.mail, test sources) is the production MailDnsResolver over an offline TXT source that publishes the DkimTestSigner key and a DMARC record.

Finding while writing it (no code change): the regular dictionary parser splits on spaces only, and the default inputTemplate puts the body on the line after -----, so the body's first word is read as one token with the separator (instructions.\n-----\nhello,). A dictionary agent on an email channel should not rely on the first word of the body; LLM agents are unaffected.


fix(alerts): a per-event send claim closes the erasure-vs-delivery window (2026-10-26)

Repo: EDDI (feat/alerts-backend, PR #1138)

What changed and why

A delivery could read an event, an erasure redact it and finish, and the delivery then send what it had read. Now no send starts with erased content after an erasure has completed.

  • Send claim. IAlertEventStore.claimSend(eventId, token, now, until) is an atomic conditional write that succeeds only when no claim is live (none, or an expired one); releaseSend(eventId, token) clears it only for its own token. Both stores keep the claim in internal fields (sendClaimToken / sendClaimUntil; send_claim_token / send_claim_until) that no read maps into an event. AlertDeliveryService — the one path for first deliveries and retries — claims for SEND_CLAIM_LEASE (a fixed 30 s, three times the default 10 s webhook timeout; not tied to a configured eddi.alerts.webhook-timeout), reads the event, checks that more than the send timeout is left of the lease, sends, and releases in a finally. A claim it cannot take, or a lease too short to finish in, leaves the delivery pending, due again after one lease; the worker never blocks.

  • Erasure waits for live claims. The redactions erasure uses (redactOutputValues, redactRatingComments, and the engine's redactRatingComment) take now and skip an event whose claim is live. AlertErasureRedactor — used by AlertGdprParticipant and ConversationRatingGdprParticipant — repeats the redaction with a short pause until countOutputValues / countRatingComments report nothing left, so the erasure completes only after every send that had read the content has finished or its claim has expired.

  • The engine's own post-insert redactions cannot wait on themselves: they run before the event's first delivery and before the maintenance pass may pick it up (its nextAttemptAt is a claim lease away), so no claim on it can exist yet (said in the code).

  • Alerts → Privacy states the guarantee and its one limit: a send that started before the erasure completed cannot be recalled.

Design decisions

  • Claim per send, not per event delivery: an event with five targets would otherwise hold one claim across up to five webhook timeouts.

  • The erasure's wait is bounded by ten leases (5 minutes). A claim always expires within one lease, so only a store that keeps failing the update — or deliveries re-claiming without pause, which the backoff rules out — reaches the bound; the step is then reported failed instead of hanging the erasure. This is the one place the implementation is stricter than "keep going until the claims expire".

Tests

AlertSendClaimTest drives the races with latches, not sleeps: a send paused after its final read holds the erasure (asserted not complete after two redaction passes), the erasure completes once the send finishes, and a retry then sends the redacted event; erasure first, then delivery, sends the redacted event; a live claim makes the attempt skip, an expired one is taken over; a lease too short after the read releases and skips; the erasure's bound fails the step. Store contract (both ITs): conditional claim, token-checked release, expiry takeover, redaction skipping a claimed event until it is released or expired.


📚 feat(docs-site): build docs/ with Astro + Starlight, the replacement for GitBook (2026-10-26)

Repo: EDDI (feat/docs-site-astro)

What changed and why

docs.labs.ai is GitBook, syncing docs/ one way. The documentation moves to a site we build ourselves: Astro + Starlight, deployed on Vercel like the marketing site, at docs.eddi.technology, with docs.labs.ai redirecting there permanently. The plan, and the facts it rests on (the URLs GitBook has served over the years, the website's hosting, what GitBook provides besides pages), is planning/docs-site-migration-plan.md. This is its phase 1: the site builds locally. Nothing is deployed and docs.labs.ai is unchanged.

  • docs/ is untouched as a format. It stays plain GitHub Markdown, because GitHub renders it, McpDocResources serves it raw to MCP clients and DocumentationLinksTest checks it. docs-site/scripts/sync-docs.mjs reads it on every dev/build run and writes the Starlight copy. docs/SUMMARY.md still decides what is published and is now the sidebar too.

  • Flat URLs from file names — docs/secrets-vault.md → /secrets-vault/. GitBook's URLs carried the SUMMARY section (/security-and-compliance/secrets-vault), so moving a page between sections changed its address; and the flat links the backend and the Manager already print (VaultStartupBanner, ComplianceStartupChecks, the coordinator page) 404 on GitBook today. They resolve on the new site.

  • Links are rewritten, and checked. A link to a published page becomes its route; a link to anything else in the repository becomes a GitHub link. The sync fails on a SUMMARY entry without a file, a link to nothing, two pages that would share a URL, and an #anchor that does not exist. Anchors are checked against the source because starlight-links-validator 0.27 cannot check them under Astro 7: Astro's satteri processor runs plugins before it assigns heading ids, so the plugin sees none and reports every anchor as broken. The source-side check computes the ids with github-slugger, the same way Astro does, and matches all 5,235 heading ids of the built site, none missing and none extra. The plugin still checks every page link.

  • GitBook's machine-readable surface is kept: every page also exists as /<slug>.md (the website links to GitBook's .md URLs), and /llms.txt lists every page, with /llms-full.txt and /llms-small.txt (no changelog) beside it.

  • Everything generated lives in docs-site/.generated/, which is gitignored. DocumentationLinksTest, DocumentationAccuracyTest and DocumentedRestPathsTest skip it by name, so a local site build cannot feed them a second copy of docs/ with site-relative links.

  • The anchor check found one real broken link: two references in changelog/2026-08.md pointed at a heading that had been rotated into the July archive. They now link there.

Verification

  • npm test in docs-site/: 32 tests, including a full sync over the real docs/. Each guard was mutation-checked: disabling the anchor check, blockquote headings, setext headings, entity decoding, the intra-word underscore rule, fence-length and code-span handling, directory READMEs or the slug-collision check each fails a test.

  • npm run build: 94 pages, link validator clean. Seen in a browser — search, Mermaid, dark and light theme, phone width, .md endpoints, the no-slash URLs the backend uses — with no console errors.

Next

Phase 2 of the plan: a page-by-page comparison against GitBook. Then phase 3, the redirect map from every URL GitBook has served, and phase 4, the CI workflow and the Vercel project.


🔐 fix(auth): MCP logins last 30 days, and Keycloak behind TLS advertises https token endpoints (2026-10-26)

Repo: EDDI (fix/mcp-long-lived-sessions)

What changed and why

Connecting Claude Code to a TLS-proxied EDDI deployment surfaced two gaps, both configuration only — no Java change.

1. An MCP login died after 30 idle minutes. An MCP client keeps a refresh token, but it was tied to the realm's SSO session (Keycloak default: 30 minutes idle, 10 hours max), so the user re-ran the browser flow after every break. eddi-mcp now issues offline tokens (30 days idle, renewed on use, revocable per user). In all three realm copies (keycloak/, helm/eddi/files/, k8s/overlays/auth/): offline_access is a Default client scope of eddi-mcp, the role is in its scope mapping, default-roles-eddi includes it, and each seed user lists it. The scope, the role and the scope's role mapping are now defined in the file itself: the realm supplies its own clientScopes, and everyReferencedClientScopeIsDefined rightly refuses a reference to a scope the file does not define, even though Keycloak 26.8 happens to create this one anyway. default-roles-eddi is stated twice in the file (defaultRole and the roles.realm entry) and the roles-list entry is the one an import keeps — with the role added only under defaultRole, a newly created user was refused, so both carry it and the test checks both. eddi-frontend is unchanged — no 30-day tokens in browser storage.

Verified against Keycloak 26.8.0 with the edited realm imported: all seed users and a newly created user receive typ=Offline refresh tokens (2 592 000 s) with their roles and aud=eddi-backend, and the refresh grant works. The same test disproved both recipes docs/mcp-server.md previously gave:

  • default-roles-eddi did not grant offline_access (the realm defines its composites explicitly) — without the role: Offline tokens not allowed for the user or client.

  • Advertising offline_access in quarkus.oidc.resource-metadata.scopes makes Keycloak fail the whole login with invalid_scope on any realm whose client lacks the scope — i.e. every existing deployment. Left at openid.

2. Keycloak behind a TLS proxy advertised http:// token endpoints. With KC_HOSTNAME_BACKCHANNEL_DYNAMIC=true, Keycloak derives the token, JWKS and userinfo URLs from the request, which is plain http behind the proxy; the issuer and authorization URLs come from KC_HOSTNAME and stayed https. Claude Code refuses to send credentials to an http token endpoint, so login failed after the browser step. Fix: KC_PROXY_HEADERS=xforwarded.

  • gcp/provision-vm.sh --https now sets it, and its nginx Keycloak location now sets every forwarded header instead of passing client values through: X-Forwarded-Host $host, X-Forwarded-Port 443, X-Forwarded-For $remote_addr (was appended). Once Keycloak trusts these headers, a client-supplied X-Forwarded-Host would choose the host in that caller's discovery response (review finding, CWE-346).

  • Helm: new keycloak.proxyHeaders — empty means xforwarded when eddi.oidc.publicUrl is https, nothing otherwise; none opts out. Rendered and checked for all four cases. Chart 2.11.0 → 2.12.0.

Files

  • keycloak/eddi-realm.json, helm/eddi/files/eddi-realm.json, k8s/overlays/auth/eddi-realm.json — offline-token wiring.

  • helm/eddi/values.yaml, helm/eddi/templates/keycloak.yaml, helm/eddi/Chart.yaml — keycloak.proxyHeaders.

  • gcp/provision-vm.sh — KC_PROXY_HEADERS in the HTTPS override.

  • src/test/java/ai/labs/eddi/deploy/DeploymentManifestsTest.java — the eddi-mcp scope-mapping assertion allows offline_access; new mcpClientIssuesOfflineTokens pins the three conditions in every realm copy and that eddi-frontend stays without it.

  • ui/manager/scripts/make-test-realm.mjs, ui/manager/e2e/auth/auth-helpers.ts — the Auth E2E fixtures pin each seed user's exact roles; they now include offline_access. ui/manager/e2e/auth/mcp-oauth.spec.ts — the real authorization-code + PKCE + consent flow against eddi-mcp now asserts the refresh token is typ: Offline, the one path the container check could not drive.

  • docs/mcp-server.md — corrected offline-token section, upgrade steps for an existing realm, proxy-header deployment note. docs/kubernetes.md — settings row.

Upgrade note

--import-realm does not touch an existing realm. Existing deployments keep working with ordinary 30-minute MCP logins; for long-lived ones they add the three pieces by hand (steps in docs/mcp-server.md, "Upgrading an existing realm"), the Default scope last — with the scope in place but the role missing from the user or the client's scope mapping, Keycloak refuses the login with Offline tokens not allowed rather than falling back to an ordinary token. Revoke a single offline token under Users → the user → Consents. The nginx Keycloak location also clears X-Forwarded-Prefix (review finding). The quarkus.oidc.roles.role-claim-path=realm_access/roles fix for "requires role" on every tool is already in the image since 6.6.0; deployments on older images should pin it as QUARKUS_OIDC_ROLES_ROLE_CLAIM_PATH.


🐛 fix(ci): the Playwright install no longer waits on the Ubuntu apt mirror (2026-10-26)

Repo: EDDI (fix/playwright-install-slow-apt)

What changed and why

main went red on the fast-uri bump (daecb3513) with no test failing. UI Manager E2E (MSW) and Backend E2E (postgres) both hit the 10-minute limit of Install Playwright browsers, and the re-run failed the same way. npx playwright install --with-deps chromium always runs apt-get. On ubuntu-latest that meant about 26 MB of fonts (CJK, unifont, xfonts) plus a few library upgrades from azure.archive.ubuntu.com, which was serving 25–50 KB/s that afternoon. None of it is needed: the suites take screenshots only on failure and compare none, and the runner image already carries Chromium's shared libraries.

The three steps that installed Playwright (UI Manager E2E (MSW), Backend E2E, Auth E2E (Keycloak)) now run ui/manager/scripts/install-playwright-chromium.mjs. It:

  • downloads the browser from Playwright's CDN (no apt);

  • launches it once, and if that works, skips apt altogether;

  • otherwise prints a ::warning::, runs npx playwright install-deps chromium, and fails the step if Chromium still does not launch.

So a runner image that drops a library still works, it just pays the apt cost again, and the warning says so.

Verified

Both paths ran in Docker against @playwright/test 1.64.1:

  • node:24-bookworm (no Chromium libraries): the probe reported a missing shared library, apt installed the dependencies, the second launch succeeded, exit 0.

  • mcr.microsoft.com/playwright:v1.64.1-noble: launched first time, apt skipped, exit 0.

The ubuntu-latest path itself is verified only by this PR's own CI run.


🔒 fix(security): schedule fire authority, maxCostPerFire, group approver scope, currentversion VIEW (2026-10-26)

Repo: EDDI (fix/schedule-group-authz)

Six findings of the repository security scan (revision daecb3513) on scheduling and group-conversation authorization.

What changed and why

  • Schedule creator re-check used historical teams (#4). ScheduleFireExecutor.creatorUseCheck re-checked USE with the create-time creatorTeams snapshot, so a creator removed from a team kept firing a schedule on an agent shared only with that team. The snapshot is now narrowed by the user directory: when the creator signed in after the schedule was created, a team their latest token no longer lists stops counting (currentCreatorTeams). Only ever narrowing; with no newer directory entry the snapshot stands. Not fixed: creatorAdmin — the directory records teams, not roles, and EDDI has no server-side role source outside a request, so a creator who loses eddi-admin keeps an admin-created schedule firing. Recording roles in the directory (both stores) would close it.

  • maxCostPerFire capped nothing (#26). The field was accepted, stored and shown but never reached the turn. The fire now carries it in the input context (scheduleMaxCostPerFire), and LlmSpendGate.effectiveCeiling — used by the pre-call spend gate and between tool-loop rounds — tightens the agent's maxCostPerConversationUsd to "every earlier step's audit:cost plus the allowance", so a persistent schedule is capped per fire. 0 or below stays unlimited (PostgreSQL stores 0 as NULL).

  • pendingHumanPrompt went to every approver (#8). The approval-status summary (REST and MCP get_group_approval_status) returned a HUMAN member's rendered prompt — discussion content — to any eddi-approver. It now goes only to the pending member, the owner, admins, and an approver while the conversation awaits approval (HitlAccessGuard.mayReadPendingHumanPrompt), the same window the full view grants.

  • approve/stream streamed the resumed discussion to approvers (#27). An approver-only caller now gets a listener that forwards hitl_resume (or, on a rejection, group_complete without the synthesized answer), errors and cancellation, then closes; the owner and admins keep the full stream (HitlAccessGuard.mayReadResumedDiscussion). Same boundary as the agent resume's "a reply is a read". The approver's hitl_resume is held until resumeDiscussion returns: the coordinator announces the resume before it submits the resumed run, and a submit failure restores the pause and throws, so sending it at once told the approver their decision was applied while the discussion stayed paused, and closed the stream before the endpoint's group_error could reach it (ApproverStreamingListener.resumeEnqueued).

  • A tool-call resume skipped the cost ceiling. LlmTask.executeResume never asked the spend gate, and the tool loop checks its ceiling only after the model has answered, so a conversation (or a scheduled fire under maxCostPerFire) spent while it waited for approval still ran the approved calls and its first resumed model request. The resume now runs the same preflight before the approved calls (refused → the fallback answer, llm:spend_refused:<taskId>, the batch consumed), and the resumed loop checks before its first request too, counting what the approved calls charged: runToolCallLoop takes the tool-cost baseline from its caller, taken before those calls, instead of snapshotting it at loop start. What the turn spent before the pause was invisible to both checks: the loop's tokens and tool cost so far died with the pause signal, so a fire that had used $0.02 of a $0.025 allowance resumed as if it had spent nothing. The pause now carries that spend (ToolApprovalRequiredException.addSpend: the loop's rounds at the task's prices plus its tool-cost delta, and an enclosing cascade's earlier steps), and LlmTask.execute adds it to the step's audit:cost and audit:token_usage as the pause passes — the step the pause snapshot persists and the pause's settle meters. The resume reads it through audit:cost in its preflight, its loop ceiling and its total, so it counts once; this also closes the documented gap where a resumed turn's ledger entry under-reported its pre-pause segment. Docs: langchain.md.

  • Follow-up did not re-check group USE (#37). POST …/followup (and MCP followup_with_member) checked transcript ownership only; like a continuation, it now also requires current USE on the group.

  • /{id}/currentversion had no per-resource check (#6). IRestVersionInfo's two endpoints now call requireCurrentVersionAccess(id) first; all sixteen stores (and RestVersionInfo) implement it as VIEW via RestVersionInfo.requireViewAccess. The default refuses, so a new store that forgets fails closed. getCurrentResourceId stays the unguarded resolver in-process engine code uses.

Files

ScheduleFireExecutor.java, ScheduleConfiguration.java, LlmSpendGate.java, ToolLoopRunner.java, ToolLoopResumer.java, ToolApprovalRequiredException.java, CascadingModelExecutor.java, LlmTask.java, HitlAccessGuard.java, RestGroupConversation.java, McpHitlTools.java, McpGroupTools.java, IRestVersionInfo.java and the sixteen Rest*Store classes. Docs: scheduling.md, hitl.md, langchain.md, group-conversations.md.

Design decisions

  • maxCostPerFire rides the existing priced-spend ceiling rather than a new tool-only budget: it then covers model tokens as well as tools, and every node that runs the turn enforces it because the value travels in the input. A client that sets the context key itself can only lower its own ceiling.

  • The approver stream closes at the resume instead of filtering event by event: everything after the resume is outside the approval window, and a closed stream cannot start leaking when a new event type is added.

  • The pre-pause spend is recorded on the step at the pause, not carried on the persisted PendingToolCallBatch for the resume to add: the step already survives into the pause snapshot and is what TurnCostMeter settles, so the spend is metered even if the pause is never resumed, and a figure on the batch would be one more place a cost could be applied twice.


🔒 fix(security): close the DNS-rebinding gap between the SSRF check and the connection (2026-10-26)

Repo: EDDI (fix/ssrf-dns-pinning)

What changed and why

A repository security scan flagged three paths where the SSRF check resolves a host and the HTTP client then resolves it again to connect: OutboundHttp (JDK client), the Vert.x httpcalls client, and cached MCP transports. Both lookups normally hit the JVM's positive DNS cache and agree; a rebinding name aims for the moment that cache entry expires between them. This was recorded as an accepted risk in docs/architecture.md. None of the clients can be handed the validated addresses (the JDK HttpClient has no resolver hook, and an IP-literal URL breaks SNI and certificate checks), so each path now closes the gap with what it can see:

  • httpcalls (Vert.x): a web-client interceptor checks the address the connection actually reached in the SEND_REQUEST phase, before a byte is written, on every request, pooled connection and redirect hop. A metadata or link-local peer is refused always; with eddi.security.ssrf-protection.enabled=true a private peer is refused unless the host is allow-listed. This is a real pin of the decision to the connection.

  • OutboundHttp: each hop's SSRF check runs again once the response headers are in. The connection's own lookup is what the cache now holds, so a target that turned private (or into the metadata service) has its response discarded and closed before it reaches the caller or a redirect. A startup warning names networkaddress.cache.ttl=0, which would defeat it.

  • MCP: the server URL is validated on a tool-cache hit too, not only on a fresh discovery, and again inside the transport's per-request header hook, so a cached transport never sends to a URL that no longer passes.

What remains (written up in security.md → DNS rebinding): on the OutboundHttp path the request itself has already been sent when the second check refuses it, so this blocks reading the response, not a blind request; an exchange slower than the cache lifetime defeats the second look; MCP keeps the pre-connect window. A full pin of the JDK path needs a resolver hook the JDK does not offer, or one HttpClient per pinned host with explicit SNI, which is a larger change.

Files: HttpClientModule.java, OutboundHttp.java, McpToolProviderManager.java, UrlValidationUtils.java, security.md, architecture.md. Tests: HttpClientModuleConnectedPeerTest, OutboundHttpTest$Rebinding, McpTransportRevalidationTest, McpToolProviderManagerDiscoveryTest#cacheHitIsRevalidated.


🔒 fix(llm): tool results redacted before the model, bounded selector extraction (2026-10-26)

Repo: EDDI (fix/tool-result-redaction)

Two findings from a repository security scan of daecb3513.

What changed and why

  • Tool results are redacted before they reach the model. Only the display trace was filtered: an administrator's config-read tool (the Platform Operator) showed <REDACTED> while the hosted model provider received the plaintext key. ToolLoopRunner.executeToolCall now runs SecretRedactionFilter.redact on the result before truncation (the summarize strategy sends it to a model too) and before the guardrail envelope; the raw result stays internal (LAZY activation, repeat guard). Trade-off, documented: a key-named value such as nextPageToken reaches the model as <REDACTED>.

  • Selector extraction no longer multiplies nested text. WebScraperTool.extractWithSelector copied each match's whole descendant text, so nested matching ancestors repeated the same text up to 20 times. An element inside an already listed one is skipped, and text is gathered by a bounded walk (boundedText) against one 20,000-character output budget (5,000 per element), so nothing past the budget is materialized.

Design decisions

  • The webhook replay findings of the same scan are not in this change. Open PR #1126 already moves the webhook dedup cache to a cluster-shared bucket and refuses instead of evicting; the longer retention for body-signed schemes (github, generic-hmac) follows once it has merged, so the two do not conflict in WebhookEventHandler and CacheFactory.

Files: ToolLoopRunner.java, WebScraperTool.java, security.md


🔒 fix(secrets): linear-time reference scanning, a new secret's grant is checked against agents already referencing it, rotation retires legacy checksums (2026-10-26)

Repo: EDDI (fix/vault-reference-scanning)

Follow-up to a repository security scan of the vault and connection code.

What changed and why

  • Reference scanning is linear. find() over the ${vault:…}, ${connection:…}, ${vars:…} and tenant-reference regexes retried at every opener, and when no closing brace followed, each attempt scanned the rest of the text. A global variable value or a parameter with thousands of unterminated openers therefore cost time quadratic in its length, on every variable write, every deployment grant check and every resolved parameter. The new ReferenceScanner gives the regex's answers match for match (same start, end, tenant and name, nested openers included) but remembers its searches for the next } and /, so each character is examined a constant number of times. SecretResolver, VaultGrantChecker, SecretReference.parse and ConnectionReference (contains, requireSole, parse) use it. SecretReference.VAULT_PATTERN and ConnectionReference.CONNECTION_PATTERN stay as the documented grammar.

  • A secret's grant is checked when it is created, against the agents already referencing it. VaultGrantChecker lets a deployment through when a referenced secret does not exist yet — agent sync promotes a workflow to an instance that does not hold the source's secret and then deploys it, and AgentSyncIT covers that flow. The resolver checks no grants, so a secret created later and restricted to another agent used to resolve for every agent already deployed with a reference to it, until its next deployment. PUT /secretstore/secrets/{tenantId}/{keyName} and the space-secret endpoint now answer 409 under enforce to a create whose allowedAgents leaves out such an agent, naming it (VaultGrantImpactAnalyzer.refusalToCreate, reusing the grant-change impact scan); warn logs and creates, off does not look. A first version of this branch made the absent secret a deploy-time violation instead, which broke the agent-sync flow.

  • The create-time scan covers the cluster, and refuses when it could not look everywhere. The scan read only IAgentFactory, a per-node registry, while the vault is shared by every node, so an agent deployed on another node was invisible to a create handled here. It now also reads the deployment records in the shared database (IDeploymentStore.readDeploymentInfos(deployed)), deduplicated against the local registry, which alone sees a deployment still IN_PROGRESS (now counted) or one made with autoDeploy=false. And refusalToCreate used to ignore the scan's complete flag, so under enforce an agent whose configuration could not be read, or a listing that failed, let the create through on an empty list. It now refuses with its own 409 naming the unread agents (GrantImpact.unverifiedAgents). This is the opposite of the deploy gate on purpose: a refused deployment is an outage, a refused create is a retry, and naming the agent on the grant or granting * needs no scan. The grant-change response's agentsLosingAccessScope reads cluster instead of this-node. Left open: a deployment recorded on another node a moment after the scan read the records.

  • The checksum key cannot be stranded under a retired KEK. loadOrCreateChecksumKey checked the KEK before inserting the key, but a node stalled between that check and the insert past rotateKek's last read of the key would persist it wrapped under the retired KEK, and every node restarted with the new master key would then fail on its next store. The race predates this branch (first store), and the legacy-checksum upgrade in rotateDek made it reachable a second way. The insert is now followed by a second check, as for a DEK (takeBackIfKekRetired): when the KEK moved, the key is deleted only while it is still the value this node wrote (ISecretPersistence.deleteMetaValueIfEquals, atomic on Mongo and Postgres), so a key the rotation already re-wrapped is kept.

  • DEK rotation upgrades legacy checksums. A row written before the keyed checksum still held a bare SHA-256 of the plaintext, which anyone with the row or a backup can test guesses against offline. VaultSecretProvider.rotateDek has the authenticated plaintext in hand, so it now writes the keyed, tenant-bound checksum in the same guarded re-seal. updateSecretSealing (Mongo and Postgres) persists the checksum with the ciphertext.

Docs: secrets-vault.md ("What counts as granted", and the checksum note under the REST API).

Tests

  • ReferenceScannerTest: parity with the regexes on hand-picked and fuzzed input, matchesWhole, replaceAll, and timing guards on many unterminated openers for each caller.

  • VaultGrantCheckerTest.absentSecretIsNotAViolation; VaultGrantImpactAnalyzerTest (create-time refusal, modes, an unreadable agent or a failed listing refusing under enforce, agents found only in the deployment records, one agent in both sources checked once, IN_PROGRESS counted); RestSecretStoreGrantOnCreateTest (409 and no write).

  • MongoSecretPersistenceTest and PostgresSecretPersistenceTest (Testcontainers): deleteMetaValueIfEquals keeps a value that differs from the expected one and removes only the exact one.

  • VaultKeySafetyTest.StaleReplicaRace: a checksum key inserted after a KEK rotation, via rotateDek and via store, is taken back and a node on the new master key can store.

  • VaultKeySafetyTest.rotationRetiresLegacyChecksums.

  • PostgresSecretPersistenceUnitTest follows the new parameter order.

Stale deployment rows. The deployment sweep now checks for a missing Agent config before skipping rows this node already tracks, so a shared row that the agent-delete cascade could not remove is retired (and the agent undeployed locally) instead of lingering (for rows this node already tracks the check runs at most once every 5 minutes per row, since the agent store has no read cache) and making the grant analyzer answer UNKNOWN for it.


feat(hitl): a person's note on a rejected tool call asks the model to revise (2026-10-26)

Repo: EDDI (feat/hitl-note-asks-for-changes)

What changed and why

An approval card lets a person send a note instead of approving ("use a shorter title"). Until now a rejected call always told the model "the reviewer declined this action, do not retry, offer alternatives", so a note that asked for a change produced an explanation instead of a corrected proposal. Two small changes in ToolLoopResumer:

  • The instruction depends on who decided. When the note is non-blank and decidedBy does not start with system:, the rejection tool-result says the user did not approve the call and left a note: if the note asks for changes, call the tool again with exactly those changes and nothing else changed (the user will be asked to approve the new call); if it declines or asks for something else, do not call it again and reply briefly. With no note, or for an automated decision (system:timeout, system:group), the text is exactly what it was. Detection is the existing system: convention on decidedBy, never the note text, so the group-conversation auto-reject cannot make the model retry a call that can never be approved.

  • A per-call rejection falls back to the top-level note. A call listed in toolDecisions with REJECTED and no note of its own (absent or blank) now uses decision.note, as an unlisted call already did. A call's own note still wins; approved calls are unaffected.

The re-proposed call is an ordinary new call: it is gated, pauses again with a new pauseId and needs its own approval, so an approved call is never silently changed. Each re-proposal counts toward hitlConfig.toolApprovals.maxPausesPerTurn (default 3, maximum 10); docs/hitl.md says to raise it where notes are expected to come back as revisions.

No REST shape, verdict type or default changes.

Tests

ToolLoopResumerNoteTest: the envelope for a person's note, for no or blank note, and for system:timeout / system:group with a note; the per-call fallback through the real resume loop (own note kept, absent and blank fall back, unlisted unchanged); and one test that stores a paused conversation as a snapshot document, loads it back, resumes it REJECTED with a note and asserts the model's next request carries the new instruction and the note.


🐛 fix(llm): a \' inside a JSON reply no longer turns a complete answer into the fallback (2026-10-26)

Repo: EDDI (fix/llm-json-repair-backslash-quote)

What changed and why

Gemini sometimes escapes an apostrophe inside a JSON string the way JavaScript and Python allow: "Japan\'s ruling class". JSON has no \' escape, so ModelOutputParser reported invalid JSON syntax for the whole reply, and a convertToObject task served its fallback answer ("Sorry, I could not answer that just now"). In the case that showed it, the reply was complete and correct, about 1,300 characters long, and one apostrophe was the only defect.

ModelOutputParser now drops the backslash of \' inside JSON strings, after the fence strip and before parsing. This is the one exception to its "invalid JSON is never fixed" rule, and the class Javadoc says so. It is safe because \' is never valid JSON and can only mean '.

  • The pass is string-aware and linear. It copies every other escape as the pair it is, so \\' (an escaped backslash, then a quote) stays valid JSON and \" does not end the string. Outside strings nothing changes.

  • The whole reply is repaired once; when the object has to be extracted from prose, each candidate is repaired on its own, so an unmatched " in the text before the object cannot shift what counts as inside a string.

  • A reply without \' is not copied.

  • A repaired reply reports repaired, like a stripped fence.

  • A reply that is still invalid keeps its raw text, and a second, real syntax error is not hidden.

Tests

ModelOutputParserTest:

  • accepted: the observed case, several \' in one object and inside an array, fenced, with prose around it, and with an unmatched quote in the prose before it;

  • left alone: \\' stays valid and unrepaired, and an escaped double quote does not end the string;

  • still rejected: prose containing \' is not JSON with the raw text kept, and \' plus a trailing comma is still invalid JSON syntax.

Mutation checks:

  • With the repair switched off entirely, the acceptance cases that contain \' fail, and the \\' case passes either way, as it should.

  • With only the per-candidate repair removed, the two extraction cases fail: prose around the object, and the unmatched quote before it.


✨ feat(email): conversation mode — the agent replies in the mail thread — email Phase 3 (2026-10-25)

Repo: EDDI (feat/email-conversation-mode, on top of feat/email-trigger-mode, feat/email-dkim, feat/email-hitl-notifications and feat/email-mail-core)

Phase 3 of the email plan (§5 conversation column, §9, §10, §11, §12, §13, §15, §16, §17, §20, §21): channelType: "email" with mode: "conversation". The agent answers in the thread over SMTP — only to the DKIM/DMARC-authenticated From of the mail it answers, never Cc, never an unauthenticated or email-anon: sender, never an address the model chooses. Trigger mode is unchanged and still sends nothing. Docs: email-integration.md → Conversation mode.

Settings and save validation

  • EmailChannelSettings: mode: "conversation" is accepted, with smtpHost (required), smtpPort (587 STARTTLS required, default, or 465), fromName (header-safe, ≤ 100), replyTemplate ({output}, ≤ 4000), aiDisclosure (a default sentence; a present, empty value switches it off, ≤ 500), threadParticipants (originalSenderOnly | anyAuthenticatedParticipant), maxRepliesPerThreadPerHour (5, 1–1000) and honorReplyTo (false). requireAuthentication: false is refused in conversation mode, and from() forces it true so no reader can see false; correlateThreads is implied (and refused with a value). Each mode refuses the other's keys when they carry a value. New save warnings in X-Eddi-Warnings: email.ai-disclosure-disabled, email.honor-reply-to.

  • EmailChannelSupport also resolves smtpHost under the author socket policy (SafeSocketConnector.resolve, Protocol.SMTP) and requires the connection's allowlist to name smtp://<host>:587 / smtps://<host> besides the IMAP origin.

Transport and the reply path

  • SmtpSubmitter (engine/mail, new): the one SMTP submission over Angus Mail on a SafeSocketConnector endpoint, extracted from SystemMailer (which now delegates). The policy is the caller's: it takes an Endpoint and never resolves a host.

  • MailTransport.send (SPI) — ImapMailTransport sends over SMTP with the integration's connection (BASIC, or XOAUTH2 with the mailbox as user), envelope sender = the mailbox (bounces come back to it). It refuses an integration that is not in conversation mode, and any endpoint that is not an author-policy SMTP endpoint, before a socket opens. MailboxSession.findByMessageId finds a mail again by SEARCH HEADER Message-ID (exact match after) in the polled folder or the move folder.

  • integrations/email/reply/ (new): EmailReplyRecipients (the one recipient decision, re-applied on every attempt: conversation mode; the answered mail is this integration's inbound row and reached a turn; the conversation runs as email:<id> / email:<id>:<address>, never email-anon:; the mail's step in memory names the same mail, aligned-pass and the same From; under perSender + originalSenderOnly the identity is that address; never the own address; Reply-To only with honorReplyTo and exactly one address), EmailReplyComposer (replyTemplate on the restricted engine with the output and subject as data, then the disclosure; OutboundMail.replyInThread, new), EmailReplyThread (reads the reply from conversation outputs — the same outputs from the completion callback and from the stored conversation), EmailReplySender (ledger rows, inline first attempt on a managed executor, retries, bounces), EmailHitlResumeObserver.

  • Ledger: Kind.REPLY, Direction.OUT, idempotency key reply:<sha256(conversation, inbound row + step, kind)>, sourceRef = <inbound row>|<kind>|<step|pause|verdict>; claim/lease/complete/reschedule like notifications, its own worker (@Scheduled(identity = "email-reply-sweeper"), eddi.email.reply.sweep-interval, claimDue(Kind.REPLY)), backoff and attempts from eddi.email.outbound.*, FAILED → owner notice reply_failed. No body: a retry re-reads the conversation and re-renders under the row's Message-ID. New findByConversation and countByConversationSince (indexes on both stores).

  • Inbound (EmailInboundProcessor, conversation-mode branch only): the turn is submitted with all outputs in the detailed projection — the default one strips each step's context, where the mail map lives, so a reply would find no step to answer (EmailReplyThreadSnapshotTest pins this against the real converter, and the retry and sweep reads ask for the same) — and with the mail's ledger key as its idempotency key; its completion hands the snapshot to the reply sender before the row moves to DONE. A mail whose In-Reply-To/References names one of the integration's replies continues that reply's conversation — when its sender started it, or (anyAuthenticatedParticipant) a reply in it was sent to them; anyone else falls through to the sender-keyed thread key. The mail context map gains inReplyTo, references, replyTo. A group target's synthesis is the reply (GroupDiscussionEventListener.onGroupComplete).

  • HITL in the thread: on HitlPauseCommittedEvent the sender gets the output so far plus the pause reason — never the tool or its arguments; on HitlResumeCompletedEvent the continuation (approval) or a plain notice (rejection, cancellation, timeout, failed continuation), the approver never named. Human takeover: not built (planning/human-takeover-design.md is a design under review), so nothing to send.

Loops, bounces, suppression

  • maxRepliesPerThreadPerHour counted from the ledger per conversation; over it the row is SUPPRESSED (THREAD_BUDGET) with a once-a-day owner notice thread_throttled.

  • A DSN for one of the integration's own reply Message-IDs, with a permanent failure for that reply's recipient, fails the row (BOUNCED: <status>) and adds the address to the new IEmailSuppressionStore (Mongo + Postgres, per integration, SHA-256 + domain, no address); delays are noted. Never sent to a suppressed address (checked at queueing and before each attempt). Cleared by an administrator through the new GET /channelstore/channels/{id}/email-suppressions and POST …/email-suppressions/clear (EDIT on the integration; the address in the body, not the URL). Deleting the integration drops its list; GDPR erasure deletes an address's entries (EmailSuppressionGdprParticipant, step emailSuppressions).

Stranded handling (both modes)

  • A TURN_SUBMITTED row whose conversation holds the mail's step: conversation mode rebuilds the missing reply (or pause notice) from the stored conversation (stranded_recovered{outcome=reply_rebuilt}) before closing the row.

  • The trigger-mode gap is closed: a conversation that was started but never ran the mail's turn (idle or paused, no step for the mail) is handed back to RECEIVED keeping its conversation (conditional — one sweeper wins, outcome=resubmitted); the next poll finds the mail by Message-ID in the polled or move folder and runs it once in that conversation (the turn's idempotency key is the mail's ledger key). Not in the mailbox any more → REFUSED(stranded:not_in_mailbox) + lost notice. Ended or failed conversations, and unreadable ones, are resolved as before — when in doubt, a mail is not run twice.

Metrics, audit, Manager, operator, docs

  • eddi.email.outbound{kind=reply,outcome=sent|retry|failed|suppressed|throttled|refused|bounced|no_output}, eddi.email.outbound.latency{kind=reply}, eddi.email.suppressions{reason}; eddi.email.inbound gains outcome=bounce and real mode tags. Three Full Metrics panels (k8s copy re-synced), metrics.md.

  • Audit email.reply per sent, failed or bounced reply (integration, reply kind, outcome, Message-ID, ledger row, recipient domain + SHA-256 — no address, no body).

  • Manager: a mode selector, a Replies section (SMTP host/port, sender name, who may continue a thread, reply limit, Reply-To with its warning, AI disclosure toggle with its warning, reply template), forced authentication in conversation mode, mode switches drop the other mode's keys, DKIM/DMARC and suppression notes, the two new warning toasts; 38 new emailChannel.* keys and one reworded (modeNote) in all 11 locales. Operator revision 38 → 39: the system prompt explains conversation mode, its recipient rules, HITL in the thread, bounces and how suppressions are cleared; no channel endpoints are granted (the operator has none), so tool-scopes.ts is unchanged. MCP channel tool descriptions and the eddi-admin plugin skill cover conversation mode.

  • Docs: email-integration.md, hitl.md, security.md, configuration-reference.md, gdpr-compliance.md, compliance-data-flow.md; the plan's status line says Phases 0–3 are implemented and 4–7 are not.

Tests

Unit: EmailReplyRecipientsTest (every rule alone), EmailReplyComposerTest (output and subject as data, {#include} printed, threading headers, header injection), EmailReplySenderTest (idempotency under concurrency, suppression at queueing and before the attempt, thread budget, retries rebuilt with the same Message-ID, permanent failure → owner notice, re-checked rules on retry, pause notice minimisation, resume continuation, DSN mapping and spoofed DSNs, group synthesis), EmailConversationModeTest (processor + sender: reply, thread via EDDI's Message-ID, hijack guard, participants, unauthenticated never answered, bounce → suppression, resubmission, trigger mode never touches the reply sender), EmailChannelSupportTest, EmailHitlResumeObserverTest, EmailSuppressionGdprParticipantTest, the suppression store contract on the in-memory double, and new cases in EmailChannelSettingsTest, RestChannelIntegrationStoreEmailTest, EmailInboundSweeperTest, the ledger contract. EmailTriggerModeSendsNothingTest is rewritten on purpose: SystemMailer only in the staff notifiers, SMTP only in ImapMailTransport (and the save-time host check), composing only in the notifiers and the reply path, transport.send only in EmailReplySender, and the transport refusing trigger mode. ITs: EmailConversationModeIT (GreenMail IMAPS + SMTPS on loopback, TLS verified: full loop with headers, answer to EDDI's Message-ID, third party, bounce → suppression, crash before send → exactly one rebuilt reply, resubmission found by Message-ID and run once), Mongo/PostgresEmailSuppressionStoreIT, the new cases of Mongo/PostgresEmailMessageLedgerIT. The security guards were mutation-checked.

Review follow-up (PR #1144)

  • Resubmissions per integration. pendingResubmissions read one global batch of 50 due RECEIVED rows and filtered it in memory, so rows nobody polls any more (a deleted or invalid integration's) could fill it for ever. The new IEmailMessageLedger.findDueResubmissions(integrationId, now, limit) filters in the store (MongoDB, PostgreSQL, in-memory, contract case). Orphaned rows block nobody now and are left to ledger retention.

  • No 500-row cap on a thread. findByConversation (oldest 500 rows) gives way to findInboundTurn(conversationId, latest) and hasSentReply(conversationId, recipient), so a long thread still finds the mail a pause notice or continuation answers, and anyAuthenticatedParticipant still admits an address a late reply went to.

  • Cost before the reply. completed() records the turn's spend before queueing the reply, so a reply that cannot be queued no longer drops the cost from dailyCostBudgetUsd.

  • A failed reply rebuild keeps the row. The stranded sweep leaves the row TURN_SUBMITTED (reply_rebuild_failed:<n>, deadline moved by stranded-after) and tries again, 5 sweeps in all, instead of closing it DONE with no reply.

  • Oversized resubmission. A resubmitted mail found over maxMessageBytes ends REFUSED(too_large) and the poll goes on, instead of failing and backing off on the same row every poll.

  • Wording. hitl.md, configuration-reference.md and email-integration.md say the ledger deduplicates rows, not deliveries: a crash after the relay accepted a message and before its row completed can send it twice (same Message-ID). The recipient rule in the Manager's mode note, the operator prompt (revision 40), the create_channel_integration description and the eddi-admin skill now name the honorReplyTo exception; the throttle hint says further replies are not sent (they are SUPPRESSED), not delayed — all 11 locales.

  • Manager mode. emailMode reads the mode case-insensitively like Mode.fromId, so an API-saved "CONVERSATION" integration keeps its conversation controls and reply settings on save.

  • Tests: EmailConversationModeTest, EmailReplySenderTest, EmailInboundSweeperTest, EmailMailboxPollerTest, the ledger contract (Mongo/PostgresEmailMessageLedgerIT) and email-channel.test.ts, each mutation-checked.


✨ feat(email): the email channel in trigger mode over IMAP — email Phase 2 (2026-10-25)

Repo: EDDI (feat/email-trigger-mode, on top of feat/email-dkim, feat/email-hitl-notifications and feat/email-mail-core)

Phase 2 of the email plan (§3, §5 trigger column, §6, §7.1 inbound, §9–§14, §17, §20, §21): channelType: "email" with mode: "trigger". EDDI polls an IMAP mailbox and every new mail starts one agent turn. Nothing is ever sent to a sender — no reply, no bounce. Conversation mode is refused at save time until Phase 3. Docs: email-integration.md.

The channel

  • EmailChannelSettings (configs/channels/model): one reader for the save and the poll path, every key of plan §10's trigger mode with its default, plus port (993 / 143), correlateThreads and ownerNotifyAddresses. Unknown keys and the conversation-mode keys (smtpHost, replyTemplate, aiDisclosure, …) are refused; the connection is a name, never a credential; attachments: store needs a MIME allowlist.

  • RestChannelIntegrationStore registers email. Besides the static checks, EmailChannelSupport checks against the deployment: the host passes SafeSocketConnector.resolve (author policy), the connection exists, is BASIC or OAuth, not PER_USER, and its allowlist names imaps://<host> / imap://<host>:143 (ConnectionResolver.requireMailLoginTarget, new — no credential is resolved), and the address is unique per deployment (fail closed). observeMode is refused. Saving (re)creates the poll schedule; deleting removes it; duplicating is refused (same address). Warnings ride in a new X-Eddi-Warnings header as stable codes: email.open-trigger (no allowlist and no authentication requirement) and email.tools-without-approvals (a target agent can use tools but has no toolApprovals, found by EmailAgentToolsInspector — plan §14 item 6). MCP create_channel_integration / update_channel_integration describe the email keys and return the warnings.

Polling (no custom scheduler)

  • EmailPollSchedules (marker, like RagIngestionSchedules): one HEARTBEAT schedule per integration, email-poll:<integrationId>, every pollSeconds. ScheduleFireExecutor hands it to EmailMailboxPoller before the creator check (the integration governs it) and refuses a row whose name does not match its metadata; RestScheduleStore refuses client bodies declaring the marker, refuses updates of a managed poll schedule (409), and requires EDIT on the integration to fire one. A mail-server outage is a COMPLETED fire with the error in the fire log: the poller backs off by itself (pollSeconds × 2^(failures−1), ≤ 1 h) instead of the schedule dead-lettering.

  • ImapMailTransport (Angus Mail on SafeSocketConnector, author policy only): XOAUTH2 with resolveAccessToken (the address as the user) or BASIC with resolveBasicLogin; one folder opened read-write; envelope + flags + RFC822.SIZE + INTERNALDATE first, then BODY.PEEK[] (never \Seen) bounded by maxMessageBytes; marking sets $EddiProcessed where the server takes keywords and moves with MOVE when configured — never a copy-and-delete, never an expunge (the folder is closed with expunge=false).

  • Cursor (IEmailMailboxStateStore, Mongo + Postgres, new): UIDVALIDITY + the last UID up to which everything is settled; a deferred mail holds it back. The first poll starts at UIDNEXT and records since, so mail predating the integration is never processed (rescans included, with 5 min slack for whole-second INTERNALDATEs). A changed UIDVALIDITY rescans, deduplicated by the ledger and the keyword, counted.

The inbound pipeline (EmailInboundProcessor)

Envelope Message-ID pre-check (a deferred or settled mail costs no download) → size → fetch → parse → ledger row RECEIVED (conditional insert on (integration, IN, Message-ID)) → SenderAuthenticator as of INTERNALDATE (a temporary verdict defers the mail, unmarked, for at most a day) → EmailLoopGuard (auto-reply headers, reports, daemon/null return paths, own address, another integration's address, EDDI-minted Message-IDs, replies to mail another integration or the system mailer sent) → blocklist → allowlist → requireAuthentication → daily cost budget (stops the batch) → per-sender daily turns (defers to the next UTC day) → identity → routing (plus-tag, then subject word, then default) → optional thread correlation → claim RECEIVED → TURN_SUBMITTED → conversation, attachments, turn (queued, not awaited) → DONE from the completion callback with the turn's cost added to the day. Every refusal is REFUSED(<reason>), counted, never answered.

  • Identity (EmailUserIdentity): email:<integrationId>:<address> (perSender) or email:<integrationId> (integration) only for ALIGNED_PASS; otherwise, with requireAuthentication: false, a one-off email-anon:<random> that never correlates and has no memory: ReservedPrincipals.hasNoPersistentMemory makes ConversationService.createPropertiesHandler hand it no user-memory store and no memory tools, and ContextualToolsProvider refuses the memory tool for it as a second line. Both prefixes are reserved principals. Turns are SELF_ASSERTED (no caller identity on the poll thread), so PER_USER connections are refused.

  • Hijack guard: the thread mapping key (IUserConversationStore) is email:<integrationId>:<agentId>:sha256(threadRoot + sender) — a continuation from anyone but the original authenticated sender starts its own conversation, in both identity modes. Busy or paused conversations defer the mail.

  • Mail is data: inputTemplate (default: the mail framed as untrusted third-party content, plan §14 item 4 — a deliberate deviation from §10's bare {mail.subject}\n\n{mail.text}) renders on the restricted runtime engine with the mail as data; a failing template falls back to subject + text joined in Java. The mail context carries plan §10's fields plus anomalies (e.g. alternatives_diverge); mail.text goes to the template only.

  • Attachments: store puts allowlisted types into IAttachmentStore under the conversation and passes attachment_<n> (storageRef) to the multimodal pipeline; executables never, at most 20, every skip named.

  • Budgets and owner notices (EmailOwnerNotifier): once per UTC day and reason (budget, throttled, quota), cluster-wide via claimNotice: a WARN line always, plus a plain-text mail through the Phase 1 system mailer to ownerNotifyAddresses inside eddi.mail.notify.allowed-recipient-domains when a mailer is configured; one attempt, a NOTICE ledger row, no retry. Tenant quotas apply as for webhooks (a refusal hands the claim back and stops the poll).

Ledger, stranded turns, GDPR

  • IEmailMessageLedger gains Kind.TRIGGER/NOTICE, the inbound states, transition, findDue, findByMessage, findOutboundByMessageId and countInboundTurns (new indexes on both stores). An inbound row's recipient is the sender, so the existing erasure/export path reaches it.

  • Stranded turns (EmailInboundSweeper, @Scheduled(identity = "email-inbound-sweeper")): a row still TURN_SUBMITTED past eddi.email.inbound.stranded-after is resolved from its conversation — idle/failed/paused → DONE, running → deadline extended, no conversation → REFUSED(stranded). In trigger mode there is no reply to rebuild, and a mail is never run twice (the raw bytes are not kept and a second run could repeat tool side effects), so a node dying between claim and turn is the one way a mail can be lost; it is logged and counted. The sweep also re-creates missing poll schedules (e.g. after a ZIP import).

  • Audit: every refused mail is an audit entry email.inbound (integration, reason category, ledger row, Message-ID, sender domain + SHA-256, no address or content). Integration create/update is not audited separately yet.

  • GDPR: EmailIdentityGdprParticipant (emailIdentities) runs the erasure/export cascade for every email:<integrationId>:<address> identity of an address (current integrations and those its inbound rows name); EmailLedgerGdprParticipant also matches email: identities.

Metrics, docs, Manager, operator

  • eddi.email.inbound{integration,transport,mode,outcome}, eddi.email.poll.duration{…,outcome}, eddi.email.poll.cursor_resets, eddi.email.ledger.stranded_recovered{outcome}; eddi.email.outbound gains kind=notice. Four panels on the Full Metrics dashboard's Integrations row (k8s copy re-synced), metrics.md. eddi.email.auth{result} stays deployment-wide (one tag set per name).

  • New properties eddi.email.poll.max-messages-per-poll (50), eddi.email.poll.max-duration (2m), eddi.email.inbound.stranded-after (30m), eddi.email.inbound.sweep-interval (5m).

  • Docs: email-integration.md (Exchange Online with OAuth client credentials and a per-mailbox permission, app passwords, every key, what the agent sees, identity, threads, budgets, security, the helpdesk recipe — webhook channel + httpcalls), SUMMARY.md, security.md, configuration-reference.md, compliance-data-flow.md (the mailbox host as processor), gdpr-compliance.md, connections.md.

  • Manager: an Email channel type with a trigger-mode form, the security hints (allowlist, Exchange per-mailbox permission, tool approvals), the open-trigger warning before saving and the X-Eddi-Warnings codes as toasts after (api-client.ts now exposes response headers); 73 emailChannel.* keys in all 11 locales. Operator revision 37 → 38: the system prompt explains the email trigger channel, its security posture and when to use the helpdesk recipe instead; no new endpoint, so tool-scopes.ts is unchanged. The eddi-admin Claude plugin skill mentions the email channel.

  • ReservedPrincipalsTest classifies the new non-principal prefixes (and sha256: / notify:, which the previous slice left unclassified).

Tests

Unit: EmailChannelSettingsTest, EmailInboundProcessorTest (state machine; temporary verdicts not marked; unauthenticated refused or anonymous without correlation; loop guard; lists; oversize before download; crash after claim; hijack guard in both identity modes; executables never stored; Qute in subject/body printed, not run; budgets, throttle, quota), EmailMailboxPollerTest (mark after the ledger, cursor holding, STOP, skips, UIDVALIDITY, backoff, self-removal), EmailInboundSweeperTest, EmailChannelPiecesTest (patterns, identity, schedule, notices, GDPR), RestChannelIntegrationStoreEmailTest, and email cases in ScheduleFireExecutorTest, RestScheduleStoreTest, ConversationServiceDeepBranchTest. ITs: EmailImapPollingIT (GreenMail IMAPS on loopback through the SafeSocketTestSupport seam, TLS verified: new mail runs and is flagged but not \Seen, move, oversize, crash between ledger and mark, UIDVALIDITY change, login failure), Mongo/PostgresEmailMailboxStateStoreIT, and the inbound cases of Mongo/PostgresEmailMessageLedgerIT. The security guards were mutation-checked.

Review follow-up: crash recovery, keywords, type switching, a send guard

  • A claimed mail that did nothing is processed again. New inbound state CLAIMED between RECEIVED and TURN_SUBMITTED: the claim is taken first, and TURN_SUBMITTED (the point of no return) is written immediately before the first side effect (conversation start, group discussion, turn). A mail is marked or moved only when its row is past that point or refused, and the cursor never passes an unsettled mail, so a CLAIMED mail is still unmarked in the polled folder. A stale claim (past eddi.email.inbound.stranded-after) is given back to RECEIVED — by the next poll that meets it, or by the inbound sweep — and the poll fetches and processes it again (stranded_recovered{outcome=requeued}). The sweep deliberately opens no IMAP session: the poller owns the mailbox under its schedule's cluster claim. Only TURN_SUBMITTED without a recorded conversation (a crash inside startConversation, whose CONVERSATION_START may have called tools) stays REFUSED(stranded), now also with the once-a-day owner notice reason lost.

  • Servers without custom keywords (Exchange Online, some hosters): marking checks PERMANENTFLAGS for \* or $EddiProcessed; without them — or when the server refuses the STORE anyway — no keyword is set, the poll goes on (cursor + ledger), one WARN per integration per node, and the new eddi.email.poll.marked{result} counter (dashboard panel) shows nothing. Not refused at save time: saving does not connect to the mailbox. The docs recommend move:<folder> for Exchange.

  • Manager: switching an existing channel's type drops the old type's keys (platformConfigForType); switching to email starts from the fixed mode/transport keys, and nothing resurfaces on a round trip.

  • No reply path, pinned: EmailTriggerModeSendsNothingTest scans integrations/email/ and fails if anything but the two staff notifiers (EmailOwnerNotifier, HitlEmailNotifier) references SystemMailer, an SMTP transport or the outbound renderer. Phase 3 changes that test on purpose.

  • Not handled yet: a node that dies after starting a conversation but before the queued turn ran is resolved as DONE.

Review follow-up 2: one start per mail, no partial integration list, CORS

  • A retried mail reuses the conversation an earlier attempt started. When the turn failed after startConversation (a quota, a busy executor, a failed say), the row went back to RECEIVED and the retry started a second conversation, so CONVERSATION_START (which may call tools) ran again — for any mail without a thread mapping (correlateThreads off, or unauthenticated). EmailInboundProcessor now reads the row's conversationId on the retry and sends the turn there; a busy one defers, an ended one starts a new conversation (as a mapped one does). Chosen over refusing such mails, which would drop every mail that met a passing rate limit.

  • EmailIntegrationDirectory.scan() no longer returns a partial list. A store read failure on one integration was swallowed per descriptor, so address uniqueness at save time (fail closed, 503), GDPR identity expansion and schedule ensuring could silently miss it. find() now throws StoreUnavailableException, which scan() lets through; only an unparseable descriptor is skipped.

  • X-Eddi-Warnings is in quarkus.http.cors.exposed-headers, so a Manager on another origin sees a channel save's warnings (CorsExposedHeadersConfigTest).

  • Docs: the ledger lifecycle in email-integration.md names CLAIMED; the Full Metrics Reference's stranded panel describes requeued and the current meaning of lost.

For Phase 3 (conversation mode)

  • Replies are Kind.REPLY rows, Direction.OUT, with sourceRef = the conversation step; the loop guard already exempts replies to an integration's own outbound ids. The thread key (EmailInboundProcessor.correlationIntent) and threadRoot are the mapping to reuse; add the outbound Message-IDs to the root lookup.

  • The stranded sweep is where a lost reply is rebuilt from the snapshot (TURN_SUBMITTED past its deadline with a completed step and no REPLY row).

  • SMTP for a channel must use SafeSocketConnector.resolve (author policy), never SystemMailer/resolveOperator.

  • email-anon: identities must never receive a reply (plan §9); requireAuthentication is forced on there.


🎨 feat(manager): brand-aware strings, logos, titles, update UI and About — white-label phase 3 (2026-10-25)

Repo: EDDI (feat/white-label-4-manager-strings)

What changed and why

Phase 3 of the white-labeling plan: the Manager names the brand instead of EDDI. Unbranded, everything reads and looks as before. docs/white-labeling.md has a new "The Manager" section.

  • src/lib/brand.ts reads window.__EDDI_BRAND__ field by field, with the EDDI defaults for anything missing, so Vitest, the dev server and MSW mode need no backend. It is one store (getBrand, setBrand, subscribeBrand); components use useBrand() (src/hooks/use-brand.ts, useSyncExternalStore). brand.test.ts evaluates the Vite plugin's DEFAULT_BRAND_SCRIPT and requires it to equal DEFAULT_BRAND, which closes the chain Java = plugin = brand.ts that BrandDeliveryTest starts.

  • Strings. src/i18n/config.ts sets interpolation.defaultVariables = { productName, shortName } before i18nReady resolves, and updates them in place (then re-announces the language) when setBrand runs, which is what Phase 4's live reload needs. Of the 77 English values naming EDDI, 63 product mentions became {{productName}} in all 11 locales by script; 12 engine-version gates ("Needs EDDI 6.6 or later", "This EDDI does not record…") were rewritten by hand to "server version" wording in every locale; 2 technical names stay (the eddi-v1 webhook signature hint and the "EDDI Cluster" Grafana dashboard). 76 t() fallbacks in 45 files follow en.json. Eleven translations that had dropped the name, or named it once where English names it twice (onboarding.tour.dashboard.step4Desc in four locales, syncPage.* in three, one German sentence) were retranslated with the variable, because the interpolation-integrity test now sees it. The secrets API's English error no longer names EDDI.

  • Guard: src/__tests__/no-eddi-brand-literal.test.ts fails on \bEDDI\b in any locale value, t() fallback, defaultValue, JSX text, or alt/aria-label/title/placeholder in src (tests, test mocks and comments excepted), after stripping EDDI_*, X-EDDI-* and labsai/EDDI. Its key allow-list holds the Powered-by notice and the two technical names, each with a reason. The Platform Operator's files are excluded with a TODO naming Phase 6.

  • Logos. components/layout/brand-logo.tsx (BrandWordmark, BrandIcon) replaces the bundled data URI in both sidebars and /eddi-icon.svg on the landing page, the Workforce collapsed sidebar and the Workforce onboarding hero. The collapsed Manager sidebar shows /branding/icon when branded and the "E." monogram otherwise. Alt texts and labels are the product name.

  • Titles: use-document-title.ts builds <page> — <app.title>, and app.title is {{productName}} Manager.

  • Update UI (R5): isUpdateUiVisible(brand) (!branded || showUpdateCheck) gates the Updates nav entry and command-palette entry (through useMayOpenScreen), the /manage/updates route (redirects to /manage), the banner in AppLayout, and the automatic check itself (useUpdateCheck's query is disabled), so a stored auto-check preference never contacts GitHub on a branded deployment.

  • About dialog (components/layout/about-dialog.tsx), opened from the Help menu in the sidebar footer, and from the version label when the update UI is hidden: product name, tagline, version, and while poweredBy is on, "Powered by EDDI" with the Apache 2.0 notice and a license link. Six about.* keys in all 11 locales.

  • Dev entry. ui/manager/index.html, which serves deep links under npm run dev, now loads /branding/__brand__.js before the bundle and /branding/brand.css, uses /branding/icon and the %BRAND_PRODUCT_NAME% placeholders; vite-plugin-brand.test.ts pins it.

  • Monaco: the prompt editor's template-variable colours come from --editor-template-variable(-light) in index.css, read once at registration (src/lib/css-color.ts), with today's hex as the fallback.

Design decisions

  • The light/dark logo trick depends on branded. The bundled default for both /branding/logo and /branding/logo-dark is the white EDDI wordmark (the shells' loader shows /branding/logo on a dark background, so the default cannot be dark). Unbranded, the sidebar keeps one image with invert dark:invert-0, pixel for pixel as before. Branded, it shows the light and the dark slot as two images switched by the .dark class (a <picture> media query cannot see the app's theme) and never inverts, since inverting a colour logo produces its negative. Trade-off: a brand that sets only a name keeps the white EDDI wordmark, which is faint on the light sidebar. The settings page (Phase 4) can warn about that; __brand__.js does not say which slots are uploaded.

  • A failed /branding/* logo falls back to the bundled wordmark (onError), so the design-system bundle, which has no server, still renders it; src/assets/logo_eddi.png therefore stays.

  • Engine-version gates name the server, not the brand. "Needs Acme 6.6" would mix the brand with EDDI's version numbers; "server version 6.6" is true under any brand. The sidebar's version label does show <product> <version>, as the plan asks.

  • The update strings use {{productName}} rather than an allow-list: they only show unbranded or when the brand opted in.

  • About sits in the Help menu so it is reachable with the sidebar collapsed too. "Version" is a label beside the number rather than Version {{version}}, which would have counted as untranslated in German and French.

Verified

npm run typecheck, ESLint over every changed file, npm run i18n:check (6,066 keys, no drift), and Vitest over 94 files touching the changed components plus all src/i18n/__tests__ (plural categories, translation-debt baseline, interpolation integrity), the new guard, brand.test.ts and branding.test.tsx (14 branded-mode tests: sidebar logo, monogram and icon, a brand applied after render, Workforce sidebar, landing page, version label, About with and without Powered-by, update UI hidden and restored, the route redirect, the document title). Mutation checks: the guard fails on an EDDI in a locale value, in a t() fallback and in an alt, and on removing a Phase-6 exclusion; the branded tests fail when the update query, useMayOpenScreen's gate, the route gate, the logo branch or the title are reverted (the AppLayout banner gate is defence in depth: the disabled query already keeps the banner away). Brand-leak smoke in MSW mode with a "Zebra Labs" brand forced into window.__EDDI_BRAND__: /welcome, /manage, agents, resources, approvals, secrets, connections, cluster, sync, privacy and /workforce show no EDDI in text, alt, aria-label or title, and every image comes from /branding/. The remaining hits are the "EDDI Cluster" Grafana name (allow-listed) and the shell <title> on /welcome and /workforce, which only the dev plugin fills with EDDI; EDDI itself renders it per brand. /manage/updates redirected to the dashboard. The full Vitest suite was not run locally.

What's next

Phase 4: the Settings → Branding page, which calls setBrand after a save. Phase 6: the Platform Operator (its prompt, activation screen and API errors still say EDDI; the guard excludes those files with a TODO) and the A2A agent-card defaults in agent-detail.tsx. Also open: src/lib/llm-parameter-catalog.data.ts carries two generated notes naming EDDI.


🎨 feat(manager): Settings → Branding page with live preview and live update — white-label phase 4 (2026-10-25)

Repo: EDDI (feat/white-label-5-branding-page)

What changed and why

Phase 4 of the white-labeling plan: an admin edits the brand in the Manager instead of with curl. docs/white-labeling.md has a new "The Branding page" section.

  • Backend tweak. __brand__.js now carries assets: {logo, logoDark, icon, favicon, ogImage}, booleans saying which slots have an image of their own (uploaded or from assets-dir); the hashes stay on the admin API. /branding/logo always answers an image, the bundled EDDI one when nothing is uploaded, so without this a brand that set only a name kept the EDDI wordmark (the Phase 3 gap). Both Vite plugins' DEFAULT_BRAND_SCRIPT and brand.ts's DEFAULT_BRAND follow; BrandDeliveryTest gains a test for the flags and one that ui/manager/src/lib/brand-css.ts carries BRAND_SCALE verbatim.

  • Logos close the Phase 3 gap. BrandWordmark shows the product name as a text wordmark when the brand has no logo (per mode: only a dark logo means text in light mode). BrandIcon draws the short name's initial on the primary colour when the brand has no icon. Branded image URLs carry ?r=<revision> (brandAssetUrl), so a replaced logo shows at once despite max-age=300.

  • The page (src/pages/branding.tsx, route /manage/branding, Admin section, nav.branding): names with character counts; five colours with a picker and a text field; the two toggles; a light and a dark preview (components/branding/brand-preview.tsx); five image drop zones (components/branding/brand-asset-slot.tsx); Save; Reset behind a confirmation; the source badge and last-saved line; a locked notice naming eddi.branding.locked and the source.

  • Validation mirrors BrandValidator in src/lib/brand-validation.ts (caps 40/12/120, </>, control and bidi characters, the colour grammar, WCAG contrast). Save is disabled while any field fails; server violations are shown on the field they name, and server warnings after an accepted save. A per-pair contrast badge updates as you type.

  • Preview uses the brand's tokens on the preview container: brand-css.ts builds the same declarations BrandDelivery.stylesheet writes, and index.css gains .brand-preview-light / .brand-preview-dark, which restate each mode's surfaces and the EDDI defaults (token-definition lines, so the no-amber guard allows them). So the light panel is light on a dark page, and a cleared colour previews as the default instead of the brand still in effect.

  • Concurrency. The PUT carries the revision the form was based on. A 409 with currentRevision shows a conflict notice and disables Save until Reload latest rebases the form. An image upload or removal moves the base revision without touching the text fields, so unsaved edits survive it and the next save does not conflict with the admin's own upload.

  • Live update (src/lib/brand-live.ts): after every successful write, swap the shell's brand.css and favicon <link>s to ?r=<revision> in place, inject a fresh <script src="/branding/__brand__.js?r=…"> (no eval, CSP unchanged), and setBrand(window.__EDDI_BRAND__) on load. A failed reload leaves the brand in effect and shows a "reload the page" toast; the write itself is not failed.

  • API and hooks. src/lib/api/branding.ts (typed BrandingView, BrandUpdate, brandingErrorInfo), src/hooks/use-branding.ts (query plus four mutations with meta.silent, since the page renders every refusal in place). ApiClientError gains an optional parsed body, and ApiClient passes Blob/ArrayBuffer bodies through unchanged, so the upload keeps the token-refresh path instead of a raw fetch.

  • Roles. /manage/branding is eddi-admin in lib/roles.ts, so the sidebar and command palette hide it from everyone else (the page explains a 403 too).

  • MSW. src/test/mocks/branding-handlers.ts is a stateful stand-in for the admin API (revision checks, validation, magic-byte type check, unsafe-SVG 400, 413, 415, locked 409) and, in the browser worker, answers __brand__.js, brand.css and uploaded images from the mock's state so the live update can be seen without a backend. Variants: sessionStorage["eddi-mock-branding-locked"]="true", and the tagline trigger a conflict. resetBrandingMockState runs after every test.

  • i18n. 88 branding.* keys plus nav.branding, translated in all 11 locales; the subtitle uses {{productName}}.

  • Fix found on the way: route-integrity.test.ts was red since Phase 3, because the Updates route was declared as path={UPDATES_PATH} and the test reads the route table as text. The route is literal again; brand.test.ts pins UPDATES_PATH to it.

Design decisions

  • The route is /manage/branding in the Admin section, not a new Settings section: the Manager has no settings area, and the Admin section is where the other deployment-wide admin screens are. The page title says "Branding". The plan's "Settings → Branding" wording is for Phase 6 to align (the operator prompt names the page).

  • Hidden, not just refused, for non-admins. The neighbouring admin entries are role-gated the same way through SCREEN_ROLES; this page has nothing to show a non-admin.

  • Images apply on upload, text on Save. An image is one atomic request with its own errors; holding it until Save would mean staging binary data in the form. The page says so.

  • Mock delivery, not a second dev plugin. The dev plugin keeps answering the defaults on load (as Phase 1 decided); the mock answers only what it owns. Its /branding/* handler had to be anchored at the origin: the leading-wildcard mask */branding/* also matched /administration/branding/assets/… and sent uploads past MSW to the absent backend. browser-handlers.test.ts pins it.

Verified

npm run typecheck, npm run lint (full), npm run i18n:check (6,155 keys), and Vitest over src/__tests__ (both guards, route integrity), src/i18n/__tests__, src/test/mocks/__tests__ (OpenAPI contract, unhandled recorder, browser handlers), the layout, roles and route-registry tests, and the new pages/__tests__/branding.test.tsx (15 tests: load, client validation, contrast, preview tokens, save + live update through a real applyBrandRevision run, server violations, server warnings, the 409 → Reload latest flow, reset confirmation, locked mode, upload/remove, 400/415/413/409 image errors), lib/__tests__/brand-{css,validation,live}.test.ts and lib/api/__tests__/branding.test.ts. Mutation checks: dropping the live-update call, the base-revision rebase after an upload, the text-wordmark branch, and the origin anchor of the mock's /branding/* handler each fail a test. Backend: formatter:format, then Brand*Test,Branding*Test,BrandedShell*Test,ImportStyleTest,BuildQualityGatesTest,ChangelogFragmentTest,Documentation*Test — 225 tests, green. The full Vitest suite: 8,955 of 8,957 passed; the two failures were badges.test.tsx still expecting warn for the rules/behavior badge after the ochre split, fixed in a separate commit. In MSW mock mode in Chrome: name, colours and an SVG logo saved and uploaded; the sidebar logo, the title, the mock banner and every brand colour changed live in light and dark; the conflict notice and the locked view shown. Against a real backend (full ./mvnw package, the jar on MongoDB 7): save, logo upload, the unsafe-SVG refusal and a 409 after a concurrent curl PUT all behaved as in mock mode, and __brand__.js carried the new assets flags. Locked mode was not run against a real backend.

What's next

Phase 5 (Chat UI) can read the new assets flags the same way (chat.logo when a logo is uploaded). Phase 6: tell the Platform Operator where the page is (the screen-context table in use-current-screen-context.ts has no branding entry yet, on purpose), and offer the Keycloak theme download on this page. Phase 7's brand-leak E2E can drive this page, or the REST API, to set its test brand.


🎨 feat(chat): deployment brand for title, logo, accent and head — white-label phase 5 (2026-10-25)

Repo: EDDI (feat/white-label-6-chat-operator-surfaces)

What changed and why

Phase 5 of the white-labeling plan: the Chat UI widget follows the deployment brand. docs/white-labeling.md has a new "The Chat UI" section, and the Chat UI README and embedding guide say what overrides what.

  • ui/chat/src/api/brand.ts reads window.__EDDI_BRAND__ field by field, with DEFAULT_BRAND equal to the Vite plugin's DEFAULT_BRAND_SCRIPT (brand.test.ts pins it; BrandDeliveryTest already pins the plugin against the backend). It derives the header title (brandTitle), the logo (brandLogoUrl: /branding/logo?r=<revision> when a logo is uploaded, null meaning "show the name as text" when branded without one, EDDI's logo otherwise), the tab title (brandDocumentTitle) and the brand's config layer.

  • Precedence, highest first: URL parameters, the embedder's <ChatProvider config>, the agent's own appearance (agentAppearanceLayer(), a named seam that answers nothing yet), the brand, the built-in defaults. ChatProvider builds its initial config from those layers once, at mount; ChatWidget dispatches the URL's config over it as before.

  • Header. The title nobody overrode is the product name; an explicit ?title= still replaces the agent name. A brand without a logo shows its name as a text wordmark (chat-header__title--wordmark). Alt text is the title. The tab title is <agent> — <product> when branded and exactly <agent> — EDDI Chat / EDDI Chat when not.

  • Accent, and the old gap. ChatConfig.accentColor was stored but never applied. It now goes through applyAccentColor, the same function ?accentColor= uses (accent, user bubble, focus ring, the color-mix tints). One effect applies config.accentColor and then the URL's colour parameters, so ?accentColor= beats the embedder and the brand, and ?userBg= still beats the bubble colour an accent derives. defaultConfig no longer carries accentColor: "#113B92" or the logo URL: unset means "the stylesheet's tokens" and "the brand's logo", so setting either is always an override and an unbranded widget paints exactly as before.

  • Demo route. ChatRoute wraps the /chat/:environment/:agentId[/:userId] routes; under a brand /chat/demo/showcase shows a neutral "The demo is not available on this site." (demo.unavailable, all four locales) instead of EDDI's showcase script, and makes no request.

  • Head. chat.html already had the placeholders, /branding/favicon.ico and /branding/og-image from Phase 1. The dev entry index.html now has the same brand wiring (placeholders, brand.css, __brand__.js), the plugin knows its defaults, and vite-plugin-brand.test.ts grades both shells. vite-proxy.test.ts exempts /branding, which the dev plugin serves itself.

  • Guard. src/no-eddi-brand-literal.test.ts fails on \bEDDI\b in a locale value, a string literal or JSX text outside an exact allow-list (the unbranded defaults and one integrator console warning) and demo-api.ts. It caught the old tab-title template when mutated back in.

Design decisions

  • The accent is applied in JS, not only by brand.css. brand.css sets --chat-accent alone, so the user bubbles, focus ring and quick replies stayed EDDI blue. The JS path sets the full set the URL parameter sets, as inline styles that beat both stylesheets. Both read the same resolved value (chat accent, else primary), so they never disagree; brand.css stays for the first paint.

  • The demo route is refused in the client, not with a backend 404. The Chat shell is one SPA page; a 404 would need a route-aware resource for one path. The neutral state shows nothing of EDDI either way.

  • The "Chat" suffix was not made translatable. Branded titles no longer carry it, and the unbranded title stays byte-identical.

Verified

In ui/chat on Node 24: npm run typecheck, npm run lint and the full npm test — 32 files, 531 tests, green. New: brand.test.ts (defaults = plugin script, normalisation, title/logo/tab-title/config layer), ChatWidget.brand.test.tsx (12 tests: unbranded unchanged, branded logo and alt, text wordmark, tab title, ?title= and logoUrl still override, brand accent, ?accentColor= beats the brand, config.accentColor beats the brand and an unsafe one is ignored, ?userBg= beats the derived bubble colour, demo route branded and unbranded) and the guard. Mutation checks: the old ChatHeader fails the guard and two header tests; dropping applyAccentColor(config.accentColor) fails three accent tests; disabling the demo guard fails the demo test. Backend: BrandDeliveryTest,BrandedShellRendererTest,RestHtmlChatResourceTest,ChangelogFragmentTest,Documentation*Test,BuildQualityGatesTest,ImportStyleTest — 93 tests, green. Against a real backend (full ./mvnw package, the jar on MongoDB 7, an agent with no workflows deployed): unbranded, the demo and a chat look as before (EDDI logo, EDDI Chat, no inline accent); with a name and teal colours, the header shows "Zebra Labs" as text, the user bubble and focus ring are teal, the tab title is the product name and the demo shows the notice; after an SVG logo upload the header shows /branding/logo?r=2 with alt "Zebra Labs", and the head carries the brand's description, theme-color, favicon and og:image; ?accentColor=%23cc3366&title=Support%20Desk turns the bubble pink and titles the tab "Support Desk" under the brand; after a reset everything is EDDI again.

What's next

Phase 6 (Platform Operator, Keycloak theme download) and Phase 7 (brand-leak E2E). The per-agent appearance seam (agentAppearanceLayer) needs its own design pass (§4.6). Noticed, not changed: chat.html lacks the viewport-fit=cover, interactive-widget=resizes-content viewport the dev index.html got in #1075, so production phones do not get that fix.


🎨 feat(branding): operator persona, API surfaces, Keycloak theme download and Helm values — white-label phase 6 (2026-10-25)

Repo: EDDI (feat/white-label-6-chat-operator-surfaces)

What changed and why

Phase 6 of the white-labeling plan (§4.7–4.9, R6, R7, R9). docs/white-labeling.md gains "The Platform Operator", "API surfaces", "The Keycloak login page" and "Helm"; docs/kubernetes.md and the configuration reference point at them.

  • Platform Operator (ui/manager/src/lib/operator/system-prompt.ts, revision 38). The preamble now opens "You are the Platform Operator" and carries the one sentence that still names the engine ("built on the EDDI engine; its documentation and eddi.* configuration properties use that name"); every other mention says "this deployment", "the platform" or "the engine". The default body is brand-independent, so a rebrand never flips an untouched body to "customized", and the revision fingerprint hashes the preamble with the EDDI default name. The body tells the operator that Admin → Branding exists, what it controls, that it has no tool for it and that its own name changes on Upgrade; the docs map gains "white-labeling". Braces are dropped from the name in the prompt (it is a Qute template server-side and the validator allows {}). New operators are named operatorAgentName() = <product> Platform Operator. The branding endpoints stay off the allow-list; tool-scopes.ts documents the exclusion and a test keeps any /branding path out of both scopes. use-current-screen-context.ts gains /manage/branding → branding. The operator's user-facing errors say "this deployment" / "the server" instead of EDDI.

  • Identification audit. Activation, supersede, upgrade, trust (useOperatorTrust) and discovery read the [eddi-platform-operator] descriptor marker or the configured agent id; the only name read is discovery's fallback for pre-marker operators (/operator/i), which every built name satisfies. A new test proves a marked operator named "Acme Assist Helper" is still recognised; requiring a name match fails it.

  • Guard. no-eddi-brand-literal.test.ts loses its Phase-6 exclusions and now also grades new Error("…") messages.

  • Manager, other. The A2A card preview on the agent page uses the product name. The two generated LLM-parameter notes say "the server" (model-parameters.json, regenerated into llm-parameter-catalog.data.ts and docs/llm-parameters.md). On the Branding page an empty colour's swatch shows what it falls back to — dark → light, chat accent → primary, otherwise the unbranded default (UNBRANDED_COLORS, pinned to index.css and the chat's variables.css) — instead of black.

  • A2A (AgentCardService): provider, fallback name and description, default skill and token description use the product name, read per card; an unreadable brand serves the card under EDDI.

  • OpenAPI (BrandedOpenApiRoute): under a brand info.title is <product> API and the LABS.AI contact is dropped; unbranded the request falls through to SmallRye's cached document untouched. A first attempt as a RUNTIME_PER_REQUEST OASFilter passed its unit tests and did nothing at runtime: SmallRye's OpenApiDocument.initialize runs filterModel and then ConfigUtil.applyConfig, so the info-* properties overwrite whatever a filter set. Found only against the real jar.

  • Swagger UI (BrandedSwaggerUiRoute + SwaggerUiBranding, R6 spike → implemented). Swagger UI requests index.html, logo.png, favicon.ico and style.css relative to /q/swagger-ui/; Quarkus serves them from generated web-jar resources (META-INF/io.smallrye_smallrye-open-api-ui__jar/META-INF/resources/openapi-ui/). A Vert.x route at the shell route's order answers those four while a brand is set: title and alt from the product, no footer, the brand's logo (or its name as text), its favicon/icon, and the stylesheet with amber accents swapped per mode (the PUT method colour stays). Unbranded, and under quarkus:dev where the files are not on the classpath, it falls through.

  • MCP (BrandedMcpServerInfo implements InitialResponseInfo): serverInfo.name/title are the product name under a brand, asked per initialize; an explicit quarkus.mcp.server.server-info.name wins.

  • Keycloak theme ZIP (KeycloakThemeExport, GET /administration/branding/keycloak-theme.zip, eddi-admin). pom.xml copies keycloak/themes/eddi to keycloak-theme/eddi on the classpath (outside META-INF/resources). The ZIP is the theme renamed brand: the shipped files byte for byte, theme.properties loading css/brand-overrides.css last, the generated overrides (the --eddi-* palette per mode plus both PF5 tiers, F18; warnings stay amber; text heading when there is no logo), the brand's logo / dark logo / ICO-or-PNG favicon, and a README with loginTheme, displayName and HTML-escaped displayNameHtml as JSON. Fixed file list (a test pins it to the directory), fixed entry times, colours re-validated on output, the name only in the README. Branding page: "Download login theme" (all 11 locales), MSW handler, openapi-operations.json.

  • Helm (chart 2.13.0, EXPECTED_CHART_VERSION): eddi.branding.* values (names, colours, poweredBy/showUpdateCheck, locked, assets.configMap + mountPath) render EDDI_BRANDING_* only when set and mount the ConfigMap read-only as assets-dir. Off by default. HelmBrandingValuesTest pins the mapping.

Design decisions

  • Neutral wording over i18n for the operator's errors. They are thrown Error messages shown verbatim; "this deployment" / "the server" removes the leak without a second translation path for one screen.

  • The operator's persona lives in the non-editable preamble. The body stays brand-free, so "is the body the default?" keeps working across a rebrand, and the persona is rebuilt on every Upgrade/Reconfigure.

  • OpenAPI as a response rewrite, not a filter or a property change. Moving the title and contact from properties to @OpenAPIDefinition was tried so a filter would win; Quarkus then defaults the title to quarkus.application.name + " API" ("eddi API") and dropped the annotation contact, changing the unbranded document. The route keeps the unbranded document byte-identical and cached, and costs one parse and serialisation per /openapi fetch only while branded.

  • Swagger's page is derived from the generated file rather than re-implemented, so a Quarkus upgrade that changes the page keeps working (the rewrites are regex replacements that leave a non-matching page as it was).

  • The Keycloak favicon is replaced only by an ICO or PNG, because Keycloak links favicon.ico by name; an SVG icon keeps the shipped one and the README says so.

  • No Keycloak theme mount in the Helm chart. Its in-cluster Keycloak mounts no themes today; documented instead of adding a second ConfigMap layout. install.sh / docker-compose.auth.yml are documented, not changed.

  • Outbound User-Agent and logs keep EDDI, as decided.

Verified

  • Manager (Node 24): npm run typecheck, npm run lint, npm run i18n:check green; the full Vitest suite 624 files / 8973 tests green. Mutation checks: requiring a name match next to the marker in operator-discovery.ts fails the new discovery test; putting "EDDI" back into an operator error fails the brand guard.

  • Backend: the full ./mvnw test ran 29,948 tests with 42 failures and 134 errors, all of them Unable to establish loopback connection / failed to create a child event loop in the HTTP-client, LLM-builder, A2A-client and MCP-client tests (the known long-session environment fault), none in a branding, A2A-card, Swagger, Helm or guard class. The repo-wide guards (ImportStyleTest, BuildQualityGatesTest, Documentation*Test, ChangelogFragmentTest, DocumentedRestPathsTest, HttpMetricsUriTagsConfigTest, SkillToolReferencesTest) and the new and changed classes pass on their own. Mutation checks: writing an unvalidated colour fails KeycloakThemeExportTest; dropping the comment strip fails SwaggerUiBrandingTest.

  • Helm: helm lint and helm template (alpine/helm 3.16.3) render the default with no EDDI_BRANDING_* and no branding volume, and a branded values set with the env vars and the read-only mount.

  • Real jar (full ./mvnw package, MongoDB 7). Unbranded: /openapi equals the Phase-5 jar's document except the new path, and /q/swagger-ui/, style.css and logo.png are byte-identical. With "Zebra Labs", teal colours, an SVG logo and a PNG favicon: /openapi, /openapi.json, ?format=JSON and /openapi.yaml say "Zebra Labs API" with no contact; Swagger UI shows the title, the logo, no footer, the favicon and teal accents (PUT stays amber); MCP initialize answers serverInfo "Zebra Labs"; an A2A-enabled agent's card names Zebra Labs as provider, name, description and skill; the theme ZIP holds the 10 shipped files, the overrides, the logo, the PNG favicon and the README. Keycloak 26.8.0 with the ZIP mounted and a realm using loginTheme: brand shows the Zebra logo, teal button, focus ring and bloom, in dark and light.

  • Found, not changed: on Keycloak 26.8 the card header gets a 4 px blue top border from keycloak.v2's new --keycloak-card-top-color, which eddi-login.css (written against 26.0) does not set. Nothing in the shipped theme sets it either, so the unbranded theme is affected the same way (read from the stylesheets, not screenshotted); it belongs to a theme fix, not the brand.

What's next

Phase 7: the brand-leak E2E. Notes for it: Swagger UI is branded only in a packaged build; the operator's name changes only after Upgrade, so an E2E that rebrands an existing operator should expect the old name until then; A2A discovery lags a rebrand by up to ~60 s (brand + roster caches); the Keycloak login page is branded only once the downloaded theme is installed.


feat(alerts): masked webhook URLs, protected system schedule, OUTPUT_MATCH rules and e2e specs (2026-10-25)

Repo: EDDI (feat/conversation-ratings) — review fixes to PR 5a and PR 5b of planning/conversation-rating-plan.md (§0.2)

What changed and why

Webhook URLs are treated as secrets. A webhook URL often carries its own token, so no read returns it any more, for administrators either: REST (list, single read, create/update responses), MCP and the operator see https://host/*** plus urlConfigured: true (DeliveryTarget.masked(), applied in AlertAccess.redact). On update an omitted or masked URL keeps the stored one (RestAlertRules.restoreUrls, matched by position and host, else the only stored webhook on that host); a new value replaces it; a masked URL in a create is refused. A ${vault:…} reference is accepted as the URL itself and resolved only at send time (AlertSenders); unresolvable, or not http(s), means no delivery — the rule the signing secret already followed. "Send test alert" for a saved rule restores the stored URL server-side and requires write access to that rule. The Manager editor shows the masked URL with a "kept unless you replace it" hint.

The alerts-maintenance schedule cannot be changed through the schedule surfaces. RestScheduleStore answers 409 {"error":"SYSTEM_SCHEDULE"} to update, delete, enable, disable, retry and dismiss of a schedule carrying the system alertType; MCP delete_schedule refuses with errorCode: SYSTEM_SCHEDULE. Self-healing on startup and rule save stays as the backstop. The Manager's schedule list marks it system-managed with no edit, toggle or delete.

OUTPUT_MATCH (§0.2). A rule can now fire on what a clean turn produced:

  • OutputMatcher — paths properties.<a.b>, output.json.<a.b.c> (the agent's output parsed only when it starts with {/[, at most 64 KB, Jackson nesting capped) and actions; depth ≤ 8, segments [A-Za-z0-9_-], no wildcards or indexes; ops exists|eq|neq|in|gt|gte|lt|lte|contains, comparisons type-strict (numbers by value, a string never equals a number). The value is the author's constant: no expression engine, no template evaluation of runtime data.

  • Save-time validation (AlertRuleValidator → OutputMatcher.problems): path grammar, op/value fit, in list 1–50 scalars, constants ≤ 1000 characters, actions only with contains/exists, and no field of another source.

  • OutputMatchHook runs from ConversationStepRunner for a turn that completed cleanly (not failed, not timed out, not paused for a human). On the turn thread it does one getIfPresent on AlertRuleCache.cachedOutputNeeds; an agent without enabled OUTPUT_MATCH rules stops there. Otherwise it copies only what the rules read — the named top-level properties (detached copies), the output text, the action list — into a TurnSnapshot and hands it to the alert worker; the live memory never leaves the turn. A cache miss loads the needs on the worker and that one turn copies all three.

  • includeValue is honoured only when the agent version has conversation review enabled (ConversationReviewPolicy); the value goes to match.value, cut to 280 characters. Otherwise the alert names path, operator and constant only.

  • Manager: condition builder (output-match-builder.tsx) — path source dropdown, path input with inline validation, value type, operator filtered by type, value, and an includeValue toggle explaining the review requirement; pathProblem/outputMatchProblems in alert-rules.ts mirror the server. 30 keys in all 11 locales; MSW fixture masks its webhook.

  • Operator prompt: masked URLs, the system schedule and OUTPUT_MATCH; revision 38 → 40.

  • Docs: Alerts with the three §0.2 examples, masking, the system schedule.

E2E specs. ui/manager/e2e/alerts.spec.ts (MSW tier: inbox acknowledge, create rule, output-match builder, badge) and e2e/fullstack/ratings-feedback.fullstack.spec.ts (Chat UI rating → Feedback "Needs attention" + badge → mark reviewed → count back). Not run locally — Playwright browsers were not downloaded on purpose; CI runs them.

Design decisions

  • A masked URL is restored by position and host, never by position alone. A reordered target list still gets the right URL back when its host is unique among the stored webhooks; when it is not and the position does not match, nothing is restored and the masked URL is refused at validation rather than guessed.

  • Only top-level property names are copied, even for a nested path: the snapshot copies the property's value detached (AlertJson), so a later change to live memory cannot reach the worker.

  • A cache miss copies everything once instead of loading rules on the turn thread: the turn never waits on the store, and the first turn after a restart is not lost.

Tests

  • Review fixes: RestAlertRulesTest.WebhookUrls (list, single read, create/update response, restore by position and host, masked create refused, test send restores and needs write access), AlertSendersTest (vault URL resolved at send, unresolved → no delivery, labels), RestScheduleStoreExpandedTest and McpAdminToolsBranchCoverageTest (system schedule refused). Mutation check: 9 of 9 mutants killed (redaction, create and update responses, masked(), the label, restoreUrls, unresolved vault URL, the REST and the MCP system-schedule guards).

  • OUTPUT_MATCH: OutputMatcherTest (paths, JSON-only parsing, size and nesting caps, type-strict operators, grammar and op/value validation), OutputMatchHookTest (an agent without rules costs one cache lookup and touches nothing else — verifyNoMoreInteractions on memory and cache, nothing queued; only needed values copied, detached; cache miss copies everything; includeValue needs review; 280-character cut), AlertRuleValidatorTest, ConversationStepRunnerTurnOutcomeTest (only clean turns reach the hook), AlertStoreContract.outputMatchRuleRoundTrips (ITs 28/28, 14 MongoDB + 14 PostgreSQL). Mutation check: 6 of 6 killed — value without review, hook working for agents without rules, wildcard grammar, no truncation, type-mismatched equality, whole property map copied.

  • Manager: alert-rules.test.ts (path grammar, ops per type, problems), alerts.test.tsx (builder, inline path error, actions ops, masked URL hint), schedules-regressions.test.tsx (alerts-maintenance has no edit, toggle or delete); operator tests for revision 40.

  • Live check (dev mode on MongoDB 7 in Docker): an agent with ratingConfig and conversation review rated over REST (conversation + reply), /ratings, /ratings/summary, /ratings/attention-count, PATCH /ratings/{id} (count 2 → 1); a RATING rule with inbox-only delivery produced exactly one event when a 5-star rating was re-rated to 1, and a second low re-rating in the same window counted as duplicates: 1; acknowledged. An OUTPUT_MATCH rule on actions contains handoff_requested fired once over two turns with match.value present (review on). An agent whose LLM points at 127.0.0.1:9 produced one CONVERSATION_ERROR event (TURN_ERROR). A webhook rule read back as https://hooks.example.com/*** everywhere while MongoDB kept the full URL across a PUT that sent the masked value; its delivery stayed PENDING with "signing secret could not be resolved"; DELETE and disable on alerts-maintenance returned 409 SYSTEM_SCHEDULE.

  • Full runs: backend ./mvnw test 29,924 run, 3 failures, 8 skipped. Two failures (PostgresIngestionStateStoreTest.recordedDeadlineGoverns, PostgresSecretPersistenceTest.timestampsRoundTrip) are off by exactly one hour because the run fell in the night the clocks went back (Europe, 2026-10-25); both pass with the JVM in UTC (77/77) and neither class is touched here. The third is the known-flaky DocumentExtractorsTest.honoursItsTimeBudget. Manager vitest: 622 files, 8,961 tests passed; npm run lint, npm run typecheck and npm run i18n:check (6,333 keys) clean.


✨ feat(mail): EDDI verifies DKIM and DMARC alignment itself — email sender authentication (2026-10-25)

Repo: EDDI (feat/email-dkim, on top of feat/email-hitl-notifications and feat/email-mail-core)

The sender-authentication slice of the email plan (§8, the DKIM/DMARC part of §21), built ahead of Phase 2 so the IMAP poller can call it. No channel, transport or poller is part of this change.

The facade Phase 2 calls

  • SenderAuthenticator.authenticate(byte[] raw, InboundMail parsed) (engine/mail, @ApplicationScoped) → MailAuthentication: verdict ALIGNED_PASS · PASS_UNALIGNED · FAIL · NONE, the signing domain, a fixed-text reason (safe to log), a temporary flag (a DNS failure or the lookup budget kept a check from running — retrying later may authenticate), and one DkimResult per evaluated signature (domain, selector, algorithm, PASS · FAIL · TEMPERROR · TESTING, reason). The caller passes the bytes it received and the parser's InboundMail of those bytes (a size mismatch is refused), then attaches the verdict with InboundMail.withAuthentication. Never throws.

  • Only an aligned pass authenticates, and never when the message has anything but exactly one From field with one mailbox (counted on the raw bytes and from the parser's MULTIPLE_FROM/MISSING_FROM) or a duplicated singleton header (DUPLICATE_SINGLETON_HEADER): an unsigned second From or Subject added above a validly signed one is not hashed, so the signature still verifies, while clients show the forged one.

  • MailAuthentication gains reason, temporary and signatures (the two-argument constructor stays).

  • Judged as of delivery: authenticate(raw, parsed, Instant deliveredAt, fallback) evaluates x= and the future-t= check at the delivery instant — the transport passes the mailbox server's INTERNALDATE, the receiving server's own clock, never a sender header — so a short x= does not expire while the mail waits for the poller or the cost budget. The instant is clamped to [now − eddi.email.dkim.max-delivery-age, now] (new property, default 7d): a later value is now, an older one is the cap boundary, so a broken or forged value can neither revive an ancient signature nor postdate one. Without it, signatures are judged at the current time, as before. DkimVerifier.verify(raw, budget, evaluatedAt) takes the instant unclamped.

  • Provider fallback: authenticate(raw, parsed, SignedProviderVerdict), an interface for a verdict delivered under a signature the transport checked (SES over SNS). Consulted only when the local check could not run (no raw bytes, or every key lookup failed temporarily); never over a local fail, none or pass; alignment is still EDDI's. No provider is implemented.

DKIM (DkimVerifier)

  • RFC 6376 on the raw bytes: simple/relaxed header and body canonicalisation in all four combinations, rsa-sha256 (1024–8192-bit keys, exponent ≤ 64 bits; SPKI or bare PKCS#1 p=) and ed25519-sha256 (RFC 8463, the JDK's EdDSA). Refused as FAIL: rsa-sha1 (RFC 8301) and other algorithms, l= (body-extension attack), a signature not covering From, i= outside d=, expired x=, x= before t=, t= in the future (5 min skew), revoked (p= empty) or missing keys, more than one key record, k=/h=/s= that do not admit the signature, t=s with i= ≠ d=, malformed or duplicated tags. A t=y key gives TESTING, not a pass.

  • Bottom-up header-instance selection with over-signing semantics (a name in h= more often than present binds the absence); the signature being verified is never one of its own h= instances. Bare-LF input is converted to CRLF.

  • Bounds: 5 signatures evaluated (rest counted), 256 KB header block, 100 h= names, 8 KB signature field, one body hash per canonicalisation, the body checked before the key is fetched (a tampered mail spends no lookup).

DMARC alignment (DmarcAlignment) and the Public Suffix List

  • RFC 7489 §3.1.1: relaxed (same organisational domain) or strict (equal) per the From domain's _dmarc adkim=, falling back to the organisational domain's record (§6.6.3); no record = relaxed; several v=DMARC1 records = no DMARC; a temporary lookup failure assumes strict and is flagged. p= is not applied. SPF is not evaluated (EDDI never sees the connecting IP).

  • PublicSuffixList: the upstream file bundled unmodified as src/main/resources/mail/public_suffix_list.dat (MPL-2.0, new licenses/MPL-2.0.txt; commit 8437e5262f13, 2026-10-22), ICANN and private sections, wildcard and exception rules, IDN rules in ASCII. public_suffix_list.properties records commit and SHA-256; PublicSuffixListTest fails when the file is missing, small, or differs from that hash. Refresh with the new scripts/update-public-suffix-list.py. The .dat is -text in .gitattributes so its hash is stable.

DNS (MailDnsResolver, DnsjavaTxtSource)

  • dnsjava 3.6.5 (BSD-3-Clause; runtime dependency slf4j-api only, BOM-managed; CVE-2024-25638 and the KeyTrap advisories fixed in 3.6.0 and confined to the DNSSEC validator, which is not used). Its jar registers a java.net.spi.InetAddressResolverProvider that stays inert unless org.dnsjava.spi.enable=true — documented in pom.xml and security.md, with a test that fails if the switch's constant disappears.

  • New properties eddi.email.dns.servers (empty = system resolvers), .timeout (5 s, one retry), .cache-max-entries (10000), .cache-max-ttl (1 h; record TTLs and the SOA minimum for negative answers honoured, temporary failures not cached), .max-lookups-per-message (10; cache hits free). Records over 4096 characters or answers over 10 records are refused; multi-string TXT records are joined. No DNSSEC requirement. The TxtSource seam keeps every test offline.

Metrics, docs

Tests

  • DkimVerifierTest (60): the RFC 8463 Appendix A message and key records stored as fixtures (src/test/resources/mail/dkim/, byte exact) — both signatures pass, also with LF endings; body, header, second-From tampering and re-folding. The RFC 6376 §3.4.6 canonicalisation example, signed over the canonical text the RFC prints. Self-signed RSA-2048 and Ed25519 messages (DkimTestSigner, a regex-based signer written independently of the verifier) in all canonicalisations, with folded headers, trailing whitespace, 8-bit text, empty and header-only bodies; every refusal above; DNS outcomes; bounds.

  • SenderAuthenticatorTest (31): verdicts, DMARC through the facade (subdomain relaxed/strict, org-domain fallback, d=co.uk, DMARC tempfail), header injection (second From, two mailboxes, no From, second Subject, mismatched bytes, and each of the two From guards on its own against a parser that disagrees), judging as of delivery (expired since delivery passes; a delivery instant older than the cap or in the future is clamped), provider fallback, 300 random inputs, and a hostile message (5000 header lines, 50 signatures × 100 h= names, 10 MB body) within a 5 s budget.

  • DmarcAlignmentTest (9), PublicSuffixListTest (24), MailDnsResolverTest (13; three run dnsjava against a loopback UDP server built in the test).

  • Every verdict path was mutation-checked: the check reverted, a test failed, the check restored.

For Phase 2

  • Call authenticate with the transport's bytes right after parsing; keep temporary in mind (leave the message for the next poll rather than treating a DNS outage as an unauthenticated sender).

  • Pass the mailbox server's INTERNALDATE as deliveredAt; without it, x= is judged at processing time.

  • eddi.email.auth carries only result. Prometheus requires one tag set per meter name, so per-integration tags mean moving the counter to the channel layer rather than adding tags here.

  • No real-world signed mail (Gmail, Outlook.com, Exchange Online, a list) is in the corpus yet (§21); add it with its DNS records when a test mailbox is available.


fix(manager): https-only webhook check, bulk-acknowledge mock, operator revision 41 (2026-10-25)

Repo: EDDI (feat/alerts-manager, PR #1139) — the Manager side of the alerts backend review fixes (PR #1138)

What changed and why

  • Rule editor: ruleProblems (alert-rules.ts) accepts only an https:// webhook URL or a ${vault:…} reference, as the server now requires; the masked https://host/*** of a stored URL still passes.

  • MSW: the bulk-acknowledge handler answers 400 INVALID_PARAMETER to an empty ids list or an empty entry, as the server does; the Manager sends {} when it acknowledges by filter and a non-empty list otherwise, so its calls are unchanged.

  • Platform Operator: the prompt says webhooks must be https and corrects "no conversation text" — a rating comment, or an OUTPUT_MATCH value with includeValue and conversation review on, can appear, each at most 280 characters. Revision 40 → 41.

Review follow-ups

  • AlertDeliveryService derives the send claim lease as the longer of 30 s and three times eddi.alerts.webhook-timeout, and AlertSettings keeps that timeout between 1 s and 60 s, so a long timeout can no longer make every send skip.

  • Manager: test-result rows in the rule editor have unique keys; removing a chat rating clears its reasons and comment; the chat hook reads a conversation's own rating controls even when the current profile is null; the feedback list steps back to the last existing page when triage empties the current one.

Tests

npm run typecheck, eslint on the changed files and npm run i18n:check pass; the alert and operator suites (19 files, 530 tests) pass.


fix(manager): second round of alerts review findings — throttle bounds, bulk-acknowledge body, inbox paging (2026-10-25)

Repo: EDDI (feat/alerts-manager, PR #1139)

What changed and why

  • Throttle checked before saving: throttleProblems in alert-rules.ts uses AlertRuleValidator's bounds exactly (whole numbers, 1–1440 minutes, 1–1000 per window); ruleProblems reports throttle, which disables Save and Send test, and the editor marks the field with an inline error (alerts.throttleRange, all 11 locales).

  • Bulk acknowledge body: acknowledgeAlertEvents sends {} only for null/undefined and { ids } otherwise, so an empty list reaches the server, which refuses it, instead of being widened to everything matching. The page's only "all matching" caller passes null.

  • Inbox: keyed on the agent, so changing it starts from page 1 with nothing selected; the page moves back to the last one that exists when acknowledging empties the one it is on (instead of "No open alerts"); the selection clears when the source or the acknowledged filter changes.

  • Schedules: a dead-lettered server-owned schedule (alerts-maintenance) gets no Retry on its row and no Retry/Dismiss in Failed fires — the server answers 409 SYSTEM_SCHEDULE to both.

  • Output-match builder: switching the path source to actions turns the value into text (contains compares strings) and keeps exists without one.

  • Full-stack e2e spec: each resource is recorded as soon as it exists, and cleanup removes every recorded one even when setup failed midway.

Tests

New: output-match-builder.test.tsx (5), lib/api/__tests__/alerts.test.ts (3), throttle cases in alert-rules.test.ts, four page tests in alerts.test.tsx (throttle error, page clamp, selection reset on filters, fresh inbox on agent change) and the server-owned case in schedules-regressions.test.tsx. The alerts, schedules, operator, mocks and i18n suites: 34 files, 770 tests. Mutation check: 10 of 10 mutants killed (throttle not reported, window bound off by one, fractions accepted, empty ids widened, no page clamp, selection kept on either filter, Inbox not keyed on the agent, row Retry and Failed-fires actions for a server-owned schedule). The Playwright spec is typechecked and linted, not run.


fix(manager): carry each webhook target's targetId through the rule editor (2026-10-25)

Repo: EDDI (feat/alerts-manager, PR #1139) — the Manager side of the backend's targetId restore (PR #1138)

What changed and why

  • Types: DeliveryTarget.targetId in lib/api/alerts.ts, documented as the server's id to send back unchanged.

  • Editor (alert-rule-editor.tsx): targets are edited, removed and — new — moved up or down as whole objects, so each keeps its own targetId; rows are keyed by it. A new target has none. Save and Send test send the ids as loaded. Two new strings (alerts.moveTargetUp, alerts.moveTargetDown) in all 11 locales.

  • Validation: ruleProblems accepts a masked URL only together with a targetId, so a masked URL is never sent without one.

  • MSW (alert-handlers.ts) now mirrors the server: it stores full URLs and answers reads masked, assigns ids on create (replacing client ones), restores a masked or empty URL on update and test send only from the stored target with the same targetId, and refuses one without a known id with 400 INVALID_RULE.

  • Platform Operator: the masked-URL paragraph explains targetId and the INVALID_RULE refusal. Revision 41 → 42; it ships as 43, because merging main (where the ratings work had moved the operator to 39) needed a revision above both.

Tests

New page tests (alerts.test.tsx): removing one of two masked same-host webhooks sends the other with its own id, reordering moves ids with their targets, editing a masked target's secret keeps its id, a new target goes without one, a test send of a saved rule sends the ids, and saving the stored webhook rule round-trips through the mock. alert-handlers.test.ts (4) pins the mock's contract; alert-rules.test.ts covers the masked-URL check. npm run typecheck, the full npm run lint and npm run i18n:check (6,336 keys) pass; the alerts page, alert components, src/lib (operator included), src/test/mocks (OpenAPI contract included), schedules and i18n suites: 143 files, 2,518 tests. Mutation check: 5 of 5 killed (edit drops the id, removal re-pairs ids by position, reorder leaves ids behind, masked URL accepted without an id, mock restoring without matching the id).


fix(alerts): review findings on the alerts backend — https-only webhooks, GDPR export, digest healing, bulk acknowledge (2026-10-25)

Repo: EDDI (feat/alerts-backend, PR #1138; Manager follow-ups on feat/alerts-manager, PR #1139)

What changed and why

  • Webhook URLs must be https. AlertRuleValidator refuses a plain http URL at save time; AlertSenders checks again at delivery, which is the only place a ${vault:…} URL is known — one that resolves to http (or to no host) is not delivered to. STRICT SSRF and no redirects are unchanged. Docs: Alerts → Delivery.

  • GDPR export (AlertGdprParticipant.export returned null): it now lists the rules the person created or last edited (id, name, created/updated time, author and/or lastEditor) and the events they acknowledged (id, rule name, source, agent, fired and acknowledged time), at most 10,000 of each, and no other person's identity or event content. New store reads IAlertRuleStore.findByAuthor and IAlertEventStore.findAcknowledgedBy, implemented for MongoDB and PostgreSQL and covered by AlertStoreContract. Docs: Alerts → Privacy, GDPR Compliance.

  • A digest could stay stuck. When the digest's insert hit its dedupe key — another runner sent it, or this one crashed between the insert and marking the held events — the held events stayed DIGEST_PENDING and every pass retried a digest that never inserted. AlertMaintenanceService.sendDigest now marks them on a dedupe hit too, still without delivering.

  • actions exists fired on every clean turn: an empty action list is now absent (OutputMatcher.resolve); contains is unchanged.

  • A cache miss copied the turn even when nothing would run it: when submitting the output-needs loader fails (alerts off, queue full), OutputMatchHook returns before building a snapshot.

  • Bulk acknowledge: a present ids list is the selector. An empty list or an empty entry is a 400 INVALID_PARAMETER instead of falling through to "everything matching the filter"; the filter applies only when ids is left out. The MCP tool acknowledges one event by id and the Manager sends {} when acknowledging by filter, so both stay valid.

  • Wording: OUTPUT_MATCH added to the source tag of eddi_alerts_fired_total (Metrics), to AlertEventQueryParams.source and to list_alert_events' description and source argument. "No conversation text" is corrected wherever it was repeated (REST Javadoc, MCP description, Alerts, MCP Server, the eddi-admin skill): a rating comment and, only with includeValue and conversation review on, an OUTPUT_MATCH value appear, each cut to 280 characters.

Design decisions

  • On a digest dedupe hit every held event is marked, including any held after the existing digest was written. They stay in the inbox but are not listed in a digest message. The alternative, reading the existing digest to mark only what it covered, needs the event ids on the digest, which it does not store.

  • The export re-checks each row against the user id, so a store returning a wider set cannot leak another person's rule or acknowledgement into it.

Tests

448 unit tests across the alert, output-match, REST, MCP, step-runner and GDPR classes pass, among them the new AlertGdprParticipantTest, RestAlertEventsTest.bulkEmptyIdsRefused, AlertMaintenanceServiceTest.digestCrashBetweenInsertAndMark, OutputMatchHookTest.cacheMissLoaderRefused, OutputMatcherTest.emptyActionsAreAbsent and AlertSendersTest.httpsOnly. Store ITs: 32/32 (16 MongoDB + 16 PostgreSQL, with the two new contract cases). The doc and style guards pass. Mutation check: 9 of 9 mutants killed — http accepted at save, an http vault URL delivered to, an empty export, another person's acknowledgement exported, the lastEditor role lost, a dedupe hit leaving events pending, a refused loader submit still snapshotting, an empty ids list falling back to the filter, a blank id entry accepted.


fix(alerts): erasable output values, queued rating alerts, exact digest recovery, targetId-based URL restore (2026-10-25)

Repo: EDDI (feat/alerts-backend, PR #1138) — the second round of review findings

What changed and why

  • OUTPUT_MATCH values can be erased. An event that stores a matched value (only with includeValue and conversation review on) also records the conversation owner in an internal field, AlertEvent.subjectUserId. It is @JsonIgnored, written by both stores and never read back, so no REST row, MCP answer, operator answer, Slack message or webhook payload can carry it (asserted on the serialized row and on both payloads). Events without a stored value never get it. AlertGdprParticipant.erase blanks the value and the field (IAlertEventStore.redactOutputValues, partial index on both stores); the owner's export lists those values (value, conversation, time) under outputMatchValues — their own conversation content, as the ratings export lists their ratings.

  • A rating alert queued across an erasure. AlertEngine.evaluateRating re-reads the rating first and skips it when it is gone or its updatedAt changed (the newer save has its own alert). After the event is written it re-reads again; if the rating was erased in between, the event's excerpt is blanked (redactRatingComment) before anything is delivered. No per-user lock.

  • Digest recovery marks exactly what the digest covers. The digest records the held event ids it covers (digestEventIds, internal, at most the 500-event batch); on a dedupe hit the maintenance pass reads that digest (findByDedupeKey) and marks only those ids, so events held later stay DIGEST_PENDING for the next digest.

  • Webhook URLs are restored by targetId, never by position or host. Every delivery target gets a server-assigned targetId, kept across updates and returned by every read. An update or test send that sends a masked or empty URL keeps the stored URL of the target with the same targetId only; a masked or empty URL without a known id is a 400 INVALID_RULE; a new target must bring a real URL; ids the stored rule does not have (and all ids on a create) are replaced. Removing or reordering two masked targets on one host no longer hands one target the other's URL.

  • Alerts → Privacy now says what is stored: the acknowledger's id (shown in the inbox, never sent out) and the internal subject id of a stored output value, both until erasure or retention.

Design decisions

  • Rules saved before ids existed need no migration. A target without an id gets t + its existing hashed key() on every read — the same id each time — so the first update of such a rule matches the ids the client read, and that save stores them. Both stores already persist targets as JSON, so targetId is stored without a schema change.

  • The subject id is write-only. Erasure and the export query by it in the store; no read maps it back into an event, which is a stronger guarantee than hiding it at each serializer.

  • A digest written before covered ids existed would match nothing on a dedupe hit. Alerts have not shipped, so no such digest exists outside development databases.

Tests

477 unit tests across the alert, output-match, REST, MCP, step-runner, GDPR and rating classes pass, including the new AlertPrivacyRaceTest (both race orderings, the subject recorded only with a value, never serialized or sent) and the targetId cases in RestAlertRulesTest (remove one of two same-host targets, reorder, new target, unknown id refused, client ids replaced, legacy rule). Store ITs: alert stores 20/20 on MongoDB and on PostgreSQL (new contract cases: erasable subject, covered ids and findByDedupeKey, one-event excerpt redaction, persisted targetId), rating stores 15/15 on each. Mutation check: 9 of 9 for the erasure, race and digest changes, 5 of 5 for the targetId match.


fix(alerts): erasure fence for queued alert work, deliveries send the stored event (2026-10-25)

Repo: EDDI (feat/alerts-backend, PR #1138) — two more review findings

What changed and why

  • A queued OUTPUT_MATCH value could land after an erasure. AlertErasureFence is a UserErasureParticipant: the erasure's step 0 (stopInFlightWork, and stopInFlightWorkByHash on every other node through the existing cluster gdpr-stop broadcast, as ConversationService and AuditLedgerService receive it) records the time the erasure started, per user, keyed by the user id's hash. TurnSnapshot now carries its capture time. AlertEngine.evaluateOutput stores no value (and no subject) when the snapshot was captured before a live fence — the alert still fires — and after the insert re-checks the fence and blanks value and subject (redactOutputValues) before delivery when the fence went up meanwhile. Queued rating alerts use the same fence on top of the re-read: a fenced rating is not evaluated, and an excerpt written while the fence went up is blanked. Fences last 15 minutes (AlertErasureFence.FENCE_TTL).

  • A hand-made schedule could pass for alerts-maintenance. The schedule API refused only bodies carrying the alert marker, so a plain schedule named alerts-maintenance could be created, and AlertMaintenanceSchedule.ensure — which looked the schedule up by name — then took it for the installed one, leaving retries, digests and retention unprocessed. The API now also refuses the reserved name (trimmed, case-insensitive) on create and on a rename (AlertSchedules.isReservedName), and ensure counts only a row carrying the maintenance marker; a same-named row without it (possible on a deployment from before the name was reserved) triggers a bounded scan for the marked row, and the real schedule is created when none exists. AlertMaintenanceScheduleTest and a new RestScheduleStoreExpandedTest case cover it; the docs now say a rating alert captured before an erasure is dropped altogether, while an OUTPUT_MATCH alert fires without its value.

  • Delivery could send a copy older than the store. AlertDeliveryService.deliver skips an event that no longer exists and reads the event again right before each send, sending the stored (possibly redacted) version — first delivery and every retry, on any node. No cross-node lock: the remaining window is between that read and the send, and a send already on its way cannot be recalled (said in the code and in Alerts → Privacy).

Design decisions

  • A dedicated fence bean, not the dispatcher or the engine: it has one job, both the engine and the cluster handler reach it through CDI, and it keeps the engine free of erasure bookkeeping.

  • The fence only holds back content captured before the erasure started, so expiry is a matter of memory, not correctness: a later conversation of a reused id is never blocked, and 15 minutes is far longer than the alert queue takes to drain.

Tests

486 unit tests across the alert, output-match, REST, MCP, step-runner, GDPR, rating and cluster-handler classes pass, including the fence cases in AlertPrivacyRaceTest (captured before the fence stores no value, fence up between check and insert blanks before delivery, captured after keeps the value, expiry, set by hash, fenced rating not evaluated) and AlertDeliveryServiceTest (first delivery and a retry send the redacted stored version, a deleted event is not sent). Mutation check: 7 of 7 killed.


🐛 fix(email): HITL email notification review findings (2026-10-25)

Repo: EDDI (feat/email-hitl-notifications)

Eight review findings on the HITL email notifications (docs/hitl.md, section "Email notifications").

What changed and why

  • GDPR erasure keeps the user directory entry when an earlier participant failed (GdprComplianceService). The email ledger finds a person's rows by the address in the user directory, which is why the directory participant runs LAST. The loop did not link the two: with the ledger step failing, the directory entry was still erased, so the re-run the result asks for could no longer find those rows and they stayed until ledger retention. A LAST participant is now skipped, and reported as failed, when an earlier participant failed (the same reasoning as step 4c, which keeps the snapshots for the retry).

  • A pause on the conversation-start turn is announced only after the descriptor is written (ConversationService.startConversation). A failed descriptor write discards the conversation again, and the asynchronous notifier could already have mailed about it. The say and resume sites already fire after the conversation is final.

  • eddi.mail.smtp.connection must match the connection-name grammar (SystemMailer.parse). A name no stored connection can carry ("my mail") used to leave the mailer reported as enabled with every send failing; it now disables the mailer at startup with the reason.

  • The email ledger caps providerId (255) and lastError (512) on every write, in both stores (IEmailMessageLedger.cap, Mongo and PostgreSQL). Those are the PostgreSQL column widths; an uncapped render error made PostgreSQL refuse the update, which left the row claimed until its lease ran out and retried it after every lease. The cap never splits a surrogate pair.

  • A timeout past the end of the time-line no longer aborts the notification (HitlNotificationContent). A positive duration such as P1000000000000D passes config validation but overflows Instant; the deadline line now names the duration instead of a date. HitlEmailNotifier.attempt also treats any runtime failure while building the mail as a terminal FAILED row, instead of letting it escape and leave the row PENDING.

  • Manager: Save is refused while the recipients box is invalid (HitlConfigSection reports it through onValidityChange, agent-detail.tsx refuses every save path, as it does for the spend limit). An invalid list never enters the draft, so an earlier valid edit was saved while the field showed something else. The recipients label is now associated with its textarea, and the hint no longer says the mail carries no conversation content: a tool-call pause lists the pending tools with redacted, shortened arguments (all 11 locales, plus the new agentDetail.hitlNotifyFixBeforeSave message).

The operator system prompt already described the content correctly (it names the redacted tool arguments), so it is unchanged.


feat(alerts): alert rules framework — ratings and failed turns to inbox, Slack and signed webhooks (2026-10-24)

Repo: EDDI (feat/conversation-ratings) — PR 5a of planning/conversation-rating-plan.md (§0.2, §11)

What changed and why

People running an agent can now be told when something needs them: a low rating or a comment, or a turn that failed, was interrupted, ran past its deadline or was stopped by a cost limit. One mechanism with sources, evaluated outside the pipeline — see Alerts, whose top section is the design note.

  • Model and stores — AlertRule and AlertEvent (engine/alerts), MongoDB (alertrules, alertevents, alertwindows with a TTL index) and PostgreSQL (alert_rules, alert_events, alert_windows) twins selected in DataStoreProducers. OUTPUT_MATCH is not accepted yet; its fields slot into AlertCondition and a constant into AlertSource.

  • REST — /alerts/rules (CRUD + POST /alerts/rules/test) and /alerts/events (list, unacknowledged count, read, acknowledge one / bulk, retry), save-time validation (AlertRuleValidator, every problem named), coded errors (AlertErrors).

  • Hooks — ratings: a CDI event after the rating is stored (ConversationRatingSaved). Turns: ConversationStepRunner.waitForExecutionFinishOrTimeout, the one method the say path and the HITL resume path both wait in, now classifies the outcome from in-memory data (ERROR, cancelled / EXECUTION_INTERRUPTED, watchdog timeout, an llm:spend_refused:* record) and fires TurnOutcome only for a bad one. AlertDispatcher observes both and only enqueues onto one worker with a bounded queue; a full queue drops with eddi.alerts.dropped and a rate-limited WARN.

  • Cluster-safe spam control — the dedupe is a unique index over ruleId|agentId|conversationId|windowStart; the per-rule cap an atomic window counter ($inc upsert / INSERT … ON CONFLICT DO UPDATE RETURNING); delivery updates and claims are conditional on a version (Postgres claims with FOR UPDATE SKIP LOCKED); digests mark only events still DIGEST_PENDING and carry a dedupe key of their own.

  • Delivery — Slack through the channel integration that serves the channel (ChannelTargetRouter bot token + SlackWebApiClient), mrkdwn-escaped; webhooks through OutboundHttp (STRICT SSRF, no redirects, timeout, 64 KB body cap, 16 KB answer read) signed X-Eddi-Signature: t=…,v1=… with HmacSignatures — the scheme EDDI's own inbound webhook channel verifies; the signing secret must be a ${vault:…} reference and an unresolved one stops the delivery. The inbox always.

  • Retries, digests, retention — one alerts-maintenance system schedule (HEARTBEAT, 60 s) routed by a metadata fast-path in ScheduleFireExecutor to AlertMaintenanceService, so it runs under the poller's cluster-wide claim and lease. Backoff 30 s × 4ⁿ⁻¹, 5 attempts. An idle pass writes no fire log. User-created schedules claiming alertType are refused.

  • Privacy — no user id and no conversation text anywhere an alert goes; the payload is built field by field (AlertPayloads); the rating comment is cut to 280 characters, and GDPR erasure blanks it (ConversationRatingGdprParticipant redacts before deleting the ratings) and forgets acknowledgers and rule authors (AlertGdprParticipant).

  • Manager — Alerts page (pages/alerts.tsx, /manage/alerts, admin + editor): inbox with source / acknowledged filters, per-target delivery status, Retry, acknowledge one / selected / everything here; rules list and editor (source picker, scope, condition, Slack and webhook targets, "Send test alert", throttle and digest, delete with confirmation). Sidebar badge of unacknowledged alerts, administrators only, polled every 30 s. 99 alert keys plus nav.alerts in all 11 locales; MSW handlers (alert-handlers.ts); openapi-operations.json regenerated.

  • MCP — list_alert_events, acknowledge_alert_event (McpAlertTools, AUTHOR tier, in-process bean); McpRatingTools' coded-error mapping moved to McpToolUtils.codedFailure and shared. 95 tools.

  • Operator — reads GET /alerts/events, /alerts/events/unacknowledged-count, /alerts/rules, /alerts/rules/{ruleId}; prompt section on rules, states, retries and scoping; revision 37 → 38.

  • Docs — Alerts (new, in SUMMARY.md), Metrics, a Grafana alert-rule example in the Monitoring Guide, an Alerts row in the full metrics dashboard (synced to k8s/overlays/monitoring), the eddi.alerts.* properties in the Configuration Reference, MCP Server, the eddi-admin skill.

Design decisions

  • The turn hook sits in the wait, not at error sites. waitForExecutionFinishOrTimeout is where ERROR, interruption and the watchdog's deadline converge for both turn paths, and BaseRuntime runs the turn's callbacks before Future.get returns. A mid-loop cost-ceiling stop is not visible there (the loop ends with an answer); the next turn's refusal is.

  • One maintenance schedule, not one per event or rule. Fewer rows in the schedule list, one claim per minute; every step it takes is a conditional write, so a duplicated schedule (two nodes creating it at once) is harmless.

  • Editors: one agent, Slack and inbox only. A rule over several agents and a webhook target (arbitrary URL, signed with a vault secret) are an administrator's. An editor sees a webhook by host only. Access is re-checked against the stored rule on update and delete.

  • Fixed, epoch-aligned windows for dedupe and cap — exact across replicas through unique keys and atomic counters, at the price of a boundary where two windows meet.

  • The rule author, the acknowledger and the reviewer come from the caller, never the body; MCP and the operator use the same in-process resources.

  • Operator: reads only. Acknowledging is a person's statement; retry and test send real messages; rule writes decide where alert content goes. A rule read shows a webhook URL to the operator (it runs as the admin); the prompt says not to repeat it.

Tests

Backend unit: 129 in the alert, step-runner, GDPR and MCP classes run together, plus ScheduleFireExecutorTest and RestScheduleStoreExpandedTest (648 with the related service suites); "never blocks" is proven twice — AlertDispatcherTest (10,000 hand-offs to a stuck worker in under a second) and ConversationStepRunnerTurnOutcomeTest (2,000 failing turns through the real hook). ITs: MongoAlertStoresIT and PostgresAlertStoresIT share AlertStoreContract (13 each, incl. a 40-thread window-counter race, the unique dedupe, version-conditional updates and single claims). Mutation check: 22 of 22 mutants killed by a test failure — every editor scoping guard (agentId required, single-agent scope, no webhooks, the EDIT check, agent-less events, webhook redaction, the stored-rule re-check on update and delete, editor rule listing, per-id bulk acknowledgement, single acknowledgement), the author from the caller, the privacy guards (comment truncation, no comment in the summary, Slack escaping, GDPR redaction), the hook never throwing into the turn, deadline classification, a full queue never throwing, and the webhook's strict SSRF, no redirects and unresolved-secret refusal. Manager: 18 new tests (page, editor, badge, ruleProblems). Full backend ./mvnw test: 29,895 run; the two coverage guards it caught (configuration reference, dashboard) are fixed, the third failure is the known-flaky DocumentExtractorsTest.honoursItsTimeBudget.


✨ feat(engine): self-continuation — an agent can start its own next turn (2026-10-24)

Repo: EDDI (feat/conversation-continuation) — item E8 (core) of the evaluated-generation plan

What changed and why

A job of many model calls (the plan's video pipeline: ~150 calls over ~20 minutes) cannot be one turn: the per-request deadline header is capped at 10 minutes, and the turn is EDDI's unit of tracing, persistence and recovery. Instead of a workflow engine, a job is now many ordinary turns of one conversation, and the conversation is its job log.

  • CONTINUE_CONVERSATION — a new reserved action (IConversation, ReservedActionLint). A turn that emits it queues the next turn of the same conversation, without user input, after the turn has been committed.

  • Off unless configured. Two agent-level fields (AgentConfiguration): maxContinuations (per conversation, 0..10000, default unset = off — the action is ignored with a WARN, the step records continuation:refused = disabled, and eddi.continuation.refused{reason="disabled"} counts it) and continuationInput (a literal string, ≤ 4096 characters, never a template; default empty). Validated at save time and on ZIP import (AgentStore).

  • Bounds. Each continuation is an ordinary turn under the agent's turnDeadlineMs. The count is the number of steps carrying the engine-written marker continuation:number. maxCostPerConversationUsd bounds them all together — it already sums audit:cost over every step (LlmSpendGate.conversationCost, verified); a continuation is also refused before it is armed once the ceiling is reached. The tenant budget applies through say like on any turn.

  • What a continuation turn sees. The designer's continuationInput and the engine-reserved context entry selfContinuation = {number, max} (added to ClientContextGuard.RESERVED_KEYS, so a client cannot forge it). Rules route on a phase property, so the job is a state machine in config.

  • Delivery: a one-shot schedule, not the coordinator queue (ConversationContinuations, ContinuationFireHandler, a fast-path in ScheduleFireExecutor). The coordinator's queue lives in memory and dies with its node; a schedule row survives a restart, exactly one node claims it, a failed fire is retried with backoff and dead-lettered, and the turn it starts still goes through say — coordinator, conversation lease and fencing, quotas, audit. The cost is the poll interval (≤ 15 s) between two continuation turns.

  • Once only. Delivery is at-least-once, so two guards: the fire first looks for a step carrying its number in the stored conversation (written before the persist, never expires), and the turn carries an automatic Idempotency-Key (eddi-continuation-<n>). Under the lease, a queued turn rebuilt over a newer document is dropped when that document already holds its marker — also with the Idempotency-Key feature switched off (ConversationService).

  • Lifecycle. Decided before the persist (the outcome — continuation:next or continuation:refused — is part of the committed step) and armed only after it, in the say path (ConversationStepRunner), the resume path and the CONVERSATION_START turn. Nothing is armed for a turn that paused, failed, was cancelled, lost its lease or could not be stored. A fire never runs a turn for an ENDED, AWAITING_HUMAN, deleted/erased or Art. 18-restricted conversation; an undeployed agent is retried (undeploy disables the schedule, redeploy re-enables it) and dead-lettered; an interrupted continuation stops the chain. endConversation and cancel withdraw the pending continuation — cancel between two continuation turns now answers CANCELLED instead of 409 (ConversationHitlService); the approver's paused-only cancel never touches it. A group member's turn cannot continue itself. The schedule carries the owner's userId, so erasure deletes it.

  • Schedule surfaces. A continuation schedule cannot be fired manually (REST 409, MCP error) and is never exported (RestScheduleStore, McpAdminTools, RestExportService).

  • Metrics: eddi.continuation.scheduled, eddi.continuation.run, eddi.continuation.refused{reason} — described in metrics.md and charted in the Scheduling row of the Full Metrics Reference (k8s copy re-synced).

  • Docs: new page Long Jobs — the Conversation as the Job Log; reserved-action lists (agent-config-authoring.md, hitl.md, AGENTS.md), reserved context key (passing-context-information.md, configuration-reference.md), conversations.md, scheduling.md (engine-minted schedules), httpcalls.md (do not poll long operations with retries), upgrading-from-6.5.md (newly reserved names, the cancel 200).

  • Manager: a Self-continuation section on the agent page beside Limits (maxContinuations with the backend's 0..10000 bound, refusing to save an invalid count; continuationInput), i18n in all 11 locales (agent-config-sections.tsx, continuation.ts).

  • Platform Operator: the prompt explains self-continuation, its schedule, step records and metrics, and maps the long-jobs page; revision 36 → 37. Other open branches also bump operator-revision.json — operator PRs land one at a time.

Review fixes

  • Only the engine arms a continuation. REST schedule create, update and ZIP import accepted the continuationType marker, and a fire runs a turn in the conversation its metadata names — so a client that may create schedules could inject a turn into another user's conversation. The marker is now refused (400, for everyone, like the HITL-timeout and ingestion markers), and a fire whose schedule userId does not own the conversation runs nothing (owner_mismatch, a new refusal reason) (RestScheduleStore, ContinuationFireHandler).

  • A fire is COMPLETED only for a turn that was stored. The reply reaches the handler before the persist; the handler now confirms the turn's marker is in the stored conversation (re-checked for about two seconds) and fails the fire otherwise, so the schedule retries it.

  • A schedule write that fails for a moment is retried (three attempts) before schedule_failed. The crash window between commit and arm is documented in long-jobs.md with how to spot and resume a stopped job; an automatic reconciliation sweep is planned with part 2.

  • Manager: a half-typed count (5e, -) no longer silently clears maxContinuations and lets Save through.

  • Docs: only continuation turns are retried by their schedule (the first turn is resent by its caller); the poll interval does not guarantee a minimum delay between continuations.

  • A cancel that races the arm wins. A cancel that signalled a running turn found no schedule to withdraw yet, and the turn then armed one. Arming now skips a cancelled turn, and withdraws a schedule it wrote if the cancel landed during the write (interrupted).

  • Interrupts are kept. An interrupted retry pause gives up and keeps the thread's interrupt flag, and the continuation fire log is written with the interrupt parked and restored afterwards, as the other fire paths already do.

  • End-to-end ITs on both datastores (ConversationContinuationIT and its Postgres twin, with a one-second poll profile). A deterministic agent (rules + output, no LLM) runs one user turn, then the real poller runs continuations 1..3 on its own and the fourth is refused (limit); asserted on the stored conversation through REST (markers, continuation:next, the reserved context, the literal input), the schedule listing and the fire logs. Also: cancel between turns withdraws the pending continuation (200) and nothing runs after it, endConversation withdraws it, REST create/update with the marker is 400, and an agent without maxContinuations arms nothing.

  • Fixed, found by those ITs: cancelling a finished job answered CANCELLED. A fired one-shot is disabled, not deleted, so every continuation that ran stays under continuation-<conversationId>, and disarm counted those spent rows as withdrawn: a cancel after the job ended answered 200 instead of 409. disarm still deletes them but now reports only the pending ones — enabled, or switched off by an undeploy — through a new IScheduleStore.countPendingSchedulesByName (Mongo and Postgres) (ConversationContinuations).

  • Spent continuation rows are bounded. Every fired continuation stayed behind as a disabled one-shot with its fire log — up to maxContinuations rows per conversation. Arming the next continuation, and the last continuation turn of a job, now first deletes the conversation's used-up rows with their fire logs through a new IScheduleStore.deleteUsedUpOneShotsByName (Mongo and Postgres, reusing the delete cascades). Used up means exactly what markCompleted leaves for a one-shot: disabled, PENDING, no next fire, fired, unclaimed, no disabled reason — so the running continuation's claimed row, dead-lettered, undeploy-disabled and hand-disabled rows are never touched, and a conversation keeps at most its latest used-up continuation plus the pending one. A failed prune is logged and never stops the arm. Rejected: deleting a continuation's row when its fire completes, which would erase its fire history and put continuation logic into the generic poller. deleteSchedulesByName no longer logs every deletion as "HITL timeout schedule(s)".

Not in this change (planned)

Part 2 of E8 — parking a turn on an external long-running operation (the HITL pause machinery with a machine as the resolver, a poll schedule bound to the pauseId, an optional signed webhook to resolve it sooner) — and the async video provider (needs E6/E7).

Verification

New: ConversationContinuationsTest, ContinuationFireHandlerTest, ConversationServiceContinuationTest (the real say path: armed only after the commit; fire twice → one pipeline run through the stored document; two deliveries serialized by the lease → one run, with and without Idempotency-Key), AgentStoreContinuationValidationTest; extended ConversationHitlServiceCancelTest, ScheduleFireExecutorTest, RestScheduleStoreTest, AgentStoreClientLibraryMemoryToolsTest, ClientContextGuardTest.


✨ feat(llm): spend checks that see every attempt, and per-conversation reservations (2026-10-24)

Repo: EDDI · Branch: feat/llm-spend-checks · Plan item E4 of planning/evaluated-generation-plan.md

What changed and why

The agent's maxCostPerConversationUsd and the tenant's monthly budget were checked once per LLM task, before its first model call, and between tool-loop rounds. Every further paid call of the task ran unchecked — and, since a task writes its cost into audit:cost only once it has finished, even a check would have missed the attempts before it:

  • a same-model re-ask (FormatRetryRunner) was bounded only by maxRetryCostUsd, priced from per-1M prices, and never consulted the conversation's spend;

  • a cascade escalation to its next step was bounded only by the cascade's own maxCostPerRun;

  • an output guardrail reprompt and a classifier guardrail's model call (input and output) ran whatever the ceiling or the tenant budget said;

  • nothing reserved the cost of a call in flight, so calls running at the same time would all pass the same check.

Now every one of these is admitted by LlmSpendGate.admit before it starts, with what the task has already spent and not yet recorded (earlier attempts at their prices; the primary answer's cost before a reprompt; earlier cascade steps before an escalation; the tool loop's tool cost before its final re-ask). A refused re-ask is skipped (eddi.llm.recovery{outcome="skipped_spend"}) and the reply is handled as unresolved; a refused escalation returns the cascade's best answer so far (eddi.llm.cascade.ceiling.exceeded{kind="spend"}) — or, when no earlier step produced one, raises the spend refusal so LlmTask serves the task's fallback answer, as for a refused primary call; a refused reprompt degrades to the existing "no reprompt could start" block; a refused classifier call is "could not decide" with the new audit reason spend_refused, so its failMode applies. Every refusal is counted by the existing eddi.llm.spend.refused{reason} with the existing reasons — no new meter.

Reservations. SpendReservations (one per loaded ConversationMemory, transient) holds the expected cost of each admitted call until it is closed; LlmSpendGate.check and admit both count what is held. It is per conversation and per node — exact for the ceiling, because a conversation's turns are serialized (coordinator; conversation lease in a cluster) and the ceiling is computed from the conversation's own steps, not from the cluster COSTS KV. The tenant budget is read, not reserved — but its check now adds the turn's unsettled spend (the current step's audit:cost not yet metered, plus the running task's unrecorded spend), through a new TenantQuotaService.checkCostBudget(tenantId, pendingUsd): the monthly counter is charged only when a turn settles, so without it every paid call of a turn was compared with the counter as it stood before the turn. LlmSpendGate.admit(memory, pendingUsd, expectedUsd) and TaskSpend (a PaidCallGate) are the entry points for E5 (forEach) and E7 (media).

Behaviour kept, now documented precisely. A call is admitted while the spend so far — recorded, unrecorded and in flight — is below the ceiling; its own price is not compared, so the call that crosses the ceiling completes and the next is refused. No configuration field was added; an agent without a ceiling and with quotas off behaves exactly as before.

Design decisions

  • One gate, one rule: re-asks, escalations, reprompts and classifier calls use the same admit the primary call's check is built on, and the same reasons and metric.

  • The reprompt check sits in GuardrailService.runOutput, behind GuardrailContext.spend(), so every execution branch (plain, tool loop, cascade, HITL resume) gets it; Reprompter.Attempt now carries the reprompt's priced cost.

  • A phase's unrecorded spend lives in a TaskSpend that is discarded once the phase's cost is recorded, so no amount is counted both there and in audit:cost.

  • Expected costs are cheap estimates (previous attempt's price; the classifier prompt at its input price). They only matter for concurrent calls, of which there are none inside one task today.

Files

SpendReservations.java, LlmSpendGate.java, TaskSpend.java, PaidCallGate.java, FormatRetryRunner.java, CascadingModelExecutor.java, GuardrailService.java, ClassifierGuardrail.java, LlmTask.java; docs in langchain.md, llm-resilience.md, tenant-quotas.md, metrics.md; Platform Operator prompt and revision 37.

End-to-end tests

  • LlmSpendChecksIT and its PostgreSQL twin PostgresLlmSpendChecksIT drive a deployed agent against a WireMock OpenAI endpoint whose usage blocks are priced by the task: the ceiling refusing the turn after the one that crosses it; a re-ask, a guardrail reprompt, a cascade escalation and an output classifier call each refused on the task's unrecorded spend (each with a control that makes the call when nothing stops it); the tenant budget charged by one conversation and refusing the next, and refusing a re-ask on the same turn's unsettled spend; and an under-budget turn whose audit:cost and tenant usage equal the reported usage at the configured prices. Each asserts the client's answer, the stored conversation and the exact number of provider requests.

Not done / next

  • The cascade's judge_model confidence call is still unchecked (it is priced through the cascade's run cost and the next step's check sees it).

  • Tenant-level reservations would need the quota store: a turn's own spend is now counted, but another conversation's unsettled turn is not, so concurrent conversations can each complete one call past the tenant budget.

  • Operator revision 37 will collide with other open branches that bump it; re-bump at merge.


🐛 fix(llm): per-cascade-step vision, one repeat-guard test, consistent trace-header presence (2026-10-24)

Repo: EDDI (fix/provider-capability-gaps)

What changed and why

Follow-ups from the review of #1056, #1057 and #1062.

  • Attachments are decided by the endpoint actually called. LlmTask forwarded attachments once, with the task's own type and parameters, so a cascade step on its own openai-compatible endpoint with vision=true got no images, and a step without it inherited the task's. The JSON response format already used the step's parameters. CascadingModelExecutor now takes an optional per-step prompt provider; LlmTask supplies one that re-forwards the attachments with the step's type, model and vision decision, but only when the task or the step is openai-compatible and the endpoint differs (type, model or vision decision). Non-cascade tasks and type: openai cascades take exactly the old path. The re-forward is non-recording (AttachmentForwarder.forward(..., record=false)), so the turn's attachment errors and meters are not counted twice. A rebuilt-prompt retry after a context-too-long error (onContextTooLong: retry) still forwards with the task's decision; that rarely-hit path is unchanged.

  • Input guardrails no longer undo it. The step's prompt is screened by carrying the task-level rewrites onto it (LlmTask.screenedStepPrompt): each text part the screening changed is rewritten by its text in the step's message, while the step's own image and document parts and engine notes are kept. GuardrailService.reapply is not used for a step, because it swaps the whole last user message for the task's screened one, attachments included.

  • Text only a step's prompt carries is screened. An attachment can turn into different text per endpoint (a PDF extracted to text for a step without native PDF, a file inlined for one step and skipped for the task, a vision-skip note naming the file). That text is current-turn content the task-level screening never saw, so GuardrailService.screenUnseenText screens it with every input guardrail, including the classifier, which skips earlier messages for cost. It is quiet (no outcome, metric, SSE event or audit entry; the turn's findings were recorded once); its cost is added to the turn. redact rewrites the text; a block, or a guardrail that cannot decide (a classifier that is down or unparseable) according to its failMode (a redact guardrail without failMode lets the text through), replaces it with the withheld placeholder. This differs from the task path on purpose: a BLOCK on attachment text there blocks the whole turn, while on a cascade step's step-only text the part is withheld and the turn continues, because step-only parts are never replayed into later history. The cost of a classifier call is counted whether it flags or clears the text. A verdict is kept for the turn by text, so several cascade steps carrying the same part cost one classifier call. When the step's prompt cannot be matched to the task's, the step gets the task's screened prompt.

  • What is recorded. The attachment errors written to the step data and the eddi.attachment.* meters come from the task-level pass (the task's endpoint), not from the cascade step that answered. A step's own forwarding is non-recording.

  • Repeat guard, gated batch. ToolLoopRunnerToolPolicyTest gains a test for the ungated half of a gated (HITL) batch, the second executeGuarded call site, which no test drove.

  • MCP trace headers. McpToolProviderManager.withTraceHeaders checked traceparent and tracestate one at a time, while TracePropagation.headersMissingFrom is all-or-nothing. It now reuses the shared rule (TracePropagation.withoutIfAnyPresent): an author's own traceparent or tracestate suppresses both.

  • Refuted: create_api_agent already runs the same OutboundTargetPolicy check on llmBaseUrl as setup_agent does on baseUrl (AgentSetupService.createApiAgent, covered by AgentSetupLlmBaseUrlPolicyTest); no change.

Design decisions

  • The per-step decision compares (type, model name, effective vision) of the step with the task's and re-forwards only on a difference, so the common cascade keeps the one prompt it always had.

Verification

Mutation-checked: bypassing the per-step provider, the guard at the gated-batch site, and the shared presence rule each fail the new tests.


chore(release): attest SHA256SUMS with SLSA provenance (2026-10-24)

Repo: EDDI · Branch: chore/release-provenance-attestation

The OpenSSF Scorecard Signed-Releases check reported 6.6.0 as signed (the cosign bundle SHA256SUMS.sigstore.json) but without provenance. The image job already attested its digest with actions/attest-build-provenance; the release job, which publishes the installer checksum list, did not attest anything.

  • ci.yml — the release job gets attestations: write and a Generate SLSA provenance attestation (SHA256SUMS) step after the cosign signature, using the same pinned action as the image job. It runs before the GitHub Release is created, so a failed attestation publishes nothing.

  • Verify a release with gh attestation verify SHA256SUMS --repo labsai/EDDI.

  • Applies to tags cut after this merges. 6.6.0 stays without provenance; it cannot be attested retroactively.

  • Open question: Scorecard's check may look for a .intoto.jsonl release asset rather than the attestation store. Confirm on the next tag; if it still warns, the fallback is the slsa-framework/slsa-github-generator generic generator, which emits that asset.


📝 docs(planning): evaluated generation — checks and repair for every step that produces something (2026-10-24)

Repo: EDDI (docs/evaluated-generation-plan)

What changed and why

New planning document planning/evaluated-generation-plan.md. No code changes.

It started as an analysis of whether EDDI could host a production AI video-generation pipeline: about 150 model calls per job, best-of-N keyframes, multimodal judges, a repair ladder, a human cost gate, and ffmpeg assembly. The answer generalises beyond video. Make → judge → repair is the loop behind grounded RAG answers, extraction, text-to-SQL, output compliance, content production, group deliverables and media.

Verified against main at 5028af0a3, EDDI already runs that loop in seven places:

  • output guardrails (#1064, with the classifier type from #1112);

  • format recovery (R5);

  • the model cascade;

  • TASK_FORCE VERIFY, which has no rework within a run;

  • group task approval;

  • single-agent HITL;

  • team cadences.

The plan builds on them instead of adding an eighth:

Item
What it adds

E1

A judge output guardrail that answers with author-declared issue codes, so a reprompt says what to fix; onExhausted: deliver-best for quality checks, so the best attempt is delivered (still screened by every other guardrail) instead of a block message

E1c

A deterministic expression guardrail

E2

Rework after a failed verdict, for humans and groups

E4

Spend checks that see every attempt, and reservations for parallel calls

E5

Checks and forEach on tool and HTTP steps

E6

Media groundwork

E7

Speech and image providers

E8

Long jobs through self-continuation and parked operations

E9

A fingerprinted DAG

E10

A composition service outside core

Design decisions

  • Checks on meaning are output guardrails, not a new block in responseValidation. Guardrails already run after it in every execution mode, with their own reprompt loop, cost metering and failMode.

  • judge is a sibling of classifier, not a mode of it. It shares the classifier's model-call machinery: provider pass-through, timeouts, deadline, pricing and promptTemplate data. Its contract differs: a structured list of codes rather than "safe is a positive label".

  • Judge feedback uses a closed vocabulary. GuardrailService.correctiveMessage never puts the user's or the model's text into a reprompt, so the judge returns only declared codes, and the producer is told only the designer's fix text for them.

  • The pipeline stays a straight line. Loops live inside a step, and repairs that must reach an earlier step leave as actions.

  • ffmpeg, music and domain-specific logic stay outside core.


feat(chat-ui): conversation and reply ratings (2026-10-24)

Repo: EDDI (feat/conversation-ratings) — PR 2 of planning/conversation-rating-plan.md (§7 and §0.1 "User — UX rules")

What changed and why

The Chat UI now lets the person chatting rate the conversation and, when the agent asks for it, single replies, against the owner endpoints PR 1 added. Everything is driven by the profile's rating object; without it the widget renders exactly as before.

  • Reply thumbs (StepRating.tsx) under the last agent bubble of each step — hover/focus on desktop, always on touch, aria-pressed, 44px targets on touch. Thumbs down rates at once, then offers optional reason tags and a comment.

  • Rating card (RatingCard.tsx), a sibling of PausedCard: stars as a radio group (roving focus) or thumbs; offered on end (askOnEnd) and/or after askAfterTurns replies, at most once per conversation, never to somebody who already rated, never again once closed (localStorage, guarded); always available from a header entry. One tap rates, tags/comment follow (comment per askBelowScore), then a thanks state naming who receives the feedback; editable and removable afterwards; never blocks the composer.

  • State (useRatings.ts): restored via GET /agents/{id}/rating when a conversation opens; optimistic updates with rollback and a short notice; every backend error code mapped to translated copy (rating-api.ts); a rerun clears the local thumb of that step.

  • Steps (rating-steps.ts): reply ratings are keyed by step. Full conversation reads now stamp stepIndex on their messages (stepsToMessages(…, fullHistory), processSnapshot({ fullHistory })); live turns are counted from the nearest stamped message.

  • Demo mode gets an in-memory rating backend and a profile asking for every control. i18n for en/de/fr/es; styles for both themes and phones.

  • Docs: Chat UI section in conversation-ratings.md; ui/chat/AGENTS.md structure and the rating error envelope.

Design decisions

  • The rating endpoints' error body is {error: CODE, message}, not the attachments' {error, code}; rating-api.ts parses its own and never shows the server's message.

  • One thumb per step, under the step's last bubble, because the server stores one reply rating per step.

  • Stars use radio semantics for screen readers, but arrow keys only move focus and Enter/Space rates: with "one tap rates", arrow-selects-and-submits would send a rating per key press.

  • A rerun clears the thumb locally only, as plan R8 says; the stored rating reappears after a reload (documented limitation).

Testing

npm run typecheck, npm run lint and the full vitest suite (34 files, 564 tests, 67 of them new) pass; key logic was mutation-checked. Vitest needs Node ≥ 22.15 (jsdom 30's undici): the Maven-downloaded ui/node/v24.* works.


feat(ratings): conversation ratings — backend (2026-10-24)

Repo: EDDI (feat/conversation-ratings) — PR 1 of the plan in planning/conversation-rating-plan.md

What changed and why

People chatting with an agent can now rate the conversation and, if the agent asks for it, single agent replies; the people running the agent can list, summarize, export and triage those ratings. Off unless the agent designer adds ratingConfig with "enabled": true (checked per agent version the conversation runs on, cached per version in ConversationRatingPolicy like ConversationReviewPolicy).

  • Config: AgentConfiguration.ratingConfig (scale THUMBS|FIVE_STAR, conversation and reply ratings, comment rules, reason tags, rating window), validated on agent create/update/duplicate (RatingConfigValidator), and a rating subset on GET /agents/{agentId}/profile so chat clients need no extra call.

  • Store: IConversationRatingStore with MongoDB (ConversationRatingStore) and PostgreSQL (PostgresConversationRatingStore) implementations selected in DataStoreProducers. Key (conversationId, stepIndex), conversation rating at -1; atomic upsert keeping id/createdAt; summaries aggregated in the database; indexes for agent+time, agent+version, user (GDPR) and the needs-attention count.

  • Owner REST (IRestConversationRating): PUT|GET|DELETE /agents/{conversationId}/rating and PUT|DELETE /agents/{conversationId}/steps/{stepIndex}/rating, with stable error codes (RATING_DISABLED, RATING_WINDOW_CLOSED, INVALID_STEP, INVALID_SCORE, INVALID_TAG, COMMENT_NOT_ALLOWED, COMMENT_TOO_LONG, NOT_CONVERSATION_OWNER, CONVERSATION_NOT_FOUND).

  • Maintainer REST (IRestConversationRatingAdmin, eddi-admin/eddi-editor): GET /ratings, /ratings/summary, /ratings/export (CSV, 100k cap, formula-injection escaping), and the triage loop of plan §0.1: GET /ratings/attention-count, PATCH /ratings/{ratingId}, POST /ratings/review.

  • GDPR: ConversationRatingGdprParticipant joins erasure (deletes the user's ratings, clears them as reviewer) and export; processing restriction blocks new ratings.

  • Metrics: eddi_conversation_ratings_total, eddi_conversation_ratings_normalized, eddi_conversation_ratings_withdrawn_total, charted in a new "Conversation Ratings" row of the Full Metrics Reference dashboard.

Design decisions

  • Only the owner rates. requireConversationOwner admits administrators too; the endpoint additionally requires OwnershipValidator.isOwner, so an admin can read and withdraw but never write a rating in somebody's name.

  • User ids for administrators only — decided on isAdmin(), not seesEverything(): without workspace enforcement every editor "sees everything", and the plan's R3 is about admins.

  • Scoping (R6): a caller who does not see everything must pass agentId and hold EDIT; PATCH checks EDIT on the rating's own agent.

  • canOpenTranscript applies the existing conversation-read rule per row (owner, admin, or conversation review) and is false for purged conversations — one descriptor read per distinct conversation on the page (≤ 100).

  • Triage is hidden from the rater: owner responses strip status, reviewer and note. A re-rating resets triage to NEW and clears the note. PATCH is conditional on the rating's updatedAt, so a maintainer cannot mark reviewed a rating that changed after they read it (409 RATING_CHANGED). The reviewer always comes from the principal.

  • minScore/maxScore filter the normalized score (0..1), so one filter means the same on every scale. Added sort=newest|lowest, reviewStatus and needsAttention filters.

  • Admin endpoints share one @BeanParam (RatingQueryParams) so the five filtered endpoints cannot drift.

Deviations from the plan

  • A reply rating records the conversation's agent version at rating time: conversation memory stores no version per step (plan §10 assumed one).

  • The per-reply excerpt for callers who may read the transcript (§6) is not returned; clients with canOpenTranscript open the conversation instead.

  • GDPR: implemented as an IGdprParticipant (erase + export), which is the SPI for stores; UserErasureParticipant is for stopping in-flight work and has nothing to stop here.

  • No separate (conversationId) index: the unique key's prefix serves it.

What's next

The MCP rating tools ship with this backend. Next: the Chat UI and the Manager Feedback page (badge on attention-count) with the Platform Operator's read access, then push alerts. The store ITs (MongoConversationRatingStoreIT, PostgresConversationRatingStoreIT) need Docker.


✨ feat(mail): email notifications for pending approvals — email Phase 1 (2026-10-24)

Repo: EDDI (feat/email-hitl-notifications, on top of feat/email-mail-core)

Phase 1 of the email plan (§16 "Notifications", the outbound half of §12).

Socket guard: an operator policy

  • SafeSocketConnector.resolveOperator (Policy.OPERATOR) for a host the operator set in application.properties — today only the system mailer's relay. Private and loopback addresses, IP literals, single-label names and any port (25 included) are allowed, and eddi.email.allowed-hosts (which confines authors) is not consulted. Still resolved once and pinned, still no link-local or cloud-metadata address, TLS still verified. TlsMode.PLAINTEXT exists only on an operator endpoint: the Endpoint constructor refuses it for an author one. resolve (the author policy) is unchanged.

Connections: mail origins on baseUrlAllowlist

  • A connection's baseUrlAllowlist now accepts smtp://, smtps://, imap:// and imaps:// origins (ConnectionConfiguration.requireCanonicalAllowlistOrigin), so resolveAccessToken (XOAUTH2) and the new resolveBasicLogin (username + vault-backed password for SMTP/IMAP login) can check a mail server against it. The ports a mail scheme implies fold away (smtps 465, smtp 587, imaps 993, imap 143); smtp://relay:25 stays a distinct origin. An https entry for the same host does not cover a mail origin. The credential-endpoint allowlist and the public base URL stay http(s) only. The Manager's connection-validation.ts mirror accepts the same schemes, with the originScheme message updated in all 11 locales.

The system mailer

  • SystemMailer (engine/mail): the deployment's one SMTP sender, configured by the operator under eddi.mail.smtp.* (host, port, tls = starttls | implicit | none, from, from-name, and at most one credential source: connection — BASIC or OAUTH2_CLIENT_CREDENTIALS/XOAUTH2 — or username + password). Unset host = disabled, one INFO line at startup; an unusable configuration disables it with one ERROR line and never falls back to something weaker. Sockets come from SafeSocketConnector.resolveOperator. STARTTLS is required, not opportunistic; tls=none needs eddi.mail.smtp.allow-plaintext=true and never carries a credential. Failures are classified (MailSendException.Category), permanent only for a 5xx refusal.

  • GreenMail 2.1.14 (Apache-2.0, test scope; its aggregate org.eclipse.angus:jakarta.mail and JUnit 4 are excluded) runs implicit TLS, plain SMTP and AUTH in SystemMailerTest; a small in-test STARTTLS server covers the upgrade GreenMail does not speak, and proves AUTH (PLAIN and XOAUTH2) only ever crosses the wire after it. The certificate is a throwaway made with the JDK's keytool; the production TLS path, with certificate and host-name checks, is what accepts it.

The message ledger (outbound)

  • IEmailMessageLedger (integrations/email/ledger) with MongoEmailMessageLedger (email_message_ledger collection) and PostgresEmailMessageLedger (email_message_ledger table, created on first use), selected by eddi.datastore.type in DataStoreProducers. One row per message: integration (system for system mail), kind (NOTIFY; REPLY later), direction, RFC Message-ID, conversation, sourceRef (what the message is rebuilt from — the pause id for a notification), idempotency key, recipient, state PENDING → SENT | FAILED | SUPPRESSED, attempts, nextAttemptAt, claim token, provider response, last error, created/updated/expires. No body, subject or MIME — a retry re-renders from the source. Two unique keys (idempotency key; (integrationId, direction, messageId)) make an insert a cluster-wide claim. claimDue leases rows by a conditional update (findOneAndUpdate per row on Mongo; UPDATE … FOR UPDATE SKIP LOCKED … RETURNING on Postgres), and every state change is conditional on the claim token, so a taken-over claim cannot overwrite the new owner's result.

  • MongoEmailMessageLedgerIT / PostgresEmailMessageLedgerIT run one shared contract against real databases (Testcontainers): duplicate keys, eight concurrent inserts of one notification (one winner), two sweepers claiming 20 rows at once (no overlap), lease expiry and stale claims, reschedule, retention, erasure by recipient, and the stored field set (no body field exists).

HITL email notifications

  • Agent opt-in hitlConfig.notify.email.recipients (HitlNotifyConfig): 1–20 plain ASCII addresses, validated at save and import time (HitlConfigValidation.validateNotify — empty, over 20, malformed, display-name, non-ASCII and duplicate-after-normalisation entries refused with the position, never the address). Configs without the field are unchanged.

  • The hook: HitlPauseCommittedEvent(conversationId, pauseId), fired asynchronously by ConversationService.firePauseCommitted at the three places a regular pause is committed — the say turn (ConversationStepRunner, after the state CAS and the timeout schedule), the CONVERSATION_START turn, and a resume that pauses again (ConversationHitlService). Not for a pause restored after a failed resume, nor on a CAS miss. Group discussions are not covered yet.

  • HitlEmailNotifier (integrations/email/notify): re-reads the pause from the store (state and pauseId must still match), inserts one ledger row per recipient under a digest key of kind/conversation/pause/recipient, and sends at once for the rows it won. A @Scheduled(identity = "email-ledger-sweeper") sweep retries due rows with exponential backoff (eddi.email.outbound.retry-backoff, capped at 1 h) up to eddi.email.outbound.max-attempts, removes expired rows (eddi.email.ledger-retention) and refreshes the eddi.email.ledger.pending gauge. A decided pause ends SUPPRESSED; a 5xx fails at once.

  • Content (HitlNotificationContent): agent name, pause type, reason, start, deadline + policy, conversation id, and for a tool-call pause the same redacted, 300-char-truncated argument lines as the Slack card — extracted from SlackHitlSupport into the shared HitlToolCallPreview. No conversation content. Subject [EDDI] Approval needed: <agent name>, designer text flattened to one line. The link is eddi.connections.public-base-url + /manage/approvals, no token; without a base URL the page is named, not linked.

  • Metrics eddi.email.outbound{kind,outcome} and eddi.email.ledger.pending, on the Full Metrics dashboard's Human-in-the-Loop row and in metrics.md. Audit entry email.notify per sent/failed notification with the recipient as a SHA-256 hash plus domain (the audit ledger is write-once). GDPR: EmailLedgerGdprParticipant (emailLedger) erases/exports rows by the user id's address and the directory's recorded email; IGdprParticipant.order() makes the user directory run last so the address is still readable.

Recipient domain policy and flood brake (review follow-up)

  • eddi.mail.notify.allowed-recipient-domains (NotifyRecipientPolicy, engine/mail): exact domains, *.domain for subdomains, * for any; unset = the domain of eddi.mail.smtp.from and its subdomains. Recipients are set by anyone with EDIT on an agent while the mail leaves through the operator's relay under the operator's sender, so without a bound the relay was an open mailer for agent authors. Enforced at send time on every attempt (the row ends SUPPRESSED, RECIPIENT_NOT_ALLOWED, outcome=not_allowed) and at save time in HitlConfigValidation — refused when a mailer is configured, accepted with a WARN when not (read through ConfigProvider, since the validation is static). A malformed entry fails closed: nobody is mailed, ERROR at startup.

  • eddi.mail.notify.max-per-recipient-per-hour (default 30): IEmailMessageLedger.countCreatedSince(recipient, kind, since) counts the recipient's non-suppressed NOTIFY rows of the last hour across the cluster (new index (recipient, kind, createdAt) on both stores); over the limit the row is SUPPRESSED (RATE_LIMITED, outcome=rate_limited) and each instance logs one WARN per recipient per hour, naming it by hash. Suppressed rows do not count, so the window empties once the flood stops. Count and insert are two steps, so concurrent pods can overshoot by a few.

  • Docs (hitl.md, configuration-reference.md, metrics.md), the Manager hint and the operator prompt say so; operator revision stays 37 (one PR) with the new fingerprint.

Manager and the Platform Operator

  • The agent's Human-in-the-Loop settings gain "Email people when this agent waits for approval" with a recipients field (agent-config-sections.tsx, parser in lib/hitl-notify.ts mirroring the save-time rules: 1–20, plain ASCII, no duplicates). As with the approval timeout, an unsavable list never enters the draft; the field shows what is wrong. Eight new agentDetail.hitlNotify* keys in all 11 locales.

  • Operator prompt (system-prompt.ts): how email notifications are set up — the operator's eddi.mail.smtp.*, the agent's hitlConfig.notify.email.recipients in the Manager (the operator cannot write hitlConfig), what the mail contains, why there is no "all approvers" switch. No new endpoint, so tool-scopes.ts is unchanged. Operator revision 36 → 37.

For Phase 2 and 3

  • The ledger API is the one they extend: add inbound states and a stranded-turn query to IEmailMessageLedger, Kind.REPLY rows get their own worker (claimDue takes a kind), sourceRef carries the conversation step a reply is rebuilt from. The unique (integrationId, direction, messageId) key is already the inbound dedup key.

  • The SMTP client is SystemMailer for operator relays only; a channel's author-configured SMTP must use SafeSocketConnector.resolve (the author policy), not resolveOperator.

  • Group discussions (AWAITING_APPROVAL) are not notified yet; GroupHitlCoordinator commits group pauses in three places and would need its own event.


✨ feat(mail): mail core, socket guard and bare OAuth tokens — email Phase 0 + 0b (2026-10-24)

Repo: EDDI (feat/email-mail-core)

The first slice of the email plan (Phase 0 and 0b): a pure library under engine/mail that later phases (notifications, trigger mode, conversation mode) and the mail RAG source (rag-ingestion-source-types-plan.md §8) build on. No channel, no transport, no conversation code — nothing here is reachable from an agent yet.

What changed and why

  • Angus Mail (org.eclipse.angus:angus-mail 2.0.5, jakarta.mail:jakarta.mail-api 2.1.5 — the versions the Quarkus BOM manages, so one copy on the classpath; EPL-2.0 / GPL-2.0-with-CPE / EDL-1.0) for MIME grammar.

  • MimeMessageParser: raw RFC 5322 bytes → InboundMail. Every limit (MailLimits: raw bytes, header bytes, nesting depth, part count, attachments, per-attachment bytes, output characters) is enforced before the work it bounds — multipart delimiters are counted in the raw bytes before Jakarta Mail materialises a part, so a few KB declaring thousands of parts is refused, not allocated, and a base64-encoded multipart (which would hide its delimiters) is skipped. text/plain preferred, HTML converted as fallback. Broken and unknown charsets, RFC 2047 words (split multi-byte, unknown charset), unparseable dates and invalid addresses become MailAnomaly values, never exceptions. A message without a Message-ID gets sha256:<hex of raw bytes>, flagged syntheticMessageId. Executables (by name, type and magic bytes) never carry content; archives are flagged, never expanded; message/rfc822 is never walked into. multipart/report DSNs are parsed into a DeliveryReport (recipient, action, status, original Message-ID) for later bounce suppression.

  • AddressNormalizer (lower-case, IDN→ASCII, no dot/+tag folding, no domain literals or numeric TLDs), QuoteStripper (trailing > blocks with en/de/fr/es/it/nl attributions; Outlook header blocks in en/de/fr; Gmail gmail_quote, Apple/Thunderbird blockquote type=cite + moz-cite-prefix, Outlook web markers — interleaved inline replies, forwards and quote-only messages are kept whole), AutoReplyDetector (RFC 3834, X-Autoreply/X-Autorespond, Precedence, List-*, null/daemon return paths, reports), PlainTextMailRenderer (text/plain UTF-8 format=flowed, threading headers with a capped References chain, Re: without stacking, Auto-Submitted, X-Auto-Response-Suppress: All, random <eddi.<uuid>@domain> ids, and a refusal of any header value containing CR/LF or another control character).

  • HiddenContentFilter, run by HtmlToMarkdownConverter, in two modes. Page mode (convert(), every existing caller — crawler, file upload, WebScraperTool) is conservative: only HTML comments, text of 1px or less, transparent text, and text the colour of a background set explicitly on it or an ancestor are dropped. Accordions, hidden tab panels, opacity:0 fade-ins, off-screen skip links and sr-only text — what pages hide until script reveals it, and what a knowledge base wants — are kept. Mail mode (convertMail) is strict, since mail runs no script: also display:none, opacity ~0, mso-hide, zero-size + overflow hidden, off-screen, clip, scale(0), hidden, inherited visibility:hidden, display:none/visibility:hidden rules in <style> outside @media (HiddenStylesheetRules), and an assumed white page with black text. convertMail also skips the main/article scoping and the <title>.

  • Linear on hostile input. Style blocks are read by one forward indexOf scan (no backtracking regex) and matched in one pass against an index of rules; nothing is truncated, so a hiding rule after megabytes of junk is still applied. Where exact matching would cost more, it over-approximates (rightmost compound selector only; an element more than 64 hiding rules could apply to counts as hidden), which can only remove more. The quote stripper's Outlook-header search computes subtree text sizes bottom-up and its top-level searches skip matched subtrees. jsoup 1.23.2 itself caps tree depth at 512 (deeper elements become siblings).

  • ALTERNATIVES_DIVERGE: when a multipart/alternative has both parts, the plain text (what the agent reads) is compared with the HTML as rendered, hidden content removed (what a reviewer sees), by word sets in both directions; a substantial difference adds the anomaly. text/plain stays the preference.

  • SafeSocketConnector (engine/net): the socket-level SSRF guard the RAG plan §3.10 proposed. DNS names only (every IP-literal spelling refused), IMAP 993/143-STARTTLS and SMTP 465/587-STARTTLS only, optional eddi.email.allowed-hosts, resolved once with every address checked by UrlValidationUtils.isPrivateAddress, pinned to the first address (PinnedSocket ignores a library's second lookup), TLS always verified, timeouts. angusProperties(endpoint) wires Angus Mail to it with socketFactory.fallback=false; a loopback smoke test proves Angus connects through it, requires STARTTLS before any credential, and does not fall back.

  • ConnectionResolver.resolveAccessToken: the bare access token for XOAUTH2, OAuth connections only (STATIC, BASIC, CALLER_SUPPLIED → UNSUPPORTED_PLACEMENT), with the allowlist, PER_USER/VERIFIED rules and the shared token supplier (refresh, caching) unchanged.

For the next phases

  • InboundMail.authentication() is NOT_EVALUATED until the DKIM verifier attaches a verdict with withAuthentication; only ALIGNED_PASS authenticates. The verifier must also treat the MULTIPLE_FROM and DUPLICATE_SINGLETON_HEADER anomalies as unauthenticated. Raw bytes are not kept in InboundMail; the verifier gets them from the transport.

  • baseUrlAllowlist holds http(s) origins only, so resolveAccessToken refuses an imaps:// target today (fails closed). The IMAP phase must teach the connection model (and the Manager's mirror in connection-validation.ts) mail origins.

  • Private-address mail servers (on-premises Exchange) are refused, with no override yet.

Files: engine/mail/, SafeSocketConnector.java, HiddenContentFilter.java, HiddenStylesheetRules.java, ConnectionResolver.java, security.md, configuration-reference.md, rag.md, fixtures under src/test/resources/mail/.


✨ feat(llm): expression guardrail — a deterministic check over a JSON answer (2026-10-24)

Repo: EDDI (feat/llm-expression-guardrail, from main at 5028af0a3) — item E1c of the evaluated-generation plan. Independent of the judge guardrail (#1121, feat/llm-judge-guardrail): it builds only on what main has (ContentGuardrail, GuardrailVerdict.violation(reason, hint), GuardrailUndecidedException, failMode).

What changed and why

A well-formed answer can still be wrong: an invoice whose total is not the sum of its lines passes responseSchema and json-object. expression (output only) parses the answer as JSON and evaluates an author-written boolean expression over it, and reprompts with author-written feedback — the deterministic sibling of the judge.

  • SafeJsonExpression (ai.labs.eddi.utils, new) — a small recursive-descent language in the style of CalculatorTool.SafeMathParser: number/string/true/false/null literals; paths (invoice.total, lines[0].amount, invoice['due-date'], $ for the answer itself) with a [*] wildcard that yields a list; + - * / % on BigDecimal (34 significant digits, 0.1 + 0.2 == 0.3 is true); == != < <= > >= (not chainable); && || ! with short-circuit; parentheses; nine functions — sum, count, min, max, len, abs, round(x, n) (half-up), exists(path), approx(a, b, tolerance). No script engine, no expression library, no reflection, no Qute; an unknown function is a compile-time error. JDK-only and Java 17 syntax so ClusterFuzzLite can compile a vendored copy.

  • Null semantics: a missing path and a JSON null are both null; == null / != null test it; any other comparison with null is false; arithmetic, logic or a function on null, a type mismatch, division by zero, an empty min/max and an out-of-range number are evaluation errors — could not decide, never false. exists(path) tells a present key holding null from a missing one.

  • Bounds: expression ≤ 2000 characters, nesting ≤ 32, ≤ 500 parts, ≤ 32 segments per path (all refused at compile time with a position, never a StackOverflowError); ≤ 10,000 values per path, ≤ 200,000 steps per evaluation; numbers beyond 1000 digits or a ±1000 scale refused rather than materialised.

  • ExpressionGuardrail (modules/llm/guardrails/impl, new bean, picked up by GuardrailService's type index) — parameters expr, issue ([A-Z][A-Z0-9_]{0,39}), fix (≤ 1000 characters), all required and checked in validate() at deploy (parameter 'expr' is not valid at position 21: '=' is not an operator; compare with '=='). Compiled expressions sit in a bounded Caffeine cache (512, refusals cached too). The answer is read with ModelOutputParser (fence and prose tolerant) over its own exact mapper: decimals as BigDecimal, integers as BigInteger, duplicate keys refused. Verdicts: true → allow; false → VIOLATION expression_failed:<ISSUE> with a hint that is EDDI's fixed frame (the judge guardrail's wording) around the author's fix only; not JSON / > 262,144 characters / duplicate key → GuardrailUndecidedException expression_unparseable; evaluation error or a non-boolean result → expression_undecided:<cause> (the evaluator's own codes). failMode decides as for every type.

  • Fuzzing: SafeJsonExpressionFuzzTest (Jazzer @FuzzTest over expressions and over JSON data, plus seeded random sweeps that run in every unit-test run) and a ClusterFuzzLite target SafeJsonExpressionFuzzer; .clusterfuzzlite/SafeJsonExpression.java is the vendored copy, and the Vendored Fuzz Sources In Sync guard knows the fourth file.

  • Docs: langchain.md (grammar, semantics, bounds, the invoice example and the exact corrective message), security.md (sandboxed evaluator, closed vocabulary, fuzz targets), security-review.md.

  • End-to-end proof: ExpressionGuardrailIT runs a real agent against a WireMock fake OpenAI endpoint: pass (also from a code fence), fail then repair (the second request carries the fixed frame around the author's fix and no computed value), exhausted reprompt and block/warn actions, non-JSON, duplicate-key and null-operand answers under both failModes, exact decimal arithmetic (0.1 + 0.2 == 0.3, a one-cent difference caught), and deploy refusal for a syntax error, an over-long or over-deep expression, sandbox escapes and a bad issue code or fix.

Design decisions

  • A new evaluator, not ExpressionProvider (plan §9.1): that is the NLP expression grammar, with no arithmetic or paths into JSON. PathNavigator has only +/- on path values, no comparisons, logic or aggregates.

  • Could not decide is the safe default for anything ambiguous. A missing amount inside sum(...) is not skipped, comparing a number with a string is not false: both are undecided, so a reprompt/block guardrail withholds the answer (fail closed) unless the author set failMode: open.

  • Closed vocabulary: nothing read or computed from the answer — not the sum, not the total — reaches the corrective message. Only the issue code (author-declared, pattern-checked) reaches the audit reason.

  • Duplicate keys are unparseable, so the check and a downstream reader of convertToObject cannot see two different totals.

  • No new meter; eddi.guardrail.triggered counts the action as for every type.

Manager and operator

  • The guardrail editor offers expression on the output side (guardrails.ts: type list, phases, no-rewrite set, list-row summary ISSUE · expr, type text). Its sheet has fields for expr, issue and fix, and expressionProblems() mirrors validate()'s refusals (required, length caps, the issue-code pattern) as warnings; the expression's syntax is left to the server, which names the position at deploy. 16 new llmEditor.grExpr*/grTypeExpression* keys in all 11 locales. Tests: guardrails-expression.test.ts and an expression block in task-guardrails-section.test.tsx.

  • The Platform Operator's prompt explains the type (parameters, the language, null rules, the reasons, closed-vocabulary feedback, deploy refusals with a position); operator-revision.json 36 → 37. #1121 also takes 37, so whichever merges second re-bumps.

Next

  • When #1121 lands, expression can use onExhausted: deliver-best like any reprompting type, and its HINT_HEADER/HINT_FOOTER can be shared with the judge's (same wording today).


✨ feat(llm): judge guardrail and onExhausted: deliver-best — evaluated generation E1a + E1b (2026-10-24)

Repo: EDDI (feat/llm-judge-guardrail) — item E1 (E1a and E1b; not E1c) of the evaluated-generation plan.

What changed and why

A well-formed but wrong answer passed every output guardrail EDDI had: the built-ins check shape and patterns, the classifier checks safety. E1a adds a check on meaning whose feedback says what to fix; E1b lets a quality check that cannot be satisfied deliver its best attempt instead of a block message.

  • GuardrailModelClient (modules/llm/guardrails/impl, package-private) — the classifier's model-call machinery, extracted rather than forked: ChatModelRegistry provider build with parameter pass-through (vault and ${vars} resolved by the registry), timeoutMs capped at 60 s and bounded by the turn deadline, the virtual-thread executor, promptTemplate rendering with the screened text as data only ({input}, {output}, {context}), includeRetrievedContext, pricing from inputPricePer1M/outputPricePer1M, the unavailable/unparseable mapping (provider messages never propagated) and the per-call timer. ClassifierGuardrail now delegates to it; its behaviour, reasons, metric and test surface are unchanged (all 54 of its tests pass untouched). Each type passes its timer as () -> Timer.builder(METRIC_DURATION) so MonitoringSeries still finds the meter where it is named.

  • JudgeGuardrail (judge, output only, screensHistory() false) — parameters provider, promptTemplate and issues (a JSON object of issue code → author fix text; 1–20 codes matching [A-Z][A-Z0-9_]{0,39}, fix text non-blank and ≤ 1000 chars, duplicate codes refused), plus the shared ones and a per-guardrail jsonResponseFormat override. After the rendered template EDDI appends a fixed instruction listing the codes and the reply shape {"issues": [...]}. The request carries a JSON response format per request through JsonResponseFormatPolicy — with the codes as an enum schema where the provider enforces one — never baked into the cached model. The reply is read with ModelOutputParser (fence, prose around the object), codes matched case-insensitively. Only a parsed empty list passes; any other shape or an undeclared code is judge_unparseable, an unreachable or slow judge judge_unavailable — failMode applies.

  • Closed-vocabulary feedback. A finding is a VIOLATION with reason judge_failed:<CODE>[,<CODE>…] (declaration order) and a reprompt hint made of EDDI's frame and the author's fix texts for those codes only. GuardrailService.correctiveMessage is untouched, so its invariant — never the user's or the model's text — now also holds for judge output.

  • GuardrailVerdict.issues — a sixth record component (the 5-argument constructor stays), plus GuardrailVerdict.issues(...) and severity() (0 = nothing found, the code count for a grading guardrail, 1 for any other finding).

  • GuardrailConfig.onExhausted — block (default; also when unset) or deliver-best, plus deliversBest() (not a bean getter, never serialized). In GuardrailService.runOutput, a deliver-best reprompt guardrail records every attempt it rates; when it may not reprompt again (retries spent, no reprompter, or a reprompt that cannot start) the attempt with the lowest severity is delivered — ties to the later attempt, so a binary guardrail delivers the last — with a warn outcome, reason <reason>:delivered_best, retryCount = reprompts sent. That attempt is then re-screened by the output guardrails after the exhausted one, with no further reprompts — the ones before it already screened that attempt in the pass that rated it, so each guardrail sees it once and a model-backed one is called once: redact still rewrites, warn still records, block and reprompt findings block. The re-screen's outcomes are held back until it ends, so the :delivered_best warn is recorded only for an attempt that was actually delivered; a blocked one leaves the re-screen's records and the block, each counted once. A guardrail that could not decide is not "exhausted": its failMode applies as before. Because this lives in runOutput, it covers every mode output guardrails run in — plain, streaming (buffered), tool loop, cascade, HITL resume — and audit records, the ledger, SSE guardrail_triggered and eddi.guardrail.triggered stay on the one emit path.

  • Deploy time. GuardrailService.validate refuses an unknown onExhausted, deliver-best on any action but reprompt, and deliver-best on input guardrails; JudgeGuardrail.validate refuses a missing provider/promptTemplate/issues and a malformed issues. New GuardrailService.warnings / ContentGuardrail.warnings (default none) are logged by LlmTask.validateGuardrails: deliver-best on a classifier, an unpriced judge, and a judge on the task's own provider and model (self-judging bias) — risks the plan's §8 lists.

  • Metric: timer eddi.guardrail.judge.duration{provider, outcome} (pass, fail, unparseable, unavailable, timeout), mirroring the classifier's, with a panel on the Full Metrics dashboard next to it; eddi.guardrail.triggered counts the actions as before.

  • Docs: langchain.md (type row, onExhausted field row, the judge subsection, When the retries run out), security.md (closed vocabulary; a quality check never overrides a safety check), metrics.md.

Design decisions

  • Deviations from the plan, and why. (1) onExhausted: "block" is accepted on any action (it is the default and changes nothing); only deliver-best is refused outside reprompt, and also on input guardrails, where a reprompt blocks. (2) deliver-best also applies when no reprompt can run at all (no reprompter, out of time, open circuit), not only when maxRetries is spent — in each case the guardrail has nothing further to try. (3) An attempt the guardrail passed but another guardrail later sent back is still a candidate with severity 0; if chosen, the re-screen decides. (4) A per-guardrail jsonResponseFormat parameter was added as the escape hatch for providers the matrix does not know, mirroring the task setting. (5) The judge's default timeoutMs is 5000, not the classifier's 3000: a grading LLM is slower than a safety classifier. (6) The fix texts are also listed in the judge's instruction, so the judge knows what each code means. (7) The prices-missing and self-judging notes from §8 are WARN logs at deploy, not refusals.

  • The judge's free text never travels. Extra keys in the reply object are ignored, never forwarded; only declared codes are kept, mapped to their declared spelling.

  • Unusable issues at run time (a config that bypassed deploy validation) is judge_unavailable, before any model call.

Manager

  • The guardrail editor offers judge on the output side (guardrails.ts: type list, phases, no-rewrite set, row summary, type text) with its own settings panel: provider, base URL, model and API key (shared with the classifier panel through a new ModelCallFields, so both write the provider's own model and credential keys), the required prompt template, an issue-code editor (rows of code + fix text, written back as the issues JSON string; codes upper-cased; a stored value that is not an object of strings is shown raw rather than rewritten; duplicates stay visible and are reported), timeout (default 5000) and prices (shared CallLimitFields), retrieved context, and warnings mirroring the deploy checks (missing provider, template or codes, malformed codes, unpriced judge).

  • onExhausted is a select under Max retries on an output reprompt guardrail: block is stored as absent, deliver-best as set, and switching the action away from reprompt drops it (as it drops maxRetries). deliver-best on a classifier shows the same warning the deploy logs.

  • 28 new llmEditor.* keys in all 11 locales. Tests: task-guardrails-section.test.tsx (+11) and guardrails-judge.test.ts (5).

Platform Operator

  • system-prompt.ts: the guardrail bullet lists judge and onExhausted (what deliver-best delivers, that it is re-screened, what the deploy refuses and warns about); a new judge bullet covers its parameters, the issues format, the closed-vocabulary reprompt, the could-not-decide reasons and failMode, cost and the timer, and the self-judging note; the docs pointer names the new topics. No allow-list change: the operator already edits LLM configs through PATCH. operator-revision.json 36 → 37.

Tests and checks

JudgeGuardrailTest (47: parsing — fenced, prose-wrapped, undeclared codes, wrong shapes, oversized replies; closed-vocabulary hint and corrective message; template data; native schema enum, provider matrix and override; parameter pass-through; cost; unavailable/timeout/deadline; failMode both ways; validate bounds; warnings), GuardrailServiceDeliverBestTest (13: selection, ties, default block, re-screen with redaction, block and reprompt, deploy refusals and the classifier warning), LlmTaskGuardrailsTest (+5: acceptance reprompt with the author's fix text and judge cost in audit:cost; deliver-best in plain chat with PII redaction, SSE and audit records; tool loop; cascade; configure refusals), GuardrailConfigDeserializationTest (+1). Mutation-checked: free judge text in the hint, an undeclared code accepted, a missing issues field read as a pass, the re-screen removed, and a reprompt finding let through the re-screen — each fails the suite.

  • End-to-end: JudgeGuardrailIT (9, Mongo) runs a real agent against a WireMock OpenAI endpoint that plays both the task model and the judge (told apart by the request's model): a pass (judge reply in a code fence), fail-then-repair (the second task-model request carries only the author's fix text for the found code, never the judge's free text; call counts per model asserted), exhaustion with deliver-best (fewest codes wins) and with the default block, and bad judge output (unparseable reply, undeclared code, HTTP 500) under failMode closed and open. Outcomes are read back through the conversation REST API and the audit ledger.

  • Review fix (docs): deliver-best is re-screened only by the guardrails after the exhausted one, so on a classifier it delivers what that classifier flagged. docs/security.md, docs/langchain.md and the operator prompt no longer claim a classifier is never bypassed; a safety classifier should keep onExhausted: "block". Operator revision stays 37, fingerprint updated.

  • Merge with main (#1130, history-replay protection). Conflicts in GuardrailService (both sides added methods next to validate: this branch's onExhaustedProblem/warnings, main's anySkipsHistory — all kept), LlmTaskGuardrailsTest (an import) and operator-revision.json. Two semantic fixes the auto-merge did not show: #1130 taught runOutput to act on a fail-open guardrail's partial finding (GuardrailUndecidedException.partialFinding), and the deliver-best re-screen now does the same, so a pattern list that timed out part-way still applies its rewrite to the delivered attempt (GuardrailServiceDeliverBestTest.partialFindingStillApplies); and ClassifierGuardrail lost its last TimeUnit use to #1130's RegexDeadline switch, so the import went. The operator prompt keeps both sides' additions; operator-revision.json 37 → 38.


feat(manager): Feedback page, rating triage and rating controls (2026-10-24)

Repo: EDDI (feat/conversation-ratings) — PR 3 of planning/conversation-rating-plan.md (§8 and §0.1 "Admin — triage")

What changed and why

The people running an agent can now see and triage what people said about it, in the Manager.

  • Feedback page pages/feedback.tsx at /manage/feedback (route registry, sidebar, SCREEN_ROLES admin+editor). "Needs attention" first (NEW ratings that are low or commented, newest first) with per-row Mark reviewed / Reopen, internal note (≤ 2000), Open conversation (only when canOpenTranscript) and bulk review; "All ratings" with URL-synced filters, KPI tiles against the previous period, trend, distribution, top reasons, a by-version table greying buckets under 10 ratings, CSV export honouring X-Ratings-Truncated. A non-administrator is asked to pick an agent instead of hitting AGENT_ID_REQUIRED; a 409 RATING_CHANGED reloads and says so. Components under components/feedback/.

  • Attention badge on the sidebar entry and a dashboard tile, administrators only, sharing one ratingKeys.attention query polled every 30 s.

  • Agent editor: rating-config-section.tsx for every ratingConfig field; lib/rating-config.ts mirrors RatingConfigValidator and the page refuses to save invalid values. Agent detail gets a 30-day feedback strip; conversation detail shows the conversation rating, review status and per-step reply thumbs.

  • Manager chat gets the Chat UI's rating controls (chat-rating.tsx, use-chat-ratings.ts, chat-rating-steps.ts); snapshot messages now carry stepIndex.

  • API/hooks: lib/api/ratings.ts, hooks/use-ratings.ts, ratingKeys in query-keys.ts. ApiClientError now carries the code of an {error, message} body (with tests), so callers branch on AGENT_ID_REQUIRED / RATING_CHANGED / RATING_WINDOW_CLOSED rather than on translated text.

  • Backend: the /ratings endpoints take conversationId (filter + both stores + tests), so the conversation view does not list everything.

  • MSW: test/mocks/rating-handlers.ts with an in-memory store shaped like RatingRow; e2e spec e2e/feedback.spec.ts. i18n: 146 keys in all 11 locales.

Design decisions

  • No chart library is added: the trend and distribution are plain markup in the house style (as the Workforce analytics are), with numbers in text for screen readers. KPI tiles reuse StatCard.

  • Bulk review of a selection PATCHes row by row (each conditional on the rating not having changed); "mark everything here" uses POST /ratings/review with the same filter.

  • The CSV download uses raw fetch (blob body and a response header to read) with api.getAuthHeader(), like backup.ts.

  • The Manager chat offers the card after End conversation (when askOnEnd) because it does not track the ENDED state otherwise; prompted-once state is per page, not persisted.

Not done here

The Playwright spec could not run locally (the installed Chromium build is older than the one Playwright 1.64 expects); CI's UI Manager E2E (MSW) runs it. MCP tools and the Platform Operator are PR 4, alerts PR 5.


feat(ratings): MCP rating tools and Platform Operator read access (2026-10-24)

Repo: EDDI (feat/conversation-ratings) — PR 4 of planning/conversation-rating-plan.md

What changed and why

Ratings can now be read and triaged from an MCP client, and the Platform Operator can answer questions about them.

  • MCP — McpRatingTools: list_conversation_ratings (every /ratings filter incl. needsAttention, reviewStatus, conversationId; sort, index, limit), summarize_conversation_ratings (groupBy), count_ratings_needing_attention and review_conversation_rating (REVIEWED / NEW and a note). Registered in McpToolFilter; 89 → 93 tools, 292 arguments of which 128 are required.

  • Operator — tool-scopes.ts allow-lists GET /ratings, GET /ratings/summary and GET /ratings/attention-count; system-prompt.ts gains a ratings section (what a rating holds, ratingConfig and its defaults, needs-attention, AGENT_ID_REQUIRED, how to answer "how is agent X rated since version N"), gated on a new grantsRatingReads predicate. Operator revision 39 (37 when written; main had meanwhile claimed 37 too, so the merge made it 38, and clarifying the date-only to in the prompt made it 39).

  • Docs — MCP Server (section, count, Author tier row), Conversation Ratings, and a "Feedback from users" section in the eddi-admin Claude Code skill.

Design decisions

  • Access is the REST rule, run for the MCP caller. The tools inject the in-process IRestConversationRatingAdmin bean — the pattern McpAdminTools uses with IRestAgentAdministration — not the loopback REST client, which sends no credentials (401 with authorization on, no scoping with it off). That bean's ResourceAccessGuard and ConversationAccessGuard read the request's SecurityIdentity, i.e. the MCP caller: admin sees everything, an editor names an agent it holds EDIT on, userId for admins only, canOpenTranscript as on REST. Nothing is re-implemented, so MCP cannot drift from the Feedback page.

  • Tier McpRoles.AUTHOR (admin, editor) — equal to the REST @RolesAllowed, pinned by McpRoleTierParityTest (IRestConversationRatingAdmin added to the mirrors). eddi-viewer stays out.

  • Reviewer = the caller's plain principal (callerActor), as on REST — not the HITL tools' mcp:<principal> form — so one person is one reviewer whichever surface they triage from.

  • Errors keep the REST codes as errorCode (AGENT_ID_REQUIRED, RATING_CHANGED, INVALID_PARAMETER, …). A guard refusal (io.quarkus.security.ForbiddenException) is mapped to FORBIDDEN explicitly: left to toolFailure it is not "caller-facing" and would surface as INTERNAL.

  • No writes for the operator. PATCH /ratings/{ratingId} and POST /ratings/review record the caller as the person who looked at the feedback, and a bulk review empties the queue in one call — that judgement stays with a human on the Feedback page. GET /ratings/export is a text/csv download of up to 100,000 rows (userIds included for an admin) that no chat answer needs. Both are documented as deliberate exclusions in the allow-list.

  • MCP export and bulk review are left out too; both stay REST and Manager only.

Tests

  • McpRatingToolsTest (13) wires the real RestConversationRatingAdmin with mocked guards and store: role tier, AGENT_ID_REQUIRED, missing EDIT, userId redaction, admin cross-agent listing, grouping and the attention filter, reviewer from identity, NOT_PERMITTED for an agentless rating, RATING_CHANGED / RATING_NOT_FOUND, bad requests, non-leaking internal errors. Mutation-checked: 8 of 8 mutants killed by a test failure (role tier widened, role gate dropped, guard refusal not mapped to FORBIDDEN, agentId / needsAttention / conversationId not forwarded, REST code lost, empty review accepted).

  • McpRoleTierParityTest, McpToolContractTest, McpToolFilterCoverageTest and SkillToolReferencesTest updated (ratingConfig, canOpenTranscript exempted as config/result fields).

  • Manager: operator tool-scopes and system-prompt tests for the grant, the excluded writes/export and the gated section.


✨ feat(httpcalls): forEach — one call per element, every result collected (2026-10-24)

Repo: EDDI (feat/step-checks-foreach) — item E5 part A of the evaluated-generation plan

What changed and why

preRequest.batchRequests only works with fireAndForget, so a call that needed one request per element of an array threw every response away. An httpcall now takes an optional forEach block that sends the call once per element and stores what each element produced — index, ok, httpCode, body or error, timedOut, sent, attempts, bodyDropped — as one array under responseObjectName, in source order whatever order the items finished in. postResponse runs once with 200 when every item succeeded and 207 (Multi-Status) when any failed, so property instructions gated on the default codes only see complete results unless the author opts in.

  • New field, not an extension of batchRequests. A stored config with batchRequests on a call that waits for its response sends exactly one request today; reusing the field would have turned it into N requests silently. Without forEach nothing changes, and forEach is refused (400) together with fireAndForget or batchRequests.

  • Bounded four ways. maxItems (the batch default 100 and ceiling 1000, refused as a whole before anything is sent), maxConcurrency (default 1 — the load the same calls written one after another would send; at most 16, on virtual threads), the turn deadline per item (an item whose turn comes after it is not sent), and memory: each body is capped by maxResponseSizeInBytes and all of them together by maxTotalResponseSizeInBytes (default the same value, so the array gets what one response would).

  • Never abandon paid work. A failing item never cancels its siblings; the pool is shut down, never interrupted; onItemFailure: "fail" fails the step only after every item finished and the results are stored. When the step stops waiting, queued items are not started at all, so nothing is sent whose result nobody collects.

  • A request that threw is never retried — a timeout above all, since the API may have processed (and billed) it. retryApiCallInstruction still applies per item to responses.

  • Security unchanged. Every item's request is built on the turn's thread by the same buildRequest a single call uses (templating, vault/connection/caller resolution, SSRF check, approval scope); only sending is parallel. The element is bound as template data, never template source. A forEach call is unpinnable for HITL fingerprints, like a fire-and-forget batch.

  • Seams left for parallel work. BoundedFanOut.Admission is asked before each item starts and told when it finished — where the per-conversation cost reservation (E4) plugs in. The fan-out runner is generic, so mcpcalls can reuse it. The deploy-time turn-budget warning counts a forEach call once per round.

Files: ForEachInstruction.java, ApiCall.java, ApiCallExecutor.java, ForEachItems.java, ForEachItemResult.java, BoundedFanOut.java, ApiCallsConfigurationValidator.java, RestApiCallsStore.java, TurnResilienceWarnings.java, docs/httpcalls.md (also drops a duplicated "Turn deadline" section), the Platform Operator prompt and revision.

What's next

Part B of E5 — checks on httpcall and mcpcall results, reusing the output guardrail types — and forEach on mcpcalls are not in this change; the plan is in the PR description.

End-to-end proof

ForEachHttpCallsIT drives a deployed agent over REST against WireMock: one request per element (templated into path and body, source order, read back from the stored conversation), a filter leaving index gaps, maxItems refusing the whole call before anything is sent, the total-size budget counting UTF-8 bytes of a non-ASCII payload, an empty list sending nothing, a 500 and a timeout not stopping or being retried, 207 gating of postResponse, onItemFailure: "fail" running every item first, and the concurrency bound (1 by default, 2 when configured) observed from WireMock's arrival times.


✨ feat(hitl,groups): humans and groups produce verdicts — revise with the note, rework within a run, stop on a verdict (2026-10-24)

Repo: EDDI (feat/verdict-rework) — item E2 of planning/evaluated-generation-plan.md.

What changed and why

Three places where a check already ran but its verdict could not repair anything now can, each off by default.

1. Single-agent HITL: hitlConfig.onRejection: "REVISE" (decision 9.5: a hitlConfig policy, not a new verdict value). Under the default SKIP a rejected rule pause skips the remaining tasks, as before. Under REVISE, a rejection with a human's note has the same model revise the answer it gave before the pause: one tool-less re-ask over the frozen request that produced the draft (system prompt, history, retrieved context, tool results), the draft as the assistant turn and the note as the user turn, then the pipeline continues from the task after the model's, so a rule that paused on the draft pauses again on the revision. maxRevisionsPerTurn (1..10, default 3) bounds it.

  • Scope: behavior-rule (RULE) pauses only. A rejected tool call (TOOL_CALL) is a rejected action, not a rejected answer, and already reaches the model as a tool result with the note; it is unchanged. A rejection without a note, an automated one (system:*), a Slack button (its note is its own attribution), a pause before any answer, an answer from a later task or workflow, an over-cap request, a spend refusal, a model failure, a failed responseValidation or a guardrail block all fall back to SKIP, and hitl:revision:outcome records which.

  • The note is data: concatenated into the user message, never template source. The revision passes responseValidation and the output guardrails and asks the spend gate first; its tokens and cost are recorded like any answer's.

  • The candidate (HitlRevisionCandidate) is recorded by LlmTask only while the policy is on, stamped with its pipeline position by LifecycleManager, and persisted by the RULE pause as step data hitl:revision:candidate — so it travels through both stores unchanged, is scrubbed of secret input and context with the step, is withheld from returnDetailed and from the approver's full snapshot, and is removed when the pause is decided. Cap eddi.hitl.revision.transcript-max-bytes (256 KB). The round count rides on the candidate, so the bound holds across re-pauses and reloads.

  • New seam: IAnswerRevisingTask (implemented by LlmTask) and ILifecycleManager.reviseAnswerAt, which runs one task's revision with its audit entry and converts a later task's gated tool call into a TOOL_CALL pause. Output that the draft and the tasks after it wrote is cut back before they run again.

  • Records: hitl.approval carries onRejection: REVISE; meter eddi_hitl_revision_total{outcome}.

2. TASK_FORCE maxReworks (group field, 0..5, default 0). A task that fails VERIFY returns to ASSIGNED with the verifier's feedback (SharedTaskList.reworkTask, the same transition and feedback channel as onTaskRejection: RETRY), the nearest EXECUTE phase runs it again inside the VERIFY phase and VERIFY checks it again, up to maxReworks times per task. Stopped by maxTurns (a round needs one turn per task plus the verifier's) and the cost ceiling; a rework that could not run ends FAILED, never stranded. Not applied when EXECUTE gates tasks for human approval. Counts persist in taskList.reworkCounts (additive, no schema bump: an older pod re-saving drops them, which fails soft). An unparseable verdict keeps the fail-open auto-verify but is now warned and counted (eddi_group_verify_unparseable_total); reworks are eddi_group_task_reworks_total.

3. convergence.mode: "VERDICT" on a repeating phase. The moderator reviews the latest repeat against the question and the phase ends once it passes ({"passed": true} as a JSON boolean; anything else keeps it going). threshold is unused and minRepeats may be 1. "SIMILARITY" stays the default, and an unknown mode is a save-time 400.

Compatibility: stored agent and group configs load and behave identically — onRejection absent is SKIP and captures nothing, maxReworks absent is 0, convergence.mode absent is SIMILARITY with the old minRepeats floor. Old pods ignore the new fields (FAIL_ON_UNKNOWN_PROPERTIES is off). The approval API (REST /resume, MCP resume_conversation, Slack buttons, Manager approvals) is unchanged in shape.

Manager: the agent HITL section gains "When a reviewer rejects" and "Revisions per turn"; the phase editor gains a convergence "Stop when" select (VERDICT hides the threshold, floor 1); Task force settings gain "Reworks after a failed verification". All 11 locales. Platform Operator: a cheatsheet entry for the three settings; revision 36 → 37. Four other open branches (E1c, E4, E5, #1121) also bump operator-revision.json, so whichever lands second must re-bump and refresh the fingerprint.

Docs: hitl.md (new "Revise with the reviewer's note"), group-conversations.md (rework within a run, convergence.mode), llm-resilience.md, metrics.md, configuration-reference.md; three dashboard panels, synced to the Kubernetes copy.

Verification

New tests: LlmTaskHitlRevisionTest, ConversationHitlRevisionTest (including a resume after a JSON and a BSON round trip of the paused snapshot), LifecycleManagerRevisionTest, HitlRejectionPolicyConfigTest, TaskForceEngineReworkTest, ConvergenceVerdictModeTest, plus Manager tests for the three editors. Nine mutants (revision bound, default policy, note requirement, automated decisions, per-task rework bound, maxReworks default, rework turn budget, convergence default mode, boolean-only verdict) are each killed.

  • End-to-end ITs on MongoDB and PostgreSQL (HitlRevisionIT, GroupVerdictIT and their postgres/ twins), with WireMock as the model: a rejection with a note revises over the frozen request (the note and the draft reach the model, the candidate and its round count survive the store across both pauses, approval delivers the revision only), no_note and exhausted skip; VERDICT convergence stops on a JSON "passed": true while prose, a string "true" or a failing judge run every repeat, and an unknown mode is a 400; TASK_FORCE maxReworks sends a failed task back with the verifier's feedback and persists taskList.reworkCounts. Not persisting the candidate, dropping the rework feedback and never passing a verdict each fail them.

  • Fix — the raw read leaked the frozen request. GET /conversationstore/conversations/{id} (the owner's and the Platform Operator's raw read) served the paused step's hitl:revision:candidate whole, so its transcriptJson — the compiled system prompt and every tool result — reached anyone allowed to read the conversation, in result and again in the possibleResults copy. ConversationMemoryUtilities.redactRawPendingToolCallsForRead, already the raw surface's single redaction point for the tool-call batch, now also withholds the candidate's frozen input (REVISION_CANDIDATE_FROZEN_INPUT_FIELDS) on every step and the redo cache, keeping the draft and bookkeeping. The other surfaces were already safe: returnDetailed (REST, MCP read_conversation, the Manager's inspector and the /simple read) drops the key, approval-status?detail=full (REST and MCP) removes the candidate, and the GDPR export carries only conversationOutputs. ConversationMemoryUtilitiesRevisionRedactionTest; HitlRevisionIT asserts no candidate entry carries the transcript or the system prompt while the revision request still carries it. Not changed, and older than E2: the raw read still serves audit:compiled_prompt, the LLM task's own audit step data (written on every answered turn while the audit ledger is on), which holds the same compiled system prompt; the IT pins that this is the only place it appears. Whether the raw read should drop audit:* like returnDetailed does is a separate decision. hitl.md now says hitlDecision reads REJECTED only until the revision is decided.

What's next

The judge machinery of E1 (#1121) could serve as VERIFY's and VERDICT's verdict parser, and the agent-testing harness's LLM-as-judge expectation should reuse it. A failing VERDICT review is recorded but not shown to the members of the next repeat; feeding it back is a follow-up.


📝 docs(planning): white-labeling plan for every UI (2026-10-24)

Repo: EDDI (feat/white-label-ui)

What changed and why

Added planning/white-label-ui-plan.md: an inventory of every place the Manager, the Chat UI, the backend-served pages, the Platform Operator and the Keycloak login theme show the EDDI brand, and a phased design to replace it with an admin-defined brand without a rebuild or restart.

Design decisions

  • The brand is one database document edited on a Manager Settings → Branding page. eddi.branding.* properties seed it, and eddi.branding.locked=true makes them authoritative for GitOps installs.

  • Delivery stays same-origin: fixed /branding/* asset URLs with a bundled fallback, a runtime /branding/__brand__.js plus /branding/brand.css, and serve-time <head> substitution in the HTML shells. The CSP does not change.

  • Technical identifiers (eddi.* properties, X-EDDI-* headers, storage keys, postMessage types) are contracts and are not renamed.

  • "Powered by EDDI" is switchable and on by default. The update check stays opt-in, and its UI is hidden when branded. The docs link is parked.

  • The branding endpoints are deliberately left off the Platform Operator's allow-list.

Next

Phase 1 of the plan, the backend brand store and delivery.


🎨 feat(branding): brand store, admin REST and same-origin delivery — white-label phase 1 (2026-10-24)

Repo: EDDI (feat/white-label-ui)

What changed and why

Phase 1 of the white-labeling plan: the backend brand store and its delivery to every UI. With no brand set, nothing visible changes. The page is White-Labeling.

  • Brand store. configs/branding: one BrandDocument per deployment, behind IBrandingStore. It has a MongoDB BrandingStore (collections branding and brandingassets) and a PostgresBrandingStore (tables branding and branding_assets), picked in DataStoreProducers. Images are stored per slot (logo, logoDark, icon, favicon, ogImage, a closed enum); the document holds only their sha256: hashes. Writes are compare-and-set on the revision.

  • BrandingConfig (@ConfigMapping, eddi.branding.*) seeds every field the stored document leaves unset. With locked=true the properties are authoritative.

  • BrandingService is the single entry point (current(BrandRequest)). It resolves locked → document → seed → defaults field by field, and validates writes and the seed with one validator (BrandValidator, BrandAssetValidator); an invalid seed fails startup naming the property. It caches for 30 s with immediate local invalidation, answers 409 on a stale revision or when locked, and writes an INFO audit line.

  • Admin REST IRestBrandingAdmin at /administration/branding (eddi-admin): GET, PUT, DELETE, and PUT/DELETE /assets/{slot}.

  • Public delivery IRestBranding at /branding/* (@PermitAll, hidden from OpenAPI): the five images with a bundled fallback, plus __brand__.js and brand.css. /branding/* joins the static-assets permit list and the micrometer path patterns.

  • Head substitution. The five shells (manage, welcome, workforce, chat, root index.html) carry %BRAND_PRODUCT_NAME%, %BRAND_TAGLINE% and %BRAND_THEME_COLOR%, /branding/* favicons, the brand script and the brand stylesheet. BrandedShellRenderer fills them in, HTML-escaped and cached per (shell, revision), for the four shell resources. BrandedShellRoute, a Vert.x route, does the same for the static /, /index.html and /<shell>.html paths.

  • One JS-string escaper, JsGlobalScript. __auth_config__.js and /chat/__config__.js moved onto it with byte-identical output.

  • Dev server. scripts/vite-plugin-brand.mjs in both UIs fills the defaults and serves /branding/* under npm run dev and MSW mode. A test in each UI runs a real vite build over the real shells and checks that the placeholders survive and that brand.css comes after the bundle's stylesheet. The MSW passthrough list gained */branding/*.

  • Docs: docs/white-labeling.md, a White-labeling section in configuration-reference.md, and SUMMARY.md. ConfigurationReferenceCoverageTest now reads @ConfigMapping interfaces, so mapped properties are held to the same documented-and-real rule as @ConfigProperty ones. ReservedPrincipalsTest classifies sha256: (the image hash) as a non-principal prefix.

  • Verified through the persistence boundary. BrandingStoreMongoIT and BrandingStorePostgresIT share one contract (BrandingStoreContract). Their first run found isEmpty() serialized as an "empty" property that the reader then refused, so every stored brand was unreadable; BrandingJsonTest now pins the round trip without Docker.

Design decisions

  • Field-wise merge, and a monotonic revision. A null in the document means "the seed's value, else EDDI's". Reset writes an empty document under the next revision rather than deleting it, so caches keyed on the revision can never serve a stale page.

  • brand.css is linked as the first child of <body>, not in <head>. Vite injects the bundle's stylesheet at the end of <head>, so a <head> link would come first and lose to the bundle's .dark block. The build test pins the order.

  • Per-shell default taglines (BrandedShell) keep every unbranded description byte-identical. The welcome and chat descriptions differed before branding existed.

  • /branding/favicon.ico for the chat shell, which already used an ICO. The favicon falls back to the icon, and the dark logo and og-image fall back to the logo, so a brand with only a logo and an icon leaves no EDDI image behind.

  • The SVG filter is stricter than the plan. On top of <script>, <foreignObject>, on…=, javascript: and external href, it refuses namespace-prefixed elements, <animate>/<set>, entity declarations, character references (which would hide javascript: from a text check), @import and external CSS url().

  • brand.css also sets --color-sidebar-accent-foreground, so the sidebar accent keeps the brand's contrast pair.

  • Not on the Platform Operator's allow-list (plan R9). openapi-operations.json gains the five admin operations.

What's next

Phases 2–7 of the plan, starting with the Manager token cleanup.


🐛 fix(agent-tests): mocked httpcall tools keep their postResponse, runs can be cancelled, replicas stop aborting each other's runs (2026-10-24)

Repo: EDDI (fix/agent-tests-fidelity)

Review follow-ups to the agent regression harness (PR #1065).

What changed and why

  • An httpcall mocked on the LLM tool path now runs its response handling. ToolLoopRunner answered every mocked LLM tool call itself, before any executor, so for an httpcall tool saveResponse, retries and postResponse property instructions never ran: an agent that sets a property from a tool's response behaved differently mocked than live, and its properties expectations failed. The call is still decided and recorded once in ToolLoopRunner (ToolMockRegistry.decideToolCall); a MOCKED decision for an executor that implements the new MockAwareToolExecutor (the httpcall tools of HttpCallToolsProvider) is handed to it, and ApiCallExecutor answers the call with it — no request built — exactly as it already did for a rule-triggered call. Refusals (unmocked, fail-closed) and every other tool source short-circuit as before. A mocked call is uncached and unpriced.

  • A retried mocked call is recorded once. ApiCallExecutor intercepted inside the retry loop, so each retry was recorded again and counted against maxToolCalls (and a retried unmocked call produced several unmockedTool failures). The decision is made once per call, as a retried live call is one call.

  • Cancel. POST /agenttests/runs/{runId}/cancel and the MCP tool cancel_agent_test_run (author tier, EDIT on the agent — what starting one takes) stop a run cooperatively: no further turn starts, a waiting turn is abandoned, its conversations are ended and deleted, and the run ends with the new status CANCELLED. Before, a run of up to 2,000 turns × 900 s held one of two run slots until the node restarted. Manager: a Cancel run button on a running run, the CANCELLED badge and notice (11 locales).

  • Orphan recovery is owner- and heartbeat-aware. At startup every RUNNING run was marked ABORTED and its conversations deleted — wrong when several replicas share one database without cluster mode. A run now records ownerNode (<nodeId>/<bootId>) and refreshes heartbeatAt every 30 s; a node aborts only a run of an earlier boot of itself or one whose heartbeat is older than three minutes, at startup and every three minutes.

  • Capacity before the deploy. AgentTestService checked the run slots after deploying the version to test, so a request refused with 429 had already changed what the test environment serves.

  • Reserved test user ids. A conversation started from outside as agent-test:<liveRunId>:c:r joined that run's mock session and wrote into its results. OwnershipValidator.validateAndResolveUserId now refuses any requested user id in that namespace (403), for an admin and with authorization off too.

  • A permanent delete removes memory checkpoints. ConversationPurgeService.purge (every permanent conversation delete, not only test runs) left the checkpoints the tool loop writes before every tool call; only GDPR erasure removed them.

  • PostgreSQL IT and a two-turn case. PostgresAgentTestSuiteIT runs the harness IT against PostgreSQL; AgentTestSuiteIT gained a two-turn case.

  • Docs. agent-testing.md: the Manager page is shipped (not a follow-up), the "a mocked httpcall is still built" limitation was wrong and is replaced, cancel and the liveness rules are documented, and test conversations are noted to appear in listings and metrics while a run is in progress.

Design decisions

  • The mock rides into ApiCallExecutor in the template data (ToolMockRegistry.TOOL_PATH_MOCK), next to the existing TOOL_PATH_MARKER, rather than through a ThreadLocal: the executor runs on the tool-timeout thread.

  • Cancel is node-local. A cancel arriving at another replica answers 409 naming the owner; a cross-node flag would race the heartbeat's whole-document writes.

  • A run recorded before 6.6 (no owner, no heartbeat) counts from its startedAt.

Files: ToolLoopRunner.java, MockAwareToolExecutor.java, HttpCallToolsProvider.java, ApiCallExecutor.java, ToolMockRegistry.java, AgentTestRunner.java, AgentTestService.java, AgentTestRunRecovery.java, ConversationPurgeService.java, OwnershipValidator.java, agent-testing.md


🐛 fix(agent-tests): review follow-ups — skew-proof orphan detection, CAS heartbeats, reserved ids at schedules (2026-10-24)

Repo: EDDI (fix/agent-tests-fidelity)

What changed and why

  • Recovery can no longer abort a live run. Staleness compared another node's heartbeatAt with the local clock (clock skew or a short write outage aborted a live run and deleted its conversations), and the "earlier boot of this node" rule needed no heartbeat at all — two EDDI processes on one host share a host-derived node id and aborted each other's runs. Now a run is an orphan only when its heartbeat has not changed across this node's own sweeps for 3 minutes (90 s for the same node id, another boot), timed on the observer's monotonic clock; the sweep runs every minute.

  • Heartbeat, abort and final write are compare-and-swaps on heartbeatAt (IAgentTestRunStore.updateIfHeartbeat, storeIfFieldEquals). An abort clears the heartbeat; the owner's next beat then fails, and the owner stops the run and writes nothing back — the record no longer flips from ABORTED to RUNNING.

  • Abandoned turns. A turn given up on (timeout or cancel) can finish after its conversation was deleted; once it completes, the conversation is deleted again.

  • Tool calls are recorded after the loop's gates. A mocked httpcall tool (or a live call) refused by the tool budget, tenant quota or turn deadline no longer counts as a call (ToolMockRegistry.previewToolCall / recordToolCall).

  • Reserved agent-test: ids are also refused at REST schedule save and at every schedule fire — including a persistent schedule that reuses its stored conversation and a Dream consolidation fire, which never start one — and OwnershipValidator checks the resolved id as well as the requested one.

  • A non-MockResult under the tool-path mock key never mocks: the call is treated as undecided — refused in a test conversation, sent in any other.

  • Permanent delete removes HITL tool-journal entries too, as GDPR erasure does.

  • Platform Operator may cancel a run (POST /agenttests/runs/{runId}/cancel, gated) and knows the terminal statuses; revision 37.

  • i18n: ABORTED is "interrupted" in de, es, pt, hi, th and ar, so it no longer reads the same as CANCELLED.

Files: AgentTestRunRecovery.java, AgentTestRunner.java, AgentTestRunStore.java, ToolLoopRunner.java, ScheduleFireExecutor.java, ConversationPurgeService.java, agent-testing.md


🐛 fix(tenancy): the cost gates fail closed on both datastores, and undo no longer refunds spend (2026-10-24)

Repo: EDDI (fix/cost-gate-consistency)

What changed and why

Follow-ups to the tenant monthly cost budget and the per-conversation cost ceiling.

  • The pre-call cost gate answered a store outage differently per backend. PostgresTenantQuotaStore.getMonthlyCost caught the SQLException and returned 0.0, so the gate read "nothing spent" and allowed every model and tool call (fail open). MongoTenantQuotaStore.getMonthlyCost did not catch the MongoException, and LlmTask asks LlmSpendGate outside its guarded model phase, so the turn failed instead of serving the fallback answer. tenant-quotas.md promised fail closed. Both stores now raise QuotaAccountingUnavailableException, as their getQuota already did (ITenantQuotaStore documents the contract), and TenantQuotaService.checkCostBudget turns it into a refusal flagged accountingUnavailable, counted on eddi.tenant.quota.unavailable{type=cost}. An exception that still escapes the check is a defect, not an outage. LlmSpendGate and the tool-call gate in ToolLoopRunner both refuse it (the fallback answer, a tool error result) under a separate reason, tenant_check_error. It is counted on eddi.llm.spend.refused and logged at ERROR, with the stack trace at most once a minute. It does not pass for an outage on eddi.tenant.quota.unavailable.

  • say → undo → say discarded spend. The ceiling summed audit:cost over the live steps. Undo moved the priced step to the redo cache, and the next say cleared it, so a public /undo reset what a conversation had spent. ConversationMemory.startNextStep() now carries the discarded steps' spend onto the new step as audit:discarded_cost, a new key in MemoryKeys that is persisted with the step. The ceiling counts audit:discarded_cost and the redo cache, which a rerun runs against. The snapshot's conversation total counts both as well, so it no longer drops between an undo and the next say; it is read by the Manager, the group cost ledger, Slack and schedule deltas. Redo leaves the total unchanged, and a rerun already added to the step's own audit:cost.

  • Undo and redo kept the wrong audit:pending_cost. TurnCostMeter reads the owed tenant charge from the newest step that has one, and undo and redo reorder those steps. An undone step's pending charge was lost on the next say. A rerun after an undo re-charged an amount the undone step had already recovered. A rerun's own outage charge was then shadowed by the undone or redone step's older value. Undo and redo now copy the pending value of the step they move aside onto the step that becomes current, 0.0 included. That step always holds the newer of the two values, and both writes are full replaces, so the copy is persisted.

  • Dream charges lost to an outage are carried in DreamService (node-local, in-process) and added to the next priced consolidation charge. The docs say a restart loses it.

  • Manager quotas page. The cost-budget status checked "unlimited" before "enforced", so a disabled tenant with no budget was told its spend was metered, although recordCost records nothing while enforcement is off. Enforcement is checked first, with a new quotas.budgetDisabled message in all 11 locales. Amounts under $1 keep up to four decimals, so $0.006 against a $0.01 cap no longer reads "$0.01 of $0.01 … $0.00 left".

  • TurnCostMeterTest's outage test claimed the marker is left untouched. It advances, as the class documents, and the test now says so and asserts it.

  • ReservedPrincipalsTest (inherited from main) declared the "sha256:" prefix twice, once for brand image hashes and once for mail Message-IDs. Map.ofEntries rejects duplicate keys, so the class failed to initialise. The two entries are now one, whose description covers both uses.

Decisions

  • LlmSpendGate.countMidLoop stays on Metrics.globalRegistry. Its caller, ToolLoopRunner, is not a CDI bean and is built without a registry in AgentOrchestrator and a dozen tests. That is the same idiom as LifecycleManager, and Quarkus adds its registry to the global composite. The Javadoc now says so.

  • The old-JSON round trip for maxCostPerConversationUsd already existed (ConversationCostCeilingTest.storedConfigCompatibility), so no test was added for it.

  • Not added: an IT of the full deployment path, from a priced model through ConversationService to a refused tool call. The existing IT scaffolding has no priced model to drive through the service. The store-level halves are covered for both datastores in TenantCostMeteringIT: a monthly-cost read that fails at the gate, and say → undo → say persisted through the real conversation store.

Docs: tenant-quotas.md, langchain.md, metrics.md.


🔒 fix(guardrails): a blocked message no longer reaches the model on the next turn (2026-10-24)

Repo: EDDI (fix/guardrail-history-replay)

What changed and why

Review of the input/output guardrails (#1064, #1112) found that a message the classifier guardrail blocked was sent to the main model on the following turn. An input block is served as a fallback; the history builder merges a fallback turn's question into the next user message so roles keep alternating; input guardrails treat that merged text as history, and history is only re-screened by guardrails with screensHistory() == true — which the classifier is not (one model call per history message would multiply its cost). So: an injection blocked on turn N, then "hi" on turn N+1, and the model received the injection. The same path undid a classifier redact.

  • A durable marker, not re-screening. When an input guardrail blocks — or redacts with a guardrail that does not re-screen history — LlmTask flags the step llm:input_withheld:<taskId> (MemoryKeys.LLM_INPUT_WITHHELD_PREFIX). ConversationLogGenerator.isInputWithheldStep reads it (and, for steps written before it existed, an audit:guardrail:input:* record with action block). Both history paths (ConversationLogGenerator.generate with skipFallbackOutputs, ConversationHistoryBuilder.generateMessagesFromOutputs) replace that turn's user message — text, extracts and input files — with [earlier message withheld by a guardrail], for every guardrail type. The rolling summarizer's input and the recall tool get the same view through ConversationLogGenerator.modelFacingOutputs. Memory and the human transcript keep the message.

  • Current-turn text is located structurally. AttachmentForwarder appends extract/note text parts behind the typed text, so "the last text part" used to be the extract: a first-pass redaction was not applied to what the model saw, and the classifier screened the extract instead of the typed text. LlmTask now records the typed text's content index before forwarding; GuardrailService.runInput applies the (reused) first-pass result to it and screens each attachment text part after it as this turn's input — recorded, able to block.

  • Bounded author regexes. regex-filter and prompt-injection patterns run through a shared deadline-checking matcher (the classifier labelPattern one, later folded into RegexDeadline) with 250 ms per text; past it the guardrail throws GuardrailUndecidedException("pattern_timeout"), so failMode applies — a block guardrail refuses the text instead of passing it. Both types now validate() their patterns, so an invalid one fails the deploy instead of being dropped (which left a block-only filter that never fires).

  • Spend gate first. The spend gate is asked before the input guardrails and retrieval, so an over-budget turn pays no classifier call or embedding query; every guardrail reprompt asks it again.

  • postResponse after an input block. It now runs, as after every other fallback (output block, spend refusal, onError), so a convertToObject + addToOutput: false task whose postResponse builds the reply answers the user instead of showing nothing — and the docs' claim that the fallbackField shape is what postResponse reads is now true for both sides.

  • History-screening cost is recorded whether or not the guardrail fires.

Review follow-ups

  • A withheld turn's files stay out too. AttachmentContextExtractor.attachmentsFromPreviousTurns skips withheld steps (no re-inlined image, no "files shared earlier" note), and ReadAttachmentTool is built with withheldStorageRefs so listAttachments/readAttachment cannot hand a blocked file's content back as an unscreened tool result.

  • The current turn is not withheld by its own flag — a second LLM task of the same turn decides it with its own guardrails (both history builders skip the last output index).

  • Spend gate asked twice: before the input guardrails and again after them, so a classifier's price cannot carry the model call past a ceiling. A turn refused before screening is flagged withheld when a configured input guardrail does not re-screen history (it was never classified).

  • One regex deadline helper. BoundedRegex is folded into ai.labs.eddi.utils.RegexDeadline (now with a deadline-preserving subSequence and matcher(...)); security.md lists the guardrail patterns' bound. A pattern timeout in a regex-filter keeps what the finished patterns found (GuardrailUndecidedException.partialFinding): failing open, a redact keeps those rewrites and a block that matched still blocks.

  • Docs: template data ({memory.last.input}, {memory.past}, {conversationLog}, captured properties) is not filtered — don't template earlier user input into a guarded task's prompt or httpCall body; a turn on which the guarded task did not run was never classified.

  • Persistence round trip and undo/redo of the flag through the real ConversationMemory (InputWithheldRoundTripTest); the Platform Operator's guardrail paragraph learned the pattern budget, the deploy-time pattern check and the withheld placeholder.

Deferred: a reprompted answer is still not re-run through responseValidation (its re-ask loop does not return to the output guardrails, so wiring the two together is not a small change); documented in langchain.md.

Files: GuardrailService.java, LlmTask.java, ConversationLogGenerator.java, ConversationHistoryBuilder.java, RegexDeadline.java, RegexFilterGuardrail, PromptInjectionGuardrail, PatternCache, ClassifierGuardrail, ConversationSummarizer, ContextualToolsProvider, MemoryKeys; docs langchain.md.


🐛 fix(webhook): the replay-protection cache could evict live keys, was per node, and a few edges leaked or orphaned (2026-10-24)

Repo: EDDI (fix/webhook-dedup-replay)

What changed and why

Review of the signed inbound webhook channel (#1059) found that its de-duplication - the only replay protection of the github and generic-hmac schemes, and a second line for eddi-v1 - was weaker than documented.

  • Dedup cache sizing and admission. webhook-event-dedup had no size entry in CacheFactory, so it inherited the 1,000-entry default and was shared by every webhook integration, each delivery storing up to two keys. About 500 deliveries in ten minutes from any one integration evicted another's keys, after which a captured request ran again. The cache now has its own entry and is rate-sized like the A2A nonce cache (100 keys per second over the 10-minute window, factor-two head-room: 120,000 entries), and the handler refuses instead of evicting (an evicted key is a replayable request, a refused delivery is only a retry), per integration so that one sender cannot push the others out:

    • Each integration has its own budget, platformConfig.maxDeliveriesPerWindow (default 3000 deliveries per 10 minutes, validated 1 to 100000 at save), counted over a rolling window of 11 one-minute buckets (longer than the 10-minute key lifetime, so a delivery is counted as long as its keys exist). A delivery that is not accepted (429, 503, ...) gives its slot back, so a sender looping on a quota refusal keeps seeing the real refusal. The counters are a bounded Caffeine cache that expires idle integrations.

    • From half capacity, an integration above its fair share (half the cache divided by the active integrations, counting only those with 50 or more deliveries in the window, so throwaway integrations cannot shrink anyone's share) is refused even inside its own budget.

    • From 90% of capacity every new delivery is refused, whatever its integration holds - a last resort that keeps the cache clear of eviction.

    • Repeats of remembered deliveries are always answered, and the repeat check runs only when a refusal is pending, so an admitted delivery costs no extra cache read (in a cluster, no extra NATS round trip).

    • Refusals are their own metric outcome, refused_capacity (metrics.md, dashboard), and the WARN is limited to once a minute per integration. ICache.size() stays a cheap estimate; the new ICache.sizeExact() sweeps expired entries and is read only once the estimate reaches the threshold, so a refusal cannot outlast the data.

    • In a cluster the budgets and the thresholds are per node: the counters are node-local and the cache size read is the node-local view (documented).

  • Cluster. webhook-event-dedup joins slack-event-dedup in the shared DEDUP NATS KV bucket (same 10-minute TTL), so a replay is caught on whichever node it hits. With NATS unreachable each node falls back to its own cache, as for Slack.

  • Unsigned routing headers. Binary-mode ce-type/ce-id and the plain-mode event-type header are outside every scheme's MAC. The replay key is already derived from the MAC alone, so within the window the same signed body is a duplicate whatever header it arrives with (now covered by tests at handler and endpoint level); the page now says plainly that routing headers are unsigned, what that means (tampering in transit can re-route a body without breaking the signature) and what to do (TLS, route on a field of the signed body). No wire-protocol change and no new signing scheme.

  • Orphaned conversations. A 429 (or any refusal) from the turn after startConversation left one empty conversation per retried delivery. The conversation just created is now ended when its first turn is refused; a correlated conversation is kept, since the retry reuses it.

  • Weak or plaintext signing secrets. Save-time validation already requires a vault reference, but a ZIP import or direct store write bypasses it, and no length was checked anywhere. The router now refuses to hand the verifier a plaintext secret, a reference that did not resolve (left unchanged by resolution, also with surrounding whitespace) or a resolved one shorter than 16 characters; the verifier independently rejects anything still containing a ${vault: reference (the integration answers 401, with one WARN per integration).

  • Id probing. An unknown integration id answered 404 before the signature was looked at. It now answers 401 with the same body as a bad signature (the log keeps the distinction). The Slack endpoint likewise answers a uniform 403 for anything it cannot verify.

  • Two meanings of 409. The body now carries reason: in_progress (retry in 5 seconds) or awaiting_approval (a human has to decide). The status code is unchanged.

  • Behaviour change for 6.6.0 installs: a webhook integration whose vault secret is shorter than 16 characters used to work and now answers 401 to every request (as does a plaintext secret that reached the store through import). Find them with the log line "signing secret is shorter than" (one WARN per integration version, repeated after a vault secret change) and rotate to 32 random bytes. Saving such a secret is now refused with 400 when it already exists in the default-tenant vault; references to another tenant are not resolved at save time (that would let any editor probe other tenants' secrets), so the router's runtime check is what covers them.

  • The Platform Operator prompt now knows the new answers (unknown id 401, weak secret 401, capacity 503, 409 reason), operator revision bumped.

  • Group targets still receive only the rendered input, not the event map; documented, not changed.

Files: CacheFactory.java, WebhookEventHandler.java, RestWebhookChannel.java, ChannelTargetRouter.java, webhook-triggers.md.

Design decisions

  • No new property: the capacity is derived from the window like the nonce cache's, and the refusal threshold follows from it. A property would let an operator size the cache below the traffic it must hold, which is the defect being fixed.

  • The check for a quota refusal before creating the conversation was rejected: the API-call quota has only an atomic acquire, no read-only peek, and adding one would race. Ending the orphan is the safe equivalent (each attempt still spends a conversation slot).

  • The shared bucket is not size-capped and the node-local cache that stands in for it is, so in a cluster the thresholds read each node's own view: a sender spread over N nodes may hold N times its budget in total. Reading the exact cluster-wide size is not possible (the bucket cannot enumerate its keys).

  • Per-integration admission rather than a global refusal: a global threshold let one integration with a valid secret push every other integration to 503. The fair share counts only integrations with 50+ deliveries because the roles that can create integrations (eddi-admin, eddi-editor) could otherwise shrink everyone's share with many one-delivery integrations.

Tests

  • WebhookEventHandlerTest: an integration over its budget gets 503 while another still gets 202 (and a remembered repeat is answered); the window rolls over after 11 minutes and a delivery still counts at 10; from half full only the integration above its fair share is refused; the 90% hard stop refuses an idle integration; throwaway one-delivery integrations do not shrink another's share; an admitted delivery performs no extra cache read; refused deliveries do not spend the budget; the WARN is throttled to once a minute; refused_capacity is its own outcome; the refused turn ends its new conversation with its own reason; both 409 reasons; the same signed body under another event type is a duplicate.

  • RestWebhookChannelTest: unknown or malformed id answers identically to a bad signature; rerouted replay is a duplicate; reason in the body and no Retry-After for awaiting_approval.

  • CacheFactoryTest: explicit, window-derived size; shared through the DEDUP bucket with the matching TTL. CacheImplTest: sizeExact() ignores expired entries.

  • ChannelTargetRouterWebhookTest: plaintext and 15-character secrets are stripped, a 16-character one is kept; the weak-secret warning is logged once per refresh cycle and again after a vault change.

  • RestChannelIntegrationStoreValidationTest: a short existing vault secret is refused at save, other-tenant references are never resolved, maxDeliveriesPerWindow is validated.


docs(llm): point self-hosted servers at openai-compatible everywhere (2026-10-24)

Repo: EDDI (docs/openai-compatible-doc-nits)

Why

Two places written before or alongside the openai-compatible provider type (#1062) still sent self-hosted servers to type: openai + baseUrl, which inherits OpenAI's capability answers (JSON mode with tools, vision by model name) instead of the per-endpoint flags that type exists for.

What changed

  • docs/langchain.md — the Jlama note ("for a GPU or a larger model…") now points at type openai-compatible and its section instead of openai + baseUrl.

  • docs/langchain.md — the classifier guardrail: the provider explanation names openai-compatible for vLLM / llama-server, and the Granite Guardian on vLLM example uses "provider": "openai-compatible" with serverName: "vllm". Verified first that the classifier passes provider straight to ChatModelRegistry, where the type is registered, and that its builder delegates to the OpenAI builder, so customParameters, maxTokens and the rest of the example behave identically.

  • Platform Operator system prompt (system-prompt.ts) carried the same classifier advice; corrected the same way. Operator revision bumped 36 → 37 (operator-revision.json).

Verification

vitest run src/lib/operator — 16 files, 484 tests passed (run with Node 24; the machine's Node 22.14 cannot start the Vitest worker). DocumentationLinksTest and ChangelogFragmentTest green.


🐛 fix(ci): publish the -b image for a merge that does not touch ui/ (2026-10-21)

Repo: EDDI (fix/ci-docker-push-backend-only)

What changed and why

Since the monorepo split of 2026-09-15 (4f19e4767, "run each half only when it changed"), no merge to main that changed only backend code published a -b image. Build & Test, the integration tests and the E2E runs on the built image all passed, and Docker Build & Push was skipped.

The cause is GitHub's implicit success(). A job condition without a status function gets one added, and for a job with needs it grades every job upstream, not only the listed ones. Docker waits on ui-gate, which is written to pass when the UI did not change (always(), skipped ui-* jobs accepted). On a backend-only push those ui-* jobs are skipped, so the implicit success() of docker was false and it was skipped — and with it Smoke Test and Preflight Verify (Pushed Image), which depend on it. Of the last 25 merges, every backend-only one was affected; tag builds were not, because detect-changes forces ui=true for a tag.

ci.yml:

  • docker starts its condition with !cancelled() and grades its own needs explicitly: no failure, cancelled or skipped result. That keeps the gate the job's NOTE insists on — every listed job must have succeeded, so a failed or skipped test job still blocks the push, and no always() is used.

  • smoke-test gets !cancelled() && needs.docker.result == 'success', and preflight-push gains !cancelled() in front of its existing condition, for the same reason.

The tag-only jobs (release, Red Hat publish, post-release) are unchanged: on a tag the ui-* jobs always run.

Verification

  • The history check behind the diagnosis — Docker push outcome against the ui-* jobs for the last 25 main pushes — lines up one to one.

  • BuildQualityGatesTest#jobsBehindUiGateGradeTheirNeedsExplicitly fails on any job behind ui-gate that runs on a non-tag push without a status function, and on a docker condition that loses its explicit needs checks or gains always(). Against the old ci.yml it fails, naming docker, smoke-test and preflight-push.

  • The merge of this branch does not prove the fix: it changes ci.yml, which the ui path filter counts as a UI change, so its ui-* jobs run and it would publish anyway. The proof is the next backend-only push to main — it must publish a -b image and run Smoke Test.


Fix: eddi update on a pre-#1034 Postgres install (2026-10-20)

Repo: EDDI, branch fix/update-backfill-postgres-password

An install made before docker-compose.postgres-only.yml required POSTGRES_PASSWORD has no such line in .env. eddi update refreshed the compose file, docker compose pull and up then failed to interpolate it, and the Windows wrapper still printed "EDDI updated."

  • install.sh and install.ps1 (the eddi wrapper): after refreshing the compose files, if one references POSTGRES_PASSWORD and .env lacks it, write the legacy eddi value and print a note. A fresh random value would lock EDDI out of the existing volume, because Postgres reads the variable only at initdb.

  • install.ps1 wrapper: update now stops with exit code 1 when pull or up -d fails instead of reporting success.

  • New installs are unaffected: both installers already generate the password.


🐛 fix(hitl): a resume could not re-supply secret context, because loading a conversation dropped secret (2026-10-20)

Repo: EDDI (fix/secret-context-survives-store-load)

What changed and why

Secret context on resume (#1114) refused every resume that re-supplied a secret with 400 — context['userToken'] was not a secret context value in the paused turn — although the paused step was stored with "secret": true and the placeholder. Both conversation stores rebuild a stored context:* entry as new Context(type, value) when they load a conversation, which dropped the flag, and ConversationHitlService.validateResumeContext and Conversation.injectResumeSecretContext both read it from that loaded memory. A resume always loads from the store, so the feature could not work in a deployment; the tests of #1114 and #1116 build the memory in process and never went through a load.

Both stores now keep the flag when they rebuild the entry. Nothing else changes: the stored value is still the placeholder, the re-supplied value lives for the resumed turn only, and that turn stores the placeholder again.

Files: ConversationMemoryStore.java (loadConversationMemorySnapshot), PostgresConversationMemoryStore.java (fixContextTypes).

Tests

  • MongoConversationMemoryStoreTest, PostgresConversationMemoryStoreTest: a secret entry keeps secret: true and the placeholder through a real store round trip; an ordinary entry stays unmarked.

  • ConversationMemoryStoreResilienceTest: the same on the MongoDB load path with a mocked collection, so it also runs without Docker.

  • Without the fix all three new tests fail (expected: <true> but was: <null>).

  • End to end against an image built from this branch (MongoDB, an agent whose gated POST tool sends Bearer {context.userToken}): the resume that re-supplies the token now runs the approved call with it, where 6.6.0 answered 400; re-supplying a key that was not secret in the paused turn is still a 400 and leaves the pause; a resume without the token is still refused; neither token is stored in the conversation afterwards.


🔖 chore(release): after 6.6.0 (2026-10-20)

Repo: EDDI (chore/post-release-6.6.0, opened by post-release.yml after the release pipeline published the image)

What

  • Release pointers: 6.5.0 → 6.6.0 (Helm chart 2.10.0 → 2.11.0)

  • Build version (pom.xml): 6.6.0 → 6.7.0

Generated by python scripts/bump-version.py post-release 6.6.0. Files:

  • pom.xml

  • docs/build-reproducibility.md

  • docs/developer-quickstart.md

  • docs/getting-started.md

  • docs/kubernetes.md

  • docs/redhat-openshift.md

  • docs/release-signing.md

  • docs/setup-eddi-on-aws-with-mongodb-atlas.md

  • k8s/base/kustomization.yaml

  • k8s/quickstart.yaml

  • helm/eddi/Chart.yaml

  • src/test/java/ai/labs/eddi/deploy/DeploymentManifestsTest.java


📦 chore(deps): Quarkus 3.40.1 → 3.40.1.1 (2026-10-20)

Repo: EDDI (feat/compatible-import-sync, carried on that PR so the patch reaches main with the next merge)

What changed and why

  • Quarkus platform 3.40.1 → 3.40.1.1 (pom.xml quarkus.platform.version, the only pin). It is a patch release of the 3.40 LTS line, published 2026-10-19, and contains only dependency and bug fixes:

    • Vert.x 4.5.35 and Netty 4.1.139.Final;

    • lz4-java 1.11.4, snappy-java 1.1.10.11 and Hibernate Validator 9.1.5.Final;

    • a fix that makes rolesAllowed in REST Data Panache MethodProperties inherit from @ResourceProperties, plus smaller REST Data Panache fixes.

  • No EDDI code or configuration changes were needed.

Verification

Compile with the style gates, the repo-wide guards, and an @QuarkusTest integration test that boots the application, all on the new platform. CI runs the full unit, integration and E2E suites.


📘 docs(integrations): Claude Code plugin with eddi and eddi-admin skills (2026-10-20)

Repo: EDDI (docs/eddi-claude-skills)

The MCP server gives an assistant EDDI's tools. It does not tell the assistant which tools to chain, which configuration mistakes deploy cleanly and then fail, or which calls need a person's approval. A new Claude Code plugin covers that, in integrations/claude-plugin/, with a marketplace entry at .claude-plugin/marketplace.json (/plugin marketplace add labsai/EDDI).

  • eddi (every role) covers connecting and reading auth failures, discover_agents, keeping one conversation (chat_managed by intent, or passing conversationId back to chat_with_agent), group discussions (sync and async), approvals bound to the pauseId that was read, and the user's own memories.

  • eddi-admin (editor and admin) covers orientation, setup_agent / create_api_agent into test, and the change path: update_resource → one apply_agent_changes → test → promote. It explains the compatible decision, and warns that undeploying with endConversations ends users' conversations, and that MCP cannot edit a workflow itself (adding a step is a Manager or REST change). It also covers agent test runs, intents, schedules, channels and groups. The references cover the change workflow, five config gotchas, a symptom-to-cause debugging table, groups, and the actions that need a yes, including the partial-result semantics of the GDPR tools.

  • Design: the skills split along the MCP role tiers, so an eddi-user session never loads authoring tools it would get FORBIDDEN on. The skills treat everything EDDI returns as data, never as instructions. They point to the server's own read_docs instead of copying documentation, so a skill cannot contradict the running version.

  • No .mcp.json in the plugin: each deployment has its own URL. The Claude Code docs also do not confirm clientId / callbackPort in a checked-in .mcp.json, and without them the client would try dynamic registration, which the shipped realm refuses. The README gives the claude mcp add --client-id eddi-mcp command instead.

  • Guard: SkillToolReferencesTest (in engine.mcp, reusing McpToolContractTest's tool scan) fails if a skill names an unregistered tool or a camelCase argument no tool takes, if it references a read_docs page that is missing or that the Dockerfile deletes from the image, if a SKILL.md frontmatter is incomplete, or if the marketplace entry and the plugin name disagree. Writing the skills against the source caught two stale names. create_schedule's description said cronExpression, but the argument is cron: the description is fixed in McpAdminTools. And the first draft used the REST parameter endAllActiveConversations where undeploy_agent's argument is endConversations. The argument check exists because of that one.

  • Docs: mcp-server.md gains a "Claude Code plugin" subsection under Quick Start. The AGENTS.md §4.6 docs item now names the skills, because the guard catches renames but not new capabilities.

Not verified: the skills have not been run against a live server. Operator prompt unchanged: the only server change is one MCP tool description, which the operator (REST) never sees.


feat(hitl): opt-in reply and unverified approver on resume (2026-10-20)

Repo: EDDI (feat/hitl-resume-reply-and-approver)

What changed and why

  • Reply from resume. POST /agents/{conversationId}/resume accepts the say query parameters (returnCurrentStepOnly, returnDetailed, returningFields). With any of them the request waits for the resumed turn (AsyncResponse, agentTimeoutInSeconds, 408 on timeout, Retry-After as on say) and returns it through the same snapshot conversion say uses, so secret context stays a placeholder. Without them the answer is the empty 200 it always was. IConversationService.resumeConversation gained a six-argument form; the three-argument form delegates with (false, true, []).

  • Approver without authentication. With no authenticated principal, a body decidedBy is recorded as unverified:<value> (trimmed, 128 characters, [A-Za-z0-9._@:+-] only). It is a claim by the caller, not an identity. An authenticated principal still wins and the body is ignored.

  • Tool-call path test. ResumeSecretContextApprovedCallTest drives the real resume loop with the real httpcall provider and ApiCallExecutor resolution (HTTP client recorded): a pinned call using Bearer {context.userToken} runs with the real header when the token is re-supplied, is refused as before without it, and is still refused when the URI or a body value changed.

Files: RestAgentEngine.java, IRestAgentEngine.java, ConversationHitlService.java, hitl.md.

Design decisions

  • The endpoint is converted to AsyncResponse rather than blocking a worker: it is the same shape and timeout contract as say, and the no-flag path resumes the async response immediately.

  • Presence of any say flag, not a particular value, is what asks for the reply, so returnCurrentStepOnly=false returns the whole conversation as it does on say.

  • Follow-up fixes. unverified: is now a ReservedPrincipals prefix (no token may carry it). The resumed reply runs recordTurnOutcome like say, so an ERROR turn carries error and Retry-After. A waiting client is always answered: a resume dropped before it ran (cancelled/ended, or refused by the coordinator) is delivered as onSkipped (410 for ENDED, else 409, one mapping shared with say), and a resume that throws without rendering is delivered as the ERROR snapshot.

  • A reply is a read. Resume admits approver-only callers (eddi-approver, neither owner nor admin), but a reply returns the conversation, and with returnCurrentStepOnly=false or returnDetailed=true that can be its whole history. A request carrying any reply flag therefore also needs the owner-or-admin access say needs; an approver-only caller asking for a reply gets 403 before the resume runs, so the pause is untouched. Raised by review as a Major authorization finding (CWE-863).

  • The watchdog path too. A resume the runtime routes to its failure callback (the agent-timeout watchdog abandoned it, or a failure escaped the resume body) now answers a client waiting for the reply with the stored state (EXECUTION_INTERRUPTED or ERROR, the latter with its error), once, guarded by the same one-shot flag. Previously that client waited for its own 408. On a watchdog abandonment the two usually coincide, since both run on agentTimeoutInSeconds; the answer matters for a failure that escapes the body early.


feat(hitl): secret context on resume (2026-10-20)

Repo: EDDI (feat/hitl-resume-secret-context)

What changed and why

A per-turn credential sent as secret context (secret: true) is replaced by a placeholder when a turn pauses, so every task after an approval that needed it (an approved HTTP tool call acting as the user) failed: a pinned call was refused as "the request changed after it was approved", an unpinned one failed at execution. POST /agents/{conversationId}/resume now accepts an optional context map in the same shape as a say request. Only entries marked secret: true whose key was a secret in the paused turn are accepted; anything else is a 400 before the pause is consumed. The values replace the placeholder for the resumed turn only and go through the same scrubbing as on say (shared registerSecretContext, scrubSecretContextValues, TurnAuditBuffer redaction), so the stored step holds the placeholder again afterwards.

Files: HitlDecision.java (write-only context), ConversationHitlService.java (pre-CAS validation), Conversation.java (injection and scrub), hitl.md.

Design decisions

  • Timeout, Slack, MCP and group resumes pass no context and are unchanged. MCP deliberately does not get it: tool arguments are logged and audited.

  • Approval binding is not weakened: headers are fingerprinted redacted, so an identical re-supplied token matches (as does a rotated one in a credential header such as Authorization); a different value in the URI, query, body or an unrecognised header changes the fingerprint and the call is refused (fail closed). Documented in hitl.md.


Operator revision bump after #1112 (2026-10-20)

Repo: EDDI · Branch: fix/operator-revision-36

#1112 (classifier guardrail) was squash-merged at a head whose system-prompt.ts edits were in, but whose matching operator-revision.json bump was pushed a moment later and never reached main. operator-revision.test.ts therefore fails on main. This sets ui/manager/src/lib/operator/operator-revision.json to revision 36 with the fingerprint the test computes for the current prompt, allow-list and gate (d9679ddf62f6532a). No behaviour change.


feat(backup): declare a ZIP import or agent sync compatible (2026-10-19)

Repo: EDDI (feat/compatible-import-sync)

What changed and why

A conversation runs on the newest ready version of its compatibility generation, so a compatible save lets running conversations follow and a breaking one pins them. ZIP import (strategy=upgrade, and the update half of strategy=merge) and agent sync always wrote a breaking version, so promoting an agent from staging to production pinned every running production conversation to the pre-promotion version, and operators ended those conversations to get the fix out.

  • compatible parameter (default false, the safe default is unchanged) on POST /backup/import (merge and upgrade) and POST /backup/import/sync, and a per-request compatible field on SyncRequest for POST /backup/import/sync/batch. It is threaded to the agent write (RestImportService.createOrUpdateAgent, UpgradeExecutor.updateAgentConfig) and is ignored when a new agent is created or nothing is written. The old method forms remain as default overloads on IRestImportService and UpgradeExecutor.executeUpgrade, so existing callers are unchanged. No MCP tool exposes import or sync, so there is nothing to change there.

  • Merge rollback. A failed merge writes the pre-import content back through the same agent write, so the restore carries the same declaration. Breaking import: aborted version G+1, restore G+2, so no later breaking save can share a generation with the aborted version (the original reasoning, still true). Compatible import: nothing bumped, aborted version and restore both keep G, so conversations that had already followed onto the aborted version follow on to the restored content, whereas a breaking restore would pin them to the aborted import's content. Generations never decrease along the version chain in either case. Both outcomes are tested.

  • Preview. ImportPreview.conversationImpact (PromotionImpact) on the upgrade, merge and sync previews: the target's current version and generation, the generation each declaration would produce, the open conversations per compatibility generation and how many would follow if declared compatible. It answers for both declarations because the preview is read before the choice, so the Manager updates instantly without another round trip to the source. Counts only, by the conversations' own compatibility generation (a conversation follows the newest ready version of its generation whatever version it last ran on, so a count per deployed version missed idle conversations stored on undeployed versions): one grouped count, IConversationMemoryStore.getActiveConversationCountsByGeneration (Mongo $group, Postgres GROUP BY), never the active-conversation memory listing. Computed by RestAgentAdministration.previewNextVersion with the same follow rule as the deployment impact and the generation rule of AgentStore.nextCompatibilityGeneration (now public). Omitted when nothing would be written, there is no existing target, or the caller lacks EDIT on it.

  • Result. UpgradeResult (upgrade, sync, batch) gains compatible and compatibilityGeneration of the written agent version; a merge import answers with X-Agent-Compatible and X-Agent-Compatibility-Generation. Additive.

  • Legacy edge. A target whose current version has no generation still starts generation 1 on a compatible save; the preview reports startsNewChain: true and the Manager shows the existing compatibleLegacyNote text.

  • Manager. PromotionCompatibilityPanel (reusing CompatibleVersionCheckbox, unticked by default) in the import dialog's preview step and in each agent's detail on the Sync page, with the impact sentence and agentVersioning.promotionImpact* keys in all 11 locales.

  • Docs. deployment-management-of-agents.md (when to tick compatible on a promotion, both outcomes), agent-sync-guide.md, import-export-an-agent.md.

Design decisions

  • Merge shares the update path with the rollback in question, so it takes compatible as well as upgrade.

  • Preview parameters were rejected in favour of returning both answers.

  • Counting by deployed version was rejected: a conversation follows by its own generation, so idle conversations stored on undeployed versions were missed.

Tests

New: RestImportServiceCompatibleTest, RestAgentAdministrationPromotionImpactTest, additions to UpgradeExecutorSyncTest and RestImportServiceSyncCoverageTest, and promotion-compatibility.test.tsx. The key backend tests were mutation-checked.


feat(operator): the Platform Operator explains 408 Request Timeout and caller_timed_out (2026-10-19)

Repo: EDDI · Branch: feat/operator-turn-timeout-408

What changed and why

PR #1101 changed what a 408 means under load, and left telling the Platform Operator for later, because the "Turn capacity" prompt section of #1091 had not landed yet. Without this an admin asking "why do my users get 408?" or "what is eddi_turn_skipped_total?" got an answer from the old behaviour, or none. AGENTS.md §4.6 asks for this check whenever behaviour changes.

  • system-prompt.ts, "Turn capacity":

    • A fourth capacity_exceeded cause: the database pool-wait timeout ("The database is busy: no connection was free in time"), now a 503 with Retry-After instead of a 500.

    • How a 408 differs from a 503: the turn was accepted but its caller's time (systemRuntime.agentTimeoutInSeconds, counted from the request's arrival) ran out. The prompt gives the three cases and whether the turn ran in each: rejected before queueing (eddi_turn_rejected_total{reason="caller_timed_out"}), dropped unrun from the queue with its input unconsumed (eddi_turn_skipped_total{reason="caller_timed_out"}, eddi.conversation.skip-turns-of-timed-out-callers; only then is a retry exactly-once, and with the setting off the queued turn still runs), or already started, whose outcome is unknown at the 408 because the execution watchdog times from the turn's submission to the executor (queue wait included), not the request's arrival.

    • What a rising caller_timed_out means: the node is overloaded. The fix is more nodes or a lower max-in-flight-turns, which turns a 60 s wait into a fast 503. Raising the timeout does not help. Flat counters do not prove health: a turn that queued until just before its deadline and then started is counted by neither, so compare wait-before-start with run time.

    • /q/metrics answers on dedicated threads (eddi.metrics.dedicated-scrape-threads).

    • The logs section: pool-wait refusals are WARN lines, and both 408 paths log at DEBUG only, so the logs do not show them.

  • No allow-list change. The meters are at /q/metrics, which is not in the OpenAPI spec and so cannot become a tool. The prompt already says the operator cannot read them.

  • operator-revision.json: revision bump, so existing deployments are offered the upgrade.

  • system-prompt.test.ts: pins the pool-wait message, the 408/503 distinction, both counters, the "did it run" sentence, the overload advice and the DEBUG-only logging note.


✨ feat(engine): move already-pinned conversations onto the current agent version (2026-10-19)

Repo: EDDI (feat/upgrade-conversation-generation)

What changed and why

A ZIP import and an agent sync write a breaking version unless declared compatible, a breaking save leaves the same result, and conversations that started before compatibility generations existed carry none, so after a promotion every running conversation stays pinned to the version it began on. Operators ended them, which is a bad experience for the user in the middle of a conversation. This adds an operator-declared, previewable repair: "this agent's conversations on an older generation (or none) are compatible with the current version, move them onto it."

  • Endpoint. POST /administration/{environment}/upgradeconversations/{agentId} with dryRun (default true), repeatable fromVersion, limit (default 5000, so a call stays inside a proxy timeout) and after (the cursor: a truncated report carries nextAfter). Same path style, roles and EDIT access check as undeploy. The response has the same shape for dry and real runs: target version and generation, and per source version matched, eligible, upgraded and skipped by reason. MCP: upgrade_conversations, same dry-run default (86 tools now). The REST call is recorded by the existing administrative-action audit filter; deploy and undeploy over MCP write no audit record either, so the tool adds none.

  • Target. The generation of the agent's latest version. A version of it must be READY in the environment on the serving node, else 409; an agent whose latest version has no generation also gets 409. A generation is never lowered, and conversations already on the target are not touched.

  • Only the generation is written. The existing per-turn machinery (resolveConversationAgent, recordAgentVersionMove) then moves the conversation to the newest READY version of the generation and records the move, so agentVersion, steps and the descriptor are not rewritten here.

  • States. READY, ERROR and EXECUTION_INTERRUPTED are moved. ERROR is included on purpose: say refuses only ended and paused conversations, so an errored conversation is live and the new version often repairs it. ENDED, AWAITING_HUMAN (a resume must finish on the version that paused it) and a persisted IN_PROGRESS are skipped and counted.

  • Concurrency. A say turn never persists IN_PROGRESS, so the store cannot see a running turn. Each write is therefore a task in the conversation's own coordinator queue (cluster-wide lease in cluster mode) and never overlaps a turn. The write is one conditional update and also moves _rev and _histRev: a turn queued behind it is rebuilt over the new document by the existing stale-snapshot guard, and a writer holding an older load is refused (append: history revision; full write: revision) instead of putting the old generation back. Tasks that do not start within eddi.conversation-upgrade.turn-wait-ms (30 s) are withdrawn and reported as busy.

  • Scale. Candidates are read as a keyset-paged projection (id, state, version, generation), 100 per round, never loaded in full and never via the active-conversation listing. Implemented for MongoDB (pipeline update) and PostgreSQL (jsonb_set).

  • Observability. eddi_conversation_generation_upgrade_count; one INFO line per run with the counts.

Tests

ConversationUpgradeServiceTest (selection, skips, target validation, never lower, dry run writes nothing, timeout withdrawal, real-coordinator ordering against a running turn), RestAgentAdministrationUpgradeConversationsTest, and a GenerationUpgrade group in both MongoConversationMemoryStoreTest and PostgresConversationMemoryStoreTest (Testcontainers), including the stale-append and stale-full-write interleavings.

Docs

docs/deployment-management-of-agents.md ("Moving running conversations onto the current version") and docs/mcp-server.md.

Design decisions

  • Order of preference: save or promote compatibly where possible; this action is for conversations that are already pinned.

  • Ended conversations are not scanned (they would stay candidates forever and crowd out the ones that can move); they are counted per version with one query. The cursor exists because conversations skipped without change (paused, in progress, busy) stay candidates.


🐛 fix(cluster): review follow-ups to #1089 — non-blocking heartbeat tick, drain/acquire race, one dead-letter budget (2026-10-19)

Repo: EDDI · Branch: fix/cluster-resilience-review-followup

What changed and why

#1089 merged before its last round of review fixes was pushed. This lands them on their own.

  • The lease scheduler never waits for a heartbeat pass (KvLeaseManager). The single lease-scheduler thread also runs every lease waiter's retry and deadline timer. heartbeatAll waits up to one interval for its renewals, so a stalled renewal delayed those timers by up to an interval. The tick (dispatchHeartbeat) now only starts the pass on the I/O executor; a tick that finds the previous pass still running skips.

  • A leader lease granted while a drain began is handed back. tryAcquireKey checked draining before its KV create; a drain whose sweep ran during that create could not see the new lease, so the drained node kept renewing a leader lease no other node could take. It re-checks after the grant.

  • One budget for a dead-letter append (JetStreamDeadLetterStore). The ~2 s retry budget started only after the first publish and the provisioning, each of which can take a full request timeout against a NATS that stopped answering. It now covers the whole append.

  • Late on-connect hooks (registered after the connection is up) also run on the hook executor (NatsConnectionManager), not on the shared scheduler.

  • Cancellation in a mixed gated/allowed tool batch (ToolLoopRunner): the allowed calls of a batch that also pauses for approval now check the turn's cancel flag before each tool, like the main loop.

Tests

KvLeaseManagerTest.leaderAcquiredDuringADrainIsReleased, heartbeatTickNeverBlocksTheScheduler, JetStreamDeadLetterStoreTest.aFirstPublishThatUsedUpTheBudgetSkipsProvisioningAndRetries — each fails with its fix reverted. The renewal-overlap test releases its gate in finally.


fix(engine): the turn timeout and /q/metrics hold under overload (2026-10-19)

Repo: EDDI · Branch: fix/turn-timeout-under-load

What changed and why

The collapse investigation of 2026-10-19 (PR #1098) found three overload behaviours in a 5,000-user burst against a node held to 2 CPUs: turns answered 200 after a median of 113 s although the REST timeout is 60 s, /q/metrics silent for about 110 s, and queued turns that still ran after their caller had been answered 408. A reproduction with per-request timing (results note) traced the first two to one queue. say and the Prometheus endpoint ran on the Quarkus worker pool (200 threads), and in the burst every one of those threads was busy with conversation starts waiting on MongoDB. A turn request waited up to 79 s for a thread before its 60 s timeout was even armed, a finished turn waited up to 37 s more for a thread to write its answer, and the scrape queued behind both. The timeout timer itself fired on time.

  • RequestArrivalStamp: the router's first route records when each request arrived. TurnDeadlineHeaderReader puts it on the turn's InputData.

  • RestAgentEngine: the 408 fires at systemRuntime.agentTimeoutInSeconds after arrival. A request that has already used the whole budget is answered 408 at once and queues nothing (eddi_turn_rejected_total{reason="caller_timed_out"}). say, sayWithinContext and rerun are @RunOnVirtualThread, which also takes the response write off the worker pool. A database pool-wait timeout on a turn or a start is 503 capacity_exceeded with Retry-After: 5 instead of a 500 (ConnectionWaitTimeouts).

  • ConversationService and ConversationStepRunner: the turn carries when its caller gives up. A turn still queued then is dropped before any read, its input unconsumed (eddi.conversation.skip-turns-of-timed-out-callers, default true, eddi_turn_skipped_total{reason="caller_timed_out"}). The caller is told through the new ConversationResponseHandler.onCallerGone (REST: 408), and an idempotency key is released, so a retry runs the turn. A turn deadline (turnDeadlineMs, X-EDDI-Turn-Deadline-Ms) now counts from the request's arrival too.

  • MetricsScrapeRoute: GET/HEAD /q/metrics is answered on two threads of its own, by a route at order −10: after the security filters (−200, −100), so the metrics permission still applies, and before the /q sub-router (eddi.metrics.dedicated-scrape-threads, default true).

  • Docs: conversations.md (when a turn is answered 408 and whether it ran), configuration-reference.md (both properties), metrics.md (the caller_timed_out reasons), application.properties.

Measured

Interleaved on a contended laptop (host CPU 72–79 %; other sessions' builds ran throughout), two runs per arm, burst of 5,000 users, limit 1,500:

  • /q/metrics: 0 of 335 scrapes timed out, against 120 s blind in every baseline run.

  • Slowest 200: 60.4 s, against 94–105 s. Every 200 arrived within the caller's 60 s.

  • 200s within 60 s (estimated from percentiles): 24.7 and 27.9 per second, against 21.9 and 17.4. Fewer 200s in all (3,297–3,734 against about 4,700), because the late answers became 408s.

Design decisions

  • Starts stay on the worker pool. Measured with starts on virtual threads too, the node collapsed: 0 turns, connections refused, event loops blocked for up to 60 s. Two carriers at 2 CPUs could not absorb thousands of CPU-heavy starts admitted at once. The worker pool is the start path's only concurrency limit. AgentEngineVirtualThreadIT pins both halves of this.

  • A caller-gone skip, not a default turn deadline. A default turnDeadlineMs would change how every agent's retries and fallbacks spend their time. The skip only stops work whose answer cannot reach anyone, and only for callers that stamped when they give up (REST say). Streams, schedules and group members carry no such time and are untouched.

  • The scrape route replaces Quarkus' handler rather than moving it. A management interface would still use the same worker pool for its blocking route. A route of our own ahead of Quarkus' keeps the path, the content negotiation and the permission, and can be switched off.

Not done (follow-ups)

  • A request that cannot be dispatched within 60 s (up to 123 s on two saturated carriers) still gets its 408 only when it runs. The remedy is earlier load shedding: an in-flight limit sized to CPU.

  • Conversation starts have no concurrency bound of their own.

  • The Platform Operator learns about the 408 / caller_timed_out behaviour once the "Turn capacity" section of PR #1091 lands; changing the same prompt here would be a revision-bump conflict.


🛡️ feat(manager): LLM input/output guardrails editor and guardrail_triggered chat notice (2026-10-19)

Repo: EDDI (feat/manager-llm-guardrails, based on feat/llm-input-output-guardrails, PR #1064, because that PR had not merged when this was written)

The backend shipped input/output guardrails on LLM tasks with only a TypeScript type mirror in the Manager, so designers had to edit JSON. This adds the editor and surfaces the new SSE event.

What changed

  • Guardrails section on the LLM task editor (task-guardrails-section.tsx): two ordered lists, inputGuardrails and outputGuardrails. Each row shows type and action, and can be reordered (order is run order), edited or removed. Each guardrail is edited in a side sheet (guardrail-sheet.tsx) so the task editor itself stays one flat list.

  • The sheet edits type, action (with a one-line explanation per action and phase; reprompt is not offered on the input side, where the engine treats it as block), maxRetries (only while the action is reprompt), blockMessage, failMode, repromptMessage, and the type's own parameters: prompt-injection (extra patterns, mode), pii-redaction (kinds, replacement), regex-filter (patterns, replacement), max-length (maxChars), json-object (none), and classifier (provider picker reusing ProviderSelect, base URL, model under the key the chosen provider reads, API key through SecretKeyPicker so it is a ${vault:…} reference, risk, prompt template, unsafe/safe label, label pattern, timeout, prices, retrieved-context toggle on the output side). Warnings for: classifier without a provider, classifier unsafeLabel other than yes without a safeLabel (the deploy is refused), redact on a type with nothing to rewrite with, failMode: open on a blocking guardrail, a regex filter with no pattern, a type on the wrong side.

  • Streaming caveat: an output guardrail whose action is block, redact, reprompt (or absent, which is block) makes the task buffer its answer; the section says so in amber while that is the case, and plainly otherwise.

  • Chat: guardrail_triggered is handled in use-chat and attached to the agent bubble of the turn; ChatMessage shows one quiet line per fired guardrail (phase, type, action). The payload carries no screened text. The standalone Chat UI (ui/chat) was left alone: it is an end-user widget whose block message already is the answer, and it surfaces no other internal pipeline events as notices.

  • i18n: 109 keys (llmEditor.gr*, chat.guardrail*) in all 11 locales.

Design decisions

  • Write only what the author sets. A new guardrail is { "type": … } with nothing else; blanking a field removes it, an emptied parameters map is dropped, an emptied list removes inputGuardrails/outputGuardrails rather than writing [], and moving off reprompt drops maxRetries. An older server's strict parser refuses unknown fields (same rule as task-tool-call-limits.tsx).

  • All parameters stay plain strings, as the backend reads them; an unknown type and any unknown parameter are preserved untouched.

  • The classifier model key follows modelParamSpec(provider), and switching provider moves the model and credential to the new provider's keys.

  • Edits apply live (no draft/apply step) because the list behind the sheet reflects them and the editor already has its own save/dirty handling.

Not done / next

  • The classifier type exists on feat/llm-classifier-guardrail, not yet in a PR. Until that backend lands the editor does not offer it (it is left out of GUARDRAIL_TYPES); a stored classifier entry still shows as a custom type and keeps its settings panel. The classifier PR adds it back.

  • The operator system prompt is unchanged: its guardrail text was already added with the backend PRs.

  • Live-turn notices only: a conversation reloaded from history does not show them (the audit ledger holds the record).


📊 feat(ci): Slack digests estimate real Docker pulls next to the raw count (2026-10-19)

Repo: EDDI (feat/metrics-sweep-filter)

What changed and why

The daily digest went from single-digit pull counts to +1,805 overnight. The arithmetic was right, but the source was not people. Since 2026-10-18 02:47 UTC, something has pulled all 198 tags of labsai/eddi at once, every ~2 hours. The workflow logs show pull_count rising in steps of exactly 198–200, and Docker Hub's tag_last_pulled puts every tag's last pull within the same millisecond. The Oct 7 jump of +3,947 has the same shape. Outside those sweeps the counter rises by a few pulls a day.

The digests keep the absolute count and now add two lines:

  • Likely real pulls: the pull_count increase minus bot sweeps and our own CI pulls, with the number of sweeps filtered out.

  • Versions pulled: the tags real pulls went to (e.g. latest ×12, 6.5.0 ×3). The number is how many runs saw that tag pulled, not a pull count, because Docker Hub does not publish per-tag counts.

How it works, in docker-pull-notify.yml:

  • A new step, Fetch Docker Hub tags, reads every tag's tag_last_pulled after it reads pull_count, and records when it finished. Both Docker Hub reads now have a 30-second deadline, so a stalled connection can't hold the job, and through the concurrency group every later run, until GitHub's 6-hour limit.

  • Persist metrics history appends one line per run to data/runs.csv on the metrics branch. Each line splits the increase since the previous line three ways. An interval in which ≥ 20 tags were pulled is a sweep, costing one pull per tag. A long gap holding several sweeps is estimated from what is left once any carried debt is paid, divided by the tag count. Otherwise each -b<N> build tag pulled counts as one CI pull, because ci.yml's post-push check pulls every build it publishes. The rest is real, and the other tags pulled are recorded.

  • bot_debt / debt_since cover Docker Hub showing a sweep's timestamps before its pull_count catches up, possibly by more than one run. Debt that can't be subtracted yet is always applied to the next interval, which holds the late count however long it is. Anything still unpaid carries further only while it is younger than 2 hours. The two failure modes are lopsided: dropping debt too early books a whole sweep (~200) as real pulls, while holding it too long hides a few real ones. A malformed last line starts a new baseline instead of blocking the log.

  • Plan digests sums the log over the same span as the raw delta beside it: every line after the first run of the from day, up to and including the first run of the to day (the daily rows are first-run-of-the-day snapshots). Consecutive windows share no line and miss none, so an interval crossing midnight is counted exactly once. If the log has no line on the from day, the window is empty rather than borrowing an interval from after it. A window that has to start after its first day (no line until later in a weekly window) is labelled partial from that line. A log younger than the window gives a figure labelled "counted since …". With no log, the line is left out and the digest is otherwise unchanged.

Design decisions

  • The run log lives on the metrics branch, not in the Actions cache. Each line's baseline is the previous line. The cache is evicted routinely, which is how the digest baselines broke before. One commit per run, about 70 a day, is acceptable on an orphan data branch.

  • A failed fetch writes no line. The next interval just gets longer, and a failed push heals the same way.

  • Estimates, labelled as such. A tag pulled by a person and then swept in the same interval is lost, and a short burst of real pulls in a sweep interval is only roughly separated. Exact per-tag counts would need Docker Hub's publisher analytics, e.g. via the Docker-Sponsored Open Source program.

Verification

The changed step scripts were extracted from the workflow and run in ubuntu:24.04 with the runner's tools. They were tested against the live Docker Hub tag API (198 tags) and a synthetic sequence: quiet interval, CI build-tag pull, one sweep, a sweep whose count lags one run and then two, two sweeps in one gap, a late count in the same interval as a new sweep, debt kept while young and dropped after 2 hours, a refused duplicate timestamp, a failed fetch, and a malformed last line. Mutants restoring one-run carry, no expiry, and sweeps counted from the raw delta each fail the suite. Every Slack payload variant was parsed as JSON. actionlint reports only the four SC2129 style notes main already had.


fix(engine): price the conversation without converting every step on the current-step path (2026-10-19)

Repo: EDDI · Branch: fix/security-review-authz (carried by #1081 to repair main)

What changed and why

#1066 (group cost ledger) and #1093 (convert only the current step for a turn's response) merged within minutes of each other, each green on its own. Together they broke main: ConversationMemoryUtilities.conversationCost sums audit:cost over every step of the snapshot, and on the current-step path that list is the lazy view #1093 introduced, so pricing the conversation converted every step again. ConversationMemoryCurrentStepConversionTest.convertsOnlyCurrentStep failed, and the default turn response lost the saving #1093 was for.

  • LazyStepSnapshots.conversationCost() sums the live steps' audit:cost entries with one IConversationStepStack.getExactDataPerStep read. Nothing is converted. A step holds at most one value per key, which is exactly what the full conversion sums per step, with the same non-finite and negative filtering.

  • conversationCost(List) uses it when it is handed the lazy view; every other caller is unchanged.

  • New test: with costs on every step, the current-step path returns the same total as the full conversion and still reads only the newest step.


fix(runtime): refuse a conversation start at capacity before any read (2026-10-19)

Repo: EDDI · Branch: feat/turn-admission-hardening (PR #1085)

What changed and why

A profile of a 5,000-user burst against a node held to 2 CPUs (JFR, 2026-10-19) found that turns got only about 17 % of the CPU. Starting conversations took 19 %, and the HTTP event loop took 27 %. Most of those starts were refused for capacity, and each client came back after Retry-After. #1085 already moved the capacity check before any read for say, rerun and streaming. A start, though, still ran the agent access check, resolved the user, read the GDPR restriction from usermemories and looked up the agent before admitTurn refused it.

  • RestAgentEngine.startConversationWithContext now calls refuseIfAtCapacity first. A refused start answers the same 503 capacity_exceeded as before, now with no database read. admitTurn stays the authoritative check.

  • RestAgentEngineCapacityPrecheckTest pins both cases: refused before the access guard and before startConversation, and going ahead when there is capacity. Removing the call fails both tests.

  • docs/metrics.md names the start path among the pre-checked entry points.

Design decisions

  • The internal starts (group members, schedules, sub-agents, A2A) do not pass through this method and are unchanged. They reach admitTurn as before.


perf(audit): the audit ledger signs through signIfKeyPresent; burst-collapse investigation (2026-10-19)

Repo: EDDI · Branch: perf/audit-signing-missing-key

What changed and why

An investigation of throughput collapses under a 5,000-user burst (scripts/loadtest/results/collapse-2026-10-19.md) found that every audit entry did a vault read that was certain to miss. AuditLedgerService.submit signs each entry with the agent's Ed25519 key, on the turn's own thread, and almost no agent has a key. This branch fixed that with a 60 s missing-key cache. Meanwhile #1055 landed an equivalent cache on main (AgentSigningService.missingKeyUntil, with a guard against a lookup racing a key generation), so the merge keeps main's implementation. What this branch still adds:

  • AgentSigningService.signIfKeyPresent, used by the audit ledger. While a "no key" answer is remembered it returns null without throwing. Through sign, a remembered miss still builds three exceptions per entry (SecretNotFoundException, PrivateKeyLoadException, AgentSigningException), about 8,000 of each in one profiled burst. sign keeps its contract.

  • The investigation's results file. Host contention triggers the collapses; on 2026-10-18 that is stated as a hypothesis, since no host telemetry covers the worst runs. On scarce CPU, EDDI spent most of it outside turns. Its follow-ups are the unfired 60 s turn timeout, /q/metrics going unresponsive and turns that run after their caller has gone.

  • docs/configuration-reference.md described eddi.audit.agent-signing-enabled as signing agent configurations. It signs audit entries, and the row now says so, including the 60 s re-check.

Design decisions

  • On the merge conflict with #1055, main's cache won outright: it also guards the race in which a lookup that started before generateKeyPair publishes its miss afterwards. This branch's own cache, a Caffeine cache with a 10,000-key cap that came out of review, was dropped rather than merged in.

  • Tests: three signIfKeyPresent cases in AgentSigningServiceTest (null without a second vault read, a present key, a vault failure still thrown), and AuditLedgerServiceBranchTest covering the unsigned-entry path.


fix(security): the four leftovers of the 2026-10-17 security review (2026-10-18)

Repo: EDDI · Branch: fix/security-review-leftovers

The 2026-10-17 review was remediated in PRs #1079–#1094. Four items were left on purpose and are closed here, one commit each.

1. Keycloak refuses the admin/admin fallback off loopback

docker-compose.auth.yml falls back to admin/admin for the Keycloak bootstrap admin so the loopback quick start needs no .env. That was safe only while KEYCLOAK_BIND stayed on loopback, and nothing enforced it. A new one-shot keycloak-guard service, the same pattern as docker-compose.yml's bind-guard, now exits 1 (and Keycloak, which waits for it with service_completed_successfully, never starts) when KEYCLOAK_BIND is not loopback while KC_BOOTSTRAP_ADMIN_PASSWORD is unset or admin. It reads both values from its own environment with the defaults the keycloak service uses. It runs on the Keycloak image the overlay pulls anyway, so it adds no image to either base stack (docker-compose.postgres-only.yml's own guard avoids the mongo image for the same reason). The installers and gcp/provision-vm.sh already generate a password, so their paths pass unchanged.

  • ComposeStackTest pins the wiring (dependency condition, same password expression, same bind variable as the published port) and runs the guard script itself through sh for five bind/password combinations; that test is skipped only where no POSIX sh is on PATH. adminPasswordsAreOverridable now checks that each admin-password variable appears at least once, since the guard repeats KC_BOOTSTRAP_ADMIN_PASSWORD.

  • Verified by hand with docker compose run keycloak-guard against loopback, 0.0.0.0 with no password, with admin, with an empty one and with a real one.

3. The release signs SHA256SUMS, and the installers verify it

PR #1088 made the release publish a SHA256SUMS that install.sh / install.ps1 check every download against, but the list itself was unsigned, so whoever could replace one release asset could replace both. The release job in ci.yml now gets id-token: write, installs cosign with the same pinned installer as the image job, signs the list keyless (cosign sign-blob --yes --bundle SHA256SUMS.sigstore.json SHA256SUMS), verifies the bundle against the exact identity the installers demand, and attaches it to the release.

Both installers, when cosign is on PATH, fetch the bundle from the same release and run cosign verify-blob with --certificate-identity https://github.com/labsai/EDDI/.github/workflows/ci.yml@refs/tags/<tag> (exact, not a regexp: the certificate must name this release's own tag) and --certificate-oidc-issuer https://token.actions.githubusercontent.com, BEFORE any hash in the list is trusted. A list that fails stops the install. Without cosign they print one warning line, and a release from before the bundle existed is used unsigned with a warning. Releases cut before this change keep working.

  • Tests: InstallerReleaseRefTest.checksumListIsSignedAndVerified checks the release job and both installers as text, including that verification precedes trust. shellVerifiesTheChecksumSignature runs install.sh's own functions with a stub curl and a stub cosign: one warning without cosign; the exact identity, issuer and bundle URL with it; refusal on a failed verification; the unsigned fallback when there is no bundle. It was mutation-checked by forcing verification to pass. The PowerShell function was run the same way by hand, with a stub cosign.cmd, in all four cases.

  • Not verified end to end: keyless signing needs the GitHub OIDC token, so the first real signature appears on the next release tag. The job verifies it before publishing.

  • Docs: docs/security.md, "Installer Downloads", with the manual cosign verify-blob command.

4. read_audit_trail no longer shows a USE-only owner the agent's prompt

Finding: yes, it did. LlmTask writes audit:compiled_prompt as the compiled system message, ---, and the processed prompt template; LifecycleManager.buildAuditEntry copies it into AuditEntry.llmDetail.compiledPrompt, and the MCP read_audit_trail tool returned entries as stored to any eddi-viewer who owned the conversation. Under enforced workspaces an agent shared with USE lets the recipient chat with it but not read its configuration, so the audit trail of their own conversation was a way around that. (/auditstore over REST and the GDPR export are eddi-admin only and unaffected.)

McpConversationTools now replaces compiledPrompt with a redaction marker unless ResourceAccessGuard.hasAccess(agentId, VIEW) holds. That answers OWN for an admin and whenever workspaces are not enforced, so nothing changes there. VIEW on the agent rather than on each LLM config: sharing materialises the agent's level onto its config graph (ConfigGraphResolver), so it is the same decision without a graph walk per entry. Model name, token usage, cost and the model's reply stay; the access lookup is made once per agent per call and skipped for entries with no prompt. Tests in McpConversationToolsOwnershipTest pin both halves (USE-only owner gets the marker and no prompt text; VIEW passes the entry through untouched), mutation-checked by reverting the call.

2. EDDI connects to MongoDB as its own user, not as root

Compose, Helm and the kustomize MongoDB overlay connected EDDI as the MongoDB root user with authSource=admin, so anything that could read EDDI's connection string held the whole server. EDDI now connects as eddi_app, defined in the eddi database with readWrite and dbAdmin there and nothing elsewhere (dbAdmin because MongoResourceStorage un-hides an index with collMod, which readWrite lacks).

  • Not an initdb script, deliberately. The mongo image runs /docker-entrypoint-initdb.d only on an empty volume, so every existing deployment would have pointed EDDI at a user that does not exist. Instead a helper with the root credentials creates the user, or resets its password and roles, on every start: a one-shot mongodb-app-user service that eddi waits for in docker-compose.yml, docker-compose.openwebui.yml and docker-compose.cluster.yml, and an ensure-mongodb-user init container (restricted-PSS security context, bounded wait for MongoDB) in the Helm Deployment and in k8s/overlays/mongodb. Existing Compose and Helm installs migrate on the next up / helm upgrade, and changing the app password rotates it.

  • Defaults that do not break an existing install. Compose's MONGO_APP_PASSWORD falls back to the root password (documented as "set a distinct one"). Helm's mongodb.appPassword falls back to sha256("eddi-app:" + rootPassword): stable across renders without lookup, distinct from and not reversible to the root password. Kustomize's operator-created Secret gets two new keys in the documented command; for an old Secret the MONGO_APP_* references are optional and the init container does nothing, so EDDI keeps working as root until the documented patch is applied.

  • The mongodb healthchecks no longer carry the root password (ping needs no auth).

  • Helm chart 2.9.0 → 2.10.0 (new values mongodb.appUsername, mongodb.appPassword).

  • Docs: docs/upgrading-from-6.5.md (new "MongoDB least-privilege user" section, plus the Keycloak guard from item 1), docs/docker.md, docs/kubernetes.md, docs/troubleshooting.md, .env.example.

  • Tests: ComposeStackTest.eddiDoesNotConnectAsMongoRoot and DeploymentManifestsTest.helmEddiDoesNotConnectAsMongoRoot / kustomizeEddiDoesNotConnectAsMongoRoot (both mutation-checked); the CI manifest-lint step now checks the app password is URL-encoded and that the root password never reaches EDDI's connection string.

  • Verified in Docker with labsai/eddi:6.5.0: a volume written by the old root-connected stack, restarted on the new compose file, keeps its data, EDDI writes as eddi_app, a second up updates rather than fails, eddi_app is refused on admin, and a fresh volume works. The init container's script was run as uid 185 on a read-only root filesystem with all capabilities dropped, against a MongoDB still starting up. helm template/helm lint (default, existingSecret, PostgreSQL-only, special-character password) and kubectl kustomize of every overlay and example render.

  • Not changed: scripts/loadtest/docker-compose.loadtest.yml (a load-test harness, still root) and k8s/quickstart.yaml (its MongoDB runs without authentication at all).

Review follow-ups (CodeRabbit on #1099)

  • Keycloak, an existing admin/admin volume. keycloak-guard sees only the configured password, and Keycloak reads it on first boot only, so a volume first started with the default kept that login whatever .env said. A new one-shot keycloak-admin-rotate runs once Keycloak is healthy and before EDDI starts: when a non-default password is configured and admin still logs in, it resets the account to the configured password through kcadm, password on stdin. The window in which such a volume is published with the old login is now Keycloak's start-up, not indefinite. Verified live: admin accepted, rotation, admin refused, the new password (with a quote and a backslash) accepted, second run a no-op. ComposeStackTest pins the wiring.

  • MongoDB helper: root password off the command line. All five copies (three compose files, Helm, kustomize) now authenticate with db.auth(process.env…) inside --eval, so the root password is no longer in mongosh's argv (/proc/<pid>/cmdline).

  • MongoDB helper: concurrent starts. Several replicas starting at once could race between getUser and createUser; a 51003 (user already exists) now falls through to updateUser. Verified with four init containers started at the same moment: all exit 0.

  • Signed releases fail closed. A missing SHA256SUMS.sigstore.json used to be taken for a release from before signing. From 6.6.0, the first signed release (pre-releases included), the installers refuse when cosign is installed and the bundle cannot be fetched; older tags keep the unsigned-with-warning path. Tested in InstallerReleaseRefTest (9.8.7 and 6.6.0-RC1 refused, 6.5.0 warned) and by hand for install.ps1.

  • Redacted audit entries carry no signature. The copy read_audit_trail returns with the prompt redacted no longer keeps the original hmac and agentSignature, which covered the unredacted payload and would have made an intact entry look tampered.

  • Second review round. keycloak-admin-rotate passes -n to kcadm update … reset-password (that endpoint has no GET; re-verified live). From 6.6.0 a missing SHA256SUMS stops the install too, with or without cosign, since without it no download is checked; older tags keep the warning. mongodb-app-user in docker-compose.yml warns when MONGO_APP_PASSWORD is unset or equals the root password. Failing in that case would break every existing install and the zero-config quick start. TLS between the compose services stays out of scope, as the review document records ("plaintext intra-service traffic").

  • No start-up window for an old Keycloak volume. keycloak-admin-rotate now leaves a marker (.eddi-admin-verified) in keycloak-data once it has seen admin refused, and keycloak-guard, which mounts the volume read-only, refuses a non-loopback bind for an existing volume (one with an h2 directory) without it. The default login of an old volume is therefore never published, not even for the seconds before the rotation; such a volume is started once on loopback. Verified live: old volume refused off loopback, rotated on loopback, then accepted; a fresh volume accepted at once. ComposeStackTest runs the guard against a volume with and without the marker.


docs(loadtest): adaptive turn limit judged with Retry-After-honouring clients — dropped (2026-10-18)

Repo: EDDI · Branch: docs/adaptive-limit-retry-measurement (on top of feat/turn-admission-hardening)

What changed and why

The adaptive turn limit parked on 2026-10-17 lowers eddi.conversation.max-in-flight-turns while the mean MongoDB pool wait exceeds 100 ms. It had been judged with k6 clients that ignore Retry-After. It has now been measured again with the benchmark suite's --retry-503 10 clients (PR #1086): limiter off against on, down -v before every run, 2,500 conversations × 10 turns and a 5,000-user burst, 3 s mock LLM, three rounds. The results and the method are in scripts/loadtest/results/admission-2026-10-17.md. No code changes.

  • Not shipped. On a quiet machine the limiter gained 12–15 % goodput in the steady scenario, cut its p99 and left the p95 even. But it abandoned turns in every burst run (603 and 102) and in the contended steady run (1,464), against 0 with it off. That fails the ship criterion: the limiter must beat "off" without raising abandoned turns.

  • The pool-wait signal does not track database saturation. A per-second sampler put it next to mongod opcounters, globalLock queue and CPU. Pool wait correlated negatively with mongod ops/s in nine of ten runs. The wait was high while mongod ran at a fraction of its peak, with free pooled connections and an empty lock queue. It measures CPU contention in the EDDI JVM, which is why another stack's load test drove the limit down to 92. mongodb_driver_pool_waitqueuesize moves with it, so it is no better.

Design decisions

  • No replacement signal was built. A signal that really measured MongoDB saturation would not have fired in these runs (mongod stayed far below its peak), which is the same as "off". The steady gain points at CPU instead: a static max-in-flight-turns sized to CPU, rather than to heap, is the next thing to measure.

What's next

  • Delete the local branch wip/adaptive-turn-limit (commit 63659ba18) once the user agrees.

  • Measure a CPU-sized static in-flight limit against auto with the same retrying clients.


docs(loadtest): static, CPU-sized in-flight turn limit measured against auto — default unchanged (2026-10-18)

Repo: EDDI · Branch: docs/static-turn-limit-measurement (on top of feat/turn-admission-hardening)

What changed and why

The adaptive limiter measured earlier the same day gained steady goodput while it held in-flight turns at about 900–1,900. That suggested a static eddi.conversation.max-in-flight-turns, sized to CPU rather than heap, might keep the gain without a controller. This was measured against the default auto (2,602 at -Xmx6g) on 20 cores, with the benchmark suite's --retry-503 10 clients (PR #1086). Scenarios: 2,500 conversations × 10 turns, and a 5,000-user burst, both with a 3 s mock LLM. Each run started from down -v, configurations were interleaved, and there were 2–7 uncontended rounds per configuration (36 runs). The results are in a new section of scripts/loadtest/results/admission-2026-10-17.md. No code changes.

  • Steady: 2000 and 1500 tie with auto (median 228–234 turns/s, p95 including backoff about 20–22 s). 1000 and 600 abandon turns (45 and 619) without gaining throughput, and 600 loses a third. No static limit reproduces the adaptive limiter's 12–15 % gain.

  • Burst: 2000 has the higher unpaired median (333 against 275 turns/s) and a narrower range (281–355 against 185–427). Paired by round it is a tie: three wins each, median difference +2.5 turns/s. It also abandons turns (9 over six runs against 0 over seven) and has 3–4 s worse p95 and p99 totals. 1500 and below abandon 70–2,000 turns per burst.

Design decisions

  • No new default. No candidate beats auto without raising abandoned turns, the same criterion the adaptive limiter failed. With closed-loop clients that honour Retry-After, a lower limit moves the waiting from EDDI's queue into client backoff while throughput stays where the CPU puts it.

  • About 2,000 is a deployment choice, not a default. It is documented as an option for operators who want a predictable burst floor more than the best case.

What's next

  • Nothing on admission control. A CPU-aware limit would need EDDI's own share of each turn's latency, which EDDI cannot measure without timing every LLM call.


⚡ perf(startup): derive the audit keys while the vault derives its KEK (2026-10-18)

Repo: EDDI (perf/startup-parallel-kdf)

What changed and why

Thread dumps of the main thread during boot showed it in PBKDF2 twice, one after the other: the audit ledger's HMAC key (AuditKeyring.initialize → AuditHmac.deriveHmacKey) and the vault KEK (EnvelopeCrypto.deriveKeyFromString from VaultSecretProvider.onStartup). Each is 600,000 iterations of HMAC-SHA256, a few hundred milliseconds, and they share no input.

  • AuditKeyring.deriveEarly is a new StartupEvent observer at APPLICATION - 100, ahead of the vault's at APPLICATION. It starts initialize() on a virtual thread and returns, so the audit keys are derived while the main thread loads the vault salt and derives the KEK.

  • The join is the existing lock. AuditKeyring.onStartup (APPLICATION + 100) and every key accessor call initialize(), which waits on the keyring's monitor until the derivation is done. The volatile initialized fast path and the synchronized double-check are unchanged, so the keys are complete before readiness and before the first entry is signed.

  • initialize() is no longer a @PostConstruct. Arc instantiates the bean on the thread that first touches it — the observer's, the main one — so a @PostConstruct derivation would have run inline again. Every method that reads a key already called initialize() first; fromMasterKey still does.

  • Failure is not swallowed. If the early derivation throws, initialized stays false and the next caller derives again on its own thread and sees the exception, as before.

The KDF, salts, iteration count and therefore every key are unchanged: existing signatures and vault entries verify as before.

Tests

StartupKeyDerivationTest pins both derivations to known answers computed outside the JVM (Python hashlib.pbkdf2_hmac), checks that keys derived through deriveEarly equal those from an inline initialize(), and that deriveEarly returns without doing the work itself. Mutation-checked: 600,001 iterations in AuditHmac or in EnvelopeCrypto, and running the early derivation inline, each fail it.

Measured

Fast-jar boots of origin/main and this branch, built with -DskipUi=true, against a local MongoDB 7 with a vault master key set, 8 runs each in alternating order after one discarded warm-up (Windows 11, JDK 25.0.1, a host shared with other work):

started in median (min)

to /q/health/ready median (min)

before

4.03 s (3.51 s)

4.90 s (4.42 s)

after

3.52 s (3.17 s)

4.48 s (4.21 s)

About 0.4–0.5 s off a ~4 s boot. The spread between runs is of the same order, so read it as "one PBKDF2 derivation leaves the critical path", not as a precise figure. On a cold, contended container the derivations are slower, and so is the saving.


feat(loadtest): benchmark suite — streaming TTFT, cluster scaling, group discussions, DB-ops CI gate (2026-10-17)

Repo: EDDI · Branch: feat/loadtest-benchmark-suite

What changed and why

EDDI leads on concurrent stateful conversations per node, but nobody — EDDI included — publishes numbers for stateful multi-turn load, time to first token overhead, scaling efficiency or multi-agent throughput. This extends the load-test harness so those numbers can be published reproducibly and regressions caught. Nothing under src/main changed.

  • stream: time to first token over EDDI's SSE endpoint (POST /agents/{id}/stream) and over POST /v1/chat/completions with stream: true, against the same streamed request sent straight to the mock as calibration; overhead = EDDI's TTFT minus the mock's, per percentile. The WireMock stub streams equal-length SSE events with chunkedDribbleDelay, so each slice is exactly one event, with a configurable first-chunk delay, token count and spacing. Driver: drivers/stream_driver.py, asyncio on the standard library, in a pinned python image on the compose network.

  • --retry-503 N (k6 RETRY_503, off by default so earlier results stay comparable): a client that honours 503 + Retry-After (capped, jittered) and resends the same turn up to N attempts; reports latency including backoff, attempts per turn and abandoned turns. Requested by the admission-control work, whose shedding otherwise read as collapsed goodput. LOADTEST_COMPOSE_EXTRA adds compose overrides for EDDI settings under test (overrides/in-flight-100.yml). Measured live (laptop, results/retry-2026-10-18-report.md): 500 conversations against 100 in-flight turns, 1 s mock, fresh database each: the default client completed 339 of 2,500 turns (17.5 turns/s, 762 failed starts); the retrying client 2,404 (43.3 turns/s, 74 abandoned, 22 failed starts), with p95 including backoff of 18 s. The first live run showed refused starts were not retried, so starts now back off too.

  • Overhead as a first-class metric: every turn run reports turn_overhead (latency minus the mock's delay) at p50/p95/p99.

  • Cluster scaling is main's cluster mode (labsai/EDDI#1092, cluster-matrix), which landed while this branch was open. This branch first had its own up --nodes N / scaling overlay for the same purpose; merging main removed it rather than keep two cluster paths (cluster-* is a full stack with a three-node NATS cluster and per-node metrics). The laptop sample's scaling section was measured with the removed path; report no longer renders scaling, cluster-matrix writes its own results/cluster-scaling-<date>.md.

  • group: N-member group discussions (POST /groups/{id}/conversations, k6 groups.js); member turns per second across members.

  • gate and .github/workflows/loadtest-db-ops.yml (manual dispatch, nightly, PRs touching the harness): a fixed scenario on a GitHub runner fails when MongoDB operations per turn exceed thresholds/db-ops-mongo.json. Throughput and latency are artifacts, not gates.

  • report: one Markdown benchmark page per label — hardware, image digests, build commit, JVM, method, every number, and the exact commands (with their LOADTEST_* variables) to reproduce it. Sample: results/laptop-2026-10-17-report.md.

  • up --db postgres: PostgreSQL with pg_stat_statements; database operations per turn are statement executions by verb.

  • Sharing a machine: compose files are split (base, mongo, postgres, app, cluster) and COMPOSE_PROJECT_NAME keeps stacks apart. Before a measurement the driver waits while another stack's k6/SSE container runs, and a result measured while one appeared records contended_by (⚠ in the report).

Design decisions

  • A Python SSE driver, not k6 + xk6-sse. xk6-sse needs a custom k6 build (Go toolchain, xk6, a community extension, each to pin); one standard-library file in a pinned image has nothing to build or drift, and its definition of "first token" is readable in place.

  • What the gate gates. Document counts for insert/update/delete and the operations on the collections a turn touches itself (conversation memory, descriptors, vault, user memory) are identical run to run. Reads of agents, workflows, quotas and the audit ledger follow the clock (cache refresh, batched flushes) and grow on a slower runner. The audit ledger flushes from a queue every 3 s, which first moved the insert total by a batch either way on short runner runs (3.8 and 2.66 vs 3.2 per turn); every measurement now waits for that queue to drain plus one flush interval before each snapshot. The clock-driven reads are reported and covered only by a loose total-query ceiling (5 ops of headroom). Measured: 3 runs on this laptop agreed to 0.01 per turn on every per-collection counter, and the first GitHub-runner run matched them exactly.

  • Ceilings in git, not the Actions cache, which evicts entries at its size cap.

Measured (laptop, not publishable)

See the sample report. On 4b83ffb8b: about 22.5 MongoDB operations per turn (17 queries, 3.2 inserts, 2 updates); streamed tokens reach the client unbuffered on both paths (token spread equal to the mock's).

Next

  • Run the suite on dedicated hardware for publishable numbers.

  • When a round-trip cut (labsai/EDDI#1055 and its follow-up) lands, the gate reports "well below": lower the ceilings with gate --record in that PR.

  • Not diagnosed: at 10–50 conversations with a 0–100 ms mock the laptop shows EDDI overhead p50 135–190 ms and p95/p99 stalls of 1.5–5 s; check on an idle machine before reading anything into it.


🩹 fix(manager): self-hosted provider hints on the operator activation screen (2026-10-17)

Repo: EDDI (feat/llm-openai-compatible-provider)

Browser-checked the self-hosted provider in the agent wizard and operator activation. The wizard explained the required model id and Base URL; the operator activation screen showed both fields bare. It now shows the same hints (reusing the wizard's strings) and links them to the inputs with aria-describedby. Files: operator-activation.tsx.


🩹 fix(manager): webhook channel — explain the options, label every field (2026-10-17)

Repo: EDDI (feat/channels-signed-webhook)

Browser-checked the webhook channel in the create dialog and on the detail page. Fixed: the signature scheme and conversation strategy were bare identifiers (now a one-line explanation of the chosen option); the generic-HMAC and event-type inputs had only placeholders and untranslated English aria-labels such as signatureHeader (now visible, translated labels); the last create step talked about trigger keywords, which a webhook does not have; those grids now stack on a narrow screen. A Billing Webhook entry was added to the mock channel store. Files: webhook-settings.tsx, create-channel-dialog.tsx.


Fewer MongoDB round trips per turn, part 2 (2026-10-17)

Repo: EDDI · Branch: perf/turn-db-roundtrips, stacked on perf/turn-mongo-roundtrips (#1055)

What #1055 left of Phase 1 of the throughput plan (WS1, WS3a, WS3f). Measured with scripts/loadtest against #1055 merged with main: MongoDB round trips per turn 9.4–10.6 → 6.3–6.8 (queries 7.1–8.2 → 4.2–4.5; 19.6 on main before #1055). conversationmemories reads per turn 4.1 → 2.1, audit_ledger up to 1.1 → 0.1, agents + workflows up to 0.3 → 0. Throughput and p95 improved in every run, but the laptop was shared with other load tests, so the latency numbers are indicative only. Details in scripts/loadtest/results/p1-roundtrips-2026-10-17.md.

What changed

  • Turn start reads state and revision once (ConversationStepRunner.runConversationStep). The queued-say guard read the stored state and the stale-snapshot guard (reloadIfSuperseded) read the stored revision, two projection reads of the same document. IConversationMemoryStore.getStateAndRevision answers both in one read (MongoDB projection, PostgreSQL SELECT). Its default returns null, and then the caller asks the two old methods, so a store or a test double that predates it behaves exactly as before.

  • No committed-state read for a turn that was not paused. The persist callback's finally passed committedStateOrError(...) to DeferredDelivery.deliver, a no-op unless a paused completion was deferred. Java evaluated the argument anyway: one state read per turn for nothing. It now reads only when a delivery is pending.

  • The audit collision check is one query per flush (AuditLedgerService.detectForeignSequenceAllocation). It asked maxSequence once per conversation in every flushed batch, about one read per turn under load, on connections the turns wait for. IAuditStore.maxSequences answers the whole batch: MongoDB $sort on the (conversationId, sequence) index plus $group/$first, PostgreSQL one indexed MAX per id over unnest. The default loops maxSequence, as before. The seed itself was already once per conversation on both paths: the single-node counter table, and the NATS KV counter in cluster mode. The detector does not run in cluster mode, where positions come from the shared counter.

  • WS1: WorkflowTraversal no longer expires after 2 s. Turns of one conversation are rarely 2 s apart, so practically every LLM turn re-read the agent, its workflows and their extension configs. Agent, workflow and extension versions are immutable, so the traversal cache is now a size-bounded Caffeine cache (1,000 entries) with no TTL. Entries for an agent are dropped by the same AgentFactory deploy/undeploy hook that clears #1055's AgentConfigurationCache. Only complete traversals are cached, as before. The callers only read the cached configs (checked: LlmTask, HttpCallToolsProvider, McpToolsProvider, RagContextProvider, TurnBudgetValidator); the 2 s cache already shared them between concurrent conversations.

Looked at, not changed

  • Inserts (3.1 per turn in opcounters) are already batched. The counter counts documents: about 3 audit entries per turn, written as one insertMany per flush (the profiler showed 300 entries in one command). The only other inserts are one conversation document and one descriptor per new conversation.

  • GdprComplianceService.isProcessingRestricted is the remaining usermemories read on every turn (about 1 per turn). Caching it needs a product and security decision about cluster invalidation, so it stays uncached by design. The existing opt-in TTL (eddi.gdpr.restriction-cache-ttl-seconds) is unchanged.

Tests: ConversationServiceTurnStoreReadsTest (a whole say turn through the real BaseRuntime, counting conversation-store calls, plus the fallback path and the superseded-turn reload), AuditLedgerServiceTest.theCollisionCheckIsOneReadPerFlush, maxSequences against real MongoDB and PostgreSQL, and WorkflowTraversalCacheTest (no expiry with time, per-agent invalidation, a degraded traversal is not cached). All were mutation-checked.


chore(deploy): production-sized runtime defaults for the image, Helm and Kustomize (2026-10-17)

Repo: EDDI · Branch: chore/enterprise-runtime-defaults

What changed and why

The defaults fitted a laptop demo, not the load profile the throughput work measured. EDDI waits on LLMs far more than it computes, so memory, not CPU, decides how many conversation turns a node runs at once. Each in-flight turn holds its conversation (about 1 MB for short conversations in the load-test harness). The old defaults were a 1 GiB limit at the image's 50 % heap ratio, i.e. a 512 MB heap, and ParallelGC, which stops every thread on a full collection.

  • Image (Dockerfile):

    • JAVA_MAX_MEM_RATIO=75.

    • GC_CONTAINER_OPTIONS=-XX:+UseG1GC, replacing run-java's ParallelGC.

    • -XX:+ExitOnOutOfMemoryError on JDK_JAVA_OPTIONS, so the flag survives an operator's JAVA_OPTS. A JVM out of heap exits and is restarted, instead of holding its turns and leases.

  • Helm eddi.resources and the Kustomize base: request 1 CPU / 3 GiB, limit 4 CPU / 3 GiB.

    • Memory request = limit, for Guaranteed QoS.

    • A CPU limit is kept because the JVM sizes its GC, carrier and Jlama threads from it.

  • Production overlay: request 2 CPU / 4 GiB, limit 4 CPU / 4 GiB.

  • Quickstart: 1 GiB request, 2 GiB limit (was 384 Mi / 1 Gi).

  • docker-compose.yml: ulimits.nofile 65536.

  • Docs: a "Sizing a node" section in docs/kubernetes.md, and the Jlama memory note in docs/langchain.md. In-process Jlama weights are memory-mapped outside the heap, so lower the ratio and add the model size to the limit.

Design decisions

  • G1, not ZGC, as the default. G1 is the JDK's own server default and fits heaps of a few GB. ZGC is documented as the override for heaps of 8 GB and more.

  • Keep a CPU limit. Removing it avoids CFS throttling, but the JVM would then size its threads for every core of a large node. The limit stays, set generously (4) with a request of 1.

  • No bump to the dependency charts (MongoDB, PostgreSQL, Keycloak). Size them per installation.

Not yet verified

  • The image's JVM command line (heap ratio and GC through run-java) was not checked against a real container. Docker was unavailable when this was committed.

  • G1 vs ParallelGC under load (p99 and the longest pause at 1000 conversations) is still to be measured with scripts/loadtest.


📦 chore(deps): dependency refresh before the 6.6.0 release (2026-10-17)

Repo: EDDI (chore/release-6.6.0-deps)

What changed and why

A last pass over every pinned dependency before tagging 6.6.0. pom.xml already says 6.6.0 (the 6.5.0 post-release PR set it), so this changes no project version, only libraries and the Node toolchain.

  • Maven. Every version literal in pom.xml was checked against Maven Central. Dependabot had already brought Quarkus (3.40.1), langchain4j (1.22.0 / 1.22.0-beta32), the Jackson overrides and the plugins to their latest releases. The only patch or minor still open was classgraph 4.8.196 → 4.8.199.

  • Node 24.21.0 → 24.22.0 (latest 24 LTS patch), moved in all the places BuildQualityGatesTest keeps equal: pom.xml node.version, ci.yml NODE_VERSION with NODE_SHA256_LINUX_X64 (the linux-x64 .tar.gz line of the release's SHASUMS256.txt), and mise.toml. Both UI READMEs name the pinned version and were updated to match.

  • Manager and Chat UI. npm update --save inside the existing semver ranges, run with Node 24.22.0 / npm 11.19.1. This includes React 19.3.1, Vite 8.3.4, Vitest 5.0.5 (covers the open Dependabot vitest-group PRs), eslint 10.13, typescript-eslint 8.71.2, Playwright 1.64.1, Radix UI minors, TanStack Query, i18next / react-i18next, lucide-react 1.59 (Manager), zustand and the fontsource packages. The Manager lockfile also deduplicates about 30 nested entries. The earlier advisory overrides still apply: the Chat UI ships a single katex 0.19.0 and the Manager resolves postcss-selector-parser 7.1.6.

Deliberately not updated (majors that need their own migration)

Dependency
Current → available
Why not now

com.networknt:json-schema-validator

1.5.9 → 3.0.8

Rewritten API; the shared-artifact validators need porting

de.undercouch:bson4jackson

2.18.0 → 3.x

Built on Jackson 3, which the ban-jackson3 enforcer rule blocks

com.github.victools:jsonschema-*

4.38.0 → 5.0.0

Also built on Jackson 3 (tools.jackson), so the same enforcer rule blocks it

io.github.classgraph:classgraph

→ 5.x / 6.x

Major release; patch line taken instead

io.projectreactor.netty:reactor-netty-http

1.2.18 → 1.3.x

Needs Netty 4.2; Quarkus still manages 4.1 (see the pom comment)

typescript

5.9 → 7.0

Native compiler port; its own PR

msw (Manager)

2.15 → 3.x

Major release; the mock layer needs migrating

lucide-react (Chat UI)

0.577 → 1.x

Major release with renamed icons

@types/node

24 → 26

The runtime is Node 24; the types follow it

Verification

./mvnw clean compile; Chat UI lint, typecheck, all tests and build; Manager typecheck, lint, i18n:check, build and the full vitest run (592 files, 8551 tests); BuildQualityGatesTest and the repo-wide guard tests (243 tests, three failures in DeploymentManifestsTest's PowerShell create-secrets.ps1 stub tests, which fail the same way on an untouched origin/main checkout on the Windows machine used, so they are environmental). The full backend unit suite, the integration tests and the E2E jobs were left to CI.

Files: pom.xml, .github/workflows/ci.yml, mise.toml, ui/manager/package.json, ui/chat/package.json, both package-lock.json files, both UI READMEs.


docs(planning): conversation storage layout design, steps as records (2026-10-17)

Repo: EDDI · Branch: docs/conversation-storage-design

What changed and why

planning/memory-architecture-plan.md gains §11, Conversation Storage Layout (Phase G). This is the long-term design the throughput plan's WS6/WS7 asked for. Today one conversation is one document (MongoDB) or one JSONB value (PostgreSQL), loaded in full twice per turn and, on PostgreSQL, rewritten in full on every append.

Load tests on the WS2 build measured the cost over 200-turn conversations:

  • turns slow down 1.6–1.9× on MongoDB and 2.2–2.5× on PostgreSQL;

  • PostgreSQL runs at 61–83 % of MongoDB's throughput;

  • 62 % of PostgreSQL's database time goes to the append;

  • PostgreSQL stores 256 kB of live data in 28 MB.

The design:

  • Layout: a small header (CAS-updated every turn, with new stepCount and lastInteraction fields) and one record per step (MongoDB conversationsteps, keyed {c, i}; PostgreSQL conversation_steps with primary key (conversation_id, step_index)).

  • Reads: a turn loads the header and a window derived from the agent's existing history/summary settings; older steps are fetched lazily by page, so every consumer keeps its semantics and absolute indexes.

  • Writes: an append writes only new records, in one transaction on PostgreSQL and through a unique-key claim on MongoDB (no transactions needed). Undo, redo, rerun and HITL commits become narrow updates instead of full rewrites.

  • Data and rollout: full history stays stored and readable through every surface (AGENTS.md §4.7). Migration is online behind eddi.conversation.storage.layout, with conversion on first write, a background sweep and its reverse for downgrades. Header digests later replace the commonest all-history scans.

Also:

  • Phase G is added to §7 and its targets to §10.

  • §3.4.1 now says that compaction changes what the LLM is given, not what is stored. It used to say the summary "replaces the raw history in IConversationMemory", which contradicted §4.7.

Next

G1 (header counters) is small and independent. The rest waits for WS3a (one full load per turn).


Manager UI for agent test suites ("golden conversations") (2026-10-17)

Repo: EDDI (ui/manager) · Branch: feat/manager-agent-tests, based on feat/agent-test-harness (labsai/EDDI#1065) — merge after it.

The regression harness from #1065 had no Manager UI; suites and runs were reachable only over REST and MCP. This adds it (WS6 phase 6.2, UI part).

What changed

  • Test suites are a resource type (testsuite, store /testsuitestore/testsuites) in RESOURCE_TYPES, so list, create, edit, version history and delete come from the existing Resources pages. The form editor (components/editors/test-suite-editor.tsx, registered in EDITOR_MAP) covers defaults, tool mocks, cases, turns and every expectation field; the JSON tab stays available. Expectation fields are folded away per turn (progressive disclosure). Half-typed JSON never overwrites the last valid value.

  • Agent detail → "Golden conversations" (components/agent-tests/agent-tests-section.tsx), collapsed by default and outside the draft fieldset: pick a suite, Run (POST /agenttests/runs, runs the saved agent version against the suite's current version), run history from GET /agenttests/runs?agentId=. The list polls while any run is RUNNING.

  • Run result side sheet (run-result-sheet.tsx): per case → repetition → turn pass/fail, each failed expectation with expected and actual side by side, cost and duration, and tool calls that had no mock highlighted. ABORTED, ERROR and a cost-ceiling stop each get a notice saying the agent was not judged (or why the run stopped) and what to do.

  • i18n: 129 keys in all 11 locales.

  • Mocks: test/mocks/agent-test-fixtures.ts + agentTestHandlers (passing, failing, aborted, error and ceiling runs; a started run turns PASSED after 4 s). The OpenAPI contract test stays green with no new exemptions.

Decisions

  • ResourceTypeConfig gains duplicable: false and jsonSchema: false: the suite store has no POST /{id} duplicate and no GET /jsonSchema, so the Manager does not offer or request them rather than shipping a 404 (the snippet/parser drift in the contract test's exemption list is the precedent we avoided repeating).

  • api-client keeps a 202 body when it parses. It used to return undefined for every 202, which dropped the run id POST /agenttests/runs answers with. 202s with an empty or non-JSON body behave as before.

  • ClusterDrawer gained an optional widthClass so the run sheet can be wider; no other caller changes.

  • Operator prompt and allow-list now include agent test suite and run access, so operator-revision.json is bumped past main's revision with the new provisioning fingerprint.

  • en.json and the other locales lose one duplicated block of decisionSummary* keys (the file already defined them twice; JSON keeps the last one) as a side effect of re-serialising — no value changes.

Verified: npm run typecheck, lint, i18n:check, and the unit suites for resources, editors, lib, hooks, i18n, mock contract and the new components; plus a headless-Chrome walkthrough in MSW mock mode (passing run, failing turn, aborted, error, run-in-progress → passed, suite editor, suite list). Screenshots are in the session notes folder.

Not done / next: generate-a-suite-from-a-conversation, an LLM-judge expectation and a deployment gate (all listed as follow-ups in docs/agent-testing.md); a Playwright e2e spec for the new screens.


💰 feat(manager): cost controls — per-conversation ceiling and a legible tenant budget (2026-10-17)

Repo: EDDI (feat/manager-cost-controls) — Manager UI for the backend in the tenancy cost-metering PR (feat/tenancy-cost-metering)

What changed and why

Two cost settings shipped on the backend without a screen, and the tenant budget was still presented as a plain number.

  • Agent detail → new "Limits" section (agent-config-sections.tsx) with maxCostPerConversationUsd. Empty means unlimited and removes the field from the document (never null or -1); 0 is kept as a real ceiling meaning no priced spend at all; a negative or half-typed value is flagged and not written. The section says that only priced models count. Parsing lives in cost-ceiling.ts.

  • Tenant quotas page. The monthly-cost field now says what it counts (priced spend only), and the usage card gains a Monthly cost budget status that names which of four states the tenant is in: no budget, budget set but enforcement off, budget reached (models are serving fallback answers, tool calls refused), or spend versus remaining. It lists what is not metered and points at the eddi.llm.spend.refused metric — there is no REST endpoint for recent refusals, so none is shown.

  • All 14 new strings are in all 11 locales.

Design decisions

  • A new section rather than a field inside an existing one: the ceiling bounds the whole agent whatever its memory, session or approval settings are.

  • The budget block states the situation instead of leaving it to be inferred from a progress bar that turns red at 90%.

Not done: recent spend refusals on the quotas page need a backend endpoint; today they are only a metric and a per-step marker (llm:spend_refused:<taskId>).


Platform Operator explains 503 capacity_exceeded and node sizing (2026-10-17)

Repo: EDDI · Branch: feat/operator-capacity-limits

The 2026-10-17 throughput work made eddi.conversation.max-in-flight-turns (heap-derived with auto) the node's turn ceiling, but the Platform Operator knew nothing about it: asked why a turn came back 503 capacity_exceeded, or how big a node should be, it had no text and no tool to answer from.

What changed

  • ui/manager/src/lib/operator/system-prompt.ts — a new "Turn capacity" section in the default body, in both scopes. It tells the three backend sources of capacity_exceeded apart by their message (the in-flight limit, eddi.coordinator.max-active-conversations for a new conversation, a node shutting down) and keeps an administrator drain apart, since that answers 409 with Retry-After, not 503. It states that the refusal is retryable backpressure with Retry-After, gives the auto formula as InFlightTurnLimit computes it ((max heap − 256 MB) ÷ in-flight-turn-memory-mb, floor 32), the 10–20 % headroom advice from the configuration reference, the meters and alert (eddi_conversation_max_in_flight_turns, eddi_turn_rejected_total{reason="in_flight_limit"}, EddiTurnCapacityReached), and the remedies in order: turn latency, replicas (clustering), heap, with the database pool kept in step.

  • Two lines are added only when their tool is granted: what the coordinator status read shows (activeConversations, queueDepths, not the in-flight limit) and what the log read shows: a refused say/rerun is a WARN Turn rejected for conversation … carrying the refusal message, a refused new conversation under the coordinator cap is a WARN, and only a conversation start refused by the in-flight limit stays at DEBUG.

  • operator-revision.json bumped to 20 (main took 18 for the model-catalogue refresh and 19 for #1079), so existing operators are offered the upgrade.

  • Tests in system-prompt.test.ts.

Decisions

  • No allow-list change. The numbers live at /q/metrics, which is not in EDDI's OpenAPI spec, so it cannot become a generated tool; the prompt says the operator cannot read them and names what the admin should look at. Exposing the limit and the in-flight count on GET /administration/coordinator/status would be the way to let the operator see them — a backend change, left as a follow-up.

  • The per-conversation queue cap, the bounded MongoDB pool wait and the pool-wait meters (feat/turn-admission-hardening, PR #1085) are not described: that branch has not merged. They need a follow-up revision bump once it lands.

  • Docs named in the prompt are top-level pages only: the image copies docs/*.md, so the monitoring guide is not served to the operator.


perf(runtime): overload hardening — capacity check before any read, per-conversation queue cap, bounded MongoDB pool wait (2026-10-17)

Repo: EDDI · Branch: feat/turn-admission-hardening

What changed and why

A load test and JProfiler session on 2026-10-17 (1,000 to 5,000 concurrent conversations, 3 s mock LLM) found that once turns run on virtual threads (#1045), the MongoDB connection pool is where a turn spends its time under load. Indexed single-document reads averaged 2.2–3.3 s inside the driver, while mongod's own profiler logged them at 15–20 ms.

  • Capacity check before any read. IConversationService.refuseIfAtCapacity (a no-op default; ConversationService implements it against eddi.conversation.max-in-flight-turns). RestAgentEngine (say, rerun) and RestAgentEngineStreaming call it before the ownership check. Until now, a turn refused at the limit first read its descriptor and loaded its conversation. Admission in admitTurn stays the authoritative, atomic check.

  • eddi.conversation.max-queued-turns-per-conversation (default 20). Turns of one conversation run one at a time, so a client that keeps sending without waiting for answers (a retry storm, a bot loop) only built a queue of turns, each holding a permit and a loaded conversation. One more than 20 waiting is now refused in AbstractQueuedConversationCoordinator with the existing 503 capacity_exceeded, counted as eddi_turn_rejected_total{reason="conversation_queue"}. The cap applies in both coordinators.

  • eddi.mongodb.max-wait-time-ms (default 10000). The driver waited up to 120 s for a pooled connection, twice the turn timeout, so a saturated pool held turns long after their callers had given up. A waitQueueTimeoutMS in the connection string still wins.

  • eddi.datastore.pool.wait timer and eddi.datastore.pool.wait.timeouts counter (MongoDB, PoolWaitListener). Micrometer's pool listener showed how many operations were waiting, never for how long. Both are on the Full Metrics dashboard's connection-pool panel. PostgreSQL already exports agroal_blocking_time_*.

Measured

scripts/loadtest, 3 s mock LLM, 6 GB heap, everything on one Windows laptop (Docker Desktop), with its own compose project and ports. "Legacy" is this build with eddi.mongodb.max-wait-time-ms=0, i.e. the driver's 120 s.

Scenario
Legacy (120 s pool wait)
This change (10 s)

2,500 conversations × 10 turns

69 turns/s · p50 26.9 s · p95 65.7 s · 668 × 408

191 turns/s · p50 7.5 s · p95 21.9 s · 73 × 408, 7 × 5xx, 1 × 503

Burst: ramp to 5,000 users in 30 s, hold 60 s

75 turns/s · p50 48.2 s · p95 73.7 s

240 turns/s · p50 13.3 s · p95 20.1 s · 727 × 503 at the in-flight limit

The bounded wait accounts for this difference: it is the only setting that differs between the two columns, and each run started on a fresh database. With the driver's 120 s, the p95 (66 s) ran past the 60 s turn timeout. Turns whose callers had already given up kept queueing for connections, and that abandoned work crowded out live turns. Each figure comes from a single run on a laptop, so read the ratio, not the absolute numbers. Details are in scripts/loadtest/results/admission-2026-10-17.md.

Design decisions

  • No adaptive limit, yet. A limiter that lowered the in-flight limit while the mean pool wait exceeded a target was built, tested and measured, then left out of this change. Under the harness, which drives clients that ignore Retry-After, it cut goodput (2,500 conversations: 191 → 27 turns/s; 5,000-user burst: 240 → 20 turns/s). In the burst, the pool-wait signal stayed around 470 ms while MongoDB served only about 500 operations/s. It is parked on a local branch, wip/adaptive-turn-limit. Judging it needs load-test clients that honour Retry-After; the benchmark-suite work adds them.

  • Queue cap default 20, not 5 (the throughput plan's WS4b proposal). Coordinator tests that queue 20 turns on one conversation are legitimate FIFO tests, and a chat channel can deliver several messages from a fast typist. 20 is beyond any human pace and still stops a loop.

What's next

  • The Platform Operator's prompt does not explain capacity_exceeded, nor any of the turn limits. A follow-up should add it, together with an operator revision bump.

  • WS4a deadline gaps (skipping turns whose deadline expired while queued) touch ConversationStepRunner, which the per-turn round-trip follow-up to #1055 is changing; take them after that lands.


🐛 fix(cluster): leases that survive a busy node, turns that stop when they lose them, one turn per idempotency key across nodes (2026-10-17)

Repo: EDDI · Branch: fix/cluster-resilience

What changed and why

An assessment of cluster mode (NATS leases with fencing, event bus, degraded mode) found the design sound and its failure scenarios tested. It also found a handful of places where a node under strain, or a NATS that hangs instead of refusing, does worse than the clustering page promises. Per-turn database work is #1055's and node sizing is #1053's; neither is touched here.

  • Lease heartbeats get a thread of their own (NatsConnectionManager, KvLeaseManager). They shared a 2-thread scheduler with presence, the console's pollers, the HITL recovery sweep (a database scan) and every on-connect hook (up to 10,000 synchronous outbox publishes, bucket provisioning, the stale-lease sweep). Right after NATS came back, exactly when it is slowest, those hooks could hold both threads past the 20 s lease TTL and a live node lost every lease at once. Now the leases run on leaseScheduler() (one thread, nothing else on it) and the on-connect hooks on two threads of their own. A heartbeat pass also renews the held leases side by side on the virtual-thread I/O executor instead of one after another, so a NATS that answers in 2 s per call no longer stretches a pass over hundreds of leases past the TTL. The pass waits at most one heartbeat interval, so a stalled call never delays the next tick; a lease whose renewal is still in flight is skipped, never renewed twice at once.

  • A drained node hands its leader lease over (KvLeaseManager.setDraining). It stopped running the leader's work (tryAcquireKey answers empty while draining) but kept the leader.hitl-recovery lease alive through its heartbeat, so no node ran HITL crash recovery for as long as the drain lasted — contrary to the method's own Javadoc.

  • Shutdown releases leases side by side, within a bound (releaseAll): up to three NATS calls per lease, sequentially, could outlast the termination grace against a slow NATS. A lease it misses still expires by TTL.

  • A cancelled turn stops its tool loop (ToolLoopRunner). Lease loss, /cancel, a GDPR stop and the watchdog all raise the turn's cancel flag, but the loop only checked the thread's interrupt flag, so an agent loop ran all its remaining rounds — more model calls and side-effectful tools — for a turn whose result is discarded. It now checks the flag before every model call and every tool. The call already in flight finishes; interrupting it would also interrupt the persistence and dead-lettering that follow on the same thread.

  • Bounded NATS waits on the turn's thread. A failed turn's dead letter retried its publish ten times; against a NATS that keeps the connection and answers nothing, each attempt ran into the 2 s request timeout — about 24 s on the failing turn's thread. The retry (JetStreamDeadLetterStore) is now bounded by about 2 s and skipped when the client is disconnected or the stream answered with a refusal other than "not found" (a full stream is not re-provisioned on every refused publish); the entry stays in the node-local ring and is forwarded later. Audit position allocation (AuditClusterSupport) stops asking NATS for one request timeout after a failure, so a turn's audit entries cost one timeout, not one each (they are recorded unsequenced meanwhile, as they already were on failure).

  • Dead-letter stream size cap: new eddi.coordinator.dead-letter.max-bytes (1 GiB). The stream was bounded by age only, on the NATS volume the leases share. When full it refuses new entries (DiscardPolicy.New) rather than dropping the oldest an operator may still replay.

  • Event bus (JetStreamEventBus): the outbox is also flushed every 2 s while connected (an event whose async publish failed without a disconnect waited for a reconnect that might never come), at most one flush at a time; and resyncs coalesce — requests that arrive while one is queued join it, so N nodes asking for a resync after a long outage flush each node once more, not N times. Each flush is a wave of cache misses against the shared database.

  • Idempotency-Key holds across nodes (ConversationService, TurnIdempotencyService). A duplicate that reached another node while the first request ran there missed that node's in-flight registry, became an owner, queued for the lease and, once it held it, ran the turn a second time over the newer document. The turn builder now re-checks the key when it rebuilds over a superseded document: under the lease, the check and the run are one step cluster-wide. The duplicate is answered as skipped (409 + Retry-After) and its retry is served the stored answer.

  • Autoscaling (Helm chart 2.8.0 → 2.9.0): autoscaling.extraMetrics and autoscaling.behavior are rendered as given, and each resource target may be null. A node waiting on LLMs runs hundreds of turns at little CPU, so a CPU-only HPA may never scale up; the docs show how to scale on in-flight turns (eddi_runtime_executor_active{pool="turn"}) through a custom-metrics adapter. The chart refuses an HPA with no metric at all, which CI's chart-guard step now asserts.

  • Docs: Clustering gains database-connection sizing (a stock PostgreSQL's max_connections=100 is exhausted by a third replica at the default pool of 50; PgBouncer only in session mode, because EDDI takes session-level advisory locks), an Autoscaling section, a "NATS hangs" failure mode, and the behaviour above; Kubernetes and the configuration reference list the new values. WS5 of planning/throughput-optimization-plan.md is marked superseded by cluster mode. The Platform Operator's prompt learns the dead-letter cap and that a drain hands over leadership (operator revision bump).

Tests

  • KvLeaseManagerTest: renewals side by side (6 leases at 300 ms each in well under the sequential 1.8 s), a lease with a renewal in flight is skipped, releaseAll side by side, a drain releases the leader lease but keeps conversation leases and the heartbeat does not take it back.

  • JetStreamDeadLetterStoreTest: a hanging NATS holds the turn about 2 s, not 7+; a disconnected node does not retry or provision; the stream config carries the size cap and DiscardPolicy.New.

  • AuditClusterSupportTest: after an outage, five more entries cost no NATS call; allocation resumes after the pause.

  • JetStreamEventBusTest: five resync requests during a flush cause exactly one more flush; an outbox entry is flushed by the sampler without a reconnect.

  • ConversationServiceIdempotencyTest: a duplicate queued on "another node" does not run again once the document holds its key; a queued turn with a different key still runs.

  • ToolLoopRunnerToolPolicyTest: a turn cancelled during a tool runs neither the rest of the batch nor another model call.

  • DeploymentManifestsTest: the HPA template's extra metrics, behavior, optional targets and no-metric refusal; chart version 2.9.0.

Not done here

  • Distributing one group discussion's member turns across nodes (today the whole discussion runs on the node that started it) — a design change, not a fix.

  • A multi-node throughput benchmark — in progress separately (scripts/loadtest, 1→8 nodes).


fix(test): two unit-test classes that failed on every Windows checkout (2026-10-17)

Repo: EDDI · Branch: fix/flaky-local-unit-tests

Both failures reproduced on a clean origin/main and on no CI run: each is a test that built its fixture in a form only Linux accepts. Neither is a product bug; in both cases the product code under test behaved correctly and the fixture never reached it.

What changed and why

  • McpApiToolBuilderExternalRefTest.oversizedJsonSpecWithEscapedKeyIsStillScanned. specReferencing spliced a @TempDir path into a JSON string unescaped. On Windows that path is C:\Users\…, and \U is not a legal JSON escape, so the spec was not JSON at all. The cases the raw-text pass catches still passed; this one rests on the decoded-tree pass alone (its $ref key is Unicode-escaped), which could not build a tree and refused the spec as "could not be parsed" instead of reporting the external reference. rejectUnsafeInlineRefs failing closed there is correct. The helper now JSON-escapes backslashes, so every case reaches the reference it is about.

  • DeploymentManifestsTest — "secret generator — fail-closed classification" (three PowerShell cases). The Windows kubectl.cmd stand-in recognised the existence probe with a bare find. A Maven started from Git Bash hands its PATH down, with Git's Unix find ahead of System32\find.exe; that one rejects the argument, the stub's errorlevel 1 branch took the error for "not the probe", and every probe exited 0. Every stub mode therefore read as "a Secret already exists", so the NotFound path refused to install and the unreachable/forbidden paths aborted with the wrong message. create-secrets.ps1 classified each answer it was given correctly (checked by hand against the stub with a PowerShell-launched PATH). The stub now calls %SystemRoot%\System32\find.exe by full path. CI's ubuntu runner never takes this branch, which is why it stayed green.

Design decisions

  • Fix the fixtures, not the code: the guard and the generator were right, and loosening either to accommodate a malformed fixture would have weakened a security check.


fix(groups): count every turn of a group member toward the group's cost ceiling (2026-10-17)

Repo: EDDI · Branch: fix/group-cost-ledger-accumulation

What was wrong

GroupCostLedger.accumulateMemberCost fed a group's totalCost, which the maxCostPerDiscussion ceiling (I1) is checked against, through two faults:

  • It read the wrong value. It took audit:cost from the last step of the member turn's snapshot and recorded it by replacement, on the assumption that the value was the conversation's running total. It is not: LlmTask accumulates audit:cost on the current step, and every new step starts without one. A member that spoke in several turns had only its latest turn counted. The comment in MemberTurnExecutor and the ledger's own Javadoc repeated the wrong assumption, and the tests stubbed the same wrong model (a growing "cumulative" audit:cost), so they passed.

  • Since 2026-09-26 it read nothing at all. Member turns call say with returnDetailed=true, and the redaction of that projection (f94036125) withholds every audit:* key from the step data. From then on the ledger found no cost, so member spend counted $0 toward the ceiling. Only the discussion's own system costs (summarizer, stance summaries) still counted. Every unit test mocked say with a hand-built snapshot, so none of them went through the redaction.

What changed

  • SimpleConversationMemorySnapshot gains conversationCost, the sum of audit:cost over every step of the conversation, including the steps returnCurrentStepOnly leaves out. It is @JsonIgnore and in-process only, so it does not widen what any REST, MCP or SSE caller receives. The redaction is unchanged. ConversationMemoryUtilities.convertSimpleConversationMemory fills it, skipping NaN, infinite and negative values. It is null when no step carried a cost.

  • GroupCostLedger.accumulateMemberCost records that total. It no longer reads step data. Replacement is now correct, because the value really is the conversation's running total. That holds in every case:

    • harvesting the same turn twice;

    • a skipped turn, whose snapshot shows the previous turn;

    • a HITL pause, whose resumed spend arrives with the member's next turn.

  • GroupCostLedger.retireConversation: when MemberTurnExecutor swaps a member's ended private conversation for a fresh one under the same key, it first moves the ended conversation's entry to key:endedConversationId. That is the key:child shape nested groups already use, and the Manager's per-member digest already sums it. Before, the fresh conversation's first total overwrote the member's whole earlier spend.

  • Late callbacks from a retired conversation. A turn that timed out on the ended conversation can still finish, and its callback arrives under the same key. The ledger compares the snapshot's conversation id with the member's active one and routes a mismatch to key:<thatConversationId>. That entry keeps the larger value, so the callback and the retirement can run in either order without double-counting or overwriting the replacement's total.

  • No window between retirement and replacement. Retirement always leaves a retired entry, $0 if nothing was spent yet. A callback decides where its cost goes by whether that entry exists, and it reads and writes under the same monitor retirement holds. A late callback therefore lands correctly even before the replacement's id is published, while the member's conversation map still names the ended conversation.

Design decisions

  • Not widening the redaction. Letting audit:cost through, the way audit:token_usage is, would also expose the operator's configured pricing to any chatting user who sets returnDetailed=true. An in-process field gives the group engine what it needs and exposes nothing.

  • A conversation total, not per-turn deltas. The snapshot carries no step index, so adding per-turn deltas could not tell a repeated harvest or a skipped turn's stale step apart from new spend. A total recorded by replacement is idempotent by construction.

Tests

  • GroupCostLedgerTest builds its snapshots through the real projection, with the flags a member turn uses. It checks that a two-turn member is counted in full ($0.05 + $0.07 = $0.12), and that two $0.06 turns trip a $0.10 ceiling that neither turn trips alone.

  • ConversationMemoryUtilitiesTest: the sum covers steps outside returnCurrentStepOnly, poisoned values are skipped, and the field never reaches JSON.

  • MemberTurnExecutorTest: an ended conversation's spend survives its replacement.

  • Mutation-checked. Each of these reverts fails the new tests:

    • restoring the last-step read;

    • summing only the projected steps;

    • dropping the retireConversation call;

    • removing the late-callback routing;

    • recording a retired entry by plain replacement instead of the larger value;

    • routing by the conversation map alone;

    • skipping the $0 retired entry.


📱 fix(manager): every screen size, RTL, and state handling (2026-10-17)

Repo: EDDI (fix/manager-layout-a11y)

Half of a review of both UIs for click latency, every screen size and every state. This PR holds the Manager's layout, RTL, state-handling and accessibility fixes; the click-latency fixes and the Chat UI are in the companion PR on fix/ui-click-responsiveness. The two share no file and build independently.

Every screen size and RTL (Manager)

  • The chat drawer was a fixed 420px column, wider than a phone screen, and its Close button was unreachable. It is now a full-screen overlay below md, and Escape closes it. The operator panel no longer runs off the start edge on phones.

  • Hover-only card and row actions (the kebab menus, deletes) did not exist on touch screens. The new reveal-on-touch utility in index.css shows them under (hover: none) and on keyboard focus, with 32px targets.

  • Agent Studio rendered the mobile tabs and the desktop chat panel together at 768–1023px, mounting two chat panels. Both now switch at lg.

  • The top-bar breadcrumb truncates instead of pushing the controls off screen. List tables scroll horizontally and hide their secondary columns below md. App shells use h-dvh, custom modals cap at 100dvh-2rem, the main gutter is p-4 md:p-6, page headers wrap, and labelled three-column grids stack on phones.

  • RTL: switch thumbs no longer slide out of their track, directional arrows and chevrons are mirrored, the toaster sits at the inline end, and the onboarding badge is centred.

State handling and accessibility (Manager)

  • The API-call header/query/body editor could silently overwrite a value: after a delete, Add reused an existing key name, and renaming on every keystroke merged rows. It now uses nextFreeKey and RenamableKeyInput, as the connection and rules editors already did.

  • Escape inside the agent picker or a secret picker no longer closes and wipes the schedule form or the create-channel wizard (defaultPrevented is honoured). Neither form now discards edits on a backdrop click or Escape; the property-setter long-value modal does the same.

  • Inline group-config edits are covered by the unsaved-changes guard. The version diff dialog uses AccessibleDialog.

  • An Enter that confirms an IME composition (Chinese, Japanese, Korean) no longer commits half-typed text in the chip and tag inputs.

  • The dashboard shows an error with a retry instead of "nothing here" when a load fails. Resource type counts no longer read "0" while loading. The A2A copy buttons report a clipboard failure.

  • About 40 icon-only buttons gained accessible names. A count-plus-word concatenation was replaced with plural keys in all 11 locales (including _many and the Arabic categories).


🩹 fix(manager): long tool names wrap in a group member's "using …" line (2026-10-17)

Repo: EDDI (feat/groups-member-tool-call-events)

Browser-checked the member card during a streamed discussion. A long MCP tool name could not wrap and pushed the line out of the card, so it now breaks. The mock discussion stream emits a member_tool_call frame and holds it long enough to see. Files: agent-response-card.tsx.


🔒 fix(security): authorization gaps from the 2026-10-17 review — directory, workflow references, group USE checks, platform.* variables, strict group ownership, reserved principals, per-turn USE (2026-10-17)

Repo: EDDI (fix/security-review-authz)

Findings M2, M3, M5, L2, L3 and L4 of the 2026-10-17 security review. The authorization changes (M2, M3, M5, L2, L4) are no-ops for an administrator, and the workspace ones (M3, L4) are no-ops unless eddi.workspaces.enabled=true with authorization on. L3 is not an authorization check: a token whose principal is in a reserved namespace is refused whatever roles it carries.

M2 — the user directory could be harvested by any editor

GET /workspaces/directory answered a one-character prefix with every matching person's name, username and e-mail, whether or not workspaces were enforced. Now:

  • eddi.workspaces.directory.enabled has no default: unset, it follows workspace enforcement (UserDirectory reads it as Optional<Boolean>, falling back to WorkspaceSettings.isEnforcing()). application.properties no longer sets it. A deployment without enforced workspaces records no one and suggests no one; shares are taken as typed, which is what an inactive directory always did.

  • People are searched from three characters (MIN_USER_QUERY 1 → 3). Shorter queries return only the caller's own teams, not a 400, so the Manager's share box (which queries from the first keystroke) keeps working unchanged.

  • A non-administrator is offered only their own teams and the people who share one of them. The restriction runs in the store — new IUserDirectoryStore.searchWithinTeams on MongoDB (teams $in) and PostgreSQL (teams && ?) — so a page is never filled with outsiders and then emptied. eddi-admin keeps the full search, known teams included.

  • The e-mail (detail) is returned only to an administrator or to somebody who shares a team with the person — in suggestions and in a resource's grant list (ResourceSharingService, via UserDirectory.detailFor(user, caller, isAdmin)). Anyone else gets the username.

  • Typing an exact username, verified e-mail or team:<name> still resolves (resolveSubject unchanged): only suggestion is narrowed.

Docs: workspaces.md, configuration-reference.md.

M3.1 — a workflow could reference another space's private configuration

RestWorkflowStore now checks every eddi:// reference a workflow names — each step's config.uri and each extension element's config.uri (parser dictionaries) — through ResourceAccessGuard on create, update (and so updateResourceUri and AgentCascadeService, which reach it over the loopback REST client with the caller's identity) and duplicate (deep or not). Configuration needs VIEW; an ai.labs.agent/ai.labs.group reference needs USE. An update need not re-justify a resource id the stored version already referenced — keeping (or re-versioning) a reference somebody with access made grants nothing new — but a new id must pass, including the prefix trick updateResourceUri allowed (a target id that is a prefix of the stored one replaces it with a different resource). References are keyed by type and id: USE grants nothing about a configuration, so an agent URI naming a configuration's id must not stand in for the configuration and get it the weaker check.

M3.2 — moderator, facilitator, RECRUIT and duplicate skipped the USE check

  • RestAgentGroupStore.requireUseOnMembers also checks moderatorAgentId and facilitator.agentId, skips HUMAN members (their id is a principal, not an agent), and duplicateGroup now runs it. MCP create_group, update_group and create_group_from_template, and RestGroupTemplates, all save through this store, so they are covered too.

  • FacilitatorEngine takes the same (agentId, principal) -> boolean use check RecruitAgentTool has (M-A1) and asks it for the discussion owner before the deployment check, so a refusal does not reveal whether a private agent is deployed. GroupConversationService supplies it from a field-injected ResourceAccessGuard and the owner's own captured identity (CallerIdentity.isAdminActingAs).

M5 — platform.* global variables were editor-writable

RestGlobalVariableStore refuses a non-admin PUT or DELETE of any key starting with platform. (case-insensitive, any tenant) with a JSON 403 — {"error": …, "reservedPrefix": "platform."} — and a [SECURITY] WARN. platform.operator is what the Manager trusts for which agent is the Platform Operator and which prompt an Upgrade re-provisions. Reads are unchanged. No MCP tool writes variables. Every write and delete, refused or not, is already on the audit ledger through AdminActionAuditFilter (pinned by a test). Docs: global-variables.md.

L2 — non-strict owner check on group-conversation reads and MCP group tools

McpGroupTools.requireConversationOwner (follow-up, continue, close, delete) and read_group_conversation, and RestGroupConversation.readGroupConversation, now use requireOwnerOrAdminStrict: a record with no owner is an administrator's alone. The lenient branch of RestGroupConversation.validateGroupConversationOwnership had no caller left (every call passed hitlOperation=true) and was removed with its parameter.

L3 — reserved principal namespaces

New ReservedPrincipals is the one list of principal prefixes EDDI makes up for itself — openwebui:, slack:, webhook:, agent-test:, group:, system:, a2a:, mcp:, anonymous-, gdpr-erased:, and the whole name anonymous — built from the existing constants where they exist. NamelessPrincipalAugmentor rejects an authenticated identity whose principal carries one (case-insensitively) with 401 and a throttled [SECURITY] WARN naming the prefix and issuer. ReservedPrincipalsTest scans src/main/java for "<word>:" + concatenations and *PREFIX* = "<word>:" constants and fails on any that is neither reserved nor listed in the test as not a principal. webhook: and agent-test: come from open PRs #1059 and #1065 and are reserved ahead of them. Docs: security.md.

L4 — USE was checked only when a conversation started

New ConversationAccessGuard.requireConversationTurnAccess: the owner-or-admin check requireConversationOwner makes, plus — under enforced workspaces, for a non-admin — requireAgentUseAccess on the agent the conversation runs on (from the descriptor's agentResource, else the memory's agentId; a conversation that names neither is refused). Used by RestAgentEngine.say/sayWithinContext/rerunLastConversationStep, RestAgentEngineStreaming.sayStreaming, and MCP talk_to_agent and chat_with_agent (existing conversation). Nothing is cached across requests, so revoking a share stops the next turn. The service-level owner check inside ConversationService.say is unchanged — it also serves internal callers (Slack, schedules), which must not be USE-gated.

Design decisions

  • Short directory queries return less, not 400. The Manager searches from the first keystroke; an error there would surface as a failed request per keystroke.

  • Workflow updates check only newly referenced ids. Checking every reference would lock a collaborator with EDIT out of a workflow whose owner referenced something only the owner may read; it would protect nothing, since the reference already exists.

  • L4 lives in ConversationAccessGuard, next to the owner check it extends, so REST, streaming and MCP cannot drift apart; the workspace guard is reached through a lazy Instance<ResourceAccessGuard>.

  • Not done here: the Manager is unchanged (it needs no change for M2; a hint to type three characters would help). The Platform Operator's prompt does not describe platform.* being admin-only; its writes run with the administrator's token, so nothing it does is refused.

Tests: UserDirectoryTest (new Harvest group), UserDirectoryStoreContract.searchWithinTeams (run against real MongoDB and PostgreSQL), RestWorkspacesTest, RestWorkflowStoreReferenceAccessTest, RestAgentGroupStoreUseCheckTest, FacilitatorEngineTest (two RECRUIT cases), RestGlobalVariableStoreTest (M5 cases), AdminActionAuditFilterTest, McpGroupToolsTest and RestGroupConversationTest (unowned records), NamelessPrincipalAugmentorTest, ReservedPrincipalsTest, ConversationAccessGuardTest (new requireConversationTurnAccess group), RestAgentEngineTest; RestAgentEngineStreamingTest updated for the new guard method.


🔒 fix(security): group-discussion attachments get an owner, quotas and a delete path (2026-10-17)

Repo: EDDI (fix/security-review-data-lifecycle) — security review 2026-10-17, finding M4 and its REST edge.

What changed and why

A group discussion's inline attachments were stored with the five-argument IAttachmentStore.store(...), which records no user. So no per-user quota counted them (one eddi-user could store 100 MB per discussion, without bound), deleting the discussion left the blobs behind with nothing pointing at them, and nothing keyed on the user could find them.

  • Owner. GroupAttachmentBinder stores with the discussion's userId, so eddi.attachments.max-per-user and max-total-bytes-per-user count group uploads. A quota refusal no longer silently drops the file: the blobs the request had already stored are removed, the just-created discussion is failed, and the caller gets 400 (GroupAttachmentRejectedException; a group_error event on /stream). A blob the rollback could not remove is logged at ERROR and stays owned by the failed discussion, where its delete and the user's erasure still reach it.

  • REST edge. RestGroupConversation re-checks the inline attachments against eddi.attachments.max-size-bytes per file and max-per-conversation / max-total-bytes-per-conversation for the discussion before anything is decoded or stored (GroupAttachmentLimits, computed from the base64 lengths), as it already re-checks its other request ceilings. The body itself stays bounded by RequestBodyLimitGuard before it is read. Human input (submitHumanInput) carries no attachments, so there was nothing to bound there.

  • Delete. GroupLifecycleOps.deleteGroupConversation deletes the discussion's blobs before the document. A failure keeps the document (500, retryable) rather than orphaning the blobs.

  • storageRef guard. materializeAttachments used to pass a storageRef-only attachment straight to grantAccess for every member. It now accepts one only from a trusted source conversation that can read the blob — the parent discussion, for a nested GROUP member, which MemberTurnExecutor passes through a new discuss(...) overload — and grants the child discussion access so the next level can repeat the check. A reference with no trusted source (anything a client could send) is refused. Unreachable from REST today; the guard keeps it that way.

Files

GroupAttachmentBinder.java, GroupAttachmentLimits.java, GroupLifecycleOps.java, GroupConversationService.java, MemberTurnExecutor.java, RestGroupConversation.java, IGroupConversationService.java; docs attachments-guide.md, group-conversations.md.

Not done here

  • Blobs stored by earlier releases still have no owner recorded, so they do not count towards a per-user quota. Deleting their discussion, or erasing its owner, now removes them.

  • close still keeps the blobs (it keeps the transcript readable); only delete and erasure remove them.

  • McpGroupTools' delete_group_conversation description and docs/mcp-server.md still name only artifacts and ephemeral agents (left to the workstream that owns the MCP group tools).


🔒 fix(gdpr): erasure and export reach group discussions; keyed database-log pseudonym (2026-10-17)

Repo: EDDI (fix/security-review-data-lifecycle) — security review 2026-10-17, findings M4 (erasure half) and L9.

What changed and why

  • Erasure reaches group blobs (M4). GdprComplianceService.deleteUserData resolved attachment owners from getConversationIdsByUserId, which returns 1:1 conversations only, so a discussion's shared files — stored under the group conversation's id — survived an Art. 17 erasure that reported success. The cascade now lists the user's group conversations (GroupConversationStore.listAllForUser, paged, exact-match re-check) before step 5c deletes them, and deletes the blobs of each discussion and of every member conversation it created. A failed lookup is reported as the step groupConversationAttachments. If that lookup fails, or a blob delete under a discussion or member id fails, step 5c keeps the discussion documents (reported as groupConversations, kept for a re-run) — they are the only record of the ids the blobs are stored under, the way step 4c keeps the snapshots on an incomplete vault sweep (review follow-up).

  • Export completeness (L9b). The Art. 15/20 bundle now carries groupConversations (question, transcript, state, dates) and sharedArtifacts (content and revision history, via the new ISharedArtifactStore.listAllForUser), each capped at 1,000 with groupConversationsTruncated / sharedArtifactsTruncated, plus failedCategories for a store that failed. The group listing pages at the cap plus one row, not the storage maximum, since the store reads every row of a page in full. All three count against complete(). The attachment inventory covers the discussions' blobs and their member conversations'. omittedCategories shrinks to schedules and journalEntries, so the endpoint still answers 207 until those land. MCP export_user_data reports the same fields.

  • Keyed pseudonym (L9a). The database-log pseudonym (and the pseudonym in GDPR log lines and compliance records) was AuditHmac.pseudonymFor, an unsalted SHA-256 any list of candidate e-mail addresses reverses. New GdprPseudonymizer: the audit ledger's keyed pseudonym (gdpr-erased:k1:…) when the ledger signs; otherwise gdpr-erased:s1:…, an HMAC under a random per-deployment salt kept with ISecretPersistence.setMetaValueIfAbsent("gdpr-pseudonym-salt", …) — the metadata store and insert-if-absent pattern VaultSaltManager uses for the KEK salt, present whether or not the vault is on; the unsalted form only if that store fails (WARN).

Design decisions

  • No migration of old pseudonyms. Rows erased earlier keep gdpr-erased:<sha256>: the raw id is gone from them, so they cannot be re-keyed, and a re-run erasure matches on the raw id only.

  • Audit-ledger step 7b keeps the unsalted token. Its blanket update reaches only v1–v4 and unsigned rows (the store already gives v5 rows the keyed pseudonym of their signing key), and a v3/v4 row signs exactly the unsalted token; anything else would break its signature. In the default redact mode step 7a has already moved every reachable row to the keyed pseudonym.

Files

GdprComplianceService.java, GdprPseudonymizer.java, UserDataExport.java, AuditHmac.java, GroupConversationStore.java, ISharedArtifactStore.java, SharedArtifactStore.java, McpGdprTools.java, IRestGdprAdmin.java; docs gdpr-compliance.md, troubleshooting.md.

Not done here

  • MongoUserMemoryStore / PostgresUserMemoryStore still log the unsalted pseudonym in their erasure log lines (server log only, not stored data).

  • The Manager's GDPR export view does not render the new sections yet.


🔒 fix(vault): a secret create says where the secret may go; discover-endpoints pinned as never resolving (2026-10-17)

Repo: EDDI (fix/security-review-2026-10-17-h1-leftovers, built on fix/security-review-2026-10-17-high). Covers the two H1 leftovers from the 2026-10-17 security review.

What changed and why

1. POST /apicallstore/apicalls/discover-endpoints: checked, no fix needed. The question was whether it resolves a ${vault:…} or ${vars:…} value from the request and sends it to a URL the caller picked, the way discover-tools did. It does not. authHeaderRef must already be a reference (a literal is a 400), and McpApiToolBuilder.parseAndBuild copies it verbatim into the generated calls' Authorization header. The spec fetch (OpenApiSpecFetcher) sends only Accept and User-Agent. The reference is resolved later, when an agent makes the call, and the secret's grant and allowedHosts are checked at that point. A new test in RestApiCallsStoreBranchTest pins this: discovery from an inline spec whose server is https://attacker.example returns both references exactly as written.

2. A secret create needs allowedHosts under enforce. This is a breaking change. allowedAgents limits which agents may reference a secret, but any editor can write a config that sends a referenced secret to a URL they choose. So a secret created without allowedHosts went wherever the next config edit pointed it. Under eddi.vault.grant-enforcement=enforce (the default), a create through PUT /secretstore/secrets/{tenantId}/{keyName} or PUT /spacestore/secrets/{key} now gets a 400 when allowedHosts is omitted or []. ["*"] (alone, never as a pattern) is the explicit opt-out and is stored as the empty list. warn and off keep the old behaviour, and a rotation may still omit the list. The user agreed to the break before it was made.

  • VaultGrantRequests.requireHostsOnCreate is the host-side twin of requireGrantOnCreate, shared by both endpoints.

  • VaultHostAllowlist gains ANY_HOST, isExplicitlyUnrestricted and requestedHosts (which maps ["*"] to [], and otherwise works like validatedHosts). SetupSecretHosts now delegates to it rather than keeping its own copy. The grant endpoint also accepts ["*"] and treats it like [], which clears the restriction.

  • Space secrets could not carry allowedHosts at all. SecretWrite gains the field, and a 3-argument constructor is kept. SpaceSecret now returns the field.

  • Manager: there is a shared AllowedHostsField with two choices, Only these hosts or Any host. It is used in Add Secret, in the secret picker's inline create, and on the Workspaces page, and the submit button stays disabled until one is chosen. The picker fills in the host from the config's URL for the MCP server URL, the A2A agent URL and the LLM baseUrl/provider default. The Workspaces page create now also sends allowedAgents: ["*"]: it sent no grant at all, so it already failed under enforce. Re-saving an existing space key sends no grant and no hosts, so the stored lists are kept. The MSW handlers model the enforce rules. The Operator prompt tells an admin a new secret needs its hosts. The operator revision is bumped.

  • seed-demo-agent.sh sent neither list and failed under enforce. It now sends both, with the host taken from EDDI_DEMO_LLM_TYPE, or from EDDI_DEMO_LLM_ALLOWED_HOST when that is set (wired through docker-compose.openwebui.yml and .env.example). The cluster demo and AuditAndSecurityIT now send both lists too.

  • Docs: secrets-vault.md (new Required on a create section), workspaces.md, troubleshooting.md, upgrading-from-6.4.md §7.1.

Verification

  • ./mvnw test on *Secret*Test,*Vault*Test,*Space*Test,AgentSetup*Test,SetupSecretHosts*Test,McpSetupToolsTest,ComposeStackTest,RestApiCallsStore*Test: 6114 run, and one fails: RestApiCallsStoreBranchTest.arbitraryPasswordInTheSpecUrlIsNotEchoed. That test resolves a .test host over the network and fails locally with UncheckedIOException. This change does not touch it.

  • Mutation check: with requireHostsOnCreate removed from both endpoints, createWithoutHostsRefused, createWithEmptyHostsRefused and SpaceResourcesTest.createNeedsAllowedHosts fail.

  • Manager: npm run typecheck, lint and i18n:check pass, and so do the targeted vitest files (secrets, picker, workspaces, use-secrets, MSW handlers, i18n, operator-revision). The full vitest suite and the Playwright run are left to CI.

Decisions

Folded in when this branch was synced with main (2026-10-19)

#1079 merged as a squash while this branch still carried its earlier commits, and main had moved on, so the sync merge resolves the overlap (operator revision 23 after later syncs past #1091, #1078 and #1056, main's dialog sizing, nameSeg encoding in space-resources.ts) and carries the fixes below:

  • main was red (#1066 against #1093: the response's cost sum converted every step that #1093 had made lazy). This branch fixed it first, but #1081 merged the same fix (conversationCost reads a lazy step list's total from the live steps), so the second sync takes main's version and drops the duplicate.

  • /setup-api apiAuth was locked to the LLM host by an explicit allowedHosts (#1079): the request's list names where the LLM key may go, so it no longer applies to apiAuth, which keeps the generated calls' target hosts; only an explicit ["*"] carries over (AgentSetupService.apiAuthRequestedHosts).

  • Timing limits in ModelOutputParserFenceTest and ConversationRecallToolTest rose from 100 ms to 1 s: the cubic case they guard against takes seconds, and 100 ms was a flake on a loaded CI runner.

  • Workspaces → space secret Save stays disabled until the secret list has loaded: while it was loading or had failed, a save went out as a create with an open agent grant and could widen a key someone had narrowed.

  • The #1079 fragment now says its decision about REST creates is superseded here, and that its operator revision landed as 19.


🔒 fix(vault): wizard-vaulted keys carry a destination list; discovery probes resolve no vault reference (2026-10-17)

Repo: EDDI (fix/security-review-2026-10-17-high) — security review 2026-10-17, finding H1

What changed and why

Every key the setup wizard vaulted was stored with allowedAgents ["*"] and no allowedHosts. An eddi-editor can read the LLM configuration holding the ${vault:…} reference, so they could copy it, set baseUrl to their own host, deploy, send one message, and receive the key (reproduced live). The MCP discover-tools probe was a second path needing no agent: it resolved a ${vault:…} reference from the X-Mcp-Authorization header and sent the plaintext to the URL in the request body.

  • AgentSetupService stores every secret it creates (the LLM apiKey; the apiAuth on /setup-api) with allowedHosts: the host of the base URL the request names, else the provider's own endpoint (new SetupSecretHosts — OpenAI, Anthropic, Gemini, Mistral, Hugging Face, jlama's model download, and the catalog of named OpenAI-compatible providers). For apiAuth it is the host of each generated httpcall's targetServerUrl.

  • New allowedHosts field on SetupAgentRequest and CreateApiAgentRequest (appended last, positional constructors kept): an explicit list overrides the derived one, ["*"] stores the secret open. Under eddi.vault.grant-enforcement=enforce an open secret is never created silently — when nothing can be derived and the request does not say ["*"], setup returns a 400 before writing anything. warn/off store it open with a [SECURITY] warning. Not exposed on the MCP setup tools.

  • Checksum reuse now reuses an entry only when it is restricted to the same hosts, so a key an earlier release vaulted open is not handed to new agents.

  • ISecretProvider.storeIfAbsent gained an allowedHosts overload, written in the same atomic insert by VaultSecretProvider (the default refuses a list rather than store the secret open).

  • RestMcpCallsStore.discoverTools refuses a ${vault:…}/${eddivault:…} or ${vars:…} value in X-Mcp-Authorization with a 400 instead of resolving it.

  • Platform Operator prompt: never set allowedHosts; ask for the endpoint when a setup is refused for an unknown destination. Revision 17 → 18 on this branch; main had moved to 18 in parallel, so the merge landed it as 19.

  • Docs: docs/secrets-vault.md ("Where a wizard key may be sent"), docs/mcp-client.md.

Design decisions

  • Derive, don't ask. The wizard knows where the key is going. A required field would break every existing caller; a derived list closes the hole for all of them. The list only constrains a configuration that names an endpoint; one without uses the provider's built-in endpoint and is not checked (ChatModelRegistry.ENDPOINT_KEYS), so a slightly incomplete default list cannot break an agent.

  • Existing entries are not migrated. A vaultKeyName or ${vault:…} reference the admin names is used as it is. Keys already vaulted open stay open until an admin narrows them via PUT …/grant.

  • allowedHosts ["*"] is wizard-request syntax only. The secrets REST API still rejects * in allowedHosts, and still accepts a create without the field. Refusing that under enforce too would be a breaking change for the Manager's Secrets page, so it is left as a follow-up. Superseded by 2026-10-17-fix-security-review-h1-leftovers.md: a REST create under enforce now requires allowedHosts, with ["*"] as the explicit opt-out.

Tests

AgentSetupAllowedHostsTest (new, 11): derived and requested lists, enforce refusal, explicit wildcard, warn mode, reuse of open versus restricted entries, the named-key insert. RestMcpCallsStoreTest: a reference in the header is refused before the manager is called, and a literal still probes. VaultSecretProviderAllowedHostsTest: storeIfAbsent persists the list. McpSetupToolsTest now asserts the end-to-end ["api.openai.com"]. Reverting the store argument or the probe check fails these tests (mutation-checked).

Not done here

  • POST /apicallstore/apicalls/discover-endpoints was not checked for the same probe pattern.

  • The review's defence-in-depth items: requiring eddi-admin to save a non-default baseUrl next to a vault reference the caller did not create, and a Manager warning badge for "unrestricted destination".


🔒 fix(ssrf): the metadata guard refuses a host java.net.URI cannot read (2026-10-17)

Repo: EDDI (fix/security-review-2026-10-17-high) — security review 2026-10-17, finding H2

What changed and why

UrlValidationUtils.rejectCloudMetadataTarget is the only check on the httpCalls path while eddi.security.ssrf-protection.enabled=false (the default). It read the host with java.net.URI and returned quietly when that host was null. URI gives a null host for any registry-style authority: an underscore (x_y.attacker.com), a percent-encoded host, or an IP literal with a trailing dot. The Vert.x client (HttpClientWrapper) parses the same string with java.net.URL, gets a host, resolves it and connects. An editor-written targetServerUrl naming such a host, with an A record of 169.254.169.254, therefore reached the cloud metadata service.

  • rejectCloudMetadataTarget now throws for an unparseable URL, and for an http(s) URL whose URI host is null or blank. When java.net.URL reads a different host, that host is checked as well. A URL with another scheme is still left to the caller.

  • HttpClientModule.requireNotMetadataHop refuses a redirect hop with no host instead of following it. A hop with an unreadable host is refused through the same check.

  • Docs: docs/security.md.

Behaviour change

An httpCall, MCP server or A2A peer whose host contains an underscore (for example a Docker service name such as my_api) is now refused even with SSRF protection off. Give it a hyphenated alias. The JDK HttpClient used by every other path already refused such URLs.

Tests

UrlValidationUtilsTest.unreadableHostIsRefused covers x_y.example, 169.254.169.254., 169%2e254%2e169%2e254, a single-slash http:/ and an unparseable URL. Its resolver answers "public" for everything, so only the new rule can refuse them. HttpClientModuleTest covers the same hosts as redirect hops, plus a hop with no host. The old assertion that an unparseable URL "is left to the caller" was inverted. Reverting the null-host throw fails both classes (mutation-checked).


🔒 fix(llm): linear JSON fence stripping; cap the recall tool's query (2026-10-17)

Repo: EDDI (fix/security-review-2026-10-17-high) — security review 2026-10-17, finding H3

What changed and why

ModelOutputParser.stripFence ran every reply of a convertToObject LLM task (and every FormatRetryRunner retry) through a regex with three quantifiers competing for one whitespace run. A reply of three backticks, N spaces and a letter cost O(N³): 462 ms at 1,000 spaces, 3.7 s at 2,000, about an hour at 16,000. That CPU is spent on the turn thread, and any chat user can trigger it by prompt injection, as can a hostile model endpoint.

  • stripFence is now startsWith / endsWith / substring, plus an ASCII case-insensitive check for the json tag. It returns the same result as the old regex for every input: the regex's leading [ \t]*\r?\n? and trailing \s* only moved whitespace that the trim() removed anyway.

  • ConversationRecallTool reads only the first 500 characters of the model-written query (MAX_QUERY_LENGTH). Its range pattern was quadratic over a long digit run (10.9 s at 40,000 characters). A null query now means "the last summarized turns" instead of a NullPointerException.

Tests

ModelOutputParserFenceTest (new, 24) keeps the old regex as an oracle and compares it with the new code on 23 fixtures, including non-ASCII look-alikes of json and a vertical tab. It also runs the 50,000-space input through stripFence and through parse(), each within 100 ms. ConversationRecallToolTest adds a 40,000-digit query (100 ms budget), a turn range followed by a 40,000-char tail, and a null query. Removing the cap fails the budget test at 10.4 s. The fence budget was not mutation-run: the old regex needs hours at 50,000 spaces.

Not done here

The L14 alternation-loop regexes from the same review are untouched.


🔒 fix(security): outbound requests, parsers and templates from the 2026-10-17 review (2026-10-17)

Repo: EDDI (fix/security-review-outbound-parsers)

What changed and why

One commit per finding of the 2026-10-17 security review (M8–M11, L13–L16). PR #1079 (UrlValidationUtils, requireNotMetadataHop, ModelOutputParser, ConversationRecallTool) is not redone here.

  • M9.1 — group artifact JSON schemas could $ref the network or the disk. ArtifactValidators now builds its networknt factory with an AllowSchemaLoader in front that admits only the bundled meta-schemas (classpath:draft/…, classpath:draft-0…); an http(s):, file: or other $ref throws before anything connects or is read. Refs are resolved eagerly at save time, so the save fails with an actionable message, and a ref first reached at write time refuses the write. ArtifactValidators.java, group-conversations.md

  • M9.2 — pgvector host injection. pgjdbc splices server names into its JDBC URL unencoded, so host = "db/eddi?sslfactory=…&x=" injected driver properties and a.com,10.0.0.5 dialled a host the metadata guard never saw. EmbeddingStoreFactory.requirePlainHost accepts one hostname (RFC 1123 labels, _ allowed for Docker service names) or IP literal, nothing else, for pgvector and Qdrant. EmbeddingStoreFactory.java, rag.md

  • M9.3 — httpCall redirects with SSRF protection off. A new redirect-handler guard (HttpClientModule.refusingPrivateHops) classifies each hop as public, private or loopback and follows a non-public hop only when the request that redirected (its connected address, else its resolved host) was in the same class, or the host is on eddi.security.ssrf-protection.allowed-hosts. A host-less Location is refused. Comparing with the previous hop is stricter than comparing with the first target. The DNS lookup of the hop and the client's own lookup are separate (JVM address cache); not pinned. HttpClientModule.java, httpcalls.md

  • M9.4 — credential header detection. ApiCallExecutor flagged a header as carrying a vault secret only when the resolved set grew, so a ${vault:k} already resolved in the body did not disable redirects for a custom header reusing it. It now checks the header's own text for a reference. ApiCallExecutor.java

  • M10 — templates. (a) str:fmt/str:format and the String.fmt/format instance forms are served by new BoundedFormat resolvers registered ahead of the generated ones: an upper bound for the output is computed from the format specifiers and refused against eddi.templating.max-output-chars before String.format allocates (pre-check, not removal — formatting numbers is common in prompts). (b) quarkus.qute.timeout is now effective: the render's deadline is a template-instance attribute checked on every value resolution (the bounded resolvers) and every loop iteration. (c) processTemplate reports a StackOverflowError as a template error; validateTemplate too. Section nesting is not capped at parse time — Qute's parser is not recursive, the render is, and catching the overflow covers it. BoundedFormat.java, RuntimeTemplateEngineFactory.java, TemplatingEngine.java, security.md

  • M11 — PDF budgets on the attachment and tool paths. AttachmentTextExtractor runs every PDF operation under the ingestion path's PdfStreamBudget pre-scan and PdfDecodeBudget (64 MB per stream, 128 MB per document), now public for that reuse, and the (startPage, endPage) variant reads at most eddi.attachments.extraction.max-pages pages. AttachmentTextExtractor.java

  • L14 — regex stack overflow on long JSON strings. The "((?:[^"\\]|\\.)*)" alternation loop in ConfidenceEvaluator and LifecycleManager.PROVIDER_ERROR_MESSAGE recursed once per character; both now use JsonStringField, a linear scan. summarizeException and reportFailureToCaller no longer let a StackOverflowError escape the failure handler. JsonStringField.java

  • M8 — export scrubbing and sync rebinding. SecretScrubber judges structured strings part by part — a relative request.path query string, a form-encoded body, a JSON document inside a string (request.body, serviceAccountJson) — treats Cookie/Set-Cookie headers as credentials, and runs the full SecretRedactionFilter.redact (template expressions masked) over request material only — path, body, URLs/endpoints, header and query-parameter maps, embedded documents. Every other string (prompts, descriptions, outputs, rule values) gets only a credential-shape pass (SecretRedactionFilter.redactCredentialShapes plus export-side shapes: AIza…, gh*_/github_pat_, xox?-, AKIA/ASIA, gsk_, xai-, JWTs, the password of mongodb(+srv)://user:pass@), so prose such as "never echo the password: policy" round-trips byte-identical. Vault references and template expressions stay legible. For /backup/import/sync*, the facade cannot pin an address, so every request to the source now carries SourceUrlValidator.connectPolicy: STRICT when private targets are refused, METADATA_ONLY when they are allowed or the origin is allow-listed — re-checked by the facade right before each send. SecretScrubber.java, SourceUrlValidator.java, agent-sync-guide.md

  • L15 — SharedKvCache.decode. The value class named in a NATS KV entry is matched against the exact classes the shared caches store (Boolean, String, A2ATaskRecord, PrincipalIndex, PaginatedResponse, ChannelTarget) instead of package prefixes; anything else is refused and logged at ERROR. SharedKvCache.java

  • L16 — templated JSON bodies. Documented that a runtime value in a JSON body must go through {json:serialize(...)} without quotes of its own, and deployment now WARNs per httpCall whose JSON body has a {…} expression inside a string literal. ApiCallsTask.java, httpcalls.md

  • L13 (partial) — LLM provider response size. The OpenAI, Anthropic, Gemini, Mistral and Ollama builders use BoundedJdkHttpClient: the langchain4j JdkHttpClient built from an HttpClient.Builder whose client wraps every body subscriber with a byte cap (eddi.llm.max-response-bytes, 32 MB; over the whole stream for streaming). Not capped: MCP responses (StreamableHttpMcpTransport builds its own HttpClient and exposes no hook), Azure OpenAI and other SDK-based providers, and Jlama's Hugging Face download. BoundedJdkHttpClient.java

Review fixes (PR #1083)

  • SecretRedactionFilter's two sk- shape rules now start at a word boundary ((?<![A-Za-z0-9_]), the convention EXPORT_CREDENTIAL_SHAPES already used). Unanchored, redactCredentialShapes — which M8 made run over every exported prose string — turned risk-assessment-workflow-handler into risk-<REDACTED>; log redaction keeps its coverage since real keys start at a boundary.

  • SecretScrubber.scrubStructuredText returns the original string, whitespace included, when an embedded JSON document comes back unchanged; it returned the trimmed text, so a body template ending in a newline exported trimmed and containsCredential reported it.

  • LifecycleManager's StackOverflowError fallback digest carries taskType and errorType: stack_overflow like the regular digest, so TurnError.fromTaskError keeps the task metadata. LifecycleManagerFailureReportFallbackTest drives it with an exception whose getResponse() overflows inside LlmFailureClassifier.classify.

  • The scrubber test fixture uses AWS's documented example key AKIAIOSFODNN7EXAMPLE (gitleaks allowlists it) instead of a made-up AKIA… that Secret Scanning flagged.

Not done / open

  • M9.3 and M8 re-check rather than pin: the facade and the Vert.x client resolve names themselves, so a window remains between the guard's lookup and the client's (normally served by the same JVM address cache).

  • L13: MCP tool results, Azure OpenAI and Jlama downloads remain uncapped; an httpCall whose future.get(timeout) expires is still not cancelled on the Vert.x side.

  • M8 provider-key coverage in free text is whatever SecretRedactionFilter matches; AIza…-style keys in a query parameter named key are caught once those patterns land there.


✨ feat(channels): signed inbound webhook channel — CloudEvents over HTTP (2026-10-15)

Repo: EDDI (feat/channels-signed-webhook)

What changed and why

Agents could react to chat turns and schedules, not to events. A new channel type, channelType: "webhook", lets an external system (GitHub, a payment provider, a monitoring stack) start an agent turn or a group discussion by POSTing a signed event to POST /integrations/webhook/{integrationId}. It reuses the channel machinery rather than adding a trigger system: ChannelIntegrationConfiguration, its targets table and ChannelTargetRouter (Pillar 3).

  • Authentication is the HMAC signature, verified over the raw body bytes against the addressed integration's one secret, fail-closed. Schemes: eddi-v1 (default; X-Eddi-Signature: t=…,v1=…, 5-minute window, several v1 for rotation), github (X-Hub-Signature-256), generic-hmac (header, hex/base64, prefix configurable). The HMAC/constant-time/freshness primitives moved into the shared HmacSignatures; SlackSignatureVerifier now uses them (behaviour unchanged).

  • Formats: CloudEvents 1.0 structured and binary mode, and plain JSON (type from a header or JSON pointer, else webhook). All three yield the same event map, which reaches the conversation as the context value event — data, never a template. The input text is the author's inputTemplate, rendered by the restricted runtime Qute engine, default event:<type>.

  • Routing by event type against targets[].triggers (exact or prefix*, most specific wins), else the default target; agents and groups.

  • Review fixes: a repeat delivery that arrives while the first is still being processed answers a retryable 409 (Retry-After: 5), not 200 duplicate — the first may still be refused, and a 200 would have lost the event; only a recorded 202 makes a repeat a duplicate. HmacSignatures.isFresh is overflow-safe (subtractExact/absExact; a timestamp of Long.MIN_VALUE + now used to read as fresh — also used by Slack). Events without an id are deduplicated on the signature value for every scheme, not only eddi-v1: for github and generic-hmac, which sign no timestamp, that window is the only replay protection, as the docs now say.

  • PR review (#1059): deduplication is keyed by the event id AND by a canonical replay key the verifier derives from the MAC it computed (never from the sender's header — an extra v1= candidate or upper-case hex no longer yields a fresh key), so a captured request replayed under a new, unsigned delivery id is a duplicate. Trade-off, documented: byte-identical signed deliveries within the window count as one. Docs separate eddi-v1's t + "." + body MAC input from the body-only schemes; the Manager labels the create-dialog secret field, names X-Signature as the generic-HMAC default, and promises stale-request refusal only for eddi-v1. A second t= entry in X-Eddi-Signature is refused as malformed (it let the verified timestamp and the replay key diverge), and eddi.webhook.events also counts refusals answered before dispatch.

  • Conversations: new per event, or correlate — one conversation per value at correlationKeyPath, mapped through IUserConversationStore like Slack threads.

  • Identity: turns run as webhook:<integrationId>.

  • Delivery: 202 with the conversation id; repeated event id → 200 duplicate (10-minute Caffeine cache, released when an event is refused so retries work); 413 above 256 KB (eddi.webhook.max-body-bytes); 429 + Retry-After on tenant quota; 503 when the agent is not deployed.

  • Validation: a webhook integration must have platformConfig.signingSecret, and it must be a ${vault:…} reference (400 otherwise); unknown schemes, non-pointer paths, correlate without a key path and observeMode targets are refused.

  • HTTP policy quarkus.http.auth.permission.webhook (POST, permit) plus @PermitAll on the resource, as for Slack.

  • Manager: webhook in the channel type list, a create-dialog step and detail-page section for its settings, the endpoint URL and the signing format (11 locales). MCP create_channel_integration documents the type and returns webhookEndpoint. Platform Operator prompt knows the type (revision bump).

Design decisions

  • Quota-consuming steps run before the response. startConversation and say are called on the request thread: say only admits the turn and queues it on the conversation coordinator, so the agent's work is still asynchronous, but the 202 can carry the conversation id and a quota refusal can still be a 429. A separate executor (Slack's pattern) would have made the 429 unreportable. Cost: a new conversation's CONVERSATION_START turn runs inline — documented.

  • Body as bytes, not String. The MAC covers what the sender signed; a charset round trip can alter invalid UTF-8. The body is read with a hard cap before any verification; nothing is parsed before the signature passes.

  • Webhook integrations are keyed by their resource id in the router (no channelId), so the URL needs no extra configuration and cannot collide.

  • Signing secret must be a vault reference — the endpoint is public, and a plaintext secret is returned by GET /channelstore/channels/{id} and exported. Slack only warns, for back-compat; the new type has none to keep.

  • Not reused: TurnIdempotencyService is per-conversation and the event has no conversation yet; deduplication uses the cache factory, like Slack.

Not done / next

  • Deduplication is per node; a NATS cluster could run a replayed event once per node.

  • A new integration is reachable only after the router's 60-second refresh.

Files: RestWebhookChannel.java, WebhookEventHandler.java, WebhookEventParser.java, WebhookSignatureVerifier.java, HmacSignatures.java, WebhookChannelSettings.java, ChannelTargetRouter, RestChannelIntegrationStore, SlackSignatureVerifier, McpAdminTools, application.properties, Manager channel pages + webhook-settings.tsx, operator prompt.


✨ feat(llm): classifier guardrail type — a safety-classifier model as configuration (2026-10-15)

Repo: EDDI (feat/llm-classifier-guardrail, stacked on feat/llm-input-output-guardrails) — WS4 Phase 4b.

What changed and why

The 4a guardrails are deterministic heuristics. Phase 4b adds one generic model-backed type, classifier (input and output), that asks a safety-classifier model for a verdict, so Granite Guardian, ShieldGemma, a hosted moderation model or a TrustyAI-served detector are configuration values, not code. EDDI ships and endorses no model.

  • ClassifierGuardrail (modules/llm/guardrails/impl) — a ContentGuardrail bean, picked up by GuardrailService's type index like every other. Parameters: provider (an EDDI provider type) plus that provider's own model parameters in a task's vocabulary (baseUrl, apiKey — a ${vault:…} reference, resolved and grant-checked as for a task — modelName/model, customParameters, maxTokens, …), and its own keys promptTemplate, risk, unsafeLabel (default yes), safeLabel, labelPattern, timeoutMs (default 3000, cap 60000), includeRetrievedContext (output), inputPricePer1M/outputPricePer1M, and the generic failMode.

  • Transport is ChatModelRegistry.getOrCreate (made public), not SafeHttpClient: classifier endpoints are in-cluster private addresses, the same trust class as a task's model baseUrl; the registry also brings vault/global-variable resolution, the model cache and LLM telemetry. timeoutMs becomes the provider timeout (a stable cache key), and the call itself runs on a virtual thread bounded by min(timeoutMs, turn deadline − reserve) (#996); a turn already out of time does not call the classifier.

  • Prompt: without promptTemplate the text goes as the model's native conversation (input: the user message; output: question + answer as an assistant message), which is what Granite Guardian on vLLM and ShieldGemma on Ollama expect — their chat templates build the classification prompt. With promptTemplate, the template is rendered by the restricted Qute engine with the screened text as data only ({input}, {output}, {risk}, {context}) — never as template source.

  • Verdict: label = first capture group of the last labelPattern match (Granite's <score> yes </score>, after an optional <think> trace), else the first word with punctuation trimmed; compared case-insensitively with unsafeLabel / safeLabel.

  • Could not decide → new GuardrailUndecidedException(reason, costUsd): GuardrailService.evaluate now returns an internal Evaluation and the three failure sites (input, history, output) record the exception's reason (classifier_unavailable, classifier_unparseable) instead of guardrail_error, and add its cost. Everything else about failMode is 4a's single code path (closed by default for block/reprompt).

  • Cost: priced with TokenPricing from the classifier's token usage into GuardrailVerdict.costUsd, which 4a's accumulateCost folds into audit:cost (WS2's tenant metering reads that key) — including the cost of an unparseable answer.

  • Context: GuardrailContext gains retrievedContext (this turn's vector-store + httpCallRag context, output phase) and deadline; the old six-argument constructor stays. LlmTask collects the retrieved context it already appends to the system message and passes both. The HITL resume path has no retrieved context (null).

  • Metric: timer eddi.guardrail.classifier.duration{provider, outcome} (provider tagged only after the registry accepted it, so bounded; outcome safe|unsafe|unparseable|unavailable|timeout); eddi.guardrail.triggered unchanged. Both now have panels on the Full Metrics dashboard — 4a's counter had none, which MetricsDashboardCoverageTest flagged.

  • Docs: langchain.md (parameters, template safety, could-not-decide, cost/latency, worked examples for Granite Guardian 3.3 on vLLM and ShieldGemma on Ollama), security.md (the failMode availability trade-off, transport trust), metrics.md, audit-ledger.md. Operator prompt explains configuring a classifier (it never writes the vault reference itself); revision stays 17 (main is at 16), fingerprint updated. Manager GuardrailConfig doc comment lists the type.

Design decisions

  • screensHistory() is false: a model call per earlier history message on every turn would multiply the cost by the window size; each message was classified on its own turn.

  • promptTemplate optional (the plan had it required): the two documented models expect the raw conversation and build their own prompt; a wrapper prompt would be classified as content.

  • labelPattern added (not in the plan): Granite Guardian answers inside a <score> tag, which first-token matching cannot read. It is author config, compiled through 4a's bounded PatternCache.

  • Safe is a positive match, never a default (review follow-up). An answer is safe only when it matches safeLabel; a refusal, an HTML error body, maybe or a truncated reply is undecided and follows failMode (closed by default). safeLabel defaults to no when unsafeLabel is left at yes; a custom unsafeLabel without safeLabel fails the deploy — LlmTask.configure now asks each guardrail type to validate its parameters (ContentGuardrail.validate, default: nothing to check; unknown types still only WARN at run time). A missing provider is refused the same way.

  • labelPattern runs over the last 4 KB of the answer (the first word over the first 4 KB), so an author regex never scans an unexpectedly huge reply.

  • Llama Guard: not given a worked example. Meta's Llama 3.2/3.3/4 acceptable-use policies withhold the licence rights for their multimodal models from EU-domiciled companies, which covers Llama Guard 4 and Llama Guard 3 Vision; the text-only Llama Guard 3 is mentioned with that caveat, and ShieldGemma is the Ollama example. EDDI takes no position on any model's licence.

  • Provider error messages are never logged or propagated (they can echo the screened text); only the exception class.

Manager

  • The guardrails editor from the merged Manager PR offers classifier again on both sides (GUARDRAIL_TYPES, phases, no-rewrite set and type text in guardrails.ts); its settings panel and warnings were already in place. The editor test that asserted it was not offered now asserts it is. operator-revision.json is bumped for the operator prompt change.

Not done

  • The Granite Guardian chat_template_kwargs example is per the model card and vLLM's request extension; it was not run against a live vLLM here.


feat(llm): generic openai-compatible provider type for self-hosted servers (2026-10-15)

Repo: EDDI (feat/llm-openai-compatible-provider; backend, Manager, docs, Platform Operator)

What changed and why

Production on-prem inference runs on vLLM, llama-server, TGI, KServe or LiteLLM. EDDI could reach them only as type: openai + baseUrl, and so judged them as OpenAI: JSON mode was sent alongside tools (a 400 on servers that do not support the combination), vision was decided by OpenAI model names (a self-hosted Qwen-VL was text-only), and telemetry reported the traffic as OPEN_AI. The named-provider catalog cannot describe these servers by design: it requires a fixed https:// endpoint and a fixed default model.

  • New LLM type openai-compatible (OpenAiCompatibleEndpoint, SelfHostedOpenAiLanguageModelBuilder, registered in LlmModule and reserved in BUILT_IN_TYPES so no catalog row can take the id). It runs on the OpenAI builder. baseUrl and modelName are required; http:// is accepted and the cloud-metadata block stays. apiKey is optional: verified against langchain4j 1.22.0's DefaultOpenAiClient, a null key adds no Authorization header, and a blank key is now removed before it could become Bearer .

  • Per-endpoint capability flags, in the catalog's own vocabulary (OpenAiCompatibleProvider.Capabilities): jsonMode, jsonModeWithTools, vision, all off by default. JsonResponseFormatPolicy gained an endpoint component, filled by a new of(..., parameters) overload at all three call sites: LlmTask live, LlmTask HITL resume, and CascadingModelExecutor, which passes the step's merged parameters. ModelCapabilityService.visionOverride places the endpoint's vision=true below the per-task multimodal.vision override and above the deployment override; the built-in default for the type is off.

  • Strict literal flags, lenient templated ones. A literal flag that is neither true nor false fails the deploy (OpenAiCompatibleConfigValidator, run from LlmTask.configure for the task, each cascade step and the judge) with a message naming the parameter; so does a missing baseUrl/modelName. LLM parameters are rendered by Qute before the request is built, but ${vars:...} is otherwise only resolved inside ChatModelRegistry, so the call sites resolve global variables in the three flags first (OpenAiCompatibleEndpoint.withResolvedFlags). A templated flag that still is not a boolean counts as false with one WARN per distinct value (bounded): it never fails the build or the turn. customParameters must parse to a JSON object for this type (the OpenAI builder only warns and drops it).

  • Telemetry. serverName (default openai-compatible) is reported as gen_ai.provider.name and the provider meter tag in place of langchain4j's OPEN_AI, through a provider-name override on LlmTelemetryListener.forModelType and the observable model wrappers. It is bounded: lower-cased, 1-32 characters of [a-z0-9._-], else the default.

  • Model cache. The three capability flags are left out of ChatModelRegistry's cache key for this type (they shape requests, not the model instance); serverName stays in, because the telemetry wrapper bakes it in.

  • Parameter catalog. model-parameters.json has an openai-compatible row that inherits OpenAI's parameters without their model rules and adds serverName and the three flags; the Manager mirror and docs/llm-parameters.md are regenerated. Its inherited responseFormat is overridden with a "do not use" note pointing at convertToObject / jsonResponseFormat and jsonMode, since the OpenAI builder bakes it into the cached model.

  • Setup. AgentSetupService treats the type as keyless and requires model and baseUrl/llmBaseUrl up front instead of injecting the SaaS default model; the MCP setup_agent / create_api_agent descriptions name it.

  • Manager. "Self-hosted (OpenAI-compatible)" in the local group of the provider picker (agent wizard, operator activation, LLM editor, cascade steps, summary provider): required model and base URL with examples, an optional API key, and a note that the capability flags are switched on under Model settings, where they render from the catalog with a one-line explanation each. Pickers with no base URL field do not offer it: the workforce team builder, the group wizard's members and moderator, the cascade judge and a group's summarizer. The rolling-summary provider offers it only when the task itself is openai-compatible, because the summarizer then inherits the task's baseUrl and key. 7 i18n keys in all 11 locales.

  • Docs and Operator. A "Self-hosted OpenAI-compatible servers" section with a migration note in docs/langchain.md, the provider matrix row, and notes in docs/metrics.md and docs/model-cascade.md. The Platform Operator prompt describes the type; operator-revision.json is bumped to 24 (one above main).

Design decisions

  • customParameters is the extra-body mechanism, not a new extraBody key: it already is a JSON object merged into the request body with the user winning, the Manager already renders it, and a second key with the same meaning would need a precedence rule. It is made strict for this type only, so type: openai behaviour does not change.

  • No jsonSchema flag yet. Native json_schema support differs between servers and versions, and the plan ties it to the structured-output work (D5); schemaless JSON is sent when jsonMode allows it.

  • vision=false defers rather than vetoes: absent or false both fall through to the deployment override and then to the off default, so an operator's eddi.multimodal.openai-compatible.vision=on still applies to endpoints that did not set it.

  • type: openai is untouched, pinned by a regression test of its JSON-policy rows, its native schema, its vision decisions and an old type: openai + baseUrl config.

Not done

  • Model discovery via GET /v1/models and the deployment-level provider allow-list (C3) are out of scope.

  • CreateSubAgentTool has no base URL parameter, so it refuses this type up front with a message telling the model to pick another provider or have an administrator create the agent.


🔒 fix(deploy): runtime and deployment findings of the 2026-10-17 security review (2026-10-17)

Repo: EDDI (fix/security-review-runtime)

What changed and why

The runtime and deployment workstream of the 2026-10-17 security review — M6, M7, L7, L8 and the small L12/L13 items. One commit per finding.

  • M6 — the authenticated PostgreSQL install could not start, and two stacks had no bind-guard. docker-compose.auth.yml overrides bind-guard, which only docker-compose.yml declared, so -f docker-compose.postgres-only.yml -f docker-compose.auth.yml — exactly what install.sh --db=postgres --with-auth and install.ps1 compose — failed with "service bind-guard has neither an image nor a build context". Separately docker-compose.postgres-only.yml and docker-compose.cluster.yml publish on ${EDDI_BIND:-127.0.0.1} with the three *_ALLOW_UNAUTHENTICATED defaults true and no guard, so EDDI_BIND=0.0.0.0 published an open EDDI, MCP server and vault there. Both stacks now carry the same guard (on the database image each already pulls; in the cluster the load balancer waits for it). Design: the guard stays in every base rather than moving to an overlay — a base used on its own must still refuse — and ComposeStackTest makes the duplication safe: the copies must be byte-identical in script and inputs, every stack that publishes on EDDI_BIND must have one, every combination the installers can assemble (base × --local × --with-auth × --with-monitoring, read back out of both installers) and every multi-file command README/docs/ print is checked structurally (every service and depends_on target resolves) and, where a Docker CLI exists, rendered with docker compose config. That sweep also found docs/mcp-server.md telling users to run docker compose -f docker-compose.auth.yml down -v on its own, which compose refuses; fixed. Files: docker-compose.postgres-only.yml, docker-compose.cluster.yml, docker-compose.auth.yml, ComposeStackTest.java, docker.md, mcp-server.md

  • M7 — the unauthenticated quick start had no Host/Origin check. Loopback binding stops the network, not the browser: a DNS-rebinding page (Host: evil.example resolved to 127.0.0.1) was same-origin with the whole API, MCP and /secretstore, and without rebinding a page could still send blind CORS "simple" POSTs. The new UnauthenticatedRequestGuard (a Vert.x route filter registered like HttpMethodGuard, and only while authorization.enabled=false) answers 421 to a Host that is not localhost/*.localhost, an IP literal or an entry of the new eddi.security.unauthenticated.allowed-hosts, and 403 to a POST/PUT/PATCH/DELETE whose Origin is neither the request's own nor in quarkus.http.cors.origins (null included) or, without an Origin, whose Sec-Fetch-Site is cross-site/same-site. /q/health is exempt; one [SECURITY] WARN at boot states the policy. Design decision, deviating from the review's "loopback only": IP literals are always answered. Rebinding needs a DNS name the attacker controls, so an address cannot be its product, and kubelet probes, Prometheus scrapes (pod IPs) and eddi.self.base-url (http://127.0.0.1:… or a pod IP) address EDDI that way; the cross-site check still covers a page that posts to an address. The raw Host header is read, never a forwarded one — a rebound page is same-origin and may set X-Forwarded-Host. The compose stacks default the allow-list to eddi (Prometheus and Open WebUI reach EDDI by service name), the kustomize base and quickstart to the Service's in-cluster names, and the Helm chart (when OIDC is off) to the Service names plus any acknowledged ingress host. Chart 2.8.0 → 2.9.0. Files: UnauthenticatedRequestGuard.java, UnauthenticatedRequestGuardTest.java, security.md, configuration-reference.md

  • L7 — runtime defaults. Done:

    • HSTS. The GCP provisioner's nginx sends Strict-Transport-Security: max-age=31536000 on both https servers (no includeSubDomains — sslip.io names are not ours), and EDDI gains an opt-in HstsHeaderFilter (eddi.security.hsts.enabled, default false; eddi.security.hsts.max-age). The Helm chart sets it when ingress.enabled and ingress.tls are both set.

    • /q/health detail. The cluster readiness check reports its details (mode, NATS state, node id, member count, drain state, degradedSince) only with the new eddi.health.verbose=true; by default the public endpoint carries the status alone. GET /administration/cluster/overview still has everything, authenticated. (Gated in ClusterHealthCheck itself, so the readiness data is gone, not merely moved behind a path.) agentsInErrorCount stays — it is a count, documented as deliberately public.

    • Keycloak realm (all three copies, kept in step): passwordPolicy (length(12) and maxLength(128) and notUsername and notEmail and passwordHistory(3) — the installers' generated one-time passwords are 32 characters), login and admin events on (30 days, admin event bodies off), eddi-mcp with consentRequired: true and fullScopeAllowed: false plus a scopeMappings entry for exactly the eddi-* roles, seeded users emailVerified: false. Verified by importing the realm into quay.io/keycloak/keycloak:26.8.0 and generating an example eddi-mcp access token (roles and aud still present). Realm import is one-shot: existing realms keep their old settings (documented in security.md).

    • GCP nginx returns 404 for /realms/master/ (the provisioner reaches it on localhost:8180, not through nginx).

    • Kubernetes. The production NetworkPolicy's ingress-controller rule is pinned to the ingress-nginx namespace by kubernetes.io/metadata.name instead of admitting a controller-labelled pod from any namespace. MongoDB, PostgreSQL and Keycloak pods (Helm, kustomize overlays, quickstart) run as their image's own uid from the start (Mongo 999, Postgres alpine 70 — Helm postgres.runAsUser — Keycloak 1000) with allowPrivilegeEscalation: false, capabilities.drop: [ALL] and the RuntimeDefault seccomp profile; both databases were started that way in Docker (--user … --cap-drop ALL --security-opt no-new-privileges) to confirm their entrypoints still initialise.

    • quarkus.swagger-ui.oauth2-redirect-url is no longer pinned to http://localhost:7070; Swagger UI derives it from the page's origin.

    • docker-compose.yml's MongoDB healthcheck no longer carries the root password on its command line (docker inspect, host process list): ping needs no authentication.

    Deliberately not done here: Keycloak start-dev and the admin/admin compose fallback (the installers and the GCP provisioner already generate one; a production Keycloak mode needs a database and hostname design of its own), EDDI connecting to MongoDB as root, plaintext service-to-service traffic, NATS without auth and the unauthenticated MongoDB in the kustomize quickstart, and quarkus.log.console.level=DEBUG (the handler level only; categories stay at INFO). Files: HstsHeaderFilter.java, ClusterHealthCheck.java, eddi-realm.json, provision-vm.sh, network-policy.yaml

  • L8 — installer integrity (the minimal version). The release job in ci.yml now checks out the tag, hashes every file the installers download (docker-compose*.yml, the realm, the login theme, docs/monitoring/) into SHA256SUMS and attaches it to the GitHub release. install.sh and install.ps1 fetch that asset when EDDI_BRANCH is a release tag and refuse a downloaded file whose hash differs (the file is deleted); with no asset — main, a branch, every release before this one — they warn that only TLS vouches for the files and carry on, so existing installs do not break. Exercised with stubbed downloads for both scripts (accept, unlisted → warn, mismatch → refuse and delete, non-release ref → warn). gcp/provision-vm.sh defaults --eddi-branch to the --eddi-version tag or the newest stable release (GitHub API), falling back to main with a warning. postgres:16-alpine is pinned to postgres:16.15-alpine in the compose stack (database and bind-guard), the kustomize overlay and the Helm values. Not done: the installers cannot verify themselves (curl | bash from main stays TLS-only), the CLI's eddi update refresh path does not verify, there is no cosign signature on the asset, compose still defaults to labsai/eddi:latest, and mcp-sidecar/Dockerfile's unpinned nodejs npm is untouched. Files: install.sh, install.ps1, ci.yml, security.md

  • L12/L13 — small items. quarkus.http.cors.exposed-headers now exposes Mcp-Session-Id and Retry-After next to Location, so a browser-based MCP client on an allowed origin can read its session id and a 429/503's back-off. The 7443 mapping the compose stacks publish is documented rather than removed: it is Quarkus' HTTPS port, opened only once a certificate is configured, and removing it would have touched every installer's port resolution for no security gain (nothing listens). Dependabot #716 was not stale, contrary to the review: it bumps the eclipse-temurin:25-jre digest in src/main/docker/Dockerfile.demo (the Open WebUI demo image), which still uses that base — nothing changed here. Files: application.properties, docker-compose.yml, docker.md

  • M7 follow-up (live dev-mode test). host.docker.internal, gateway.docker.internal and host.containers.internal are now answered built in — that is how a container reaches an EDDI on the host, the container runtime's resolver answers them, and .internal is a reserved TLD public DNS never delegates. Three unexpected 400s from the live test (Host: eddi.localhost:7070, Host: localhost., and /q/health/live with Host: evil.example) were traced to Quarkus 3.40's own HostValidationFilter, not this guard: it is switched on in dev and test mode because the server binds localhost, accepts only localhost/127.0.0.1/[::1] and ends anything else with an empty 400 (confirmed from its bytecode, and by the guard answering evil.example with its own 421 on a non-exempt path of the same instance). The released 6.5.0 image (binds 0.0.0.0, filter off) answers all three with 200. The guard's own decisions for the three are pinned in UnauthenticatedRequestGuardTest, and docs/security.md explains the dev-mode 400.

Design decisions

  • bind-guard is duplicated into every base stack rather than moved to an overlay, and a test pins the copies together — moving it out would have left docker compose up on a base alone unguarded.

  • The M7 guard answers any IP-literal Host (see above) and reads only the raw Host header; * in the allow-list switches the Host check off, logged at boot.

  • /q/health detail is gated in the health check (eddi.health.verbose) instead of narrowing the public permit, because the sensitive data is in /q/health/ready itself.

  • Installer checksum verification is warn-only when no SHA256SUMS exists, so every release before this one keeps installing.

What's next

  • The Platform Operator (ui/manager/src/lib/operator/system-prompt.ts, WS-F's area) does not yet know about eddi.security.unauthenticated.allowed-hosts, eddi.health.verbose or eddi.security.hsts.enabled; an admin asking "why 421?" will not get an answer from it.

  • L7 and L8 items listed as not done above.

  • The review itself is now in the repository. planning/security-review-2026-10-17.md is the report every security review 2026-10-17, <id> reference in code and fragments points to, with a status line, the live-probe results, what was verified clean and the remediation table; docs/security-review.md gains an entry for the October reviews.


🔒 fix(security): editors no longer read plaintext credentials in any config store (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

What changed and why

M1 of the 2026-10-17 security review. The 2026-10-15 fix (L12) redacted plaintext keys for non-admins in tasks[].parameters of LLM configurations only; editors still read them verbatim in a2aAgents[].apiKey, modelCascade step and judge parameters, the MCP-calls apiKey, a Slack integration's botToken/signingSecret (enough to forge /integrations/slack/* events), RAG embeddingParameters/storeParameters, and literal Authorization headers and keys in an httpcall's request.path and request.body — current and old (?version=) versions alike.

  • One shared read-redactor, ConfigSecretRedactor (secrets.sanitize), walks the serialized document: credential-named fields are replaced whole, header and query-parameter maps are judged by header/parameter name, URLs lose their userinfo password and credential-named query values, and body fields go through SecretRedactionFilter. References (${vault:}, ${vars:}, ${connection:}, ${caller:}) and templates pass unchanged, also beside a scheme word (Bearer ${vault:k}). token matches only singular, so maxTokens and thinkingBudgetTokens are untouched; httpCalls[].parameters (tool parameter descriptions) and tasks[].toolCacheScopes (keyed by tool name) are skipped.

  • RestLlmStore, RestMcpCallsStore, RestChannelIntegrationStore, RestRagStore and RestApiCallsStore apply it for every caller who is not eddi-admin. MCP read_resource/read_channel_integration reach the same REST stores through the loopback client, which forwards the caller, so they are covered too.

  • RestLlmStore's write-time warning now uses the same detection, so it warns about exactly what an editor cannot read back.

  • RestRagIngestion reads the knowledge base through the new RestRagStore.readUnredacted (same access check, no redaction): ingestion builds the embedding model from that document and must not send the marker.

Design decision: no merge-back of the stored literal when an editor saves a redacted document — the marker is saved and fails at the provider. Merging it back would let an editor move the marker next to a host of their choosing (H1 with extra steps).

Upgrade and sync read their targets unredacted, and the previews an editor sees are redacted at the REST boundary — see the last entry below.

Files: ConfigSecretRedactor.java, RestLlmStore.java, RestMcpCallsStore.java, RestChannelIntegrationStore.java, RestRagStore.java, RestRagIngestion.java, RestApiCallsStore.java, security.md, secrets-vault.md

Tests: ConfigSecretRedactorTest (rules, idempotence, a linear-time check on adversarial braces), one *ReadRedactionTest per store; each store test was mutation-checked by removing the redaction and watching it fail.


🔒 fix(security): resetting a tenant's vault requires confirm=true (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

L11 of the 2026-10-17 security review. POST /secretstore/secrets/{tenantId}/reset deletes every secret and DEK of a tenant and had no confirmation, unlike adopt-master-key. It now requires ?confirm=true; without it the answer is a 400 with {"error": "confirm=true is required", "action": …} and nothing is deleted. The Manager's reset dialog (which already makes the admin type the tenant id) sends the flag, and the adopt-master-key response names it.

Files: IRestSecretStore.java, RestSecretStore.java, secrets.ts, secrets-vault.md


🔒 fix(security): name the vault secrets that may still be sent anywhere (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

The residual of H1 in the 2026-10-17 security review: PR #1079 makes the setup wizard set allowedHosts on every key it vaults from now on, but every secret vaulted before it keeps an open destination, so an editor can still exfiltrate it by pointing a copy of the LLM configuration at their own host.

  • New UnrestrictedSecretsCheck (next to VaultStartupBanner): when the vault is enabled it scans, on a virtual thread after boot, the current version of every LLM, MCP-calls, RAG, httpcalls and channel configuration for ${vault:…} references, reads each referenced secret's metadata, and logs one [SECURITY] WARN naming every secret without allowedHosts (tenant/key), the configurations that reference it, and the PUT /secretstore/secrets/{tenantId}/{keyName}/grant call that narrows it.

  • GET /secretstore/secrets/{tenantId} (admin-only) now returns SecretListing entries: the same metadata fields as before plus unrestrictedDestination (live: allowedHosts empty) and referencedBy (from the last complete scan; absent before one).

  • The scan says when it could not read every configuration: one [SECURITY] WARN, and referencedBy stays absent rather than claiming that nothing references a secret the unread configuration may use.

Design decision: no automatic migration. Only the admin knows which host a key belongs to; a wrong guess would break a working agent. AgentSetupService and VaultSecretProvider are untouched (PR #1079 changes them).

Not covered: references reached only through ${vars:…} or ${connection:…}, and old configuration versions that are still deployed. No Manager warning state yet (UI).

Files: UnrestrictedSecretsCheck.java, SecretListing.java, RestSecretStore.java, secrets-vault.md


🔒 fix(security): the free-text redaction filter knows more provider key shapes (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

L6 of the 2026-10-17 security review. SecretRedactionFilter — which backs logs, dead letters, the audit scrub, HITL approval cards and now the config read-redaction — recognised only sk-, sk-ant-, Bearer and named fields. Patterns added (no existing rule changed): Google AIza…, xAI xai-…, Groq gsk_…, GitHub gh[pousr]_… and github_pat_…, Slack xox[baprse]-…, AWS AKIA…/ASIA… (exactly 16, not inside a longer run), bare JWTs, the credential after Authorization: Basic|Token|Digest, …Subscription-Key: headers, and the userinfo password of mongodb(+srv), postgres(ql), mysql, redis(s) and amqp(s) connection strings. (api-key:/x-api-key: were already matched by the API-key name rule.)

Every pattern is a literal prefix plus one possessive or bounded character class that admits no quote, backslash or brace, so a match cannot cross a JSON string or eat a ${vault:…} reference. The JWT rule is the one that can fail after consuming a long run, so a lookbehind admits a start only where a token run begins — without it eyJ repeated 60,000 times is quadratic (the mutation check timed out at 30 s).

The connection-string rule had a 256-character ceiling on the user and on the password, and stopped at the first @, so a longer password — or a malformed one carrying a raw @ (u:abc@tail:pw@host) — went through in part. The password is now walked by hand to the last @ of the authority, in one pass. The labelled scheme rule lost its six-character floor (Authorization: Basic YTpi is a:b), and a quote escaped inside a JSON-carried Digest value no longer ends that credential early. Two gaps found in review: a Digest header lost only username= — the scheme rule took one unquoted token and left response=, the credential proper, legible — and now loses its whole directive list, walked by hand rather than by a pattern, since a quantified group recurses once per directive; and a bare Basic <base64> with no header name in front is redacted when the token decodes to user:password, so Basic configuration stays prose.

Files: SecretRedactionFilter.java, SecretRedactionFilterProviderShapesTest.java, secrets-vault.md


🔒 fix(security): legacy no-AAD vault rows are re-sealed bound on first read (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

L10 of the 2026-10-17 security review. VaultSecretProvider.decryptSecretWithFallback kept a permanent no-AAD fallback for rows written before row binding, so with database write access the ciphertexts of two such rows could be swapped and each still decrypted. Only a DEK rotation retired the fallback, and a deployment that never rotates kept it forever.

  • resolve() now notices when a row opened only through the legacy path and re-seals it bound (tenantId|keyName|dekId AAD) under the same DEK generation, through the new ISecretPersistence.resealSecretInPlace (Mongo and Postgres). It rewrites only the ciphertext and IV — not dekId, not lastRotatedAt — and is guarded on the IV the row was read with: a dekId guard cannot see a concurrent store under the same generation and would write the old value back over the new one. A lost guard, a failure or an implementation without the method (the interface default writes nothing) leaves the row legacy and readable; the read never fails because of it — the write-back catches every RuntimeException, so a driver or pool error a store did not wrap cannot fail it either. Logged once per key per node.

  • openSealedData (OAuth grants and other participant-owned sealed data) cannot write back — the provider does not own those rows — so it logs once per tenant that POST /secretstore/secrets/{tenantId}/rotate-dek re-seals them bound.

Files: VaultSecretProvider.java, ISecretPersistence.java, MongoSecretPersistence.java, PostgresSecretPersistence.java, secrets-vault.md

Tests: VaultLegacySealingRetirementTest (re-seal on read, swap refused afterwards, a store racing the write-back wins, a failing write-back does not fail the read) and guard tests in the Mongo and Postgres persistence unit tests; mutation-checked.


🔒 fix(security): the read-redaction marker is never stored; upgrade and sync read targets unredacted (2026-10-17)

Repo: EDDI (fix/security-review-secrets-redaction)

Follow-up to the M1 read-redaction above, so it can never turn into stored corruption.

  • Writes refuse the marker. New RedactionMarkerGuard (configs/rest): every create, update, JSON Patch and duplicate of the LLM, MCP-calls, channel, RAG and httpcalls stores, RestImportService.createResourceDirect and UpgradeExecutor.createExtension answer 400 {"error": "bad_request", "message": …, "fields": […]} when any string in the document contains <redacted: , for administrators too. The import and upgrade paths create every resource type through one method, so there the check is scoped to those five document types (requireNoneIfRedactedType): a workflow or output set that merely mentions the marker text is content and imports. Before this, an editor who opened a configuration in the Manager and saved it replaced the stored key with the marker, and the agent broke at its next deploy.

  • One recognisable marker. The in-string marker ConfigSecretRedactor writes into URLs, headers and bodies is now <redacted: credential> instead of the filter's generic <REDACTED>, which a prompt or output template may legitimately contain. Both markers share the <redacted: prefix the guard looks for.

  • Unredacted internal reads. RestLlmStore, RestMcpCallsStore, RestApiCallsStore and RestRagStore expose readUnredacted (same access check; readRagForIngestion became readUnredacted). StructuralMatcher reads upgrade/sync targets through it instead of the loopback REST client, so an editor-run upgrade neither diffs against the marker nor writes it: the export's ${vault:REDACTED} placeholder is replaced by the target's own key.

  • A sync source read from a peer through a non-admin credential carries the peer's marker; such resources are now refused rather than stored.

  • Previews are redacted for editors. The matcher's unredacted target content is also what the upgrade and sync previews return, and those endpoints admit eddi-editor, so RestImportService redacts sourceContent and targetContent for every caller who is not eddi-admin (PreviewRedaction, with the stores' redactor and skipped paths) before a preview leaves the server. The upgrade itself still writes from the unredacted read. (Review finding on the PR.)

Tests: a *RedactionMarkerWriteTest per store, a marker case in RestImportServiceCallerTokenTest, EditorUpgradeKeepsTargetCredentialTest (an editor-run upgrade of an agent whose LLM config holds a plaintext key keeps it and is not refused), PreviewRedactionTest and RestImportServicePreviewRedactionTest; each mutation-checked.

Files: RedactionMarkerGuard.java, ConfigSecretRedactor.java, PreviewRedaction.java, StructuralMatcher.java, UpgradeExecutor.java, RestImportService.java, security.md


🔒 fix(manager,chat): UI findings from the 2026-10-17 security review (2026-10-17)

Repo: EDDI (fix/security-review-ui)

What changed and why

The UI half of the 2026-10-17 review (L1, L5, and the Manager side of M5). The backend halves are separate branches.

  • L1, Chat ?apiServer=. http.ts builds request URLs by concatenating the base and the path, and the allow-list let ? and # through, so ?apiServer=%2Fadministration%2Fcluster%2Fcaches%2Fresync%3F made the widget's start call a state-changing request to another same-origin path, carrying the page's credentials. sanitizeApiServer now parses the value against the page origin and accepts it only when the origin is unchanged, search and hash are empty, the pathname is exactly the input (so .. and . segments are refused), and it has no %. Documented in chat-ui-embedding.md.

  • L5a, opt-in agent HTML. sanitizeAgentHtml now forbids class (Tailwind utilities could paint a full-viewport fake prompt) and the svg, math, image, feImage and use elements (render-time fetches), and forces target="_blank" rel="noopener noreferrer" on every anchor through a hook registered only for the call.

  • L5b, ids in request paths. New lib/api/path-segment.ts: seg() encodes an id and refuses /, \, .., whitespace, control characters and empty values; nameSeg() encodes a free-form name (connection name, tenant, secret key) and refuses only ., .. and empty. Every id interpolated into a path under lib/api/ now goes through one of them (about 160 call sites in 32 files). The chat panel drops an unsafe ?agentId= / ?conversationId= before issuing GET /agents/<id>.

  • L5c, navigateAway. The OAuth link flow navigates only to an https: URL, or http: for localhost, 127.0.0.1 and [::1], without embedded credentials (lib/authorization-url.ts). Anything else is a failed start with the existing "Could not start linking." toast.

  • L5d, pinned Workforce responses. The localStorage key now names the signed-in principal (workforce-pins-<principal>:<board>), and sign-out removes every workforce-pins-* key.

  • M5, Platform Operator trust. platform.operator is writable by eddi-editor. The Manager now opens the operator chat, history and conversation restore only when the agent's descriptor carries [eddi-platform-operator] and the approval gate verifies on every version (useOperatorTrust, lib/operator/operator-trust.ts). Otherwise the drawer and the operator page show an "operator could not be verified" panel with Check again, and fail closed when a check cannot be completed. Before an Upgrade that keeps the stored instructions, or a Reconfigure that carries them over, the admin sees a line diff against the default (and the full stored text) and must tick a confirmation. The Manager also does nothing to an agent it could not verify (review follow-up on PR #1082): the marker is read at the agent's current version from the store, never at config.version (that number sits in the same editor-writable variable as the id, so its author chose which descriptor would be inspected); an unverified agent gets no Check connection, Deactivate or upgrade notice, and a paused one no Turn back on; Reconfigure provisions the replacement with retirePredecessor: false, which leaves the old agent exactly as it was and reports that in the superseded banner; and Delete operator becomes Unregister operator (useUnregisterOperator), which drops platform.operator and touches no agent. 21 new strings in all eleven locales.

Design decisions

  • The marker is writable by anyone who can edit the descriptor, so the check is a tripwire, not a signature. The real fix is reserving platform.* for eddi-admin on the backend (other branch). It is stated in the docs.

  • An unverified agent is left alone rather than retired on Reconfigure or deleted on Delete, even though the admin asked: platform.operator can name any agent, so a retire-and-replace flow would be the one-click way for an editor to have an admin permanently delete someone else's agent and its resources. The admin gets the Agents screen instead, where the agent is shown for what it is.

  • seg() throws rather than sending a mangled request. Free-form names get the lighter nameSeg() because existing tests (and real tenants and secret keys) contain spaces and slashes that encodeURIComponent already makes inert.

  • No change to system-prompt.ts or tool-scopes.ts, so operator-revision.json is not bumped.

Not done / follow-up

  • The Stryker scope includes src/lib/operator/**; the mutation run was not repeated for the two new files there (operator-trust.ts, prompt-diff.ts).

Files: ChatWidget.tsx, markdown-safe.tsx, path-segment.ts, authorization-url.ts, workforce-pins.ts, operator-trust.ts, operator-untrusted.tsx


⚡ fix(ui): clicks that never wait on I/O, and a Chat UI that holds up on phones (2026-10-17)

Repo: EDDI (fix/ui-click-responsiveness)

Half of a review of both UIs for click latency, every screen size and every state. Four read-only reviews (click responsiveness, layout/RTL, Manager state handling, Chat UI) produced about 100 verified findings. This PR holds the Manager's click-latency fixes and the whole Chat UI; the Manager's layout, RTL and state fixes are in the companion PR on fix/manager-layout-a11y. The two share no file and build independently. Agent cards here carry the reveal-on-touch class, which that PR defines; until it lands the class is inert.

Clicks no longer wait on I/O (Manager)

  • Optimistic updates. New lib/optimistic.ts (patchQueries / restoreQueries). The schedule enable toggle flips its row at once and rolls back on failure; only the clicked row is disabled, not every toggle on the page. Notification mark-read/dismiss update the badge and the list immediately, and busy state is per item.

  • Mutations no longer hold their pending state through a refetch. onSuccess/onSettled arrows that returned invalidateQueries(...) made TanStack wait for the refetch before call-site callbacks ran (closing a dialog, navigating). Fixed in use-cluster, use-group-templates, use-group-workspace and use-user-conversations. The share dialog no longer awaits five invalidations one by one before re-enabling its controls.

  • Deploy no longer refetches every agent card. Deploy and undeploy invalidated all of agentKeys.all, so every card's status query refired. agentDeploymentQueries(agentIds) in query-keys.ts matches only the deployed agent's entries and the environment listings, and refreshes any sub-key it does not recognise.

  • Filters stop blanking the list. Search on agents and workflows, the cluster leases and dead-letter filters, and the logs instance filter are debounced (250–300 ms) and use placeholderData: keepPreviousData.

  • Fewer sequential round trips. The "where is this used" scan after a resource save fetches workflows and agents with bounded concurrency (8), and fetches each agent once rather than once per matching workflow. Grant dry runs run in parallel, and so do the agent editor sheet's post-save invalidations.

Chat UI

  • Layout: a long code line or a wide table widened the bubble and scrolled the whole transcript sideways (min-width: 0, plus a table scroller). Inputs are 16px so iOS does not zoom on focus. The viewport meta adds viewport-fit=cover and interactive-widget=resizes-content, and the root height is 100dvh, so the composer clears both the home indicator and the keyboard. Very wide screens cap line length. Lists, blockquotes and tables use logical properties, and messages carry dir="auto".

  • Scrolling: pressing Scroll to bottom during a reply turned following off again as soon as the smooth scroll began, because its own scroll events read as "left the bottom". Now only the reader moving up ends following. The view also re-pins for content that grows without a new message (the throttled trailing render, images, KaTeX, a shrinking viewport), and the button scrolls the transcript rather than the host page.

  • Indicators: no more dots under a reply that is already streaming. Undo, redo, retry and cancel no longer show the typing dots or a Stop button. Pressing Stop then would have cancelled the conversation and raised a false "interrupted" banner.

  • Focus and input: focus moves to the composer after a quick reply or Stop, and back to the New-conversation button when its confirmation is cancelled. Quick replies render disabled while a click would be dropped. On touch screens Enter inserts a newline. A refused draft regrows to its height. An agent-requested field no longer steals focus on page load.

  • Undo and redo rebuild messages with position-derived ids, so unchanged bubbles keep their keys and are not re-animated and re-parsed. The status strings "Thinking…", "Using {tool}…" and the scroll button label are translated.

Team setup, HITL and background polling

  • Group and Workforce wizards set their members up in parallel. runDeployManyWithGrants deploys DEPLOY_MANY_CONCURRENCY (3) targets at a time instead of one after another, and both wizards create new agents three at a time. The grant dialog still asks one question at a time: a new request used to cancel the open one, which is why the loop was sequential, so the per-agent second-chance dialogs now go through serializeGrantDecisions. Every agent that was created is recorded before a failure is reported, because provisioning is not idempotent. The Workforce wizard raises one toast for the batch, and each failed row shows its own error.

  • HITL human-input submit is optimistic. The cached group conversation leaves AWAITING_HUMAN_INPUT at once and is put back if the submit fails. It used to await two refetches, which kept the button pending for an extra round trip.

  • The Chat UI no longer polls approval status from a hidden tab. The next read is parked and taken at once when the tab is visible again.

Review fixes

  • Optimistic rollbacks are scoped to their own operation. A failed schedule toggle undoes only its row, and a failed notification dismiss undoes only its items and its share of the badge, instead of restoring a whole snapshot over a later change. Every schedule row with a toggle in flight stays disabled (useMutationState), not just the latest one.

  • The share dialog refreshes the agent's detail and descriptor queries as well as the lists. Those keys have their own roots, agent and agent-descriptor, not agents.

  • Dead-letter paging is disabled while a page is still placeholder data, so a second click cannot push the same cursor twice.

  • The logs instance box follows back/forward navigation.

  • Schedule edits made through the trigger tabs, cron presets and the agent picker count as edits, so Escape or a backdrop click no longer discards them.

  • The Chat composer takes a pending focus request only once the turn has finished, so the phone keyboard does not cover a reply as it arrives.

Not done (follow-ups)

  • A client-side idle watchdog for a stalled chat stream was considered and rejected. The conversation stream sends no keep-alives (only the log stream does), so a single slow tool or model call is legitimately silent for minutes, and a watchdog would cut real turns off as "connection lost". It needs a server-side heartbeat first.

  • Workforce analytics and the skill registry still fire one request per group or skill; both need batch endpoints on the backend.

Tests

New: responsiveness-review.test.tsx and a Scroll-to-bottom regression in ChatWidget.ux.test.tsx (Chat), and optimistic-mutations.test.tsx (Manager), plus deploy-many-concurrency.test.ts and a hidden-tab case in useHitlPolling.test.ts. Mutation-checked: restoring the old scroll handler, dropping the dialog queue (in the serializer or in its use), dropping the HITL cache patch and ignoring visibility each fail a test.


feat(manager): model picker that always shows the whole catalog, and a refreshed model list (2026-10-17)

Repo: EDDI (feat/manager-model-picker)

What changed and why

The model field no longer hides the catalog. The agent wizard, the LLM editor and the operator activation form used a native <datalist>, which filters its options by whatever the input holds. The field is pre-filled with the provider's default, so clicking it showed one option, the default, and read as "this provider has one model". The new ModelCombobox (ui/manager/src/components/shared/model-combobox.tsx) replaces all three:

  • A click, the chevron or ArrowDown opens the whole list with the current value ticked and scrolled into view. The provider default carries a default badge.

  • Typing puts matches under a "Matching …" heading and keeps every other suggestion below a divider under "Other models". Matching ignores case and separators, so opus 5.5 finds claude-opus-5-5.

  • When nothing matches, a note says the typed id is used as typed. A footer repeats that any id the provider supports can be typed. The suggestions are help, not a whitelist.

  • It follows the ARIA combobox pattern (aria-activedescendant, grouped listbox). Escape closes only the list, not the dialog around it. A read-only field gets no list.

The grouping lives in groupModelSuggestions in lib/model-suggestions.ts. The 7 new modelCombobox.* strings are translated into all 11 locales.

Catalog refresh. Every id was checked against the provider's model and deprecation pages on 2026-10-17.

  • Added:

    • claude-haiku-5-5 (Anthropic, Vertex, Bedrock)

    • gemini-4-argon (Gemini, Vertex, OpenRouter)

    • The GPT-6 family on Azure and Bedrock

    • mistral-large-4

    • grok-build-0.1

    • Grok, Gemini and Llama 4 Scout on OCI

    • Gemma 4, Qwen 3.5/3.6, Ministral 3 and gpt-oss on Ollama

    • Popular OpenRouter slugs

  • Removed:

    • OpenAI: o3-mini (shut down 2026-10-23), gpt-5.4-nano, the gpt-5 family, and gpt-5.4-thinking, which was never an API id

    • Gemini: gemini-3.7-flash and gemini-3.5-flash, both deprecated on AI Studio

    • Vertex: gemini-2.5-*, retiring 2026-10-20

    • MiniMax: the M2.7 pair (retiring 2026-11-18). M3.1-Flash-Preview stays, because the parameter catalog has rules for it, though MiniMax currently offers it only on its subscription plans

    • Bedrock: models now Legacy or past end of life (Llama 3.x/4, MiniMax M2)

    • Azure: deprecated gpt-4o and gpt-4.1

  • Fixed ids that never existed:

    • Hugging Face: deepseek-ai/DeepSeek-V4, google/gemma-4-assistant and Qwen/Qwen3.5-7B

    • Bedrock: anthropic.claude-sonnet-4-6-v1:0

    • OCI: the openai/gpt-oss-* ids, which take a dot after the vendor, not a slash

    • Vertex: claude-haiku-4-5@20251001

  • Bedrock now suggests global. inference-profile ids. Most current models have no in-Region endpoint on bedrock-runtime.

  • Defaults:

    • Gemini and Vertex: gemini-3.5-flash → gemini-3.8-flash

    • Hugging Face: Qwen/Qwen3.5-7B, which does not exist → Qwen/Qwen3.8-27B

  • The named-compatible changes (xAI, MiniMax, OpenRouter) are made in both openai-compatible-providers.json and its Manager mirror.

  • The operator's system prompt lists these suggestions, so the operator revision is bumped.

Not done

ModelCombobox is not added to the design-sync mirror (.design-sync/).


⚡ perf(engine): convert only the current step for a turn's response, drop per-turn INFO logging (2026-10-17)

Repo: EDDI (perf/hotpath-and-startup)

What changed and why

Part of the throughput work (planning/throughput-optimization-plan.md, WS3b and WS8.5). A JProfiler run at 1,000 concurrent conversations put 9% of running time in Jackson and about 2% in per-turn Logger.info calls and String.format.

  • Current-step-only conversion (WS3b). The memory overload of ConversationMemoryUtilities.convertSimpleConversationMemorySnapshot converted every step of the conversation and then returned only the last one, which is the default turn response (returnCurrentStepOnly=true) and the HITL replies. With returnCurrentStepOnly it now builds the snapshot through convertConversationMemoryForCurrentStep: same header, outputs, properties and redo cache, and a step list of the same size whose entries are converted only when read. The projection reads the last step and the list's size, so a turn converts one step instead of all of them. Redaction, secret-turn masking, the error field and the undo/redo flags are unchanged: they run in convertSimpleConversationMemory, which still does the work. A reader that walks every step still gets correct values, because each step converts on first access; it just gets no saving. Callers in ConversationService needed no change.

  • A quadratic loop in convertConversationMemory. IConversationMemory.getAllSteps() copies the whole step list on every call, and the conversion called it twice per step. It is now called once. The persistence path uses this conversion too.

  • Per-turn INFO logs are now DEBUG. Every turn logged four INFO lines, even for an agent with no tools: "Discovering httpcall tools…", "Discovered 0 httpcall tools…" and the two mcpcalls equivalents. Lines that fire on every turn when their feature is configured moved to DEBUG as well: built-in tool counts and lazy-tool loading (AgentOrchestrator, ToolLoopRunner), the contextual memory/recall/attachment tools, RAG and rolling-summary injection (LlmTask, RagContextProvider), the httpcall tool result line, and the cascade step lines. The string-concatenating ones now use debugf, so nothing is built while DEBUG is off.

  • No more new ObjectMapper() per discover_tools result (WS8.5). ToolLoopRunner.activateDiscoveredTools built a mapper for every result; it now uses a shared one.

  • Bound Jackson readers and writers. The Mongo JacksonCodec binds an ObjectReader for its type and an ObjectWriter once, instead of resolving them through the mapper for every document. JsonSerialization does the same for its writer and untyped reader.

Measurements

Conversion, single thread, best of five (memory with ten properties and twelve data per step):

Steps
Full conversion (persist) before → after
Turn response before → after

10

8.0 → 6.6 µs

≥ 8 → 1.0 µs

50

57.8 → 30.4 µs

≥ 58 → 2.6 µs

200

376 → 113 µs

≥ 376 → 2.5 µs

"Turn response before" is at least the old full conversion, which the projection ran first. End to end (scripts/loadtest, origin/main against this branch, alternating A/B/A/B on Docker Desktop on a shared machine, so treat the numbers as indicative): steady 50 conversations with a 0 ms mock LLM, 81.9 → 102.9 turns/s on average (the rounds overlap: 88.7 and 75.1 against 120.1 and 85.7); long-conversation (5 × 200 turns), p50 87 → 80 ms at the same throughput, since MongoDB dominates there. INFO lines per run: 16,043 → 43.

Tests

ConversationMemoryCurrentStepConversionTest: 168 golden-equivalence cases compare the new path with the full conversion plus trim across six memories (plain, secret last turn, secret earlier turn, error, redo, single step) × returnDetailed × returnCurrentStepOnly × seven returningFields shapes. One test checks that the path still redacts credentials, drops audit:* and masks a secret turn. One guard checks that only the newest step is read. Mutation-checked: reading the steps in the wrong order fails 51 cases, converting eagerly fails the guard, and dropping the redo cache fails 14 cases.

Not done here

PR #1066 adds a conversationCost sum over all steps to convertSimpleConversationMemory. It stays correct on this path, because the lazy list converts every step it is asked for, but it gives up most of the saving for the default response. Once both land, the cost sum should read audit:cost from the live steps (or from a running total) rather than from converted snapshots.

Files: ConversationMemoryUtilities.java, JacksonCodec.java, JsonSerialization.java, ToolLoopRunner.java, HttpCallToolsProvider.java, McpToolsProvider.java, AgentOrchestrator, ContextualToolsProvider, LlmTask, RagContextProvider, CascadingModelExecutor.


test(loadtest): cluster mode for the turn load test, N replicas behind nginx (2026-10-17)

Repo: EDDI · Branch: test/loadtest-cluster-scaling

What changed and why

Cluster mode (NATS leases with fencing, the cluster event bus, degraded mode) is well tested for correctness, but nothing measured multi-node throughput: the single-node WS2 report was the only data, and the sizing claims in clustering.md, including "the database is the shared bottleneck", were unverified.

  • scripts/loadtest/docker-compose.cluster.yml (new): the topology of the repository's docker-compose.cluster.yml and scripts/cluster-demo (N EDDI replicas with eddi.messaging.type=nats, three NATS nodes at R3, one MongoDB, nginx round-robin), plus the WireMock LLM and k6. It has its own ports (75xx), so it runs next to the single-node stack.

  • scripts/loadtest/nginx-cluster.conf (new): the cluster balancer's rules, sized for thousands of connections. It adds X-Loadtest-Upstream to every response, and only a refused connection moves on to the next replica, so 409s and 503s reach k6 and get counted.

  • k6/turns.js: with NODE_ADDRS set, every turn metric is tagged with the replica that answered, and one no-op threshold per node makes k6 write the per-node submetrics into its summary.

  • loadtest.py: new commands cluster-up --nodes N, cluster-run, cluster-down, cluster-matrix --nodes 1,2,4,8 [--baseline] and cluster-report. Every point starts from a fresh stack and gets a warm-up run that is thrown away. Each run collects, per node: turns/s, p50/p95/p99, 409/503, eddi_cluster_lease_acquire_seconds by outcome, eddi_cluster_fence_rejected_total, peak in-flight turns and leases held. Across the cluster it collects MongoDB ops per turn and per second, NATS messages per turn, and the CPU of every container (other stacks' too) plus the host's. --baseline adds one single node with eddi.messaging.type=in-memory, so the overhead of cluster mode at N=1 shows up.

Design decisions

  • Comparability is explicit. In-flight turns per node (--max-in-flight, 400), the MongoDB maxPoolSize (100), heap, memory and CPUs per node are passed on every point. None of them is left to max-in-flight-turns=auto, which depends on the heap.

  • Host CPU is measured, not assumed. On Docker Desktop, the replicas, MongoDB, NATS, nginx and k6 share one VM with everything else on the machine. The report gives the host's CPU (typeperf on Windows) and other stacks' container CPU next to the efficiency column, because on one machine a falling efficiency can come from the host as easily as from the database.

  • Agent setup goes to a node directly. Right after start, the balancer can still hold an address it resolved before the replica was up, and it answers the setup POST with a 502.

  • MongoDB gets restart: on-failure. On a busy host the image's two-step first start can fail with exit 48 (address in use).

Results

scripts/loadtest/results/cluster-scaling-2026-10-18.md. The setup was 100 conversations per node, a 3 s mock LLM and 2 CPUs per node. The host was saturated (85–99 % CPU, shared with other sessions' work), so the report measures overhead and shape, not true horizontal scaling.

  • Errors: none across 18k turns — no 409, no 503, no fence rejection.

  • Overhead at N=1: cluster mode ran 16.1 turns/s against 21.3 in memory (−24 %, +1.4 s p50). Every turn paid an uncontended lease acquire of ~151 ms.

  • Lease contention: round-robin without affinity makes 13–32 % of acquires contended (0.5–2.6 s extra) even with one sequential client per conversation. A turn holds its lease until persisted, which is after the reply.

  • Efficiency: 1.11 at N=2 (a quiet re-run; the first N=2 run read 0.28), 0.65 at N=4, 0.40 at N=8.

  • Where it saturated: node CPU at N=4, then host CPU at N=8. MongoDB peaked at 1.2k ops/s (23 ops/turn, flat in N, 2.25 of 4 CPUs) and NATS at 0.5 CPU per node, so neither was the limit. The expected database knee is untested here.

  • NATS cost: about 14–22 ms of NATS CPU per turn across R3. That puts a 1-vCPU NATS node nearer 150–200 turns/s than the docs' "thousands", and needs a re-check on a quiet machine.

Follow-ups

Profile the uncontended lease acquire. Decide between releasing the lease before post-reply persistence and routing by conversation in the reference nginx config. Re-measure NATS CPU and the database knee on separate machines.


perf(engine): fewer MongoDB round trips per conversation turn (2026-10-16)

Repo: EDDI (perf/turn-mongo-roundtrips)

A JProfiler profile of the virtual-thread build (labsai/EDDI#1045) counted about 17 MongoDB reads per turn, each with a named caller, and found the driver's connection pool to be the ceiling once turns run on virtual threads (418 operations queued for a connection at 500 in-flight turns). This branch removes the redundant ones, one commit each, in the order the profile suggested.

What changed and why

  • One conversation-descriptor read per request. A REST turn read the same descriptor three times before it started: RestAgentEngine's ownership check, the same check again in ConversationService.say, and the soft-delete check right after it. New ConversationDescriptorMemo (@RequestScoped) remembers the resolved descriptor (live, archived or none) for the rest of the request; ConversationAccessGuard and ConversationService.isSoftDeleted both resolve through it. Only the descriptor is shared, never a decision: each check still compares the owner against its own identity. Store failures are not remembered, every write through ConversationDescriptorStore forgets the conversation, and outside a request (worker threads, schedules) every lookup reads the store as before. Saves 2 reads per turn on the request thread, where the profile saw most of the pool waits.

  • updateTimeStamp is one update (WS3c). It was getCurrentResourceId + readDescriptor + ModifiableHistorizedResourceStore.set (which reads again) + a version-checked full replace: 3 reads and a write on every turn's completion path. New storage SPI method IResourceStorage.setNumberField(id, field, long): MongoDB updateOne with $set, PostgreSQL UPDATE … SET data = jsonb_set(…, to_jsonb(?::bigint)), both on the live row only (a soft-deleted or unknown id writes nothing). DescriptorStore.touchLastModified uses it; ConversationDescriptorStore.updateTimeStamp falls back to the old rewrite only for a backend without it. The value is stored as a number, exactly as the persistence mapper writes dates (epoch millis), so retention (RestConversationStore compares getLastModifiedOn()) and the listings' server-side sort see no difference — DescriptorTouchParityTest checks the read-back date, the stored type (BSON int64 / jsonb number), the sort position among fully written descriptors and that no other field or version changes, on a real MongoDB and PostgreSQL. A side benefit: the replace could overwrite a concurrent edit of any other descriptor field with the copy it had read; a single-field update cannot. A failure is now logged and swallowed instead of thrown into the completion callback, where it would have broken the response of a turn that was already stored.

  • Signing negative cache (WS8.1). AgentSigningService.loadPrivateKey cached only keys it found, so with an active vault every audit entry of a keyless agent (three per turn) asked the vault — a secretvault_secrets read — only to hear "not found" again. A "not found" is now remembered for 60 s per key (MISSING_KEY_TTL_NANOS, bounded at 10 000 entries). A vault failure is never remembered. Generating or rotating a key on this node evicts the entry, so the new key signs at once — including when a lookup that started before the key was stored answers "not found" after the eviction: every eviction is counted, and a miss whose lookup saw the count move is withdrawn instead of remembered; a key created on another node is picked up within the TTL, and entries written meanwhile carry no signature, as they would have a moment earlier. This is also step 7 of PQ-5a in the PQC plan — implemented once, here.

  • Pinned agent configuration from memory. ConversationHitlService.lookupAgentConfigPinned read the agent document at the conversation's pinned version on every turn, only to learn its tool-approval policy. New AgentConfigurationCache (@ApplicationScoped, Caffeine, 1 000 entries, 30 min after last access) keeps (agentId, version) configurations: a stored version never changes (edits write a new version; the only in-place writers are the descriptor stores and the startup migrations). Absence and store failures are not cached, so the HITL gate still fails closed on a read error and still falls back to the latest version when the pinned one is gone. AgentFactory drops an agent's entries on every deploy and undeploy. WorkflowTraversal's own short-lived traversal cache is left as it is; WS1 should hang its invalidation off the same deployment hooks.

  • One full conversation load per turn (WS3a). The conversation-id entry points (say / sayStreaming without an environment — REST, SSE, MCP, Slack, /v1) load the snapshot to find the agent and run the pre-turn checks, then called the environment-qualified overload, whose admission (admitTurn) loaded the same document again. That load is now handed down (preloaded) and converted instead of re-read. The idempotency admission (admitOrServe) still runs between the load and the turn, as before; a deferred duplicate re-enters the whole entry point and loads afresh. The environment-qualified overloads (A2A, group members, tests) still load on their own. Staleness is unchanged: the second load used to happen a moment after the first, and the step runner's reloadIfSuperseded revision check still guards the turn either way.

Measured

Load-test harness from labsai/EDDI#1044 (steady, 50 conversations × 20 turns, mock LLM delay 0 ms, everything in Docker), origin/main (aa8806c68) against this branch, 1 000 turns each. MongoDB operations per successful turn (serverStatus().opcounters, per-collection from top):

Before
After

Queries per turn

16.67

6.65

descriptors queries

6.05

1.05

conversationmemories queries

5.04

4.08

secretvault_secrets queries

3.05

0.06

agents queries

1.09

0.09

Updates / inserts per turn

2.05 / 3.11

2.05 / 3.11

Turns/s (single run, indicative)

117

146

On PostgreSQL (pg_stat_statements, SELECT conversation_state, data FROM conversation_memories), full conversation loads per turn went from 2.09 to 1.13 with short conversations, and from 2.74 to 1.88 in the long-conversation scenario (10 × 200 turns). An instrumented build traced the excess over MongoDB's 2.0 to ConversationStepRunner.reloadIfSuperseded: the reply is delivered before the turn is persisted, and on PostgreSQL the full-document append grows with the conversation, so the client's next turn is often admitted against the row as it was before the previous turn's write and reloaded when it runs (68 % of turns on main). That reload is what keeps the turn on the current document, so it stays; avoiding it means loading at run time when a turn is already in flight, or a cheaper PostgreSQL write (WS6/WS7).

The descriptor write stays one per turn, now a $set instead of a replace. Left on the turn path: one descriptor read (the ownership check), the full conversation load, the state and revision projections, and the GDPR restriction check on usermemories.

Design decisions

  • A request-scoped memo, not new parameters. The checks sit behind IConversationService.say / sayStreaming, which Slack, MCP, /v1 and A2A also call; threading a resolved descriptor through all of them would have changed every signature for a saving that only the REST path needs twice.


🔒 fix(ui): clear three npm advisories reported by Scorecard (2026-10-16)

Repo: EDDI (fix/ui-dependency-advisories)

What changed and why

OpenSSF Scorecard's Vulnerabilities check flagged three advisories. All three came from the UI lockfiles, not from the Maven build.

  • GHSA-238p-pmpm-9mq7, KaTeX prototype-pollution trust bypass (katex < 0.18.2). The Chat UI's own katex was already 0.19.0. rehype-katex@7.0.1 and micromark-extension-math@3.1.0 each ask for ^0.16, which gave them a nested 0.16.47 copy that ships in the chat bundle. Both are on their latest release, so an npm overrides entry now points both at the root version ($katex). Build, lint and all 480 chat tests pass, including the MessageBubble math-rendering tests.

  • GHSA-rj75-hqrm-r3gf, quadratic selector parsing in postcss-selector-parser (< 7.1.6). @tailwindcss/typography@0.5.20, also on its latest release, pins exactly 6.0.10. The Manager now overrides it to ^7.1.6. This is a build-time dev dependency. The Manager's generated CSS is byte-for-byte identical under 6.0.10 and 7.1.6, across all three stylesheets and 141 .prose rules.

  • GHSA-vfj7-8cjw-p6xm, braces stack exhaustion (all versions through 3.0.3, with no fixed release). It reached the repo only through ui/manager/.ds-sync/package-lock.json, via @tailwindcss/cli → @parcel/watcher → micromatch. .ds-sync holds local design-sync tooling that is never shipped and is not inventoried in the SBOM. Its lockfile is removed and gitignored, and the Dependabot entry for that directory stays to keep the manifest's direct dependencies current.

Both lockfiles were regenerated with the pinned Node 24.21.0 (npm 11.19.0), so the diff holds only the dependency change, without peer-flag churn from a different npm. Each nested entry was deleted by hand before npm install, because npm does not apply a new override to an entry the lockfile has already resolved.

Files: ui/chat/package.json, ui/manager/package.json, both package-lock.json files, ui/manager/.gitignore, .github/dependabot.yml

Next

Drop the two overrides once rehype-katex/micromark-extension-math accept KaTeX ≥ 0.18.2 and @tailwindcss/typography stops pinning postcss-selector-parser 6.


docs(planning): human takeover / handoff design for review (2026-10-15)

Repo: EDDI (docs/planning-human-takeover; planning document only, no production code)

What changed and why

WS7 of the competitor-research roadmap needs a maintainer-approved design before any code: a live 1:1 conversation handed to a person, who talks to the user while the pipeline is off and then hands it back. planning/human-takeover-design.md is that design, written against origin/main @ aa811c838.

  • Inventory of every branch on ConversationState. Engine, both conversation stores, cluster leases and fencing (#956), idempotent turns (#1000), the idle sweep and undeploy (#990), HITL, /v1, Slack, A2A, MCP, group members, schedules, Chat UI and Manager. Each entry gives the location, what it does today and what the new state needs. Allow-list sites are safe by default. The deny-list sites are listed as must-fix: NON_APPENDABLE_STATES in both stores, undo/redo, the admin state reset, the per-agent idle sweep, TurnIdempotencyService.isReplayable, and the A2A outcome switch, whose default -> completed would report an empty finished task.

  • Recommendations: a new HUMAN_CONTROL state rather than reusing AWAITING_HUMAN; the reserved action HANDOFF_TO_HUMAN, applied at the end of the turn; an opt-in request_human_agent tool that is never selected by an empty built-in whitelist; operator endpoints under /agents/{conversationId}/takeover. Takeover writes run as coordinator tasks under the conversation lease, which is never held for the length of a takeover. One step per message, with the operator's identity kept out of user-visible output. operator.* audit entries with the actor set server-side and message text stored only as a digest (a content commitment, not a copy). Because AuditLedgerService writes asynchronously, each takeover write also records its audit entry in a journal inside the conversation document, and a reconciler submits any entry a crash lost. Operator turns go into LLM history annotated as a human's. A dedicated role that never admits the conversation owner and, by default, reaches only the agents whose desk the caller belongs to.

  • Separable first PR: a property patch alongside a HITL /resume decision. It is allow-listed per agent, refuses longTerm and secret scopes, is audited by digest, and is validated before the resume CAS so a refused patch does not use up the pause.

Design decisions

  • AWAITING_HUMAN means "refuse input, then resume the pipeline at a bookmark", and HITL admits the owner. Takeover means "accept input, return to idle", and the owner must be excluded. Reusing the state would take a sub-branch at about 20 sites, and a missed one silently drops customer messages.

  • Paths avoid the word "operator", because in the Manager the Operator is the Platform Operator LLM.

What's next

Maintainer sign-off on the eleven questions in §11 of the design (Q11 confirms the secure default: desk scoping required, unrestricted access only by explicit opt-in), then PR 1 (property patch) and PR 2 (state and API) as laid out in §13.


feat(agent-tests): agent regression harness — golden conversations (2026-10-15)

Repo: EDDI (feat/agent-test-harness; WS6 Phase 6.1)

What changed and why

EDDI had thousands of tests and none that asserted what an agent does. A config-driven engine records every turn — actions, properties, output, tool calls, cost — so a suite can assert exactly that, independently of how an LLM words its answer.

  • AgentTestSuite config resource (configs/agenttests): a versioned document like every other config — scripted cases of turns, per-turn expectations, tool mocks, defaults (toolMode, unmockedTools, repetitions, passRate, turnTimeoutSeconds) and a per-run dollar ceiling (maxCostPerRun, default $1). AgentTestSuiteValidator refuses at save time (400) what a run could not honour: unknown modes, invalid or over-long regexes (500 chars), more than 200 cases / 50 turns per case / 20 repetitions / 2,000 turns per run.

  • AgentTestRun records (engine/agenttests, collection agenttestruns): one document per run through IResourceStorageFactory at a single version (the GroupConversationStore pattern), so it works on MongoDB and PostgreSQL alike; listed per agent newest-first, pruned to a bounded number per agent.

  • AgentTestRunner runs a suite against an agent version deployed to the test environment: one conversation per case repetition as user agent-test:<runId>:<case>:<repetition>, each turn through the non-streaming say with a per-turn timeout, judged from the stored memory afterwards (actions, properties, output text, audit:tool_calls, audit:cost, state). Repetitions run on virtual threads, at most eddi.agent-tests.max-parallel-cases (4) at once; the summed audit:cost (start turns included) is checked against maxCostPerRun before every turn. A HITL pause is an observable conversationState, after which the conversation is ended — the runner never waits for a human. Every test conversation is ended and permanently deleted afterwards (RestConversationStore.purgeConversation, the guard-free half of the permanent delete) unless the run keeps them. One summary audit-ledger entry per run (taskId: ai.labs.agenttest).

  • ExpectationEvaluator: actionsContain, actionsExact, properties (equals — representation-tolerant, 3 = "3" — matches, exists, absent), outputContains, outputMatches, toolCalled (+ argsSubset), toolNotCalled, maxToolCalls, maxCostUsd, conversationState. Every failing expectation is reported with the expected and actual value.

  • ReDoS guard (BoundedRegex): no safe-regex helper existed. Patterns are capped at 500 characters at save time and matched against a CharSequence that throws after 250 ms, so a catastrophically backtracking pattern fails its expectation instead of occupying a thread.

  • Long-term user memory is neither read nor written by test conversations: ConversationService.createPropertiesHandler hands an agent-test: user no user-memory store (so Conversation skips both the init load and storePropertiesPermanently), and the undo/redo long-term sync skips them.

  • AgentTestService (shared by REST and MCP): reading the suite needs VIEW; the version under test is deployed to test through IRestAgentAdministration.deployAgent(test, …, autoDeploy=false, wait), so the deploy's own EDIT check, space-reference guard and agent quota apply to the starter; a run is refused (409) when a newer version is also deployed to test, because new conversations start on the newest ready version. At most eddi.agent-tests.max-concurrent-runs (2) runs execute per node (429 beyond).

  • Tool mocking (ToolMockRegistry), fail closed. Consulted at the three places a pipeline reaches the outside world: ToolLoopRunner.executeSingleToolCallResult before executor dispatch (every LLM tool source; the HITL resume path goes through the same method), ApiCallExecutor.execute (rule-triggered httpcalls — the mock replaces the IResponse, so saveResponse, retries and postResponse property instructions run on the mocked {httpCode, body} unchanged; fire-and-forget calls are not dispatched) and McpCallsTask (rule-triggered MCP calls — no server contact at all, not even tool discovery, unless the suite runs live). An unmocked call returns {"status":"NOT_EXECUTED","reason":"no mock defined in test mode"} (a 501 for httpcalls) and fails the case; toolMode: live / unmockedTools: live are explicit opt-ins. A test conversation the registry does not know — a turn still running after its run gave up — is refused too. Memory-writing tools never run live in a test. For every other conversation the hook is one string prefix check on the user id. The LLM-path hook is a self-contained early return directly after the call is traced, so the pending split of that method merges trivially.

  • Tool expectations see all three paths: the registry records every intercepted call per turn (mocked, refused or live), and toolCalled / toolNotCalled / maxToolCalls are judged against that record rather than the LLM-only audit:tool_calls trace.

  • REST. Suites: /testsuitestore/testsuites (URI eddi://ai.labs.testsuite/testsuitestore/testsuites/{id}?version=N, the v6 store convention; registered with the workspace access-index backfill). Runs: POST /agenttests/runs (202 with the RUNNING record), GET /agenttests/runs/{runId}, GET /agenttests/runs?agentId=. Both eddi-admin/eddi-editor, the deploy tier.

  • MCP. run_agent_tests, get_agent_test_run, list_agent_test_runs (McpAgentTestTools, AUTHOR tier like deploy_agent); tool count 85 → 88.

  • Metrics. eddi_agent_tests_runs_total{status}, eddi_agent_tests_turns_total, eddi_agent_tests_run_duration_seconds, charted in the Scheduling row of the Full Metrics Reference dashboard.

  • Docs. New agent-testing.md (concepts, JSON reference, mocking rules, CI curl recipe, EU AI Act evidence note); mcp-server.md, metrics.md, configuration-reference.md (eddi.agent-tests.*), SUMMARY.md.

  • Full-engine proof: AgentTestSuiteIT (DevServices MongoDB) stores a suite over REST, starts a run against the deterministic rules-only agentengine fixture agent — the run deploys it to test itself — and reads back PASSED for a suite that holds and FAILED with the actual actions for one that does not. It found two defects the unit tests could not: MongoDB assigns a run's id only on its first write, and a turn's completion callback can run before the turn is stored, so a turn is now judged from the snapshot say completes with (detailed, current step) and only its internal audit:cost/model names — stripped from every client projection — are read from the stored step, waiting up to 5 s for it.

  • Platform Operator. May read suites and runs and start a run (a gated write — it deploys to test, like the deploy it already has); it may not write suites. Prompt explains reading results and unmockedTool. operator-revision.json → 24.

Review fixes

  • Unchecked purge moved out of the REST layer. The permanent delete is now ConversationPurgeService (memory package); RestConversationStore calls purge only after its owner check and keeps no unchecked public method. The runner calls purgeAgentTestConversation(conversationId, runId), which refuses any conversation whose user id is not agent-test:<runId>:… — the runner can only delete what it created. Nothing in the delete path reads a request identity (tested on an identity-less virtual thread, with a pending approval ended as a system actor).

  • Cluster mode is refused (409). Mocks and runs live in one JVM and NATS cluster mode can route a test turn to another node. A call refused for want of a session on this node now says so (no agent-test session on this node …) instead of no mock defined.

  • PR review. A run whose result cannot be stored (an oversized document, say) is replaced by a terminal ERROR record without the per-case detail, never left RUNNING; an output expectation's failure records the output cut at 2,000 characters like the turn's own; a suite read goes through the shared RestVersionInfo.read (version=0 = current, null/negative checks); the purge treats the store's null for a missing conversation as already gone. A rule-triggered httpcall's mock is selected before the request is built, so a mocked call neither resolves ${vault:}/${connection:}/${caller:} references nor fails for an unprovisioned credential.

  • Orphaned runs. A new ABORTED status: at startup, AgentTestRunRecovery marks every RUNNING run (none can be live yet) aborted with the reason and deletes its test conversations, found by their deterministic user ids.

Design decisions

  • The test marker is the user id (agent-test: prefix), not a new memory field: the CONVERSATION_START turn runs inside startConversation before the conversation has an id, and the user id is the one thing every seam (user-memory handler, tool loop, httpcall executor, MCP task) already has. The prefix only ever takes capabilities away, so it need not be unforgeable. agent-test: rather than the plan's test:, which a real deployment could plausibly use for real users.

  • ToolMockRegistry is static, because the LLM tool loop is plain classes built by AgentOrchestrator; threading a CDI bean through would have changed a dozen constructors (and the pending executeToolCall split).

  • Runs are not versioned config and live in their own single-version collection, pruned per agent (eddi.agent-tests.max-runs-per-agent, 50).

  • A newer version deployed to test refuses the run instead of being undeployed: the runner never changes a deployment it did not make.

  • Suites are not yet part of agent export ZIPs (maintainer decision) — follow-up.

Known gaps and follow-ups

  • Phase 6.2: generate a suite from a conversation, LLM-as-judge expectation, Manager page. Phase 6.3: optional deploy gate.

  • Suites in agent export/import ZIPs and in agent sync.

  • A run lives on the node that started it; if that node stops, the run is marked ABORTED at the next startup and must be started again.

Files: AgentTestSuite.java, AgentTestSuiteValidator.java, AgentTestSuiteStore.java, AgentTestRunStore.java, AgentTestRunner.java, AgentTestService.java, ExpectationEvaluator.java, ConversationService.java, ToolMockRegistry.java, IRestAgentTestRuns.java, IRestAgentTestSuiteStore.java, McpAgentTestTools.java, agent-testing.md


feat(groups): member_tool_call SSE event for group members (2026-10-15)

Repo: EDDI (feat/groups-member-tool-call-events)

What changed and why

A group member's turn is not streamed, so an observer saw nothing between speaker_start and speaker_complete, however long the member's tool loop ran. The 1:1 stream already emits tool_call (name only); the group stream now emits member_tool_call {agentId, displayName, tool} with the same rule: the name travels, the arguments never do.

  • IConversationMemory gains a name-only toolCallObserver (default null), deliberately separate from the event sink: a non-null sink switches the LLM task into its streaming path, which a member turn must not trigger. ToolLoopRunner notifies it next to the sink (observer failures are swallowed).

  • ConversationResponseHandler.toolCallObserver() (default null) lets a plain say caller supply it; ConversationService installs it per turn. MemberTurnExecutor supplies one only when a listener exists, and drops events from a cancelled speaker (the callback runs on a coordinator thread).

  • GroupDiscussionEventListener.onMemberToolCall (default no-op), emitted by RestGroupConversation. SlackGroupDiscussionListener keeps the no-op: Slack posts finished contributions, and a message per tool call would be noise.

  • Manager: the speaking member's typing indicator reads "using X..." instead of "responding..." (i18n in all locales). Docs: SSE table gains member_tool_call, cost_updated, stance_updated, and token is marked as never emitted.

Design decisions

  • Observer on memory rather than a new say overload: keeps the 9-argument say signature (and every existing mock of it) intact.

  • Absent observer or listener changes nothing.


✨ feat(llm): input and output guardrails on LLM tasks (2026-10-15)

Repo: EDDI (feat/llm-input-output-guardrails) — WS4 Phase 4a, executing the R0 spec of planning/langchain4j-recommendations.md.

What changed and why

Only tool results were governed (ToolResultGuardrail). Nothing screened the user's message or the model's final answer — the largest governance gap (jailbreaks, PII leaking either way). An LLM task can now carry inputGuardrails and outputGuardrails: ordered lists of {type, action, maxRetries, blockMessage, parameters}. Actions are block (default), redact, reprompt (output: re-ask the same model, maxRetries default 2, clamped 0–5, then block) and warn. Built-in types: prompt-injection (input), pii-redaction, regex-filter, max-length (both), json-object (output). Nothing is on by default; a task without the lists never touches the guardrail service.

  • Input guardrails screen the user's raw message before retrieval (a blocked message issues no RAG query or httpCallRag call; a redacted one is the retrieval query), then the assembled prompt before the model is built, preRequest runs or the circuit breaker is consulted — the second pass reuses the first result when the model-facing message is unchanged, so a finding is recorded once. A block answers the turn with the block message, served as a fallback (LlmFallbackHandler.serveText: the step's llm:fallback:<taskId> flag keeps it out of later history, fallbackField wrapping applies under convertToObject); the model is never called. Since the history builder merges a fallback turn's question into the next user message, only the last text part of the last user message is the current turn — earlier parts are screened as history, so a blocked injection cannot block every later turn. Redaction rewrites what the model sees; memory keeps the user's text. Earlier user messages of the history window are re-screened silently every turn, so a message blocked/redacted on its own turn is not replayed to the model later (a guardrail can opt out via screensHistory(), meant for model-backed types).

  • Output guardrails run right after responseValidation, in every branch — plain, streaming, tool loop, cascade — and on the HITL resume path. A block is served through the same serveText path (flagged, wrapped, not parsed, not recorded as the model's response); the raw output stored under langchain:<type>:<taskId> is the wrapped content, as on every other fallback path, while the stream and the visible output carry only the message text. A reprompt runs on the branch that produced the answer: plain chat re-asks the model; the tool loop and a resumed loop re-ask only the final answer over the tool transcript (reaskFinalAnswer — no tool runs twice); the cascade re-asks the accepted step. Corrective shape is R5's (FormatRetryRunner.withCorrective): request, rejected answer as assistant turn, corrective user message. A reprompt needs responseValidation.minAttemptMs of turn time left (#996 deadline) and an admitting per-model circuit breaker (#1001: a fresh ticket per reprompt, settled with its own outcome; the HITL resume neither consults nor settles one, as for R12), else blocks. Reprompt tokens fold into the turn's token usage and cost (cascade: priced with the accepted step's prices into cascadeCostUsd).

  • Streaming: an output guardrail with block/redact/reprompt forces the task onto the buffered path exactly like a retry response-validation policy (bufferOutput = retryPolicy != null || guardrailBuffering replaces every streaming decision that used retryPolicy != null); warn keeps streaming.

  • Evidence: step key audit:guardrail:<phase>:<type> (a list of {phase,type,action,reason,retryCount,taskId}), collected by LifecycleManager.buildAuditEntry into AuditEntry.output.guardrails (LLM task only); SSE guardrail_triggered {type,phase,action,taskId} via ConversationEventSink → StreamingResponseHandler (both wrappers in ConversationService) → RestAgentEngineStreaming; counter eddi.guardrail.triggered{phase,type,action}.

Design decisions

  • EDDI-native SPI instead of dev.langchain4j.guardrail types. R0 chose the lc4j types; against langchain4j 1.22.0 (javap-verified) OutputGuardrailRequest still demands a ChatExecutor that a guardrail may call itself — a second model-call path outside the turn's budget, deadline and cost accounting — GuardrailRequestParams still NPEs without userMessageTemplate/variables, results are sealed, and JsonExtractorOutputGuardrail no longer exists. Reprompting is EDDI's loop through a Reprompter the branch supplies, so the executor would be dead weight or a hazard. ContentGuardrail (type(), phases(), evaluate(text, context) → GuardrailVerdict ALLOW/REWRITE/VIOLATION) keeps "a new type is just another bean": GuardrailService indexes every @Any Instance<ContentGuardrail> by type. GuardrailVerdict.costUsd and GuardrailContext.messages are the hooks Phase 4b's classifier type needs.

  • A block is a value, never an exception (R0 T1): a guardrail message can quote user text and would otherwise reach the tool loop's retry classifier.

  • Fail closed (Pillar 4, consistent with the 4b classifier): a guardrail that throws or returns no verdict blocks (reason guardrail_error) when its action is block or reprompt, and warns when it is redact or warn; per-guardrail parameters.failMode (closed/open) overrides. History messages a closed guardrail cannot check are withheld.

  • Find vs act: guardrails only report; for pii-redaction/regex-filter/max-length a finding with block refuses, with redact applies the rewrite.

  • No new loop on top of FormatRetryRunner: its triggers are a fixed enum tied to responseValidation; reusing its corrective shape, Asker, turnBudget and minAttemptMs keeps the semantics without entangling the two policies.

  • No ExtensionDescriptor entries (R0 1.3 f): the descriptor describes the workflow step's uri, not the LLM resource; guardrails live in the resource.

  • Not extracted into executeModel (T11): hooked at the existing seams instead, so the diff in LlmTask is additive plus the retryPolicy != null → bufferOutput substitutions.

Known limits / follow-ups

  • An httpCallRag template that reads memory.current.input directly (instead of userInput) still sees the stored, unredacted text (documented).

  • Manager: only the LlmTask type mirror (inputGuardrails/outputGuardrails, GuardrailConfig); the guardrail list editor on the LLM task form came with #1077, merged into this branch. Platform Operator cheatsheet explains configuring guardrails; revision bumped.

  • Phase 4b (classifier type) builds on this branch.

  • SSE acceptance criterion 11 (guardrail_triggered before done over a real socket) is covered at unit level (handler → sendJson) only.

Files: GuardrailService.java, ContentGuardrail.java, built-ins under guardrails/impl/, LlmTask.java, LlmConfiguration.java, LifecycleManager.java, SSE plumbing (ConversationEventSink, IConversationService, ConversationService, RestAgentEngineStreaming); docs langchain.md, security.md, audit-ledger.md, metrics.md, rest-api-reference.md.


feat(llm): tool repeat guard refuses identical failing tool calls (2026-10-15)

Repo: EDDI (feat/llm-tool-repeat-guard)

What changed and why

Inside the iteration cap a model could re-send the same failing call (a 403, a 404, a schema-rejected body) every round, burning cost and rate-limit budget and repeating side effects on non-idempotent endpoints. The tool loop now keeps a per-run ToolRepeatGuard: a call whose last identical call failed, with no other call succeeding since, is answered NOT_EXECUTED without running and traced as tool_repeat_refused (metric eddi.tool.repeat.refused, tags source, reason). After maxRefusalsPerTurn (default 3) refusals the loop stops asking the model and ends the turn with a fixed message.

Behaviour change: the guard is ON by default. An agent with no toolRepeatGuard now gets it with the defaults (maxIdenticalFailures 2, maxIdenticalCalls unlimited, maxRefusalsPerTurn 3). It only refuses calls that already failed identically with no progress in between. "toolRepeatGuard": {"enabled": false} restores the previous behaviour exactly. See Repeated failing tool calls.

  • ToolOutcomeClassifier classifies the RAW tool result (before the provenance envelope): HTTP httpCode 2xx success, 408/425/429/5xx retryable, other statuses terminal; Error: strings and {"error":...} retryable, except rejected arguments and unknown tools (terminal); loop-level refusals (budget, tenant quota, expired deadline, NOT_EXECUTED/DENIED) never count as failures. MCP isError results reach the loop as an internal-error string and are retryable.

  • ToolLoopRunner.executeToolCall returns governed and raw results; executeSingleToolCallResult still returns the governed string (resume path unchanged).

  • Guard state is per run of the loop: a HITL resume and each cascade step start fresh. Failures were already never cached.

  • Platform Operator prompt updated (revision bumped).

Files: ToolRepeatGuard.java, ToolOutcomeClassifier.java, ToolRepeatGuardConfig.java, ToolLoopRunner.java

Manager: the LLM task editor's tool-call limits block has a "Repeated failing tool calls" control (toggle, thresholds, exempt tools); the field is written only when the author changes something.


✨ feat(observability): W3C trace propagation on outbound calls and execute_tool spans (2026-10-15)

Repo: EDDI (feat/observability-trace-propagation)

What changed and why

A trace used to stop at EDDI's edge: it showed that a turn spent four seconds in the LLM task, but not which MCP server or API made it slow. Two additions close that gap (pillar 6, observability).

  • execute_tool {tool} span per tool call — opened in ToolExecutionService.executeToolWrapped, the one seam every tool source passes through (builtin, http, mcp, a2a, dynamic, memory, recall, plus the mcpcalls step). GenAI semconv attributes (gen_ai.operation.name, gen_ai.tool.name, gen_ai.tool.call.id, eddi.tool.source, error.type), semconv revision pinned via LlmTelemetryListener.SEMCONV_SCHEMA_VERSION. The span is current while the tool runs — inline, and on the timeout worker through the existing carryContext — so outbound requests are its children. Cache hits (eddi.tool.cache_hit=true) and rate-limited calls (error.type=rate_limited) get a span too: cheap when OTel is off, and exactly what a slow-turn investigation needs to see.

  • W3C traceparent/tracestate on outbound calls, via a new TracePropagation bean (W3CTraceContextPropagator only — never baggage): httpcalls (HttpClientWrapper, on a copy of the request so the memory record and the HITL approval fingerprint do not change per send), the OutboundHttp facade — built-in tools, A2A, the RAG crawler, OAuth, Slack, remote sync (first hop and same-origin hops; dropped on cross-origin hops like credentials — the Vert.x redirect handler drops them too) — and MCP (params._meta per SEP-414 through langchain4j's metaSupplier, plus the HTTP header).

  • Quarkus' Vert.x HTTP client tracer is off for the httpcalls client (TracingPolicy.IGNORE). With the default policy it re-injected a fresh traceparent onto every redirect hop, including a cross-origin one the redirect handler had just stripped. The explicit header still carries the trace; the auto-instrumented client span for httpcalls is what is given up.

  • Config: eddi.tracing.propagate-outbound (default true). Inert while quarkus.otel.sdk.disabled=true — a no-op span has an invalid context and produces no header, never an all-zero one.

Design decisions

  • MCP threading. Verified in the langchain4j-mcp 1.22.0-beta32 bytecode: DefaultMcpClient calls the meta supplier synchronously on the calling thread before the transport, but StreamableHttpMcpTransport rebuilds the request on an HTTP-client callback thread when it retries after session expiry. So the header supplier reads the trace context from the message's _meta, not from Context.current() — header and _meta cannot disagree, whichever thread builds the request.

  • Source and call id travel in the OTel Context (ToolCallTrace), set by ToolLoopRunner around its one call into the service, rather than as two more parameters: they label the span and nothing else, ToolInvocation's equality is a cost/cache identity, and a new overload would have broken the Mockito stubs of 17 test classes.

  • Merged onto the OutboundHttp facade (#1042/#1046). SafeHttpClient was retired on main while this branch was open; propagation moved into the facade's exchange/redirectHeaders, so every caller of the facade gets it and A2A no longer needs its own injection.

  • Tracer: lazily resolved GlobalOpenTelemetry.getTracer("eddi.tools"), same pattern as LlmTelemetryListener/LifecycleManager; package-private field so tests install an SDK tracer without mutating the JVM-wide global.

Docs

Monitoring guide: execute_tool span, propagation rules, and a "Sending traces to Langfuse / Arize Phoenix / Jaeger / Tempo" section with endpoints verified against each project's docs (Phoenix Cloud left explicitly unverified). Configuration reference row; tracing note in metrics.md; Platform Operator prompt line on tracing a slow tool (revision 17 → 18).

Files: TracePropagation.java, ToolExecutionService.java, ToolCallTrace.java, OutboundHttp.java, HttpClientWrapper.java, HttpClientModule.java, McpToolProviderManager.java, A2AToolProviderManager.java, monitoring-guide.md.

Not verified

The acceptance check — one connected trace through the monitoring compose (pipeline task → gen_ai span → execute_tool → downstream span) — was not run end-to-end in a live stack; the unit tests pin each link.


💰 feat(tenancy): enforce the tenant monthly cost budget — meter settled turns and Dream runs, gate model calls (2026-10-15)

Repo: EDDI (feat/tenancy-cost-metering)

What changed and why

maxMonthlyCostUsd was stored, validated, shown in the Manager quotas page and documented as not enforced: TenantQuotaService.recordCost had no production caller, so the monthly counter stayed at zero and the pre-call gate never tripped. It is now real.

  • Metering at the settle points. New TurnCostMeter charges the current step's audit:cost to the default tenant from the pipeline's completion callback — ConversationService.admitTurn (say, streamed say, rerun; group member turns and sub-agents go through it too), the inline CONVERSATION_START turn in startConversation, and ConversationHitlService.resumeConversation (now always passes a completion callback, also for an internally driven resume). Only the not-yet-metered part is charged: the step keeps audit:metered_cost, persisted with the turn, so a turn paused for approval and resumed is charged once in total. Skipped for a turn stopped by lease loss (nothing is stored; the new owner re-runs and meters it); a replayed idempotent turn never reaches the callback. A denied or unavailable recordCost never fails the turn — logged and counted on eddi.tenant.cost.metering{outcome}; a charge the store could not record is carried forward as audit:pending_cost on the newest step and charged by the conversation's next settle (review finding: an ordinary say turn starts a new step, and say turns are persisted as appends, so leaving it on the old step would have lost it).

  • The marker key is audit:metered_cost, not audit:cost:metered. Step lookups are prefix matches, so a key starting with audit:cost would be read back as the step's cost by getLatestData(AUDIT_COST) (LlmTask.accumulateCost, LifecycleManager).

  • audit:cost no longer depends on the audit ledger. LlmTask only wrote it with eddi.audit.enabled=true; token usage and cost are now recorded either way (accumulateUsageAndCost), since the tenant budget charges them.

  • Pre-model-call gate. New LlmSpendGate, asked once per LLM task before any model request (plain, tool loop, cascade, streaming). The existing checkCostBudget gate ran only before tool calls, so an agent without tools never stopped, and one with tools kept calling its model to be refused tool after tool. A refusal fails soft like the tool-call gate: the model is not called, the task's fallback answer (responseValidation.fallbackMessage, or the default sentence) is served regardless of onError, the step records llm:spend_refused:<taskId>, and eddi.llm.spend.refused{reason} counts it. Cheap: with quotas off it is a cache hit; on, one monthly-cost read per LLM task. The circuit breaker ticket is not acquired for a refused call, and the rolling summary is not updated.

  • Dream (A2). DreamService charges each consolidation call at the dream config's own prices (pricedCost — never the upper-bound estimate it uses for maxCostPerRun, so an unpriced config meters $0) and stops consolidating once the tenant budget is spent (not a failed cycle).

  • Caveats removed. The WARN in RestTenantQuota, the "not enforced" notes in TenantQuota, checkCostBudget (which also wrongly said AgentOrchestrator called it per LLM turn) and recordCost, and the note in tenant-quotas.md, replaced with an accurate section listing the call classes that are not metered: rolling summary, tool-response summarization, group window/stance summaries, embeddings, the pre-pause segment of a tool-call HITL pause, lease-lost turns. The MemberTurnExecutor comment calling AUDIT_COST a running total is corrected (it is per step).

  • Docs/Operator. tenant-quotas.md, langchain.md (prices drive the budget), metrics.md, configuration-reference.md; the Platform Operator prompt says the cap is enforced and priced-only (operator revision bumped; 20 at merge time).

Tests: TurnCostMeterTest (delta, pause→persist→resume once, prefix trap, outage retry, exception swallowed, over-budget marked, in-memory end to end), ConversationServiceCostMeteringTest (settle point through the real say path, unpriced, idempotent replay, lease loss), LlmTaskSpendGateTest, DreamServiceTest additions, ConversationServiceResumeTest (resume callback meters), RestTenantQuotaTest (no "NOT enforced" warning), LlmTaskAuditLedgerTest (cost now bypasses the collector gate), TenantCostMeteringIT (Mongo + Postgres Testcontainers: two priced turns cross a $0.01 budget and the gate then refuses; and a priced turn that pauses, is persisted to and reloaded from the real conversation store, and resumes with further cost is charged exactly the step total, with audit:metered_cost on the persisted step).

Group cost

GroupCostLedger used to read only the member conversation's last step's audit:cost; main fixed that independently (#1066, the snapshot now carries the conversation's summed cost). Tenant metering does not go through it either way — member turns settle through say.


💰 feat(llm): per-conversation LLM cost ceiling maxCostPerConversationUsd (2026-10-15)

Repo: EDDI (feat/tenancy-cost-metering)

What changed and why

A new optional agent-level field, maxCostPerConversationUsd on AgentConfiguration, bounds the priced spend of one conversation — the sum of every step's audit:cost. Absent (every existing agent) means unlimited and behaviour is unchanged; 0 allows no priced spend; a negative value is unlimited. The task-level, tool-only maxBudgetPerConversation is untouched.

  • Carrier. AgentStoreClientLibrary copies it onto the deployed Agent, which puts it on the memory in startConversation and in continueConversation (every say, rerun and HITL resume passes there, so the running version's value always wins and a version without one clears it). The memory carrier is transient and typed OptionalDouble, not a nullable Double: a mocked memory hands back 0.0 for a Double, which here means "no spend allowed".

  • Checks. LlmSpendGate compares the conversation's spend with the ceiling before the tenant budget, once per LLM task before any model call (plain, streaming, tool loop, cascade); a refusal serves the fallback answer and records llm:spend_refused:<taskId> with reason: conversation_ceiling. Because that gate only sees a tool loop's cost when the loop ends, ToolLoopRunner repeats the check between rounds (prior spend + the loop's tokens at the task's prices + its tool cost) and ends the loop with a fixed answer saying the completed calls took effect. Counted on eddi.llm.spend.refused{reason="conversation_ceiling"}.

  • Docs. langchain.md (new section), tenant-quotas.md, metrics.md.

Tests: ConversationCostCeilingTest (old JSON without the field, round trip, carrier set and cleared, spend summed over steps without the metering marker, gate order and edge values), LlmTaskSpendGateTest (ceiling refuses without asking the tenant budget; no ceiling sums nothing), ToolLoopRunnerCostCeilingTest (stops at the ceiling, prior spend counts, no ceiling unchanged), AgentStoreClientLibraryMemoryToolsTest (deployed agent carries the value).

Not done

No Manager field: the agent editor has no cost/limits section and no nullable-number input, and turnDeadlineMs — the nearest agent-level setting — is not editable there either. The value can be set through the agent JSON. Follow-up: a "Limits" section for both.


perf(groups): run the blocking group endpoints on virtual threads (2026-10-15)

Repo: EDDI · Branch: feat/group-endpoints-virtual-threads

What changed and why

This is the last part of the throughput plan's WS2 (item 5). Six group endpoints run discussion work inline, and each one held a Quarkus worker thread for an entire multi-agent discussion, every member turn and LLM call included:

  • discuss

  • followUpWithMember

  • continueDiscussion

  • approveGroupPhase

  • submitHumanInput

  • approveGroupPhaseStreaming, which calls resumeDiscussion on the request thread

The worker pool has about 200 threads and blocking REST endpoints share it, so a handful of long discussions could starve unrelated requests. Conversation turns already left that pool (PR #1045), and the member turns inside a discussion already run on virtual threads.

RestGroupConversation now marks those six methods @RunOnVirtualThread. The other streaming endpoints were already asynchronous and are unchanged: discussStreaming goes through startAndDiscussAsync, and continueDiscussionStreaming uses its own executor.

Design decisions

  • The annotation is on the implementing methods, not on IRestGroupConversation. The JAX-RS contract stays free of execution-model detail. Whether Quarkus REST honours the annotation there was the open question; GroupEndpointsVirtualThreadIT settles it over HTTP.

  • The proof is an IT, not a unit test. The execution model is chosen when Quarkus dispatches the request, so calling the bean directly cannot observe it. The IT installs a Mockito stand-in for GroupConversationService with QuarkusMock (Mockito, not a JDK proxy, because QuarkusMock needs an instance of the bean class). The stand-in records Thread.isVirtual() for each service call and completes the streaming listener.

Verification

  • GroupEndpointsVirtualThreadIT: 6 tests, one per endpoint. With every annotation removed, all 6 fail with "a worker thread".

  • GroupConversationIT and GroupHitlIT, which drive real discussions, approvals and human input through these endpoints, pass (12 tests).

  • 1,106 group unit tests pass, along with ImportStyleTest, BuildQualityGatesTest and ChangelogRotationTest.


Outbound HTTP callers moved onto the facade; SafeHttpClient retired — consolidation phase 2 (2026-10-15)

Repo: EDDI · Branch: feat/outbound-http-callers (stacked on feat/outbound-http-facade, labsai/EDDI#1042) · Plan: planning/http-client-consolidation-plan.md, Phase 2

What changed

Every EDDI-owned caller now sends through OutboundHttp, with its existing caps, timeouts and redirect rules unchanged:

Caller
SSRF / redirects
Body

WeatherTool, WebSearchTool

HOPS_ONLY (fixed hosts), JDK-safe redirects

bytes(1 MiB / 2 MiB, TRUNCATE); a truncated answer is refused as before

PdfReaderTool, WebScraperTool

the tool's own URL check, then HOPS_ONLY

bytes(eddi.tools.*, TRUNCATE)

AttachmentForwarder

STRICT

bytes(per-file cap, TRUNCATE)

SafeHttpPageFetcher (crawler)

STRICT

bytes(cap, TRUNCATE); its hand-written bounded read and watchdog are gone (identical in the facade), and so is its IRuntime dependency

OAuthTokenClient

NONE (the credential-endpoint allowlist is the gate), NEVER

string(1 MiB, FAIL). New cap: a token answer was unbounded before; anything over 1 MiB is now a transient TOKEN_ENDPOINT_UNAVAILABLE

SlackWebApiClient

NONE (fixed host), NEVER

string(1 MiB, FAIL); its private HttpClient is gone. Now bounded in time — it had no request timeout at all, and gets the facade's 15 s per hop

A2AToolProviderManager

STRICT or METADATA_ONLY per eddi.security.ssrf-protection.enabled, NEVER

bytes(1 MiB, TRUNCATE); its lazy private client and its a2a-body-watchdog thread are gone

OpenApiSpecFetcher (MCP/httpcall OpenAPI discovery, added on main while this PR was open)

its own redirect loop with OutboundTargetPolicy on every hop, each hop one NEVER send with SsrfPolicy.NONE (the policy is the gate)

stream(16 MiB, 4 × 30 s); its private openapi-spec-body-watchdog thread is gone. Its "did not arrive within" message now names the real budget (120 s), not the request timeout

RemoteApiResourceSource (+ the two static helpers)

new profile INTERNAL_PEER: NONE (SourceUrlValidator stays the gate), NEVER

JSON string(eddi.backup.sync.max-response-bytes, FAIL) with the old refusal message; archives bytes(256 MiB, FAIL)

  • SafeHttpClient is deleted (internal API, no callers left), with CappedStringBodyHandler and the per-source client lifecycle (close(), configure(), the owned-client flag): sources share the application's facade. BoundedBodyReader moved into engine/httpclient/outbound as package-private.

  • RestImportService gets the facade by setter injection, lazily falling back to a standalone one outside CDI, as A2AToolProviderManager does.

  • AGENTS.md (§4.2 table, §4.4 Tool Security and its sample, Key Files), README, architecture.md (SSRF layers and sample), connections.md, code-review-standards.md, security-review.md, a2a-protocol.md, configuration-reference.md and metrics.md now name OutboundHttp.

  • The // codeql[java/ssrf] suppressions moved with the sinks: they now sit on the http.send(...) calls in RemoteApiResourceSource (and its sendJson helper).

Tests

  • The 22 server-backed SafeHttpClient tests were ported to OutboundHttpServerTest against the facade on the real JDK engine (a no-op hopValidator replaces the Mockito spy that let a redirect reach loopback). Their subjects, and a new cross-origin Authorization case, are all still covered over real sockets.

  • New test helpers in engine/httpclient/outbound (test sources): TestOutbound (standalone facade, facade over any engine, canned responses), ScriptedEngine (records hops, replays answers), and JdkClientEngine (routes facade hops into a mocked JDK HttpClient). The last one let roughly 200 remote-sync test stubs stay as they were while the code under test runs through the real facade.

  • The crawler, OAuth, A2A wiring and new Slack tests run the real facade over a scripted engine rather than mocking it. New: a loopback crawl seed is refused before anything is sent; an A2A peer's 307 and a Slack 302 are never followed; a sync source declaring a body over eddi.backup.sync.max-response-bytes is refused before it is read (the old size tests only simulated the refusal in a stub, so lifting the cap broke none of them).

  • Mutation-checked: dropping NEVER from OAuth, A2A, Slack or remote sync, weakening the crawler to HOPS_ONLY, or lifting the remote-sync size cap each fails a test.

Design decisions

  • internal-peer has its own connection pool but no configuration keys yet. Remote sync had nothing tunable, so it uses the default settings, and the configuration reference says so.

  • Pass-through, not rewrite: every caller keeps its old checks (the tools' own validateUrl, A2A's pre-credential check, SourceUrlValidator). The facade's policy is added on top.

Next: Phase 3, the langchain4j adapter: shared LLM provider pools, plus llm-provider keys.


Outbound HTTP facade — Phase 1 of the client consolidation (2026-10-15)

Repo: EDDI · Branch: feat/outbound-http-facade · Plan: planning/http-client-consolidation-plan.md, Phase 1

What changed

  • New package ai.labs.eddi.engine.httpclient.outbound. OutboundHttp is the one place outbound policy lives: the SSRF policy per request (STRICT, HOPS_ONLY, METADATA_ONLY, NONE, FOLLOW_GLOBAL_FLAG); redirects followed hop by hop with a MethodRule (JDK_SAFE, the RFC 9110 rule SafeHttpClient always used, and VERTX_COMPAT, which matches what the httpcalls Vert.x client does); cross-origin stripping of the fixed SENSITIVE_HEADERS plus any header the request marks caller-derived (a ${caller:token} can sit in any header name); one whole-exchange deadline; redirect bodies dropped after 64 KiB; body caps enforced while reading (BodyMode.string/bytes/file/stream/discard, OnOverflow.TRUNCATE|FAIL); refusal on a Vert.x event-loop thread; four meters (eddi.http.outbound.requests|duration|blocked|bytes) on a new Outbound HTTP dashboard row.

  • OutboundEngine is a one-hop SPI; JdkOutboundEngine keeps one java.net.http client per Profile (default, llm-provider, apicalls, internal-peer), with an optional forward proxy (vault-resolvable credentials, answered to proxy challenges only, failing closed when unresolved) and an optional named quarkus.tls configuration.

  • SafeHttpClient is now a @Deprecated adapter over the facade. Its API and behaviour are unchanged: all 22 server-backed SafeHttpClientTest/SafeHttpClientBodyBoundsTest cases pass as they were, apart from one import (CallerFrames moved). Its unit tests of moved internals were ported: the method rule to MethodRuleTest, the budget and redirect-body discard to OutboundHttpTest, and the withDefaultTimeout rebuild to a request-conversion test.

  • New settings, documented in configuration-reference.md: eddi.http.outbound.engine, eddi.http.outbound.default.{connect-timeout,total-timeout,protocol,tls.configuration-name}, eddi.http.outbound.proxy.{host,port,non-proxy-hosts,credentials}. The connect timeout falls back to httpClient.connectTimeoutInMillis, so a tuned deployment keeps its value.

Design decisions

  • Only the default profile has keys. The others get theirs in the phase that moves their callers, so no documented setting is a silent no-op in the meantime.

  • tls.named-groups was dropped from this phase. java.net.http.HttpClient copies the SSL parameters it is given and discards namedGroups: client.sslParameters().getNamedGroups() comes back null. A key would therefore be a no-op. PQC plan PQ-3 needs another route: an SSLContext wrapper that sets groups per engine, the global jdk.tls.namedGroups, or the Vert.x engine.

  • max-connections-per-host was deferred to the Vert.x engine (Phase 4), because the JDK client has no per-host pool limit.

  • OutboundBlockedException extends IllegalArgumentException and OutboundTimeoutException extends HttpTimeoutException, so every existing catch keeps working.

  • The plan's table maps send* to NONE, but what send actually did was trust the initial URL and fully validate every redirect hop. That is SsrfPolicy.HOPS_ONLY, a policy the plan did not list.

  • The event-loop guard was enabled after an audit: the only Uni/@NonBlocking code in src/main/java is NamelessPrincipalAugmentor, which makes no outbound call.

  • Mutation-checked: removing caller-derived stripping, the VERTX_COMPAT RETURN, the redirect-hop check, the FAIL-mode cap probe and the redirect-body cap each fails a test.

Next: Phase 2 moves the callers (OAuthTokenClient, SafeHttpPageFetcher, AttachmentForwarder, the tools, SlackWebApiClient, A2AToolProviderManager, RemoteApiResourceSource) onto OutboundHttp and retires SafeHttpClient.


docs(security): cryptography inventory and post-quantum readiness, guarded by a test (2026-10-15)

Repo: EDDI · Branch: feat/pqc-crypto-inventory

First step (PQ-1) of the post-quantum readiness work. It changes no runtime behaviour.

What changed and why

  • New page docs/cryptography.md lists every algorithm EDDI uses (vault AES-256-GCM and PBKDF2, the HMAC-SHA256 audit ledger and vault checksums, Ed25519 agent signing, SHA-256 hashing, and TLS), what each one protects, and whether it is post-quantum safe. It also covers the threat model (harvest-now-decrypt-later for TLS, future forgery of Ed25519 signatures) and the roadmap. The page is linked from security.md (TLS section and See Also) and from SUMMARY.md.

  • Verified on JDK 25.0.1: JSSE's default named groups are classical only (x25519, secp256r1, secp384r1, secp521r1, x448, ffdhe*), while ML-DSA-65 and ML-KEM-768 are available through the standard JCA (an ML-DSA-65 signature is 3309 B and its public key 1974 B). The page states only these verified facts about TLS.

  • New CryptoInventoryTest scans src/main/java for the JCA engine getInstance(...) calls and new SecretKeySpec(...). It resolves each algorithm from a literal or a same-file static final String, and fails the build in four cases:

    • the algorithm is not on its allowlist;

    • the argument cannot be resolved, so moving the string into a variable cannot bypass the check;

    • the call pins a JCA provider;

    • an allowlist entry is no longer used, or is not named in docs/cryptography.md.

Design decisions

  • Rather than scan only the per-class constants listed in the plan, the test resolves each call's argument, so a new call site cannot slip through by using an unfamiliar constant name.

  • TrustManagerFactory, KeyManagerFactory and KeyStore are left out of the scan: they name PKIX and trust-store formats rather than primitives.

  • The allowlist is two-way (unused entries fail as well) so the doc cannot drift from the code.

Next

PQ-5a: make the existing agent signatures on audit entries versioned and verifiable (see planning/pqc-readiness-plan.md).


✨ feat(rag): live run progress, a knowledge-base inspector and schedule status for ingestion (2026-10-15)

Repo: EDDI (feat/rag-ingestion-ux)

What changed and why

Ingestion ran blind: a run row was written as RUNNING with zeroes and only got its numbers when it ended, nothing said what a knowledge base actually held, and a source's schedule was a cron string with no word on whether it was armed, firing or failing. The backend now answers all three.

Run visibility

  • IIngestionStateStore.reportProgress(run) writes a running run's counters onto its row, fenced on status = RUNNING in both stores, so a late write can neither reopen nor overwrite a finished or reaped run. IngestionPipeline's collector calls it at most every two seconds (forced once at the start, so the trigger is on the row before the first document); a failed write is a stale number, never a failed run.

  • IngestionRun gains documentsSkipped, stopReason and trigger (MANUAL / SCHEDULED), with a 13-argument constructor kept for the existing callers. Postgres gains the columns through ADD COLUMN IF NOT EXISTS; Mongo needs nothing. The skipped count and stop reason were already in IngestionReport and reached only the preview response and the log.

  • RagSourceIngestionService.runAsync takes the trigger; processScheduledFire passes SCHEDULED. A run cancelled at shutdown is now closed with the counters its last progress write recorded rather than zeroes.

  • POST …/sources/{sourceId}/run returns the runId it reserved.

Inspector — KnowledgeBaseInspector, read-only:

  • GET …/sources/{sourceId}/documents (VIEW) — the source's document states, most recently embedded first, filterable and paged, labelled by file name for uploads; the orphan-sweep marker row is hidden.

  • GET …/sources/{sourceId}/chunks?documentId= (EDIT) — one document's chunks in document order.

  • POST /ragstore/rags/{id}/search (EDIT) — a test retrieval with the knowledge base's own maxResults/minScore as defaults, optionally narrowed to one source.

  • The vector stores have no listing, so chunks are reached by a similarity search filtered on the metadata ingestion writes, and always ANDed with EmbeddingStoreFactory.retrievalFilter — the inspector sees exactly what retrieval would, and a per-id knowledge base in a shared table sees only its own chunks. A store that cannot filter answers 501; a failing provider or store 502 with the cause.

Schedules

  • IScheduleStore.readScheduleByName (Mongo + Postgres), and GET …/sources/{sourceId}/schedule (VIEW) returning next/last fire, fire status, fail count, disable reason and the last five fires.

  • GET /ragstore/rags/cron/preview applies the save-time checks — parseable, matches a real date, not more frequent than eddi.schedule.min-interval-seconds — and returns the next fire times in UTC.

Design decisions

  • Chunks and search need EDIT, the document list VIEW. A published knowledge base grants VIEW to everyone; the chunk text is the knowledge base's content and every call costs an embedding.

  • Progress is throttled in the pipeline, not in the store. One small update per source every two seconds; the interval is an instance field only so a test can make every document report.

  • Search goes through the retrieval isolation filter unconditionally. An inspector that could see another knowledge base's chunks in a shared table would be a cross-tenant read.

Tests

IngestionStateStoreContract (three new cases, run against Mongo, Postgres and the in-memory double), IngestionPipelineTest (trigger + stop reason recorded; counters visible on the running row while it embeds), RagSourceIngestionServiceTest (shutdown keeps progress), KnowledgeBaseInspectorTest (real InMemoryEmbeddingStore: ordering, isolation, source narrowing, min score, file labels), RestRagIngestionInspectionTest (access levels, clamping, 400/404/501/502), RagSourceScheduleViewTest, and readScheduleByName in both schedule store container tests.

Files: IIngestionStateStore.java, IngestionPipeline.java, KnowledgeBaseInspector.java, RagSourceIngestionService.java, IRestRagIngestion.java, RestRagIngestion.java, IScheduleStore.java, both state and schedule stores, docs/rag.md.

What's next

The cost controls planned in rag-ingestion-source-types-plan.md (§3.13) and run outcome/duration metrics. A cancel button for a running run would need a cancellation signal the worker polls; isCancelled is the natural hook.


✨ feat(manager): see ingestion while and after it runs — progress, run details, schedule, contents, test retrieval (2026-10-15)

Repo: EDDI (feat/rag-ingestion-ux)

What changed and why

The knowledge-base editor showed a spinner during a run, "N ingested · M unchanged" after it, a bare cron string for the schedule, and nothing at all about what the knowledge base held. It now uses the endpoints added in the backend entry of the same date.

  • Live progress (ingestion-run-history.tsx → RunProgress): documents looked at against what the last complete run saw (or the file count, for a Files source), every counter as it moves, the trigger, and elapsed time against the source's time budget. The run history polls every 2 s while a run is in flight (was 3 s).

  • Run history opens each run to all it recorded — skipped, failed, removed, chunks, duration, estimated cost and how it ended, the stop reason said in words. A completed run that lost documents gets an amber icon instead of the green tick, and its summary says how many failed.

  • Errors say what the server said. Run, Preview and Purge failures append the server's message to the generic line ("…A run may already be in flight." was shown for a disabled source and for a database fault alike).

  • Schedule (ingestion-schedule.tsx): a preset picker (hand only, hourly, daily, weekly, monthly — UTC) or a custom cron checked against the server's rules while it is typed, with its next fire times in local time. Once saved, ScheduleStatus shows the next run, the last fire, recent fires with their errors, and says in words when a saved cron produced no schedule, when fires are failing, when the scheduler disabled it and when it was dead-lettered. The card header shows the preset's name with the raw cron on hover.

  • Ingested documents (ingestion-source-contents.tsx): the source's documents, filterable and paged, each Live, Missed by the last N runs or Removed; opening one shows its chunks. Collapsed by default — each opened document is an embedding call on the server, so chunks are fetched only on demand, never retried, and kept for five minutes.

  • Test Retrieval (retrieval-tester.tsx): a new editor section that searches the whole knowledge base or one source exactly as an agent would and shows each chunk with its score and origin.

  • After a run ends the document list and schedule refetch (useRefreshAfterRun), keyed on the newest run's id and status rather than a timer.

  • The legacy Document Ingestion section now says that pasted documents cannot be listed, updated or removed later, and points to a Files source.

  • Schedules page: an ingestion schedule links to the knowledge base it is changed on.

Design decisions

  • No count interpolation in the new strings, so none of them needs per-locale plural categories; the numbers read naturally with neutral wording ("Missed by the last {{runs}} run(s)").

  • The source card observes the files query only while a run is in flight, for the progress total. Observing it always refetched the list every time a card was opened — caught by the existing "reloads the file list" test.

  • The run id POST …/run now returns is not used: ApiClient discards every 202 body, and the RUNNING row in the history identifies the run.

Tests

resource-detail-rag-insight.test.tsx (9 cases: progress estimate and bar, run details and stop reason, server error text, schedule status / missing schedule, live cron check, documents → filter → chunks, retrieval request and result, retrieval failure), one case in schedules-regressions.test.tsx; the cron assertion in resource-detail-rag-sources.test.tsx now checks the preset label and the raw cron in its title. 87 new keys in all 11 locales; npm run i18n:check, lint and typecheck pass. The five new operations are added to openapi-operations.json (refreshed from a Maven-built spec), which the MSW contract test checks every handler against. Checked in the browser against the mock API.


feat(loadtest): turn load-test harness and the throughput baseline (2026-10-15)

Repo: EDDI · Branch: feat/throughput-loadtest-harness

What changed and why

WS0 of the throughput plan: every later workstream must show before/after numbers, and until now there was nothing to measure with.

  • scripts/loadtest/ (new). A compose stack (MongoDB, a WireMock OpenAI-compatible LLM, EDDI, k6) with everything bound to 127.0.0.1, plus loadtest.py, which uses only the standard library. up mounts this checkout's target/quarkus-app into the published image, the way scripts/cluster-demo does, and creates one deployed LLM agent through POST /administration/agents/setup. run and matrix set the mock's latency through WireMock's admin API, run k6 (scenarios steady, burst, same-conversation, long-conversation), sample the saturation gauges every second, and write turns/s, latency percentiles, errors by status, peak executor, coordinator, audit and pool gauges, and MongoDB operations per turn (opcounters and top per collection).

  • scripts/loadtest/results/baseline-2026-10-15.md. Measured on aa811c838 at 3 s LLM delay: 50 and 200 concurrent conversations run at the LLM's pace. At 500, throughput flattens at about 61 turns/s with the managed pool pinned at 199 active and up to 198 queued, and p50 rises from 3.1 s to 7.5 s. No request is rejected: overload shows up as latency. Each turn costs about 23 MongoDB operations, independent of load.

Design decisions

  • One Python driver instead of the plan's setup.sh / collect.sh. It matches the cluster demo and runs the same way from PowerShell and Git Bash.

  • No new meter. The existing executor gauges explain the latency on their own, so the plan's optional eddi.turn.queue_wait timer is not added.

  • WireMock with async responses and no request journal, so the mock is not the bottleneck at hundreds of concurrent delayed calls.

Next

WS1 (configuration cache): re-measure with --think-ms 3000, because back-to-back turns hide the 2 s TTL. WS2 (thread ceiling and admission). Unexplained so far: about 3 vault reads per turn.


perf(runtime): conversation turns on virtual threads, bounded by an in-flight limit (2026-10-15)

Repo: EDDI · Branch: feat/throughput-virtual-thread-turns

What changed and why

WS2 of the throughput plan. Each in-flight turn held one ManagedExecutor platform thread, blocked on the pipeline's future for as long as the LLM took. The pool (~200 threads), which blocking REST endpoints share, was therefore the node's turn ceiling. Past it, turns queued without bound in front of the pool, and overload showed up as latency for everything rather than as a rejection.

  • Turns run on virtual threads. IRuntime.ITurnExecution is a marker sub-interface of the completion callback. Both coordinators (AbstractQueuedConversationCoordinator.execute, and ClusterConversationCoordinator.runUnderLease, which submitNext also goes through) now pass one, and BaseRuntime runs those submissions on a dedicated virtual-thread executor (eddi-turn-*). The body is unchanged: thread bindings, the nested marker (so the pipeline still goes to the nested executor), the one-shot callback and the abandonment token. Deploys, retention sweeps and the parser endpoint stay on the pool. New gauge series: eddi_runtime_executor_{active,queued}{pool="turn"}.

  • Admission control: eddi.conversation.max-in-flight-turns (default 1000). The C11 ProcessingTurn token carries the permit. It is taken with one CAS against a permit counter, so concurrent admissions cannot overshoot, and given back exactly once by finish(). Only the turn's own exits call finish(): the turn task's finally, its discard hook, and the pre-submission rollback. The gauge's existing release() still fires as soon as the client has its answer, but persistence runs after that on the same thread, so the permit stays held until then. Releasing it with the gauge let the node run past its limit (1029 active at 1000 in the load test below). The permit is admitted after idempotency admission (a duplicate key answered from the stored result takes no permit) and before the tenant quota slot, so a capacity refusal does not spend quota. startConversation admits its CONVERSATION_START turn the same way, because that turn runs inline and can call an LLM. A turn the watchdog abandons while its body keeps running (a swallowed interrupt) keeps its permit until that body really stops: the in-flight registration that already tracks such zombies returns it on settle(). A zombie that never ends therefore holds its permit, which eddi_conversation_abandoned_running shows. The refusal, TurnCapacityExceededException, extends RejectedExecutionException, so every surface answers it with the existing 503 capacity_exceeded + Retry-After. It is counted in eddi_turn_rejected_total{reason="in_flight_limit"}.

  • /v1/chat/completions runs on a virtual thread (@RunOnVirtualThread instead of @Blocking). Both the sync wait and the streaming body held a second worker thread per request next to the turn's own.

  • Monitoring. EddiExecutorSaturated no longer describes turns. The new EddiTurnCapacityReached alert fires when turns are refused at the limit for 5 minutes; it has a runbook entry and a promtool case. The full-metrics dashboard's "Coordinator throughput" panel charts the rejection rate. docs/metrics.md and the configuration reference cover the new series and property.

Measured (load-test harness of the WS0 PR, 3 s mock-LLM delay, 10 turns per conversation)

Concurrent conversations
Before: turns/s · p50 · p95
After: turns/s · p50 · p95

200

52–60 · 3.1–3.3 s · 3.5–4.4 s

60 · 3.1 s · 3.6 s

500

61 · 7.5 s · 9.8–10.1 s

131 · 3.3 s · 4.2 s

1000

(not run: past the ceiling)

269 · 3.2 s · 4.6 s

1500 (limit 1000)

—

182 · 3.6 s · 5.5 s; 8161 × 503, no timeout, no other 5xx

Before, at 500 conversations, the managed pool was pinned at 199 active with up to 198 queued. After, it stays at 0: turns peaked at 1029 active on pool="turn" with 326 live JVM threads. That build still released the permit with the client's answer. The overshoot past 1000 is the persistence tail that review moved inside the permit, and the numbers were not re-measured after that change. MongoDB operations per successful turn are unchanged (≈ 22.7). A refused turn still costs its conversation loads, because admission sits after them. That is WS3a's single-load work.

/v1 answers capacity refusals as 503

Review found that the OpenAI-compatible bridge turned any RejectedExecutionException into a 500: the new in-flight limit, coordinator saturation and the shutdown drain alike. That applied to the sync response, the streaming error event and conversation start. It now answers 503 capacity_exceeded with Retry-After: 5, like every other surface. A quota-store outage gets 503 quota_accounting_unavailable (OpenAiApiException.capacityExceeded, OpenAiConversationBridge.rejectionAsApiException, and a Retry-After header from OpenAiExceptionMapper).

max-in-flight-turns=auto (the default)

A fixed 1000 fitted only one container size. The Helm chart's 1 GiB limit gives a 512 MB heap at the image's default 50 %, so a busy node would run out of memory long before 1000 turns. auto (InFlightTurnLimit) derives the limit from the maximum heap: (max heap − 256 MB) ÷ eddi.conversation.in-flight-turn-memory-mb (new, default 2 MB per turn, twice the ~1 MB measured). That gives 128 at 512 MB, ~1400 at 3 GB and ~2900 at 6 GB.

  • A number still sets the limit, and 0 still disables it.

  • An invalid setting fails the boot (@PostConstruct), and the node logs the value it resolved.

  • The value is exported as the gauge eddi_conversation_max_in_flight_turns, charted next to the in-flight count on the full-metrics dashboard. That panel's legend is now on.

Sizing the limit

A later comparison run (the load-test harness, MongoDB and PostgreSQL, two rounds each) found that with exactly as many clients as the limit (1000 against 1000), 5–12 % of turns were refused. A turn keeps its place until it is persisted, which happens after its caller already has the answer, so a client's next turn can arrive first. The configuration reference and application.properties now say to leave roughly 10–20 % headroom above the expected number of concurrently active conversations. They also give the measured heap per in-flight turn (~1 MB for short conversations) and PostgreSQL's pool default (50).

Design decisions

  • A callback marker, not a new IRuntime method or a wrapped callable. About 25 tests mock IRuntime, and a new method would return null there. The coordinator tests also assert callable identity (eq(task)) and isNull() bindings, which a wrapper would break. The coordinators already pass a callback; marking it changes nothing else.

  • max-active-conversations stays. It caps how many conversations hold a turn queue and only ever refuses a new conversation; the new limit caps turns. Both are documented side by side.

  • Rejections log at DEBUG in ConversationService. RestAgentEngine already logs one WARN per 503, and under overload a second line per refused turn only doubles the flood.

Next

  • RestGroupConversation.discuss and the other synchronous group endpoints still hold a worker for a whole discussion. Converting them is a JAX-RS-interface change; it is a separate piece.

  • WS1 (configuration cache), then WS3a (one conversation load per turn, which also makes refused turns cheap).


🔒 fix(security): close the M9, M10, L6, L9, L10 and L12 findings of the 2026-10-15 review (2026-10-15)

Repo: EDDI (fix/authz-lifecycle)

What changed and why

Six residual findings of the security review of main at d49e855, each a gap that the live RBAC/IDOR tests did not reach. One commit per finding; the code comments name the finding so a later reader can find this entry.

  • M9 — A2A JSON-RPC skipped the per-agent USE check. POST /a2a/agents/{agentId} required a role, but not the USE grant that POST /agents/{id}/start and /v1 apply under enforced workspaces, so any eddi-user could converse with any agent. RestA2AEndpoint.handleJsonRpc now calls ResourceAccessGuard.requireAgentUseAccess before dispatching SEND and STREAM — outside the method's catch-all, so the refusal is a 403 and not a JSON-RPC "internal error". tasks/get and tasks/cancel stay principal-scoped: they reach only a task this peer created after passing the gate. A2aEndpointPermissionsTest and RestA2AEndpointTest cover every send and stream method name in all three dialects.

  • M10 — GDPR erasure and export did not reach the A2A task store. A peer's tasks hold the message it sent and the reply, keyed by its principal, and outlived an erasure until the cache expired. IA2ATaskStore gains tasksOf and eraseForPrincipal (the length-prefixed key makes a principal's prefix exact), and A2ATaskGdprParticipant registers both with GdprComplianceService as step a2aTasks. It also joins the cascade's stop phase: beginErasure closes the store to the principal's writes for five minutes, so a peer request admitted while the cascade runs cannot leave a task behind the sweep; on one node the check and the write are serialised against the sweep by a read/write lock, and in cluster mode the marker lives in a shared A2A_ERASING bucket so every node refuses the writes, while a shared per-principal A2A_INDEX lets a sweep or export on one node reach the records other nodes wrote (bucket keys are hashed, so nothing else can enumerate them). The index is kept with a compare-and-set loop — SharedKvCache.replace(key, expected, next) is now a revision-checked update on the bucket, not get-then-put — and caps a principal at 10,000 tasks: an id that falls off the end takes its record with it. The one narrow cross-node residual is in clustering.md. gdpr-compliance.md lists it and now has a section naming what erasure does not reach — RAG knowledge bases, application log files, telemetry exports and LLM-provider retention — with why, and what bounds each.

  • L6 — dead letters kept the raw turn input for seven days. describeTurn runs before the pipeline, so the scope: secret scrub could not help, and only a client that set context.secretInput was spared. The captured input and its string context values now pass through SecretRedactionFilter — string leaves inside object values included, with credential-named keys masked — an entry the client marked secret or whose key names a credential is dropped, and a turn addressed to an agent whose workflows carry any scope: secret property instruction is recorded as secretInput: true without input or context, like a client-flagged one. The fact is computed once at deployment: PropertySetterConfiguration.hasSecretInstructions(), carried by IExecutableWorkflow and aggregated on IAgent, and read from the agent say already resolved for the turn — no second lookup on the hot path. A turn with no resolved agent is treated as one that expects secrets.

  • L9 — three ownership gaps on the internal REST surface. RestAgentManagement never bound the {userId} path segment to the caller (its only check asked whether the caller was anonymous), and initUserConversation deleted the ended-conversation mapping before the engine's transitive 403; every method now runs OwnershipValidator.validateUserAccess first. The group write paths followUp, continue and continue/stream used requireOwnerOrAdmin, which admits any authenticated caller to a legacy record with no owner; they use requireOwnerOrAdminStrict, as delete and close already did. And an eddi-approver could cancel any user's executing turn through POST /agents/{id}/cancel: a caller who is only an approver now goes through cancelPausedConversation, a single compare-and-set on AWAITING_HUMAN that never signals an executing turn, so the entitlement check and the cancel are one atomic operation (any other state is a 403; documented in hitl.md); the MCP cancel_conversation tool applies the same rule through HitlAccessGuard.mayCancelExecuting; owner and admin are unchanged.

  • L10 — unbounded listings and unbounded per-user attachments. ?limit=2147483647 returned every descriptor in one response (verified live on /agentstore/agents/descriptors). PageBounds applies one ceiling — eddi.rest.listing.max-limit, default 1000, the Manager's largest descriptor page — to every config store's descriptor listing, the cross-resource /descriptors, the conversation listing (which used to clamp silently at 100), the visible user memories and both /administration/logs listings; a limit above it, or a negative index, is a 400 with a JSON {"error": …} body. eddi.attachments.max-per-user and eddi.attachments.max-total-bytes-per-user default to 500 files and 1 GiB instead of off (attachments-guide.md).

  • L12 (remaining) — legacy salt and request logging. A boot that adopts the legacy fixed KEK salt (DEKs present, no per-deployment salt) records the fact in the vault metadata (vault-kek-legacy-salt-seen); every later boot still on it logs an ERROR naming POST /secretstore/secrets/admin/rotate-kek and the date the salt was first adopted, where before there was one WARN per boot. A persisted or migrated salt clears the record. logRequests on the LLM decorators wrote 200 characters of the last message — the user's own text — at INFO; the line is now DEBUG and both it and the logResponses line run through LogRecordRedactor (before truncation, so a key straddling the cutoff cannot leave its first characters behind), which is public for that.

  • Flaky test fixed at its cause. ClusterConversationCoordinatorTest.localDeadLettersPage failed CI on this branch (and passes or fails locally by chance): the local dead-letter id was drawn outside the lock that appends the entry, so concurrent failures could append out of id order, and the cursor paging over local entries — which skips by id number — then dropped or repeated one. The id is now taken under the lock; InMemoryConversationCoordinatorTest.concurrentDeadLettersAreRecordedInIdOrder pins it.

Files: RestA2AEndpoint.java, A2ATaskGdprParticipant.java, CachedA2ATaskStore.java, ConversationService.java, WorkflowStoreClientLibrary.java, RestAgentManagement.java, RestGroupConversation.java, RestAgentEngine.java, PageBounds.java,