Context
PR #16854 repairs the residency diagnosis chain from TextEmbeddingService through VectorService to the operator-visible IngestionService receipt. Exact-source inspection at d28c7d5ca138099f21fc362f26f9bf93f20c1c5c shows the behavior is correct: an unobserved preflight leaves residencyDisposition absent, observed residency followed by loss becomes evicted-mid-batch, and the bounded value reaches summary.errors[].details.
Two requested regression proofs remain absent, however. This successor records those proof obligations without holding merge-safe production code in another repair cycle.
The Problem
Two independent production mutations remain green:
- Insert a second loaded-model call into the preflight-rejection arm. The focused
TextEmbeddingService.retry.spec.mjs suite still passes 36/36 because the never-resident control installs async () => [] but never counts calls.
- Delete only the conditional
residencyDisposition spread from IngestionService.embedChunkGroups. The Vector batch-failure and canonical embed-failure-classification suites still pass 37/37 because the new delivery test stops at VectorService.
The implementation therefore has the intended behavior today, but CI does not own either invariant. A later fresh probe or dropped final carrier can restore the original ambiguity without reddening the named evidence.
The Architectural Reality
ai/services/memory-core/TextEmbeddingService.mjs owns the residency observation and tri-state classification. The observed-negative preflight is the sole never-resident writer; the post-request arm may add evicted-mid-batch only after an observed-positive preflight.
ai/services/knowledge-base/VectorService.mjs carries the bounded classification and cause across the total-outage rethrow.
ai/services/knowledge-base/IngestionService.mjs#embedChunkGroups is the final production writer of the operator-visible error receipt.
test/playwright/unit/ai/services/memory-core/TextEmbeddingService.retry.spec.mjs owns the exact-one-preflight invariant.
test/playwright/unit/ai/services/knowledge-base/embedFailureClassification.spec.mjs already exercises the real embedChunkGroups seam and is the natural owner for the final receipt witness.
The mandatory structure-map command was attempted at ticket creation and failed with Cannot create a string longer than 0x1fffffe8 characters; the existing owner files and sibling tests above provide the placement authority. No new file or directory is prescribed.
The Fix
- Count the installed loaded-model probe in the never-resident control and assert exactly one call.
- Extend the real
embedChunkGroups composition witness so a classified thrown error lands at summary.errors[0].details.residencyDisposition.
- Add the negative control: an unclassified upstream error must leave that details property absent.
- Mutation-prove both seams: an inserted second preflight and a removed final receipt carry must each red their named test.
No production behavior change is expected unless a test exposes a previously hidden defect.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
| loaded-model preflight count |
TextEmbeddingService operation preflight |
exactly one provider observation on the observed-negative arm |
no new probe at failure time |
existing source JSDoc/comments |
never-resident spec asserts probeCount === 1; inserted second call reds |
| ingestion failure receipt |
IngestionService.embedChunkGroups |
carry observed residencyDisposition into summary.errors[].details |
upstream absence remains property absence |
existing receipt comments |
production-path spec asserts present and absent arms; removed carry reds |
Decision Record impact
none — this binds existing repaired behavior and introduces no architectural decision.
Acceptance Criteria
Out of Scope
- Changing residency classification vocabulary or
error.code.
- Adding a fresh provider request after failure.
- Changing retry, timeout, model-loading, or ingestion behavior.
- Claiming live-provider or stuck-runner detection; those remain separate runtime-evidence lanes.
Avoided Traps
- Stopping at
VectorService. That proves the middle carrier, not the receipt an operator reads.
- Treating a serial skip as a green control. A skipped negative is unmeasured, not preserved.
- Source grep as mutation proof. Current source correctness does not establish that future removal turns CI red.
- Adding a second probe to test probe count. The control observes the existing seam; it must never create the behavior it forbids.
Related
- Follow-up to PR #16854.
- Refs #16852 — source contract and repaired production behavior.
- Refs #14154 — broader residency diagnosis remains intentionally open.
Live latest-open sweep: checked the latest 20 open issues and the latest 30 all-state A2A messages at 2026-08-10T08:23:40.801Z; no equivalent ticket or earlier in-flight claim found.
Origin Session ID: 878f05af-2c4e-4da2-a5c2-9e4af666fcb8
Retrieval Hint: query_raw_memories("PR 16854 residencyDisposition exact one preflight IngestionService receipt mutation")
Context
PR #16854 repairs the residency diagnosis chain from
TextEmbeddingServicethroughVectorServiceto the operator-visibleIngestionServicereceipt. Exact-source inspection atd28c7d5ca138099f21fc362f26f9bf93f20c1c5cshows the behavior is correct: an unobserved preflight leavesresidencyDispositionabsent, observed residency followed by loss becomesevicted-mid-batch, and the bounded value reachessummary.errors[].details.Two requested regression proofs remain absent, however. This successor records those proof obligations without holding merge-safe production code in another repair cycle.
The Problem
Two independent production mutations remain green:
TextEmbeddingService.retry.spec.mjssuite still passes 36/36 because the never-resident control installsasync () => []but never counts calls.residencyDispositionspread fromIngestionService.embedChunkGroups. The Vector batch-failure and canonical embed-failure-classification suites still pass 37/37 because the new delivery test stops atVectorService.The implementation therefore has the intended behavior today, but CI does not own either invariant. A later fresh probe or dropped final carrier can restore the original ambiguity without reddening the named evidence.
The Architectural Reality
ai/services/memory-core/TextEmbeddingService.mjsowns the residency observation and tri-state classification. The observed-negative preflight is the solenever-residentwriter; the post-request arm may addevicted-mid-batchonly after an observed-positive preflight.ai/services/knowledge-base/VectorService.mjscarries the bounded classification and cause across the total-outage rethrow.ai/services/knowledge-base/IngestionService.mjs#embedChunkGroupsis the final production writer of the operator-visible error receipt.test/playwright/unit/ai/services/memory-core/TextEmbeddingService.retry.spec.mjsowns the exact-one-preflight invariant.test/playwright/unit/ai/services/knowledge-base/embedFailureClassification.spec.mjsalready exercises the realembedChunkGroupsseam and is the natural owner for the final receipt witness.The mandatory structure-map command was attempted at ticket creation and failed with
Cannot create a string longer than 0x1fffffe8 characters; the existing owner files and sibling tests above provide the placement authority. No new file or directory is prescribed.The Fix
embedChunkGroupscomposition witness so a classified thrown error lands atsummary.errors[0].details.residencyDisposition.No production behavior change is expected unless a test exposes a previously hidden defect.
Contract Ledger Matrix
TextEmbeddingServiceoperation preflightprobeCount === 1; inserted second call redsIngestionService.embedChunkGroupsresidencyDispositionintosummary.errors[].detailsDecision Record impact
none— this binds existing repaired behavior and introduces no architectural decision.Acceptance Criteria
embedChunkGroupsrun carriesevicted-mid-batchtosummary.errors[0].details.residencyDisposition.summary.errors[0].details.residencyDispositionabsent.IngestionServicecarrier makes the production-path witness fail.Out of Scope
error.code.Avoided Traps
VectorService. That proves the middle carrier, not the receipt an operator reads.Related
Live latest-open sweep: checked the latest 20 open issues and the latest 30 all-state A2A messages at 2026-08-10T08:23:40.801Z; no equivalent ticket or earlier in-flight claim found.
Origin Session ID: 878f05af-2c4e-4da2-a5c2-9e4af666fcb8
Retrieval Hint:
query_raw_memories("PR 16854 residencyDisposition exact one preflight IngestionService receipt mutation")